publishport-opencli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1860) hide show
  1. package/LICENSE +214 -0
  2. package/README.md +299 -0
  3. package/README.zh-CN.md +341 -0
  4. package/cli-manifest.json +51513 -0
  5. package/clis/12306/auth.js +25 -0
  6. package/clis/12306/me.js +9 -0
  7. package/clis/12306/orders.js +13 -0
  8. package/clis/12306/passengers.js +14 -0
  9. package/clis/12306/price.js +1 -0
  10. package/clis/12306/stations.js +1 -0
  11. package/clis/12306/train.js +1 -0
  12. package/clis/12306/trains.js +1 -0
  13. package/clis/12306/utils.js +1 -0
  14. package/clis/1688/assets.js +127 -0
  15. package/clis/1688/auth.js +1 -0
  16. package/clis/1688/download.js +1 -0
  17. package/clis/1688/item.js +21 -0
  18. package/clis/1688/search.js +129 -0
  19. package/clis/1688/shared.js +11 -0
  20. package/clis/1688/store.js +26 -0
  21. package/clis/1point3acres/auth.js +18 -0
  22. package/clis/1point3acres/digest.js +1 -0
  23. package/clis/1point3acres/forum.js +1 -0
  24. package/clis/1point3acres/forums.js +1 -0
  25. package/clis/1point3acres/hot.js +1 -0
  26. package/clis/1point3acres/latest.js +1 -0
  27. package/clis/1point3acres/notifications.js +1 -0
  28. package/clis/1point3acres/search.js +1 -0
  29. package/clis/1point3acres/thread.js +2 -0
  30. package/clis/1point3acres/user.js +1 -0
  31. package/clis/1point3acres/utils.js +6 -0
  32. package/clis/36kr/article.js +20 -0
  33. package/clis/36kr/hot.js +16 -0
  34. package/clis/36kr/news.js +1 -0
  35. package/clis/36kr/search.js +36 -0
  36. package/clis/51job/company.js +36 -0
  37. package/clis/51job/detail.js +35 -0
  38. package/clis/51job/hot.js +1 -0
  39. package/clis/51job/search.js +1 -0
  40. package/clis/51job/utils.js +21 -0
  41. package/clis/_atlassian/shared.js +21 -0
  42. package/clis/_shared/article/auth.js +16 -0
  43. package/clis/_shared/article/douban-md2draft.js +4 -0
  44. package/clis/_shared/article/format.js +1 -0
  45. package/clis/_shared/article/images.js +95 -0
  46. package/clis/_shared/article/login.js +1 -0
  47. package/clis/_shared/article/page-runtime.js +745 -0
  48. package/clis/_shared/article/publish.js +34 -0
  49. package/clis/_shared/common.js +1 -0
  50. package/clis/_shared/content-guard.js +1 -0
  51. package/clis/_shared/desktop-commands.js +1 -0
  52. package/clis/_shared/search-adapter.js +1 -0
  53. package/clis/_shared/site-auth.js +1 -0
  54. package/clis/_shared/token-auth.js +2 -0
  55. package/clis/_shared/video-publish.js +62 -0
  56. package/clis/aibase/news.js +31 -0
  57. package/clis/amazon/auth.js +19 -0
  58. package/clis/amazon/bestsellers.js +1 -0
  59. package/clis/amazon/discussion.js +20 -0
  60. package/clis/amazon/movers-shakers.js +1 -0
  61. package/clis/amazon/new-releases.js +1 -0
  62. package/clis/amazon/offer.js +29 -0
  63. package/clis/amazon/product.js +25 -0
  64. package/clis/amazon/rankings.js +68 -0
  65. package/clis/amazon/search.js +16 -0
  66. package/clis/amazon/shared.js +11 -0
  67. package/clis/antigravity/SKILL.md +38 -0
  68. package/clis/antigravity/_actions.js +201 -0
  69. package/clis/antigravity/audit-extras.js +78 -0
  70. package/clis/antigravity/delete.js +1 -0
  71. package/clis/antigravity/dump.js +1 -0
  72. package/clis/antigravity/extract-code.js +18 -0
  73. package/clis/antigravity/history.js +1 -0
  74. package/clis/antigravity/mark-read.js +1 -0
  75. package/clis/antigravity/model.js +90 -0
  76. package/clis/antigravity/new.js +9 -0
  77. package/clis/antigravity/read.js +10 -0
  78. package/clis/antigravity/rename.js +1 -0
  79. package/clis/antigravity/send.js +11 -0
  80. package/clis/antigravity/serve.js +97 -0
  81. package/clis/antigravity/status.js +1 -0
  82. package/clis/antigravity/storage.js +12 -0
  83. package/clis/antigravity/watch.js +6 -0
  84. package/clis/apple-podcasts/episodes.js +1 -0
  85. package/clis/apple-podcasts/search.js +1 -0
  86. package/clis/apple-podcasts/top.js +1 -0
  87. package/clis/apple-podcasts/utils.js +1 -0
  88. package/clis/archive/item.js +1 -0
  89. package/clis/archive/search.js +1 -0
  90. package/clis/archive/snapshots.js +1 -0
  91. package/clis/archive/wayback.js +1 -0
  92. package/clis/arxiv/author.js +1 -0
  93. package/clis/arxiv/paper.js +1 -0
  94. package/clis/arxiv/recent.js +1 -0
  95. package/clis/arxiv/search.js +1 -0
  96. package/clis/arxiv/utils.js +1 -0
  97. package/clis/autohome/__fixtures__/catalog.html +11 -0
  98. package/clis/autohome/__fixtures__/koubei.json +116 -0
  99. package/clis/autohome/brand.js +1 -0
  100. package/clis/autohome/score.js +1 -0
  101. package/clis/autohome/utils.js +1 -0
  102. package/clis/baidu-scholar/search.js +63 -0
  103. package/clis/baijiahao/article.js +1 -0
  104. package/clis/baijiahao/lists.js +1 -0
  105. package/clis/baijiahao/login.js +1 -0
  106. package/clis/baijiahao/publish.js +57 -0
  107. package/clis/baijiahao/stats.js +1 -0
  108. package/clis/baijiahao/whoami.js +1 -0
  109. package/clis/band/auth.js +29 -0
  110. package/clis/band/bands.js +37 -0
  111. package/clis/band/mentions.js +6 -0
  112. package/clis/band/post.js +76 -0
  113. package/clis/band/posts.js +50 -0
  114. package/clis/barchart/flow.js +70 -0
  115. package/clis/barchart/greeks.js +88 -0
  116. package/clis/barchart/options.js +61 -0
  117. package/clis/barchart/quote.js +87 -0
  118. package/clis/bbc/news.js +1 -0
  119. package/clis/bbc/topic.js +1 -0
  120. package/clis/bbc/utils.js +1 -0
  121. package/clis/bilibili/article.js +1 -0
  122. package/clis/bilibili/auth.js +1 -0
  123. package/clis/bilibili/categories.js +1 -0
  124. package/clis/bilibili/coin.js +1 -0
  125. package/clis/bilibili/comment-del.js +1 -0
  126. package/clis/bilibili/comment-like.js +1 -0
  127. package/clis/bilibili/comment.js +1 -0
  128. package/clis/bilibili/comments.js +1 -0
  129. package/clis/bilibili/dm-list.js +1 -0
  130. package/clis/bilibili/dm-read.js +1 -0
  131. package/clis/bilibili/dm-send.js +1 -0
  132. package/clis/bilibili/download.js +7 -0
  133. package/clis/bilibili/drafts.js +1 -0
  134. package/clis/bilibili/dynamic-post.js +24 -0
  135. package/clis/bilibili/dynamic.js +1 -0
  136. package/clis/bilibili/favorite-add.js +1 -0
  137. package/clis/bilibili/favorite.js +1 -0
  138. package/clis/bilibili/feed.js +2 -0
  139. package/clis/bilibili/follow.js +1 -0
  140. package/clis/bilibili/following.js +1 -0
  141. package/clis/bilibili/history.js +1 -0
  142. package/clis/bilibili/hot.js +15 -0
  143. package/clis/bilibili/like.js +1 -0
  144. package/clis/bilibili/me.js +1 -0
  145. package/clis/bilibili/partitions.js +1 -0
  146. package/clis/bilibili/ranking.js +1 -0
  147. package/clis/bilibili/search.js +1 -0
  148. package/clis/bilibili/stats.js +1 -0
  149. package/clis/bilibili/subtitle.js +21 -0
  150. package/clis/bilibili/summary.js +1 -0
  151. package/clis/bilibili/topics.js +1 -0
  152. package/clis/bilibili/unfollow.js +1 -0
  153. package/clis/bilibili/upload.js +1 -0
  154. package/clis/bilibili/user-videos.js +1 -0
  155. package/clis/bilibili/utils.js +50 -0
  156. package/clis/bilibili/video-drafts.js +1 -0
  157. package/clis/bilibili/video.js +1 -0
  158. package/clis/binance/asks.js +1 -0
  159. package/clis/binance/depth.js +1 -0
  160. package/clis/binance/gainers.js +1 -0
  161. package/clis/binance/klines.js +1 -0
  162. package/clis/binance/losers.js +1 -0
  163. package/clis/binance/pairs.js +1 -0
  164. package/clis/binance/price.js +1 -0
  165. package/clis/binance/prices.js +1 -0
  166. package/clis/binance/ticker.js +1 -0
  167. package/clis/binance/top.js +1 -0
  168. package/clis/binance/trades.js +1 -0
  169. package/clis/bloomberg/businessweek.js +12 -0
  170. package/clis/bloomberg/crypto.js +1 -0
  171. package/clis/bloomberg/economics.js +1 -0
  172. package/clis/bloomberg/feeds.js +1 -0
  173. package/clis/bloomberg/green.js +1 -0
  174. package/clis/bloomberg/industries.js +1 -0
  175. package/clis/bloomberg/main.js +1 -0
  176. package/clis/bloomberg/markets.js +1 -0
  177. package/clis/bloomberg/news.js +57 -0
  178. package/clis/bloomberg/opinions.js +1 -0
  179. package/clis/bloomberg/politics.js +1 -0
  180. package/clis/bloomberg/pursuits.js +1 -0
  181. package/clis/bloomberg/tech.js +1 -0
  182. package/clis/bloomberg/utils.js +17 -0
  183. package/clis/bluesky/post.js +1 -0
  184. package/clis/bluesky/shared.js +56 -0
  185. package/clis/bluesky/whoami.js +1 -0
  186. package/clis/booking/search.js +93 -0
  187. package/clis/boss/auth.js +13 -0
  188. package/clis/boss/batchgreet.js +1 -0
  189. package/clis/boss/chatlist.js +1 -0
  190. package/clis/boss/chatmsg.js +1 -0
  191. package/clis/boss/detail.js +1 -0
  192. package/clis/boss/exchange.js +1 -0
  193. package/clis/boss/greet.js +1 -0
  194. package/clis/boss/invite.js +4 -0
  195. package/clis/boss/joblist.js +1 -0
  196. package/clis/boss/mark.js +1 -0
  197. package/clis/boss/recommend.js +1 -0
  198. package/clis/boss/resume.js +90 -0
  199. package/clis/boss/search.js +1 -0
  200. package/clis/boss/send.js +1 -0
  201. package/clis/boss/stats.js +1 -0
  202. package/clis/boss/utils.js +161 -0
  203. package/clis/brave/search.js +23 -0
  204. package/clis/chaoxing/assignments.js +1 -0
  205. package/clis/chaoxing/auth.js +21 -0
  206. package/clis/chaoxing/exams.js +1 -0
  207. package/clis/chaoxing/utils.js +58 -0
  208. package/clis/chatgpt/ask.js +1 -0
  209. package/clis/chatgpt/auth.js +17 -0
  210. package/clis/chatgpt/detail.js +1 -0
  211. package/clis/chatgpt/history.js +1 -0
  212. package/clis/chatgpt/image.js +1 -0
  213. package/clis/chatgpt/model.js +1 -0
  214. package/clis/chatgpt/new.js +1 -0
  215. package/clis/chatgpt/project-file-add.js +1 -0
  216. package/clis/chatgpt/project-list.js +1 -0
  217. package/clis/chatgpt/read.js +1 -0
  218. package/clis/chatgpt/send.js +1 -0
  219. package/clis/chatgpt/status.js +1 -0
  220. package/clis/chatgpt/utils.js +1092 -0
  221. package/clis/chatgpt-app/ask.js +1 -0
  222. package/clis/chatgpt-app/ax.js +512 -0
  223. package/clis/chatgpt-app/model.js +1 -0
  224. package/clis/chatgpt-app/new.js +1 -0
  225. package/clis/chatgpt-app/read.js +1 -0
  226. package/clis/chatgpt-app/send.js +1 -0
  227. package/clis/chatgpt-app/status.js +1 -0
  228. package/clis/chatwise/ask.js +1 -0
  229. package/clis/chatwise/export.js +21 -0
  230. package/clis/chatwise/history.js +26 -0
  231. package/clis/chatwise/model.js +48 -0
  232. package/clis/chatwise/new.js +1 -0
  233. package/clis/chatwise/read.js +25 -0
  234. package/clis/chatwise/screenshot.js +1 -0
  235. package/clis/chatwise/send.js +1 -0
  236. package/clis/chatwise/status.js +1 -0
  237. package/clis/chatwise/utils.js +75 -0
  238. package/clis/chess/analyze.js +1 -0
  239. package/clis/chess/game.js +1 -0
  240. package/clis/chess/games.js +1 -0
  241. package/clis/chess/stats.js +1 -0
  242. package/clis/chess/utils.js +1 -0
  243. package/clis/claude/ask.js +4 -0
  244. package/clis/claude/auth.js +19 -0
  245. package/clis/claude/detail.js +1 -0
  246. package/clis/claude/history.js +1 -0
  247. package/clis/claude/new.js +1 -0
  248. package/clis/claude/read.js +1 -0
  249. package/clis/claude/send.js +1 -0
  250. package/clis/claude/status.js +1 -0
  251. package/clis/claude/utils.js +179 -0
  252. package/clis/cnblogs/article.js +1 -0
  253. package/clis/cnblogs/login.js +1 -0
  254. package/clis/cnblogs/stats.js +37 -0
  255. package/clis/cnblogs/whoami.js +1 -0
  256. package/clis/cnki/search.js +38 -0
  257. package/clis/codex/_actions.js +72 -0
  258. package/clis/codex/archive.js +1 -0
  259. package/clis/codex/ask.js +23 -0
  260. package/clis/codex/dump.js +1 -0
  261. package/clis/codex/export.js +12 -0
  262. package/clis/codex/extract-diff.js +28 -0
  263. package/clis/codex/history.js +1 -0
  264. package/clis/codex/model.js +118 -0
  265. package/clis/codex/new.js +1 -0
  266. package/clis/codex/pin.js +1 -0
  267. package/clis/codex/projects.js +1 -0
  268. package/clis/codex/read.js +16 -0
  269. package/clis/codex/rename.js +34 -0
  270. package/clis/codex/screenshot.js +1 -0
  271. package/clis/codex/send.js +16 -0
  272. package/clis/codex/sidebar.js +1 -0
  273. package/clis/codex/status.js +1 -0
  274. package/clis/coingecko/categories.js +1 -0
  275. package/clis/coingecko/coin.js +1 -0
  276. package/clis/coingecko/derivatives.js +1 -0
  277. package/clis/coingecko/exchanges.js +1 -0
  278. package/clis/coingecko/global.js +1 -0
  279. package/clis/coingecko/top.js +1 -0
  280. package/clis/coingecko/trending.js +1 -0
  281. package/clis/confluence/create.js +1 -0
  282. package/clis/confluence/page.js +1 -0
  283. package/clis/confluence/search.js +1 -0
  284. package/clis/confluence/shared.js +1 -0
  285. package/clis/confluence/update.js +1 -0
  286. package/clis/coupang/add-to-cart.js +86 -0
  287. package/clis/coupang/auth.js +16 -0
  288. package/clis/coupang/product.js +161 -0
  289. package/clis/coupang/search.js +385 -0
  290. package/clis/coupang/utils.js +1 -0
  291. package/clis/crates/crate.js +1 -0
  292. package/clis/crates/search.js +1 -0
  293. package/clis/crates/utils.js +1 -0
  294. package/clis/csdn/article.js +29 -0
  295. package/clis/csdn/columns.js +1 -0
  296. package/clis/csdn/login.js +1 -0
  297. package/clis/csdn/stats.js +71 -0
  298. package/clis/csdn/whoami.js +1 -0
  299. package/clis/cto51/article.js +1 -0
  300. package/clis/cto51/whoami.js +1 -0
  301. package/clis/ctrip/auth.js +1 -0
  302. package/clis/ctrip/flight.js +17 -0
  303. package/clis/ctrip/hotel-search.js +24 -0
  304. package/clis/ctrip/hotel-suggest.js +1 -0
  305. package/clis/ctrip/search.js +1 -0
  306. package/clis/ctrip/utils.js +119 -0
  307. package/clis/cursor/ask.js +22 -0
  308. package/clis/cursor/composer.js +12 -0
  309. package/clis/cursor/dump.js +1 -0
  310. package/clis/cursor/export.js +23 -0
  311. package/clis/cursor/extract-code.js +18 -0
  312. package/clis/cursor/history.js +26 -0
  313. package/clis/cursor/model.js +18 -0
  314. package/clis/cursor/new.js +1 -0
  315. package/clis/cursor/read.js +27 -0
  316. package/clis/cursor/screenshot.js +1 -0
  317. package/clis/cursor/send.js +12 -0
  318. package/clis/cursor/status.js +1 -0
  319. package/clis/dblp/author.js +1 -0
  320. package/clis/dblp/paper.js +1 -0
  321. package/clis/dblp/search.js +1 -0
  322. package/clis/dblp/utils.js +1 -0
  323. package/clis/dblp/venue.js +1 -0
  324. package/clis/deepseek/ask.js +1 -0
  325. package/clis/deepseek/auth.js +22 -0
  326. package/clis/deepseek/detail.js +1 -0
  327. package/clis/deepseek/history.js +1 -0
  328. package/clis/deepseek/new.js +1 -0
  329. package/clis/deepseek/read.js +1 -0
  330. package/clis/deepseek/send.js +50 -0
  331. package/clis/deepseek/status.js +1 -0
  332. package/clis/deepseek/utils.js +202 -0
  333. package/clis/defillama/protocol.js +1 -0
  334. package/clis/defillama/protocols.js +1 -0
  335. package/clis/defillama/utils.js +1 -0
  336. package/clis/devto/auth.js +9 -0
  337. package/clis/devto/latest.js +1 -0
  338. package/clis/devto/publish.js +17 -0
  339. package/clis/devto/read.js +3 -0
  340. package/clis/devto/stats.js +27 -0
  341. package/clis/devto/tag.js +1 -0
  342. package/clis/devto/top.js +1 -0
  343. package/clis/devto/user.js +1 -0
  344. package/clis/dianping/__fixtures__/search.html +168 -0
  345. package/clis/dianping/__fixtures__/shop.html +6 -0
  346. package/clis/dianping/auth.js +10 -0
  347. package/clis/dianping/cityResolver.js +4 -0
  348. package/clis/dianping/search.js +1 -0
  349. package/clis/dianping/shop.js +1 -0
  350. package/clis/dianping/utils.js +1 -0
  351. package/clis/dictionary/examples.js +1 -0
  352. package/clis/dictionary/search.js +1 -0
  353. package/clis/dictionary/synonyms.js +1 -0
  354. package/clis/discord-app/channels.js +1 -0
  355. package/clis/discord-app/delete.js +66 -0
  356. package/clis/discord-app/goto.js +1 -0
  357. package/clis/discord-app/members.js +21 -0
  358. package/clis/discord-app/read.js +1 -0
  359. package/clis/discord-app/search.js +29 -0
  360. package/clis/discord-app/send.js +10 -0
  361. package/clis/discord-app/servers.js +1 -0
  362. package/clis/discord-app/status.js +1 -0
  363. package/clis/discord-app/thread-read.js +1 -0
  364. package/clis/discord-app/threads.js +1 -0
  365. package/clis/discord-app/utils.js +226 -0
  366. package/clis/discord-web/auth.js +10 -0
  367. package/clis/discord-web/send.js +13 -0
  368. package/clis/dockerhub/image.js +1 -0
  369. package/clis/dockerhub/search.js +1 -0
  370. package/clis/dockerhub/utils.js +1 -0
  371. package/clis/dongchedi/__fixtures__/search.json +60 -0
  372. package/clis/dongchedi/__fixtures__/series-detail.json +911 -0
  373. package/clis/dongchedi/__fixtures__/series-score.json +1396 -0
  374. package/clis/dongchedi/koubei.js +1 -0
  375. package/clis/dongchedi/models.js +1 -0
  376. package/clis/dongchedi/score.js +1 -0
  377. package/clis/dongchedi/search.js +1 -0
  378. package/clis/dongchedi/series.js +1 -0
  379. package/clis/dongchedi/specs.js +1 -0
  380. package/clis/dongchedi/utils.js +1 -0
  381. package/clis/douban/article.js +53 -0
  382. package/clis/douban/auth.js +21 -0
  383. package/clis/douban/book-hot.js +1 -0
  384. package/clis/douban/download.js +1 -0
  385. package/clis/douban/marks.js +59 -0
  386. package/clis/douban/movie-hot.js +1 -0
  387. package/clis/douban/photos.js +1 -0
  388. package/clis/douban/reviews.js +53 -0
  389. package/clis/douban/search.js +1 -0
  390. package/clis/douban/subject.js +1 -0
  391. package/clis/douban/top250.js +50 -0
  392. package/clis/douban/utils.js +344 -0
  393. package/clis/doubao/ask.js +1 -0
  394. package/clis/doubao/auth.js +28 -0
  395. package/clis/doubao/detail.js +1 -0
  396. package/clis/doubao/history.js +1 -0
  397. package/clis/doubao/meeting-summary.js +1 -0
  398. package/clis/doubao/meeting-transcript.js +1 -0
  399. package/clis/doubao/new.js +1 -0
  400. package/clis/doubao/read.js +1 -0
  401. package/clis/doubao/send.js +1 -0
  402. package/clis/doubao/status.js +1 -0
  403. package/clis/doubao/utils.js +704 -0
  404. package/clis/doubao-app/ask.js +1 -0
  405. package/clis/doubao-app/dump.js +1 -0
  406. package/clis/doubao-app/new.js +1 -0
  407. package/clis/doubao-app/read.js +1 -0
  408. package/clis/doubao-app/screenshot.js +1 -0
  409. package/clis/doubao-app/send.js +1 -0
  410. package/clis/doubao-app/status.js +1 -0
  411. package/clis/doubao-app/utils.js +64 -0
  412. package/clis/douyin/_shared/browser-fetch.js +28 -0
  413. package/clis/douyin/_shared/creation-id.js +1 -0
  414. package/clis/douyin/_shared/evaluate-result.js +1 -0
  415. package/clis/douyin/_shared/imagex-upload.js +1 -0
  416. package/clis/douyin/_shared/public-api.js +1 -0
  417. package/clis/douyin/_shared/sts2.js +1 -0
  418. package/clis/douyin/_shared/text-extra.js +1 -0
  419. package/clis/douyin/_shared/timing.js +1 -0
  420. package/clis/douyin/_shared/tos-upload.js +5 -0
  421. package/clis/douyin/_shared/transcode.js +1 -0
  422. package/clis/douyin/_shared/types.js +1 -0
  423. package/clis/douyin/_shared/vod-upload.js +5 -0
  424. package/clis/douyin/activities.js +1 -0
  425. package/clis/douyin/auth.js +1 -0
  426. package/clis/douyin/collections.js +1 -0
  427. package/clis/douyin/delete.js +76 -0
  428. package/clis/douyin/draft.js +166 -0
  429. package/clis/douyin/drafts.js +1 -0
  430. package/clis/douyin/hashtag.js +1 -0
  431. package/clis/douyin/location.js +1 -0
  432. package/clis/douyin/profile.js +1 -0
  433. package/clis/douyin/publish-image.js +64 -0
  434. package/clis/douyin/publish.js +14 -0
  435. package/clis/douyin/search.js +51 -0
  436. package/clis/douyin/stats.js +1 -0
  437. package/clis/douyin/update.js +1 -0
  438. package/clis/douyin/user-videos.js +1 -0
  439. package/clis/douyin/videos.js +1 -0
  440. package/clis/duckduckgo/search.js +1 -0
  441. package/clis/duckduckgo/suggest.js +1 -0
  442. package/clis/eastmoney/_secid.js +1 -0
  443. package/clis/eastmoney/announcement.js +1 -0
  444. package/clis/eastmoney/article.js +1 -0
  445. package/clis/eastmoney/convertible.js +1 -0
  446. package/clis/eastmoney/etf.js +1 -0
  447. package/clis/eastmoney/holders.js +1 -0
  448. package/clis/eastmoney/hot-rank.js +30 -0
  449. package/clis/eastmoney/index-board.js +1 -0
  450. package/clis/eastmoney/kline.js +1 -0
  451. package/clis/eastmoney/kuaixun.js +1 -0
  452. package/clis/eastmoney/longhu.js +1 -0
  453. package/clis/eastmoney/money-flow.js +1 -0
  454. package/clis/eastmoney/northbound.js +1 -0
  455. package/clis/eastmoney/quote.js +1 -0
  456. package/clis/eastmoney/rank.js +1 -0
  457. package/clis/eastmoney/sectors.js +1 -0
  458. package/clis/eastmoney/whoami.js +1 -0
  459. package/clis/endoflife/product.js +1 -0
  460. package/clis/endoflife/utils.js +1 -0
  461. package/clis/facebook/__fixtures__/notifications-page.html +13 -0
  462. package/clis/facebook/add-friend.js +24 -0
  463. package/clis/facebook/auth.js +1 -0
  464. package/clis/facebook/comment.js +18 -0
  465. package/clis/facebook/events.js +26 -0
  466. package/clis/facebook/feed.js +209 -0
  467. package/clis/facebook/friends.js +24 -0
  468. package/clis/facebook/groups.js +32 -0
  469. package/clis/facebook/join-group.js +25 -0
  470. package/clis/facebook/like.js +29 -0
  471. package/clis/facebook/marketplace-inbox.js +34 -0
  472. package/clis/facebook/marketplace-listings.js +33 -0
  473. package/clis/facebook/memories.js +21 -0
  474. package/clis/facebook/notifications.js +31 -0
  475. package/clis/facebook/post.js +88 -0
  476. package/clis/facebook/profile.js +18 -0
  477. package/clis/facebook/search.js +22 -0
  478. package/clis/flathub/app.js +1 -0
  479. package/clis/flathub/search.js +1 -0
  480. package/clis/flathub/utils.js +1 -0
  481. package/clis/flomo/auth.js +22 -0
  482. package/clis/flomo/memos.js +13 -0
  483. package/clis/gemini/ask.js +1 -0
  484. package/clis/gemini/auth.js +14 -0
  485. package/clis/gemini/deep-research-result.js +4 -0
  486. package/clis/gemini/deep-research.js +1 -0
  487. package/clis/gemini/detail.js +1 -0
  488. package/clis/gemini/history.js +1 -0
  489. package/clis/gemini/image.js +3 -0
  490. package/clis/gemini/new.js +1 -0
  491. package/clis/gemini/read.js +1 -0
  492. package/clis/gemini/status.js +1 -0
  493. package/clis/gemini/utils.js +1234 -0
  494. package/clis/geogebra/add-circle.js +1 -0
  495. package/clis/geogebra/add-line.js +1 -0
  496. package/clis/geogebra/add-point.js +1 -0
  497. package/clis/geogebra/add-polygon.js +1 -0
  498. package/clis/geogebra/eval.js +1 -0
  499. package/clis/geogebra/hexagon.js +1 -0
  500. package/clis/geogebra/info.js +13 -0
  501. package/clis/geogebra/list.js +1 -0
  502. package/clis/geogebra/triangle.js +1 -0
  503. package/clis/geogebra/utils.js +99 -0
  504. package/clis/ghost/publish.js +1 -0
  505. package/clis/ghost/shared.js +1 -0
  506. package/clis/ghost/whoami.js +1 -0
  507. package/clis/gitee/auth.js +12 -0
  508. package/clis/gitee/index.js +1 -0
  509. package/clis/gitee/search.js +1 -0
  510. package/clis/gitee/trending.js +240 -0
  511. package/clis/gitee/user.js +71 -0
  512. package/clis/github/auth.js +7 -0
  513. package/clis/github-trending/repos.js +1 -0
  514. package/clis/google/news.js +1 -0
  515. package/clis/google/search.js +90 -0
  516. package/clis/google/suggest.js +1 -0
  517. package/clis/google/trends.js +1 -0
  518. package/clis/google/utils.js +1 -0
  519. package/clis/google-scholar/cite.js +20 -0
  520. package/clis/google-scholar/profile.js +36 -0
  521. package/clis/google-scholar/search.js +35 -0
  522. package/clis/goproxy/module.js +1 -0
  523. package/clis/goproxy/utils.js +1 -0
  524. package/clis/goproxy/versions.js +1 -0
  525. package/clis/gov-law/recent.js +1 -0
  526. package/clis/gov-law/search.js +14 -0
  527. package/clis/gov-law/shared.js +29 -0
  528. package/clis/gov-policy/__fixtures__/recent.html +16 -0
  529. package/clis/gov-policy/__fixtures__/search.html +41 -0
  530. package/clis/gov-policy/recent.js +8 -0
  531. package/clis/gov-policy/search.js +8 -0
  532. package/clis/gov-policy/utils.js +1 -0
  533. package/clis/grok/ask.js +1 -0
  534. package/clis/grok/auth.js +17 -0
  535. package/clis/grok/delete.js +1 -0
  536. package/clis/grok/detail.js +1 -0
  537. package/clis/grok/export-all.js +170 -0
  538. package/clis/grok/export-utils.js +1 -0
  539. package/clis/grok/export.js +106 -0
  540. package/clis/grok/history.js +1 -0
  541. package/clis/grok/image.js +119 -0
  542. package/clis/grok/image.test.ts +127 -0
  543. package/clis/grok/new.js +1 -0
  544. package/clis/grok/pin.js +1 -0
  545. package/clis/grok/read.js +1 -0
  546. package/clis/grok/send.js +1 -0
  547. package/clis/grok/status.js +1 -0
  548. package/clis/grok/utils.js +337 -0
  549. package/clis/guazi/__fixtures__/detail.html +7 -0
  550. package/clis/guazi/__fixtures__/list.html +5 -0
  551. package/clis/guazi/browse.js +1 -0
  552. package/clis/guazi/car.js +1 -0
  553. package/clis/guazi/utils.js +1 -0
  554. package/clis/hackernews/ask.js +1 -0
  555. package/clis/hackernews/auth.js +9 -0
  556. package/clis/hackernews/best.js +1 -0
  557. package/clis/hackernews/comment.js +61 -0
  558. package/clis/hackernews/jobs.js +1 -0
  559. package/clis/hackernews/new.js +1 -0
  560. package/clis/hackernews/read.js +11 -0
  561. package/clis/hackernews/search.js +1 -0
  562. package/clis/hackernews/show.js +1 -0
  563. package/clis/hackernews/submit.js +65 -0
  564. package/clis/hackernews/top.js +1 -0
  565. package/clis/hackernews/user.js +1 -0
  566. package/clis/hashnode/auth.js +11 -0
  567. package/clis/hashnode/publish.js +92 -0
  568. package/clis/hf/auth.js +12 -0
  569. package/clis/hf/datasets.js +1 -0
  570. package/clis/hf/models.js +1 -0
  571. package/clis/hf/paper.js +1 -0
  572. package/clis/hf/spaces.js +1 -0
  573. package/clis/hf/top.js +1 -0
  574. package/clis/homebrew/cask.js +1 -0
  575. package/clis/homebrew/formula.js +1 -0
  576. package/clis/homebrew/popular.js +1 -0
  577. package/clis/homebrew/utils.js +1 -0
  578. package/clis/huodongxing/events.js +1 -0
  579. package/clis/hupu/__fixtures__/hot-home.html +64 -0
  580. package/clis/hupu/auth.js +14 -0
  581. package/clis/hupu/detail.js +7 -0
  582. package/clis/hupu/hot.js +14 -0
  583. package/clis/hupu/like.js +1 -0
  584. package/clis/hupu/mentions.js +91 -0
  585. package/clis/hupu/reply.js +1 -0
  586. package/clis/hupu/search.js +1 -0
  587. package/clis/hupu/unlike.js +1 -0
  588. package/clis/hupu/utils.js +243 -0
  589. package/clis/imdb/person.js +140 -0
  590. package/clis/imdb/reviews.js +40 -0
  591. package/clis/imdb/search.js +113 -0
  592. package/clis/imdb/title.js +1 -0
  593. package/clis/imdb/top.js +1 -0
  594. package/clis/imdb/trending.js +1 -0
  595. package/clis/imdb/utils.js +162 -0
  596. package/clis/imooc/article.js +59 -0
  597. package/clis/imooc/login.js +1 -0
  598. package/clis/imooc/whoami.js +1 -0
  599. package/clis/indeed/job.js +20 -0
  600. package/clis/indeed/search.js +37 -0
  601. package/clis/indeed/utils.js +1 -0
  602. package/clis/infoq/article.js +19 -0
  603. package/clis/infoq/login.js +1 -0
  604. package/clis/infoq/whoami.js +1 -0
  605. package/clis/instagram/_shared/private-publish.js +75 -0
  606. package/clis/instagram/_shared/protocol-capture.js +180 -0
  607. package/clis/instagram/_shared/runtime-info.js +33 -0
  608. package/clis/instagram/auth.js +22 -0
  609. package/clis/instagram/collection-create.js +38 -0
  610. package/clis/instagram/collection-delete.js +72 -0
  611. package/clis/instagram/comment.js +26 -0
  612. package/clis/instagram/detail.js +2 -0
  613. package/clis/instagram/download.js +83 -0
  614. package/clis/instagram/explore.js +27 -0
  615. package/clis/instagram/follow.js +24 -0
  616. package/clis/instagram/followers.js +30 -0
  617. package/clis/instagram/following.js +74 -0
  618. package/clis/instagram/like.js +25 -0
  619. package/clis/instagram/note.js +162 -0
  620. package/clis/instagram/post.js +718 -0
  621. package/clis/instagram/profile.js +25 -0
  622. package/clis/instagram/reel.js +452 -0
  623. package/clis/instagram/save.js +25 -0
  624. package/clis/instagram/saved.js +37 -0
  625. package/clis/instagram/search.js +23 -0
  626. package/clis/instagram/story.js +21 -0
  627. package/clis/instagram/unfollow.js +21 -0
  628. package/clis/instagram/unlike.js +25 -0
  629. package/clis/instagram/unsave.js +25 -0
  630. package/clis/instagram/user.js +1 -0
  631. package/clis/jd/add-cart.js +22 -0
  632. package/clis/jd/auth.js +12 -0
  633. package/clis/jd/cart.js +59 -0
  634. package/clis/jd/detail.js +42 -0
  635. package/clis/jd/item.js +98 -0
  636. package/clis/jd/item.test.ts +517 -0
  637. package/clis/jd/reviews.js +31 -0
  638. package/clis/jd/search.js +42 -0
  639. package/clis/jianshu/article.js +1 -0
  640. package/clis/jianshu/login.js +1 -0
  641. package/clis/jianshu/notebooks.js +1 -0
  642. package/clis/jianshu/whoami.js +1 -0
  643. package/clis/jianyu/auth.js +28 -0
  644. package/clis/jianyu/detail.js +1 -0
  645. package/clis/jianyu/search.js +73 -0
  646. package/clis/jianyu/shared/china-bid-search.js +86 -0
  647. package/clis/jianyu/shared/procurement-contract.js +1 -0
  648. package/clis/jianyu/shared/procurement-detail.js +18 -0
  649. package/clis/jike/auth.js +19 -0
  650. package/clis/jike/comment.js +82 -0
  651. package/clis/jike/create.js +83 -0
  652. package/clis/jike/feed.js +32 -0
  653. package/clis/jike/like.js +38 -0
  654. package/clis/jike/notifications.js +115 -0
  655. package/clis/jike/post.js +33 -0
  656. package/clis/jike/repost.js +67 -0
  657. package/clis/jike/search.js +29 -0
  658. package/clis/jike/topic.js +20 -0
  659. package/clis/jike/user.js +19 -0
  660. package/clis/jike/utils.js +15 -0
  661. package/clis/jimeng/auth.js +13 -0
  662. package/clis/jimeng/generate.js +60 -0
  663. package/clis/jimeng/history.js +32 -0
  664. package/clis/jimeng/new.js +26 -0
  665. package/clis/jimeng/workspaces.js +22 -0
  666. package/clis/jira/attachments.js +1 -0
  667. package/clis/jira/comments.js +1 -0
  668. package/clis/jira/issue.js +1 -0
  669. package/clis/jira/links.js +1 -0
  670. package/clis/jira/search.js +1 -0
  671. package/clis/jira/shared.js +1 -0
  672. package/clis/juejin/article.js +5 -0
  673. package/clis/juejin/categories.js +1 -0
  674. package/clis/juejin/hot.js +1 -0
  675. package/clis/juejin/login.js +1 -0
  676. package/clis/juejin/recommend.js +1 -0
  677. package/clis/juejin/stats.js +53 -0
  678. package/clis/juejin/tags.js +1 -0
  679. package/clis/juejin/utils.js +1 -0
  680. package/clis/juejin/whoami.js +1 -0
  681. package/clis/ke/auth.js +14 -0
  682. package/clis/ke/chengjiao.js +45 -0
  683. package/clis/ke/ershoufang.js +50 -0
  684. package/clis/ke/utils.js +21 -0
  685. package/clis/ke/xiaoqu.js +45 -0
  686. package/clis/ke/zufang.js +50 -0
  687. package/clis/kimi/_utils.js +38 -0
  688. package/clis/kimi/audit-extras.js +64 -0
  689. package/clis/kimi/auth.js +17 -0
  690. package/clis/kimi/chat.js +77 -0
  691. package/clis/kimi/storage.js +14 -0
  692. package/clis/kimi/ui.js +89 -0
  693. package/clis/kimi/usage.js +51 -0
  694. package/clis/kuaishou/auth.js +1 -0
  695. package/clis/kuaishou/publish.js +53 -0
  696. package/clis/lesswrong/_helpers.js +9 -0
  697. package/clis/lesswrong/comments.js +9 -0
  698. package/clis/lesswrong/curated.js +5 -0
  699. package/clis/lesswrong/frontpage.js +5 -0
  700. package/clis/lesswrong/new.js +5 -0
  701. package/clis/lesswrong/read.js +5 -0
  702. package/clis/lesswrong/sequences.js +5 -0
  703. package/clis/lesswrong/shortform.js +5 -0
  704. package/clis/lesswrong/tag.js +5 -0
  705. package/clis/lesswrong/tags.js +5 -0
  706. package/clis/lesswrong/top-month.js +5 -0
  707. package/clis/lesswrong/top-week.js +5 -0
  708. package/clis/lesswrong/top-year.js +5 -0
  709. package/clis/lesswrong/top.js +5 -0
  710. package/clis/lesswrong/user-posts.js +5 -0
  711. package/clis/lesswrong/user.js +5 -0
  712. package/clis/lichess/top.js +1 -0
  713. package/clis/lichess/user.js +1 -0
  714. package/clis/lichess/utils.js +1 -0
  715. package/clis/linkedin/auth.js +27 -0
  716. package/clis/linkedin/comment.js +1 -0
  717. package/clis/linkedin/connect.js +244 -0
  718. package/clis/linkedin/create.js +113 -0
  719. package/clis/linkedin/follow.js +1 -0
  720. package/clis/linkedin/inbox.js +1 -0
  721. package/clis/linkedin/job-detail.js +40 -0
  722. package/clis/linkedin/jobs-preferences.js +34 -0
  723. package/clis/linkedin/like.js +1 -0
  724. package/clis/linkedin/notifications.js +1 -0
  725. package/clis/linkedin/people-search.js +1 -0
  726. package/clis/linkedin/post-analytics.js +1 -0
  727. package/clis/linkedin/post-comments.js +1 -0
  728. package/clis/linkedin/post-detail.js +1 -0
  729. package/clis/linkedin/posts-core.js +138 -0
  730. package/clis/linkedin/posts.js +1 -0
  731. package/clis/linkedin/profile-analytics.js +1 -0
  732. package/clis/linkedin/profile-api.js +218 -0
  733. package/clis/linkedin/profile-experience.js +1 -0
  734. package/clis/linkedin/profile-projects.js +1 -0
  735. package/clis/linkedin/profile-read.js +3 -0
  736. package/clis/linkedin/reply.js +1 -0
  737. package/clis/linkedin/repost.js +1 -0
  738. package/clis/linkedin/safe-send.js +155 -0
  739. package/clis/linkedin/salesnav-inbox.js +21 -0
  740. package/clis/linkedin/salesnav-message.js +33 -0
  741. package/clis/linkedin/salesnav-search.js +15 -0
  742. package/clis/linkedin/salesnav-thread.js +1 -0
  743. package/clis/linkedin/search-api.js +42 -0
  744. package/clis/linkedin/search.js +50 -0
  745. package/clis/linkedin/sent-invitations.js +46 -0
  746. package/clis/linkedin/services-read.js +57 -0
  747. package/clis/linkedin/shared.js +10 -0
  748. package/clis/linkedin/social-api.js +260 -0
  749. package/clis/linkedin/thread-snapshot.js +81 -0
  750. package/clis/linkedin/timeline.js +37 -0
  751. package/clis/linkedin-learning/auth.js +27 -0
  752. package/clis/linkedin-learning/course.js +17 -0
  753. package/clis/linkedin-learning/search.js +17 -0
  754. package/clis/linkedin-learning/trending.js +17 -0
  755. package/clis/linux-do/auth.js +20 -0
  756. package/clis/linux-do/categories.js +1 -0
  757. package/clis/linux-do/feed.js +19 -0
  758. package/clis/linux-do/search.js +1 -0
  759. package/clis/linux-do/tags.js +1 -0
  760. package/clis/linux-do/topic-content.js +28 -0
  761. package/clis/linux-do/topic.js +1 -0
  762. package/clis/linux-do/user-posts.js +1 -0
  763. package/clis/linux-do/user-topics.js +1 -0
  764. package/clis/lobsters/active.js +1 -0
  765. package/clis/lobsters/domain.js +1 -0
  766. package/clis/lobsters/hot.js +1 -0
  767. package/clis/lobsters/newest.js +1 -0
  768. package/clis/lobsters/read.js +11 -0
  769. package/clis/lobsters/tag.js +1 -0
  770. package/clis/maimai/auth.js +19 -0
  771. package/clis/maimai/search-talents.js +37 -0
  772. package/clis/manus/_utils.js +28 -0
  773. package/clis/manus/auth.js +20 -0
  774. package/clis/manus/connectors.js +4 -0
  775. package/clis/manus/credits.js +4 -0
  776. package/clis/manus/list.js +7 -0
  777. package/clis/manus/read.js +7 -0
  778. package/clis/manus/skills.js +4 -0
  779. package/clis/manus/status.js +8 -0
  780. package/clis/mastodon/post.js +1 -0
  781. package/clis/mastodon/shared.js +48 -0
  782. package/clis/mastodon/whoami.js +1 -0
  783. package/clis/maven/artifact.js +1 -0
  784. package/clis/maven/search.js +1 -0
  785. package/clis/maven/utils.js +1 -0
  786. package/clis/mdn/search.js +1 -0
  787. package/clis/medium/article.js +12 -0
  788. package/clis/medium/feed.js +1 -0
  789. package/clis/medium/login.js +1 -0
  790. package/clis/medium/search.js +1 -0
  791. package/clis/medium/stats.js +56 -0
  792. package/clis/medium/tag.js +1 -0
  793. package/clis/medium/user.js +1 -0
  794. package/clis/medium/utils.js +62 -0
  795. package/clis/medium/whoami.js +1 -0
  796. package/clis/mubu/doc.js +1 -0
  797. package/clis/mubu/docs.js +1 -0
  798. package/clis/mubu/notes.js +1 -0
  799. package/clis/mubu/recent.js +1 -0
  800. package/clis/mubu/search.js +1 -0
  801. package/clis/mubu/utils.js +31 -0
  802. package/clis/note/auth.js +12 -0
  803. package/clis/note/note-utils.js +2 -0
  804. package/clis/note/publish.js +17 -0
  805. package/clis/notebooklm/add-source.js +46 -0
  806. package/clis/notebooklm/auth.js +21 -0
  807. package/clis/notebooklm/create.js +1 -0
  808. package/clis/notebooklm/current.js +1 -0
  809. package/clis/notebooklm/generate-audio.js +1 -0
  810. package/clis/notebooklm/generate-slides.js +1 -0
  811. package/clis/notebooklm/get.js +1 -0
  812. package/clis/notebooklm/history.js +1 -0
  813. package/clis/notebooklm/list.js +1 -0
  814. package/clis/notebooklm/note-list.js +1 -0
  815. package/clis/notebooklm/notes-get.js +1 -0
  816. package/clis/notebooklm/open.js +1 -0
  817. package/clis/notebooklm/rpc.js +36 -0
  818. package/clis/notebooklm/shared.js +1 -0
  819. package/clis/notebooklm/source-fulltext.js +1 -0
  820. package/clis/notebooklm/source-get.js +1 -0
  821. package/clis/notebooklm/source-guide.js +1 -0
  822. package/clis/notebooklm/source-list.js +1 -0
  823. package/clis/notebooklm/status.js +1 -0
  824. package/clis/notebooklm/summary.js +1 -0
  825. package/clis/notebooklm/utils.js +172 -0
  826. package/clis/notebooklm/write-note.js +1 -0
  827. package/clis/nowcoder/auth.js +24 -0
  828. package/clis/nowcoder/comment.js +1 -0
  829. package/clis/nowcoder/comments.js +1 -0
  830. package/clis/nowcoder/companies.js +1 -0
  831. package/clis/nowcoder/creators.js +1 -0
  832. package/clis/nowcoder/delete.js +1 -0
  833. package/clis/nowcoder/detail.js +46 -0
  834. package/clis/nowcoder/dm-list.js +1 -0
  835. package/clis/nowcoder/dm-read.js +1 -0
  836. package/clis/nowcoder/dm-send.js +1 -0
  837. package/clis/nowcoder/drafts.js +1 -0
  838. package/clis/nowcoder/experience.js +20 -0
  839. package/clis/nowcoder/hot.js +1 -0
  840. package/clis/nowcoder/inbox.js +1 -0
  841. package/clis/nowcoder/jobs.js +1 -0
  842. package/clis/nowcoder/like.js +1 -0
  843. package/clis/nowcoder/my.js +1 -0
  844. package/clis/nowcoder/notifications.js +16 -0
  845. package/clis/nowcoder/papers.js +22 -0
  846. package/clis/nowcoder/post.js +1 -0
  847. package/clis/nowcoder/practice.js +21 -0
  848. package/clis/nowcoder/recommend.js +1 -0
  849. package/clis/nowcoder/referral.js +21 -0
  850. package/clis/nowcoder/salary.js +22 -0
  851. package/clis/nowcoder/search.js +31 -0
  852. package/clis/nowcoder/suggest.js +17 -0
  853. package/clis/nowcoder/topics.js +1 -0
  854. package/clis/nowcoder/trending.js +1 -0
  855. package/clis/nowcoder/utils.js +68 -0
  856. package/clis/npm/downloads.js +1 -0
  857. package/clis/npm/package.js +1 -0
  858. package/clis/npm/search.js +1 -0
  859. package/clis/npm/utils.js +1 -0
  860. package/clis/nuget/package.js +1 -0
  861. package/clis/nuget/search.js +1 -0
  862. package/clis/nuget/utils.js +1 -0
  863. package/clis/nvd/cve.js +1 -0
  864. package/clis/oeis/search.js +1 -0
  865. package/clis/oeis/sequence.js +1 -0
  866. package/clis/oeis/utils.js +1 -0
  867. package/clis/ones/common.js +23 -0
  868. package/clis/ones/enrich-tasks.js +1 -0
  869. package/clis/ones/login.js +2 -0
  870. package/clis/ones/logout.js +1 -0
  871. package/clis/ones/me.js +1 -0
  872. package/clis/ones/my-tasks.js +1 -0
  873. package/clis/ones/resolve-labels.js +1 -0
  874. package/clis/ones/task-helpers.js +1 -0
  875. package/clis/ones/task.js +1 -0
  876. package/clis/ones/tasks.js +1 -0
  877. package/clis/ones/token-info.js +1 -0
  878. package/clis/ones/worklog.js +14 -0
  879. package/clis/openalex/search.js +1 -0
  880. package/clis/openalex/utils.js +1 -0
  881. package/clis/openalex/work.js +1 -0
  882. package/clis/openfda/drug-label.js +1 -0
  883. package/clis/openfda/food-recall.js +1 -0
  884. package/clis/openfda/utils.js +1 -0
  885. package/clis/openreview/author.js +1 -0
  886. package/clis/openreview/paper.js +1 -0
  887. package/clis/openreview/reviews.js +4 -0
  888. package/clis/openreview/search.js +1 -0
  889. package/clis/openreview/utils.js +1 -0
  890. package/clis/openreview/venue.js +1 -0
  891. package/clis/oschina/article.js +1 -0
  892. package/clis/oschina/catalogs.js +1 -0
  893. package/clis/oschina/login.js +1 -0
  894. package/clis/oschina/stats.js +54 -0
  895. package/clis/oschina/whoami.js +1 -0
  896. package/clis/osv/query.js +1 -0
  897. package/clis/osv/utils.js +1 -0
  898. package/clis/osv/vulnerability.js +1 -0
  899. package/clis/packagist/package.js +1 -0
  900. package/clis/packagist/search.js +1 -0
  901. package/clis/packagist/utils.js +1 -0
  902. package/clis/paperreview/feedback.js +1 -0
  903. package/clis/paperreview/review.js +1 -0
  904. package/clis/paperreview/submit.js +1 -0
  905. package/clis/paperreview/utils.js +1 -0
  906. package/clis/pinterest/api.js +1 -0
  907. package/clis/pinterest/auth.js +1 -0
  908. package/clis/pinterest/boards.js +1 -0
  909. package/clis/pinterest/client.js +20 -0
  910. package/clis/pinterest/publish.js +13 -0
  911. package/clis/pixiv/auth.js +17 -0
  912. package/clis/pixiv/detail.js +1 -0
  913. package/clis/pixiv/download.js +1 -0
  914. package/clis/pixiv/illusts.js +1 -0
  915. package/clis/pixiv/ranking.js +26 -0
  916. package/clis/pixiv/search.js +1 -0
  917. package/clis/pixiv/user.js +1 -0
  918. package/clis/pixiv/utils.js +18 -0
  919. package/clis/powerchina/auth.js +17 -0
  920. package/clis/powerchina/search.js +1 -0
  921. package/clis/producthunt/browse.js +54 -0
  922. package/clis/producthunt/hot.js +64 -0
  923. package/clis/producthunt/posts.js +1 -0
  924. package/clis/producthunt/today.js +1 -0
  925. package/clis/producthunt/utils.js +1 -0
  926. package/clis/pubmed/article.js +1 -0
  927. package/clis/pubmed/author.js +1 -0
  928. package/clis/pubmed/citations.js +1 -0
  929. package/clis/pubmed/clinical-trial.js +1 -0
  930. package/clis/pubmed/journal.js +1 -0
  931. package/clis/pubmed/mesh.js +1 -0
  932. package/clis/pubmed/related.js +1 -0
  933. package/clis/pubmed/review.js +1 -0
  934. package/clis/pubmed/search.js +1 -0
  935. package/clis/pubmed/utils.js +1 -0
  936. package/clis/pypi/downloads.js +1 -0
  937. package/clis/pypi/package.js +1 -0
  938. package/clis/pypi/utils.js +1 -0
  939. package/clis/qiita/auth.js +1 -0
  940. package/clis/qiita/gql.js +32 -0
  941. package/clis/qiita/publish.js +7 -0
  942. package/clis/qiita/stats.js +37 -0
  943. package/clis/qoder/_utils.js +113 -0
  944. package/clis/qoder/composer.js +1 -0
  945. package/clis/qoder/history.js +25 -0
  946. package/clis/qoder/quest.js +1 -0
  947. package/clis/qoder/read.js +1 -0
  948. package/clis/qoder/status.js +1 -0
  949. package/clis/qoder/ui.js +59 -0
  950. package/clis/quark/auth.js +16 -0
  951. package/clis/quark/ls.js +1 -0
  952. package/clis/quark/mkdir.js +1 -0
  953. package/clis/quark/mv.js +1 -0
  954. package/clis/quark/rename.js +1 -0
  955. package/clis/quark/rm.js +1 -0
  956. package/clis/quark/save.js +1 -0
  957. package/clis/quark/share-tree.js +1 -0
  958. package/clis/quark/utils.js +13 -0
  959. package/clis/quora/create-answer.js +22 -0
  960. package/clis/quora/create-question.js +24 -0
  961. package/clis/quora/shared.js +43 -0
  962. package/clis/quora/whoami.js +1 -0
  963. package/clis/qwen/ask.js +1 -0
  964. package/clis/qwen/auth.js +17 -0
  965. package/clis/qwen/detail.js +1 -0
  966. package/clis/qwen/history.js +1 -0
  967. package/clis/qwen/image.js +31 -0
  968. package/clis/qwen/new.js +1 -0
  969. package/clis/qwen/read.js +1 -0
  970. package/clis/qwen/send.js +1 -0
  971. package/clis/qwen/status.js +1 -0
  972. package/clis/qwen/utils.js +185 -0
  973. package/clis/reddit/auth.js +17 -0
  974. package/clis/reddit/comment.js +36 -0
  975. package/clis/reddit/frontpage.js +40 -0
  976. package/clis/reddit/home.js +32 -0
  977. package/clis/reddit/hot.js +46 -0
  978. package/clis/reddit/popular.js +46 -0
  979. package/clis/reddit/read.js +398 -0
  980. package/clis/reddit/reply.js +56 -0
  981. package/clis/reddit/save.js +30 -0
  982. package/clis/reddit/saved.js +24 -0
  983. package/clis/reddit/search.js +51 -0
  984. package/clis/reddit/submit.js +42 -0
  985. package/clis/reddit/subreddit-info.js +29 -0
  986. package/clis/reddit/subreddit.js +52 -0
  987. package/clis/reddit/subscribe.js +29 -0
  988. package/clis/reddit/subscribed.js +68 -0
  989. package/clis/reddit/upvote.js +43 -0
  990. package/clis/reddit/upvoted.js +24 -0
  991. package/clis/reddit/user-comments.js +20 -0
  992. package/clis/reddit/user-posts.js +17 -0
  993. package/clis/reddit/user.js +20 -0
  994. package/clis/reddit/whoami.js +19 -0
  995. package/clis/rednote/auth.js +19 -0
  996. package/clis/rednote/comments.js +1 -0
  997. package/clis/rednote/download.js +1 -0
  998. package/clis/rednote/feed.js +1 -0
  999. package/clis/rednote/note.js +1 -0
  1000. package/clis/rednote/notifications.js +67 -0
  1001. package/clis/rednote/search.js +32 -0
  1002. package/clis/rednote/user.js +1 -0
  1003. package/clis/rest-countries/country.js +1 -0
  1004. package/clis/rest-countries/region.js +1 -0
  1005. package/clis/rest-countries/utils.js +1 -0
  1006. package/clis/reuters/article-detail.js +1 -0
  1007. package/clis/reuters/auth.js +39 -0
  1008. package/clis/reuters/search.js +1 -0
  1009. package/clis/reuters/utils.js +50 -0
  1010. package/clis/rfc/rfc.js +1 -0
  1011. package/clis/rfc/utils.js +1 -0
  1012. package/clis/rubygems/gem.js +1 -0
  1013. package/clis/rubygems/search.js +1 -0
  1014. package/clis/rubygems/utils.js +1 -0
  1015. package/clis/segmentfault/_signed-request.js +43 -0
  1016. package/clis/segmentfault/article.js +3 -0
  1017. package/clis/segmentfault/channels.js +1 -0
  1018. package/clis/segmentfault/login.js +1 -0
  1019. package/clis/segmentfault/stats.js +82 -0
  1020. package/clis/segmentfault/tags.js +1 -0
  1021. package/clis/segmentfault/whoami.js +1 -0
  1022. package/clis/semanticscholar/citations.js +1 -0
  1023. package/clis/semanticscholar/paper.js +1 -0
  1024. package/clis/semanticscholar/recommendations.js +1 -0
  1025. package/clis/semanticscholar/search.js +1 -0
  1026. package/clis/semanticscholar/utils.js +1 -0
  1027. package/clis/sinablog/article.js +1 -0
  1028. package/clis/sinablog/hot.js +1 -0
  1029. package/clis/sinablog/search.js +1 -0
  1030. package/clis/sinablog/user.js +1 -0
  1031. package/clis/sinablog/utils.js +153 -0
  1032. package/clis/sinafinance/news.js +1 -0
  1033. package/clis/sinafinance/rolling-news.js +20 -0
  1034. package/clis/sinafinance/stock-rank.js +41 -0
  1035. package/clis/sinafinance/stock.js +1 -0
  1036. package/clis/slock/attachment-download.js +1 -0
  1037. package/clis/slock/attachment-upload.js +34 -0
  1038. package/clis/slock/attachment-url.js +1 -0
  1039. package/clis/slock/auth-verify.js +1 -0
  1040. package/clis/slock/bookmark-add.js +11 -0
  1041. package/clis/slock/bookmark-list.js +10 -0
  1042. package/clis/slock/bookmark-remove.js +7 -0
  1043. package/clis/slock/channel-action.js +1 -0
  1044. package/clis/slock/channel-archive.js +1 -0
  1045. package/clis/slock/channel-create.js +1 -0
  1046. package/clis/slock/channel-files.js +1 -0
  1047. package/clis/slock/channel-info.js +1 -0
  1048. package/clis/slock/channel-join.js +1 -0
  1049. package/clis/slock/channel-leave.js +1 -0
  1050. package/clis/slock/channel-list.js +1 -0
  1051. package/clis/slock/channel-mark.js +1 -0
  1052. package/clis/slock/channel-members.js +1 -0
  1053. package/clis/slock/channel-unarchive.js +1 -0
  1054. package/clis/slock/dm-list.js +1 -0
  1055. package/clis/slock/errors.js +1 -0
  1056. package/clis/slock/in-page.js +113 -0
  1057. package/clis/slock/inbox-done.js +9 -0
  1058. package/clis/slock/inbox-read-all.js +1 -0
  1059. package/clis/slock/inbox.js +1 -0
  1060. package/clis/slock/login.js +1 -0
  1061. package/clis/slock/message-read.js +61 -0
  1062. package/clis/slock/message-search.js +24 -0
  1063. package/clis/slock/message-send.js +55 -0
  1064. package/clis/slock/reaction-add.js +1 -0
  1065. package/clis/slock/reaction-remove.js +1 -0
  1066. package/clis/slock/resolve.js +1 -0
  1067. package/clis/slock/server-list.js +9 -0
  1068. package/clis/slock/server-use.js +18 -0
  1069. package/clis/slock/shared.js +1 -0
  1070. package/clis/slock/task-claim.js +14 -0
  1071. package/clis/slock/task-convert.js +35 -0
  1072. package/clis/slock/task-create.js +24 -0
  1073. package/clis/slock/task-delete.js +9 -0
  1074. package/clis/slock/task-get.js +11 -0
  1075. package/clis/slock/task-list-server.js +12 -0
  1076. package/clis/slock/task-list.js +14 -0
  1077. package/clis/slock/task-status.js +19 -0
  1078. package/clis/slock/task-unclaim.js +13 -0
  1079. package/clis/slock/thread-done.js +1 -0
  1080. package/clis/slock/thread-follow.js +1 -0
  1081. package/clis/slock/thread-list.js +1 -0
  1082. package/clis/slock/thread-state.js +1 -0
  1083. package/clis/slock/thread-undone.js +1 -0
  1084. package/clis/slock/thread-unfollow.js +1 -0
  1085. package/clis/slock/unread-summary.js +18 -0
  1086. package/clis/slock/whoami.js +1 -0
  1087. package/clis/smzdm/search.js +71 -0
  1088. package/clis/sohu/article.js +1 -0
  1089. package/clis/sohu/attributes.js +1 -0
  1090. package/clis/sohu/categories.js +1 -0
  1091. package/clis/sohu/channels.js +1 -0
  1092. package/clis/sohu/columns.js +1 -0
  1093. package/clis/sohu/login.js +1 -0
  1094. package/clis/sohu/mpbp.js +1 -0
  1095. package/clis/sohu/stats.js +95 -0
  1096. package/clis/sohu/topics.js +1 -0
  1097. package/clis/sohu/whoami.js +1 -0
  1098. package/clis/spotify/spotify.js +1 -0
  1099. package/clis/spotify/utils.js +8 -0
  1100. package/clis/stackoverflow/bounties.js +1 -0
  1101. package/clis/stackoverflow/hot.js +1 -0
  1102. package/clis/stackoverflow/read.js +13 -0
  1103. package/clis/stackoverflow/related.js +1 -0
  1104. package/clis/stackoverflow/search.js +1 -0
  1105. package/clis/stackoverflow/tag.js +1 -0
  1106. package/clis/stackoverflow/unanswered.js +1 -0
  1107. package/clis/stackoverflow/user.js +1 -0
  1108. package/clis/stackoverflow/utils.js +1 -0
  1109. package/clis/steam/app.js +1 -0
  1110. package/clis/steam/search.js +1 -0
  1111. package/clis/steam/top-sellers.js +1 -0
  1112. package/clis/steam/utils.js +1 -0
  1113. package/clis/substack/auth.js +11 -0
  1114. package/clis/substack/feed.js +1 -0
  1115. package/clis/substack/post-utils.js +2 -0
  1116. package/clis/substack/publication.js +1 -0
  1117. package/clis/substack/publish.js +10 -0
  1118. package/clis/substack/search.js +1 -0
  1119. package/clis/substack/utils.js +108 -0
  1120. package/clis/suno/auth.js +21 -0
  1121. package/clis/suno/download.js +17 -0
  1122. package/clis/suno/generate.js +4 -0
  1123. package/clis/suno/list.js +14 -0
  1124. package/clis/suno/status.js +1 -0
  1125. package/clis/suno/utils.js +102 -0
  1126. package/clis/taobao/add-cart.js +93 -0
  1127. package/clis/taobao/auth.js +8 -0
  1128. package/clis/taobao/cart.js +68 -0
  1129. package/clis/taobao/detail.js +48 -0
  1130. package/clis/taobao/reviews.js +52 -0
  1131. package/clis/taobao/search.js +64 -0
  1132. package/clis/tdx/hot-rank.js +25 -0
  1133. package/clis/telegram/send.js +18 -0
  1134. package/clis/telegram/shared.js +21 -0
  1135. package/clis/telegram/whoami.js +1 -0
  1136. package/clis/test-utils.js +1 -0
  1137. package/clis/threads/post.js +152 -0
  1138. package/clis/threads/shared.js +27 -0
  1139. package/clis/threads/whoami.js +1 -0
  1140. package/clis/ths/hot-rank.js +27 -0
  1141. package/clis/tieba/hot.js +16 -0
  1142. package/clis/tieba/posts.js +1 -0
  1143. package/clis/tieba/read.js +84 -0
  1144. package/clis/tieba/search.js +54 -0
  1145. package/clis/tieba/utils.js +1 -0
  1146. package/clis/tiktok/auth.js +30 -0
  1147. package/clis/tiktok/comment.js +69 -0
  1148. package/clis/tiktok/creator-videos.js +45 -0
  1149. package/clis/tiktok/explore.js +76 -0
  1150. package/clis/tiktok/follow.js +49 -0
  1151. package/clis/tiktok/following.js +103 -0
  1152. package/clis/tiktok/friends.js +79 -0
  1153. package/clis/tiktok/like.js +19 -0
  1154. package/clis/tiktok/live.js +79 -0
  1155. package/clis/tiktok/notifications.js +77 -0
  1156. package/clis/tiktok/profile.js +26 -0
  1157. package/clis/tiktok/publish.js +82 -0
  1158. package/clis/tiktok/save.js +15 -0
  1159. package/clis/tiktok/search.js +24 -0
  1160. package/clis/tiktok/unfollow.js +59 -0
  1161. package/clis/tiktok/unlike.js +19 -0
  1162. package/clis/tiktok/unsave.js +17 -0
  1163. package/clis/tiktok/user.js +143 -0
  1164. package/clis/tiktok/utils.js +272 -0
  1165. package/clis/toutiao/article.js +1 -0
  1166. package/clis/toutiao/articles.js +6 -0
  1167. package/clis/toutiao/auth.js +50 -0
  1168. package/clis/toutiao/hot.js +1 -0
  1169. package/clis/toutiao/utils.js +2 -0
  1170. package/clis/trae-cn/activity.js +1 -0
  1171. package/clis/trae-cn/approve.js +1 -0
  1172. package/clis/trae-cn/ask.js +1 -0
  1173. package/clis/trae-cn/dump.js +1 -0
  1174. package/clis/trae-cn/export.js +3 -0
  1175. package/clis/trae-cn/model.js +1 -0
  1176. package/clis/trae-cn/new.js +1 -0
  1177. package/clis/trae-cn/read.js +1 -0
  1178. package/clis/trae-cn/screenshot.js +1 -0
  1179. package/clis/trae-cn/select-model.js +1 -0
  1180. package/clis/trae-cn/send.js +1 -0
  1181. package/clis/trae-cn/setup.js +1 -0
  1182. package/clis/trae-cn/status.js +1 -0
  1183. package/clis/trae-cn/targets.js +1 -0
  1184. package/clis/trae-cn/utils.js +456 -0
  1185. package/clis/trae-cn/watch.js +3 -0
  1186. package/clis/trae-solo/_actions.js +41 -0
  1187. package/clis/trae-solo/_fs.js +6 -0
  1188. package/clis/trae-solo/_state.js +2 -0
  1189. package/clis/trae-solo/automation.js +43 -0
  1190. package/clis/trae-solo/history.js +15 -0
  1191. package/clis/trae-solo/mode.js +31 -0
  1192. package/clis/trae-solo/model.js +50 -0
  1193. package/clis/trae-solo/renderer-storage.js +11 -0
  1194. package/clis/trae-solo/settings.js +1 -0
  1195. package/clis/trae-solo/skill-fs.js +1 -0
  1196. package/clis/trae-solo/skill.js +81 -0
  1197. package/clis/trae-solo/state-fs.js +2 -0
  1198. package/clis/trae-solo/status.js +1 -0
  1199. package/clis/trae-solo/task-fs.js +5 -0
  1200. package/clis/trae-solo/user-rules.js +1 -0
  1201. package/clis/trae-solo/workspaces-fs.js +1 -0
  1202. package/clis/tumblr/auth.js +24 -0
  1203. package/clis/tumblr/publish.js +14 -0
  1204. package/clis/tvmaze/search.js +1 -0
  1205. package/clis/tvmaze/show.js +1 -0
  1206. package/clis/tvmaze/utils.js +1 -0
  1207. package/clis/twitter/accept.js +116 -0
  1208. package/clis/twitter/article.js +116 -0
  1209. package/clis/twitter/auth.js +4 -0
  1210. package/clis/twitter/block.js +62 -0
  1211. package/clis/twitter/bookmark-folder.js +4 -0
  1212. package/clis/twitter/bookmark-folders.js +4 -0
  1213. package/clis/twitter/bookmark.js +44 -0
  1214. package/clis/twitter/bookmarks.js +27 -0
  1215. package/clis/twitter/delete.js +36 -0
  1216. package/clis/twitter/device-follow.js +13 -0
  1217. package/clis/twitter/dm-list.js +1 -0
  1218. package/clis/twitter/dm-read.js +1 -0
  1219. package/clis/twitter/dm-send.js +13 -0
  1220. package/clis/twitter/dm-shared.js +6 -0
  1221. package/clis/twitter/download.js +38 -0
  1222. package/clis/twitter/follow-batch.js +43 -0
  1223. package/clis/twitter/follow.js +39 -0
  1224. package/clis/twitter/followers.js +59 -0
  1225. package/clis/twitter/following.js +4 -0
  1226. package/clis/twitter/hide-reply.js +57 -0
  1227. package/clis/twitter/like.js +48 -0
  1228. package/clis/twitter/likes.js +14 -0
  1229. package/clis/twitter/list-add-batch.js +1 -0
  1230. package/clis/twitter/list-add-core.js +35 -0
  1231. package/clis/twitter/list-add.js +1 -0
  1232. package/clis/twitter/list-batch-utils.js +1 -0
  1233. package/clis/twitter/list-create.js +12 -0
  1234. package/clis/twitter/list-delete.js +36 -0
  1235. package/clis/twitter/list-remove-batch.js +1 -0
  1236. package/clis/twitter/list-remove-core.js +127 -0
  1237. package/clis/twitter/list-remove.js +1 -0
  1238. package/clis/twitter/list-tweets.js +27 -0
  1239. package/clis/twitter/lists.js +27 -0
  1240. package/clis/twitter/notifications.js +4 -0
  1241. package/clis/twitter/post.js +158 -0
  1242. package/clis/twitter/profile.js +66 -0
  1243. package/clis/twitter/quote.js +123 -0
  1244. package/clis/twitter/reply-dm.js +112 -0
  1245. package/clis/twitter/reply.js +97 -0
  1246. package/clis/twitter/retweet.js +62 -0
  1247. package/clis/twitter/schedule.js +96 -0
  1248. package/clis/twitter/scheduled-delete.js +60 -0
  1249. package/clis/twitter/scheduled-list.js +15 -0
  1250. package/clis/twitter/scheduled-utils.js +18 -0
  1251. package/clis/twitter/search.js +12 -0
  1252. package/clis/twitter/shared.js +76 -0
  1253. package/clis/twitter/thread.js +4 -0
  1254. package/clis/twitter/timeline.js +4 -0
  1255. package/clis/twitter/trending.js +18 -0
  1256. package/clis/twitter/tweets.js +12 -0
  1257. package/clis/twitter/unblock.js +45 -0
  1258. package/clis/twitter/unbookmark.js +41 -0
  1259. package/clis/twitter/unfollow.js +45 -0
  1260. package/clis/twitter/unlike.js +48 -0
  1261. package/clis/twitter/unretweet.js +62 -0
  1262. package/clis/twitter/utils.js +55 -0
  1263. package/clis/uisdc/news.js +25 -0
  1264. package/clis/uiverse/_shared.js +257 -0
  1265. package/clis/uiverse/code.js +1 -0
  1266. package/clis/uiverse/preview.js +1 -0
  1267. package/clis/upwork/auth.js +19 -0
  1268. package/clis/upwork/detail.js +22 -0
  1269. package/clis/upwork/feed.js +21 -0
  1270. package/clis/upwork/search.js +21 -0
  1271. package/clis/upwork/utils.js +1 -0
  1272. package/clis/v2ex/auth.js +10 -0
  1273. package/clis/v2ex/daily.js +41 -0
  1274. package/clis/v2ex/hot.js +1 -0
  1275. package/clis/v2ex/latest.js +1 -0
  1276. package/clis/v2ex/me.js +58 -0
  1277. package/clis/v2ex/member.js +1 -0
  1278. package/clis/v2ex/node.js +1 -0
  1279. package/clis/v2ex/nodes.js +1 -0
  1280. package/clis/v2ex/notifications.js +40 -0
  1281. package/clis/v2ex/replies.js +1 -0
  1282. package/clis/v2ex/topic.js +1 -0
  1283. package/clis/v2ex/user.js +1 -0
  1284. package/clis/vk/post.js +1 -0
  1285. package/clis/vk/shared.js +8 -0
  1286. package/clis/vk/whoami.js +1 -0
  1287. package/clis/wanfang/search.js +42 -0
  1288. package/clis/web/read.js +260 -0
  1289. package/clis/wechat-channels/auth.js +31 -0
  1290. package/clis/wechat-channels/publish.js +298 -0
  1291. package/clis/weibo/article.js +1 -0
  1292. package/clis/weibo/auth.js +17 -0
  1293. package/clis/weibo/comments.js +28 -0
  1294. package/clis/weibo/delete.js +84 -0
  1295. package/clis/weibo/favorites.js +27 -0
  1296. package/clis/weibo/feed.js +33 -0
  1297. package/clis/weibo/hot.js +17 -0
  1298. package/clis/weibo/me.js +51 -0
  1299. package/clis/weibo/post.js +46 -0
  1300. package/clis/weibo/publish.js +98 -0
  1301. package/clis/weibo/search.js +47 -0
  1302. package/clis/weibo/user-posts.js +92 -0
  1303. package/clis/weibo/user.js +37 -0
  1304. package/clis/weibo/utils.js +16 -0
  1305. package/clis/weixin/article.js +1 -0
  1306. package/clis/weixin/create-draft.js +152 -0
  1307. package/clis/weixin/download.js +100 -0
  1308. package/clis/weixin/drafts.js +27 -0
  1309. package/clis/weixin/login.js +1 -0
  1310. package/clis/weixin/search.js +44 -0
  1311. package/clis/weixin/stats.js +43 -0
  1312. package/clis/weixin/whoami.js +1 -0
  1313. package/clis/weread/ai-outline.js +2 -0
  1314. package/clis/weread/auth.js +24 -0
  1315. package/clis/weread/book-search.js +2 -0
  1316. package/clis/weread/book.js +3 -0
  1317. package/clis/weread/highlights.js +1 -0
  1318. package/clis/weread/notebooks.js +1 -0
  1319. package/clis/weread/notes.js +1 -0
  1320. package/clis/weread/ranking.js +1 -0
  1321. package/clis/weread/search.js +1 -0
  1322. package/clis/weread/shelf.js +1 -0
  1323. package/clis/weread/utils.js +67 -0
  1324. package/clis/weread-official/book.js +1 -0
  1325. package/clis/weread-official/discover.js +1 -0
  1326. package/clis/weread-official/list-apis.js +1 -0
  1327. package/clis/weread-official/notes.js +1 -0
  1328. package/clis/weread-official/readdata.js +1 -0
  1329. package/clis/weread-official/review.js +1 -0
  1330. package/clis/weread-official/search.js +1 -0
  1331. package/clis/weread-official/shelf.js +1 -0
  1332. package/clis/weread-official/utils.js +1 -0
  1333. package/clis/wikidata/entity.js +1 -0
  1334. package/clis/wikidata/search.js +1 -0
  1335. package/clis/wikidata/utils.js +1 -0
  1336. package/clis/wikipedia/page.js +3 -0
  1337. package/clis/wikipedia/random.js +1 -0
  1338. package/clis/wikipedia/search.js +1 -0
  1339. package/clis/wikipedia/summary.js +1 -0
  1340. package/clis/wikipedia/trending.js +1 -0
  1341. package/clis/wikipedia/utils.js +1 -0
  1342. package/clis/wordpress/login.js +1 -0
  1343. package/clis/wordpress/publish.js +1 -0
  1344. package/clis/wordpress/shared.js +54 -0
  1345. package/clis/wordpress/whoami.js +1 -0
  1346. package/clis/woshipm/article.js +1 -0
  1347. package/clis/woshipm/login.js +1 -0
  1348. package/clis/woshipm/stats.js +52 -0
  1349. package/clis/woshipm/whoami.js +1 -0
  1350. package/clis/wttr/current.js +1 -0
  1351. package/clis/wttr/forecast.js +1 -0
  1352. package/clis/wttr/utils.js +1 -0
  1353. package/clis/xianyu/auth.js +11 -0
  1354. package/clis/xianyu/chat.js +1 -0
  1355. package/clis/xianyu/im.js +240 -0
  1356. package/clis/xianyu/inbox.js +1 -0
  1357. package/clis/xianyu/item.js +97 -0
  1358. package/clis/xianyu/messages.js +1 -0
  1359. package/clis/xianyu/publish.js +245 -0
  1360. package/clis/xianyu/reply.js +1 -0
  1361. package/clis/xianyu/search.js +141 -0
  1362. package/clis/xianyu/utils.js +1 -0
  1363. package/clis/xiaoe/auth.js +10 -0
  1364. package/clis/xiaoe/catalog.js +134 -0
  1365. package/clis/xiaoe/content.js +16 -0
  1366. package/clis/xiaoe/courses.js +43 -0
  1367. package/clis/xiaoe/detail.js +19 -0
  1368. package/clis/xiaoe/play-url.js +97 -0
  1369. package/clis/xiaohongshu/ask.js +130 -0
  1370. package/clis/xiaohongshu/auth.js +13 -0
  1371. package/clis/xiaohongshu/collection-helpers.js +64 -0
  1372. package/clis/xiaohongshu/comments.js +89 -0
  1373. package/clis/xiaohongshu/creator-note-detail.js +80 -0
  1374. package/clis/xiaohongshu/creator-notes-summary.js +1 -0
  1375. package/clis/xiaohongshu/creator-notes.js +107 -0
  1376. package/clis/xiaohongshu/creator-profile.js +13 -0
  1377. package/clis/xiaohongshu/creator-stats.js +13 -0
  1378. package/clis/xiaohongshu/delete-note.js +69 -0
  1379. package/clis/xiaohongshu/download.js +200 -0
  1380. package/clis/xiaohongshu/draft-clear.js +44 -0
  1381. package/clis/xiaohongshu/draft-delete.js +37 -0
  1382. package/clis/xiaohongshu/draft-open.js +1 -0
  1383. package/clis/xiaohongshu/draft-utils.js +36 -0
  1384. package/clis/xiaohongshu/drafts.js +1 -0
  1385. package/clis/xiaohongshu/feed.js +38 -0
  1386. package/clis/xiaohongshu/follow.js +75 -0
  1387. package/clis/xiaohongshu/liked.js +1 -0
  1388. package/clis/xiaohongshu/note-helpers.js +1 -0
  1389. package/clis/xiaohongshu/note.js +32 -0
  1390. package/clis/xiaohongshu/notifications.js +1 -0
  1391. package/clis/xiaohongshu/publish-video.js +87 -0
  1392. package/clis/xiaohongshu/publish.js +637 -0
  1393. package/clis/xiaohongshu/saved.js +1 -0
  1394. package/clis/xiaohongshu/search.js +194 -0
  1395. package/clis/xiaohongshu/unfollow.js +98 -0
  1396. package/clis/xiaohongshu/user-helpers.js +1 -0
  1397. package/clis/xiaohongshu/user.js +30 -0
  1398. package/clis/xiaoyuzhou/auth.js +3 -0
  1399. package/clis/xiaoyuzhou/download.js +1 -0
  1400. package/clis/xiaoyuzhou/episode.js +1 -0
  1401. package/clis/xiaoyuzhou/podcast-episodes.js +1 -0
  1402. package/clis/xiaoyuzhou/podcast.js +1 -0
  1403. package/clis/xiaoyuzhou/transcript.js +1 -0
  1404. package/clis/xiaoyuzhou/utils.js +1 -0
  1405. package/clis/xueqiu/article.js +4 -0
  1406. package/clis/xueqiu/auth.js +27 -0
  1407. package/clis/xueqiu/comments.js +38 -0
  1408. package/clis/xueqiu/danjuan-utils.js +84 -0
  1409. package/clis/xueqiu/earnings-date.js +1 -0
  1410. package/clis/xueqiu/events.js +17 -0
  1411. package/clis/xueqiu/feed.js +1 -0
  1412. package/clis/xueqiu/fund-holdings.js +1 -0
  1413. package/clis/xueqiu/fund-snapshot.js +1 -0
  1414. package/clis/xueqiu/groups.js +1 -0
  1415. package/clis/xueqiu/hashtags.js +26 -0
  1416. package/clis/xueqiu/hot-stock.js +1 -0
  1417. package/clis/xueqiu/hot.js +1 -0
  1418. package/clis/xueqiu/kline.js +1 -0
  1419. package/clis/xueqiu/search.js +1 -0
  1420. package/clis/xueqiu/stock.js +1 -0
  1421. package/clis/xueqiu/stocks.js +13 -0
  1422. package/clis/xueqiu/users.js +12 -0
  1423. package/clis/xueqiu/utils.js +9 -0
  1424. package/clis/xueqiu/watchlist.js +1 -0
  1425. package/clis/yahoo/search.js +21 -0
  1426. package/clis/yahoo-finance/quote.js +50 -0
  1427. package/clis/yollomi/background.js +1 -0
  1428. package/clis/yollomi/edit.js +1 -0
  1429. package/clis/yollomi/face-swap.js +1 -0
  1430. package/clis/yollomi/generate.js +1 -0
  1431. package/clis/yollomi/models.js +1 -0
  1432. package/clis/yollomi/object-remover.js +1 -0
  1433. package/clis/yollomi/remove-bg.js +1 -0
  1434. package/clis/yollomi/restore.js +1 -0
  1435. package/clis/yollomi/try-on.js +1 -0
  1436. package/clis/yollomi/upload.js +17 -0
  1437. package/clis/yollomi/upscale.js +1 -0
  1438. package/clis/yollomi/utils.js +16 -0
  1439. package/clis/yollomi/video.js +1 -0
  1440. package/clis/youdao/note.js +113 -0
  1441. package/clis/youtube/auth.js +20 -0
  1442. package/clis/youtube/channel.js +118 -0
  1443. package/clis/youtube/comments.js +64 -0
  1444. package/clis/youtube/feed.js +89 -0
  1445. package/clis/youtube/history.js +87 -0
  1446. package/clis/youtube/like.js +33 -0
  1447. package/clis/youtube/playlist.js +47 -0
  1448. package/clis/youtube/publish.js +56 -0
  1449. package/clis/youtube/search.js +39 -0
  1450. package/clis/youtube/subscribe.js +42 -0
  1451. package/clis/youtube/subscriptions.js +26 -0
  1452. package/clis/youtube/transcript-group.js +2 -0
  1453. package/clis/youtube/transcript.js +417 -0
  1454. package/clis/youtube/unlike.js +33 -0
  1455. package/clis/youtube/unsubscribe.js +42 -0
  1456. package/clis/youtube/utils.js +34 -0
  1457. package/clis/youtube/video.js +96 -0
  1458. package/clis/youtube/watch-later.js +41 -0
  1459. package/clis/yuanbao/ask.js +145 -0
  1460. package/clis/yuanbao/auth.js +23 -0
  1461. package/clis/yuanbao/detail.js +1 -0
  1462. package/clis/yuanbao/history.js +1 -0
  1463. package/clis/yuanbao/new.js +16 -0
  1464. package/clis/yuanbao/read.js +1 -0
  1465. package/clis/yuanbao/send.js +1 -0
  1466. package/clis/yuanbao/shared.js +127 -0
  1467. package/clis/yuanbao/status.js +1 -0
  1468. package/clis/yuque/article.js +1 -0
  1469. package/clis/yuque/whoami.js +1 -0
  1470. package/clis/zhihu/answer-comments.js +11 -0
  1471. package/clis/zhihu/answer-detail.js +11 -0
  1472. package/clis/zhihu/answer.js +15 -0
  1473. package/clis/zhihu/article-transform.js +1 -0
  1474. package/clis/zhihu/article.js +7 -0
  1475. package/clis/zhihu/auth.js +11 -0
  1476. package/clis/zhihu/collection.js +7 -0
  1477. package/clis/zhihu/collections.js +7 -0
  1478. package/clis/zhihu/comment.js +17 -0
  1479. package/clis/zhihu/download.js +39 -0
  1480. package/clis/zhihu/favorite.js +39 -0
  1481. package/clis/zhihu/follow.js +19 -0
  1482. package/clis/zhihu/followers.js +1 -0
  1483. package/clis/zhihu/following.js +1 -0
  1484. package/clis/zhihu/hot.js +21 -0
  1485. package/clis/zhihu/like.js +16 -0
  1486. package/clis/zhihu/paginate.js +11 -0
  1487. package/clis/zhihu/pin.js +24 -0
  1488. package/clis/zhihu/pins.js +1 -0
  1489. package/clis/zhihu/question.js +7 -0
  1490. package/clis/zhihu/recommend.js +7 -0
  1491. package/clis/zhihu/search.js +11 -0
  1492. package/clis/zhihu/stats.js +41 -0
  1493. package/clis/zhihu/target.js +1 -0
  1494. package/clis/zhihu/text.js +6 -0
  1495. package/clis/zhihu/user-answers.js +1 -0
  1496. package/clis/zhihu/user-arg.js +1 -0
  1497. package/clis/zhihu/user-articles.js +1 -0
  1498. package/clis/zhihu/user.js +11 -0
  1499. package/clis/zhihu/write-shared.js +71 -0
  1500. package/clis/zlibrary/info.js +1 -0
  1501. package/clis/zlibrary/search.js +1 -0
  1502. package/clis/zlibrary/utils.js +48 -0
  1503. package/clis/zsxq/auth.js +33 -0
  1504. package/clis/zsxq/dynamics.js +1 -0
  1505. package/clis/zsxq/groups.js +1 -0
  1506. package/clis/zsxq/search.js +1 -0
  1507. package/clis/zsxq/topic.js +1 -0
  1508. package/clis/zsxq/topics.js +1 -0
  1509. package/clis/zsxq/utils.js +72 -0
  1510. package/dist/src/adapter-shadow.d.ts +11 -0
  1511. package/dist/src/adapter-shadow.js +2 -0
  1512. package/dist/src/adapter-shadow.test.d.ts +1 -0
  1513. package/dist/src/adapter-source.d.ts +11 -0
  1514. package/dist/src/adapter-source.js +1 -0
  1515. package/dist/src/adapter-source.test.d.ts +1 -0
  1516. package/dist/src/browser/analyze.d.ts +118 -0
  1517. package/dist/src/browser/analyze.js +1 -0
  1518. package/dist/src/browser/analyze.test.d.ts +1 -0
  1519. package/dist/src/browser/article-extract.d.ts +57 -0
  1520. package/dist/src/browser/article-extract.e2e.test.d.ts +1 -0
  1521. package/dist/src/browser/article-extract.js +2 -0
  1522. package/dist/src/browser/article-extract.test.d.ts +1 -0
  1523. package/dist/src/browser/ax-snapshot.d.ts +37 -0
  1524. package/dist/src/browser/ax-snapshot.js +2 -0
  1525. package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
  1526. package/dist/src/browser/base-page.d.ts +151 -0
  1527. package/dist/src/browser/base-page.js +225 -0
  1528. package/dist/src/browser/base-page.test.d.ts +1 -0
  1529. package/dist/src/browser/bridge-readiness.d.ts +14 -0
  1530. package/dist/src/browser/bridge-readiness.js +1 -0
  1531. package/dist/src/browser/bridge-readiness.test.d.ts +1 -0
  1532. package/dist/src/browser/bridge.d.ts +26 -0
  1533. package/dist/src/browser/bridge.js +1 -0
  1534. package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
  1535. package/dist/src/browser/cdp.d.ts +51 -0
  1536. package/dist/src/browser/cdp.js +1 -0
  1537. package/dist/src/browser/cdp.test.d.ts +1 -0
  1538. package/dist/src/browser/compound.d.ts +59 -0
  1539. package/dist/src/browser/compound.js +82 -0
  1540. package/dist/src/browser/compound.test.d.ts +1 -0
  1541. package/dist/src/browser/config.d.ts +2 -0
  1542. package/dist/src/browser/config.js +1 -0
  1543. package/dist/src/browser/daemon-client.d.ts +79 -0
  1544. package/dist/src/browser/daemon-client.js +1 -0
  1545. package/dist/src/browser/daemon-client.test.d.ts +1 -0
  1546. package/dist/src/browser/daemon-lifecycle.d.ts +37 -0
  1547. package/dist/src/browser/daemon-lifecycle.js +12 -0
  1548. package/dist/src/browser/daemon-transport.d.ts +55 -0
  1549. package/dist/src/browser/daemon-transport.js +1 -0
  1550. package/dist/src/browser/daemon-version.d.ts +4 -0
  1551. package/dist/src/browser/daemon-version.js +2 -0
  1552. package/dist/src/browser/dom-helpers.d.ts +41 -0
  1553. package/dist/src/browser/dom-helpers.js +166 -0
  1554. package/dist/src/browser/dom-helpers.test.d.ts +1 -0
  1555. package/dist/src/browser/dom-snapshot.d.ts +93 -0
  1556. package/dist/src/browser/dom-snapshot.js +809 -0
  1557. package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
  1558. package/dist/src/browser/errors.d.ts +38 -0
  1559. package/dist/src/browser/errors.js +5 -0
  1560. package/dist/src/browser/errors.test.d.ts +1 -0
  1561. package/dist/src/browser/extract.d.ts +69 -0
  1562. package/dist/src/browser/extract.js +42 -0
  1563. package/dist/src/browser/extract.test.d.ts +1 -0
  1564. package/dist/src/browser/find.d.ts +84 -0
  1565. package/dist/src/browser/find.js +328 -0
  1566. package/dist/src/browser/find.test.d.ts +1 -0
  1567. package/dist/src/browser/fingerprint.d.ts +44 -0
  1568. package/dist/src/browser/fingerprint.js +82 -0
  1569. package/dist/src/browser/html-tree.d.ts +75 -0
  1570. package/dist/src/browser/html-tree.js +61 -0
  1571. package/dist/src/browser/html-tree.test.d.ts +1 -0
  1572. package/dist/src/browser/index.d.ts +14 -0
  1573. package/dist/src/browser/index.js +1 -0
  1574. package/dist/src/browser/managed-chrome.d.ts +89 -0
  1575. package/dist/src/browser/managed-chrome.js +1 -0
  1576. package/dist/src/browser/network-cache.d.ts +49 -0
  1577. package/dist/src/browser/network-cache.js +1 -0
  1578. package/dist/src/browser/network-cache.test.d.ts +1 -0
  1579. package/dist/src/browser/network-key.d.ts +22 -0
  1580. package/dist/src/browser/network-key.js +1 -0
  1581. package/dist/src/browser/network-key.test.d.ts +1 -0
  1582. package/dist/src/browser/page.d.ts +83 -0
  1583. package/dist/src/browser/page.js +15 -0
  1584. package/dist/src/browser/page.test.d.ts +1 -0
  1585. package/dist/src/browser/profile.d.ts +96 -0
  1586. package/dist/src/browser/profile.js +2 -0
  1587. package/dist/src/browser/proxy-test.d.ts +28 -0
  1588. package/dist/src/browser/proxy-test.js +12 -0
  1589. package/dist/src/browser/shape-filter.d.ts +52 -0
  1590. package/dist/src/browser/shape-filter.js +1 -0
  1591. package/dist/src/browser/shape-filter.test.d.ts +1 -0
  1592. package/dist/src/browser/shape.d.ts +23 -0
  1593. package/dist/src/browser/shape.js +1 -0
  1594. package/dist/src/browser/shape.test.d.ts +1 -0
  1595. package/dist/src/browser/stealth.d.ts +18 -0
  1596. package/dist/src/browser/stealth.js +391 -0
  1597. package/dist/src/browser/stealth.test.d.ts +1 -0
  1598. package/dist/src/browser/tabs.d.ts +13 -0
  1599. package/dist/src/browser/tabs.js +2 -0
  1600. package/dist/src/browser/target-errors.d.ts +39 -0
  1601. package/dist/src/browser/target-errors.js +1 -0
  1602. package/dist/src/browser/target-errors.test.d.ts +1 -0
  1603. package/dist/src/browser/target-resolver.d.ts +158 -0
  1604. package/dist/src/browser/target-resolver.js +423 -0
  1605. package/dist/src/browser/target-resolver.test.d.ts +1 -0
  1606. package/dist/src/browser/trace.d.ts +21 -0
  1607. package/dist/src/browser/trace.js +2 -0
  1608. package/dist/src/browser/utils.d.ts +20 -0
  1609. package/dist/src/browser/utils.js +1 -0
  1610. package/dist/src/browser/utils.test.d.ts +1 -0
  1611. package/dist/src/browser/verify-fixture.d.ts +65 -0
  1612. package/dist/src/browser/verify-fixture.js +2 -0
  1613. package/dist/src/browser/verify-fixture.test.d.ts +1 -0
  1614. package/dist/src/browser/visual-refs.d.ts +11 -0
  1615. package/dist/src/browser/visual-refs.js +94 -0
  1616. package/dist/src/browser-session-lock.d.ts +13 -0
  1617. package/dist/src/browser-session-lock.js +1 -0
  1618. package/dist/src/browser-session-lock.test.d.ts +1 -0
  1619. package/dist/src/browser.test.d.ts +1 -0
  1620. package/dist/src/build-manifest.d.ts +103 -0
  1621. package/dist/src/build-manifest.js +16 -0
  1622. package/dist/src/build-manifest.test.d.ts +1 -0
  1623. package/dist/src/capabilityRouting.d.ts +19 -0
  1624. package/dist/src/capabilityRouting.js +1 -0
  1625. package/dist/src/capabilityRouting.test.d.ts +1 -0
  1626. package/dist/src/cli-argv-preprocess.d.ts +63 -0
  1627. package/dist/src/cli-argv-preprocess.js +1 -0
  1628. package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
  1629. package/dist/src/cli.d.ts +79 -0
  1630. package/dist/src/cli.js +132 -0
  1631. package/dist/src/cli.test.d.ts +1 -0
  1632. package/dist/src/commanderAdapter.d.ts +21 -0
  1633. package/dist/src/commanderAdapter.js +3 -0
  1634. package/dist/src/commanderAdapter.test.d.ts +1 -0
  1635. package/dist/src/commands/auth.d.ts +40 -0
  1636. package/dist/src/commands/auth.js +2 -0
  1637. package/dist/src/commands/auth.test.d.ts +1 -0
  1638. package/dist/src/commands/daemon.d.ts +25 -0
  1639. package/dist/src/commands/daemon.js +1 -0
  1640. package/dist/src/commands/daemon.test.d.ts +1 -0
  1641. package/dist/src/completion-fast.d.ts +22 -0
  1642. package/dist/src/completion-fast.js +1 -0
  1643. package/dist/src/completion-shared.d.ts +13 -0
  1644. package/dist/src/completion-shared.js +30 -0
  1645. package/dist/src/completion.d.ts +21 -0
  1646. package/dist/src/completion.js +1 -0
  1647. package/dist/src/completion.test.d.ts +1 -0
  1648. package/dist/src/constants.d.ts +22 -0
  1649. package/dist/src/constants.js +1 -0
  1650. package/dist/src/convention-audit.d.ts +50 -0
  1651. package/dist/src/convention-audit.js +2 -0
  1652. package/dist/src/convention-audit.test.d.ts +1 -0
  1653. package/dist/src/daemon-utils.d.ts +18 -0
  1654. package/dist/src/daemon-utils.js +1 -0
  1655. package/dist/src/daemon.d.ts +22 -0
  1656. package/dist/src/daemon.js +1 -0
  1657. package/dist/src/daemon.test.d.ts +1 -0
  1658. package/dist/src/discovery.d.ts +43 -0
  1659. package/dist/src/discovery.js +2 -0
  1660. package/dist/src/doctor.d.ts +38 -0
  1661. package/dist/src/doctor.js +13 -0
  1662. package/dist/src/doctor.test.d.ts +1 -0
  1663. package/dist/src/download/article-download.d.ts +72 -0
  1664. package/dist/src/download/article-download.js +21 -0
  1665. package/dist/src/download/article-download.test.d.ts +1 -0
  1666. package/dist/src/download/index.d.ts +71 -0
  1667. package/dist/src/download/index.js +7 -0
  1668. package/dist/src/download/index.test.d.ts +1 -0
  1669. package/dist/src/download/media-download.d.ts +49 -0
  1670. package/dist/src/download/media-download.js +1 -0
  1671. package/dist/src/download/media-download.test.d.ts +1 -0
  1672. package/dist/src/download/progress.d.ts +36 -0
  1673. package/dist/src/download/progress.js +5 -0
  1674. package/dist/src/download/progress.test.d.ts +1 -0
  1675. package/dist/src/electron-apps.d.ts +31 -0
  1676. package/dist/src/electron-apps.js +1 -0
  1677. package/dist/src/electron-apps.test.d.ts +1 -0
  1678. package/dist/src/engine.test.d.ts +1 -0
  1679. package/dist/src/errors.d.ts +117 -0
  1680. package/dist/src/errors.js +2 -0
  1681. package/dist/src/errors.test.d.ts +1 -0
  1682. package/dist/src/execution.d.ts +24 -0
  1683. package/dist/src/execution.js +2 -0
  1684. package/dist/src/execution.test.d.ts +1 -0
  1685. package/dist/src/extension-manifest-regression.test.d.ts +1 -0
  1686. package/dist/src/external-clis.yaml +109 -0
  1687. package/dist/src/external.d.ts +49 -0
  1688. package/dist/src/external.js +1 -0
  1689. package/dist/src/external.test.d.ts +1 -0
  1690. package/dist/src/help.d.ts +88 -0
  1691. package/dist/src/help.js +8 -0
  1692. package/dist/src/help.test.d.ts +1 -0
  1693. package/dist/src/hooks.d.ts +46 -0
  1694. package/dist/src/hooks.js +1 -0
  1695. package/dist/src/hooks.test.d.ts +4 -0
  1696. package/dist/src/interceptor.d.ts +44 -0
  1697. package/dist/src/interceptor.js +123 -0
  1698. package/dist/src/interceptor.test.d.ts +4 -0
  1699. package/dist/src/launcher.d.ts +41 -0
  1700. package/dist/src/launcher.js +7 -0
  1701. package/dist/src/launcher.test.d.ts +1 -0
  1702. package/dist/src/logger.d.ts +26 -0
  1703. package/dist/src/logger.js +9 -0
  1704. package/dist/src/main.d.ts +5 -0
  1705. package/dist/src/main.js +10 -0
  1706. package/dist/src/manifest-types.d.ts +43 -0
  1707. package/dist/src/manifest-types.js +1 -0
  1708. package/dist/src/node-network.d.ts +10 -0
  1709. package/dist/src/node-network.js +1 -0
  1710. package/dist/src/node-network.test.d.ts +1 -0
  1711. package/dist/src/observation/artifact.d.ts +16 -0
  1712. package/dist/src/observation/artifact.js +8 -0
  1713. package/dist/src/observation/artifact.test.d.ts +1 -0
  1714. package/dist/src/observation/events.d.ts +89 -0
  1715. package/dist/src/observation/events.js +1 -0
  1716. package/dist/src/observation/index.d.ts +7 -0
  1717. package/dist/src/observation/index.js +1 -0
  1718. package/dist/src/observation/manager.d.ts +9 -0
  1719. package/dist/src/observation/manager.js +1 -0
  1720. package/dist/src/observation/manager.test.d.ts +1 -0
  1721. package/dist/src/observation/redaction.d.ts +11 -0
  1722. package/dist/src/observation/redaction.js +2 -0
  1723. package/dist/src/observation/redaction.test.d.ts +1 -0
  1724. package/dist/src/observation/retention.d.ts +32 -0
  1725. package/dist/src/observation/retention.js +1 -0
  1726. package/dist/src/observation/retention.test.d.ts +1 -0
  1727. package/dist/src/observation/ring-buffer.d.ts +22 -0
  1728. package/dist/src/observation/ring-buffer.js +1 -0
  1729. package/dist/src/observation/ring-buffer.test.d.ts +1 -0
  1730. package/dist/src/observation/session.d.ts +25 -0
  1731. package/dist/src/observation/session.js +1 -0
  1732. package/dist/src/output.d.ts +14 -0
  1733. package/dist/src/output.js +2 -0
  1734. package/dist/src/output.test.d.ts +1 -0
  1735. package/dist/src/package-exports.test.d.ts +1 -0
  1736. package/dist/src/package-paths.d.ts +8 -0
  1737. package/dist/src/package-paths.js +1 -0
  1738. package/dist/src/pipeline/executor.d.ts +11 -0
  1739. package/dist/src/pipeline/executor.js +1 -0
  1740. package/dist/src/pipeline/executor.test.d.ts +4 -0
  1741. package/dist/src/pipeline/index.d.ts +5 -0
  1742. package/dist/src/pipeline/index.js +1 -0
  1743. package/dist/src/pipeline/registry.d.ts +28 -0
  1744. package/dist/src/pipeline/registry.js +1 -0
  1745. package/dist/src/pipeline/steps/browser.d.ts +13 -0
  1746. package/dist/src/pipeline/steps/browser.js +1 -0
  1747. package/dist/src/pipeline/steps/download.d.ts +18 -0
  1748. package/dist/src/pipeline/steps/download.js +1 -0
  1749. package/dist/src/pipeline/steps/download.test.d.ts +1 -0
  1750. package/dist/src/pipeline/steps/fetch.d.ts +5 -0
  1751. package/dist/src/pipeline/steps/fetch.js +31 -0
  1752. package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
  1753. package/dist/src/pipeline/steps/intercept.d.ts +5 -0
  1754. package/dist/src/pipeline/steps/intercept.js +1 -0
  1755. package/dist/src/pipeline/steps/tap.d.ts +12 -0
  1756. package/dist/src/pipeline/steps/tap.js +53 -0
  1757. package/dist/src/pipeline/steps/transform.d.ts +9 -0
  1758. package/dist/src/pipeline/steps/transform.js +1 -0
  1759. package/dist/src/pipeline/template.d.ts +17 -0
  1760. package/dist/src/pipeline/template.js +1 -0
  1761. package/dist/src/pipeline/template.test.d.ts +4 -0
  1762. package/dist/src/pipeline/transform.test.d.ts +4 -0
  1763. package/dist/src/plugin-manifest.d.ts +70 -0
  1764. package/dist/src/plugin-manifest.js +1 -0
  1765. package/dist/src/plugin-manifest.test.d.ts +4 -0
  1766. package/dist/src/plugin-scaffold.d.ts +28 -0
  1767. package/dist/src/plugin-scaffold.js +75 -0
  1768. package/dist/src/plugin-scaffold.test.d.ts +4 -0
  1769. package/dist/src/plugin.d.ts +145 -0
  1770. package/dist/src/plugin.js +20 -0
  1771. package/dist/src/plugin.test.d.ts +4 -0
  1772. package/dist/src/rate-limit.d.ts +15 -0
  1773. package/dist/src/rate-limit.js +2 -0
  1774. package/dist/src/rate-limit.test.d.ts +1 -0
  1775. package/dist/src/registry-api.d.ts +13 -0
  1776. package/dist/src/registry-api.js +1 -0
  1777. package/dist/src/registry.d.ts +130 -0
  1778. package/dist/src/registry.js +1 -0
  1779. package/dist/src/registry.test.d.ts +4 -0
  1780. package/dist/src/runtime-detect.d.ts +31 -0
  1781. package/dist/src/runtime-detect.js +1 -0
  1782. package/dist/src/runtime-detect.test.d.ts +1 -0
  1783. package/dist/src/runtime.d.ts +57 -0
  1784. package/dist/src/runtime.js +1 -0
  1785. package/dist/src/scripts/framework.d.ts +7 -0
  1786. package/dist/src/scripts/framework.js +1 -0
  1787. package/dist/src/scripts/interact.d.ts +4 -0
  1788. package/dist/src/scripts/interact.js +1 -0
  1789. package/dist/src/scripts/store.d.ts +13 -0
  1790. package/dist/src/scripts/store.js +1 -0
  1791. package/dist/src/serialization.d.ts +42 -0
  1792. package/dist/src/serialization.js +4 -0
  1793. package/dist/src/serialization.test.d.ts +1 -0
  1794. package/dist/src/skills.d.ts +14 -0
  1795. package/dist/src/skills.js +6 -0
  1796. package/dist/src/skills.test.d.ts +1 -0
  1797. package/dist/src/snapshotFormatter.d.ts +11 -0
  1798. package/dist/src/snapshotFormatter.js +3 -0
  1799. package/dist/src/snapshotFormatter.test.d.ts +7 -0
  1800. package/dist/src/tui.d.ts +28 -0
  1801. package/dist/src/tui.js +16 -0
  1802. package/dist/src/tui.test.d.ts +1 -0
  1803. package/dist/src/types.d.ts +236 -0
  1804. package/dist/src/types.js +1 -0
  1805. package/dist/src/utils.d.ts +57 -0
  1806. package/dist/src/utils.js +38 -0
  1807. package/dist/src/utils.test.d.ts +1 -0
  1808. package/dist/src/validate.d.ts +21 -0
  1809. package/dist/src/validate.js +3 -0
  1810. package/dist/src/validate.test.d.ts +9 -0
  1811. package/dist/src/verify.d.ts +27 -0
  1812. package/dist/src/verify.js +2 -0
  1813. package/dist/src/verify.test.d.ts +8 -0
  1814. package/dist/src/version.d.ts +4 -0
  1815. package/dist/src/version.js +1 -0
  1816. package/dist/src/weixin-download.test.d.ts +1 -0
  1817. package/docs/guide/browser-bridge.md +94 -0
  1818. package/docs/guide/electron-app-cli.md +199 -0
  1819. package/docs/guide/exit-codes.md +24 -0
  1820. package/docs/guide/extending-opencli.md +134 -0
  1821. package/docs/guide/getting-started.md +81 -0
  1822. package/docs/guide/installation.md +52 -0
  1823. package/docs/guide/plugins.md +226 -0
  1824. package/docs/guide/remote-orchestration.md +116 -0
  1825. package/docs/guide/troubleshooting.md +69 -0
  1826. package/package.json +116 -0
  1827. package/scripts/check-doc-coverage.sh +81 -0
  1828. package/scripts/check-listing-id-pairing.mjs +193 -0
  1829. package/scripts/check-silent-column-drop.mjs +105 -0
  1830. package/scripts/check-typed-error-lint.mjs +118 -0
  1831. package/scripts/clean-dist.cjs +13 -0
  1832. package/scripts/copy-yaml.cjs +12 -0
  1833. package/scripts/fetch-adapters.js +293 -0
  1834. package/scripts/minify-release.mjs +115 -0
  1835. package/scripts/postinstall.js +174 -0
  1836. package/scripts/silent-column-drop-baseline.json +910 -0
  1837. package/scripts/typed-error-lint-baseline.json +1098 -0
  1838. package/skills/opencli-adapter-author/SKILL.md +256 -0
  1839. package/skills/opencli-adapter-author/references/adapter-template.md +471 -0
  1840. package/skills/opencli-adapter-author/references/api-discovery.md +295 -0
  1841. package/skills/opencli-adapter-author/references/coverage-matrix.md +81 -0
  1842. package/skills/opencli-adapter-author/references/field-conventions.md +172 -0
  1843. package/skills/opencli-adapter-author/references/field-decode-playbook.md +181 -0
  1844. package/skills/opencli-adapter-author/references/jsdom-fixture-pattern.md +196 -0
  1845. package/skills/opencli-adapter-author/references/output-design.md +149 -0
  1846. package/skills/opencli-adapter-author/references/site-memory/bilibili.md +70 -0
  1847. package/skills/opencli-adapter-author/references/site-memory/eastmoney.md +70 -0
  1848. package/skills/opencli-adapter-author/references/site-memory/tonghuashun.md +51 -0
  1849. package/skills/opencli-adapter-author/references/site-memory/xueqiu.md +58 -0
  1850. package/skills/opencli-adapter-author/references/site-memory.md +231 -0
  1851. package/skills/opencli-adapter-author/references/site-recon.md +134 -0
  1852. package/skills/opencli-adapter-author/references/strategy-selection.md +169 -0
  1853. package/skills/opencli-adapter-author/references/success-rate-pitfalls.md +162 -0
  1854. package/skills/opencli-adapter-author/references/typed-errors.md +234 -0
  1855. package/skills/opencli-autofix/SKILL.md +297 -0
  1856. package/skills/opencli-browser/SKILL.md +468 -0
  1857. package/skills/opencli-browser-sitemap/SKILL.md +96 -0
  1858. package/skills/opencli-sitemap-author/SKILL.md +161 -0
  1859. package/skills/opencli-sitemap-author/references/sitemap-schema.md +660 -0
  1860. package/skills/opencli-usage/SKILL.md +168 -0
@@ -0,0 +1,25 @@
1
+ import{AuthRequiredError as i,CommandExecutionError as a}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as s}from"../_shared/site-auth.js";async function n(t){return(await t.getCookies({url:"https://kyfw.12306.cn"})).some((r)=>r.name==="tk"&&r.value)}async function o(t){if(!await n(t))throw new i("12306.cn","12306 tk auth cookie missing");await t.goto("https://kyfw.12306.cn/otn/view/index.html");await t.wait(2);const e=await t.evaluate(`(async () => {
2
+ try {
3
+ const r = await fetch('/otn/index/initMy12306Api', {
4
+ method: 'POST',
5
+ credentials: 'include',
6
+ headers: { 'X-Requested-With': 'XMLHttpRequest' },
7
+ });
8
+ if (/login\\.html/.test(r.url)) {
9
+ return { kind: 'auth', detail: '12306 initMy12306Api redirected to login' };
10
+ }
11
+ const t = await r.text();
12
+ let d = null;
13
+ try { d = JSON.parse(t); } catch {}
14
+ if (!d || d.status === false || /未登录|登录超时|NotLogin/i.test(t)) {
15
+ return { kind: 'auth', detail: '12306 initMy12306Api returned NotLogin' };
16
+ }
17
+ const userName = d.data?.user_name || d.data?.userName || d.user_name || '';
18
+ if (!userName) {
19
+ return { kind: 'auth', detail: '12306 initMy12306Api 200 but no user_name surface' };
20
+ }
21
+ return { ok: true, user_name: String(userName) };
22
+ } catch (e) {
23
+ return { kind: 'exception', detail: String(e && e.message || e) };
24
+ }
25
+ })()`);if(e?.kind==="auth")throw new i("12306.cn",e.detail);if(e?.kind==="exception")throw new a(`12306 whoami failed: ${e.detail}`);if(!e?.ok)throw new a(`Unexpected 12306 probe: ${JSON.stringify(e)}`);return{user_name:e.user_name}}s({site:"12306",domain:"12306.cn",loginUrl:"https://kyfw.12306.cn/otn/resources/login.html",columns:["user_name"],quickCheck:n,verify:o,poll:async(t)=>{if(!await n(t))throw new i("12306.cn","Waiting for 12306 tk auth cookie");return o(t)}});
@@ -0,0 +1,9 @@
1
+ import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{AuthRequiredError as s,CommandExecutionError as i}from"@jackwener/opencli/errors";import{isAuthLikePayload as d,maskEmail as f,maskMobile as _,maskChineseName as h,require12306Login as y,requireEvaluateObject as w}from"./utils.js";const b="https://kyfw.12306.cn/otn/modifyUser/initQueryUserInfoApi";c({site:"12306",name:"me",access:"read",description:"Show the logged-in 12306 account summary. Sensitive fields (real name, email, mobile, birth date) are masked by default; pass --include-sensitive to opt in.",domain:"kyfw.12306.cn",strategy:l.COOKIE,browser:!0,args:[{name:"include-sensitive",type:"boolean",default:!1,help:"Reveal unmasked real name / email / mobile / birth date. The 12306 ID-number mask is server-side and never decoded."}],columns:["username","real_name","email","mobile","birth_date","sex","country","user_type","member","active"],func:async(t,m)=>{if(!t)throw new i("Browser session required for 12306 me");await t.goto("https://kyfw.12306.cn/otn/view/index.html");await y(t,s);const r=w(await t.evaluate(`async () => {
2
+ const r = await fetch(${JSON.stringify(b)}, { credentials: 'include' });
3
+ if (!r.ok) return { __http: r.status };
4
+ try {
5
+ return await r.json();
6
+ } catch (err) {
7
+ return { __parse: String(err && err.message || err) };
8
+ }
9
+ }`),"account info");if(r?.__http){if([401,403].includes(Number(r.__http)))throw new s("kyfw.12306.cn","12306 account info requires a valid login session");throw new i(`12306 returned HTTP ${r.__http} for account info`)}if(r?.__parse)throw new i(`12306 account info returned non-JSON body: ${r.__parse}`);if(d(r))throw new s("kyfw.12306.cn","12306 account info requires a valid login session");if(r?.status!==!0||!r?.data?.userDTO)throw new i("12306 account info payload missing userDTO");const e=r.data.userDTO,n=e.loginUserDTO||{},u=n.user_name||n.name||"",o=n.real_name||n.realname||"",a=m["include-sensitive"]===!0;return[{username:u,real_name:a?o:h(o),email:a?e.email||"":f(e.email||""),mobile:a?e.mobile_no||"":_(e.mobile_no||""),birth_date:a?e.born_date||"":(e.born_date||"").slice(0,4),sex:e.sex_code==="M"?"男":e.sex_code==="F"?"女":"",country:e.country_code||"",user_type:r.data.userTypeName||"",member:e.flag_member==="1",active:e.is_active==="1"}]}});
@@ -0,0 +1,13 @@
1
+ import{cli as _,Strategy as c}from"@jackwener/opencli/registry";import{AuthRequiredError as o,CommandExecutionError as a,EmptyResultError as l}from"@jackwener/opencli/errors";import{isAuthLikePayload as m,maskChineseName as p,require12306Login as f,requireEvaluateObject as y}from"./utils.js";const h="https://kyfw.12306.cn/otn/queryOrder/queryMyOrderNoComplete";_({site:"12306",name:"orders",access:"read",description:"List in-progress 12306 orders (not yet ridden, refunded, or completed) for the logged-in user",domain:"kyfw.12306.cn",strategy:c.COOKIE,browser:!0,args:[{name:"include-sensitive",type:"boolean",default:!1,help:"Reveal unmasked passenger names in order rows. Masked by default."}],columns:["order_id","order_date","train_code","from_station","to_station","departure","passengers","status","amount"],func:async(s,i)=>{if(!s)throw new a("Browser session required for 12306 orders");await s.goto("https://kyfw.12306.cn/otn/view/index.html");await f(s,o);const d=i["include-sensitive"]===!0,r=y(await s.evaluate(`async () => {
2
+ const r = await fetch(${JSON.stringify(h)}, {
3
+ method: 'POST',
4
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
5
+ body: '_json_att=', credentials: 'include',
6
+ });
7
+ if (!r.ok) return { __http: r.status };
8
+ try {
9
+ return await r.json();
10
+ } catch (err) {
11
+ return { __parse: String(err && err.message || err) };
12
+ }
13
+ }`),"orders");if(r?.__http){if([401,403].includes(Number(r.__http)))throw new o("kyfw.12306.cn","12306 orders requires a valid login session");throw new a(`12306 returned HTTP ${r.__http} for queryMyOrderNoComplete`)}if(r?.__parse)throw new a(`12306 orders returned non-JSON body: ${r.__parse}`);if(m(r))throw new o("kyfw.12306.cn","12306 orders requires a valid login session");if(r?.status!==!0)throw new a("12306 queryMyOrderNoComplete returned a failure status");let t;if(Array.isArray(r?.data?.orderDBList))t=r.data.orderDBList;else if(Array.isArray(r?.data?.orderDTODataList))t=r.data.orderDTODataList;else if(Array.isArray(r?.data?.orders))t=r.data.orders;else if(Array.isArray(r?.data))t=r.data;else throw new a("12306 queryMyOrderNoComplete payload missing order list array");if(t.length===0)throw new l("No in-progress 12306 orders on this account");return t.map((e)=>{const u=(Array.isArray(e.tickets)?e.tickets:[]).map((n)=>n.passenger_name||"").filter(Boolean).map((n)=>d?n:p(n)).join(", ");return{order_id:e.sequence_no||e.order_id||e.sequenceNo||"",order_date:e.order_date||"",train_code:e.train_code_page||e.station_train_code||e.train_code||"",from_station:e.from_station_name_page||e.from_station_name||"",to_station:e.to_station_name_page||e.to_station_name||"",departure:e.start_train_date_page||e.start_train_date||"",passengers:u,status:e.ticket_status_name||e.order_status_name||e.statusName||"",amount:e.ticket_total_price_page||e.ticket_total_price||""}})}});
@@ -0,0 +1,14 @@
1
+ import{cli as c,Strategy as p}from"@jackwener/opencli/registry";import{ArgumentError as m,AuthRequiredError as o,CommandExecutionError as i,EmptyResultError as _}from"@jackwener/opencli/errors";import{isAuthLikePayload as y,maskChineseName as g,require12306Login as f,requireEvaluateObject as h}from"./utils.js";const w="https://kyfw.12306.cn/otn/passengers/query",d=50;function l(e,a,t){if(e===void 0||e===null||e==="")return a;const n=Number(e);if(!Number.isInteger(n)||n<1)throw new m(`limit must be a positive integer (1-${t})`);if(n>t)throw new m(`limit must be <= ${t}`);return n}c({site:"12306",name:"passengers",access:"read",description:"List the logged-in user's saved 12306 passengers. Sensitive fields are masked by default; pass --include-sensitive to opt in.",domain:"kyfw.12306.cn",strategy:p.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:20,help:`Max passengers to return (1-${d})`},{name:"include-sensitive",type:"boolean",default:!1,help:"Reveal unmasked real names and birth dates. The 12306 ID-number / mobile masks are server-side and never decoded."}],columns:["name","sex","born_year","id_type","id_no","mobile","passenger_type","country"],func:async(e,a)=>{if(!e)throw new i("Browser session required for 12306 passengers");const t=l(a.limit,20,d),n=a["include-sensitive"]===!0;await e.goto("https://kyfw.12306.cn/otn/view/index.html");await f(e,o);const s=h(await e.evaluate(`async () => {
2
+ const body = "pageIndex=1&pageSize=${d}";
3
+ const r = await fetch(${JSON.stringify(w)}, {
4
+ method: 'POST',
5
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
6
+ body, credentials: 'include',
7
+ });
8
+ if (!r.ok) return { __http: r.status };
9
+ try {
10
+ return await r.json();
11
+ } catch (err) {
12
+ return { __parse: String(err && err.message || err) };
13
+ }
14
+ }`),"passengers");if(s?.__http){if([401,403].includes(Number(s.__http)))throw new o("kyfw.12306.cn","12306 passengers requires a valid login session");throw new i(`12306 returned HTTP ${s.__http} for passengers/query`)}if(s?.__parse)throw new i(`12306 passengers returned non-JSON body: ${s.__parse}`);if(y(s))throw new o("kyfw.12306.cn","12306 passengers requires a valid login session");if(s?.status!==!0||!Array.isArray(s?.data?.datas))throw new i("12306 passengers payload missing data.datas array");const u=s.data.datas;if(u.length===0)throw new _("No saved passengers on this 12306 account");return u.slice(0,t).map((r)=>({name:n?r.passenger_name||"":g(r.passenger_name||""),sex:r.sex_name||"",born_year:(r.born_date||"").slice(0,4),id_type:r.passenger_id_type_name||"",id_no:r.passenger_id_no||"",mobile:r.mobile_no||"",passenger_type:r.passenger_type_name||"",country:r.country_code||""}))}});export const __test__={normalizeLimit:l};
@@ -0,0 +1 @@
1
+ import{cli as x,Strategy as R}from"@jackwener/opencli/registry";import{ArgumentError as B,CommandExecutionError as $,EmptyResultError as _}from"@jackwener/opencli/errors";import{fetchStationBundle as j,mintSession as y,resolveStation as L,validateDate as T}from"./utils.js";const O="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0 Safari/537.36",U=/^[0-9A-Za-z]{8,18}$/,C=/^[A-Z0-9]{1,32}$/,b={A9:"商务座",P:"特等座",M:"一等座",O:"二等座",A1:"硬座",A3:"硬卧",A4:"软卧",F:"动卧",WZ:"无座"};async function q(Q,J,G,M,V,W=fetch){const X=`https://kyfw.12306.cn/otn/czxx/queryByTrainNo?train_no=${J}&from_station_telecode=${G}&to_station_telecode=${M}&depart_date=${V}`,K=await W(X,{headers:{"User-Agent":O,Referer:"https://kyfw.12306.cn/otn/leftTicket/init",Cookie:Q}});if(!K.ok)throw new $(`12306 queryByTrainNo returned HTTP ${K.status}`);let z;try{z=await K.json()}catch{throw new $("12306 queryByTrainNo returned non-JSON body")}if(z?.status!==!0||!Array.isArray(z?.data?.data))throw new $("12306 queryByTrainNo returned an unexpected payload shape");return z.data.data}function D(Q,J,G,M,V){const W=(z,Z,Y)=>z.station_name&&Y&&z.station_name===Y,X=Q.find((z)=>W(z,J,M)),K=Q.find((z)=>W(z,G,V));if(!X)throw new $(`Train does not stop at ${M}`);if(!K)throw new $(`Train does not stop at ${V}`);return{fromNo:X.station_no,toNo:K.station_no}}async function H(Q,J,G,M,V,W,X=fetch){const K=`https://kyfw.12306.cn/otn/leftTicket/queryTicketPrice?train_no=${J}&from_station_no=${G}&to_station_no=${M}&seat_types=${V}&train_date=${W}`,z=await X(K,{headers:{"User-Agent":O,Referer:"https://kyfw.12306.cn/otn/leftTicket/init",Cookie:Q}});if(!z.ok)throw new $(`12306 queryTicketPrice returned HTTP ${z.status}`);let Z;try{Z=await z.json()}catch{throw new $("12306 queryTicketPrice returned non-JSON body")}if(Z?.status!==!0||!Z?.data)throw new $("12306 queryTicketPrice returned an unexpected payload shape");return Z.data}function I(Q){const J=[];for(const[G,M]of Object.entries(Q)){if(G==="train_no"||G==="OT")continue;if(typeof M!=="string"||!M)continue;if(/^\d+$/.test(G))continue;if(!/^[A-Z]/.test(G))continue;const V=M.replace(/^¥/,"");if(!/^[\d.]+$/.test(V))continue;J.push({seat_code:G,seat_name:b[G]||G,price:V,currency:"CNY"})}J.sort((G,M)=>Number(M.price)-Number(G.price));return J}x({site:"12306",name:"price",access:"read",description:"Look up 12306 ticket prices by seat class for one train on a given date and segment (anonymous, no login required)",domain:"kyfw.12306.cn",strategy:R.PUBLIC,browser:!1,args:[{name:"train-no",positional:!0,required:!0,help:"Internal train_no from `12306 trains` (e.g. 24000000G10L)"},{name:"from",required:!0,help:"Origin station (Chinese name, telecode, or pinyin) - must be a stop of this train"},{name:"to",required:!0,help:"Destination station - must be a stop of this train"},{name:"date",required:!0,help:"Departure date in YYYY-MM-DD"},{name:"seat-types",default:"OM9PA1A3A4FWZ",help:"Seat-type letters to query (default covers the common classes). Examples: OM9 (二等/一等/商务), A1A3A4 (硬座/硬卧/软卧)."}],columns:["seat_code","seat_name","price","currency"],func:async(Q)=>{const J=String(Q["train-no"]??"").trim();if(!J)throw new B("<train-no> must not be empty");if(!U.test(J))throw new B(`<train-no> "${J}" does not look like a 12306 internal train_no`,"Use the train_no field from `12306 trains` output (e.g. 24000000G10L), not the public code (G1).");const G=String(Q.from??"").trim(),M=String(Q.to??"").trim();if(!G)throw new B("--from station must not be empty");if(!M)throw new B("--to station must not be empty");const V=T(Q.date),W=String(Q["seat-types"]??"").trim()||"OM9PA1A3A4FWZ";if(!C.test(W))throw new B("--seat-types must contain only 12306 seat letters/digits (A-Z, 0-9)");const X=await j(),K=L(X,G),z=L(X,M);if(K.code===z.code)throw new B(`--from and --to must differ; both resolved to ${K.name} (${K.code})`);const Z=await y(),Y=await q(Z,J,K.code,z.code,V),{fromNo:v,toNo:P}=D(Y,K.code,z.code,K.name,z.name),h=await H(Z,J,v,P,W,V),F=I(h);if(F.length===0)throw new _(`No prices returned for train_no=${J} ${K.name} -> ${z.name} on ${V}`,"Try a different seat-types letter set, or check that this train operates on the date.");return F}});export const __test__={parsePriceData:I,pickStationNos:D,queryStopsForPrice:q,queryPrice:H,SEAT_LETTERS:b,TRAIN_NO_RE:U};
@@ -0,0 +1 @@
1
+ import{cli as l,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as s,EmptyResultError as d}from"@jackwener/opencli/errors";import{fetchStationBundle as y}from"./utils.js";const c=50;function m(n,t,r){if(n===void 0||n===null||n==="")return t;const i=Number(n);if(!Number.isInteger(i)||i<1)throw new s(`limit must be a positive integer (1-${r})`);if(i>r)throw new s(`limit must be <= ${r}`);return i}l({site:"12306",name:"stations",access:"read",description:"Search 12306 (China Railway) stations by Chinese name, telecode, or pinyin keyword",domain:"kyfw.12306.cn",strategy:u.PUBLIC,browser:!1,args:[{name:"keyword",positional:!0,required:!0,help:"Chinese substring (上海), telecode (AOH), or pinyin (shanghai)"},{name:"limit",type:"int",default:20,help:`Maximum results (1-${c})`}],columns:["name","code","pinyin","abbr","city"],func:async(n)=>{const t=String(n.keyword??"").trim();if(!t)throw new s("keyword must not be empty");const r=m(n.limit,20,c),i=await y(),o=t.toLowerCase(),a=i.filter((e)=>e.name.includes(t)||e.code===t.toUpperCase()||e.pinyin.includes(o)||e.abbr.includes(o)||e.short.includes(o)||e.city.includes(t));if(a.length===0)throw new d(`No 12306 stations match "${t}"`);return a.slice(0,r).map((e)=>({name:e.name,code:e.code,pinyin:e.pinyin,abbr:e.abbr,city:e.city}))}});export const __test__={normalizeLimit:m};
@@ -0,0 +1 @@
1
+ import{cli as h,Strategy as y}from"@jackwener/opencli/registry";import{ArgumentError as a,CommandExecutionError as u,EmptyResultError as w}from"@jackwener/opencli/errors";import{fetchStationBundle as v,mintSession as g,resolveStation as p,validateDate as S}from"./utils.js";const b="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0 Safari/537.36",f=/^[0-9A-Za-z]{8,18}$/;async function _(o,e,s,m,c,d=fetch){const r=`https://kyfw.12306.cn/otn/czxx/queryByTrainNo?train_no=${e}&from_station_telecode=${s}&to_station_telecode=${m}&depart_date=${c}`,n=await d(r,{headers:{"User-Agent":b,Referer:"https://kyfw.12306.cn/otn/leftTicket/init",Cookie:o}});if(!n.ok)throw new u(`12306 queryByTrainNo returned HTTP ${n.status}`);let i;try{i=await n.json()}catch{throw new u("12306 queryByTrainNo returned non-JSON body")}if(i?.status!==!0||!Array.isArray(i?.data?.data))throw new u("12306 queryByTrainNo returned an unexpected payload shape");return i.data.data}h({site:"12306",name:"train",access:"read",description:"List every station a 12306 train calls at, with arrival / departure / stopover time (anonymous, no login required)",domain:"kyfw.12306.cn",strategy:y.PUBLIC,browser:!1,args:[{name:"train-no",positional:!0,required:!0,help:"Internal train_no from `12306 trains` (e.g. 24000000G10L), not the public code (G1)"},{name:"from",required:!0,help:"Origin station for the segment: Chinese name, telecode, or pinyin"},{name:"to",required:!0,help:"Destination station for the segment"},{name:"date",required:!0,help:"Departure date in YYYY-MM-DD"}],columns:["station_no","station_name","arrive_time","start_time","stopover_time"],func:async(o)=>{const e=String(o["train-no"]??"").trim();if(!e)throw new a("<train-no> must not be empty");if(!f.test(e))throw new a(`<train-no> "${e}" does not look like a 12306 internal train_no`,"Use the train_no field from `12306 trains` output (e.g. 24000000G10L), not the public code (G1).");const s=String(o.from??"").trim(),m=String(o.to??"").trim();if(!s)throw new a("--from station must not be empty");if(!m)throw new a("--to station must not be empty");const c=S(o.date),d=await v(),r=p(d,s),n=p(d,m);if(r.code===n.code)throw new a(`--from and --to must differ; both resolved to ${r.name} (${r.code})`);const i=await g(),l=await _(i,e,r.code,n.code,c);if(l.length===0)throw new w(`No stops returned for train_no=${e} on ${c}`);return l.map((t)=>({station_no:t.station_no||"",station_name:t.station_name||"",arrive_time:t.arrive_time==="----"?"":t.arrive_time||"",start_time:t.start_time==="----"?"":t.start_time||"",stopover_time:t.stopover_time==="----"?"":t.stopover_time||""}))}});export const __test__={queryStops:_,TRAIN_NO_RE:f};
@@ -0,0 +1 @@
1
+ import{cli as b,Strategy as R}from"@jackwener/opencli/registry";import{ArgumentError as H,CommandExecutionError as Y,EmptyResultError as j}from"@jackwener/opencli/errors";import{fetchStationBundle as C,mintSession as A,resolveStation as N,validateDate as v,parseTrainRecord as w}from"./utils.js";const f="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0 Safari/537.36",Q=["queryG","queryO","queryZ","queryA"],_=100,k=/^query[A-Z]$/;function q(F,K,J){if(F===void 0||F===null||F==="")return K;const G=Number(F);if(!Number.isInteger(G)||G<1)throw new H(`limit must be a positive integer (1-${J})`);if(G>J)throw new H(`limit must be <= ${J}`);return G}function U(F){const K=String(F??"").trim();if(!K)return"";const J=K.replace(/^leftTicket\//,"").trim();if(k.test(J))return J;try{const G=new URL(K,"https://kyfw.12306.cn");if(G.hostname!=="kyfw.12306.cn")return"";const $=G.pathname.match(/\/leftTicket\/(query[A-Z])$/);return $?$[1]:""}catch{return""}}async function I(F,K,J){let G;if(J)try{G=JSON.parse(J)}catch{}const $=U(G?.c_url);if($)return $;const z=U(F.headers?.get?.("location"));if(z)return z;if(F.status===302)throw new Y(`12306 ${K} redirected without a leftTicket query endpoint`);if(G?.c_url)throw new Y(`12306 ${K} returned an invalid rotation endpoint`);return""}async function L(F,K,J,G){const $={"User-Agent":f,Referer:"https://kyfw.12306.cn/otn/leftTicket/init",Cookie:F},z=`leftTicketDTO.train_date=${G}&leftTicketDTO.from_station=${K}&leftTicketDTO.to_station=${J}&purpose_codes=ADULT`;let B="";const V=[...Q],O=new Set;while(V.length>0){const W=V.shift();if(O.has(W))continue;O.add(W);const M=`https://kyfw.12306.cn/otn/leftTicket/${W}?${z}`,Z=await fetch(M,{headers:$,redirect:"manual"});if(!Z.ok){if(Z.status===302){const D=await Z.text(),P=await I(Z,W,D);if(P&&!O.has(P))V.unshift(P);continue}throw new Y(`12306 ${W} returned HTTP ${Z.status}`)}const X=await Z.text();B=X;let h;try{h=JSON.parse(X)}catch{throw new Y(`12306 ${W} returned non-JSON body`)}if(h?.c_url&&typeof h.c_url==="string"){const D=await I(Z,W,X);if(D&&!O.has(D))V.unshift(D);continue}if(Array.isArray(h?.data?.result))return h.data.result;throw new Y(`12306 ${W} returned an unexpected payload shape`)}throw new Y(`12306 rejected every known query endpoint name (${Q.join(", ")}); the wire protocol may have changed. Last body: ${B.slice(0,200)}`)}b({site:"12306",name:"trains",access:"read",description:"List trains between two 12306 stations on a given date (anonymous, no login required)",domain:"kyfw.12306.cn",strategy:R.PUBLIC,browser:!1,args:[{name:"from",positional:!0,required:!0,help:"Origin station: Chinese name (北京), telecode (BJP), or pinyin (beijing)"},{name:"to",positional:!0,required:!0,help:"Destination station: same forms as <from>"},{name:"date",required:!0,help:"Departure date in YYYY-MM-DD"},{name:"limit",type:"int",default:50,help:`Maximum rows (1-${_})`}],columns:["code","from_station","to_station","start_time","arrive_time","duration","available","business_seat","first_seat","second_seat","soft_sleeper","hard_sleeper","hard_seat","no_seat","train_no"],func:async(F)=>{const K=String(F.from??"").trim(),J=String(F.to??"").trim();if(!K)throw new H("<from> station must not be empty");if(!J)throw new H("<to> station must not be empty");const G=v(F.date),$=q(F.limit,50,_),z=await C(),B=N(z,K),V=N(z,J);if(B.code===V.code)throw new H(`<from> and <to> must differ; both resolved to ${B.name} (${B.code})`);const O=new Map(z.map((X)=>[X.code,X])),W=await A(),Z=(await L(W,B.code,V.code,G)).map((X)=>w(decodeURIComponent(X.replace(/%0A/g,"")),O)).filter(Boolean);if(Z.length===0)throw new j(`No trains found from ${B.name} to ${V.name} on ${G}`,"Try a different date or check whether the route is operated by 12306.");return Z.slice(0,$)}});export const __test__={normalizeLimit:q,extractQueryEndpoint:U,queryLeftTickets:L};
@@ -0,0 +1 @@
1
+ import{ArgumentError as Y,CommandExecutionError as X}from"@jackwener/opencli/errors";const M="https://kyfw.12306.cn/otn/resources/js/framework/station_name.js",j="https://kyfw.12306.cn/otn/leftTicket/init",$="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0 Safari/537.36",q=/^\d{4}-\d{2}-\d{2}$/,O=/^[A-Z]{2,4}$/;export function parseStationBundle(F){const z=F.match(/'([^']+)'/);if(!z)throw new X("Failed to parse 12306 station_name.js: source string not found");const K=z[1].split("@").filter(Boolean),Q=[];for(const Z of K){const V=Z.split("|");if(V.length<8||!V[2])continue;Q.push({short:V[0]||"",name:V[1]||"",code:V[2]||"",pinyin:V[3]||"",abbr:V[4]||"",city:V[7]||""})}if(Q.length===0)throw new X("Failed to parse 12306 station_name.js: no station records found");return Q}export function resolveStation(F,z){const G=String(z??"").trim();if(!G)throw new Y("station must not be empty");if(O.test(G)){const W=F.find((J)=>J.code===G);if(W)return W;throw new Y(`Unknown 12306 station telecode "${G}"`)}const K=G.toLowerCase(),Q=F.find((W)=>W.name===G);if(Q)return Q;const Z=F.find((W)=>W.pinyin===K);if(Z)return Z;const V=F.find((W)=>W.abbr===K||W.short===K);if(V)return V;throw new Y(`Unknown 12306 station "${G}"`,"Try the Chinese name (上海虹桥), the 3-4 letter telecode (AOH), or full pinyin (shanghaihongqiao).")}export function validateDate(F){if(!q.test(String(F??"")))throw new Y(`date must be YYYY-MM-DD, got "${F}"`);const[z,G,K]=F.split("-").map(Number),Q=new Date(Date.UTC(z,G-1,K));if(Q.getUTCFullYear()!==z||Q.getUTCMonth()!==G-1||Q.getUTCDate()!==K)throw new Y(`date "${F}" is not a real calendar date`);return F}export function buildCookieHeader(F){if(!Array.isArray(F)||F.length===0)return"";return F.map((z)=>z.split(";")[0]).filter(Boolean).join("; ")}export async function fetchStationBundle(F=fetch){const z=await F(M,{headers:{"User-Agent":$}});if(!z.ok)throw new X(`Failed to fetch 12306 station bundle: HTTP ${z.status}`);return parseStationBundle(await z.text())}export async function mintSession(F=fetch){const z=await F(j,{headers:{"User-Agent":$},redirect:"follow"});if(!z.ok)throw new X(`Failed to mint 12306 session: HTTP ${z.status}`);const G=typeof z.headers.getSetCookie==="function"?z.headers.getSetCookie():z.headers.raw?.()["set-cookie"]||[],K=buildCookieHeader(G);if(!K)throw new X("12306 init returned no session cookies");return K}export function parseTrainRecord(F,z){const G=F.split("|");if(G.length<33)return null;return{train_no:G[2]||"",code:G[3]||"",from_station:z.get(G[6])?.name||G[6]||"",to_station:z.get(G[7])?.name||G[7]||"",from_code:G[6]||"",to_code:G[7]||"",start_time:G[8]||"",arrive_time:G[9]||"",duration:G[10]||"",available:(G[1]||"").trim()==="预订"||(G[11]||"").trim()==="Y",business_seat:G[32]||"",first_seat:G[31]||"",second_seat:G[30]||"",soft_sleeper:G[23]||"",hard_sleeper:G[28]||"",hard_seat:G[29]||"",no_seat:G[26]||""}}export function maskEmail(F){const z=String(F||"").trim();if(!z)return"";const G=z.indexOf("@");if(G<=0)return z;const K=z.slice(0,G),Q=z.slice(G);if(K.length<=2)return K[0]+"*"+Q;return K[0]+"*".repeat(Math.max(1,K.length-2))+K.slice(-1)+Q}export function maskMobile(F){const z=String(F||"").trim();if(!z)return"";if(/\*/.test(z))return z;if(z.length<7)return z.replace(/.(?=.)/g,"*");return z.slice(0,3)+"*".repeat(z.length-7)+z.slice(-4)}export function maskChineseName(F){const z=String(F||"").trim();if(!z)return"";if(z.length===1)return z;if(z.length===2)return z[0]+"*";return z[0]+"*".repeat(z.length-2)+z.slice(-1)}export function unwrapEvaluateResult(F){if(F&&typeof F==="object"&&!Array.isArray(F)&&Object.prototype.hasOwnProperty.call(F,"session")&&Object.prototype.hasOwnProperty.call(F,"data"))return F.data;return F}export function requireEvaluateObject(F,z){const G=unwrapEvaluateResult(F);if(!G||typeof G!=="object"||Array.isArray(G))throw new X(`12306 ${z} returned a malformed browser payload`);return G}export function isAuthLikePayload(F){if(!F||typeof F!=="object")return!1;const z=[];if(Array.isArray(F.messages))z.push(...F.messages);if(F.message)z.push(F.message);if(F.msg)z.push(F.msg);if(F.validateMessages&&typeof F.validateMessages==="object")z.push(...Object.values(F.validateMessages).flat());const G=z.map((K)=>String(K??"")).join(" ");return/未登录|登录|请登录|身份|认证|session|Session|login/i.test(G)}export async function require12306Login(F,z){const G=unwrapEvaluateResult(await F.evaluate("document.cookie || ''")),K=typeof G==="string"?G:"";if(!/\btk=/.test(K)||!/JSESSIONID=/.test(K))throw new z("kyfw.12306.cn","Not logged into 12306. Sign in at https://kyfw.12306.cn first.")}export const __test__={parseStationBundle,resolveStation,validateDate,buildCookieHeader,parseTrainRecord,maskEmail,maskMobile,maskChineseName,unwrapEvaluateResult,requireEvaluateObject,isAuthLikePayload};
@@ -0,0 +1,127 @@
1
+ import{cli as g,Strategy as f}from"@jackwener/opencli/registry";import{assertAuthenticatedState as h,buildDetailUrl as m,buildProvenance as y,cleanText as o,extractOfferId as v,gotoAndReadState as w,uniqueMediaSources as I}from"./shared.js";function k(){return`
2
+ (() => {
3
+ const root = window.context ?? {};
4
+ const model = root.result?.global?.globalData?.model ?? null;
5
+ const gallery = root.result?.data?.gallery?.fields ?? null;
6
+ const defaultSrcProps = ['data-lazyload-src', 'data-src', 'data-ks-lazyload', 'currentSrc', 'src'];
7
+ const groups = [
8
+ { key: 'main', type: 'image', selectors: ['#dt-tab img', '.detail-gallery-turn img.detail-gallery-img', '.img-list-wrapper img.od-gallery-img', '.od-scroller-item span'] },
9
+ { key: 'video', type: 'video', selectors: ['.lib-video video', 'video[src]', 'video source[src]'] },
10
+ { key: 'sku', type: 'image', selectors: ['.pc-sku-wrapper .prop-item-inner-wrapper', '.sku-item-wrapper', '.specification-cell', '.sku-filter-button', '.expand-view-item', '.feature-item img'], srcProps: ['backgroundImage'] },
11
+ { key: 'detail', type: 'image', selectors: ['.de-description-detail img', '#detailContentContainer img', '.html-description img', '.html-description source', '.desc-lazyload-container img'] },
12
+ ];
13
+ const assets = [];
14
+ const seen = new Set();
15
+
16
+ const normalizeUrl = (value) => {
17
+ if (typeof value !== 'string') return '';
18
+ let next = value
19
+ .replace(/^url\\((.*)\\)$/i, '$1')
20
+ .replace(/^['"]|['"]$/g, '')
21
+ .replace(/\\\\u002F/g, '/')
22
+ .replace(/&amp;/g, '&')
23
+ .trim();
24
+ if (!next || next.startsWith('blob:') || next.startsWith('data:')) return '';
25
+ if (next.startsWith('//')) next = 'https:' + next;
26
+ try {
27
+ return new URL(next, location.href).toString();
28
+ } catch {
29
+ return '';
30
+ }
31
+ };
32
+
33
+ const push = (type, group, url, source) => {
34
+ const normalized = normalizeUrl(url);
35
+ if (!normalized) return;
36
+ const key = type + ':' + normalized;
37
+ if (seen.has(key)) return;
38
+ seen.add(key);
39
+ assets.push({ type, group, url: normalized, source });
40
+ };
41
+
42
+ const queryAllDeep = (selector) => {
43
+ const results = [];
44
+ const visitedRoots = new Set();
45
+ const walkRoots = (root, fn) => {
46
+ if (!root || visitedRoots.has(root)) return;
47
+ visitedRoots.add(root);
48
+ fn(root);
49
+ const childElements = root.querySelectorAll ? Array.from(root.querySelectorAll('*')) : [];
50
+ for (const child of childElements) {
51
+ if (child && child.shadowRoot) {
52
+ walkRoots(child.shadowRoot, fn);
53
+ }
54
+ }
55
+ };
56
+ walkRoots(document, (root) => {
57
+ if (root.querySelectorAll) {
58
+ results.push(...Array.from(root.querySelectorAll(selector)));
59
+ }
60
+ });
61
+ return results;
62
+ };
63
+
64
+ const valuesFromElement = (element, srcProps) => {
65
+ const values = [];
66
+ const props = srcProps && srcProps.length ? srcProps : defaultSrcProps;
67
+ for (const prop of props) {
68
+ try {
69
+ if (prop === 'backgroundImage') {
70
+ const bg = getComputedStyle(element).backgroundImage || '';
71
+ const matches = bg.match(/url\\(([^)]+)\\)/g) || [];
72
+ for (const match of matches) {
73
+ const clean = match.replace(/^url\\(/, '').replace(/\\)$/, '');
74
+ values.push(clean);
75
+ }
76
+ continue;
77
+ }
78
+
79
+ const direct = element[prop];
80
+ if (typeof direct === 'string' && direct) values.push(direct);
81
+ const attr = element.getAttribute ? element.getAttribute(prop) : '';
82
+ if (attr) values.push(attr);
83
+ } catch {}
84
+ }
85
+
86
+ if (element.tagName === 'SOURCE' && element.parentElement?.tagName === 'VIDEO') {
87
+ values.push(element.src || element.getAttribute('src') || '');
88
+ }
89
+
90
+ if (element.tagName === 'VIDEO') {
91
+ values.push(element.currentSrc || '');
92
+ values.push(element.src || '');
93
+ }
94
+
95
+ return values;
96
+ };
97
+
98
+ for (const group of groups) {
99
+ for (const selector of group.selectors) {
100
+ for (const element of queryAllDeep(selector)) {
101
+ for (const value of valuesFromElement(element, group.srcProps)) {
102
+ push(group.type, group.key, value, 'dom:' + selector);
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ const scriptTexts = Array.from(document.scripts).map((script) => script.textContent || '');
109
+ const videoRegex = /https?:\\/\\/[^"'\\s]+\\.(?:mp4|m3u8)(?:\\?[^"'\\s]*)?/gi;
110
+ for (const scriptText of scriptTexts) {
111
+ const matches = scriptText.match(videoRegex) || [];
112
+ for (const match of matches) {
113
+ push('video', 'video', match, 'script');
114
+ }
115
+ }
116
+
117
+ const toJson = (value) => JSON.parse(JSON.stringify(value ?? null));
118
+ return {
119
+ href: window.location.href,
120
+ title: document.title || '',
121
+ offerTitle: model?.offerTitleModel?.subject ?? '',
122
+ offerId: model?.tradeModel?.offerId ?? '',
123
+ gallery: toJson(gallery),
124
+ scannedAssets: assets,
125
+ };
126
+ })()
127
+ `}function p(t){const r=o(String(t.offerId??""))||v(o(t.href))||null,a=r?m(r):o(t.href),n=[...(t.gallery?.mainImage??[]).map((e)=>({type:"image",group:"main",url:e,source:"page_state:mainImage"})),...(t.gallery?.offerImgList??[]).map((e)=>({type:"image",group:"main",url:e,source:"page_state:offerImgList"})),...(t.gallery?.wlImageInfos??[]).map((e)=>({type:"image",group:"main",url:e?.fullPathImageURI??"",source:"page_state:wlImageInfos"}))],s=I([...n,...t.scannedAssets??[]]),l=s.filter((e)=>e.type==="image"&&e.group==="main").map((e)=>e.url),i=s.filter((e)=>e.type==="image"&&e.group==="sku").map((e)=>e.url),c=s.filter((e)=>e.type==="image"&&e.group==="detail").map((e)=>e.url),u=s.filter((e)=>e.type==="video").map((e)=>e.url),d=s.filter((e)=>e.type==="image"&&!["main","sku","detail"].includes(e.group)).map((e)=>e.url);return{offer_id:r,title:o(t.offerTitle)||o(t.title)||null,item_url:a,main_images:l,sku_images:i,detail_images:c,videos:u,other_images:d,raw_assets:s,source:[...new Set(s.map((e)=>o(e.source)).filter(Boolean))],main_count:l.length,sku_count:i.length,detail_count:c.length,video_count:u.length,...y(o(t.href)||a)}}async function S(t,r){const a=await w(t,r,2500,"assets");h(a,"assets");await t.autoScroll({times:3,delayMs:400});await t.wait(1);return await t.evaluate(k())}export async function extractAssetsForInput(t,r){const a=m(String(r??"")),n=await S(t,a);return p(n)}g({site:"1688",name:"assets",access:"read",description:"列出 1688 商品页可提取的图片/视频素材",domain:"www.1688.com",strategy:f.COOKIE,args:[{name:"input",required:!0,positional:!0,help:"1688 商品 URL 或 offer ID(如 887904326744)"}],columns:["offer_id","title","main_count","sku_count","detail_count","video_count"],func:async(t,r)=>{return[await extractAssetsForInput(t,String(r.input??""))]}});export const __test__={normalizeAssets:p};
@@ -0,0 +1 @@
1
+ import{AuthRequiredError as n,CommandExecutionError as u}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as s}from"../_shared/site-auth.js";async function e(o){return(await o.getCookies({url:"https://www.1688.com"})).some((t)=>t.name==="__cn_logon__"&&t.value==="true")}async function m(o){if(!await e(o))throw new n("1688.com","1688 __cn_logon__=true cookie missing — anonymous");await o.goto("https://www.1688.com/");await o.wait(2);const r=await o.getCookies({url:"https://www.1688.com"}),t=Object.fromEntries(r.map((a)=>[a.name,a.value]));if(t.__cn_logon__!=="true")throw new n("1688.com","1688 __cn_logon__ cookie absent after navigation");const c=t.unb||"";if(!c)throw new n("1688.com","1688 unb cookie missing — partial logged-in state");let i="";try{i=t.lid?decodeURIComponent(t.lid):""}catch{i=t.lid||""}return{user_id:String(c),name:i}}s({site:"1688",domain:"1688.com",loginUrl:"https://login.1688.com/member/signin.htm",columns:["user_id","name"],quickCheck:e,verify:m,poll:async(o)=>{if(!await e(o))throw new n("1688.com","Waiting for 1688 __cn_logon__=true cookie");return m(o)}});
@@ -0,0 +1 @@
1
+ import*as O from"node:path";import{formatCookieHeader as P}from"@jackwener/opencli/download";import{downloadMedia as Q}from"@jackwener/opencli/download/media-download";import{cli as R,Strategy as V}from"@jackwener/opencli/registry";import{cleanText as W}from"./shared.js";import{extractAssetsForInput as X}from"./assets.js";function J(B,q){try{const v=O.extname(new URL(B).pathname).toLowerCase();if(v&&v.length<=8)return v}catch{}return q}function L(B,q){const v=[],z=(E,G)=>{E.forEach((K,N)=>{v.push({type:"image",url:K,filename:`${B}_${G}_${String(N+1).padStart(2,"0")}${J(K,".jpg")}`})})};z(q.main_images,"main");z(q.sku_images,"sku");z(q.detail_images,"detail");z(q.other_images,"other");q.videos.forEach((E,G)=>{v.push({type:"video",url:E,filename:`${B}_video_${String(G+1).padStart(2,"0")}${J(E,".mp4")}`})});return v}R({site:"1688",name:"download",access:"read",description:"批量下载 1688 商品页可提取的图片和视频素材",domain:"www.1688.com",strategy:V.COOKIE,args:[{name:"input",required:!0,positional:!0,help:"1688 商品 URL 或 offer ID(如 887904326744)"},{name:"output",default:"./1688-downloads",help:"输出目录"}],columns:["index","type","status","size"],func:async(B,q)=>{const v=await X(B,String(q.input??"")),z=W(v.offer_id)||"1688",E=L(z,v),G=await B.getCookies({domain:"1688.com"});return Q(E,{output:String(q.output||"./1688-downloads"),subdir:z,cookies:P(G),browserCookies:G,filenamePrefix:z,timeout:60000})}});export const __test__={extFromUrl:J,toDownloadItems:L};
@@ -0,0 +1,21 @@
1
+ import{CommandExecutionError as J}from"@jackwener/opencli/errors";import{cli as E,Strategy as L}from"@jackwener/opencli/registry";import{isRecord as R}from"@jackwener/opencli/utils";import{assertAuthenticatedState as z,buildDetailUrl as x,buildProvenance as $,canonicalizeSellerUrl as B,cleanMultilineText as k,cleanText as o,extractLocation as H,extractMemberId as j,extractOfferId as _,extractShopId as C,gotoAndReadState as K,normalizePriceTiers as V,parseMoqText as W,parsePriceText as Q,toNumber as F,uniqueNonEmpty as b}from"./shared.js";function h(e){const t=o(e.href),r=k(e.bodyText),n=o(e.seller?.companyName),i=o(e.seller?.winportUrl??e.seller?.sellerWinportUrlMap?.defaultUrl??e.seller?.sellerWinportUrlMap?.indexUrl),s=B(i),l=o(String(e.offerId??""))||_(t)||null,w=o(e.seller?.memberId)||j(i||t)||null,q=C(s??t),u=o(e.trade?.unit),f=o(e.trade?.priceDisplay),m=Q(f?`¥${f}`:r),U=y(r,e.trade?.beginAmount,u),d=W(U),p=G(e),D=b(p.map((c)=>o(c.serviceName))),A=v(e.trade?.offerIDatacenterSellInfo),P=V(e.trade?.offerPriceModel?.currentPrices??[],u||null),N=b([...e.gallery?.mainImage??[],...e.gallery?.offerImgList??[],...(e.gallery?.wlImageInfos??[]).map((c)=>c.fullPathImageURI??"")]),g=l?x(l):t,O=$(t||g);return{offer_id:l,member_id:w,shop_id:q,title:o(e.offerTitle)||I(e.title)||X(r)||null,item_url:g,main_images:N,price_text:m.price_text||null,price_tiers:P,currency:m.currency,moq_text:d.moq_text||null,moq_value:d.moq_value,seller_name:n||null,seller_url:s,shop_name:n||null,origin_place:H(r),delivery_days_text:S(r,p,e.shipping),customization_text:a(r,["来样定制","来图定制","支持定制","可定制","定制"]),private_label_text:a(r,["贴牌","贴标","定制logo","打logo","OEM","ODM"]),visible_attributes:A,sales_text:T(r),service_badges:D,stock_quantity:M(r),...O}}function v(e){if(!R(e))return[];return Object.entries(e).filter(([t,r])=>t!=="sellPointModel"&&o(t)&&o(String(r))).map(([t,r])=>({key:o(t),value:o(String(r))}))}function G(e){const t=[...Array.isArray(e.services)?e.services:[],...Array.isArray(e.shipping?.protectionInfos)?e.shipping.protectionInfos:[],...Array.isArray(e.shipping?.buyerProtectionModel)?e.shipping.buyerProtectionModel:[]],r=new Set,n=[];for(const i of t){const s=o(i.serviceName);if(!s||r.has(s))continue;r.add(s);n.push(i)}return n}function I(e){return o(e).replace(/\s*-\s*阿里巴巴$/,"").trim()}function X(e){return e.split(`
2
+ `).map((t)=>o(t)).find(Boolean)??""}function y(e,t,r){const n=e.match(/\d+(?:\.\d+)?\s*(件|个|套|箱|包|双|台|把|只)\s*起批/);if(n)return n[0];const i=F(t);if(i!==null)return`${i}${r||""}起批`;return""}function S(e,t,r){const n=o(r?.deliveryLimitText)||o(r?.logisticsText);if(n)return n;const i=e.match(/\d+\s*(?:小时|天)(?:内)?发货/);if(i)return i[0];const s=t.find((l)=>typeof l.agreeDeliveryHours==="number");if(s&&typeof s.agreeDeliveryHours==="number")return`${s.agreeDeliveryHours}小时内发货`;return null}function a(e,t){const r=e.split(`
3
+ `).map((n)=>o(n)).filter(Boolean);for(const n of r)if(t.some((i)=>n.includes(i)))return n;return null}function T(e){const t=e.match(/(?:全网销量|已售)\s*\d+(?:\.\d+)?\+?\s*[件套个单]?/);return t?o(t[0]):null}function M(e){const t=e.match(/库存\s*(\d+)/);return t?Number.parseInt(t[1],10):null}async function Y(e,t){const r=await K(e,t,2500,"item");z(r,"item");const n=await e.evaluate(`
4
+ (() => {
5
+ const root = window.context ?? {};
6
+ const model = root.result?.global?.globalData?.model ?? null;
7
+ const toJson = (value) => JSON.parse(JSON.stringify(value ?? null));
8
+ return {
9
+ href: window.location.href,
10
+ title: document.title || '',
11
+ bodyText: document.body ? document.body.innerText || '' : '',
12
+ offerTitle: model?.offerTitleModel?.subject ?? '',
13
+ offerId: model?.tradeModel?.offerId ?? '',
14
+ seller: toJson(model?.sellerModel),
15
+ trade: toJson(model?.tradeModel),
16
+ gallery: toJson(root.result?.data?.gallery?.fields ?? null),
17
+ shipping: toJson(root.result?.data?.shippingServices?.fields ?? null),
18
+ services: toJson(root.result?.data?.shippingServices?.fields?.protectionInfos ?? []),
19
+ };
20
+ })()
21
+ `);if(!(o(String(n.offerId??""))||_(o(n.href))))throw new J("1688 item page did not expose product context","当前 tab 非商品详情上下文,请切到 detail.1688.com 商品页并重试");return n}E({site:"1688",name:"item",access:"read",description:"1688 商品详情(公开商品字段、价格阶梯、卖家基础信息)",domain:"www.1688.com",strategy:L.COOKIE,navigateBefore:!1,args:[{name:"input",required:!0,positional:!0,help:"1688 商品 URL 或 offer ID(如 887904326744)"}],columns:["offer_id","title","price_text","moq_text","seller_name","origin_place"],func:async(e,t)=>{const r=x(String(t.input??"")),n=await Y(e,r);return[h(n)]}});export const __test__={normalizeItemPayload:h,normalizeVisibleAttributes:v,stripAlibabaSuffix:I,extractMoqText:y,extractDeliveryDaysText:S,extractKeywordLine:a,extractSalesText:T,extractStockQuantity:M};
@@ -0,0 +1,129 @@
1
+ import{CommandExecutionError as g,EmptyResultError as q}from"@jackwener/opencli/errors";import{cli as b,Strategy as z}from"@jackwener/opencli/registry";import{FACTORY_BADGE_PATTERNS as C,SERVICE_BADGE_PATTERNS as E,assertAuthenticatedState as I,buildProvenance as R,buildSearchUrl as U,canonicalizeItemUrl as P,canonicalizeSellerUrl as $,cleanText as c,extractBadges as B,extractLocation as M,extractMemberId as N,extractOfferId as k,extractShopId as H,gotoAndReadState as L,parseMoqText as O,parsePriceText as D,SEARCH_LIMIT_DEFAULT as T,SEARCH_LIMIT_MAX as K,parseSearchLimit as j,uniqueNonEmpty as y}from"./shared.js";const G=["detail.1688.com/offer/","detail.m.1688.com/page/index.html?offerId="],F=12;function v(e,t){const n=P(c(e.item_url)),r=c(e.container_text),d=p([i(e.price_text),i(W(e.hover_price_text))]),o=D(d||r),f=O(p([i(e.moq_text),i(w(r))])),s=$(c(e.seller_url)),a=y([r,...e.desc_rows??[],...e.tag_items??[],...e.hover_items??[]]).join(`
2
+ `),m=B(a,[...C,...E]),u=p([_(e.sales_text),_(r)]),h=X([...e.tag_items??[],...e.hover_items??[]]),l=R(t);return{rank:0,offer_id:k(n??"")??null,member_id:N(s??"")??null,shop_id:H(s??"")??null,title:c(e.title)||S(r)||null,item_url:n,seller_name:c(e.seller_name)||null,seller_url:s,price_text:o.price_text||null,price_min:o.price_min,price_max:o.price_max,currency:o.currency,moq_text:f.moq_text||null,moq_value:f.moq_value,location:M(r),badges:m,sales_text:u||null,return_rate_text:h,source_url:l.source_url,fetched_at:l.fetched_at,strategy:l.strategy}}function w(e){const t=i(e);return t.match(/\d+(?:\.\d+)?\s*(件|个|套|箱|包|双|台|把|只)\s*起批/i)?.[0]??t.match(/≥\s*\d+(?:\.\d+)?\s*(件|个|套|箱|包|双|台|把|只)?/i)?.[0]??t.match(/\d+(?:\.\d+)?\s*(?:~|-|至|到)\s*\d+(?:\.\d+)?\s*(件|个|套|箱|包|双|台|把|只)/i)?.[0]??""}function W(e){return i(e).match(/[¥$€]\s*\d+(?:\.\d+)?/)?.[0]??""}function _(e){const t=i(e);if(!t)return"";if(/^\d+(?:\.\d+)?\+?\s*(件|套|个|单)$/.test(t))return t;const n=t.match(/(?:已售|销量|售)\s*\d+(?:\.\d+)?\+?\s*(件|套|个|单)?/);return n?c(n[0]):""}function S(e){return e.split(/\s+/).find(Boolean)??""}function p(e){return e.map((t)=>c(t)).find(Boolean)??""}function i(e){return c(e).replace(/([¥$€])\s+(?=\d)/g,"$1").replace(/(\d)\s*\.\s*(\d)/g,"$1.$2").replace(/\s*([~-])\s*/g,"$1").trim()}function X(e){return y(e.map((t)=>i(t))).find((t)=>/^回头率\s*\d+(?:\.\d+)?%$/.test(t))??null}function A(e){if(e.offer_id)return`offer:${e.offer_id}`;if(e.item_url)return`url:${e.item_url}`;return null}async function J(e,t){const n=await L(e,t,2500,"search");I(n,"search");const r=await e.evaluate(`
3
+ (() => {
4
+ const normalizeText = (value) => (value || '').replace(/\\s+/g, ' ').trim();
5
+ const normalizeUrl = (href) => {
6
+ if (!href) return '';
7
+ try {
8
+ return new URL(href, window.location.href).toString();
9
+ } catch {
10
+ return '';
11
+ }
12
+ };
13
+ const isItemHref = (href) => ${JSON.stringify(G)}
14
+ .some((pattern) => (href || '').includes(pattern));
15
+ const uniqueTexts = (values) => [...new Set(values.map((value) => normalizeText(value)).filter(Boolean))];
16
+ const collectTexts = (root, selector) => uniqueTexts(
17
+ Array.from(root.querySelectorAll(selector)).map((node) => node.innerText || node.textContent || ''),
18
+ );
19
+ const firstText = (root, selectors) => {
20
+ for (const selector of selectors) {
21
+ const node = root.querySelector(selector);
22
+ const value = normalizeText(node ? node.innerText || node.textContent || '' : '');
23
+ if (value) return value;
24
+ }
25
+ return '';
26
+ };
27
+ const findMoqText = (values, priceText) => {
28
+ const moqPattern = /(≥\\s*\\d+(?:\\.\\d+)?\\s*(件|个|套|箱|包|双|台|把|只)?)|(\\d+(?:\\.\\d+)?\\s*(?:~|-|至|到)\\s*\\d+(?:\\.\\d+)?\\s*(件|个|套|箱|包|双|台|把|只))|(\\d+(?:\\.\\d+)?\\s*(件|个|套|箱|包|双|台|把|只)\\s*起批)/i;
29
+ return values.find((value) => moqPattern.test(value))
30
+ || normalizeText(priceText).match(moqPattern)?.[0]
31
+ || '';
32
+ };
33
+ const isSellerHref = (href) => {
34
+ if (!href) return false;
35
+ try {
36
+ const url = new URL(href, window.location.href);
37
+ const host = url.hostname || '';
38
+ if (!host.endsWith('.1688.com')) return false;
39
+ if (
40
+ host === 's.1688.com'
41
+ || host === 'r.1688.com'
42
+ || host === 'air.1688.com'
43
+ || host === 'detail.1688.com'
44
+ || host === 'detail.m.1688.com'
45
+ || host === 'dj.1688.com'
46
+ ) {
47
+ return false;
48
+ }
49
+ return true;
50
+ } catch {
51
+ return false;
52
+ }
53
+ };
54
+ const pickContainer = (anchor) => {
55
+ let node = anchor;
56
+ while (node && node !== document.body) {
57
+ const text = normalizeText(node.innerText || node.textContent || '');
58
+ if (text.length >= 40 && text.length <= 2000) {
59
+ return node;
60
+ }
61
+ node = node.parentElement;
62
+ }
63
+ return anchor;
64
+ };
65
+ const collectCandidates = () => {
66
+ const anchors = Array.from(document.querySelectorAll('a')).filter((anchor) => isItemHref(anchor.href || ''));
67
+ const seen = new Set();
68
+ const items = [];
69
+ for (const anchor of anchors) {
70
+ const href = anchor.href || '';
71
+ if (!href || seen.has(href)) continue;
72
+ seen.add(href);
73
+
74
+ const container = pickContainer(anchor);
75
+ const tagItems = collectTexts(container, '.offer-tag-row .offer-desc-item');
76
+ const hoverItems = collectTexts(container, '.offer-hover-wrapper .offer-desc-item');
77
+ const sellerAnchor = Array.from(container.querySelectorAll('a'))
78
+ .find((link) => isSellerHref(link.href || ''));
79
+ const hoverPriceText = firstText(container, [
80
+ '.offer-hover-wrapper .hover-price-item',
81
+ '.offer-hover-wrapper .price-item',
82
+ ]);
83
+
84
+ items.push({
85
+ item_url: href,
86
+ title: firstText(container, ['.offer-title-row .title-text', '.offer-title-row'])
87
+ || normalizeText(anchor.innerText || anchor.textContent || ''),
88
+ container_text: normalizeText(container.innerText || container.textContent || ''),
89
+ desc_rows: collectTexts(container, '.offer-desc-row'),
90
+ price_text: firstText(container, ['.offer-price-row .price-item']),
91
+ sales_text: firstText(container, ['.offer-price-row .col-desc_after', '.offer-desc-row .col-desc_after']),
92
+ hover_price_text: hoverPriceText,
93
+ moq_text: findMoqText(hoverItems, hoverPriceText),
94
+ tag_items: tagItems,
95
+ hover_items: hoverItems,
96
+ seller_name: sellerAnchor ? normalizeText(sellerAnchor.innerText || sellerAnchor.textContent || '') : null,
97
+ seller_url: sellerAnchor ? sellerAnchor.href : null,
98
+ });
99
+ }
100
+ return items;
101
+ };
102
+ const findNextUrl = () => {
103
+ const selectors = [
104
+ 'a.fui-next:not(.disabled)',
105
+ 'a.next-pagination-item:not(.disabled)',
106
+ 'a[rel="next"]:not(.disabled)',
107
+ 'a[data-role="next"]:not(.disabled)',
108
+ ];
109
+ for (const selector of selectors) {
110
+ const node = document.querySelector(selector);
111
+ if (!node) continue;
112
+ const href = normalizeUrl(node.getAttribute('href') || node.href || '');
113
+ if (href) return href;
114
+ }
115
+ const textBased = Array.from(document.querySelectorAll('a'))
116
+ .find((node) => /下一页|next/i.test(normalizeText(node.textContent || '')));
117
+ if (!textBased) return '';
118
+ return normalizeUrl(textBased.getAttribute('href') || textBased.href || '');
119
+ };
120
+
121
+ return {
122
+ href: window.location.href,
123
+ title: document.title || '',
124
+ bodyText: document.body ? document.body.innerText || '' : '',
125
+ next_url: findNextUrl(),
126
+ candidates: collectCandidates(),
127
+ };
128
+ })()
129
+ `);if(!r||typeof r!=="object")throw new g("1688 search page did not return a readable payload","Open the same query in Chrome and verify the page is fully loaded before retrying.");return r}async function Q(e,t,n){const r=new Map,d=new Set;let o=U(t),f=0;while(o&&r.size<n&&f<F){if(d.has(o))break;d.add(o);f+=1;const s=await J(e,o),a=c(s.href)||o,m=Array.isArray(s.candidates)?s.candidates:[];for(const h of m){const l=v(h,a),x=A(l);if(!x||r.has(x))continue;r.set(x,l);if(r.size>=n)break}const u=c(s.next_url);if(!u||u===a)break;o=u}if(r.size===0)throw new q("1688 search","No visible results were extracted. Retry with a different query or open the same search page in Chrome first.");return[...r.values()].slice(0,n).map((s,a)=>({...s,rank:a+1}))}b({site:"1688",name:"search",access:"read",description:"1688 商品搜索(结果候选、卖家链接、价格/MOQ/销量文本)",domain:"www.1688.com",strategy:z.COOKIE,navigateBefore:!1,args:[{name:"query",required:!0,positional:!0,help:'搜索关键词,如 "置物架"'},{name:"limit",type:"int",default:T,help:`结果数量上限(默认 ${T},最大 ${K})`}],columns:["rank","offer_id","title","item_url","price_text","moq_text","seller_name","member_id","location"],func:async(e,t)=>{const n=String(t.query??""),r=j(t.limit);return Q(e,n,r)}});export const __test__={normalizeSearchCandidate:v,extractMoqText:w,extractSalesText:_,firstWord:S,buildDedupeKey:A};
@@ -0,0 +1,11 @@
1
+ import{ArgumentError as c,AuthRequiredError as x,CommandExecutionError as _}from"@jackwener/opencli/errors";export const SITE="1688",HOME_URL="https://www.1688.com/",SEARCH_URL_PREFIX="https://s.1688.com/selloffer/offer_search.htm?charset=utf8&keywords=",DETAIL_URL_PREFIX="https://detail.1688.com/offer/",STORE_MOBILE_URL_PREFIX="https://winport.m.1688.com/page/index.html?memberId=",STRATEGY="cookie",SEARCH_LIMIT_DEFAULT=20,SEARCH_LIMIT_MAX=100;const w=new Set(["www","detail","s","winport","work","air","dj"]),g=new Set(["spm","tracelog","clickid","source","scene","from","src","ns","cna","pvid"]),b="/_____tmd_____/punish",E=["请拖动下方滑块完成验证","请按住滑块,拖动到最右边","通过验证以确保正常访问","验证码拦截","访问验证","滑动验证"],R=["请登录","登录后","账号登录","手机登录","立即登录","扫码登录","请先完成登录","请先登录后查看"],T=["/member/login","passport","login.taobao.com","account.1688.com"];export const FACTORY_BADGE_PATTERNS=["源头工厂","深度验厂","实力工厂","工厂档案","加工专区","验厂报告","厂家直销","生产厂家","工厂直供"],SERVICE_BADGE_PATTERNS=["延期必赔","品质保障","破损包赔","退货包运费","晚发必赔","7*24小时响应","48小时发货","72小时发货","后天达","包邮","闪电拿样"];const u=["北京","天津","上海","重庆","河北","山西","辽宁","吉林","黑龙江","江苏","浙江","安徽","福建","江西","山东","河南","湖北","湖南","广东","海南","四川","贵州","云南","陕西","甘肃","青海","台湾","内蒙古","广西","西藏","宁夏","新疆","香港","澳门"];export function cleanText(e){return typeof e==="string"?e.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():""}export function cleanMultilineText(e){return typeof e==="string"?e.replace(/\u00a0/g," ").split(`
2
+ `).map((t)=>t.replace(/\s+/g," ").trim()).filter(Boolean).join(`
3
+ `):""}export function uniqueNonEmpty(e){return[...new Set(e.map((t)=>cleanText(t)).filter(Boolean))]}export function parseSearchLimit(e){const t=Number.parseInt(String(e??SEARCH_LIMIT_DEFAULT),10);if(!Number.isFinite(t)||t<1)throw new c("1688 search --limit must be a positive integer",'Example: opencli 1688 search "桌面置物架" --limit 20');return Math.min(SEARCH_LIMIT_MAX,t)}export function buildSearchUrl(e){const t=cleanText(e);if(!t)throw new c("1688 search query cannot be empty",'Example: opencli 1688 search "桌面置物架" --limit 20');return`${SEARCH_URL_PREFIX}${encodeURIComponent(t)}`}export function buildDetailUrl(e){const t=extractOfferId(e);if(!t)throw new c("1688 item expects an offer URL or offer ID","Example: opencli 1688 item 887904326744");return`${DETAIL_URL_PREFIX}${t}.html`}export function resolveStoreUrl(e){const t=cleanText(e);if(!t)throw new c("1688 store expects a store URL or member ID","Example: opencli 1688 store https://yinuoweierfushi.1688.com/");const r=extractMemberId(t);if(r)return`${STORE_MOBILE_URL_PREFIX}${r}`;if(/^https?:\/\//i.test(t))return canonicalizeStoreUrl(t);if(t.endsWith(".1688.com"))return canonicalizeStoreUrl(`https://${t}`);if(/^[a-z0-9-]+$/i.test(t))return canonicalizeStoreUrl(`https://${t}.1688.com`);throw new c("1688 store expects a store URL or member ID","Example: opencli 1688 store b2b-22154705262941f196")}export function canonicalizeStoreUrl(e){const t=m(e),r=extractMemberId(t.toString());if(r)return`${STORE_MOBILE_URL_PREFIX}${r}`;const n=a(t.hostname);if(!n)throw new c("Invalid 1688 store URL","Example: opencli 1688 store https://yinuoweierfushi.1688.com/");return`https://${n}`}export function canonicalizeItemUrl(e){const t=extractOfferId(e);if(t)return`${DETAIL_URL_PREFIX}${t}.html`;const r=f(e);if(!r)return null;h(r);r.hash="";return r.toString()}export function canonicalizeSellerUrl(e){const t=extractMemberId(e);if(t)return`${STORE_MOBILE_URL_PREFIX}${t}`;const r=f(e);if(!r)return null;const n=a(r.hostname);if(!n)return null;return`https://${n}`}export function extractOfferId(e){const t=cleanText(e);if(!t)return null;const r=t.match(/^\d{6,}$/)?.[0];if(r)return r;const n=t.match(/\/offer\/(\d{6,})\.html/i);if(n)return n[1];const o=t.match(/[?&]offerId=(\d{6,})/i);if(o)return o[1];return null}export function extractMemberId(e){const t=cleanText(e);if(!t)return null;const r=t.match(/\bb2b-[a-z0-9]+\b/i)?.[0];if(r)return r;const n=t.match(/[?&]memberId=(b2b-[a-z0-9]+)/i);if(n)return n[1];const o=t.match(/\/winport\/(b2b-[a-z0-9]+)\.html/i);if(o)return o[1];return null}export function extractShopId(e){const t=cleanText(e);if(!t)return null;try{const r=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`),n=a(r.hostname);if(!n)return null;return n.split(".")[0]??null}catch{return/^[a-z0-9-]+$/i.test(t)?t:null}}export function buildProvenance(e){return{source_url:e,fetched_at:new Date().toISOString(),strategy:STRATEGY}}export function parsePriceText(e){const t=l(cleanText(e)),n=(t.match(/\d+(?:,\d{3})*(?:\.\d+)?/g)??[]).map((o)=>Number.parseFloat(o.replace(/,/g,""))).filter((o)=>Number.isFinite(o));if(n.length===0)return{price_text:t,price_min:null,price_max:null,currency:null};return{price_text:t,price_min:n[0]??null,price_max:n[n.length-1]??n[0]??null,currency:t.includes("¥")||t.includes("元")?"CNY":null}}export function normalizePriceTiers(e,t){return e.map((r)=>{const n=toNumber(r.beginAmount),o=cleanText(r.price),i=toNumber(r.price);return{quantity_text:n!==null?`${n}${t??""}`:"",quantity_min:n,price_text:o,price:i,currency:o?"CNY":null}}).filter((r)=>r.price_text)}export function parseMoqText(e){const t=l(cleanText(e)),r=t.match(/(\d+(?:\.\d+)?)\s*(件|个|套|箱|包|双|台|把|只|pcs|piece|pieces)?\s*起批/i)??t.match(/≥\s*(\d+(?:\.\d+)?)/),n=t.match(/(\d+(?:\.\d+)?)\s*(?:~|-|至|到)\s*\d+(?:\.\d+)?\s*(件|个|套|箱|包|双|台|把|只|pcs|piece|pieces)/i);if(!r&&!n)return{moq_text:t,moq_value:null};return{moq_text:t,moq_value:Number.parseFloat((r??n)[1])}}export function extractLocation(e){const t=cleanMultilineText(e),r=t.split(/送至|发往/)[0]??t,n=r.split(`
4
+ `);for(const i of n){const s=cleanText(i);if(!s||s.length>16)continue;if(u.some((d)=>s.startsWith(d)))return s}const o=new RegExp(`(${u.join("|")})[\\u4e00-\\u9fa5]{0,8}`);return r.match(o)?.[0]??null}export function extractAddress(e){const t=cleanMultilineText(e),r=t.match(/地址[::]\s*([^\n]+)/);if(r)return cleanText(r[1]);return t.split(`
5
+ `).map((n)=>cleanText(n)).find((n)=>n.includes("省")||n.includes("市")||n.includes("区")||n.includes("县"))??null}export function extractMetric(e,t){const r=cleanMultilineText(e),n=r.match(new RegExp(`(?:^|\\n)\\s*${p(t)}[::]?\\s*([^\\n]+)`));if(n)return cleanText(n[1]);const o=r.match(new RegExp(`(?:^|\\n)\\s*${p(t)}\\n([^\\n]+)`));return o?cleanText(o[1]):null}export function extractYearsOnPlatform(e){return e.match(/入驻\d+年/)?.[0]??null}export function extractMainBusiness(e){const t=extractMetric(e,"主营");return t?t.replace(/^:/,"").trim():null}export function extractBadges(e,t){return uniqueNonEmpty(t.filter((r)=>cleanMultilineText(e).includes(r)))}export function guessTopCategories(e){const t=extractMainBusiness(e);if(!t)return[];return uniqueNonEmpty(t.split(/[、,/|]/).map((r)=>r.trim()))}export function isCaptchaState(e){const t=cleanText(e.href).toLowerCase(),r=cleanText(e.title),n=cleanMultilineText(e.body_text);if(t.includes(b))return!0;return E.some((o)=>r.includes(o)||n.includes(o))}export function isLoginState(e){const t=cleanText(e.href).toLowerCase(),r=cleanText(e.title),n=cleanMultilineText(e.body_text);if(T.some((o)=>t.includes(o)))return!0;return R.some((o)=>r.includes(o)||n.includes(o))}export function buildCaptchaHint(e){return[`Open a clean 1688 ${e} page in the shared Chrome profile and finish any slider challenge first.`,"If you run opencli via CDP, set OPENCLI_CDP_TARGET=1688.com or a more specific 1688 host before retrying."].join(" ")}export async function readPageState(e){const t=await e.evaluate(`
6
+ (() => ({
7
+ href: window.location.href,
8
+ title: document.title || '',
9
+ body_text: document.body ? document.body.innerText || '' : '',
10
+ }))()
11
+ `);return{href:cleanText(t.href),title:cleanText(t.title),body_text:cleanMultilineText(t.body_text)}}export async function gotoAndReadState(e,t,r=2500,n="page"){try{await e.goto(t,{settleMs:r});await e.wait(1.5);return readPageState(e)}catch(o){const i=o instanceof Error?o.message:String(o);if(i.includes("Inspected target navigated or closed")||i.includes("Cannot find context with specified id")||i.includes("Target closed"))throw new _(`1688 ${n} navigation lost the current browser target`,`${buildCaptchaHint(n)} If CDP is attached to a stale or blocked tab, open a fresh 1688 tab and point OPENCLI_CDP_TARGET at that tab.`);throw o}}export async function ensure1688Session(e){const t=await gotoAndReadState(e,HOME_URL,1500,"homepage");assertAuthenticatedState(t,"homepage")}export function assertAuthenticatedState(e,t){if(!isCaptchaState(e)&&!isLoginState(e))return;throw new x("1688.com",`请先在共享 Chrome 完成 1688 登录/验证,再重试(${t})`)}export function assertNotCaptcha(e,t){assertAuthenticatedState(e,t)}export function toNumber(e){if(typeof e==="number"&&Number.isFinite(e))return e;if(typeof e==="string"){const t=e.replace(/,/g,"").trim();if(!t)return null;const r=Number.parseFloat(t);return Number.isFinite(r)?r:null}return null}export function limitCandidates(e,t){const r=Math.max(1,Math.trunc(t)||1);return e.slice(0,r)}export function normalizeMediaUrl(e){const t=cleanText(e);if(!t)return"";let r=t.replace(/^url\((.*)\)$/i,"$1").replace(/^['"]|['"]$/g,"").replace(/\\u002F/g,"/").replace(/&amp;/g,"&").trim();if(!r||r.startsWith("data:")||r.startsWith("blob:"))return"";if(r.startsWith("//"))r=`https:${r}`;try{return new URL(r).toString()}catch{return""}}export function uniqueMediaSources(e){const t=new Set,r=[];for(const n of e){const o=normalizeMediaUrl(n.url);if(!o)continue;const i=`${n.type}:${o}`;if(t.has(i))continue;t.add(i);r.push({...n,url:o,source:cleanText(n.source)||void 0})}return r}function l(e){return e.replace(/([¥$€])\s+(?=\d)/g,"$1").replace(/(\d)\s*\.\s*(\d)/g,"$1.$2").replace(/\s*([~-])\s*/g,"$1").trim()}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){const t=cleanText(e);try{const r=new URL(t);if(!r.hostname.endsWith(".1688.com")&&r.hostname!=="1688.com"&&r.hostname!=="www.1688.com")throw Error("invalid-host");h(r);r.hash="";return r}catch{throw new c("Invalid 1688 URL","Use a URL under 1688.com (for example: https://detail.1688.com/offer/887904326744.html)")}}function f(e){try{return m(e)}catch{return null}}function a(e){const t=cleanText(e).toLowerCase();if(!t.endsWith(".1688.com"))return null;const[r]=t.split(".");if(!r||w.has(r))return null;return t}function h(e){const t=[...e.searchParams.keys()];for(const r of t)if(g.has(r)||r.toLowerCase().startsWith("utm_"))e.searchParams.delete(r)}export const __test__={SEARCH_LIMIT_DEFAULT,SEARCH_LIMIT_MAX,parseSearchLimit,buildSearchUrl,buildDetailUrl,resolveStoreUrl,canonicalizeStoreUrl,canonicalizeItemUrl,canonicalizeSellerUrl,extractOfferId,extractMemberId,extractShopId,parsePriceText,normalizePriceTiers,parseMoqText,extractLocation,extractAddress,extractMetric,extractYearsOnPlatform,extractMainBusiness,extractBadges,guessTopCategories,isCaptchaState,isLoginState,cleanText,cleanMultilineText,uniqueNonEmpty,normalizeMediaUrl,uniqueMediaSources,limitCandidates};
@@ -0,0 +1,26 @@
1
+ import{CommandExecutionError as w,EmptyResultError as z}from"@jackwener/opencli/errors";import{cli as D,Strategy as J}from"@jackwener/opencli/registry";import{FACTORY_BADGE_PATTERNS as q,SERVICE_BADGE_PATTERNS as $,assertAuthenticatedState as U,buildDetailUrl as G,buildProvenance as W,canonicalizeSellerUrl as Y,canonicalizeStoreUrl as j,cleanMultilineText as y,cleanText as n,extractAddress as S,extractBadges as v,extractMemberId as h,extractMetric as x,extractOfferId as T,extractShopId as g,extractYearsOnPlatform as F,gotoAndReadState as I,guessTopCategories as K,resolveStoreUrl as V,uniqueNonEmpty as H}from"./shared.js";function P(e){const{storePayload:t,contactPayload:r,seed:o}=e,a=y(r?.bodyText),s=y(t?.bodyText),f=y(o?.bodyText),l=[a,s,f].filter(Boolean).join(`
2
+ `),i=n(o?.seller?.winportUrl??o?.seller?.sellerWinportUrlMap?.defaultUrl??t?.href??e.resolvedUrl),c=A(i||e.resolvedUrl)??e.resolvedUrl,u=Y(i)??c,B=Q(r?.href,c),M=n(o?.seller?.memberId)||e.explicitMemberId||h(e.resolvedUrl)||h(t?.href??"")||null,N=g(u)??g(c),_=n(o?.seller?.companyName)||b(a)||b(s)||null,O=H([...v(l,$),...(o?.services??[]).map((L)=>n(L.serviceName))]),k=v(l,q);return{member_id:M,shop_id:N,store_name:_,store_url:c,company_name:_,company_url:B,business_model_text:m(l,["经营模式","生产加工","主营产品"]),years_on_platform_text:F(l),location:S(a)??S(s),staff_size_text:m(l,["员工人数","员工总数"]),factory_badges:k,service_badges:O,response_rate_text:m(l,["响应率","回复率","响应速度"]),return_rate_text:E(l),top_categories:K(l),phone_text:x(a,"电话"),mobile_text:x(a,"手机"),...W(n(r?.href)||n(t?.href)||e.resolvedUrl)}}function A(e){try{return j(e)}catch{return null}}function Q(e,t){const r=n(e);if(r){const o=d(r);if(o)return o}return d(t)}function d(e){try{const t=new URL(e);if(!t.hostname.endsWith(".1688.com"))return null;return`${t.protocol}//${t.hostname}/page/contactinfo.html`}catch{return null}}function b(e){return e.split(`
3
+ `).map((t)=>n(t)).find((t)=>t.includes("有限公司")||t.includes("商行")||t.includes("工厂"))??null}function m(e,t){for(const r of t){const o=x(e,r);if(o)return o}return null}function E(e){const t=e.match(/回头率\s*([0-9.]+%)/);if(t)return n(t[0]);const r=e.match(/回头率\s*\n\s*([0-9.]+%)/);if(!r)return null;return`回头率${n(r[1])}`}function p(e){for(const t of e){const r=T(t);if(r)return r}return null}function C(e){for(const t of e){const r=d(t);if(r)return r}return null}async function R(e,t,r){const o=await I(e,t,2500,r);U(o,r);return await e.evaluate(`
4
+ (() => ({
5
+ href: window.location.href,
6
+ title: document.title || '',
7
+ bodyText: document.body ? document.body.innerText || '' : '',
8
+ offerLinks: Array.from(document.querySelectorAll('a[href*="detail.1688.com/offer/"], a[href*="offerId="]'))
9
+ .map((anchor) => anchor.href)
10
+ .filter(Boolean),
11
+ contactLinks: Array.from(document.querySelectorAll('a[href*="contactinfo"]'))
12
+ .map((anchor) => anchor.href)
13
+ .filter(Boolean),
14
+ }))()
15
+ `)}async function X(e,t){const r=G(t),o=await I(e,r,2500,"store seed item");U(o,"store seed item");const a=await e.evaluate(`
16
+ (() => {
17
+ const model = window.context?.result?.global?.globalData?.model ?? null;
18
+ const toJson = (value) => JSON.parse(JSON.stringify(value ?? null));
19
+ return {
20
+ href: window.location.href,
21
+ bodyText: document.body ? document.body.innerText || '' : '',
22
+ seller: toJson(model?.sellerModel),
23
+ services: toJson(model?.shippingServices?.fields?.buyerProtectionModel ?? []),
24
+ };
25
+ })()
26
+ `);if(!(!!n(a?.seller?.memberId)||!!n(a?.seller?.winportUrl)))throw new w("1688 store seed item did not expose seller context","当前 tab 非商品详情上下文,请切到 detail.1688.com 商品页并重试");return a}function Z(e,t,r){return!!n(e?.bodyText)||!!n(t?.bodyText)||!!n(r?.bodyText)}D({site:"1688",name:"store",access:"read",description:"1688 店铺/供应商公开信息(联系方式、主营、入驻年限、公开服务信号)",domain:"www.1688.com",strategy:J.COOKIE,navigateBefore:!1,args:[{name:"input",required:!0,positional:!0,help:"1688 店铺 URL 或 member ID(如 b2b-22154705262941f196)"}],columns:["store_name","years_on_platform_text","location","return_rate_text"],func:async(e,t)=>{const r=String(t.input??""),o=V(r),a=h(r),s=await R(e,o,"store"),f=C(s.contactLinks??[])||d(s.href||o),l=f?await R(e,f,"store contact"):null,i=T(r)||p(s.offerLinks??[])||p(l?.offerLinks??[]);let c=null;if(i)try{c=await X(e,i)}catch(u){if(!(u instanceof w))throw u}if(!Z(s,l,c))throw new z("1688 store","Store page is reachable but no visible fields were extracted. Open the store page in Chrome and retry.");return[P({resolvedUrl:o,storePayload:s,contactPayload:l,seed:c,explicitMemberId:a})]}});export const __test__={normalizeStorePayload:P,safeCanonicalStoreUrl:A,buildContactUrl:d,firstNamedLine:b,firstMetric:m,extractReturnRate:E,firstOfferId:p,firstContactUrl:C};
@@ -0,0 +1,18 @@
1
+ import{AuthRequiredError as i,CommandExecutionError as s}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as u}from"../_shared/site-auth.js";async function o(t){const e=await t.getCookies({url:"https://www.1point3acres.com"}),a=await t.getCookies({url:"https://.1point3acres.com"});return[...e,...a].some((n)=>/_auth$/.test(n.name)&&n.value)}async function r(t){if(!await o(t))throw new i("1point3acres.com","1point3acres Discuz *_auth cookie missing");await t.goto("https://www.1point3acres.com/bbs/");await t.wait(2);const e=await t.evaluate(`
2
+ (() => {
3
+ if (/auth\\.1point3acres\\.com\\/login/.test(location.href)) {
4
+ return { kind: 'auth', detail: '1point3acres bbs redirected to auth login' };
5
+ }
6
+ const loginLink = document.querySelector('a[href*="auth.1point3acres.com/login"], a[href*="member.php?mod=logging&action=login"]');
7
+ if (loginLink && /登录/.test(loginLink.innerText || '')) {
8
+ return { kind: 'auth', detail: '1point3acres bbs shows 登录 link — anonymous' };
9
+ }
10
+ const nameEl = document.querySelector('#um .vwmy h4 a, a.username, .vwmy a');
11
+ const username = (nameEl?.innerText || '').trim();
12
+ const uid = (nameEl?.getAttribute('href') || '').match(/uid[=-](\\d+)/)?.[1] || '';
13
+ if (!uid && !username) {
14
+ return { kind: 'auth', detail: '1point3acres bbs rendered but no #um identity — anonymous or shape drifted' };
15
+ }
16
+ return { ok: true, user_id: uid, username };
17
+ })()
18
+ `);if(e?.kind==="auth")throw new i("1point3acres.com",e.detail);if(!e?.ok)throw new s(`Unexpected 1point3acres probe: ${JSON.stringify(e)}`);return{user_id:e.user_id,username:e.username}}u({site:"1point3acres",domain:"1point3acres.com",loginUrl:"https://auth.1point3acres.com/login",columns:["user_id","username"],quickCheck:o,verify:r,poll:async(t)=>{if(!await o(t))throw new i("1point3acres.com","Waiting for 1point3acres Discuz *_auth cookie");return r(t)}});
@@ -0,0 +1 @@
1
+ import{cli as a,Strategy as l}from"@jackwener/opencli/registry";import{fetchHtml as m,parseThreadList as o,normalizeLimit as n,BASE as p}from"./utils.js";a({site:"1point3acres",name:"digest",access:"read",description:"一亩三分地 精华帖(编辑推荐 / 加精)",domain:"www.1point3acres.com",strategy:l.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"返回条数(默认 20,最多 50)"}],columns:["rank","tid","title","forum","author","replies","views","lastReplyTime","url"],func:async(i)=>{const t=n(i.limit,20,50),r=await m(`${p}/forum.php?mod=guide&view=digest`);return o(r).slice(0,t).map((e,s)=>({rank:s+1,tid:e.tid,title:e.title,forum:e.forum,author:e.author,replies:e.replies,views:e.views,lastReplyTime:e.lastReplyTime,url:e.url}))}});
@@ -0,0 +1 @@
1
+ import{cli as K,Strategy as M}from"@jackwener/opencli/registry";import{ArgumentError as G}from"@jackwener/opencli/errors";import{fetchHtml as O,parseThreadList as P,parseThreadRows as Q,normalizeLimit as U,BASE as V}from"./utils.js";K({site:"1point3acres",name:"forum",access:"read",description:"浏览一亩三分地某个版块的帖子列表(按 fid)",domain:"www.1point3acres.com",strategy:M.PUBLIC,browser:!1,args:[{name:"fid",required:!0,positional:!0,help:"版块 ID,例如 145(海外面经)、198(海外职位内推)、27(研究生申请)"},{name:"page",type:"int",default:1,help:"页码(默认 1)"},{name:"limit",type:"int",default:20,help:"返回条数(默认 20,最多 50)"}],columns:["rank","tid","kind","title","author","replies","views","lastReplyTime","url"],func:async(v)=>{const C=String(v.fid||"").trim();if(!/^\d+$/.test(C))throw new G("fid must be a numeric forum id","e.g. 145 for 海外面经");const x=Number(v.page??1);if(!Number.isInteger(x)||x<=0)throw new G("page must be a positive integer");const I=U(v.limit,20,50),D=await O(`${V}/forum-${C}-${x}.html`);if(Q(D).length===0)return[];return P(D).slice(0,I).map((q,J)=>({rank:J+1,tid:q.tid,kind:q.kind==="stickthread"?"置顶":"普通",title:q.title,author:q.author,replies:q.replies,views:q.views,lastReplyTime:q.lastReplyTime,url:q.url}))}});
@@ -0,0 +1 @@
1
+ import{cli as K,Strategy as L}from"@jackwener/opencli/registry";import{fetchHtml as M,decodeEntities as N,BASE as F}from"./utils.js";K({site:"1point3acres",name:"forums",access:"read",description:"一亩三分地 所有版块(fid + 版块名)",domain:"www.1point3acres.com",strategy:L.PUBLIC,browser:!1,args:[{name:"filter",type:"string",default:"",help:"按版块名关键字过滤(子串匹配,中英文)"}],columns:["fid","name","url"],func:async(G)=>{const I=await M(`${F}/forum.php`),x=new Map,J=/<a href="forum-(\d+)-1\.html"[^>]*class="[^"]*overflow-hidden[^"]*"[^>]*>\s*([^<]+?)\s*<\/a>/g;let z;while(z=J.exec(I)){const v=z[1];let q=N(z[2].trim());q=q.replace(/^\[(.+)\]$/,"$1").trim();if(!q||x.has(v))continue;x.set(v,q)}const C=String(G.filter||"").toLowerCase().trim(),D=[];for(const[v,q]of x){if(C&&!q.toLowerCase().includes(C))continue;D.push({fid:v,name:q,url:`${F}/forum-${v}-1.html`})}return D}});
@@ -0,0 +1 @@
1
+ import{cli as a,Strategy as l}from"@jackwener/opencli/registry";import{fetchHtml as m,parseThreadList as o,normalizeLimit as n,BASE as p}from"./utils.js";a({site:"1point3acres",name:"hot",access:"read",description:"一亩三分地 今日热门帖子(按热度排序,约 50 条)",domain:"www.1point3acres.com",strategy:l.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"返回条数(默认 20,最多 50)"}],columns:["rank","tid","title","forum","author","replies","views","lastReplyTime","url"],func:async(i)=>{const t=n(i.limit,20,50),r=await m(`${p}/forum.php?mod=guide&view=hot`);return o(r).slice(0,t).map((e,s)=>({rank:s+1,tid:e.tid,title:e.title,forum:e.forum,author:e.author,replies:e.replies,views:e.views,lastReplyTime:e.lastReplyTime,url:e.url}))}});
@@ -0,0 +1 @@
1
+ import{cli as m,Strategy as o}from"@jackwener/opencli/registry";import{fetchHtml as a,parseThreadList as l,normalizeLimit as n,BASE as p}from"./utils.js";m({site:"1point3acres",name:"latest",access:"read",description:"一亩三分地 最新发帖(按发帖时间倒序)",domain:"www.1point3acres.com",strategy:o.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"返回条数(默认 20,最多 50)"}],columns:["rank","tid","title","forum","author","replies","views","postTime","url"],func:async(i)=>{const t=n(i.limit,20,50),r=await a(`${p}/forum.php?mod=guide&view=new`);return l(r).slice(0,t).map((e,s)=>({rank:s+1,tid:e.tid,title:e.title,forum:e.forum,author:e.author,replies:e.replies,views:e.views,postTime:e.postTime,url:e.url}))}});
@@ -0,0 +1 @@
1
+ import{cli as C,Strategy as D}from"@jackwener/opencli/registry";import{AuthRequiredError as I,EmptyResultError as U}from"@jackwener/opencli/errors";import{fetchHtml as z,decodeEntities as H,getCookie as P,stripHtml as f,truncate as j,normalizePositiveInteger as B,BASE as K}from"./utils.js";C({site:"1point3acres",name:"notifications",access:"read",description:"一亩三分地 站内通知(互动 / 点评 / @ 我;需要登录)",domain:"www.1point3acres.com",strategy:D.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"kind",type:"string",default:"mypost",help:"通知类型:mypost(我的帖子) / interactive(互动) / system(系统) / app(应用)"},{name:"limit",type:"int",default:20,help:"返回条数"}],columns:["index","from","summary","time","threadUrl"],func:async(W,L)=>{const X=String(L.kind||"mypost").trim(),Y=await P(W),Z=`${K}/home.php?mod=space&do=notice&view=${encodeURIComponent(X)}`,x=await z(Z,{cookie:Y,headers:{Referer:`${K}/`}});if(/<title>提示信息/.test(x)&&/请登录/.test(x))throw new I("www.1point3acres.com","请先登录一亩三分地");if(/暂时没有提醒内容/.test(x))throw new U("1point3acres notifications","暂时没有提醒内容");const J=[],_=B(L.limit,20,"limit"),$=/<dl class="[^"]*cl[^"]*"[^>]*>([\s\S]*?)<\/dl>/g;let N,O=0;while((N=$.exec(x))&&J.length<_){const F=N[1],Q=H((F.match(/<dt>([\s\S]*?)<\/dt>/)||[,""])[1]).replace(/<[^>]+>/g,"").trim(),T=(F.match(/<dd class="ntc_body">([\s\S]*?)<\/dd>/)||F.match(/<dd>([\s\S]*?)<\/dd>/)||[,""])[1],V=j(f(T),200),q=((F.match(/<dd class="[^"]*xg1[^"]*"[^>]*>([\s\S]*?)<\/dd>/)||[,""])[1]||"").replace(/<[^>]+>/g,"").trim(),G=T.match(/href="([^"]*thread-\d+[^"]*)"/),v=G?G[1].startsWith("http")?G[1]:`${K}/${G[1]}`:"";O+=1;if(!Q&&!V)continue;J.push({index:O,from:Q,summary:V,time:q,threadUrl:v})}return J}});
@@ -0,0 +1 @@
1
+ import{cli as X,Strategy as Y}from"@jackwener/opencli/registry";import{ArgumentError as Z,EmptyResultError as M}from"@jackwener/opencli/errors";import{fetchHtml as _,parseSearchList as $,assertNotGuestAlert as b,getCookie as C,decodeEntities as D,normalizeLimit as G,BASE as O}from"./utils.js";X({site:"1point3acres",name:"search",access:"read",description:"一亩三分地 站内关键字搜索(需要登录)",domain:"www.1point3acres.com",strategy:Y.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"query",required:!0,positional:!0,help:"搜索关键字"},{name:"limit",type:"int",default:20,help:"返回条数(默认 20,最多 50)"},{name:"fid",type:"string",default:"",help:"限定版块 ID(可选)"}],columns:["rank","tid","title","forum","author","replies","views","postTime","url"],func:async(P,x)=>{const F=String(x.query||"").trim();if(!F)throw new Z("query 不能为空");const Q=G(x.limit,20,50),J=String(x.fid||"").trim(),T=await C(P),U=new URLSearchParams({mod:"forum",srchtxt:F,searchsubmit:"yes",...J?{srchfid:J}:{}}),V=`${O}/search.php?${U.toString()}`,I=await _(V,{cookie:T,headers:{Referer:`${O}/`}});b(I);const K=$(I);if(K.length===0){const v=I.match(/<p>([^<]*?抱歉[^<]*?)<\/p>/);if(v)throw new M("1point3acres search",D(v[1].trim()));throw new M("1point3acres search",`No results for "${F}"`)}return K.slice(0,Q).map((v,W)=>({rank:W+1,tid:v.tid,title:v.title,forum:v.forum,author:v.author,replies:v.replies,views:v.views,postTime:v.postTime,url:v.url}))}});
@@ -0,0 +1,2 @@
1
+ import{cli as B,Strategy as b}from"@jackwener/opencli/registry";import{ArgumentError as w,EmptyResultError as H}from"@jackwener/opencli/errors";import{fetchHtml as x,decodeEntities as R,stripHtml as E,truncate as k,normalizePositiveInteger as Z,BASE as j}from"./utils.js";function F(O,J,K=1){const U=O.match(J);return U?U[K]:""}B({site:"1point3acres",name:"thread",access:"read",description:"一亩三分地 帖子详情 + 楼层(主楼 + 回复)",domain:"www.1point3acres.com",strategy:b.PUBLIC,browser:!1,args:[{name:"tid",required:!0,positional:!0,help:"帖子 ID(数字,见 `hot`/`latest` 返回的 tid)"},{name:"page",type:"int",default:1,help:"楼层分页页码(默认 1)"},{name:"limit",type:"int",default:10,help:"返回楼层条数(默认 10,含主楼)"},{name:"contentLimit",type:"int",default:400,help:"每楼正文截断长度(默认 400 字符,最少 50)"}],columns:["floor","pid","author","postTime","content","url"],func:async(O)=>{const J=String(O.tid||"").trim();if(!/^\d+$/.test(J))throw new w("tid must be a numeric thread id");const K=Z(O.page,1,"page"),U=Z(O.limit,10,"limit"),z=Z(O.contentLimit,400,"contentLimit",{min:50}),A=`${j}/thread-${J}-${K}-1.html`,N=await x(A);if(!/id="postlist"/.test(N)&&!/id="post_\d+"/.test(N))throw new H("1point3acres thread",`帖子 ${J} 不存在或被删除`);const W=[],I=/<div id="post_(\d+)"[^>]*>/g,Q=[];let X;while(X=I.exec(N))Q.push({postId:X[1],offset:X.index});for(let q=0;q<Q.length;q++){const V=Q[q].offset,D=q+1<Q.length?Q[q+1].offset:N.length;W.push({postId:Q[q].postId,body:N.slice(V,D)})}const G=[];for(let q=0;q<W.length&&G.length<U;q++){const{postId:V,body:D}=W[q],_=D.match(/<div class="authi"[\s\S]*?<\/div>/),$=_?_[0]:"",P=[/<a [^>]*class="[^"]*\bxi2\b[^"]*"[^>]*>\s*([^<]+?)\s*<\/a>/,/<a [^>]*href="space-uid-\d+\.html"[^>]*>\s*([^<]+?)\s*<\/a>/,/<a [^>]*class="[^"]*\bxw1\b[^"]*"[^>]*>\s*([^<]+?)\s*<\/a>/];let C="";for(const v of P){const Y=R(F($||D,v));if(Y&&!/匿名卡|变色卡|关贴卡/.test(Y)){C=Y;break}}const M=F($,/<span title="([^"]+)">/)||F(D,/id="authorposton\d+"[^>]*>\s*<span title="([^"]+)">/)||F(D,/id="authorposton\d+"[^>]*>\s*([^<]+?)\s*</)||F(D,/<meta itemprop="datePublished" content="([^"]+)"/),L=F(D,/<em>(\d+)<\/em>\s*#?\s*<\/a>/)||F(D,/id="postnum\d+"[^>]*>\s*<em>(\d+)<\/em>/),S=L?Number(L):K===1&&q===0?1:(K-1)*10+q+1,T=D.match(/id="postmessage_\d+"[^>]*>([\s\S]*?)<\/td>/),y=k(E(T?T[1]:""),z);G.push({floor:S,pid:V,author:C,postTime:M.trim(),content:y,url:`${j}/forum.php?mod=redirect&goto=findpost&ptid=${J}&pid=${V}`})}if(K===1&&G.length>0){const q=R(F(N,/<span id="thread_subject">([^<]+)<\/span>/).trim()||F(N,/<title>([^<]+?)\s*[-|]/).trim());G[0].content=q?`【${q}】
2
+ ${G[0].content}`:G[0].content}if(!G.length)throw new H("1point3acres thread",`帖子 ${J} 第 ${K} 页没有可读取楼层`);return G}});