publishport-opencli 1.0.19 → 1.0.21

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 (1042) hide show
  1. package/cli-manifest.json +35 -0
  2. package/clis/12306/me.js +2 -2
  3. package/clis/12306/orders.js +3 -3
  4. package/clis/12306/passengers.js +3 -3
  5. package/clis/12306/price.js +1 -1
  6. package/clis/12306/stations.js +1 -1
  7. package/clis/12306/train.js +1 -1
  8. package/clis/12306/trains.js +1 -1
  9. package/clis/12306/utils.js +1 -1
  10. package/clis/1688/download.js +1 -1
  11. package/clis/1688/item.js +4 -4
  12. package/clis/1688/search.js +4 -4
  13. package/clis/1688/store.js +4 -4
  14. package/clis/1point3acres/forum.js +1 -1
  15. package/clis/1point3acres/forums.js +1 -1
  16. package/clis/1point3acres/notifications.js +1 -1
  17. package/clis/1point3acres/search.js +1 -1
  18. package/clis/1point3acres/thread.js +2 -2
  19. package/clis/1point3acres/user.js +1 -1
  20. package/clis/1point3acres/utils.js +2 -2
  21. package/clis/36kr/article.js +2 -2
  22. package/clis/36kr/hot.js +2 -2
  23. package/clis/36kr/news.js +1 -1
  24. package/clis/36kr/search.js +2 -2
  25. package/clis/51job/company.js +2 -2
  26. package/clis/51job/detail.js +2 -2
  27. package/clis/51job/hot.js +1 -1
  28. package/clis/51job/search.js +1 -1
  29. package/clis/51job/utils.js +7 -7
  30. package/clis/_atlassian/shared.js +9 -9
  31. package/clis/_shared/article/auth.js +4 -4
  32. package/clis/_shared/article/douban-md2draft.js +4 -4
  33. package/clis/_shared/article/format.js +1 -1
  34. package/clis/_shared/article/images.js +7 -7
  35. package/clis/_shared/article/login.js +1 -1
  36. package/clis/_shared/article/publish.js +11 -11
  37. package/clis/_shared/common.js +1 -1
  38. package/clis/_shared/content-guard.js +1 -1
  39. package/clis/_shared/desktop-commands.js +1 -1
  40. package/clis/_shared/file-inject.js +12 -12
  41. package/clis/_shared/self-hosted-sites.js +2 -2
  42. package/clis/_shared/site-auth.js +1 -1
  43. package/clis/_shared/token-auth.js +2 -2
  44. package/clis/_shared/video-publish.js +9 -9
  45. package/clis/amazon/offer.js +3 -3
  46. package/clis/amazon/product.js +5 -5
  47. package/clis/amazon/shared.js +6 -6
  48. package/clis/antigravity/_actions.js +13 -13
  49. package/clis/antigravity/audit-extras.js +10 -10
  50. package/clis/antigravity/delete.js +1 -1
  51. package/clis/antigravity/model.js +6 -6
  52. package/clis/antigravity/new.js +2 -2
  53. package/clis/antigravity/read.js +2 -2
  54. package/clis/antigravity/rename.js +1 -1
  55. package/clis/antigravity/send.js +3 -3
  56. package/clis/antigravity/serve.js +17 -17
  57. package/clis/antigravity/storage.js +6 -6
  58. package/clis/antigravity/watch.js +2 -2
  59. package/clis/apple-podcasts/episodes.js +1 -1
  60. package/clis/apple-podcasts/top.js +1 -1
  61. package/clis/apple-podcasts/utils.js +1 -1
  62. package/clis/archive/item.js +1 -1
  63. package/clis/archive/search.js +1 -1
  64. package/clis/archive/snapshots.js +1 -1
  65. package/clis/archive/wayback.js +1 -1
  66. package/clis/arxiv/author.js +1 -1
  67. package/clis/arxiv/utils.js +1 -1
  68. package/clis/autohome/brand.js +1 -1
  69. package/clis/autohome/score.js +1 -1
  70. package/clis/autohome/utils.js +1 -1
  71. package/clis/baijiahao/article.js +1 -1
  72. package/clis/baijiahao/lists.js +1 -1
  73. package/clis/baijiahao/login.js +1 -1
  74. package/clis/baijiahao/publish.js +9 -9
  75. package/clis/baijiahao/stats.js +1 -1
  76. package/clis/baijiahao/whoami.js +1 -1
  77. package/clis/band/bands.js +2 -2
  78. package/clis/band/mentions.js +2 -2
  79. package/clis/band/post.js +4 -4
  80. package/clis/band/posts.js +3 -3
  81. package/clis/barchart/flow.js +3 -3
  82. package/clis/barchart/greeks.js +2 -2
  83. package/clis/barchart/quote.js +3 -3
  84. package/clis/bbc/news.js +1 -1
  85. package/clis/bbc/topic.js +1 -1
  86. package/clis/bbc/utils.js +1 -1
  87. package/clis/bilibili/article.js +1 -1
  88. package/clis/bilibili/categories.js +1 -1
  89. package/clis/bilibili/coin.js +1 -1
  90. package/clis/bilibili/comment-del.js +1 -1
  91. package/clis/bilibili/comment-like.js +1 -1
  92. package/clis/bilibili/comment.js +1 -1
  93. package/clis/bilibili/comments.js +1 -1
  94. package/clis/bilibili/dm-list.js +1 -1
  95. package/clis/bilibili/dm-read.js +1 -1
  96. package/clis/bilibili/dm-send.js +1 -1
  97. package/clis/bilibili/download.js +2 -2
  98. package/clis/bilibili/drafts.js +1 -1
  99. package/clis/bilibili/dynamic-post.js +3 -3
  100. package/clis/bilibili/favorite-add.js +1 -1
  101. package/clis/bilibili/favorite.js +1 -1
  102. package/clis/bilibili/feed.js +2 -2
  103. package/clis/bilibili/follow.js +1 -1
  104. package/clis/bilibili/following.js +1 -1
  105. package/clis/bilibili/like.js +1 -1
  106. package/clis/bilibili/partitions.js +1 -1
  107. package/clis/bilibili/stats.js +1 -1
  108. package/clis/bilibili/subtitle.js +3 -3
  109. package/clis/bilibili/summary.js +1 -1
  110. package/clis/bilibili/topics.js +1 -1
  111. package/clis/bilibili/unfollow.js +1 -1
  112. package/clis/bilibili/upload.js +1 -1
  113. package/clis/bilibili/utils.js +10 -10
  114. package/clis/bilibili/video-drafts.js +1 -1
  115. package/clis/bilibili/video.js +1 -1
  116. package/clis/bloomberg/businessweek.js +4 -4
  117. package/clis/bloomberg/news.js +2 -2
  118. package/clis/bloomberg/utils.js +13 -13
  119. package/clis/bluesky/post.js +1 -1
  120. package/clis/bluesky/shared.js +11 -11
  121. package/clis/bluesky/whoami.js +1 -1
  122. package/clis/booking/search.js +2 -2
  123. package/clis/boss/accept.js +1 -1
  124. package/clis/boss/applied.js +1 -1
  125. package/clis/boss/auth.js +1 -1
  126. package/clis/boss/batchgreet.js +1 -1
  127. package/clis/boss/bossinfo.js +1 -1
  128. package/clis/boss/chatlist.js +1 -1
  129. package/clis/boss/chatmsg.js +1 -1
  130. package/clis/boss/cities.js +1 -1
  131. package/clis/boss/detail.js +1 -1
  132. package/clis/boss/exchange.js +1 -1
  133. package/clis/boss/greet.js +1 -1
  134. package/clis/boss/interviews.js +1 -1
  135. package/clis/boss/invite.js +1 -1
  136. package/clis/boss/joblist.js +1 -1
  137. package/clis/boss/mark.js +1 -1
  138. package/clis/boss/me.js +2 -2
  139. package/clis/boss/recommend.js +1 -1
  140. package/clis/boss/resumedelete.js +1 -1
  141. package/clis/boss/resumelist.js +1 -1
  142. package/clis/boss/resumeupload.js +11 -11
  143. package/clis/boss/search.js +1 -1
  144. package/clis/boss/send.js +1 -1
  145. package/clis/boss/sendresume.js +1 -1
  146. package/clis/boss/stats.js +1 -1
  147. package/clis/boss/unread.js +1 -1
  148. package/clis/boss/utils.js +13 -13
  149. package/clis/chaoxing/assignments.js +1 -1
  150. package/clis/chaoxing/exams.js +1 -1
  151. package/clis/chaoxing/utils.js +9 -9
  152. package/clis/chatgpt/ask.js +1 -1
  153. package/clis/chatgpt/auth.js +2 -2
  154. package/clis/chatgpt/detail.js +1 -1
  155. package/clis/chatgpt/image.js +1 -1
  156. package/clis/chatgpt/read.js +1 -1
  157. package/clis/chatgpt/send.js +1 -1
  158. package/clis/chatgpt/utils.js +59 -59
  159. package/clis/chatgpt-app/ask.js +1 -1
  160. package/clis/chatgpt-app/send.js +1 -1
  161. package/clis/chatwise/model.js +6 -6
  162. package/clis/chess/analyze.js +1 -1
  163. package/clis/chess/game.js +1 -1
  164. package/clis/chess/games.js +1 -1
  165. package/clis/chess/stats.js +1 -1
  166. package/clis/chess/utils.js +1 -1
  167. package/clis/claude/ask.js +2 -2
  168. package/clis/claude/detail.js +1 -1
  169. package/clis/claude/new.js +1 -1
  170. package/clis/claude/read.js +1 -1
  171. package/clis/claude/send.js +1 -1
  172. package/clis/claude/utils.js +23 -23
  173. package/clis/cnblogs/article.js +1 -1
  174. package/clis/cnblogs/login.js +1 -1
  175. package/clis/cnblogs/stats.js +7 -7
  176. package/clis/cnblogs/whoami.js +1 -1
  177. package/clis/codex/_actions.js +3 -3
  178. package/clis/codex/archive.js +1 -1
  179. package/clis/codex/ask.js +6 -6
  180. package/clis/codex/model.js +8 -8
  181. package/clis/codex/pin.js +1 -1
  182. package/clis/codex/rename.js +4 -4
  183. package/clis/codex/send.js +3 -3
  184. package/clis/codex/sidebar.js +1 -1
  185. package/clis/coingecko/categories.js +1 -1
  186. package/clis/coingecko/coin.js +1 -1
  187. package/clis/coingecko/derivatives.js +1 -1
  188. package/clis/coingecko/exchanges.js +1 -1
  189. package/clis/coingecko/global.js +1 -1
  190. package/clis/coingecko/trending.js +1 -1
  191. package/clis/confluence/search.js +1 -1
  192. package/clis/coupang/product.js +3 -3
  193. package/clis/coupang/utils.js +1 -1
  194. package/clis/crates/crate.js +1 -1
  195. package/clis/crates/search.js +1 -1
  196. package/clis/crates/utils.js +1 -1
  197. package/clis/csdn/article.js +13 -13
  198. package/clis/csdn/columns.js +1 -1
  199. package/clis/csdn/login.js +1 -1
  200. package/clis/csdn/stats.js +4 -4
  201. package/clis/csdn/whoami.js +1 -1
  202. package/clis/cto51/article.js +1 -1
  203. package/clis/cto51/whoami.js +1 -1
  204. package/clis/ctrip/flight.js +2 -2
  205. package/clis/ctrip/hotel-search.js +3 -3
  206. package/clis/ctrip/hotel-suggest.js +1 -1
  207. package/clis/ctrip/search.js +1 -1
  208. package/clis/ctrip/utils.js +6 -6
  209. package/clis/cursor/ask.js +5 -5
  210. package/clis/cursor/composer.js +2 -2
  211. package/clis/cursor/model.js +4 -4
  212. package/clis/cursor/send.js +2 -2
  213. package/clis/dblp/author.js +1 -1
  214. package/clis/dblp/paper.js +1 -1
  215. package/clis/dblp/search.js +1 -1
  216. package/clis/dblp/utils.js +1 -1
  217. package/clis/dblp/venue.js +1 -1
  218. package/clis/deepseek/ask.js +1 -1
  219. package/clis/deepseek/auth.js +2 -2
  220. package/clis/deepseek/detail.js +1 -1
  221. package/clis/deepseek/new.js +1 -1
  222. package/clis/deepseek/read.js +1 -1
  223. package/clis/deepseek/send.js +7 -7
  224. package/clis/deepseek/utils.js +25 -25
  225. package/clis/defillama/protocol.js +1 -1
  226. package/clis/defillama/protocols.js +1 -1
  227. package/clis/defillama/utils.js +1 -1
  228. package/clis/devto/auth.js +2 -2
  229. package/clis/devto/latest.js +1 -1
  230. package/clis/devto/publish.js +5 -5
  231. package/clis/devto/read.js +2 -2
  232. package/clis/devto/stats.js +3 -3
  233. package/clis/dianping/auth.js +2 -2
  234. package/clis/dianping/cityResolver.js +2 -2
  235. package/clis/dianping/search.js +1 -1
  236. package/clis/dianping/shop.js +1 -1
  237. package/clis/dianping/utils.js +1 -1
  238. package/clis/discord-app/delete.js +3 -3
  239. package/clis/discord-app/read.js +1 -1
  240. package/clis/discord-app/thread-read.js +1 -1
  241. package/clis/discord-web/auth.js +2 -2
  242. package/clis/discord-web/send.js +5 -5
  243. package/clis/dockerhub/image.js +1 -1
  244. package/clis/dockerhub/search.js +1 -1
  245. package/clis/dockerhub/utils.js +1 -1
  246. package/clis/dongchedi/koubei.js +1 -1
  247. package/clis/dongchedi/models.js +1 -1
  248. package/clis/dongchedi/score.js +1 -1
  249. package/clis/dongchedi/search.js +1 -1
  250. package/clis/dongchedi/series.js +1 -1
  251. package/clis/dongchedi/specs.js +1 -1
  252. package/clis/dongchedi/utils.js +1 -1
  253. package/clis/douban/article.js +3 -3
  254. package/clis/douban/auth.js +2 -2
  255. package/clis/douban/download.js +1 -1
  256. package/clis/douban/utils.js +23 -23
  257. package/clis/doubao/auth.js +3 -3
  258. package/clis/doubao/utils.js +39 -39
  259. package/clis/doubao-app/ask.js +1 -1
  260. package/clis/doubao-app/utils.js +4 -4
  261. package/clis/douyin/_shared/browser-fetch.js +7 -7
  262. package/clis/douyin/_shared/draft-cache.js +1 -1
  263. package/clis/douyin/_shared/imagex-upload.js +1 -1
  264. package/clis/douyin/_shared/sts2.js +1 -1
  265. package/clis/douyin/_shared/text-extra.js +1 -1
  266. package/clis/douyin/_shared/tos-upload.js +4 -4
  267. package/clis/douyin/_shared/transcode.js +1 -1
  268. package/clis/douyin/_shared/vod-upload.js +4 -4
  269. package/clis/douyin/draft.js +18 -18
  270. package/clis/douyin/drafts.js +1 -1
  271. package/clis/douyin/publish-image.js +12 -12
  272. package/clis/douyin/publish.js +9 -9
  273. package/clis/douyin/search.js +3 -3
  274. package/clis/douyin/videos.js +1 -1
  275. package/clis/eastmoney/_secid.js +1 -1
  276. package/clis/eastmoney/announcement.js +1 -1
  277. package/clis/eastmoney/article.js +1 -1
  278. package/clis/eastmoney/convertible.js +1 -1
  279. package/clis/eastmoney/etf.js +1 -1
  280. package/clis/eastmoney/holders.js +1 -1
  281. package/clis/eastmoney/index-board.js +1 -1
  282. package/clis/eastmoney/kline.js +1 -1
  283. package/clis/eastmoney/kuaixun.js +1 -1
  284. package/clis/eastmoney/longhu.js +1 -1
  285. package/clis/eastmoney/money-flow.js +1 -1
  286. package/clis/eastmoney/northbound.js +1 -1
  287. package/clis/eastmoney/quote.js +1 -1
  288. package/clis/eastmoney/rank.js +1 -1
  289. package/clis/eastmoney/sectors.js +1 -1
  290. package/clis/endoflife/product.js +1 -1
  291. package/clis/endoflife/utils.js +1 -1
  292. package/clis/facebook/comment.js +8 -8
  293. package/clis/facebook/feed.js +4 -4
  294. package/clis/facebook/like.js +5 -5
  295. package/clis/facebook/notifications.js +3 -3
  296. package/clis/facebook/post.js +11 -11
  297. package/clis/facebook/search.js +3 -3
  298. package/clis/flathub/app.js +1 -1
  299. package/clis/flathub/search.js +1 -1
  300. package/clis/flathub/utils.js +1 -1
  301. package/clis/flomo/memos.js +1 -1
  302. package/clis/gemini/deep-research-result.js +4 -4
  303. package/clis/gemini/deep-research.js +1 -1
  304. package/clis/gemini/detail.js +1 -1
  305. package/clis/gemini/history.js +1 -1
  306. package/clis/gemini/image.js +2 -2
  307. package/clis/gemini/status.js +1 -1
  308. package/clis/gemini/utils.js +43 -43
  309. package/clis/geogebra/hexagon.js +1 -1
  310. package/clis/geogebra/info.js +3 -3
  311. package/clis/geogebra/triangle.js +1 -1
  312. package/clis/geogebra/utils.js +11 -11
  313. package/clis/ghost/login.js +1 -1
  314. package/clis/ghost/shared.js +2 -2
  315. package/clis/gitee/auth.js +2 -2
  316. package/clis/github-trending/repos.js +1 -1
  317. package/clis/google/news.js +1 -1
  318. package/clis/google/search.js +2 -2
  319. package/clis/google/suggest.js +1 -1
  320. package/clis/google/trends.js +1 -1
  321. package/clis/google/utils.js +1 -1
  322. package/clis/goproxy/module.js +1 -1
  323. package/clis/goproxy/utils.js +1 -1
  324. package/clis/goproxy/versions.js +1 -1
  325. package/clis/gov-policy/recent.js +2 -2
  326. package/clis/gov-policy/search.js +2 -2
  327. package/clis/grok/ask.js +1 -1
  328. package/clis/grok/detail.js +1 -1
  329. package/clis/grok/image.js +8 -8
  330. package/clis/grok/pin.js +1 -1
  331. package/clis/grok/send.js +1 -1
  332. package/clis/grok/status.js +1 -1
  333. package/clis/grok/utils.js +21 -21
  334. package/clis/guazi/browse.js +1 -1
  335. package/clis/guazi/car.js +1 -1
  336. package/clis/guazi/utils.js +1 -1
  337. package/clis/hackernews/auth.js +2 -2
  338. package/clis/hackernews/comment.js +8 -8
  339. package/clis/hackernews/read.js +7 -7
  340. package/clis/hackernews/submit.js +7 -7
  341. package/clis/hashnode/auth.js +3 -3
  342. package/clis/hashnode/publish.js +14 -14
  343. package/clis/hf/auth.js +2 -2
  344. package/clis/hf/models.js +1 -1
  345. package/clis/hf/paper.js +1 -1
  346. package/clis/hf/spaces.js +1 -1
  347. package/clis/hf/top.js +1 -1
  348. package/clis/homebrew/cask.js +1 -1
  349. package/clis/homebrew/formula.js +1 -1
  350. package/clis/homebrew/popular.js +1 -1
  351. package/clis/homebrew/utils.js +1 -1
  352. package/clis/huodongxing/events.js +1 -1
  353. package/clis/hupu/detail.js +4 -4
  354. package/clis/hupu/hot.js +3 -3
  355. package/clis/hupu/reply.js +1 -1
  356. package/clis/hupu/search.js +1 -1
  357. package/clis/hupu/unlike.js +1 -1
  358. package/clis/hupu/utils.js +10 -10
  359. package/clis/imdb/person.js +2 -2
  360. package/clis/imdb/reviews.js +3 -3
  361. package/clis/imdb/search.js +2 -2
  362. package/clis/imdb/title.js +1 -1
  363. package/clis/imdb/top.js +1 -1
  364. package/clis/imdb/trending.js +1 -1
  365. package/clis/imdb/utils.js +13 -13
  366. package/clis/imooc/article.js +6 -6
  367. package/clis/imooc/login.js +1 -1
  368. package/clis/imooc/whoami.js +1 -1
  369. package/clis/indeed/job.js +2 -2
  370. package/clis/indeed/search.js +2 -2
  371. package/clis/indeed/utils.js +1 -1
  372. package/clis/infoq/article.js +2 -2
  373. package/clis/infoq/login.js +1 -1
  374. package/clis/infoq/whoami.js +1 -1
  375. package/clis/instagram/_shared/private-publish.js +4 -4
  376. package/clis/instagram/_shared/protocol-capture.js +9 -9
  377. package/clis/instagram/detail.js +3 -3
  378. package/clis/instagram/post.js +25 -25
  379. package/clis/instagram/reel.js +18 -18
  380. package/clis/instagram/story.js +4 -4
  381. package/clis/instagram/user.js +2 -2
  382. package/clis/jd/item.js +65 -65
  383. package/clis/jianshu/article.js +1 -1
  384. package/clis/jianshu/login.js +1 -1
  385. package/clis/jianshu/notebooks.js +1 -1
  386. package/clis/jianshu/whoami.js +1 -1
  387. package/clis/jianyu/search.js +6 -6
  388. package/clis/jianyu/shared/procurement-contract.js +1 -1
  389. package/clis/jike/api.js +6 -6
  390. package/clis/jike/auth.js +3 -3
  391. package/clis/jike/comment.js +1 -1
  392. package/clis/jike/create.js +6 -6
  393. package/clis/jike/feed.js +3 -3
  394. package/clis/jike/like.js +1 -1
  395. package/clis/jike/notifications.js +3 -3
  396. package/clis/jike/repost.js +13 -13
  397. package/clis/jike/search.js +3 -3
  398. package/clis/jimeng/auth.js +2 -2
  399. package/clis/jimeng/generate.js +10 -10
  400. package/clis/jira/shared.js +1 -1
  401. package/clis/juejin/article.js +4 -4
  402. package/clis/juejin/categories.js +1 -1
  403. package/clis/juejin/hot.js +1 -1
  404. package/clis/juejin/login.js +1 -1
  405. package/clis/juejin/recommend.js +1 -1
  406. package/clis/juejin/stats.js +3 -3
  407. package/clis/juejin/tags.js +1 -1
  408. package/clis/juejin/utils.js +1 -1
  409. package/clis/juejin/whoami.js +1 -1
  410. package/clis/ke/utils.js +4 -4
  411. package/clis/kimi/_utils.js +7 -7
  412. package/clis/kimi/audit-extras.js +14 -14
  413. package/clis/kimi/auth.js +3 -3
  414. package/clis/kimi/chat.js +15 -15
  415. package/clis/kimi/storage.js +5 -5
  416. package/clis/kimi/ui.js +13 -13
  417. package/clis/kimi/usage.js +3 -3
  418. package/clis/kuaishou/auth.js +1 -1
  419. package/clis/kuaishou/publish.js +6 -6
  420. package/clis/lesswrong/_helpers.js +5 -5
  421. package/clis/lesswrong/comments.js +5 -5
  422. package/clis/lichess/top.js +1 -1
  423. package/clis/lichess/user.js +1 -1
  424. package/clis/lichess/utils.js +1 -1
  425. package/clis/linkedin/comment.js +1 -1
  426. package/clis/linkedin/connect.js +11 -11
  427. package/clis/linkedin/create.js +5 -5
  428. package/clis/linkedin/follow.js +1 -1
  429. package/clis/linkedin/inbox.js +1 -1
  430. package/clis/linkedin/job-detail.js +3 -3
  431. package/clis/linkedin/like.js +1 -1
  432. package/clis/linkedin/notifications.js +1 -1
  433. package/clis/linkedin/people-search.js +1 -1
  434. package/clis/linkedin/post-comments.js +1 -1
  435. package/clis/linkedin/post-detail.js +1 -1
  436. package/clis/linkedin/profile-analytics.js +1 -1
  437. package/clis/linkedin/profile-api.js +13 -13
  438. package/clis/linkedin/profile-experience.js +1 -1
  439. package/clis/linkedin/profile-projects.js +1 -1
  440. package/clis/linkedin/profile-read.js +3 -3
  441. package/clis/linkedin/reply.js +1 -1
  442. package/clis/linkedin/repost.js +1 -1
  443. package/clis/linkedin/safe-send.js +8 -8
  444. package/clis/linkedin/salesnav-inbox.js +5 -5
  445. package/clis/linkedin/salesnav-message.js +3 -3
  446. package/clis/linkedin/salesnav-search.js +4 -4
  447. package/clis/linkedin/salesnav-thread.js +1 -1
  448. package/clis/linkedin/search-api.js +3 -3
  449. package/clis/linkedin/search.js +8 -8
  450. package/clis/linkedin/social-api.js +31 -31
  451. package/clis/linkedin/timeline.js +3 -3
  452. package/clis/linkedin-learning/search.js +2 -2
  453. package/clis/linkedin-learning/trending.js +2 -2
  454. package/clis/linux-do/feed.js +4 -4
  455. package/clis/linux-do/topic-content.js +8 -8
  456. package/clis/lobsters/domain.js +1 -1
  457. package/clis/lobsters/read.js +7 -7
  458. package/clis/maimai/auth.js +2 -2
  459. package/clis/maimai/search-talents.js +4 -4
  460. package/clis/manus/_utils.js +1 -1
  461. package/clis/mastodon/login.js +1 -1
  462. package/clis/mastodon/post.js +1 -1
  463. package/clis/mastodon/shared.js +12 -12
  464. package/clis/mastodon/whoami.js +1 -1
  465. package/clis/maven/artifact.js +1 -1
  466. package/clis/maven/search.js +1 -1
  467. package/clis/maven/utils.js +1 -1
  468. package/clis/mdn/search.js +1 -1
  469. package/clis/medium/article.js +5 -5
  470. package/clis/medium/login.js +1 -1
  471. package/clis/medium/stats.js +3 -3
  472. package/clis/medium/tag.js +1 -1
  473. package/clis/medium/whoami.js +1 -1
  474. package/clis/mubu/notes.js +1 -1
  475. package/clis/mubu/utils.js +15 -15
  476. package/clis/note/auth.js +2 -2
  477. package/clis/note/note-utils.js +2 -2
  478. package/clis/note/publish.js +8 -8
  479. package/clis/notebooklm/add-source.js +8 -8
  480. package/clis/notebooklm/create.js +1 -1
  481. package/clis/notebooklm/generate-slides.js +1 -1
  482. package/clis/notebooklm/notes-get.js +1 -1
  483. package/clis/notebooklm/rpc.js +8 -8
  484. package/clis/notebooklm/source-fulltext.js +1 -1
  485. package/clis/notebooklm/utils.js +10 -10
  486. package/clis/nowcoder/auth.js +2 -2
  487. package/clis/nowcoder/comment.js +1 -1
  488. package/clis/nowcoder/comments.js +1 -1
  489. package/clis/nowcoder/dm-list.js +1 -1
  490. package/clis/nowcoder/dm-read.js +1 -1
  491. package/clis/nowcoder/dm-send.js +1 -1
  492. package/clis/nowcoder/drafts.js +1 -1
  493. package/clis/nowcoder/inbox.js +1 -1
  494. package/clis/nowcoder/like.js +1 -1
  495. package/clis/nowcoder/my.js +1 -1
  496. package/clis/nowcoder/post.js +1 -1
  497. package/clis/nowcoder/utils.js +13 -13
  498. package/clis/npm/downloads.js +1 -1
  499. package/clis/npm/package.js +1 -1
  500. package/clis/npm/search.js +1 -1
  501. package/clis/npm/utils.js +1 -1
  502. package/clis/nuget/package.js +1 -1
  503. package/clis/nuget/search.js +1 -1
  504. package/clis/nuget/utils.js +1 -1
  505. package/clis/nvd/cve.js +1 -1
  506. package/clis/oeis/search.js +1 -1
  507. package/clis/oeis/sequence.js +1 -1
  508. package/clis/oeis/utils.js +1 -1
  509. package/clis/ones/common.js +6 -6
  510. package/clis/ones/enrich-tasks.js +1 -1
  511. package/clis/ones/my-tasks.js +1 -1
  512. package/clis/ones/resolve-labels.js +1 -1
  513. package/clis/ones/task-helpers.js +1 -1
  514. package/clis/ones/task.js +1 -1
  515. package/clis/ones/worklog.js +7 -7
  516. package/clis/openalex/search.js +1 -1
  517. package/clis/openalex/utils.js +1 -1
  518. package/clis/openalex/work.js +1 -1
  519. package/clis/openfda/drug-label.js +1 -1
  520. package/clis/openfda/food-recall.js +1 -1
  521. package/clis/openfda/utils.js +1 -1
  522. package/clis/openreview/author.js +1 -1
  523. package/clis/openreview/paper.js +1 -1
  524. package/clis/openreview/reviews.js +3 -3
  525. package/clis/openreview/search.js +1 -1
  526. package/clis/openreview/utils.js +1 -1
  527. package/clis/openreview/venue.js +1 -1
  528. package/clis/oschina/article.js +1 -1
  529. package/clis/oschina/catalogs.js +1 -1
  530. package/clis/oschina/login.js +1 -1
  531. package/clis/oschina/stats.js +6 -6
  532. package/clis/oschina/whoami.js +1 -1
  533. package/clis/osv/query.js +1 -1
  534. package/clis/osv/utils.js +1 -1
  535. package/clis/osv/vulnerability.js +1 -1
  536. package/clis/packagist/package.js +1 -1
  537. package/clis/packagist/search.js +1 -1
  538. package/clis/packagist/utils.js +1 -1
  539. package/clis/pinterest/api.js +1 -1
  540. package/clis/pinterest/auth.js +1 -1
  541. package/clis/pinterest/boards.js +1 -1
  542. package/clis/pinterest/client.js +6 -6
  543. package/clis/pinterest/publish.js +5 -5
  544. package/clis/pixiv/auth.js +2 -2
  545. package/clis/pixiv/download.js +1 -1
  546. package/clis/pixiv/illusts.js +1 -1
  547. package/clis/pixiv/search.js +1 -1
  548. package/clis/pixiv/utils.js +3 -3
  549. package/clis/powerchina/auth.js +2 -2
  550. package/clis/powerchina/search.js +1 -1
  551. package/clis/producthunt/browse.js +2 -2
  552. package/clis/producthunt/hot.js +2 -2
  553. package/clis/producthunt/posts.js +1 -1
  554. package/clis/producthunt/today.js +1 -1
  555. package/clis/producthunt/utils.js +1 -1
  556. package/clis/pypi/downloads.js +1 -1
  557. package/clis/pypi/package.js +1 -1
  558. package/clis/pypi/utils.js +1 -1
  559. package/clis/qiita/auth.js +1 -1
  560. package/clis/qiita/gql.js +6 -6
  561. package/clis/qiita/publish.js +4 -4
  562. package/clis/qiita/stats.js +4 -4
  563. package/clis/qoder/_utils.js +16 -16
  564. package/clis/qoder/composer.js +1 -1
  565. package/clis/qoder/quest.js +1 -1
  566. package/clis/qoder/ui.js +14 -14
  567. package/clis/quark/auth.js +2 -2
  568. package/clis/quark/utils.js +2 -2
  569. package/clis/quora/answer-comments.js +3 -3
  570. package/clis/quora/create-answer.js +4 -4
  571. package/clis/quora/create-question.js +3 -3
  572. package/clis/quora/shared.js +17 -17
  573. package/clis/quora/whoami.js +1 -1
  574. package/clis/qwen/ask.js +1 -1
  575. package/clis/qwen/auth.js +3 -3
  576. package/clis/qwen/detail.js +1 -1
  577. package/clis/qwen/image.js +5 -5
  578. package/clis/qwen/status.js +1 -1
  579. package/clis/qwen/utils.js +16 -16
  580. package/clis/reddit/home.js +3 -3
  581. package/clis/reddit/read.js +10 -10
  582. package/clis/reddit/reply.js +4 -4
  583. package/clis/reddit/submit.js +11 -11
  584. package/clis/reddit/subreddit-info.js +3 -3
  585. package/clis/reddit/subscribed.js +4 -4
  586. package/clis/reddit/whoami.js +2 -2
  587. package/clis/rednote/comments.js +1 -1
  588. package/clis/rednote/download.js +1 -1
  589. package/clis/rednote/feed.js +1 -1
  590. package/clis/rednote/note.js +1 -1
  591. package/clis/rednote/notifications.js +2 -2
  592. package/clis/rednote/search.js +2 -2
  593. package/clis/rest-countries/country.js +1 -1
  594. package/clis/rest-countries/region.js +1 -1
  595. package/clis/rest-countries/utils.js +1 -1
  596. package/clis/reuters/article-detail.js +1 -1
  597. package/clis/reuters/auth.js +3 -3
  598. package/clis/reuters/search.js +1 -1
  599. package/clis/reuters/utils.js +4 -4
  600. package/clis/rfc/rfc.js +1 -1
  601. package/clis/rfc/utils.js +1 -1
  602. package/clis/rubygems/gem.js +1 -1
  603. package/clis/rubygems/search.js +1 -1
  604. package/clis/rubygems/utils.js +1 -1
  605. package/clis/segmentfault/article.js +3 -3
  606. package/clis/segmentfault/channels.js +1 -1
  607. package/clis/segmentfault/login.js +1 -1
  608. package/clis/segmentfault/stats.js +4 -4
  609. package/clis/segmentfault/tags.js +1 -1
  610. package/clis/segmentfault/whoami.js +1 -1
  611. package/clis/semanticscholar/citations.js +1 -1
  612. package/clis/semanticscholar/paper.js +1 -1
  613. package/clis/semanticscholar/recommendations.js +1 -1
  614. package/clis/semanticscholar/search.js +1 -1
  615. package/clis/semanticscholar/utils.js +1 -1
  616. package/clis/sinafinance/news.js +1 -1
  617. package/clis/sinafinance/stock-rank.js +1 -1
  618. package/clis/sinafinance/stock.js +1 -1
  619. package/clis/slock/attachment-download.js +1 -1
  620. package/clis/slock/attachment-upload.js +7 -7
  621. package/clis/slock/attachment-url.js +1 -1
  622. package/clis/slock/auth-verify.js +1 -1
  623. package/clis/slock/bookmark-add.js +1 -1
  624. package/clis/slock/bookmark-remove.js +1 -1
  625. package/clis/slock/channel-action.js +1 -1
  626. package/clis/slock/channel-create.js +1 -1
  627. package/clis/slock/channel-files.js +1 -1
  628. package/clis/slock/channel-list.js +1 -1
  629. package/clis/slock/channel-mark.js +1 -1
  630. package/clis/slock/channel-members.js +1 -1
  631. package/clis/slock/channel-unarchive.js +1 -1
  632. package/clis/slock/dm-list.js +1 -1
  633. package/clis/slock/errors.js +1 -1
  634. package/clis/slock/in-page.js +28 -28
  635. package/clis/slock/inbox-done.js +5 -5
  636. package/clis/slock/inbox.js +1 -1
  637. package/clis/slock/message-read.js +22 -22
  638. package/clis/slock/message-search.js +10 -10
  639. package/clis/slock/message-send.js +25 -25
  640. package/clis/slock/reaction-add.js +1 -1
  641. package/clis/slock/reaction-remove.js +1 -1
  642. package/clis/slock/resolve.js +1 -1
  643. package/clis/slock/server-list.js +2 -2
  644. package/clis/slock/task-claim.js +4 -4
  645. package/clis/slock/task-convert.js +13 -13
  646. package/clis/slock/task-create.js +1 -1
  647. package/clis/slock/task-delete.js +5 -5
  648. package/clis/slock/task-get.js +5 -5
  649. package/clis/slock/task-list-server.js +4 -4
  650. package/clis/slock/task-list.js +5 -5
  651. package/clis/slock/task-status.js +3 -3
  652. package/clis/slock/task-unclaim.js +3 -3
  653. package/clis/slock/thread-follow.js +1 -1
  654. package/clis/slock/thread-state.js +1 -1
  655. package/clis/slock/unread-summary.js +5 -5
  656. package/clis/slock/whoami.js +1 -1
  657. package/clis/smzdm/search.js +3 -3
  658. package/clis/sohu/article.js +1 -1
  659. package/clis/sohu/attributes.js +1 -1
  660. package/clis/sohu/categories.js +1 -1
  661. package/clis/sohu/channels.js +1 -1
  662. package/clis/sohu/columns.js +1 -1
  663. package/clis/sohu/login.js +1 -1
  664. package/clis/sohu/stats.js +3 -3
  665. package/clis/sohu/topics.js +1 -1
  666. package/clis/sohu/whoami.js +1 -1
  667. package/clis/spotify/spotify.js +1 -1
  668. package/clis/stackoverflow/read.js +6 -6
  669. package/clis/stackoverflow/related.js +1 -1
  670. package/clis/stackoverflow/tag.js +1 -1
  671. package/clis/stackoverflow/user.js +1 -1
  672. package/clis/stackoverflow/utils.js +1 -1
  673. package/clis/steam/app.js +1 -1
  674. package/clis/steam/search.js +1 -1
  675. package/clis/steam/utils.js +1 -1
  676. package/clis/substack/auth.js +2 -2
  677. package/clis/substack/post-utils.js +2 -2
  678. package/clis/substack/publish.js +5 -5
  679. package/clis/suno/auth.js +2 -2
  680. package/clis/suno/download.js +5 -5
  681. package/clis/suno/generate.js +3 -3
  682. package/clis/suno/list.js +1 -1
  683. package/clis/suno/status.js +1 -1
  684. package/clis/suno/utils.js +29 -29
  685. package/clis/telegram/send.js +7 -7
  686. package/clis/telegram/shared.js +2 -2
  687. package/clis/telegram/whoami.js +1 -1
  688. package/clis/test-utils.js +1 -1
  689. package/clis/threads/post.js +23 -23
  690. package/clis/threads/shared.js +3 -3
  691. package/clis/threads/whoami.js +1 -1
  692. package/clis/tieba/hot.js +3 -3
  693. package/clis/tieba/posts.js +1 -1
  694. package/clis/tieba/read.js +2 -2
  695. package/clis/tieba/search.js +3 -3
  696. package/clis/tieba/utils.js +1 -1
  697. package/clis/tiktok/comment.js +2 -2
  698. package/clis/tiktok/creator-videos.js +3 -3
  699. package/clis/tiktok/explore.js +3 -3
  700. package/clis/tiktok/follow.js +8 -8
  701. package/clis/tiktok/following.js +4 -4
  702. package/clis/tiktok/friends.js +7 -7
  703. package/clis/tiktok/live.js +3 -3
  704. package/clis/tiktok/notifications.js +6 -6
  705. package/clis/tiktok/publish.js +16 -16
  706. package/clis/tiktok/unfollow.js +4 -4
  707. package/clis/tiktok/user.js +2 -2
  708. package/clis/tiktok/utils.js +1 -1
  709. package/clis/toutiao/article.js +1 -1
  710. package/clis/toutiao/articles.js +2 -2
  711. package/clis/toutiao/auth.js +2 -2
  712. package/clis/toutiao/hot.js +1 -1
  713. package/clis/toutiao/recommend.js +1 -1
  714. package/clis/toutiao/utils.js +2 -2
  715. package/clis/trae-solo/_actions.js +4 -4
  716. package/clis/trae-solo/_fs.js +5 -5
  717. package/clis/trae-solo/_state.js +2 -2
  718. package/clis/trae-solo/automation.js +4 -4
  719. package/clis/trae-solo/mode.js +4 -4
  720. package/clis/trae-solo/model.js +4 -4
  721. package/clis/trae-solo/renderer-storage.js +4 -4
  722. package/clis/trae-solo/settings.js +1 -1
  723. package/clis/trae-solo/skill-fs.js +1 -1
  724. package/clis/trae-solo/skill.js +12 -12
  725. package/clis/trae-solo/state-fs.js +2 -2
  726. package/clis/trae-solo/task-fs.js +5 -5
  727. package/clis/trae-solo/workspaces-fs.js +1 -1
  728. package/clis/tumblr/auth.js +2 -2
  729. package/clis/tumblr/publish.js +3 -3
  730. package/clis/tvmaze/search.js +1 -1
  731. package/clis/tvmaze/show.js +1 -1
  732. package/clis/tvmaze/utils.js +1 -1
  733. package/clis/twitter/accept.js +7 -7
  734. package/clis/twitter/article.js +7 -7
  735. package/clis/twitter/bookmark-folder.js +3 -3
  736. package/clis/twitter/bookmark-folders.js +3 -3
  737. package/clis/twitter/bookmarks.js +4 -4
  738. package/clis/twitter/delete.js +5 -5
  739. package/clis/twitter/device-follow.js +3 -3
  740. package/clis/twitter/dm-list.js +1 -1
  741. package/clis/twitter/dm-read.js +1 -1
  742. package/clis/twitter/dm-send.js +5 -5
  743. package/clis/twitter/dm-shared.js +3 -3
  744. package/clis/twitter/download.js +6 -6
  745. package/clis/twitter/followers.js +5 -5
  746. package/clis/twitter/following.js +2 -2
  747. package/clis/twitter/like.js +3 -3
  748. package/clis/twitter/likes.js +8 -8
  749. package/clis/twitter/list-add-core.js +9 -9
  750. package/clis/twitter/list-create.js +5 -5
  751. package/clis/twitter/list-remove-core.js +9 -9
  752. package/clis/twitter/list-tweets.js +7 -7
  753. package/clis/twitter/lists.js +6 -6
  754. package/clis/twitter/notifications.js +2 -2
  755. package/clis/twitter/post.js +24 -24
  756. package/clis/twitter/profile.js +7 -7
  757. package/clis/twitter/quote.js +7 -7
  758. package/clis/twitter/reply-dm.js +7 -7
  759. package/clis/twitter/reply.js +12 -12
  760. package/clis/twitter/retweet.js +3 -3
  761. package/clis/twitter/scheduled-delete.js +3 -3
  762. package/clis/twitter/scheduled-list.js +2 -2
  763. package/clis/twitter/scheduled-utils.js +3 -3
  764. package/clis/twitter/search.js +5 -5
  765. package/clis/twitter/shared.js +6 -6
  766. package/clis/twitter/thread.js +4 -4
  767. package/clis/twitter/timeline.js +3 -3
  768. package/clis/twitter/trending.js +2 -2
  769. package/clis/twitter/tweets.js +11 -11
  770. package/clis/twitter/unlike.js +3 -3
  771. package/clis/twitter/unretweet.js +3 -3
  772. package/clis/twitter/utils.js +6 -6
  773. package/clis/upwork/detail.js +2 -2
  774. package/clis/upwork/feed.js +2 -2
  775. package/clis/upwork/search.js +2 -2
  776. package/clis/upwork/utils.js +1 -1
  777. package/clis/v2ex/auth.js +2 -2
  778. package/clis/v2ex/daily.js +3 -3
  779. package/clis/v2ex/me.js +2 -2
  780. package/clis/v2ex/notifications.js +2 -2
  781. package/clis/vk/post.js +1 -1
  782. package/clis/vk/shared.js +2 -2
  783. package/clis/vk/whoami.js +1 -1
  784. package/clis/web/read.js +8 -8
  785. package/clis/wechat-channels/auth.js +2 -2
  786. package/clis/wechat-channels/publish.js +30 -30
  787. package/clis/weibo/article.js +1 -1
  788. package/clis/weibo/auth.js +3 -3
  789. package/clis/weibo/comments.js +1 -1
  790. package/clis/weibo/delete.js +2 -2
  791. package/clis/weibo/feed.js +3 -3
  792. package/clis/weibo/hot.js +1 -1
  793. package/clis/weibo/publish.js +10 -10
  794. package/clis/weibo/search.js +2 -2
  795. package/clis/weibo/user-posts.js +3 -3
  796. package/clis/weibo/user.js +2 -2
  797. package/clis/weibo/utils.js +3 -3
  798. package/clis/weixin/article.js +1 -1
  799. package/clis/weixin/create-draft.js +26 -26
  800. package/clis/weixin/download.js +2 -2
  801. package/clis/weixin/login.js +1 -1
  802. package/clis/weixin/search.js +2 -2
  803. package/clis/weixin/stats.js +3 -3
  804. package/clis/weixin/whoami.js +1 -1
  805. package/clis/weread/ai-outline.js +2 -2
  806. package/clis/weread/book-search.js +2 -2
  807. package/clis/weread/book.js +2 -2
  808. package/clis/weread/notebooks.js +1 -1
  809. package/clis/weread/search.js +1 -1
  810. package/clis/weread/shelf.js +1 -1
  811. package/clis/weread/utils.js +6 -6
  812. package/clis/weread-official/book.js +1 -1
  813. package/clis/weread-official/discover.js +1 -1
  814. package/clis/weread-official/list-apis.js +1 -1
  815. package/clis/weread-official/notes.js +1 -1
  816. package/clis/weread-official/readdata.js +1 -1
  817. package/clis/weread-official/review.js +1 -1
  818. package/clis/weread-official/search.js +1 -1
  819. package/clis/weread-official/shelf.js +1 -1
  820. package/clis/weread-official/utils.js +1 -1
  821. package/clis/wikidata/entity.js +1 -1
  822. package/clis/wikidata/search.js +1 -1
  823. package/clis/wikidata/utils.js +1 -1
  824. package/clis/wikipedia/page.js +1 -1
  825. package/clis/wikipedia/trending.js +1 -1
  826. package/clis/wikipedia/utils.js +1 -1
  827. package/clis/wordpress/login.js +1 -1
  828. package/clis/wordpress/publish.js +1 -1
  829. package/clis/wordpress/shared.js +3 -3
  830. package/clis/wordpress/whoami.js +1 -1
  831. package/clis/woshipm/article.js +1 -1
  832. package/clis/woshipm/login.js +1 -1
  833. package/clis/woshipm/stats.js +4 -4
  834. package/clis/woshipm/whoami.js +1 -1
  835. package/clis/wttr/current.js +1 -1
  836. package/clis/wttr/forecast.js +1 -1
  837. package/clis/wttr/utils.js +1 -1
  838. package/clis/xianyu/collect.js +1 -1
  839. package/clis/xianyu/inbox.js +1 -1
  840. package/clis/xianyu/item-stats.js +2 -2
  841. package/clis/xianyu/location.js +1 -1
  842. package/clis/xianyu/manage.js +1 -1
  843. package/clis/xianyu/messages.js +1 -1
  844. package/clis/xianyu/mtop.js +5 -5
  845. package/clis/xianyu/order.js +1 -1
  846. package/clis/xianyu/promote-stats.js +2 -2
  847. package/clis/xianyu/publish.js +17 -17
  848. package/clis/xianyu/rate.js +1 -1
  849. package/clis/xianyu/reply.js +1 -1
  850. package/clis/xianyu/search.js +8 -8
  851. package/clis/xianyu/seller-data.js +1 -1
  852. package/clis/xianyu/seller-list.js +1 -1
  853. package/clis/xianyu/user.js +1 -1
  854. package/clis/xiaoe/catalog.js +2 -2
  855. package/clis/xiaoe/content.js +2 -2
  856. package/clis/xiaoe/courses.js +2 -2
  857. package/clis/xiaohongshu/ask.js +6 -6
  858. package/clis/xiaohongshu/comments.js +6 -6
  859. package/clis/xiaohongshu/creator-note-detail.js +7 -7
  860. package/clis/xiaohongshu/creator-notes-summary.js +1 -1
  861. package/clis/xiaohongshu/creator-notes.js +13 -13
  862. package/clis/xiaohongshu/creator-profile.js +2 -2
  863. package/clis/xiaohongshu/creator-stats.js +2 -2
  864. package/clis/xiaohongshu/delete-note.js +7 -7
  865. package/clis/xiaohongshu/download.js +4 -4
  866. package/clis/xiaohongshu/feed.js +2 -2
  867. package/clis/xiaohongshu/follow.js +3 -3
  868. package/clis/xiaohongshu/human.js +3 -3
  869. package/clis/xiaohongshu/note-helpers.js +1 -1
  870. package/clis/xiaohongshu/note.js +2 -2
  871. package/clis/xiaohongshu/notifications.js +1 -1
  872. package/clis/xiaohongshu/publish-video.js +8 -8
  873. package/clis/xiaohongshu/publish.js +59 -59
  874. package/clis/xiaohongshu/search.js +8 -8
  875. package/clis/xiaohongshu/unfollow.js +4 -4
  876. package/clis/xiaohongshu/user-helpers.js +1 -1
  877. package/clis/xiaohongshu/user.js +2 -2
  878. package/clis/xiaoyuzhou/auth.js +3 -3
  879. package/clis/xiaoyuzhou/download.js +1 -1
  880. package/clis/xiaoyuzhou/utils.js +1 -1
  881. package/clis/xueqiu/article.js +4 -4
  882. package/clis/xueqiu/comments.js +4 -4
  883. package/clis/xueqiu/danjuan-utils.js +4 -4
  884. package/clis/xueqiu/earnings-date.js +1 -1
  885. package/clis/xueqiu/events.js +3 -3
  886. package/clis/xueqiu/hashtags.js +3 -3
  887. package/clis/xueqiu/stocks.js +3 -3
  888. package/clis/xueqiu/users.js +3 -3
  889. package/clis/xueqiu/utils.js +3 -3
  890. package/clis/yahoo-finance/quote.js +1 -1
  891. package/clis/yollomi/background.js +1 -1
  892. package/clis/yollomi/edit.js +1 -1
  893. package/clis/yollomi/face-swap.js +1 -1
  894. package/clis/yollomi/generate.js +1 -1
  895. package/clis/yollomi/object-remover.js +1 -1
  896. package/clis/yollomi/remove-bg.js +1 -1
  897. package/clis/yollomi/restore.js +1 -1
  898. package/clis/yollomi/try-on.js +1 -1
  899. package/clis/yollomi/upload.js +4 -4
  900. package/clis/yollomi/upscale.js +1 -1
  901. package/clis/yollomi/utils.js +4 -4
  902. package/clis/yollomi/video.js +1 -1
  903. package/clis/youtube/channel.js +4 -4
  904. package/clis/youtube/feed.js +2 -2
  905. package/clis/youtube/like.js +5 -5
  906. package/clis/youtube/playlist.js +7 -7
  907. package/clis/youtube/publish.js +11 -11
  908. package/clis/youtube/search.js +3 -3
  909. package/clis/youtube/subscribe.js +7 -7
  910. package/clis/youtube/subscriptions.js +1 -1
  911. package/clis/youtube/transcript-group.js +2 -2
  912. package/clis/youtube/transcript.js +13 -13
  913. package/clis/youtube/unlike.js +5 -5
  914. package/clis/youtube/unsubscribe.js +7 -7
  915. package/clis/youtube/utils.js +3 -3
  916. package/clis/youtube/video.js +4 -4
  917. package/clis/youtube/watch-later.js +2 -2
  918. package/clis/yuanbao/ask.js +18 -18
  919. package/clis/yuanbao/detail.js +1 -1
  920. package/clis/yuanbao/read.js +1 -1
  921. package/clis/yuanbao/shared.js +9 -9
  922. package/clis/yuanbao/status.js +1 -1
  923. package/clis/yuque/article.js +1 -1
  924. package/clis/yuque/whoami.js +1 -1
  925. package/clis/zhihu/answer-comments.js +2 -2
  926. package/clis/zhihu/answer-detail.js +3 -3
  927. package/clis/zhihu/answer.js +1 -1
  928. package/clis/zhihu/article-transform.js +1 -1
  929. package/clis/zhihu/article.js +1 -1
  930. package/clis/zhihu/auth.js +2 -2
  931. package/clis/zhihu/collection.js +3 -3
  932. package/clis/zhihu/collections.js +3 -3
  933. package/clis/zhihu/download.js +2 -2
  934. package/clis/zhihu/image-profile.js +6 -6
  935. package/clis/zhihu/paginate.js +3 -3
  936. package/clis/zhihu/pin.js +4 -4
  937. package/clis/zhihu/question.js +3 -3
  938. package/clis/zhihu/recommend.js +3 -3
  939. package/clis/zhihu/search.js +3 -3
  940. package/clis/zhihu/stats.js +3 -3
  941. package/clis/zhihu/user-arg.js +1 -1
  942. package/clis/zhihu/write-shared.js +7 -7
  943. package/clis/zlibrary/utils.js +6 -6
  944. package/clis/zsxq/auth.js +3 -3
  945. package/clis/zsxq/search.js +1 -1
  946. package/clis/zsxq/topic.js +1 -1
  947. package/clis/zsxq/utils.js +5 -5
  948. package/dist/src/adapter-source.js +1 -1
  949. package/dist/src/browser/analyze.js +1 -1
  950. package/dist/src/browser/article-extract.js +2 -2
  951. package/dist/src/browser/ax-snapshot.js +2 -2
  952. package/dist/src/browser/base-page.js +25 -25
  953. package/dist/src/browser/bridge.js +1 -1
  954. package/dist/src/browser/cdp.js +1 -1
  955. package/dist/src/browser/daemon-client.js +1 -1
  956. package/dist/src/browser/daemon-lifecycle.js +7 -7
  957. package/dist/src/browser/dom-helpers.js +35 -35
  958. package/dist/src/browser/dom-snapshot.js +19 -19
  959. package/dist/src/browser/errors.js +3 -3
  960. package/dist/src/browser/extract.js +5 -5
  961. package/dist/src/browser/find.js +13 -13
  962. package/dist/src/browser/fingerprint.js +2 -2
  963. package/dist/src/browser/html-tree.js +6 -6
  964. package/dist/src/browser/managed-chrome.js +1 -1
  965. package/dist/src/browser/network-cache.js +1 -1
  966. package/dist/src/browser/network-key.js +1 -1
  967. package/dist/src/browser/page.js +7 -7
  968. package/dist/src/browser/profile.js +2 -2
  969. package/dist/src/browser/proxy-test.js +8 -8
  970. package/dist/src/browser/shape-filter.js +1 -1
  971. package/dist/src/browser/shape.js +1 -1
  972. package/dist/src/browser/stealth.js +3 -3
  973. package/dist/src/browser/tabs.js +2 -2
  974. package/dist/src/browser/target-errors.js +1 -1
  975. package/dist/src/browser/target-resolver.js +23 -23
  976. package/dist/src/browser/trace.js +2 -2
  977. package/dist/src/browser/utils.js +1 -1
  978. package/dist/src/browser/verify-fixture.js +2 -2
  979. package/dist/src/browser-session-lock.js +1 -1
  980. package/dist/src/build-manifest.js +11 -11
  981. package/dist/src/capabilityRouting.js +1 -1
  982. package/dist/src/cli-argv-preprocess.js +1 -1
  983. package/dist/src/cli.js +32 -32
  984. package/dist/src/commanderAdapter.js +3 -3
  985. package/dist/src/commands/auth.js +3 -3
  986. package/dist/src/commands/daemon.js +1 -1
  987. package/dist/src/completion-fast.js +1 -1
  988. package/dist/src/completion.js +1 -1
  989. package/dist/src/constants.js +1 -1
  990. package/dist/src/convention-audit.js +2 -2
  991. package/dist/src/daemon-utils.js +1 -1
  992. package/dist/src/daemon.js +1 -1
  993. package/dist/src/discovery.js +2 -2
  994. package/dist/src/doctor.js +9 -9
  995. package/dist/src/download/article-download.js +15 -15
  996. package/dist/src/download/index.js +4 -4
  997. package/dist/src/download/media-download.js +1 -1
  998. package/dist/src/download/progress.js +3 -3
  999. package/dist/src/electron-apps.js +1 -1
  1000. package/dist/src/errors.js +2 -2
  1001. package/dist/src/execution.js +2 -2
  1002. package/dist/src/external.js +1 -1
  1003. package/dist/src/help.js +8 -8
  1004. package/dist/src/hooks.js +1 -1
  1005. package/dist/src/interceptor.js +21 -21
  1006. package/dist/src/launcher.js +7 -7
  1007. package/dist/src/logger.js +8 -8
  1008. package/dist/src/main.js +7 -7
  1009. package/dist/src/observation/artifact.js +5 -5
  1010. package/dist/src/observation/retention.js +1 -1
  1011. package/dist/src/output.js +2 -2
  1012. package/dist/src/package-paths.js +1 -1
  1013. package/dist/src/pipeline/executor.js +1 -1
  1014. package/dist/src/pipeline/registry.js +1 -1
  1015. package/dist/src/pipeline/steps/browser.js +1 -1
  1016. package/dist/src/pipeline/steps/download.js +1 -1
  1017. package/dist/src/pipeline/steps/fetch.js +6 -6
  1018. package/dist/src/pipeline/steps/intercept.js +1 -1
  1019. package/dist/src/pipeline/steps/tap.js +17 -17
  1020. package/dist/src/pipeline/steps/transform.js +1 -1
  1021. package/dist/src/pipeline/template.js +1 -1
  1022. package/dist/src/plugin-manifest.js +1 -1
  1023. package/dist/src/plugin-scaffold.js +19 -19
  1024. package/dist/src/plugin.js +12 -12
  1025. package/dist/src/rate-limit.js +1 -1
  1026. package/dist/src/registry.js +1 -1
  1027. package/dist/src/runtime-detect.js +1 -1
  1028. package/dist/src/runtime.js +1 -1
  1029. package/dist/src/scripts/framework.js +1 -1
  1030. package/dist/src/scripts/interact.js +1 -1
  1031. package/dist/src/scripts/store.js +1 -1
  1032. package/dist/src/serialization.js +2 -2
  1033. package/dist/src/session-lease.js +1 -1
  1034. package/dist/src/snapshotFormatter.js +2 -2
  1035. package/dist/src/tui.js +12 -12
  1036. package/dist/src/user-runtime.js +1 -1
  1037. package/dist/src/utils.d.ts +12 -0
  1038. package/dist/src/utils.js +4 -4
  1039. package/dist/src/validate.js +2 -2
  1040. package/dist/src/verify.js +2 -2
  1041. package/dist/src/version.js +1 -1
  1042. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,AuthRequiredError as I,CommandExecutionError as M}from"@jackwener/opencli/errors";import{cli as S,Strategy as F}from"@jackwener/opencli/registry";import{setInputFiles as f}from"../_shared/file-inject.js";const R=new Set([".jpg",".jpeg",".png",".webp"]),V=9,W=["全新","几乎全新","轻微使用","明显使用","老旧"];function X(){return"https://www.goofish.com/publish"}async function Y(j){if(j.getCurrentUrl)try{const B=await j.getCurrentUrl();if(B)return B}catch{}return X()}function O(j,B){const q=String(j??"").replace(/\s+/g," ").trim();if(!q)throw new L(`xianyu publish ${B} cannot be empty`);return q}function x(j,B){if(j==null||String(j).trim()==="")return null;const q=String(j).trim();if(!/^\d+(?:\.\d{1,2})?$/.test(q))throw new L(`xianyu publish ${B} must be a positive price with at most 2 decimals`);const G=Number(q);if(!Number.isFinite(G)||G<=0)throw new L(`xianyu publish ${B} must be a positive price`);return q}function v(j){const B=O(j,"condition");if(!W.includes(B))throw new L(`xianyu publish condition must be one of: ${W.join(", ")}`);return B}function y(j){if(!j)return[];const B=String(j).split(",").map((q)=>q.trim()).filter(Boolean);if(B.length===0)return[];if(B.length>V)throw new L(`xianyu publish images supports at most ${V} files`);return B.map((q)=>{const G=C.resolve(q),J=C.extname(G).toLowerCase();if(!R.has(J))throw new L(`Unsupported image format "${J}". Supported: jpg, jpeg, png, webp`);const K=z.statSync(G,{throwIfNoEntry:!1});if(!K||!K.isFile())throw new L(`Not a valid image file: ${G}`);return G})}function P(j){const B=x(j.price,"price");if(B==null)throw new L("xianyu publish price cannot be empty");const q={};q.title=O(j.title,"title");q.description=O(j.description,"description");q.price=B;q.condition=v(j.condition);q.category=O(j.category,"category");q.original_price=x(j.original_price,"original_price");q.location=j.location?O(j.location,"location"):"";q.images=y(j.images);return q}function Z(j){return`
1
+ import*as T from"node:fs";import*as S from"node:path";import{ArgumentError as a,AuthRequiredError as P,CommandExecutionError as c}from"@jackwener/opencli/errors";import{cli as N,Strategy as C}from"@jackwener/opencli/registry";import{setInputFiles as M}from"../_shared/file-inject.js";const _=new Set([".jpg",".jpeg",".png",".webp"]),m=9,f=["全新","几乎全新","轻微使用","明显使用","老旧"];function h(){return"https://www.goofish.com/publish"}async function w(t){if(t.getCurrentUrl)try{const n=await t.getCurrentUrl();if(n)return n}catch{}return h()}function u(t,n){const e=String(t??"").replace(/\s+/g," ").trim();if(!e)throw new a(`xianyu publish ${n} cannot be empty`);return e}function x(t,n){if(t==null||String(t).trim()==="")return null;const e=String(t).trim();if(!/^\d+(?:\.\d{1,2})?$/.test(e))throw new a(`xianyu publish ${n} must be a positive price with at most 2 decimals`);const o=Number(e);if(!Number.isFinite(o)||o<=0)throw new a(`xianyu publish ${n} must be a positive price`);return e}function j(t){const n=u(t,"condition");if(!f.includes(n))throw new a(`xianyu publish condition must be one of: ${f.join(", ")}`);return n}function E(t){if(!t)return[];const n=String(t).split(",").map((e)=>e.trim()).filter(Boolean);if(n.length===0)return[];if(n.length>m)throw new a(`xianyu publish images supports at most ${m} files`);return n.map((e)=>{const o=S.resolve(e),s=S.extname(o).toLowerCase();if(!_.has(s))throw new a(`Unsupported image format "${s}". Supported: jpg, jpeg, png, webp`);const l=T.statSync(o,{throwIfNoEntry:!1});if(!l||!l.isFile())throw new a(`Not a valid image file: ${o}`);return o})}function k(t){const n=x(t.price,"price");if(n==null)throw new a("xianyu publish price cannot be empty");const e={};e.title=u(t.title,"title");e.description=u(t.description,"description");e.price=n;e.condition=j(t.condition);e.category=u(t.category,"category");e.original_price=x(t.original_price,"original_price");e.location=t.location?u(t.location,"location"):"";e.images=E(t.images);return e}function b(t){return`
2
2
  (() => {
3
3
  const clean = (value) => String(value ?? '').replace(/\\s+/g, ' ').trim();
4
4
 
@@ -12,7 +12,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
12
12
  || Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value')?.set;
13
13
  if (setter) {
14
14
  titleInput.focus();
15
- setter.call(titleInput, ${JSON.stringify(j.title)});
15
+ setter.call(titleInput, ${JSON.stringify(t.title)});
16
16
  titleInput.dispatchEvent(new Event('input', { bubbles: true }));
17
17
  titleInput.dispatchEvent(new Event('change', { bubbles: true }));
18
18
  filled.push('title');
@@ -26,7 +26,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
26
26
  const setter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value')?.set;
27
27
  if (setter) {
28
28
  descInput.focus();
29
- setter.call(descInput, ${JSON.stringify(j.description)});
29
+ setter.call(descInput, ${JSON.stringify(t.description)});
30
30
  descInput.dispatchEvent(new Event('input', { bubbles: true }));
31
31
  descInput.dispatchEvent(new Event('change', { bubbles: true }));
32
32
  filled.push('description');
@@ -40,7 +40,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
40
40
  const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
41
41
  if (setter) {
42
42
  priceInput.focus();
43
- setter.call(priceInput, ${JSON.stringify(String(j.price))});
43
+ setter.call(priceInput, ${JSON.stringify(String(t.price))});
44
44
  priceInput.dispatchEvent(new Event('input', { bubbles: true }));
45
45
  priceInput.dispatchEvent(new Event('change', { bubbles: true }));
46
46
  filled.push('price');
@@ -49,13 +49,13 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
49
49
  if (!filled.includes('price')) missing.push('price');
50
50
 
51
51
  // 4. 填原价(可选)
52
- ${j.original_price?`
52
+ ${t.original_price?`
53
53
  const originalPriceInput = document.querySelector('input[id*="original"], input[placeholder*="原价"], input[class*="original"]');
54
54
  if (originalPriceInput) {
55
55
  const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
56
56
  if (setter) {
57
57
  originalPriceInput.focus();
58
- setter.call(originalPriceInput, ${JSON.stringify(String(j.original_price))});
58
+ setter.call(originalPriceInput, ${JSON.stringify(String(t.original_price))});
59
59
  originalPriceInput.dispatchEvent(new Event('input', { bubbles: true }));
60
60
  originalPriceInput.dispatchEvent(new Event('change', { bubbles: true }));
61
61
  filled.push('original_price');
@@ -64,13 +64,13 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
64
64
  `:""}
65
65
 
66
66
  // 5. 填地址(可选)
67
- ${j.location?`
67
+ ${t.location?`
68
68
  const locationInput = document.querySelector('input[id*="location"], input[placeholder*="地"], input[class*="location"]');
69
69
  if (locationInput) {
70
70
  const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
71
71
  if (setter) {
72
72
  locationInput.focus();
73
- setter.call(locationInput, ${JSON.stringify(j.location)});
73
+ setter.call(locationInput, ${JSON.stringify(t.location)});
74
74
  locationInput.dispatchEvent(new Event('input', { bubbles: true }));
75
75
  locationInput.dispatchEvent(new Event('change', { bubbles: true }));
76
76
  filled.push('location');
@@ -79,8 +79,8 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
79
79
  `:""}
80
80
 
81
81
  // 6. 选择成色(点击对应按钮)
82
- if (${JSON.stringify(j.condition)}) {
83
- const condition = ${JSON.stringify(j.condition)};
82
+ if (${JSON.stringify(t.condition)}) {
83
+ const condition = ${JSON.stringify(t.condition)};
84
84
  const conditionMap = {
85
85
  '全新': ['全新', '全新未使用', 'new'],
86
86
  '几乎全新': ['几乎全新', '几乎全新无瑕疵', 'like-new'],
@@ -103,7 +103,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
103
103
 
104
104
  return { ok: missing.length === 0, filled, missing };
105
105
  })()
106
- `}function _(j){return`
106
+ `}function g(t){return`
107
107
  (async () => {
108
108
  const clean = (value) => String(value ?? '').replace(/\\s+/g, ' ').trim();
109
109
 
@@ -129,7 +129,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
129
129
  };
130
130
 
131
131
  // 在分类弹窗中搜索并点击
132
- const searchKeyword = ${JSON.stringify(j)};
132
+ const searchKeyword = ${JSON.stringify(t)};
133
133
  const hasMatch = await waitFor(() => {
134
134
  const allNodes = Array.from(document.querySelectorAll('button, [class*="item"], [class*="node"], [role="option"]'));
135
135
  return allNodes.some((el) => clean(el.textContent || '').includes(searchKeyword));
@@ -147,7 +147,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
147
147
  }
148
148
  return { ok: false, reason: 'category-match-failed' };
149
149
  })()
150
- `}function $(){return`
150
+ `}function y(){return`
151
151
  (() => {
152
152
  // 找图片上传相关的 file input
153
153
  const fileInput = document.querySelector('input[type="file"]');
@@ -162,7 +162,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
162
162
 
163
163
  return { ok: true, selector, hasMultiple: fileInput.multiple };
164
164
  })()
165
- `}function E(){return`
165
+ `}function q(){return`
166
166
  (() => {
167
167
  const clean = (value) => String(value ?? '').replace(/\\s+/g, ' ').trim();
168
168
 
@@ -181,7 +181,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
181
181
  submitBtn.click();
182
182
  return { ok: true };
183
183
  })()
184
- `}function U(){return`
184
+ `}function A(){return`
185
185
  (() => {
186
186
  const clean = (value) => String(value ?? '').replace(/\\s+/g, ' ').trim();
187
187
  const bodyText = document.body?.innerText || '';
@@ -209,7 +209,7 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
209
209
 
210
210
  return { ok: false, reason: 'unknown-state' };
211
211
  })()
212
- `}function h(){return`
212
+ `}function O(){return`
213
213
  (() => {
214
214
  const clean = (value) => String(value ?? '').replace(/\\s+/g, ' ').trim();
215
215
  const bodyText = document.body?.innerText || '';
@@ -242,4 +242,4 @@ import*as z from"node:fs";import*as C from"node:path";import{ArgumentError as L,
242
242
  bodySnippet: bodyText.slice(0, 500),
243
243
  };
244
244
  })()
245
- `}export const publishCommand=S({site:"xianyu",name:"publish",access:"write",description:"发布闲鱼宝贝(需先在浏览器中登录闲鱼)",domain:"www.goofish.com",strategy:F.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"title",required:!0,positional:!0,help:"商品标题"},{name:"description",fromFile:!0,required:!0,positional:!0,help:"商品描述/详情"},{name:"price",required:!0,positional:!0,type:"float",help:"出售价格(元)"},{name:"condition",required:!0,positional:!0,help:"成色:全新 / 几乎全新 / 轻微使用 / 明显使用 / 老旧"},{name:"category",required:!0,positional:!0,help:"商品分类关键词(如:手机、衣服、图书)"},{name:"original_price",type:"float",help:"原价(选填,用于显示折扣)"},{name:"location",help:"所在地区(选填,如:杭州)"},{name:"images",help:"本地图片路径,多张用逗号分隔(选填,如:/tmp/a.jpg,/tmp/b.jpg)"}],columns:["status","item_id","title","price","condition","url","message"],func:async(j,B)=>{const q=P(B);await j.goto(X());await j.wait(3);let G=await j.evaluate(h());for(let A=0;A<30;A++){if(G?.requiresAuth||G?.hasPublishForm)break;await j.wait(0.5);G=await j.evaluate(h())}if(G?.requiresAuth)throw new I("www.goofish.com","发布闲鱼需要先登录,请在 Chrome 中打开 goofish.com 并完成登录");if(!G?.hasPublishForm)throw new M("Xianyu publish form was not detected","Confirm goofish.com is logged in and the publish page finished loading.");let J=await j.evaluate(_(q.category));for(let A=0;A<30;A++){if(J?.ok||J?.reason!=="category-trigger-not-found")break;await j.wait(0.5);J=await j.evaluate(_(q.category))}if(!J?.ok)throw new M(`Xianyu category selection failed: ${J?.reason||"unknown-reason"}`);await j.wait(1.5);let K=await j.evaluate(Z(q));for(let A=0;A<30;A++){if(K?.ok)break;await j.wait(0.5);K=await j.evaluate(Z(q))}if(!K?.ok){const A=Array.isArray(K?.missing)?K.missing.join(", "):"unknown";throw new M(`Xianyu publish form fill failed; missing fields: ${A}`)}await j.wait(1);if(q.images.length>0){let A=await j.evaluate($());for(let H=0;H<30;H++){if(A?.ok)break;await j.wait(0.5);A=await j.evaluate($())}if(!A?.ok)throw new M(`Xianyu image upload input was not found: ${A?.reason||"unknown-reason"}`);try{await f(j,A.selector||'input[type="file"]',q.images);await j.wait(3)}catch(H){throw new M(`Xianyu image upload failed: ${H?.message||H}`)}}let Q=await j.evaluate(E());for(let A=0;A<30;A++){if(Q?.ok)break;await j.wait(0.5);Q=await j.evaluate(E())}if(!Q?.ok)throw new M(`Xianyu publish submit failed: ${Q?.reason||"unknown-reason"}`);await j.wait(2);let D="",T=await Y(j),N="";for(let A=0;A<10;A++){await j.wait(1.5);const H=await j.evaluate(U());T=await Y(j);if(H?.status==="published"){D=String(H.item_id||"").replace(/\D/g,"");return[{status:"published",item_id:D,title:q.title.slice(0,50),price:`¥${q.price}`,condition:q.condition,url:H.url||T,message:"发布成功"}]}if(H?.status==="failed"){N=H.message||"发布失败";break}}throw new M(N||"Xianyu publish result was not confirmed before timeout",`Open ${T} and verify whether the listing was published.`)}}),__test__={CONDITION_CHOICES:W,MAX_IMAGES:V,validateImagePaths:y,normalizePublishArgs:P,buildPublishUrl:X,getCurrentPageUrl:Y,buildFillFormEvaluate:Z,buildSelectCategoryEvaluate:_,buildFindFileInputSelectorEvaluate:$,buildDetectSuccessEvaluate:U};
245
+ `}export const publishCommand=N({site:"xianyu",name:"publish",access:"write",description:"发布闲鱼宝贝(需先在浏览器中登录闲鱼)",domain:"www.goofish.com",strategy:C.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"title",required:!0,positional:!0,help:"商品标题"},{name:"description",fromFile:!0,required:!0,positional:!0,help:"商品描述/详情"},{name:"price",required:!0,positional:!0,type:"float",help:"出售价格(元)"},{name:"condition",required:!0,positional:!0,help:"成色:全新 / 几乎全新 / 轻微使用 / 明显使用 / 老旧"},{name:"category",required:!0,positional:!0,help:"商品分类关键词(如:手机、衣服、图书)"},{name:"original_price",type:"float",help:"原价(选填,用于显示折扣)"},{name:"location",help:"所在地区(选填,如:杭州)"},{name:"images",help:"本地图片路径,多张用逗号分隔(选填,如:/tmp/a.jpg,/tmp/b.jpg)"}],columns:["status","item_id","title","price","condition","url","message"],func:async(t,n)=>{const e=k(n);await t.goto(h());await t.wait(3);let o=await t.evaluate(O());for(let i=0;i<30;i++){if(o?.requiresAuth||o?.hasPublishForm)break;await t.wait(0.5);o=await t.evaluate(O())}if(o?.requiresAuth)throw new P("www.goofish.com","发布闲鱼需要先登录,请在 Chrome 中打开 goofish.com 并完成登录");if(!o?.hasPublishForm)throw new c("Xianyu publish form was not detected","Confirm goofish.com is logged in and the publish page finished loading.");let s=await t.evaluate(g(e.category));for(let i=0;i<30;i++){if(s?.ok||s?.reason!=="category-trigger-not-found")break;await t.wait(0.5);s=await t.evaluate(g(e.category))}if(!s?.ok)throw new c(`Xianyu category selection failed: ${s?.reason||"unknown-reason"}`);await t.wait(1.5);let l=await t.evaluate(b(e));for(let i=0;i<30;i++){if(l?.ok)break;await t.wait(0.5);l=await t.evaluate(b(e))}if(!l?.ok){const i=Array.isArray(l?.missing)?l.missing.join(", "):"unknown";throw new c(`Xianyu publish form fill failed; missing fields: ${i}`)}await t.wait(1);if(e.images.length>0){let i=await t.evaluate(y());for(let r=0;r<30;r++){if(i?.ok)break;await t.wait(0.5);i=await t.evaluate(y())}if(!i?.ok)throw new c(`Xianyu image upload input was not found: ${i?.reason||"unknown-reason"}`);try{await M(t,i.selector||'input[type="file"]',e.images);await t.wait(3)}catch(r){throw new c(`Xianyu image upload failed: ${r?.message||r}`)}}let p=await t.evaluate(q());for(let i=0;i<30;i++){if(p?.ok)break;await t.wait(0.5);p=await t.evaluate(q())}if(!p?.ok)throw new c(`Xianyu publish submit failed: ${p?.reason||"unknown-reason"}`);await t.wait(2);let I="",d=await w(t),v="";for(let i=0;i<10;i++){await t.wait(1.5);const r=await t.evaluate(A());d=await w(t);if(r?.status==="published"){I=String(r.item_id||"").replace(/\D/g,"");return[{status:"published",item_id:I,title:e.title.slice(0,50),price:`¥${e.price}`,condition:e.condition,url:r.url||d,message:"发布成功"}]}if(r?.status==="failed"){v=r.message||"发布失败";break}}throw new c(v||"Xianyu publish result was not confirmed before timeout",`Open ${d} and verify whether the listing was published.`)}}),__test__={CONDITION_CHOICES:f,MAX_IMAGES:m,validateImagePaths:E,normalizePublishArgs:k,buildPublishUrl:h,getCurrentPageUrl:w,buildFillFormEvaluate:b,buildSelectCategoryEvaluate:g,buildFindFileInputSelectorEvaluate:y,buildDetectSuccessEvaluate:A};
@@ -1 +1 @@
1
- import{ArgumentError as h}from"@jackwener/opencli/errors";import{cli as Q,Strategy as V}from"@jackwener/opencli/registry";import{HOME_URL as W,mtopRequest as X}from"./mtop.js";import{normalizeNumericId as Y}from"./utils.js";Q({site:"xianyu",name:"rate",access:"read",description:"拉某用户收到的信用评价列表",domain:"www.goofish.com",strategy:V.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"user_id",required:!0,positional:!0,help:"被评价用户 userId(明文数字 uid)"},{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"}],columns:["rate_id","rater_nick","rate_content","create_time"],func:async(A,B)=>{const G=Y(B.user_id,"user_id","2208502750464"),J=Math.max(1,Number(B.page)||1),K=Math.max(1,Number(B.page_size)||20);await A.goto(W);await A.wait(1);const C=await X(A,"rate",{api:"mtop.idle.web.trade.rate.list",data:{rateType:0,ratedUid:G,raterType:0,rowsPerPage:K,pageNumber:J,foldFlag:0,fishAdCode:"",extraTag:""},version:"1.0"}),D=(Array.isArray(C.cardList)?C.cardList:[]).filter((x)=>x&&typeof x==="object").map((x)=>{const v=x.cardData||x;return{rate_id:String(v.rateId||v.id||""),rater_id:String(v.raterUid||v.userId||""),rater_nick:v.raterNick||v.userNick||v.nick||"",rate_content:v.content||v.rateContent||"",rate_type:v.rateType??v.attitude??"",item_id:String(v.itemId||""),item_title:v.itemTitle||"",create_time:String(v.gmtCreate||v.createTime||v.rateTime||""),reply:v.reply||v.sellerReply||""}});return D.length?D:[{rate_id:"",rater_nick:"(该用户暂无评价或评价不可见)",rate_content:"",create_time:""}]}});export const __test__={};
1
+ import{ArgumentError as y}from"@jackwener/opencli/errors";import{cli as c,Strategy as m}from"@jackwener/opencli/registry";import{HOME_URL as p,mtopRequest as _}from"./mtop.js";import{normalizeNumericId as u}from"./utils.js";c({site:"xianyu",name:"rate",access:"read",description:"拉某用户收到的信用评价列表",domain:"www.goofish.com",strategy:m.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"user_id",required:!0,positional:!0,help:"被评价用户 userId(明文数字 uid)"},{name:"page",type:"int",default:1,help:"页码,从 1 开始"},{name:"page_size",type:"int",default:20,help:"每页条数"}],columns:["rate_id","rater_nick","rate_content","create_time"],func:async(r,a)=>{const o=u(a.user_id,"user_id","2208502750464"),s=Math.max(1,Number(a.page)||1),d=Math.max(1,Number(a.page_size)||20);await r.goto(p);await r.wait(1);const i=await _(r,"rate",{api:"mtop.idle.web.trade.rate.list",data:{rateType:0,ratedUid:o,raterType:0,rowsPerPage:d,pageNumber:s,foldFlag:0,fishAdCode:"",extraTag:""},version:"1.0"}),n=(Array.isArray(i.cardList)?i.cardList:[]).filter((t)=>t&&typeof t==="object").map((t)=>{const e=t.cardData||t;return{rate_id:String(e.rateId||e.id||""),rater_id:String(e.raterUid||e.userId||""),rater_nick:e.raterNick||e.userNick||e.nick||"",rate_content:e.content||e.rateContent||"",rate_type:e.rateType??e.attitude??"",item_id:String(e.itemId||""),item_title:e.itemTitle||"",create_time:String(e.gmtCreate||e.createTime||e.rateTime||""),reply:e.reply||e.sellerReply||""}});return n.length?n:[{rate_id:"",rater_nick:"(该用户暂无评价或评价不可见)",rate_content:"",create_time:""}]}});export const __test__={};
@@ -1 +1 @@
1
- import{ArgumentError as J,AuthRequiredError as X,CommandExecutionError as Y,selectorError as Z}from"@jackwener/opencli/errors";import{cli as _,Strategy as $}from"@jackwener/opencli/registry";import{buildChatUrl as Q,buildClickInboxConversationEvaluate as q,buildExtractChatStateEvaluate as y,buildSendMessageEvaluate as T,normalizeRank as z,requireClickResult as M,requireEvaluateObject as V,requireText as R}from"./im.js";import{normalizeNumericId as W}from"./utils.js";_({site:"xianyu",name:"reply",access:"write",description:"回复指定闲鱼私信会话",domain:"www.goofish.com",strategy:$.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",positional:!0,help:"闲鱼商品 item_id"},{name:"user_id",positional:!0,help:"聊一聊对方的 user_id / peerUserId"},{name:"text",fromFile:!0,required:!0,help:"Message text to send"},{name:"rank",type:"int",default:0,help:"Conversation rank from xianyu inbox; clicks the visible row instead of requiring IDs"}],columns:["status","peer_name","item_title","price","location","message"],func:async(f,j)=>{const F=j.item_id!=null&&j.item_id!=="",G=j.user_id!=null&&j.user_id!=="",D=z(j.rank);if(D>0&&(F||G))throw new J("xianyu reply accepts either item_id/user_id or --rank, not both");if(D===0&&F!==G)throw new J("xianyu reply requires both item_id and user_id, or --rank from xianyu inbox");if(D===0&&!F&&!G)throw new J("xianyu reply requires item_id/user_id or --rank from xianyu inbox");const H=F&&G,K=H?W(j.item_id,"item_id","1038951278192"):"",L=H?W(j.user_id,"user_id","3650092411"):"",N=R(j.text,"xianyu reply --text"),O=H?Q(K,L):"";if(H)await f.goto(O);else if(!f.getCurrentUrl||!/https:\/\/www\.goofish\.com\/im\b/.test(await f.getCurrentUrl()))await f.goto("https://www.goofish.com/im");await f.wait(2);if(D>0){M(await f.evaluate(q(D-1)),"reply rank click");await f.wait(2)}const B=V(await f.evaluate(y()),"reply");if(B?.requiresAuth)throw new X("www.goofish.com","Xianyu reply requires a logged-in browser session");if(!B?.can_input)throw Z("闲鱼聊天输入框","未找到可用的聊天输入框,请确认该会话页已正确加载");const P=V(await f.evaluate(T(N)),"reply send");if(!P?.ok)throw new Y(`Xianyu reply did not observe the sent message: ${P?.reason||"unknown-reason"}`);await f.wait(1);return[{status:"sent",peer_name:B.peer_name||"",item_title:B.item_title||"",price:B.price||"",location:B.location||"",message:N,peer_user_id:L,item_id:K,url:O||"",item_url:B.item_url||""}]}});export const __test__={buildChatUrl:Q,buildSendMessageEvaluate:T};
1
+ import{ArgumentError as s,AuthRequiredError as p,CommandExecutionError as y,selectorError as x}from"@jackwener/opencli/errors";import{cli as b,Strategy as v}from"@jackwener/opencli/registry";import{buildChatUrl as _,buildClickInboxConversationEvaluate as E,buildExtractChatStateEvaluate as I,buildSendMessageEvaluate as w,normalizeRank as q,requireClickResult as C,requireEvaluateObject as h,requireText as k}from"./im.js";import{normalizeNumericId as f}from"./utils.js";b({site:"xianyu",name:"reply",access:"write",description:"回复指定闲鱼私信会话",domain:"www.goofish.com",strategy:v.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"item_id",positional:!0,help:"闲鱼商品 item_id"},{name:"user_id",positional:!0,help:"聊一聊对方的 user_id / peerUserId"},{name:"text",fromFile:!0,required:!0,help:"Message text to send"},{name:"rank",type:"int",default:0,help:"Conversation rank from xianyu inbox; clicks the visible row instead of requiring IDs"}],columns:["status","peer_name","item_title","price","location","message"],func:async(e,t)=>{const o=t.item_id!=null&&t.item_id!=="",n=t.user_id!=null&&t.user_id!=="",r=q(t.rank);if(r>0&&(o||n))throw new s("xianyu reply accepts either item_id/user_id or --rank, not both");if(r===0&&o!==n)throw new s("xianyu reply requires both item_id and user_id, or --rank from xianyu inbox");if(r===0&&!o&&!n)throw new s("xianyu reply requires item_id/user_id or --rank from xianyu inbox");const a=o&&n,u=a?f(t.item_id,"item_id","1038951278192"):"",l=a?f(t.user_id,"user_id","3650092411"):"",m=k(t.text,"xianyu reply --text"),d=a?_(u,l):"";if(a)await e.goto(d);else if(!e.getCurrentUrl||!/https:\/\/www\.goofish\.com\/im\b/.test(await e.getCurrentUrl()))await e.goto("https://www.goofish.com/im");await e.wait(2);if(r>0){C(await e.evaluate(E(r-1)),"reply rank click");await e.wait(2)}const i=h(await e.evaluate(I()),"reply");if(i?.requiresAuth)throw new p("www.goofish.com","Xianyu reply requires a logged-in browser session");if(!i?.can_input)throw x("闲鱼聊天输入框","未找到可用的聊天输入框,请确认该会话页已正确加载");const c=h(await e.evaluate(w(m)),"reply send");if(!c?.ok)throw new y(`Xianyu reply did not observe the sent message: ${c?.reason||"unknown-reason"}`);await e.wait(1);return[{status:"sent",peer_name:i.peer_name||"",item_title:i.item_title||"",price:i.price||"",location:i.location||"",message:m,peer_user_id:l,item_id:u,url:d||"",item_url:i.item_url||""}]}});export const __test__={buildChatUrl:_,buildSendMessageEvaluate:w};
@@ -1,4 +1,4 @@
1
- import{ArgumentError as U,AuthRequiredError as W,CommandExecutionError as Y,EmptyResultError as S,selectorError as b}from"@jackwener/opencli/errors";import{cli as A,Strategy as h}from"@jackwener/opencli/registry";const f=30,Z=60;function T(B){const D=Number(B);if(!Number.isFinite(D))return 20;return Math.min(Z,Math.max(1,Math.floor(D)))}function X(B){return`https://www.goofish.com/search?q=${encodeURIComponent(B)}`}function $(B,D){if(B===void 0||B===null||B==="")return null;const J=Number(String(B).trim());if(!Number.isFinite(J)||J<0)throw new U(`xianyu search ${D} must be a non-negative number`,`For example: --${D} 100000`);return J}function C(B,D){if(B==null&&D==null)return"";const J=B!=null?B:0,N=D!=null?D:99999999;return`priceRange:${J},${N};`}function L(B,D){if(!B&&!D)return"{}";return JSON.stringify({divisionList:[{province:B||"",city:D||""}],excludeMultiPlacesSellers:"0",extraDivision:""})}function F({keyword:B,searchFilter:D,extraFilterValue:J,fromFilter:N,maxItems:K}){return`
1
+ import{ArgumentError as f,AuthRequiredError as w,CommandExecutionError as s,EmptyResultError as P,selectorError as A}from"@jackwener/opencli/errors";import{cli as N,Strategy as v}from"@jackwener/opencli/registry";const g=30,c=60;function y(e){const r=Number(e);if(!Number.isFinite(r))return 20;return Math.min(c,Math.max(1,Math.floor(r)))}function h(e){return`https://www.goofish.com/search?q=${encodeURIComponent(e)}`}function l(e,r){if(e===void 0||e===null||e==="")return null;const n=Number(String(e).trim());if(!Number.isFinite(n)||n<0)throw new f(`xianyu search ${r} must be a non-negative number`,`For example: --${r} 100000`);return n}function x(e,r){if(e==null&&r==null)return"";const n=e!=null?e:0,o=r!=null?r:99999999;return`priceRange:${n},${o};`}function b(e,r){if(!e&&!r)return"{}";return JSON.stringify({divisionList:[{province:e||"",city:r||""}],excludeMultiPlacesSellers:"0",extraDivision:""})}function q({keyword:e,searchFilter:r,extraFilterValue:n,fromFilter:o,maxItems:i}){return`
2
2
  (async () => {
3
3
  const clean = (value) => String(value ?? '').replace(/\\s+/g, ' ').trim();
4
4
  const cleanFirst = (...values) => values.map(clean).find(Boolean) || '';
@@ -31,10 +31,10 @@ import{ArgumentError as U,AuthRequiredError as W,CommandExecutionError as Y,Empt
31
31
  return { error: 'mtop-not-ready' };
32
32
  }
33
33
 
34
- const searchFilter = ${JSON.stringify(D)};
34
+ const searchFilter = ${JSON.stringify(r)};
35
35
  const propValueStr = searchFilter ? { searchFilter } : {};
36
- const rows = ${f};
37
- const maxItems = ${K};
36
+ const rows = ${g};
37
+ const maxItems = ${i};
38
38
  const maxPages = Math.ceil(maxItems / rows);
39
39
  const collected = [];
40
40
 
@@ -45,8 +45,8 @@ import{ArgumentError as U,AuthRequiredError as W,CommandExecutionError as Y,Empt
45
45
  api: 'mtop.taobao.idlemtopsearch.pc.search',
46
46
  data: {
47
47
  pageNumber: page,
48
- keyword: ${JSON.stringify(B)},
49
- fromFilter: ${N?"true":"false"},
48
+ keyword: ${JSON.stringify(e)},
49
+ fromFilter: ${o?"true":"false"},
50
50
  rowsPerPage: rows,
51
51
  sortValue: '',
52
52
  sortField: '',
@@ -55,7 +55,7 @@ import{ArgumentError as U,AuthRequiredError as W,CommandExecutionError as Y,Empt
55
55
  propValueStr,
56
56
  customGps: '',
57
57
  searchReqFromPage: 'pcSearch',
58
- extraFilterValue: ${JSON.stringify(J)},
58
+ extraFilterValue: ${JSON.stringify(n)},
59
59
  userPositionJson: '{}',
60
60
  },
61
61
  type: 'POST',
@@ -138,4 +138,4 @@ import{ArgumentError as U,AuthRequiredError as W,CommandExecutionError as Y,Empt
138
138
 
139
139
  return { items: collected };
140
140
  })()
141
- `}A({site:"xianyu",name:"search",access:"read",description:"搜索闲鱼商品(支持服务端价格区间 / 地区筛选)",domain:"www.goofish.com",strategy:h.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"query",required:!0,positional:!0,help:"搜索关键词"},{name:"limit",type:"int",default:20,help:`返回结果数(最多 ${Z},自动翻页)`},{name:"min-price",type:"float",help:"最低价格(元),服务端筛选"},{name:"max-price",type:"float",help:"最高价格(元),服务端筛选"},{name:"province",type:"string",help:"省份名(如 广东),服务端按地区筛选"},{name:"city",type:"string",help:"城市名(如 深圳 / 湛江),可单独使用,服务端按地区筛选"}],columns:["item_id","rank","title","price","condition","brand","location","badge","want","url"],func:async(B,D)=>{const J=String(D.query||"").trim(),N=T(D.limit),K=$(D["min-price"],"min-price"),Q=$(D["max-price"],"max-price");if(K!=null&&Q!=null&&K>Q)throw new U("xianyu search min-price cannot be greater than max-price",`Received --min-price ${K} and --max-price ${Q}`);const V=String(D.province||"").trim(),q=String(D.city||"").trim(),j=C(K,Q),z=L(V,q),_=Boolean(j)||z!=="{}";await B.goto(X(J));await B.wait(2);const H=await B.evaluate(F({keyword:J,searchFilter:j,extraFilterValue:z,fromFilter:_,maxItems:N}));if(H?.error==="auth-required")throw new W("www.goofish.com","Xianyu search requires a logged-in browser session");if(H?.error==="blocked")throw new Y("Xianyu returned a verification page or blocked the current browser session");if(H?.error==="mtop-not-ready")throw b("window.lib.mtop","闲鱼页面未完成初始化,无法调用搜索接口");if(!H||typeof H!=="object")throw new Y("Xianyu search returned a malformed response");const I=String(H?.error_code||""),G=String(H?.error_message||"");if(/FAIL_SYS_SESSION_EXPIRED|SESSION_EXPIRED|FAIL_SYS_TOKEN/.test(I)||/FAIL_SYS_SESSION_EXPIRED|SESSION_EXPIRED/.test(G))throw new W("www.goofish.com","Xianyu search requires a logged-in browser session");if(H?.error)throw new Y(G||`Xianyu search request failed: ${H.error}`);if(!Array.isArray(H.items))throw new Y("Xianyu search response did not include an items array");const O=H.items;if(!O.length)throw new S("xianyu search","没有匹配的商品(筛选条件可能过窄,或当前关键词无结果)");return O.map((M,R)=>({rank:R+1,...M}))}});export const __test__={ROWS_PER_PAGE:f,MAX_LIMIT:Z,normalizeLimit:T,buildSearchUrl:X,parsePriceArg:$,buildSearchFilter:C,buildExtraFilterValue:L};
141
+ `}N({site:"xianyu",name:"search",access:"read",description:"搜索闲鱼商品(支持服务端价格区间 / 地区筛选)",domain:"www.goofish.com",strategy:v.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"query",required:!0,positional:!0,help:"搜索关键词"},{name:"limit",type:"int",default:20,help:`返回结果数(最多 ${c},自动翻页)`},{name:"min-price",type:"float",help:"最低价格(元),服务端筛选"},{name:"max-price",type:"float",help:"最高价格(元),服务端筛选"},{name:"province",type:"string",help:"省份名(如 广东),服务端按地区筛选"},{name:"city",type:"string",help:"城市名(如 深圳 / 湛江),可单独使用,服务端按地区筛选"}],columns:["item_id","rank","title","price","condition","brand","location","badge","want","url"],func:async(e,r)=>{const n=String(r.query||"").trim(),o=y(r.limit),i=l(r["min-price"],"min-price"),a=l(r["max-price"],"max-price");if(i!=null&&a!=null&&i>a)throw new f("xianyu search min-price cannot be greater than max-price",`Received --min-price ${i} and --max-price ${a}`);const S=String(r.province||"").trim(),_=String(r.city||"").trim(),m=x(i,a),u=b(S,_),E=Boolean(m)||u!=="{}";await e.goto(h(n));await e.wait(2);const t=await e.evaluate(q({keyword:n,searchFilter:m,extraFilterValue:u,fromFilter:E,maxItems:o}));if(t?.error==="auth-required")throw new w("www.goofish.com","Xianyu search requires a logged-in browser session");if(t?.error==="blocked")throw new s("Xianyu returned a verification page or blocked the current browser session");if(t?.error==="mtop-not-ready")throw A("window.lib.mtop","闲鱼页面未完成初始化,无法调用搜索接口");if(!t||typeof t!=="object")throw new s("Xianyu search returned a malformed response");const F=String(t?.error_code||""),d=String(t?.error_message||"");if(/FAIL_SYS_SESSION_EXPIRED|SESSION_EXPIRED|FAIL_SYS_TOKEN/.test(F)||/FAIL_SYS_SESSION_EXPIRED|SESSION_EXPIRED/.test(d))throw new w("www.goofish.com","Xianyu search requires a logged-in browser session");if(t?.error)throw new s(d||`Xianyu search request failed: ${t.error}`);if(!Array.isArray(t.items))throw new s("Xianyu search response did not include an items array");const p=t.items;if(!p.length)throw new P("xianyu search","没有匹配的商品(筛选条件可能过窄,或当前关键词无结果)");return p.map((I,R)=>({rank:R+1,...I}))}});export const __test__={ROWS_PER_PAGE:g,MAX_LIMIT:c,normalizeLimit:y,buildSearchUrl:h,parsePriceArg:l,buildSearchFilter:x,buildExtraFilterValue:b};
@@ -1 +1 @@
1
- import{ArgumentError as $,CommandExecutionError as M}from"@jackwener/opencli/errors";import{cli as j,Strategy as L}from"@jackwener/opencli/registry";const V={overview:{hash:"#/seller-data/data",label:"数据总览"},commodity:{hash:"#/seller-data/commodity",label:"商品数据"},fans:{hash:"#/seller-data/fanData",label:"粉丝数据"},service:{hash:"#/seller-data/customerService",label:"客服数据"}},W={recent1d:"近1天",recent7d:"近7天",recent30d:"近30天"},x="https://seller.goofish.com/?site=COMMONPRO";function H(){const f=[],I=new Set;document.querySelectorAll('[class*="statValue--"]').forEach((B)=>{let b=B,q=null,D=null;for(let Z=0;Z<5&&b;Z++){b=b.parentElement;if(!b)break;q=b.querySelector('[class*="statHeader--"]');if(q){D=b;break}}if(!q||!D)return;const z=(q.innerText||"").trim(),Q=(B.innerText||"").trim();if(!z)return;const J=D.querySelector('[class*="statPrevious--"]'),F=J?(J.innerText||"").replace(/\s+/g," ").trim():"",Y=z+"|"+Q;if(I.has(Y))return;I.add(Y);f.push({metric:z,value:Q,compare:F})});return f}j({site:"xianyu",name:"seller-data",access:"read",description:"读卖家工作台经营数据(曝光/访问/浏览/转化/复购/售后等指标卡)",domain:"seller.goofish.com",strategy:L.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",default:"overview",help:`数据页:${Object.keys(V).join(" / ")}`},{name:"range",default:"recent1d",help:"时间范围:recent1d / recent7d / recent30d"}],columns:["metric","value","compare"],func:async(f,I)=>{const B=String(I.page||"overview").trim(),b=V[B];if(!b)throw new $(`--page 只能是 ${Object.keys(V).join(" / ")},收到 "${B}"`);const q=String(I.range||"recent1d").trim(),D=W[q];if(!D)throw new $(`--range 只能是 ${Object.keys(W).join(" / ")},收到 "${q}"`);await f.goto(`${x}${b.hash}`);await f.wait(3);if(q!=="recent1d"){await f.evaluate((Q)=>{const J=Array.from(document.querySelectorAll("label,span,div,button")).filter((F)=>F.children.length===0&&(F.innerText||"").trim()===Q);J.forEach((F)=>F.click());return J.length},D);await f.wait(2)}const z=await f.evaluate(H);if(!Array.isArray(z)||z.length===0)throw new M(`未读到任何指标卡(page=${B})—— 可能未登录卖家中心、页面结构改版或该账号无权限`);return z}});export const __test__={readCards:H,PAGE_ROUTES:V,RANGE_TEXT:W};
1
+ import{ArgumentError as f,CommandExecutionError as w}from"@jackwener/opencli/errors";import{cli as y,Strategy as p}from"@jackwener/opencli/registry";const d={overview:{hash:"#/seller-data/data",label:"数据总览"},commodity:{hash:"#/seller-data/commodity",label:"商品数据"},fans:{hash:"#/seller-data/fanData",label:"粉丝数据"},service:{hash:"#/seller-data/customerService",label:"客服数据"}},m={recent1d:"近1天",recent7d:"近7天",recent30d:"近30天"},v="https://seller.goofish.com/?site=COMMONPRO";function g(){const t=[],c=new Set;document.querySelectorAll('[class*="statValue--"]').forEach((n)=>{let e=n,r=null,o=null;for(let h=0;h<5&&e;h++){e=e.parentElement;if(!e)break;r=e.querySelector('[class*="statHeader--"]');if(r){o=e;break}}if(!r||!o)return;const a=(r.innerText||"").trim(),i=(n.innerText||"").trim();if(!a)return;const l=o.querySelector('[class*="statPrevious--"]'),s=l?(l.innerText||"").replace(/\s+/g," ").trim():"",u=a+"|"+i;if(c.has(u))return;c.add(u);t.push({metric:a,value:i,compare:s})});return t}y({site:"xianyu",name:"seller-data",access:"read",description:"读卖家工作台经营数据(曝光/访问/浏览/转化/复购/售后等指标卡)",domain:"seller.goofish.com",strategy:p.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",default:"overview",help:`数据页:${Object.keys(d).join(" / ")}`},{name:"range",default:"recent1d",help:"时间范围:recent1d / recent7d / recent30d"}],columns:["metric","value","compare"],func:async(t,c)=>{const n=String(c.page||"overview").trim(),e=d[n];if(!e)throw new f(`--page 只能是 ${Object.keys(d).join(" / ")},收到 "${n}"`);const r=String(c.range||"recent1d").trim(),o=m[r];if(!o)throw new f(`--range 只能是 ${Object.keys(m).join(" / ")},收到 "${r}"`);await t.goto(`${v}${e.hash}`);await t.wait(3);if(r!=="recent1d"){await t.evaluate((i)=>{const l=Array.from(document.querySelectorAll("label,span,div,button")).filter((s)=>s.children.length===0&&(s.innerText||"").trim()===i);l.forEach((s)=>s.click());return l.length},o);await t.wait(2)}const a=await t.evaluate(g);if(!Array.isArray(a)||a.length===0)throw new w(`未读到任何指标卡(page=${n})—— 可能未登录卖家中心、页面结构改版或该账号无权限`);return a}});export const __test__={readCards:g,PAGE_ROUTES:d,RANGE_TEXT:m};
@@ -1 +1 @@
1
- import{CommandExecutionError as M,ArgumentError as V}from"@jackwener/opencli/errors";import{cli as W,Strategy as X}from"@jackwener/opencli/registry";const D={refund:{hash:"#/seller-trade/refund-manage",label:"退款管理"},review:{hash:"#/seller-trade/evaluation-manage",label:"评价管理"},complaint:{hash:"#/seller-trade/complaint-manage",label:"投诉管理"},income:{hash:"#/seller-finance/income-bill",label:"收入账单"},expense:{hash:"#/seller-finance/expense-bill",label:"支出账单"},"shipping-template":{hash:"#/seller-item/post-temple",label:"运费模版"}};function N(){const q=Array.from(document.querySelectorAll("thead th")).map((z)=>(z.innerText||"").trim()).filter(Boolean);if(!q.length)return{error:"no-table"};const F=[];let B=!1;document.querySelectorAll("tbody tr").forEach((z)=>{const f=Array.from(z.querySelectorAll("td"));if(!f.length)return;if(f.every((I)=>!(I.innerText||"").trim()))return;if(f.length===1)return;if(f.length!==q.length){B=!0;return}const H={};f.forEach((I,L)=>{const Q=q[L]||`col${L+1}`;H[Q]=(I.innerText||"").replace(/\s+/g," ").trim()});const J=Object.values(H).filter(Boolean);if(J.length<=1&&/^(暂无数据|没有数据|暂无记录|空空如也)$/.test(J[0]||""))return;F.push(H)});return{heads:q,rows:F,misaligned:B}}W({site:"xianyu",name:"seller-list",access:"read",description:`读卖家工作台列表页(${Object.keys(D).join(" / ")})—— 表头即列,动态返回`,domain:"seller.goofish.com",strategy:X.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",required:!0,positional:!0,help:`列表页:${Object.keys(D).join(" / ")}`}],func:async(q,F)=>{const B=String(F.page||"").trim(),z=D[B];if(!z)throw new V(`page 只能是 ${Object.keys(D).join(" / ")},收到 "${B}"`);await q.goto(`https://seller.goofish.com/?site=COMMONPRO${z.hash}`);await q.wait(4);const f=await q.evaluate(N);if(f.error==="no-table")throw new M(`${z.label} 未渲染出表格 —— 可能未登录 / 页面改版 / 无权限`);if(f.misaligned&&(f.rows||[]).length===0)throw new M(`${z.label} 表格单元格数与表头(${(f.heads||[]).length}列)不一致,疑似带选择/展开列,需为该页单独适配以免列错位`);return f.rows||[]}});export const __test__={readTable:N,PAGE_ROUTES:D};
1
+ import{CommandExecutionError as h,ArgumentError as f}from"@jackwener/opencli/errors";import{cli as g,Strategy as d}from"@jackwener/opencli/registry";const n={refund:{hash:"#/seller-trade/refund-manage",label:"退款管理"},review:{hash:"#/seller-trade/evaluation-manage",label:"评价管理"},complaint:{hash:"#/seller-trade/complaint-manage",label:"投诉管理"},income:{hash:"#/seller-finance/income-bill",label:"收入账单"},expense:{hash:"#/seller-finance/expense-bill",label:"支出账单"},"shipping-template":{hash:"#/seller-item/post-temple",label:"运费模版"}};function m(){const t=Array.from(document.querySelectorAll("thead th")).map((r)=>(r.innerText||"").trim()).filter(Boolean);if(!t.length)return{error:"no-table"};const a=[];let l=!1;document.querySelectorAll("tbody tr").forEach((r)=>{const e=Array.from(r.querySelectorAll("td"));if(!e.length)return;if(e.every((s)=>!(s.innerText||"").trim()))return;if(e.length===1)return;if(e.length!==t.length){l=!0;return}const o={};e.forEach((s,c)=>{const u=t[c]||`col${c+1}`;o[u]=(s.innerText||"").replace(/\s+/g," ").trim()});const i=Object.values(o).filter(Boolean);if(i.length<=1&&/^(暂无数据|没有数据|暂无记录|空空如也)$/.test(i[0]||""))return;a.push(o)});return{heads:t,rows:a,misaligned:l}}g({site:"xianyu",name:"seller-list",access:"read",description:`读卖家工作台列表页(${Object.keys(n).join(" / ")})—— 表头即列,动态返回`,domain:"seller.goofish.com",strategy:d.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"page",required:!0,positional:!0,help:`列表页:${Object.keys(n).join(" / ")}`}],func:async(t,a)=>{const l=String(a.page||"").trim(),r=n[l];if(!r)throw new f(`page 只能是 ${Object.keys(n).join(" / ")},收到 "${l}"`);await t.goto(`https://seller.goofish.com/?site=COMMONPRO${r.hash}`);await t.wait(4);const e=await t.evaluate(m);if(e.error==="no-table")throw new h(`${r.label} 未渲染出表格 —— 可能未登录 / 页面改版 / 无权限`);if(e.misaligned&&(e.rows||[]).length===0)throw new h(`${r.label} 表格单元格数与表头(${(e.heads||[]).length}列)不一致,疑似带选择/展开列,需为该页单独适配以免列错位`);return e.rows||[]}});export const __test__={readTable:m,PAGE_ROUTES:n};
@@ -1 +1 @@
1
- import{cli as P,Strategy as Q}from"@jackwener/opencli/registry";import{HOME_URL as V,mtopRequest as W}from"./mtop.js";import{normalizeNumericId as X}from"./utils.js";P({site:"xianyu",name:"user",access:"read",description:"查询闲鱼用户主页信息(不传 user_id 看自己)",domain:"www.goofish.com",strategy:Q.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"user_id",positional:!0,help:"目标用户 userId;留空看自己"}],columns:["user_id","nick","city","credit_level","fans_count","follow_count"],func:async(A,B)=>{const G=B.user_id!=null&&String(B.user_id).trim()!=="",J=G?X(B.user_id,"user_id","2208502750464"):"";await A.goto(V);await A.wait(1);const C=await W(A,"user",{api:"mtop.idle.web.user.page.head",data:G?{userId:J,self:!1}:{self:!0},version:"1.0"}),x=C.baseInfo||C.base||{},D=C.module||{},v=D.base||{},F=D.social||{},K=(D.tabs||{}).rate||{};return[{user_id:String(x.kcUserId||x.userId||J||""),nick:v.displayName||x.userNick||"",avatar:v.avatar&&v.avatar.avatar||v.avatar||"",location:v.ipLocation||"",signature:v.introduction||"",followers:Number(F.followers||0),following:Number(F.following||0),follow_status:F.followStatus??"",rate_count:Number(K.number||0),tags:x.tags||{}}]}});export const __test__={};
1
+ import{cli as c,Strategy as d}from"@jackwener/opencli/registry";import{HOME_URL as m,mtopRequest as f}from"./mtop.js";import{normalizeNumericId as _}from"./utils.js";c({site:"xianyu",name:"user",access:"read",description:"查询闲鱼用户主页信息(不传 user_id 看自己)",domain:"www.goofish.com",strategy:d.COOKIE,navigateBefore:!1,browser:!0,args:[{name:"user_id",positional:!0,help:"目标用户 userId;留空看自己"}],columns:["user_id","nick","city","credit_level","fans_count","follow_count"],func:async(a,o)=>{const n=o.user_id!=null&&String(o.user_id).trim()!=="",u=n?_(o.user_id,"user_id","2208502750464"):"";await a.goto(m);await a.wait(1);const s=await f(a,"user",{api:"mtop.idle.web.user.page.head",data:n?{userId:u,self:!1}:{self:!0},version:"1.0"}),t=s.baseInfo||s.base||{},r=s.module||{},e=r.base||{},i=r.social||{},l=(r.tabs||{}).rate||{};return[{user_id:String(t.kcUserId||t.userId||u||""),nick:e.displayName||t.userNick||"",avatar:e.avatar&&e.avatar.avatar||e.avatar||"",location:e.ipLocation||"",signature:e.introduction||"",followers:Number(i.followers||0),following:Number(i.following||0),follow_status:i.followStatus??"",rate_count:Number(l.number||0),tags:t.tags||{}}]}});export const __test__={};
@@ -1,4 +1,4 @@
1
- import{cli as G,Strategy as H}from"@jackwener/opencli/registry";import{CommandExecutionError as J,EmptyResultError as K}from"@jackwener/opencli/errors";import{requireXiaoePageUrl as M}from"./content.js";export function typeLabel(v){return{1:"图文",2:"直播",3:"音频",4:"视频",6:"专栏",8:"大专栏"}[Number(v)]||String(v||"")}export function buildItemUrl(v,A){const z=v.jump_url||v.h5_url||v.url||"";if(!z)return"";return z.startsWith("http")?z:A+z}export function chapterUrlPath(v){return{1:"/v1/course/text/",2:"/v2/course/alive/",3:"/v1/course/audio/",4:"/v1/course/video/"}[Number(v)]}export function buildCatalogScript(){return`(async () => {
1
+ import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{CommandExecutionError as s,EmptyResultError as n}from"@jackwener/opencli/errors";import{requireXiaoePageUrl as u}from"./content.js";export function typeLabel(e){return{1:"图文",2:"直播",3:"音频",4:"视频",6:"专栏",8:"大专栏"}[Number(e)]||String(e||"")}export function buildItemUrl(e,t){const r=e.jump_url||e.h5_url||e.url||"";if(!r)return"";return r.startsWith("http")?r:t+r}export function chapterUrlPath(e){return{1:"/v1/course/text/",2:"/v2/course/alive/",3:"/v1/course/audio/",4:"/v1/course/video/"}[Number(e)]}export function buildCatalogScript(){return`(async () => {
2
2
  ${typeLabel.toString()}
3
3
  ${buildItemUrl.toString()}
4
4
  ${chapterUrlPath.toString()}
@@ -131,4 +131,4 @@ import{cli as G,Strategy as H}from"@jackwener/opencli/registry";import{CommandEx
131
131
  }
132
132
  }
133
133
  return result;
134
- })()`}async function N(v,A){const z=M(A.url,"catalog");let B;try{await v.goto(z,{waitUntil:"load",settleMs:8000});B=await v.evaluate(buildCatalogScript())}catch(D){const F=D instanceof Error?D.message:String(D);throw new J(`Failed to read xiaoe catalog: ${F}`,"page may not have rendered or auth may be required")}if(!Array.isArray(B)||B.length===0)throw new K("xiaoe/catalog","No catalog rows extracted — the URL may not be a course page or the login session has expired");return B}export const catalogCommand=G({site:"xiaoe",name:"catalog",access:"read",description:"小鹅通课程目录(支持普通课程、专栏、大专栏)",domain:"h5.xet.citv.cn",strategy:H.COOKIE,browser:!0,args:[{name:"url",required:!0,positional:!0,help:"课程页面 URL"}],columns:["ch","chapter","no","title","type","resource_id","url","status"],func:N}),__test__={buildCatalogScript};
134
+ })()`}async function h(e,t){const r=u(t.url,"catalog");let i;try{await e.goto(r,{waitUntil:"load",settleMs:8000});i=await e.evaluate(buildCatalogScript())}catch(o){const a=o instanceof Error?o.message:String(o);throw new s(`Failed to read xiaoe catalog: ${a}`,"page may not have rendered or auth may be required")}if(!Array.isArray(i)||i.length===0)throw new n("xiaoe/catalog","No catalog rows extracted — the URL may not be a course page or the login session has expired");return i}export const catalogCommand=c({site:"xiaoe",name:"catalog",access:"read",description:"小鹅通课程目录(支持普通课程、专栏、大专栏)",domain:"h5.xet.citv.cn",strategy:l.COOKIE,browser:!0,args:[{name:"url",required:!0,positional:!0,help:"课程页面 URL"}],columns:["ch","chapter","no","title","type","resource_id","url","status"],func:h}),__test__={buildCatalogScript};
@@ -1,4 +1,4 @@
1
- import{cli as Z,Strategy as $}from"@jackwener/opencli/registry";import{ArgumentError as W,CommandExecutionError as q,EmptyResultError as Y}from"@jackwener/opencli/errors";export const CONTENT_SELECTORS=[".rich-text-wrap",".content-wrap",".article-content",".text-content",".course-detail",".detail-content",'[class*="richtext"]','[class*="rich-text"]',".ql-editor"],CONTENT_MIN_LENGTH=50;export function pickContentText(B,K,J=CONTENT_MIN_LENGTH){for(const F of K){const Q=B.querySelector(F);if(!Q)continue;const V=(Q.innerText||Q.textContent||"").trim();if(V.length>J)return V}const z=B.querySelector("main")||B.querySelector("#app")||B.body;if(!z)return"";return(z.innerText||z.textContent||"").trim()}export function countXiaoeImages(B){let K=0;const J=B.querySelectorAll("img");for(let z=0;z<J.length;z+=1){const F=J[z].getAttribute("src")||J[z].src||"";if(!F)continue;if(F.startsWith("data:"))continue;if(!F.includes("xiaoe"))continue;K+=1}return K}export function requireXiaoePageUrl(B,K){const J=typeof B==="string"?B.trim():"";if(!J)throw new W("url is required (positional)");let z;try{z=new URL(J)}catch{throw new W(`invalid xiaoe URL: ${J}`,`Example: ppcli xiaoe ${K} https://appxxxx.h5.xet.citv.cn/p/course/ecourse/v_xxxxx`)}if(z.protocol!=="https:")throw new W(`xiaoe URL must use https (got ${z.protocol.replace(":","")})`,`Example: ppcli xiaoe ${K} https://appxxxx.h5.xet.citv.cn/p/course/ecourse/v_xxxxx`);const F=z.hostname.toLowerCase();if(F!=="h5.xet.citv.cn"&&!F.endsWith(".h5.xet.citv.cn"))throw new W(`url must be on h5.xet.citv.cn or a shop subdomain (got ${z.hostname})`,`Example: ppcli xiaoe ${K} https://appxxxx.h5.xet.citv.cn/p/course/ecourse/v_xxxxx`);return z.toString()}export function buildContentScript(){return`
1
+ import{cli as x,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as s,CommandExecutionError as l,EmptyResultError as a}from"@jackwener/opencli/errors";export const CONTENT_SELECTORS=[".rich-text-wrap",".content-wrap",".article-content",".text-content",".course-detail",".detail-content",'[class*="richtext"]','[class*="rich-text"]',".ql-editor"],CONTENT_MIN_LENGTH=50;export function pickContentText(e,r,o=CONTENT_MIN_LENGTH){for(const n of r){const i=e.querySelector(n);if(!i)continue;const c=(i.innerText||i.textContent||"").trim();if(c.length>o)return c}const t=e.querySelector("main")||e.querySelector("#app")||e.body;if(!t)return"";return(t.innerText||t.textContent||"").trim()}export function countXiaoeImages(e){let r=0;const o=e.querySelectorAll("img");for(let t=0;t<o.length;t+=1){const n=o[t].getAttribute("src")||o[t].src||"";if(!n)continue;if(n.startsWith("data:"))continue;if(!n.includes("xiaoe"))continue;r+=1}return r}export function requireXiaoePageUrl(e,r){const o=typeof e==="string"?e.trim():"";if(!o)throw new s("url is required (positional)");let t;try{t=new URL(o)}catch{throw new s(`invalid xiaoe URL: ${o}`,`Example: ppcli xiaoe ${r} https://appxxxx.h5.xet.citv.cn/p/course/ecourse/v_xxxxx`)}if(t.protocol!=="https:")throw new s(`xiaoe URL must use https (got ${t.protocol.replace(":","")})`,`Example: ppcli xiaoe ${r} https://appxxxx.h5.xet.citv.cn/p/course/ecourse/v_xxxxx`);const n=t.hostname.toLowerCase();if(n!=="h5.xet.citv.cn"&&!n.endsWith(".h5.xet.citv.cn"))throw new s(`url must be on h5.xet.citv.cn or a shop subdomain (got ${t.hostname})`,`Example: ppcli xiaoe ${r} https://appxxxx.h5.xet.citv.cn/p/course/ecourse/v_xxxxx`);return t.toString()}export function buildContentScript(){return`
2
2
  (() => {
3
3
  ${pickContentText.toString()}
4
4
  ${countXiaoeImages.toString()}
@@ -13,4 +13,4 @@ import{cli as Z,Strategy as $}from"@jackwener/opencli/registry";import{ArgumentE
13
13
  image_count: imageCount,
14
14
  }];
15
15
  })()
16
- `}async function D(B,K){const J=requireXiaoePageUrl(K.url,"content");let z;try{await B.goto(J,{waitUntil:"load",settleMs:6000});z=await B.evaluate(buildContentScript())}catch(Q){const V=Q instanceof Error?Q.message:String(Q);throw new q(`Failed to extract xiaoe content: ${V}`,"page may not have rendered or auth may be required")}if(!Array.isArray(z)||z.length===0)throw new Y("xiaoe/content","No rows returned from page evaluator (page structure may have changed)");const F=z[0];if(!F||typeof F.content!=="string"||F.content.length===0)throw new Y("xiaoe/content","No article content extracted — login session may have expired or the page renders an empty shell");return z}export const contentCommand=Z({site:"xiaoe",name:"content",access:"read",description:"提取小鹅通图文页面内容为文本",domain:"h5.xet.citv.cn",strategy:$.COOKIE,browser:!0,args:[{name:"url",required:!0,positional:!0,help:"页面 URL"}],columns:["title","content","content_length","image_count"],func:D}),__test__={buildContentScript};
16
+ `}async function p(e,r){const o=requireXiaoePageUrl(r.url,"content");let t;try{await e.goto(o,{waitUntil:"load",settleMs:6000});t=await e.evaluate(buildContentScript())}catch(i){const c=i instanceof Error?i.message:String(i);throw new l(`Failed to extract xiaoe content: ${c}`,"page may not have rendered or auth may be required")}if(!Array.isArray(t)||t.length===0)throw new a("xiaoe/content","No rows returned from page evaluator (page structure may have changed)");const n=t[0];if(!n||typeof n.content!=="string"||n.content.length===0)throw new a("xiaoe/content","No article content extracted — login session may have expired or the page renders an empty shell");return t}export const contentCommand=x({site:"xiaoe",name:"content",access:"read",description:"提取小鹅通图文页面内容为文本",domain:"h5.xet.citv.cn",strategy:u.COOKIE,browser:!0,args:[{name:"url",required:!0,positional:!0,help:"页面 URL"}],columns:["title","content","content_length","image_count"],func:p}),__test__={buildContentScript};
@@ -1,4 +1,4 @@
1
- import{cli as D,Strategy as F}from"@jackwener/opencli/registry";import{CommandExecutionError as G,EmptyResultError as H}from"@jackwener/opencli/errors";export function buildCourseUrl(q){if(!q)return"";if(q.h5_url)return q.h5_url;if(q.url)return q.url;if(q.app_id&&q.resource_id){const z="https://"+q.app_id+".h5.xet.citv.cn";if(q.resource_type===6)return z+"/v1/course/column/"+q.resource_id+"?type=3";return z+"/p/course/ecourse/"+q.resource_id}return""}export function buildCoursesScript(){return`(async () => {
1
+ import{cli as i,Strategy as s}from"@jackwener/opencli/registry";import{CommandExecutionError as a,EmptyResultError as n}from"@jackwener/opencli/errors";export function buildCourseUrl(t){if(!t)return"";if(t.h5_url)return t.h5_url;if(t.url)return t.url;if(t.app_id&&t.resource_id){const e="https://"+t.app_id+".h5.xet.citv.cn";if(t.resource_type===6)return e+"/v1/course/column/"+t.resource_id+"?type=3";return e+"/p/course/ecourse/"+t.resource_id}return""}export function buildCoursesScript(){return`(async () => {
2
2
  ${buildCourseUrl.toString()}
3
3
  // 切换到「内容」tab
4
4
  var tabs = document.querySelectorAll('span, div');
@@ -40,4 +40,4 @@ import{cli as D,Strategy as F}from"@jackwener/opencli/registry";import{CommandEx
40
40
  });
41
41
  }
42
42
  return results;
43
- })()`}async function I(q){let z;try{await q.goto("https://study.xiaoe-tech.com/",{waitUntil:"load",settleMs:8000});z=await q.evaluate(buildCoursesScript())}catch(A){const B=A instanceof Error?A.message:String(A);throw new G(`Failed to list xiaoe courses: ${B}`,"page may not have rendered or auth may be required")}if(!Array.isArray(z)||z.length===0)throw new H("xiaoe/courses",'No purchased courses found — login session may have expired or the "内容" tab has no items');return z}export const coursesCommand=D({site:"xiaoe",name:"courses",access:"read",description:"列出已购小鹅通课程(含 URL 和店铺名)",domain:"study.xiaoe-tech.com",strategy:F.COOKIE,browser:!0,columns:["title","shop","url"],func:I}),__test__={buildCoursesScript};
43
+ })()`}async function u(t){let e;try{await t.goto("https://study.xiaoe-tech.com/",{waitUntil:"load",settleMs:8000});e=await t.evaluate(buildCoursesScript())}catch(r){const o=r instanceof Error?r.message:String(r);throw new a(`Failed to list xiaoe courses: ${o}`,"page may not have rendered or auth may be required")}if(!Array.isArray(e)||e.length===0)throw new n("xiaoe/courses",'No purchased courses found — login session may have expired or the "内容" tab has no items');return e}export const coursesCommand=i({site:"xiaoe",name:"courses",access:"read",description:"列出已购小鹅通课程(含 URL 和店铺名)",domain:"study.xiaoe-tech.com",strategy:s.COOKIE,browser:!0,columns:["title","shop","url"],func:u}),__test__={buildCoursesScript};
@@ -1,12 +1,12 @@
1
- import{cli as y,Strategy as x}from"@jackwener/opencli/registry";import{ArgumentError as d,AuthRequiredError as b,CommandExecutionError as c,TimeoutError as S}from"@jackwener/opencli/errors";const u="www.xiaohongshu.com",I=["query","answer","source_count","source_total_text","sources_summary","sources","warning","message_id","conversation_id"];export function unwrapEvaluateResult(e){if(e&&!Array.isArray(e)&&typeof e==="object"&&"session"in e&&"data"in e)return e.data;return e}function w(e,t,n,r,i){const o=e??t;let s;if(typeof o==="number")s=o;else if(typeof o==="string"&&/^\d+$/.test(o))s=Number(o);else throw new d(`${i} must be an integer between ${n} and ${r}, got ${JSON.stringify(e)}`);if(!Number.isInteger(s)||s<n||s>r)throw new d(`${i} must be an integer between ${n} and ${r}, got ${JSON.stringify(e)}`);return s}export function parseAskTimeout(e){return w(e,90,1,180,"--timeout")}export function parseAskLimit(e){return w(e,10,1,50,"--source-limit")}function m(e){return String(e??"").replace(/<[^>]+>/g,"").replace(/\u200b/g,"").replace(/\r\n/g,`
2
- `).trim()}function a(e){return m(e).replace(/\s+/g," ").trim()}function f(...e){for(const t of e){const n=a(t);if(n)return n}return""}function $(e){if(e===null||e===void 0||e==="")return null;const t=(o)=>Number.isSafeInteger(o)&&o>=0?o:null;if(typeof e==="number")return t(e);const n=String(e).trim(),r=n.match(/^(\d+(?:\.\d+)?)\s*(万|[wW]|亿)\+?$/);if(r){const o=Number(r[1]),s=r[2]==="亿"?1e8:1e4;return Number.isFinite(o)?t(Math.round(o*s)):null}const i=n.replace(/,/g,"").replace(/\+$/,"");if(/^\d+$/.test(i)&&(n===i||n===`${i}+`||/^\d{1,3}(?:,\d{3})+\+?$/.test(n)))return t(Number(i));return null}function g(e){if(!e)return null;try{return new URL(String(e))}catch{return null}}function _(e){const t=String(e||"").trim();if(!t)return null;const n=t.match(/^xhsdiscover:\/\/item\/([0-9a-f]{24})(?=[?#/]|$)/i);if(n){const s=g(t);return{noteId:n[1],xsecToken:s?.searchParams.get("xsec_token")||s?.searchParams.get("xsecToken")||"",href:t}}let r=g(t);if(!r&&t.startsWith("/"))r=g(`https://${u}${t}`);const i=r?.hostname.toLowerCase();if(!r||r.protocol!=="https:"||i!==u&&i!=="xiaohongshu.com")return null;const o=r.pathname.match(/^\/(?:explore|search_result|note)\/([0-9a-f]{24})\/?$/i);if(!o)return null;return{noteId:o[1],xsecToken:r.searchParams.get("xsec_token")||r.searchParams.get("xsecToken")||"",href:r.toString()}}function v(e){const t=a(e?.id||e?.noteId||e?.note_id);if(/^[0-9a-f]{24}$/i.test(t))return t;const n=[e?.textLink,e?.link,e?.url];for(const r of n){const i=_(r);if(i?.noteId)return i.noteId}return""}export function buildNoteUrl(e,t){if(!/^[0-9a-f]{24}$/i.test(String(e||"")))return"";const n=new URL(`https://${u}/explore/${e}`);if(t){n.searchParams.set("xsec_token",t);n.searchParams.set("xsec_source","")}return n.toString()}function A(e){const t=m(e?.content);if(!t)return"";const n=Array.isArray(e?.originLocation)?e.originLocation:[],r=Number(n[0]),i=Number(n[1]);if(Number.isInteger(r)&&r>=0&&Number.isInteger(i)&&i>0)return a(t.slice(r,r+i)).slice(0,300);return a(t).slice(0,300)}export function normalizeAskSource(e,t){const n=[e?.textLink,e?.link,e?.url].map(_).find(Boolean),r=v(e),i=n?.xsecToken||"",o={rank:t+1,type:"note",title:f(e?.title,e?.displayTitle,e?.name),url:buildNoteUrl(r,i),note_id:r,xsec_token:i,author:f(e?.nickName,e?.nickname,e?.author,e?.userName)},s=f(e?.noteType);if(s)o.note_type=s;const l=$(e?.like);if(l!==null)o.like_count=l;const p=a(e?.userId);if(p)o.user_id=p;const h=a(e?.time);if(h)o.published_at=h;const k=A(e);if(k)o.quote=k;if(n?.href)o.deeplink=n.href;return o}function q(e){return e.slice(0,5).map((t)=>`${t.rank}. ${t.title||t.note_id}${t.author?` - ${t.author}`:""}`).join(`
3
- `)}export function buildAskResult(e){const n=(Array.isArray(e?.sources)?e.sources:[]).map((s,l)=>normalizeAskSource(s,l)).filter((s)=>s.note_id||s.title||s.url),r=m(e?.answer||e?.base_info?.text||""),i=a(e?.warning),o=n.length===0&&r?`Xiaohongshu 点点 returned an answer but no citation sources.${i?` ${i}`:""}`:i;return{query:a(e?.query),answer:r,source_count:n.length,source_total_text:a(e?.source_total_text),sources_summary:q(n),sources:n,warning:o,message_id:a(e?.message_id),conversation_id:a(e?.conversation_id)}}export function buildAskEvaluateJs(e,t,n){const r=String(e);return`
1
+ import{cli as y,Strategy as x}from"@jackwener/opencli/registry";import{ArgumentError as d,AuthRequiredError as b,CommandExecutionError as c,TimeoutError as S}from"@jackwener/opencli/errors";const u="www.xiaohongshu.com",I=["query","answer","source_count","source_total_text","sources_summary","sources","warning","message_id","conversation_id"];export function unwrapEvaluateResult(e){if(e&&!Array.isArray(e)&&typeof e==="object"&&"session"in e&&"data"in e)return e.data;return e}function _(e,t,r,n,i){const o=e??t;let s;if(typeof o==="number")s=o;else if(typeof o==="string"&&/^\d+$/.test(o))s=Number(o);else throw new d(`${i} must be an integer between ${r} and ${n}, got ${JSON.stringify(e)}`);if(!Number.isInteger(s)||s<r||s>n)throw new d(`${i} must be an integer between ${r} and ${n}, got ${JSON.stringify(e)}`);return s}export function parseAskTimeout(e){return _(e,90,1,180,"--timeout")}export function parseAskLimit(e){return _(e,10,1,50,"--source-limit")}function l(e){return String(e??"").replace(/<[^>]+>/g,"").replace(/\u200b/g,"").replace(/\r\n/g,`
2
+ `).trim()}function a(e){return l(e).replace(/\s+/g," ").trim()}function f(...e){for(const t of e){const r=a(t);if(r)return r}return""}function v(e){if(e===null||e===void 0||e==="")return null;const t=(o)=>Number.isSafeInteger(o)&&o>=0?o:null;if(typeof e==="number")return t(e);const r=String(e).trim(),n=r.match(/^(\d+(?:\.\d+)?)\s*(万|[wW]|亿)\+?$/);if(n){const o=Number(n[1]),s=n[2]==="亿"?1e8:1e4;return Number.isFinite(o)?t(Math.round(o*s)):null}const i=r.replace(/,/g,"").replace(/\+$/,"");if(/^\d+$/.test(i)&&(r===i||r===`${i}+`||/^\d{1,3}(?:,\d{3})+\+?$/.test(r)))return t(Number(i));return null}function g(e){if(!e)return null;try{return new URL(String(e))}catch{return null}}function k(e){const t=String(e||"").trim();if(!t)return null;const r=t.match(/^xhsdiscover:\/\/item\/([0-9a-f]{24})(?=[?#/]|$)/i);if(r){const s=g(t);return{noteId:r[1],xsecToken:s?.searchParams.get("xsec_token")||s?.searchParams.get("xsecToken")||"",href:t}}let n=g(t);if(!n&&t.startsWith("/"))n=g(`https://${u}${t}`);const i=n?.hostname.toLowerCase();if(!n||n.protocol!=="https:"||i!==u&&i!=="xiaohongshu.com")return null;const o=n.pathname.match(/^\/(?:explore|search_result|note)\/([0-9a-f]{24})\/?$/i);if(!o)return null;return{noteId:o[1],xsecToken:n.searchParams.get("xsec_token")||n.searchParams.get("xsecToken")||"",href:n.toString()}}function A(e){const t=a(e?.id||e?.noteId||e?.note_id);if(/^[0-9a-f]{24}$/i.test(t))return t;const r=[e?.textLink,e?.link,e?.url];for(const n of r){const i=k(n);if(i?.noteId)return i.noteId}return""}export function buildNoteUrl(e,t){if(!/^[0-9a-f]{24}$/i.test(String(e||"")))return"";const r=new URL(`https://${u}/explore/${e}`);if(t){r.searchParams.set("xsec_token",t);r.searchParams.set("xsec_source","")}return r.toString()}function q(e){const t=l(e?.content);if(!t)return"";const r=Array.isArray(e?.originLocation)?e.originLocation:[],n=Number(r[0]),i=Number(r[1]);if(Number.isInteger(n)&&n>=0&&Number.isInteger(i)&&i>0)return a(t.slice(n,n+i)).slice(0,300);return a(t).slice(0,300)}export function normalizeAskSource(e,t){const r=[e?.textLink,e?.link,e?.url].map(k).find(Boolean),n=A(e),i=r?.xsecToken||"",o={rank:t+1,type:"note",title:f(e?.title,e?.displayTitle,e?.name),url:buildNoteUrl(n,i),note_id:n,xsec_token:i,author:f(e?.nickName,e?.nickname,e?.author,e?.userName)},s=f(e?.noteType);if(s)o.note_type=s;const m=v(e?.like);if(m!==null)o.like_count=m;const p=a(e?.userId);if(p)o.user_id=p;const h=a(e?.time);if(h)o.published_at=h;const w=q(e);if(w)o.quote=w;if(r?.href)o.deeplink=r.href;return o}function C(e){return e.slice(0,5).map((t)=>`${t.rank}. ${t.title||t.note_id}${t.author?` - ${t.author}`:""}`).join(`
3
+ `)}export function buildAskResult(e){const r=(Array.isArray(e?.sources)?e.sources:[]).map((s,m)=>normalizeAskSource(s,m)).filter((s)=>s.note_id||s.title||s.url),n=l(e?.answer||e?.base_info?.text||""),i=a(e?.warning),o=r.length===0&&n?`Xiaohongshu 点点 returned an answer but no citation sources.${i?` ${i}`:""}`:i;return{query:a(e?.query),answer:n,source_count:r.length,source_total_text:a(e?.source_total_text),sources_summary:C(r),sources:r,warning:o,message_id:a(e?.message_id),conversation_id:a(e?.conversation_id)}}export function buildAskEvaluateJs(e,t,r){const n=String(e);return`
4
4
  (async () => {
5
5
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
6
6
  const timeoutMs = ${Number(t)} * 1000;
7
- const sourceLimit = ${Number(n)};
7
+ const sourceLimit = ${Number(r)};
8
8
  const requestSourceSize = Math.max(sourceLimit, 10);
9
- const prompt = ${JSON.stringify(r)};
9
+ const prompt = ${JSON.stringify(n)};
10
10
  const simplifyText = (value, max = 6000) => {
11
11
  const text = String(value || '');
12
12
  return text.length > max ? text.slice(0, max) : text;
@@ -127,4 +127,4 @@ import{cli as y,Strategy as x}from"@jackwener/opencli/registry";import{ArgumentE
127
127
  };
128
128
  }
129
129
  })()
130
- `}function C(e){const t=String(e||"").trim();if(!t)throw new d("query is required");return t}function N(e,t){const n=a(e?.error);if(n==="answer_timeout")throw new S("xiaohongshu ask",t,"点点没有在超时时间内返回答案;可以重试或提高 --timeout。");if(n==="send_message_failed")throw new b(u,"Xiaohongshu 点点 did not accept the query. Check login status for www.xiaohongshu.com.");throw new c(`xiaohongshu ask failed: ${n||"unknown error"}`,e?.page_url?`Page URL: ${e.page_url}`:void 0)}function T(e){if(!e||typeof e!=="object")throw new c("xiaohongshu ask returned a malformed page payload");if(!m(e.answer||e.base_info?.text||""))throw new c("xiaohongshu ask returned a malformed page payload: missing answer");if(!a(e.message_id)||!a(e.conversation_id))throw new c("xiaohongshu ask returned a malformed page payload: missing message identity")}export const command=y({site:"xiaohongshu",name:"ask",access:"write",description:"Ask 小红书点点 and return the answer with citation sources.",domain:u,strategy:x.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"query",positional:!0,required:!0,help:"Question for 点点"},{name:"timeout",type:"int",default:90,help:"Seconds to wait for the 点点 answer"},{name:"source-limit",type:"int",default:10,help:"Maximum citation sources to return"}],columns:I,func:async(e,t)=>{const n=C(t?.query),r=parseAskTimeout(t?.timeout),i=parseAskLimit(t?.["source-limit"]),o=encodeURIComponent(n);await e.goto(`https://${u}/search_result?keyword=${o}&source=web_search_result_notes`);await e.wait?.(1);const s=unwrapEvaluateResult(await e.evaluate(buildAskEvaluateJs(n,r,i)));if(!s||typeof s!=="object")throw new c("xiaohongshu ask returned a malformed page payload");if(s.ok===!1)N(s,r);T(s);return buildAskResult(s)}});
130
+ `}function N(e){const t=String(e||"").trim();if(!t)throw new d("query is required");return t}function L(e,t){const r=a(e?.error);if(r==="answer_timeout")throw new S("xiaohongshu ask",t,"点点没有在超时时间内返回答案;可以重试或提高 --timeout。");if(r==="send_message_failed")throw new b(u,"Xiaohongshu 点点 did not accept the query. Check login status for www.xiaohongshu.com.");throw new c(`xiaohongshu ask failed: ${r||"unknown error"}`,e?.page_url?`Page URL: ${e.page_url}`:void 0)}function M(e){if(!e||typeof e!=="object")throw new c("xiaohongshu ask returned a malformed page payload");if(!l(e.answer||e.base_info?.text||""))throw new c("xiaohongshu ask returned a malformed page payload: missing answer");if(!a(e.message_id)||!a(e.conversation_id))throw new c("xiaohongshu ask returned a malformed page payload: missing message identity")}export const command=y({site:"xiaohongshu",name:"ask",access:"write",description:"Ask 小红书点点 and return the answer with citation sources.",domain:u,strategy:x.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"query",positional:!0,required:!0,help:"Question for 点点"},{name:"timeout",type:"int",default:90,help:"Seconds to wait for the 点点 answer"},{name:"source-limit",type:"int",default:10,help:"Maximum citation sources to return"}],columns:I,func:async(e,t)=>{const r=N(t?.query),n=parseAskTimeout(t?.timeout),i=parseAskLimit(t?.["source-limit"]),o=encodeURIComponent(r);await e.goto(`https://${u}/search_result?keyword=${o}&source=web_search_result_notes`);await e.wait?.(1);const s=unwrapEvaluateResult(await e.evaluate(buildAskEvaluateJs(r,n,i)));if(!s||typeof s!=="object")throw new c("xiaohongshu ask returned a malformed page payload");if(s.ok===!1)L(s,n);M(s);return buildAskResult(s)}});
@@ -1,8 +1,8 @@
1
- import{cli as F,Strategy as U}from"@jackwener/opencli/registry";import{AuthRequiredError as j,CliError as T,CommandExecutionError as Z,EmptyResultError as _}from"@jackwener/opencli/errors";import{parseNoteId as y,buildNoteUrl as P}from"./note-helpers.js";const L='.author-wrapper a[href*="/user/profile/"], a.name[href*="/user/profile/"], a.user-name[href*="/user/profile/"], a[href*="/user/profile/"]';export function parseXhsProfileHref(G,D="www.xiaohongshu.com"){const B=typeof G==="string"?G.trim():"";if(!B)return"";const Q=String(D||"www.xiaohongshu.com").toLowerCase();let K;try{K=new URL(B,`https://${Q}`)}catch{return""}if(K.protocol!=="https:")return"";if(K.hostname.toLowerCase()!==Q)return"";return K.pathname.match(/^\/user\/profile\/([a-zA-Z0-9]+)\/?$/)?.[1]??""}export function buildXhsProfileUrl(G,D="www.xiaohongshu.com"){const B=parseXhsProfileHref(G,D);if(!B)return"";return`https://${D}/user/profile/${B}`}export function parseCommentLimit(G,D=20){const B=Number(G);if(!Number.isFinite(B))return D;return Math.max(1,Math.min(Math.floor(B),50))}export function parseXhsLikeCountText(G){const D=/^(?:\d+|\d{1,3}(?:[,,]\d{3})+)\+?$/u,B=/^((?:\d+|\d{1,3}(?:[,,]\d{3})+)(?:\.\d+)?)([wWkK万千])\+?$/u,Q=String(G??"").replace(/\s+/g,"");if(!Q)return 0;if(D.test(Q))return Number(Q.replace(/[,+,]/g,""));const K=Q.match(B);if(!K)return 0;const M=Number(K[1].replace(/[,,]/g,""));if(!Number.isFinite(M))return 0;const Y=K[2].toLowerCase();return Math.round(M*(Y==="w"||Y==="万"?1e4:1000))}function $(G,D,B){if(G==null)return"";if(typeof G!=="string")throw new Z(`${B}: malformed comment row ${D}`);return G}export function normalizeCommentImages(G,D){if(G==null)return[];if(!Array.isArray(G))throw new Z(`${D}: malformed comment row images`);const B=[];for(const Q of G){if(typeof Q!=="string")throw new Z(`${D}: malformed comment row image URL`);const K=Q.trim();let M;try{M=new URL(K)}catch{throw new Z(`${D}: malformed comment row image URL`)}if(M.protocol!=="https:"&&M.protocol!=="http:"||M.username||M.password)throw new Z(`${D}: malformed comment row image URL`);const Y=M.toString();if(!B.includes(Y))B.push(Y)}return B}export function normalizeCommentRows(G,D="xiaohongshu/comments"){if(G==null)return[];if(!Array.isArray(G))throw new Z(`${D}: malformed comments payload`);return G.map((B,Q)=>{if(!B||typeof B!=="object"||Array.isArray(B))throw new Z(`${D}: malformed comment row at index ${Q}`);const K=$(B.text,"text",D);if(!K)throw new Z(`${D}: malformed comment row text`);const M=Number(B.likes);if(!Number.isInteger(M)||M<0)throw new Z(`${D}: malformed comment row likes`);if(typeof B.is_reply!=="boolean")throw new Z(`${D}: malformed comment row is_reply`);return{author:$(B.author,"author",D),authorHrefRaw:$(B.authorHrefRaw,"authorHrefRaw",D),text:K,likes:M,time:$(B.time,"time",D),is_reply:B.is_reply,reply_to:$(B.reply_to,"reply_to",D),images:normalizeCommentImages(B.images,D)}})}export function buildCommentsExtractJs(G,D=20){const B=parseXhsLikeCountText.toString();return`
1
+ import{cli as p,Strategy as d}from"@jackwener/opencli/registry";import{AuthRequiredError as w,CliError as g,CommandExecutionError as a,EmptyResultError as y}from"@jackwener/opencli/errors";import{parseNoteId as x,buildNoteUrl as b}from"./note-helpers.js";const k='.author-wrapper a[href*="/user/profile/"], a.name[href*="/user/profile/"], a.user-name[href*="/user/profile/"], a[href*="/user/profile/"]';export function parseXhsProfileHref(r,t="www.xiaohongshu.com"){const e=typeof r==="string"?r.trim():"";if(!e)return"";const s=String(t||"www.xiaohongshu.com").toLowerCase();let o;try{o=new URL(e,`https://${s}`)}catch{return""}if(o.protocol!=="https:")return"";if(o.hostname.toLowerCase()!==s)return"";return o.pathname.match(/^\/user\/profile\/([a-zA-Z0-9]+)\/?$/)?.[1]??""}export function buildXhsProfileUrl(r,t="www.xiaohongshu.com"){const e=parseXhsProfileHref(r,t);if(!e)return"";return`https://${t}/user/profile/${e}`}export function parseCommentLimit(r,t=20){const e=Number(r);if(!Number.isFinite(e))return t;return Math.max(1,Math.min(Math.floor(e),50))}export function parseXhsLikeCountText(r){const t=/^(?:\d+|\d{1,3}(?:[,,]\d{3})+)\+?$/u,e=/^((?:\d+|\d{1,3}(?:[,,]\d{3})+)(?:\.\d+)?)([wWkK万千])\+?$/u,s=String(r??"").replace(/\s+/g,"");if(!s)return 0;if(t.test(s))return Number(s.replace(/[,+,]/g,""));const o=s.match(e);if(!o)return 0;const n=Number(o[1].replace(/[,,]/g,""));if(!Number.isFinite(n))return 0;const l=o[2].toLowerCase();return Math.round(n*(l==="w"||l==="万"?1e4:1000))}function c(r,t,e){if(r==null)return"";if(typeof r!=="string")throw new a(`${e}: malformed comment row ${t}`);return r}export function normalizeCommentImages(r,t){if(r==null)return[];if(!Array.isArray(r))throw new a(`${t}: malformed comment row images`);const e=[];for(const s of r){if(typeof s!=="string")throw new a(`${t}: malformed comment row image URL`);const o=s.trim();let n;try{n=new URL(o)}catch{throw new a(`${t}: malformed comment row image URL`)}if(n.protocol!=="https:"&&n.protocol!=="http:"||n.username||n.password)throw new a(`${t}: malformed comment row image URL`);const l=n.toString();if(!e.includes(l))e.push(l)}return e}export function normalizeCommentRows(r,t="xiaohongshu/comments"){if(r==null)return[];if(!Array.isArray(r))throw new a(`${t}: malformed comments payload`);return r.map((e,s)=>{if(!e||typeof e!=="object"||Array.isArray(e))throw new a(`${t}: malformed comment row at index ${s}`);const o=c(e.text,"text",t);if(!o)throw new a(`${t}: malformed comment row text`);const n=Number(e.likes);if(!Number.isInteger(n)||n<0)throw new a(`${t}: malformed comment row likes`);if(typeof e.is_reply!=="boolean")throw new a(`${t}: malformed comment row is_reply`);return{author:c(e.author,"author",t),authorHrefRaw:c(e.authorHrefRaw,"authorHrefRaw",t),text:o,likes:n,time:c(e.time,"time",t),is_reply:e.is_reply,reply_to:c(e.reply_to,"reply_to",t),images:normalizeCommentImages(e.images,t)}})}export function buildCommentsExtractJs(r,t=20){const e=parseXhsLikeCountText.toString();return`
2
2
  (async () => {
3
3
  const wait = (ms) => new Promise(r => setTimeout(r, ms))
4
- const withReplies = ${G}
5
- const targetCount = ${Number(D)||20}
4
+ const withReplies = ${r}
5
+ const targetCount = ${Number(t)||20}
6
6
 
7
7
  // Check login state
8
8
  const bodyText = document.body?.innerText || ''
@@ -48,11 +48,11 @@ import{cli as F,Strategy as U}from"@jackwener/opencli/registry";import{AuthRequi
48
48
  }
49
49
 
50
50
  const clean = (el) => (el?.textContent || '').replace(/\\s+/g, ' ').trim()
51
- const parseLikeCountText = ${B}
51
+ const parseLikeCountText = ${e}
52
52
  const parseLikes = (el) => {
53
53
  return parseLikeCountText(clean(el))
54
54
  }
55
- const HREF_SELECTOR = ${JSON.stringify(L)}
55
+ const HREF_SELECTOR = ${JSON.stringify(k)}
56
56
  const extractAuthorHref = (el) => {
57
57
  if (!el) return ''
58
58
  const anchor = el.querySelector(HREF_SELECTOR)
@@ -129,4 +129,4 @@ import{cli as F,Strategy as U}from"@jackwener/opencli/registry";import{AuthRequi
129
129
 
130
130
  return { pageUrl: location.href, securityBlock, loginWall, results }
131
131
  })()
132
- `}export const command=F({site:"xiaohongshu",name:"comments",access:"read",description:"获取小红书笔记评论(支持楼中楼子回复)",domain:"www.xiaohongshu.com",strategy:U.COOKIE,navigateBefore:!1,args:[{name:"note-id",required:!0,positional:!0,help:"Full Xiaohongshu note URL with xsec_token"},{name:"limit",type:"int",default:20,help:"Number of top-level comments (max 50)"},{name:"with-replies",type:"boolean",default:!1,help:"Include nested replies (楼中楼)"}],columns:["rank","author","userId","profileUrl","text","likes","time","is_reply","reply_to","images"],func:async(G,D)=>{const B=parseCommentLimit(D.limit),Q=Boolean(D["with-replies"]),K=String(D["note-id"]),M=y(K);await G.goto(P(K,{commandName:"xiaohongshu comments"}));await G.wait({time:2+Math.random()*3});const Y=await G.evaluate(buildCommentsExtractJs(Q,B));if(!Y||typeof Y!=="object")throw new _("xiaohongshu/comments","Unexpected evaluate response");if(Y.securityBlock)throw new T("SECURITY_BLOCK","Xiaohongshu security block: the note detail page was blocked by risk control.",/^https?:\/\//.test(K)?"The page may be temporarily restricted. Try again later or from a different session.":"Try using a full URL from search results (with xsec_token) instead of a bare note ID.");if(Y.loginWall)throw new j("www.xiaohongshu.com","Note comments require login");const A=normalizeCommentRows(Y.results,"xiaohongshu/comments"),J=(V,q)=>({rank:q+1,author:V.author,userId:V.authorHrefRaw?parseXhsProfileHref(V.authorHrefRaw):"",profileUrl:V.authorHrefRaw?buildXhsProfileUrl(V.authorHrefRaw):"",text:V.text,likes:V.likes,time:V.time,is_reply:V.is_reply,reply_to:V.reply_to,images:V.images??[]});if(Q){const V=[];let q=0;for(const W of A){if(!W.is_reply)q++;if(q>B)break;V.push(W)}return V.map(J)}return A.slice(0,B).map(J)}});
132
+ `}export const command=p({site:"xiaohongshu",name:"comments",access:"read",description:"获取小红书笔记评论(支持楼中楼子回复)",domain:"www.xiaohongshu.com",strategy:d.COOKIE,navigateBefore:!1,args:[{name:"note-id",required:!0,positional:!0,help:"Full Xiaohongshu note URL with xsec_token"},{name:"limit",type:"int",default:20,help:"Number of top-level comments (max 50)"},{name:"with-replies",type:"boolean",default:!1,help:"Include nested replies (楼中楼)"}],columns:["rank","author","userId","profileUrl","text","likes","time","is_reply","reply_to","images"],func:async(r,t)=>{const e=parseCommentLimit(t.limit),s=Boolean(t["with-replies"]),o=String(t["note-id"]),n=x(o);await r.goto(b(o,{commandName:"xiaohongshu comments"}));await r.wait({time:2+Math.random()*3});const l=await r.evaluate(buildCommentsExtractJs(s,e));if(!l||typeof l!=="object")throw new y("xiaohongshu/comments","Unexpected evaluate response");if(l.securityBlock)throw new g("SECURITY_BLOCK","Xiaohongshu security block: the note detail page was blocked by risk control.",/^https?:\/\//.test(o)?"The page may be temporarily restricted. Try again later or from a different session.":"Try using a full URL from search results (with xsec_token) instead of a bare note ID.");if(l.loginWall)throw new w("www.xiaohongshu.com","Note comments require login");const m=normalizeCommentRows(l.results,"xiaohongshu/comments"),f=(i,u)=>({rank:u+1,author:i.author,userId:i.authorHrefRaw?parseXhsProfileHref(i.authorHrefRaw):"",profileUrl:i.authorHrefRaw?buildXhsProfileUrl(i.authorHrefRaw):"",text:i.text,likes:i.likes,time:i.time,is_reply:i.is_reply,reply_to:i.reply_to,images:i.images??[]});if(s){const i=[];let u=0;for(const h of m){if(!h.is_reply)u++;if(u>e)break;i.push(h)}return i.map(f)}return m.slice(0,e).map(f)}});