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,24 @@
1
+ import{cli as K,Strategy as M}from"@jackwener/opencli/registry";import{ArgumentError as J,CommandExecutionError as B}from"@jackwener/opencli/errors";import{assertLiteralContent as N}from"../_shared/content-guard.js";K({site:"bilibili",name:"dynamic-post",access:"write",description:"发布 B站动态(纯文本,官方 API,需登录)",domain:"www.bilibili.com",strategy:M.COOKIE,browser:!0,args:[{name:"text",required:!0,positional:!0,help:"Dynamic text content"},{name:"execute",type:"boolean",help:"Actually publish. Without it the command refuses to write."}],columns:["status","dynamic_id","text","url"],func:async(q,D)=>{if(!q)throw new B("Browser session required for bilibili dynamic-post");const z=String(D.text??"").trim();N(z,{label:"动态内容"});if(!z)throw new J("bilibili dynamic-post text cannot be empty");if(!D.execute)throw new J("Refusing to post: pass --execute to actually publish this dynamic");let G=!1;for(let H=0;H<4;H++){await q.goto("https://t.bilibili.com");await q.wait(2);const I=await q.evaluate("location.href");if(typeof I==="string"&&/^https?:\/\/[^/]*bilibili\.com/.test(I)){G=!0;break}}if(!G)throw new B("Failed to navigate to t.bilibili.com (page did not land on a bilibili origin)");const v=await q.evaluate(`(async () => {
2
+ var text = ${JSON.stringify(z)};
3
+ var csrf = (document.cookie.match(/bili_jct=([^;]+)/) || [])[1] || '';
4
+ var url = 'https://api.bilibili.com/x/dynamic/feed/create/dyn?csrf=' + encodeURIComponent(csrf);
5
+ var body = {
6
+ dyn_req: {
7
+ content: { contents: [{ raw_text: text, type: 1, biz_id: '' }] },
8
+ scene: 1,
9
+ meta: { app_meta: { from: 'create.dynamic.web', mobi_app: 'web' } },
10
+ },
11
+ };
12
+ var resp = await fetch(url, {
13
+ method: 'POST',
14
+ credentials: 'include',
15
+ headers: { 'Content-Type': 'application/json' },
16
+ body: JSON.stringify(body),
17
+ });
18
+ var t = await resp.text();
19
+ var data; try { data = JSON.parse(t); } catch (e) { data = null; }
20
+ if (!data) return { ok: false, message: 'Non-JSON response (HTTP ' + resp.status + '): ' + t.slice(0, 250) };
21
+ if (data.code !== 0) return { ok: false, message: (data.message || 'unknown error') + ' (' + data.code + ')' };
22
+ var dynId = data.data && (data.data.dyn_id_str || data.data.dyn_id || data.data.dynamic_id_str);
23
+ return { ok: true, dynId: String(dynId || ''), raw: t.slice(0, 250) };
24
+ })()`);if(!v?.ok)throw new B(`Bilibili dynamic-post failed: ${v?.message||"unknown error"}`);return[{status:"success",dynamic_id:v.dynId,text:z,url:v.dynId?`https://t.bilibili.com/${v.dynId}`:""}]}});
@@ -0,0 +1 @@
1
+ import{cli as a,Strategy as d}from"@jackwener/opencli/registry";import{apiGet as s}from"./utils.js";a({site:"bilibili",name:"dynamic",access:"read",description:"Get Bilibili user dynamic feed",domain:"www.bilibili.com",strategy:d.COOKIE,args:[{name:"limit",type:"int",default:15}],columns:["id","author","text","likes","url"],func:async(l,t)=>{return((await s(l,"/x/polymer/web-dynamic/v1/feed/all",{params:{},signed:!1}))?.data?.items??[]).slice(0,Number(t.limit)).map((e)=>{let i="";if(e.modules?.module_dynamic?.desc?.text)i=e.modules.module_dynamic.desc.text;else if(e.modules?.module_dynamic?.major?.archive?.title)i=e.modules.module_dynamic.major.archive.title;return{id:e.id_str??"",author:e.modules?.module_author?.name??"",text:i,likes:e.modules?.module_stat?.like?.count??0,url:e.id_str?`https://t.bilibili.com/${e.id_str}`:""}})}});
@@ -0,0 +1 @@
1
+ import{cli as G,Strategy as U}from"@jackwener/opencli/registry";import{ArgumentError as X,CommandExecutionError as Q}from"@jackwener/opencli/errors";import{apiGet as V,apiPost as q,getSelfUid as A,requireOkPayload as Y,resolveVideoIds as O}from"./utils.js";async function Z(z,K){const h=await A(z),L=await V(z,"/x/v3/fav/folder/created/list-all",{params:{up_mid:h,type:2,rid:K},signed:!0}),M=Y(L,"fav folder list")?.list??[];if(!Array.isArray(M)||M.length===0)throw new Q("Bilibili fav folder list returned no folders for this account");return M}function _(z,K){const h=String(K??"").trim();if(!h)return z[0];const L=z.find((J)=>String(J.id)===h);if(L)return L;const H=z.filter((J)=>String(J.title??"")===h);if(H.length===1)return H[0];if(H.length>1)throw new X(`收藏夹标题「${h}」有 ${H.length} 个同名,请改用 ID:${H.map((J)=>J.id).join(", ")}`);const M=z.map((J)=>`${J.id}=${J.title}`).join(", ");throw new X(`找不到收藏夹「${h}」;现有收藏夹:${M}`)}G({site:"bilibili",name:"favorite-add",access:"write",description:"把 B站视频加入 / 移出收藏夹(官方 API,需登录;--folder 缺省用默认收藏夹)",domain:"www.bilibili.com",strategy:U.COOKIE,args:[{name:"bvid",required:!0,positional:!0,help:"Video BV ID / URL / b23.tv short link"},{name:"folder",help:"目标收藏夹 ID 或标题(缺省用默认收藏夹)"},{name:"remove",type:"boolean",help:"从收藏夹移出(默认是加入)"}],columns:["bvid","folder_id","folder","status","url"],func:async(z,K)=>{if(!z)throw new Q("Browser session required for bilibili favorite-add");const h=Boolean(K.remove),{bvid:L,aid:H}=await O(z,K.bvid),M=`https://www.bilibili.com/video/${L}`,J=await Z(z,H),N=_(J,K.folder),$=Number(N.fav_state??0)===1,R={bvid:L,folder_id:String(N.id),folder:String(N.title??""),url:M};if($===!h)return[{...R,status:h?"not-in-folder":"already-favorited"}];const B=await q(z,"/x/v3/fav/resource/deal",{params:{rid:H,type:2,add_media_ids:h?"":String(N.id),del_media_ids:h?String(N.id):""}});Y(B,"fav resource deal");const W=(await Z(z,H)).find((D)=>String(D.id)===String(N.id));if(Number(W?.fav_state??0)!==(h?0:1))throw new Q(`Bilibili favorite did not verify: fav_state=${W?.fav_state} after ${h?"remove":"add"}`);return[{...R,status:h?"removed":"favorited"}]}});export const __test__={pickFolder:_};
@@ -0,0 +1 @@
1
+ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{apiGet as H,payloadData as J,getSelfUid as R}from"./utils.js";O({site:"bilibili",name:"favorite",access:"write",description:"我的收藏夹",domain:"www.bilibili.com",strategy:Q.COOKIE,args:[{name:"fid",type:"int",required:!1,help:"Favorite folder ID (defaults to first folder)"},{name:"limit",type:"int",default:20,help:"Number of results"},{name:"page",type:"int",default:1,help:"Page number"}],columns:["rank","title","author","plays","url"],func:async(x,K)=>{const{fid:B,limit:C=20,page:L=1}=K;let z;if(B)z=Number(B);else{const q=await R(x),A=await H(x,"/x/v3/fav/folder/created/list-all",{params:{up_mid:q},signed:!0}),E=J(A)?.list??[];if(!E.length)return[];z=E[0].id}const M=await H(x,"/x/v3/fav/resource/list",{params:{media_id:z,pn:L,ps:Math.min(Number(C),40)},signed:!0});return(J(M)?.medias??[]).slice(0,Number(C)).map((q,A)=>({rank:A+1,title:q.title??"",author:q.upper?.name??"",plays:q.cnt_info?.play??0,url:q.bvid?`https://www.bilibili.com/video/${q.bvid}`:""}))}});
@@ -0,0 +1,2 @@
1
+ import{cli as C,Strategy as E}from"@jackwener/opencli/registry";import{apiGet as I,payloadData as F,resolveUid as S,stripHtml as v}from"./utils.js";const R={DYNAMIC_TYPE_AV:"video",DYNAMIC_TYPE_DRAW:"draw",DYNAMIC_TYPE_ARTICLE:"article",DYNAMIC_TYPE_FORWARD:"forward",DYNAMIC_TYPE_WORD:"text",DYNAMIC_TYPE_LIVE_RCMD:"live",DYNAMIC_TYPE_PGC:"bangumi"};function Y(J){const K=J.modules??{},Q=K.module_author??{},X=K.module_dynamic??{},b=X.major??{},$=K.module_stat??{};let q="",B=J.id_str?`https://t.bilibili.com/${J.id_str}`:"";const L=R[J.type]??J.type??"";if(b.archive){q=b.archive.title??"";B=b.archive.jump_url?`https:${b.archive.jump_url}`:B}if(!q&&b.article){q=b.article.title??"";B=b.article.jump_url?`https:${b.article.jump_url}`:B}if(!q&&X.desc?.text)q=v(X.desc.text).slice(0,60);if(!q&&b.draw){const N=b.draw.items?.length??0;q=N>0?`[图片x${N}]`:"[图文动态]"}if(!q&&J.basic?.is_only_fans)q="[充电专属]";if(!q&&J.type==="DYNAMIC_TYPE_FORWARD")q="[转发动态]";if(!q)q=`[${L||"动态"}]`;const V=Q.pub_time??"",z=$.like?.count??0,W=$.comment?.count??0;return{title:q,url:B,itemType:L,author:Q.name??"",time:V,likes:z,comments:W}}C({site:"bilibili",name:"feed",access:"read",description:"动态时间线(不传 uid 查关注时间线,传 uid 查指定用户动态)",domain:"www.bilibili.com",strategy:E.COOKIE,args:[{name:"uid",positional:!0,required:!1,help:"用户 UID 或用户名(不传则显示关注时间线)"},{name:"limit",type:"int",default:20,help:"Max results to return"},{name:"type",default:"all",help:"Filter: all, video, article, draw, text"},{name:"pages",type:"int",default:1,help:"Number of pages to fetch (each ~20 items)"}],columns:["rank","time","author","title","type","likes","url"],func:async(J,K)=>{const Q=Number(K.limit)||20,X=Number(K.pages)||1,b=K.type==="all"?"":K.type??"",$=!!K.uid,q=$?await S(J,String(K.uid)):null,B=[];let L="";for(let V=0;V<X;V++){if(B.length>=Q)break;let z;if($){const O={host_mid:q,timezone_offset:-480};if(L)O.offset=L;z=await I(J,"/x/polymer/web-dynamic/v1/feed/space",{params:O})}else{const O={timezone_offset:-480,type:b||"all",page:V+1};if(L)O.offset=L;z=await I(J,"/x/polymer/web-dynamic/v1/feed/all",{params:O})}const W=F(z)??{},N=W.items??[];if(N.length===0)break;for(const O of N){if(B.length>=Q)break;const Z=Y(O);if(b&&Z.itemType!==b)continue;B.push({rank:B.length+1,time:Z.time,author:Z.author,title:Z.title,type:Z.itemType,likes:Z.likes,url:Z.url})}L=W.offset??N[N.length-1]?.id_str??"";if(!L||!W.has_more)break}return B}});C({site:"bilibili",name:"feed-detail",access:"read",description:"查看 Bilibili 动态详情(支持充电专属内容)",domain:"www.bilibili.com",strategy:E.COOKIE,args:[{name:"id",positional:!0,required:!0,help:"动态 ID(从 feed 命令的 url 中获取)"}],columns:["field","value"],func:async(J,K)=>{const Q=String(K.id),X=await I(J,"/x/polymer/web-dynamic/v1/detail",{params:{id:Q,timezone_offset:-480}}),b=[],q=F(X)?.item;if(!q){b.push({field:"error",value:"动态不存在或无权查看"});return b}const B=q.modules??{},L=B.module_author??{},V=B.module_dynamic??{},z=V.major??{},W=B.module_stat??{};b.push({field:"id",value:q.id_str??Q});b.push({field:"author",value:L.name??""});b.push({field:"time",value:L.pub_time??""});b.push({field:"type",value:R[q.type]??q.type??""});if(V.desc?.text)b.push({field:"text",value:v(V.desc.text)});if(z.archive){b.push({field:"video_title",value:z.archive.title??""});b.push({field:"video_desc",value:z.archive.desc??""});b.push({field:"video_url",value:z.archive.jump_url?`https:${z.archive.jump_url}`:""});b.push({field:"play",value:String(z.archive.stat?.play??"")});b.push({field:"danmaku",value:String(z.archive.stat?.danmaku??"")})}if(z.article){b.push({field:"article_title",value:z.article.title??""});b.push({field:"article_url",value:z.article.jump_url?`https:${z.article.jump_url}`:""})}if(z.draw?.items?.length)b.push({field:"images",value:z.draw.items.map((N)=>N.src).join(`
2
+ `)});if(z.opus?.summary?.text)b.push({field:"opus_text",value:v(z.opus.summary.text)});if(z.opus?.title)b.push({field:"opus_title",value:z.opus.title});if(q.orig){const N=q.orig.modules?.module_author?.name??"",O=q.orig.modules?.module_dynamic?.desc?.text??"";b.push({field:"forward_from",value:N});if(O)b.push({field:"forward_text",value:v(O).slice(0,200)})}b.push({field:"likes",value:String(W.like?.count??0)});b.push({field:"comments",value:String(W.comment?.count??0)});b.push({field:"forwards",value:String(W.forward?.count??0)});b.push({field:"url",value:`https://t.bilibili.com/${q.id_str??Q}`});return b}});
@@ -0,0 +1 @@
1
+ import{cli as V,Strategy as Y}from"@jackwener/opencli/registry";import{ArgumentError as Q,CommandExecutionError as W,EmptyResultError as j}from"@jackwener/opencli/errors";import{apiPost as v,fetchJson as C,getSelfUid as F,requireOkPayload as $,resolveUid as U}from"./utils.js";const P=5000,S=500;function I(D){const G=String(D??"").trim();if(!G)return"";const z=/^https?:\/\//i.test(G)?G:`https://${G}`;let B;try{B=new URL(z)}catch{return""}if(B.hostname.toLowerCase()!=="space.bilibili.com")return"";const H=B.pathname.match(/^\/(\d+)\/?$/);return H?H[1]:""}async function J(D,G){const z=String(G??"").trim();if(!z)throw new Q("bilibili follow target cannot be empty");if(/^(?:https?:\/\/)?space\.bilibili\.com\//i.test(z)){const B=I(z);if(!B)throw new Q("bilibili follow target must be a valid space.bilibili.com/<uid> URL");return B}try{return await U(D,z)}catch(B){if(B instanceof j)throw B;throw new Q(`Cannot resolve Bilibili target from input: ${z}`,B instanceof Error?B.message:String(B))}}async function X(D,G){const z=await C(D,`https://api.bilibili.com/x/relation?fid=${G}`);$(z,"relation query");const B=z?.data?.attribute;if(typeof B!=="number")throw new W("Bilibili relation query returned a malformed attribute");return B}async function q(D,G,z,B){const H=Date.now()+P;let K;while(Date.now()<=H){K=await X(D,G);if(z(K))return K;if(typeof D.wait!=="function")break;await D.wait({time:S/1000})}throw new W(`Bilibili relation modify did not verify ${B}; last attribute=${K}`)}V({site:"bilibili",name:"follow",access:"write",description:"关注 B站用户(官方 API,需登录)",domain:"www.bilibili.com",strategy:Y.COOKIE,args:[{name:"target",required:!0,positional:!0,help:"目标 UID / 用户名 / space.bilibili.com 链接"}],columns:["mid","name","status","url"],func:async(D,G)=>{if(!D)throw new W("Browser session required for bilibili follow");const z=await J(D,G.target),B=await F(D);if(z===B)throw new Q("Cannot follow yourself");const H=await X(D,z),K=`https://space.bilibili.com/${z}`;if(H===2||H===6)return[{mid:z,name:"",status:"already-following",url:K}];if(H===128)throw new W(`Bilibili user ${z} is blocked; unblock first before following.`);const N=await v(D,"/x/relation/modify",{params:{fid:z,act:1,re_src:11}});$(N,"relation modify");await q(D,z,(Z)=>Z===2||Z===6,"following");return[{mid:z,name:"",status:"followed",url:K}]}});export const __test__={resolveTargetMid:J,fetchRelationAttribute:X,waitForRelation:q};
@@ -0,0 +1 @@
1
+ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{CommandExecutionError as H}from"@jackwener/opencli/errors";import{fetchJson as R,getSelfUid as T,resolveUid as V}from"./utils.js";O({site:"bilibili",name:"following",access:"read",description:"获取 Bilibili 用户的关注列表",domain:"www.bilibili.com",strategy:Q.COOKIE,args:[{name:"uid",positional:!0,required:!1,help:"目标用户 ID(默认为当前登录用户)"},{name:"page",type:"int",required:!1,default:1,help:"页码"},{name:"limit",type:"int",required:!1,default:50,help:"每页数量 (最大 50)"}],columns:["mid","name","sign","following","fans"],func:async(B,D)=>{if(!B)throw new H("Browser session required for bilibili following");const K=D.uid?await V(B,D.uid):await T(B),L=D.page??1,N=Math.min(D.limit??50,50),q=await R(B,`https://api.bilibili.com/x/relation/followings?vmid=${K}&pn=${L}&ps=${N}&order=desc`);if(q.code!==0)throw new H(`获取关注列表失败: ${q.message} (${q.code})`);const G=q.data?.list||[];if(G.length===0)return[{mid:"-",name:`共 ${q.data?.total??0} 人关注,当前页无数据`,sign:"",following:"",fans:""}];return G.map((z)=>({mid:z.mid,name:z.uname,sign:(z.sign||"").slice(0,40),following:z.attribute===6?"互相关注":"已关注",fans:z.official_verify?.desc||""}))}});
@@ -0,0 +1 @@
1
+ import{cli as p,Strategy as m}from"@jackwener/opencli/registry";import{apiGet as h,payloadData as b}from"./utils.js";p({site:"bilibili",name:"history",access:"read",description:"我的观看历史",domain:"www.bilibili.com",strategy:m.COOKIE,args:[{name:"limit",type:"int",default:20,help:"Number of results"}],columns:["rank","title","author","progress","url"],func:async(r,a)=>{const{limit:i=20}=a,l=await h(r,"/x/web-interface/history/cursor",{params:{ps:Math.min(Number(i),30),type:"archive"}});return(b(l)?.list??[]).slice(0,Number(i)).map((t,c)=>{const o=t.progress??0,s=t.duration??0;let e;if(o<0||o>=s)e="已看完";else{const u=s>0?Math.round(o/s*100):0;e=`${n(o)}/${n(s)} (${u}%)`}return{rank:c+1,title:t.title??"",author:t.author_name??"",progress:e,url:t.history?.bvid?`https://www.bilibili.com/video/${t.history.bvid}`:""}})}});function n(r){const a=Math.floor(r/60),i=r%60;return`${a}:${i.toString().padStart(2,"0")}`}
@@ -0,0 +1,15 @@
1
+ import{cli as i}from"@jackwener/opencli/registry";i({site:"bilibili",name:"hot",access:"read",description:"B站热门视频",domain:"www.bilibili.com",args:[{name:"limit",type:"int",default:20,help:"Number of videos"}],columns:["rank","title","author","play","danmaku","bvid","url"],pipeline:[{navigate:"https://www.bilibili.com"},{evaluate:`(async () => {
2
+ const res = await fetch('https://api.bilibili.com/x/web-interface/popular?ps=\${{ args.limit }}&pn=1', {
3
+ credentials: 'include'
4
+ });
5
+ const data = await res.json();
6
+ return (data?.data?.list || []).map((item) => ({
7
+ title: item.title,
8
+ author: item.owner?.name,
9
+ play: item.stat?.view,
10
+ danmaku: item.stat?.danmaku,
11
+ bvid: item.bvid,
12
+ url: item.bvid ? 'https://www.bilibili.com/video/' + item.bvid : '',
13
+ }));
14
+ })()
15
+ `},{map:{rank:"${{ index + 1 }}",title:"${{ item.title }}",author:"${{ item.author }}",play:"${{ item.play }}",danmaku:"${{ item.danmaku }}",bvid:"${{ item.bvid }}",url:"${{ item.url }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as U,Strategy as q}from"@jackwener/opencli/registry";import{CommandExecutionError as X}from"@jackwener/opencli/errors";import{apiGet as A,apiPost as C,requireOkPayload as Z,resolveVideoIds as N}from"./utils.js";const Y=5000,h=500;async function Q(z,H,B){const D=await A(z,"/x/web-interface/archive/relation",{params:{aid:H,bvid:B}});return Z(D,"archive relation")}async function j(z,H,B,D){const K=Date.now()+Y;let J;while(Date.now()<=K){J=Boolean((await Q(z,H,B))?.like);if(J===D)return;if(typeof z.wait!=="function")break;await z.wait({time:h/1000})}throw new X(`Bilibili like did not verify: relation.like=${J}, expected ${D}`)}U({site:"bilibili",name:"like",access:"write",description:"给 B站视频点赞 / 取消点赞(官方 API,需登录;幂等,已点赞再点不会报错)",domain:"www.bilibili.com",strategy:q.COOKIE,args:[{name:"bvid",required:!0,positional:!0,help:"Video BV ID / URL / b23.tv short link"},{name:"undo",type:"boolean",help:"取消点赞(默认是点赞)"}],columns:["bvid","action","status","url"],func:async(z,H)=>{if(!z)throw new X("Browser session required for bilibili like");const B=Boolean(H.undo),{bvid:D,aid:K}=await N(z,H.bvid),J=`https://www.bilibili.com/video/${D}`,W=B?"unlike":"like",$=await Q(z,K,D);if(Boolean($?.like)===!B)return[{bvid:D,action:W,status:B?"not-liked":"already-liked",url:J}];const G=await C(z,"/x/web-interface/archive/like",{params:{aid:K,like:B?2:1}});Z(G,"archive like");await j(z,K,D,!B);return[{bvid:D,action:W,status:B?"unliked":"liked",url:J}]}});export const __test__={fetchVideoRelation:Q};
@@ -0,0 +1 @@
1
+ import{cli as a,Strategy as e}from"@jackwener/opencli/registry";import{apiGet as n,getSelfUid as s}from"./utils.js";a({site:"bilibili",name:"me",access:"read",description:"My Bilibili profile info",domain:"www.bilibili.com",strategy:e.COOKIE,args:[],columns:["name","uid","level","coins","followers","following"],func:async(o)=>{const l=await s(o),i=(await n(o,"/x/space/wbi/acc/info",{params:{mid:l},signed:!0}))?.data??{};return{name:i.name??"",uid:i.mid??l,level:i.level??0,coins:i.coins??0,followers:i.follower??0,following:i.following??0}}});
@@ -0,0 +1 @@
1
+ import{cli as B,Strategy as D}from"@jackwener/opencli/registry";import{CommandExecutionError as A}from"@jackwener/opencli/errors";async function F(q){for(let v=0;v<6;v++){await q.goto("https://member.bilibili.com/platform/home");await q.wait({time:1});let z="";try{z=String(await q.evaluate("location.href")||"")}catch{z=""}if(/^https?:\/\/member\.bilibili\.com\//.test(z))return}throw new A("无法进入 B站创作中心(可能未登录或被风控)。请先在客户端登录哔哩哔哩。")}B({site:"bilibili",name:"partitions",aliases:["tid-list"],access:"read",description:"列出 B站视频投稿分区(tid + 名称 + 父分区 + 简介),供 `bilibili upload --tid` 取合法分区 id。禁止臆造 tid。",domain:"member.bilibili.com",strategy:D.COOKIE,browser:!0,columns:["tid","name","parent","parent_name","desc"],func:async(q)=>{if(!q)throw new A("B站分区列举需要浏览器会话");await F(q);const v=await q.evaluate("(async () => {const r = await fetch('https://member.bilibili.com/x/vupre/web/archive/pre?lang=cn', { credentials: 'include' });const j = await r.json();const tree = j && j.data ? (j.data.typelist || j.data.tid_list) : null;if (!j || j.code !== 0 || !Array.isArray(tree)) {"+" throw new Error('获取 B站视频分区失败(可能未登录 B站):' + ((j && j.message) || ('code=' + (j && j.code))));"+'}const out = [];for (const p of tree) { const kids = Array.isArray(p.children) ? p.children : []; for (const c of kids) { if (!c || c.show === false) continue; out.push({ tid: c.id, name: c.name || "", parent: p.id, parent_name: p.name || "", desc: c.desc || c.description || "", }); }}return out;})()');if(!Array.isArray(v)||!v.length)throw new A("未取到任何 B站视频分区(接口返回空,可能未登录)");return v}});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as l}from"@jackwener/opencli/registry";import{apiGet as n}from"./utils.js";e({site:"bilibili",name:"ranking",access:"read",description:"Get Bilibili video ranking board",domain:"www.bilibili.com",strategy:l.COOKIE,args:[{name:"limit",type:"int",default:20}],columns:["rank","title","author","score","url"],func:async(a,t)=>{return((await n(a,"/x/web-interface/ranking/v2",{params:{rid:0,type:"all"},signed:!1}))?.data?.list??[]).slice(0,Number(t.limit)).map((i,r)=>({rank:r+1,title:i.title??"",author:i.owner?.name??"",score:i.stat?.view??0,url:i.bvid?`https://www.bilibili.com/video/${i.bvid}`:""}))}});
@@ -0,0 +1 @@
1
+ import{cli as n,Strategy as d}from"@jackwener/opencli/registry";import{apiGet as c,stripHtml as a}from"./utils.js";n({site:"bilibili",name:"search",access:"read",description:"Search Bilibili videos or users",domain:"www.bilibili.com",strategy:d.COOKIE,args:[{name:"query",required:!0,positional:!0,help:"Search keyword"},{name:"type",default:"video",help:"video or user"},{name:"page",type:"int",default:1,help:"Result page"},{name:"limit",type:"int",default:20,help:"Number of results"}],columns:["rank","title","author","score","bvid","url"],func:async(t,s)=>{const{query:l,type:o="video",page:u=1,limit:p=20}=s,r=o==="user"?"bili_user":"video";return((await c(t,"/x/web-interface/wbi/search/type",{params:{search_type:r,keyword:l,page:u},signed:!0}))?.data?.result??[]).slice(0,Number(p)).map((e,i)=>{if(r==="bili_user")return{rank:i+1,title:a(e.uname??""),author:(e.usign??"").trim(),score:e.fans??0,bvid:"",url:e.mid?`https://space.bilibili.com/${e.mid}`:""};return{rank:i+1,title:a(e.title??""),author:e.author??"",score:e.play??0,bvid:e.bvid??"",url:e.bvid?`https://www.bilibili.com/video/${e.bvid}`:""}})}});
@@ -0,0 +1 @@
1
+ import{cli as O,Strategy as R}from"@jackwener/opencli/registry";import{CommandExecutionError as C,EmptyResultError as b}from"@jackwener/opencli/errors";import{fetchJson as j,requireOkPayload as J}from"./utils.js";const V=10;async function G(B){for(let H=0;H<6;H++){await B.goto("https://member.bilibili.com/platform/upload-manager/article");await B.wait({time:1});let F="";try{F=String(await B.evaluate("location.href")||"")}catch{F=""}if(/^https?:\/\/member\.bilibili\.com\//.test(F))return}throw new C("无法进入 B站创作中心(可能未登录或被风控)。请先在客户端登录哔哩哔哩。")}function I(B){if(!B||!Number.isFinite(Number(B)))return"";const H=new Date((Number(B)+28800)*1000),F=(L)=>String(L).padStart(2,"0");return`${H.getUTCFullYear()}-${F(H.getUTCMonth()+1)}-${F(H.getUTCDate())} ${F(H.getUTCHours())}:${F(H.getUTCMinutes())}`}function K(B){if(B==null||B===""||B==="-")return"";const H=Number(String(B).replace(/,/g,""));return Number.isFinite(H)?H:""}async function Z(B,H){const F=[];for(let L=1;F.length<H;L++){const Y=`https://member.bilibili.com/x/web/archives?status=is_pubing%2Cpubed%2Cnot_pubed&pn=${L}&ps=${V}&coop=1&interactive=1`,$=await j(B,Y),X=J($,"archives"),Q=Array.isArray(X?.arc_audits)?X.arc_audits:[];if(Q.length===0)break;for(const W of Q){const z=W?.Archive??{},D=W?.stat??{},M=Number(z.ptime)||Number(z.ctime)||0,U={};if(D.dislike)U.dislike=D.dislike;if(D.now_rank)U.now_rank=D.now_rank;if(D.his_rank)U.his_rank=D.his_rank;if(D.vt)U.vt=D.vt;if(W.typename)U.category=W.typename;if(W.parent_tname)U.parent_category=W.parent_tname;if(z.aid!=null)U.aid=z.aid;if(z.duration)U.duration=z.duration;F.push({id:z.bvid||(z.aid!=null?`av${z.aid}`:""),type:"video",title:z.title??"",url:z.bvid?`https://www.bilibili.com/video/${z.bvid}`:"",published_at:I(M),views:K(D.view),likes:K(D.like),comments:K(D.reply),collects:K(D.favorite),shares:K(D.share),danmaku:K(D.danmaku),coins:K(D.coin),status:z.state_desc??"",extra:JSON.stringify(U),_ts:M})}const T=Number(X?.page?.count)||0;if(L*V>=T)break}return F}async function S(B,H){const F="%7B%22platform%22:%22web%22,%22device%22:%22pc%22,%22spmid%22:%22333.1374%22%7D",L=[];for(let Y=1;L.length<H;Y++){const $=`https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/creationlist?ps=${V}&pn=${Y}&classification_type=0&creation_type=0&web_location=333.1374&x-bili-device-req-json=${F}`,X=await j(B,$),Q=J(X,"opus creationlist"),T=Array.isArray(Q?.items)?Q.items:[];if(T.length===0)break;for(const z of T){const D=z?.stat??{},M=String(z?.dyn_type)==="64",U=Math.floor((Date.parse(`${String(z?.pub_time??"").replace(" ","T")}:00+08:00`)||0)/1000),q={dyn_id:z?.dyn_id??"",dyn_type:z?.dyn_type??""};if(z?.filter_group?.reason)q.reason=z.filter_group.reason;L.push({id:M?`cv${z.rid}`:String(z?.dyn_id??""),type:M?"article":"opus",title:z?.title??"",url:M?`https://www.bilibili.com/read/cv${z.rid}`:z?.dyn_id?`https://www.bilibili.com/opus/${z.dyn_id}`:"",published_at:z?.pub_time??"",views:K(D.view),likes:K(D.like),comments:K(D.reply),collects:K(D.favorite),shares:"",danmaku:"",coins:K(D.coin),status:"",extra:JSON.stringify(q),_ts:U})}if(!Q?.has_more)break;const W=Number(Q?.total)||0;if(W&&Y*V>=W)break}return L}O({site:"bilibili",name:"stats",access:"read",description:"B站稿件数据(每个视频/图文/专栏稿件的播放、点赞、投币、收藏、弹幕、分享、评论等全量运营指标)",domain:"member.bilibili.com",strategy:R.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:20,help:"返回条数(视频与图文合并后按发布时间倒序截取)"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","danmaku","coins","status","extra"],func:async(B,H)=>{if(!B)throw new C("B站稿件数据需要浏览器会话");const F=H?.limit||20;await G(B);const[L,Y]=[await Z(B,F),await S(B,F)],$=[...L,...Y].sort((X,Q)=>(Q._ts||0)-(X._ts||0)).slice(0,F);if($.length===0)throw new b("bilibili stats","未取到任何稿件数据。请确认已登录 B站且该账号发布过视频或图文稿件。");return $.map(({_ts:X,...Q})=>Q)}});
@@ -0,0 +1,21 @@
1
+ import{cli as j,Strategy as A}from"@jackwener/opencli/registry";import{AuthRequiredError as V,CommandExecutionError as F,EmptyResultError as q}from"@jackwener/opencli/errors";import{apiGet as G,resolveBvid as I,parsePageArg as P,selectVideoPart as R}from"./utils.js";j({site:"bilibili",name:"subtitle",access:"read",description:"获取 Bilibili 视频的字幕",domain:"www.bilibili.com",strategy:A.COOKIE,args:[{name:"bvid",required:!0,positional:!0,help:"Bilibili 视频 BV ID(如 BV1xx411c7mD),或视频 URL / b23.tv 短链"},{name:"lang",required:!1,help:"字幕语言代码 (如 zh-CN, en-US, ai-zh),默认取第一个"},{name:"page",required:!1,help:"分P 选集序号(从 1 开始)。多 P 视频取该集字幕;缺省取默认 P1"}],columns:["index","from","to","content"],func:async(W,X)=>{if(!W)throw new F("Browser session required for bilibili subtitle");const Z=await I(X.bvid),B=P(X.page);let M;try{M=await G(W,"/x/web-interface/view",{params:{bvid:Z}})}catch(z){throw new F(`获取视频信息失败: ${z?.message||z}`)}if(M?.code!==0)throw new F(`获取视频信息失败: ${M?.message??"unknown"} (${M?.code})`);const D=B!=null?R(M?.data,B).cid:M?.data?.cid;if(!D)throw new F(`无法从 view API 拿到 cid (bvid=${Z})`);let H;try{H=await G(W,"/x/player/wbi/v2",{params:{bvid:Z,cid:D},signed:!0})}catch(z){throw new F(`获取视频播放信息失败: ${z?.message||z}`)}if(!H||typeof H!=="object"||Array.isArray(H))throw new F("获取到的视频播放信息对象不符合预期格式");if(H.code!==0)throw new F(`获取视频播放信息失败: ${H.message} (${H.code})`);const J=H.data?.need_login_subtitle===!0,Q=H.data?.subtitle?.subtitles;if(!Array.isArray(Q))throw new F("获取到的字幕列表对象不符合数组格式");if(Q.length===0){if(J)throw new V("bilibili.com","Bilibili subtitles are hidden behind login for this video. Please log in to bilibili.com in Chrome and retry.");throw new q("bilibili subtitle","此视频没有发现外挂或智能字幕。")}const T=X.lang?Q.find((z)=>z.lan===X.lang)||Q[0]:Q[0];if(!T||typeof T!=="object"||!Object.hasOwn(T,"subtitle_url"))throw new F("字幕条目缺少 subtitle_url 字段");const Y=typeof T.subtitle_url==="string"?T.subtitle_url.trim():"";if(!Y)throw new V("bilibili.com","[风控拦截/未登录] 获取到的 subtitle_url 为空!请确保 CLI 已成功登录且风控未封锁此账号。");const _=Y.startsWith("//")?"https:"+Y:Y;if(!/^https?:\/\//i.test(_))throw new F(`字幕 URL 非法: ${_}`);const N=`
2
+ (async () => {
3
+ const url = ${JSON.stringify(_)};
4
+ const res = await fetch(url);
5
+ const text = await res.text();
6
+
7
+ if (text.startsWith('<!DOCTYPE') || text.startsWith('<html')) {
8
+ return { error: 'HTML', text: text.substring(0, 100), url };
9
+ }
10
+
11
+ try {
12
+ const subJson = JSON.parse(text);
13
+ // B站真实返回格式是 { font_size: 0.4, font_color: "#FFFFFF", background_alpha: 0.5, background_color: "#9C27B0", Stroke: "none", type: "json" , body: [{from: 0, to: 0, content: ""}] }
14
+ if (Array.isArray(subJson?.body)) return { success: true, data: subJson.body };
15
+ if (Array.isArray(subJson)) return { success: true, data: subJson };
16
+ return { error: 'UNKNOWN_JSON', data: subJson };
17
+ } catch (e) {
18
+ return { error: 'PARSE_FAILED', text: text.substring(0, 100) };
19
+ }
20
+ })()
21
+ `;let K;try{K=await W.evaluate(N)}catch(z){throw new F(`字幕获取失败: ${z?.message||z}`)}if(K?.error)throw new F(`字幕获取失败: ${K.error}${K.text?" — "+K.text:""}`);if(!K||typeof K!=="object"||K.success!==!0)throw new F("字幕获取结果对象不符合预期格式");const $=K.data;if(!Array.isArray($))throw new F("解析到的字幕列表对象不符合数组格式");if($.length===0)throw new q("bilibili subtitle","字幕文件中没有字幕片段。");return $.map((z,h)=>{const L=Number(z?.from),O=Number(z?.to);if(!z||typeof z!=="object"||!Number.isFinite(L)||!Number.isFinite(O))throw new F("字幕片段缺少有效 from/to 时间戳");return{index:h+1,from:L.toFixed(2)+"s",to:O.toFixed(2)+"s",content:String(z.content??"")}})}});
@@ -0,0 +1 @@
1
+ import{cli as j,Strategy as q}from"@jackwener/opencli/registry";import{ArgumentError as Y,AuthRequiredError as S,CommandExecutionError as Q,EmptyResultError as V}from"@jackwener/opencli/errors";import{apiGet as F,resolveBvid as D}from"./utils.js";const O=/(^|\.)bilibili\.com$/i,I=/(^|\.)b23\.tv$/i,_=/^BV[A-Za-z0-9]+$/;function $(J){const K=Math.max(0,Math.floor(Number(J)||0)),z=Math.floor(K/3600),N=Math.floor(K%3600/60),U=K%60,W=(X)=>String(X).padStart(2,"0");return z>0?`${z}:${W(N)}:${W(U)}`:`${W(N)}:${W(U)}`}async function G(J){const K=String(J??"").trim();if(!K)throw new Y("bilibili summary bvid cannot be empty","Pass a BV ID, Bilibili video URL, or b23.tv short link.");if(_.test(K))return K;let z=null;try{z=new URL(K)}catch{}if(z){if(z.protocol!=="https:"&&z.protocol!=="http:")throw new Y("Bilibili summary URL must use http or https");if(O.test(z.hostname)){const N=z.pathname.match(/\/(?:video|bangumi\/play)\/(BV[A-Za-z0-9]+)/i);if(!N)throw new Y("Bilibili summary URL must contain a BV video id");return N[1]}if(!I.test(z.hostname))throw new Y("Bilibili summary URL must be a bilibili.com or b23.tv URL")}try{return await D(K)}catch(N){throw new Y(`Cannot resolve Bilibili BV ID from input: ${K}`,N instanceof Error?N.message:String(N))}}function H(J,K){if(!J||typeof J!=="object"||Array.isArray(J))throw new Q(`Bilibili ${K} API returned a malformed payload`);if(J.code!==0){const z=J.message??"unknown error";if(J.code===-101||J.code===-403||/登录|权限|forbidden|permission|login/i.test(String(z)))throw new S("bilibili.com",`Bilibili ${K} API requires login or permission: ${z} (${J.code})`);throw new Q(`Bilibili ${K} API failed: ${z} (${J.code})`)}return J.data}function L(J,K){if(!J||typeof J!=="object"||Array.isArray(J))throw new Q("Bilibili conclusion API returned malformed data");if(J.code!==0)throw new V("bilibili summary",`Bilibili has not generated an AI summary for ${K}.`);let z=J.model_result;if(typeof z==="string")try{z=JSON.parse(z)}catch{throw new Q("Bilibili conclusion API returned malformed model_result JSON")}if(!z||typeof z!=="object"||Array.isArray(z))throw new Q("Bilibili conclusion API returned malformed model_result");const N=String(z.summary??"").trim();if(!N)throw new V("bilibili summary",`Bilibili has not generated an AI summary for ${K}.`);const U=z.outline??[];if(!Array.isArray(U))throw new Q("Bilibili conclusion API returned malformed outline");return{summary:N,outline:U}}function P(J){const K=[{time:"",content:J.summary}];for(const z of J.outline){if(!z||typeof z!=="object"||Array.isArray(z))throw new Q("Bilibili conclusion API returned malformed outline section");const N=String(z.title??"").trim(),U=$(z.timestamp);if(N)K.push({time:U,content:`# ${N}`});const W=z.part_outline??[];if(!Array.isArray(W))throw new Q("Bilibili conclusion API returned malformed part outline");for(const X of W){if(!X||typeof X!=="object"||Array.isArray(X))throw new Q("Bilibili conclusion API returned malformed outline point");const Z=String(X.content??"").trim();if(Z)K.push({time:$(X.timestamp),content:Z})}}return K}var k=j({site:"bilibili",name:"summary",access:"read",description:"获取 B站视频的官方 AI 总结(视频页「AI总结」同款,含分段大纲与时间戳)",domain:"www.bilibili.com",strategy:q.COOKIE,args:[{name:"bvid",required:!0,positional:!0,help:"Video BV ID / URL / b23.tv short link"}],columns:["time","content"],func:async(J,K)=>{if(!J)throw new Q("Browser session required for bilibili summary");const z=await G(K.bvid),N=await F(J,"/x/web-interface/view",{params:{bvid:z}}),U=H(N,"view"),W=U?.cid,X=U?.owner?.mid;if(!W||!X)throw new Q(`Bilibili view API did not return cid/up_mid for ${z}`);const Z=await F(J,"/x/web-interface/view/conclusion/get",{params:{bvid:z,cid:W,up_mid:X},signed:!0}),f=H(Z,"conclusion");return P(L(f,z))}});export const __test__={command:k,formatTime:$,readBvid:G,readModelResult:L,rowsFromModel:P};
@@ -0,0 +1 @@
1
+ import{cli as F,Strategy as G}from"@jackwener/opencli/registry";import{ArgumentError as H,CommandExecutionError as D}from"@jackwener/opencli/errors";async function J(q){for(let v=0;v<6;v++){await q.goto("https://member.bilibili.com/platform/home");await q.wait({time:1});let z="";try{z=String(await q.evaluate("location.href")||"")}catch{z=""}if(/^https?:\/\/member\.bilibili\.com\//.test(z))return}throw new D("无法进入 B站创作中心(可能未登录或被风控)。请先在客户端登录哔哩哔哩。")}F({site:"bilibili",name:"topics",aliases:["topic-list"],access:"read",description:"列出某分区下可参与的投稿话题(topic_id + 名称 + 简介 + 播放量),供 `bilibili upload --topic` 取合法 topic_id。禁止臆造。先用 `bilibili partitions` 取 tid。",domain:"member.bilibili.com",strategy:G.COOKIE,browser:!0,args:[{name:"tid",type:"number",required:!0,help:"分区 id(用 `bilibili partitions` 取)。话题按分区提供。"}],columns:["topic_id","name","play","desc"],func:async(q,v)=>{if(!q)throw new D("B站话题列举需要浏览器会话");if(v.tid==null||v.tid===""||!Number.isFinite(Number(v.tid)))throw new H("必须用 --tid 指定分区 id(数字)。用 `bilibili partitions` 列举分区。");const z=Number(v.tid);await J(q);const B=await q.evaluateWithArgs("(async () => {const r = await fetch('https://member.bilibili.com/x/vupre/web/topic/type?type_id=' + encodeURIComponent(tid) + '&pn=0&ps=200', { credentials: 'include' });const j = await r.json();if (!j || j.code !== 0 || !j.data || !Array.isArray(j.data.topics)) {"+" throw new Error('获取 B站话题失败(可能未登录 B站):' + ((j && j.message) || ('code=' + (j && j.code))));"+'}return j.data.topics.map(function (t) { return { topic_id: t.topic_id, name: t.topic_name || "", play: t.arc_play_vv != null ? t.arc_play_vv : "", desc: (t.description || t.activity_description || "").slice(0, 60), };});})()',{tid:z});if(!Array.isArray(B))throw new D("未取到话题列表(接口返回异常)");if(!B.length)return[];return B}});
@@ -0,0 +1 @@
1
+ import{cli as V,Strategy as Y}from"@jackwener/opencli/registry";import{ArgumentError as Q,CommandExecutionError as W,EmptyResultError as j}from"@jackwener/opencli/errors";import{apiPost as v,fetchJson as C,getSelfUid as F,requireOkPayload as $,resolveUid as U}from"./utils.js";const I=5000,P=500;function L(D){const G=String(D??"").trim();if(!G)return"";const z=/^https?:\/\//i.test(G)?G:`https://${G}`;let B;try{B=new URL(z)}catch{return""}if(B.hostname.toLowerCase()!=="space.bilibili.com")return"";const H=B.pathname.match(/^\/(\d+)\/?$/);return H?H[1]:""}async function J(D,G){const z=String(G??"").trim();if(!z)throw new Q("bilibili unfollow target cannot be empty");if(/^(?:https?:\/\/)?space\.bilibili\.com\//i.test(z)){const B=L(z);if(!B)throw new Q("bilibili unfollow target must be a valid space.bilibili.com/<uid> URL");return B}try{return await U(D,z)}catch(B){if(B instanceof j)throw B;throw new Q(`Cannot resolve Bilibili target from input: ${z}`,B instanceof Error?B.message:String(B))}}async function X(D,G){const z=await C(D,`https://api.bilibili.com/x/relation?fid=${G}`);$(z,"relation query");const B=z?.data?.attribute;if(typeof B!=="number")throw new W("Bilibili relation query returned a malformed attribute");return B}async function q(D,G,z,B){const H=Date.now()+I;let K;while(Date.now()<=H){K=await X(D,G);if(z(K))return K;if(typeof D.wait!=="function")break;await D.wait({time:P/1000})}throw new W(`Bilibili relation modify did not verify ${B}; last attribute=${K}`)}V({site:"bilibili",name:"unfollow",access:"write",description:"取消关注 B站用户(官方 API,需登录)",domain:"www.bilibili.com",strategy:Y.COOKIE,args:[{name:"target",required:!0,positional:!0,help:"目标 UID / 用户名 / space.bilibili.com 链接"}],columns:["mid","name","status","url"],func:async(D,G)=>{if(!D)throw new W("Browser session required for bilibili unfollow");const z=await J(D,G.target),B=await F(D);if(z===B)throw new Q("Cannot unfollow yourself");const H=await X(D,z),K=`https://space.bilibili.com/${z}`;if(H!==2&&H!==6)return[{mid:z,name:"",status:"not-following",url:K}];const N=await v(D,"/x/relation/modify",{params:{fid:z,act:2,re_src:11}});$(N,"relation modify");await q(D,z,(Z)=>Z!==2&&Z!==6,"not following");return[{mid:z,name:"",status:"unfollowed",url:K}]}});export const __test__={resolveTargetMid:J,fetchRelationAttribute:X,waitForRelation:q};
@@ -0,0 +1 @@
1
+ import*as I from"node:fs";import*as P from"node:path";import{cli as E,Strategy as b}from"@jackwener/opencli/registry";import{ArgumentError as D,AuthRequiredError as h,CommandExecutionError as S}from"@jackwener/opencli/errors";import{resolveVideoFile as l,resolveImageFile as u,throwIfFileAccessDenied as w}from"../_shared/video-publish.js";const U={bda2:{os:"upos",upcdn:"bda2",probe_version:20221109},bldsa:{os:"upos",upcdn:"bldsa",probe_version:20221109},qn:{os:"upos",upcdn:"qn",probe_version:20221109},ws:{os:"upos",upcdn:"ws",probe_version:20221109}},f="bda2",k=["SESSDATA","bili_jct","DedeUserID"],m="https://member.bilibili.com/platform/home",_="__pp_bili_video_input";function n(W){var J=document.getElementById(W.inputId);if(!J||!J.files||!J.files[0])return{error:"文件未就绪(input 为空)"};var Z=J.files[0],Y=Z.size,$=W.line;return async function(){try{var G=new URLSearchParams({profile:"ugcfx/bup",name:Z.name,size:String(Y),r:$.os,ssl:"0",version:"2.14.0",build:"2100400",upcdn:$.upcdn,probe_version:String($.probe_version)}),X=await(await fetch("https://member.bilibili.com/preupload?"+G.toString(),{credentials:"include",headers:{Referer:"https://www.bilibili.com"}})).json();if(X.OK!==1)return{error:"preupload 失败:"+JSON.stringify(X)};var K="https:"+X.endpoint+"/"+String(X.upos_uri).replace(/^upos:\/\//,""),O=new URLSearchParams({uploads:"",output:"json",profile:"ugcfx/bup",filesize:String(Y),partsize:String(X.chunk_size),biz_id:String(X.biz_id)}),H=await(await fetch(K+"?"+O.toString(),{method:"POST",headers:{"x-upos-auth":X.auth}})).json();if(H.OK!==1)return{error:"获取 upload_id 失败:"+JSON.stringify(H)};var T=Math.max(1,Math.ceil(Y/X.chunk_size));return{url:K,auth:X.auth,uploadId:H.upload_id,chunkSize:X.chunk_size,bizId:X.biz_id,size:Y,name:Z.name,total:T}}catch(R){return{error:"preupload 异常:"+String(R&&R.message||R)}}}()}function d(W){var J=document.getElementById(W.inputId);if(!J||!J.files||!J.files[0])return{ok:!1,error:"文件丢失(页面可能已导航)"};var Z=J.files[0],Y=W.idx*W.chunkSize,$=Z.slice(Y,Math.min(Y+W.chunkSize,W.size)),G=$.size,X=new URLSearchParams({partNumber:String(W.idx+1),uploadId:String(W.uploadId),chunk:String(W.idx),chunks:String(W.total),size:String(G),start:String(Y),end:String(Y+G),total:String(W.size)});return async function(){for(var K=0;K<5;K++){try{var O=await fetch(W.url+"?"+X.toString(),{method:"PUT",headers:{"x-upos-auth":W.auth},body:$});if(O.status<400){var H=await O.text();if(H==="MULTIPART_PUT_SUCCESS"||H==="")return{ok:!0}}}catch(T){}await new Promise(function(T){setTimeout(T,800*(K+1))})}return{ok:!1,error:"分块 "+W.idx+" 多次重试仍失败"}}()}function j(W){var J=[];for(var Z=1;Z<=W.total;Z++)J.push({partNumber:Z,eTag:"etag"});var Y=new URLSearchParams({output:"json",name:W.name,profile:"ugcfx/bup",uploadId:String(W.uploadId),biz_id:String(W.bizId)});return async function(){try{var $=await(await fetch(W.url+"?"+Y.toString(),{method:"POST",headers:{"x-upos-auth":W.auth,"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({parts:J})})).json();if($.OK!==1)return{error:"complete 失败:"+JSON.stringify($)};var G=String($.key).replace(/^\//,"").replace(/\.[^.]+$/,"");return{filename:G,cid:W.bizId}}catch(X){return{error:"complete 异常:"+String(X&&X.message||X)}}}()}function c(W){return async function(){try{var J=await fetch("https://member.bilibili.com/x/vupre/web/topic/type?type_id="+encodeURIComponent(W.tid)+"&pn=0&ps=200",{credentials:"include"}),Z=await J.json();if(!Z||Z.code!==0||!Z.data||!Array.isArray(Z.data.topics))return{error:"获取话题列表失败:"+(Z&&Z.message||"code="+(Z&&Z.code))};var Y=null;for(var $=0;$<Z.data.topics.length;$++)if(Number(Z.data.topics[$].topic_id)===Number(W.topicId)){Y=Z.data.topics[$];break}if(!Y)return{error:"topic_id "+W.topicId+" 不在分区 "+W.tid+" 的可用话题里(用 bilibili topics --tid "+W.tid+" 查合法值)"};return{topicId:Number(Y.topic_id),missionId:Y.mission_id!=null?Number(Y.mission_id):null,name:Y.topic_name||""}}catch(G){return{error:"解析话题异常:"+String(G&&G.message||G)}}}()}function o(W){return async function(){var J=document.cookie.match(/(?:^|;\s*)bili_jct=([^;]+)/);if(!J)return{error:"未找到 bili_jct CSRF token"};var Z=decodeURIComponent(J[1]);try{var Y=W.dataUri;if(typeof Y==="string"&&Y.indexOf("data:image/webp")===0){var $=Y.indexOf(",");if($===-1)return{error:"封面 data URI 格式非法"};var G=Y.slice(5,$),X=Y.slice($+1),K;if(G.indexOf("base64")!==-1){var O=atob(X);K=new Uint8Array(O.length);for(var H=0;H<O.length;H++)K[H]=O.charCodeAt(H)}else K=new TextEncoder().encode(decodeURIComponent(X));var T=new Blob([K],{type:"image/webp"}),R=await createImageBitmap(T),B=document.createElement("canvas");B.width=R.width;B.height=R.height;var M=B.getContext("2d");M.fillStyle="#ffffff";M.fillRect(0,0,B.width,B.height);M.drawImage(R,0,0);var q=await new Promise(function(F){B.toBlob(F,"image/jpeg",0.92)});if(!q)return{error:"封面 webp 转码 JPEG 失败"};Y=await new Promise(function(F,x){var A=new FileReader;A.onload=function(){F(String(A.result))};A.onerror=function(){x(Error("FileReader 读取转码结果失败"))};A.readAsDataURL(q)})}var L=new URLSearchParams;L.append("cover",Y);L.append("csrf",Z);var V=await(await fetch("https://member.bilibili.com/x/vu/web/cover/up",{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:L.toString()})).json();if(!V||V.code!==0||!V.data||!V.data.url)return{error:"封面上传失败:"+(V&&V.message?V.message:JSON.stringify(V))};return{url:V.data.url}}catch(F){return{error:"封面上传异常:"+String(F&&F.message||F)}}}()}function p(W){return async function(){var J=document.cookie.match(/(?:^|;\s*)bili_jct=([^;]+)/);if(!J)return{error:"未找到 bili_jct CSRF token"};var Z=decodeURIComponent(J[1]),Y=W.meta;for(var $ in Y)if(Y[$]===null||Y[$]===void 0)delete Y[$];Y.csrf=Z;try{var G=await fetch("https://member.bilibili.com/x/vu/web/add/v3?csrf="+encodeURIComponent(Z)+"&t="+Date.now(),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(Y)}),X=await G.json();if(!X||X.code!==0)return{error:"add/v3 提交失败:"+(X&&X.message?X.message:"")+"(code="+(X&&X.code)+" status="+G.status+")"};return{bvid:X.data&&X.data.bvid,aid:X.data&&X.data.aid}}catch(K){return{error:"add/v3 异常:"+String(K&&K.message||K)}}}()}function g(W){return async function(){var J=document.cookie.match(/(?:^|;\s*)bili_jct=([^;]+)/);if(!J)return{error:"未找到 bili_jct CSRF token"};var Z=decodeURIComponent(J[1]),Y=W.body;Y.csrf=Z;try{var $=await fetch("https://member.bilibili.com/x/vupre/web/draft/add?t="+Date.now()+"&csrf="+encodeURIComponent(Z),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(Y)}),G=await $.json();if(!G||G.code!==0)return{error:"draft/add 保存草稿失败:"+(G&&G.message?G.message:"")+"(code="+(G&&G.code)+" status="+$.status+")"};return{data:G.data}}catch(X){return{error:"draft/add 异常:"+String(X&&X.message||X)}}}()}const N=(W,J,Z)=>W.evaluateWithArgs(`(${J.toString()})(a)`,{a:Z});function s(W){const J=u(W),Z=P.extname(J).toLowerCase(),Y=Z===".png"?"image/png":Z===".webp"?"image/webp":Z===".bmp"?"image/bmp":"image/jpeg",$=I.readFileSync(J).toString("base64");return`data:${Y};base64,${$}`}async function t(W){for(let J=0;J<8;J++){await W.goto(m);await W.wait({time:1});let Z="";try{Z=String(await W.evaluate("location.href")||"")}catch{Z=""}if(/^https?:\/\/member\.bilibili\.com\//.test(Z)){const Y=await W.getCookies({url:"https://member.bilibili.com"}),$=new Map;for(const X of Array.isArray(Y)?Y:[])if(X&&typeof X.name==="string")$.set(X.name,String(X.value??""));const G=k.filter((X)=>!$.get(X));if(!G.length)return $;throw new h("member.bilibili.com",`缺少 B站登录 cookie(${G.join(", ")})。请先在客户端登录哔哩哔哩。`)}}throw new h("member.bilibili.com","无法进入 B站创作中心(可能未登录或被风控)。请先在客户端登录哔哩哔哩。")}E({site:"bilibili",name:"upload",access:"write",description:"投稿视频到 B站(在真实浏览器登录态里走 web 投稿:preupload→upos 分块→add/v3)。默认仅 dry-run 校验,加 --execute 才真正上传并提交。",domain:"member.bilibili.com",strategy:b.COOKIE,browser:!0,args:[{name:"file",required:!0,positional:!0,help:"视频文件路径"},{name:"title",help:"稿件标题(默认取文件名)"},{name:"tid",type:"number",required:!0,help:"分区 id(B站 typeid,必填,禁止臆造)。合法值用 `bilibili partitions` 列举后取。"},{name:"tag",required:!0,help:"标签,逗号分隔(B站要求至少 1 个)"},{name:"desc",help:"简介"},{name:"topic",type:"number",help:"参与话题的 topic_id(重要流量入口)。合法值用 `bilibili topics --tid <tid>` 列举,禁止臆造;mission_id 自动匹配。"},{name:"cover",help:"封面图片路径(不传由 B站自动截取)"},{name:"copyright",type:"number",help:"1=自制 2=转载(默认 1)"},{name:"source",help:"转载来源 URL(copyright=2 时必填)"},{name:"dynamic",help:"同步发布的动态文案(可空)"},{name:"no-reprint",type:"boolean",help:"禁止转载(默认允许)"},{name:"dtime",type:"number",help:"定时发布的 10 位 unix 时间戳(可空=立即)"},{name:"line",help:`上传线路:${Object.keys(U).join("/")}(默认 ${f})`},{name:"concurrency",type:"number",help:"分块并发数(默认 3)"},{name:"draft",type:"boolean",help:"存草稿而非直接发布(上传视频后存到创作中心草稿箱,不公开)"},{name:"execute",type:"boolean",help:"真正发布投稿;不带(也不带 --draft)则只做 dry-run 校验"}],columns:["status","title","bvid","url"],func:async(W,J)=>{if(!W)throw new S("bilibili upload 需要浏览器会话");const Z=l(String(J.file??"")),Y=String(J.title??"").trim()||P.basename(Z).replace(/\.[^.]+$/,""),$=String(J.tag??"").split(",").map((Q)=>Q.trim()).filter(Boolean);if(!$.length)throw new D("B站投稿至少需要 1 个标签,用 --tag 传(逗号分隔)");if(J.tid==null||J.tid===""||!Number.isFinite(Number(J.tid)))throw new D("必须用 --tid 指定分区 id(数字)。合法值用 `bilibili partitions` 列举,禁止臆造。");const G=Number(J.tid),X=J.copyright!=null&&J.copyright!==""?Number(J.copyright):1;if(X!==1&&X!==2)throw new D("--copyright 只能是 1(自制) 或 2(转载)");const K=String(J.source??"").trim();if(X===2&&!K)throw new D("转载(copyright=2)必须用 --source 提供转载来源");if(J.cover)u(String(J.cover));const O=String(J.line??f),H=U[O];if(!H)throw new D(`未知上传线路「${O}」,可选:${Object.keys(U).join("/")}`);const T=J.concurrency!=null&&J.concurrency!==""?Number(J.concurrency):3,R=Boolean(J.draft),B=Boolean(J.execute)&&!R;await t(W);if(!W.setFileInput)throw new S("浏览器扩展不支持 CDP 文件上传(set-file-input),无法上传视频;请升级 PublishPort 客户端/扩展");await W.evaluate(`(() => { var id=${JSON.stringify(_)}; var el=document.getElementById(id); if(!el){ el=document.createElement('input'); el.type='file'; el.id=id; el.style.cssText='position:fixed;left:-9999px;top:0;'; document.body.appendChild(el);} el.value=''; return true; })()`);try{await W.setFileInput([Z],`#${_}`)}catch(Q){w(Q);throw Q}if(!R&&!B)return{status:"dry-run",title:Y,bvid:"",url:`校验通过:登录态有效、视频已注入就绪、分区 ${G}、标签 [${$.join(", ")}]、版权 ${X===1?"自制":"转载"}。加 --execute 发布,或 --draft 存草稿。`};const M=await N(W,n,{inputId:_,line:H});if(!M||M.error)throw new S(`B站 preupload 失败:${M&&M.error||"无返回"}`);for(let Q=0;Q<M.total;Q++){const z=await N(W,d,{inputId:_,url:M.url,auth:M.auth,uploadId:M.uploadId,idx:Q,total:M.total,size:M.size,chunkSize:M.chunkSize});if(!z||!z.ok)throw new S(`B站分块上传失败(${Q+1}/${M.total}):${z&&z.error||"无返回"}`)}const q=await N(W,j,{url:M.url,auth:M.auth,uploadId:M.uploadId,bizId:M.bizId,name:M.name,total:M.total});if(!q||q.error||!q.filename)throw new S(`B站 complete 失败:${q&&q.error||"未拿到 filename"}`);let L="";if(J.cover){const Q=s(String(J.cover)),z=await N(W,o,{dataUri:Q});if(!z||z.error||!z.url)throw new S(`B站封面上传失败:${z&&z.error||"未拿到 url"}`);L=z.url}let V=null,F=null;if(J.topic!=null&&J.topic!==""){if(!Number.isFinite(Number(J.topic)))throw new D("--topic 必须是 topic_id 数字,用 `bilibili topics --tid <tid>` 取合法值");const Q=await N(W,c,{tid:G,topicId:Number(J.topic)});if(!Q||Q.error)throw new S(`B站话题解析失败:${Q&&Q.error||"无返回"}`);V=Q.topicId;F=Q.missionId}if(R){const Q={videos:[{filename:q.filename,title:Y,desc:"",cid:q.cid,is_4k:!1,is_8k:!1,is_hdr:!1}],cover:L,cover43:L,ai_cover:0,is_ab_cover:0,ab_cover_info:null,title:Y,copyright:X,tid:G,tag:$.join(","),desc:String(J.desc??""),recreate:-1,dynamic:String(J.dynamic??""),is_only_self:0,space_hidden:2,watermark:{state:0},no_reprint:J["no-reprint"]?1:0,subtitle:{open:0,lan:""},dolby:0,lossless_music:0,up_selection_reply:!1,up_close_reply:!1,up_close_danmu:!1};if(X===2)Q.source=K;if(V!=null){Q.topic_id=V;Q.topic_detail={from_topic_id:V,from_source:"arc.web.search"};if(F!=null)Q.mission_id=F}const z=await N(W,g,{body:Q});if(!z||z.error)throw new S(`B站 ${z&&z.error||"draft/add 无返回"}`);const y=z.data&&(z.data.aid!=null?z.data.aid:z.data.draft_id!=null?z.data.draft_id:z.data.id);return{status:"✅ 草稿已保存",title:Y,bvid:y!=null?`draft:${y}`:"",url:"https://member.bilibili.com/platform/upload-manager/article?group=draft"}}const x=J.dtime!=null&&J.dtime!==""?Number(J.dtime):null,A={title:Y,copyright:X,tid:G,tag:$.join(","),mission_id:F,topic_id:V,topic_detail:V!=null?{from_topic_id:V,from_source:"arc.web.recommend"}:null,desc_format_id:9999,desc:String(J.desc??""),dtime:x,recreate:-1,dynamic:String(J.dynamic??""),interactive:0,act_reserve_create:0,no_disturbance:0,porder:null,adorder_type:9,no_reprint:J["no-reprint"]?1:0,subtitle:{open:0,lan:""},neutral_mark:null,dolby:0,lossless_music:0,up_selection_reply:!1,up_close_reply:!1,up_close_danmu:!1,web_os:1,source:X===2?K:null,watermark:{state:0},cover:L,videos:[{title:Y,desc:"",filename:q.filename,cid:q.cid}]},C=await N(W,p,{meta:A});if(!C||C.error)throw new S(`B站 ${C&&C.error||"add/v3 无返回"}`);const v=C.bvid?String(C.bvid):"";return{status:J.dtime?"✅ 定时投稿已提交":"✅ 投稿成功",title:Y,bvid:v,url:v?`https://www.bilibili.com/video/${v}`:"(已提交,稍后在创作中心查看)"}}});
@@ -0,0 +1 @@
1
+ import{cli as u,Strategy as o}from"@jackwener/opencli/registry";import{apiGet as c,payloadData as m,resolveUid as b}from"./utils.js";u({site:"bilibili",name:"user-videos",access:"read",description:"查看指定用户的投稿视频",domain:"www.bilibili.com",strategy:o.COOKIE,args:[{name:"uid",required:!0,positional:!0,help:"User UID or username"},{name:"limit",type:"int",default:20,help:"Number of results"},{name:"order",default:"pubdate",help:"Sort: pubdate, click, stow"},{name:"page",type:"int",default:1,help:"Page number"}],columns:["rank","title","plays","likes","date","url"],func:async(i,a)=>{const{uid:r,limit:t=20,order:l="pubdate",page:s=1}=a,d=await b(i,String(r)),n=await c(i,"/x/space/wbi/arc/search",{params:{mid:d,pn:s,ps:Math.min(Number(t),50),order:l},signed:!0});return(m(n)?.list?.vlist??[]).slice(0,Number(t)).map((e,p)=>({rank:p+1,title:e.title??"",plays:e.play??0,likes:e.like??0,date:e.created?new Date(e.created*1000).toISOString().slice(0,10):"",url:e.bvid?`https://www.bilibili.com/video/${e.bvid}`:""}))}});
@@ -0,0 +1,50 @@
1
+ import B from"node:https";import{ArgumentError as G,AuthRequiredError as L,CommandExecutionError as W,EmptyResultError as _}from"@jackwener/opencli/errors";export function resolveBvid(z){const F=String(z).trim();if(/^BV[A-Za-z0-9]+$/i.test(F))return Promise.resolve(F);try{const Z=new URL(F);if(/(\.|^)bilibili\.com$/i.test(Z.hostname)){const V=Z.pathname.match(/\/(?:video|bangumi\/play)\/(BV[A-Za-z0-9]+)/i);if(V)return Promise.resolve(V[1])}}catch{}const Q=F.replace(/^https?:\/\//,"").replace(/^(www\.)?b23\.tv\//,"");if(!/^[A-Za-z0-9]+$/.test(Q))return Promise.reject(Error(`Cannot resolve BV ID from invalid b23.tv short code: ${F}`));const $="https://b23.tv/"+Q;return new Promise((Z,V)=>{const H=B.get($,(O)=>{const T=O.headers.location;if(T){const X=T.match(/\/video\/(BV[A-Za-z0-9]+)/);if(X){O.resume();Z(X[1]);return}}O.resume();V(Error(`Cannot resolve BV ID from short URL: ${F}`))});H.on("error",V);H.setTimeout(4000,()=>{H.destroy();V(Error(`Timeout resolving short URL: ${F}`))})})}export function parsePageArg(z){if(z==null||z==="")return null;if(typeof z==="number"){if(Number.isSafeInteger(z)&&z>=1)return z;throw new G(`--page must be a positive decimal integer, got: ${z}`)}if(typeof z!=="string"||!/^[1-9]\d*$/.test(z))throw new G(`--page must be a positive decimal integer, got: ${String(z)}`);const F=Number(z);if(!Number.isSafeInteger(F))throw new G(`--page is too large: ${z}`);return F}function M(z,F){if(typeof z==="number"&&Number.isSafeInteger(z)&&z>=1)return z;if(typeof z==="string"&&/^[1-9]\d*$/.test(z)){const Q=Number(z);if(Number.isSafeInteger(Q))return Q}throw new W(`Bilibili view API returned a malformed ${F}`)}export function selectVideoPart(z,F){const Q=Array.isArray(z?.pages)?z.pages:null;if(!Q||Q.length===0)throw new W("Bilibili view API did not return pages[] for --page selection");const $=[];for(const V of Q){if(!V||typeof V!=="object"||Array.isArray(V))throw new W("Bilibili view API returned a malformed pages[] entry");if(M(V.page,"page number")===F)$.push(V)}if($.length>1)throw new W(`Bilibili view API returned duplicate page entries for p=${F}`);const Z=$[0];if(!Z){const V=Q.length||z?.videos||1;throw new W(`分P 序号超出范围:p=${F}(该视频共 ${V} 集)`)}M(Z.cid,`cid for p=${F}`);return Z}const R=[46,47,18,2,53,8,23,32,15,50,10,31,58,3,45,35,27,43,5,49,33,9,42,19,29,28,14,39,12,38,41,13,37,48,7,16,24,55,40,61,26,17,0,1,60,51,30,4,22,25,54,21,56,59,6,63,57,62,11,36,20,34,44,52];export function stripHtml(z){return z.replace(/<[^>]+>/g,"").replace(/&[a-z]+;/gi," ").trim()}export function payloadData(z){return z?.data??z}async function S(z){return z.evaluate(`
2
+ async () => {
3
+ const res = await fetch('https://api.bilibili.com/x/web-interface/nav', { credentials: 'include' });
4
+ return await res.json();
5
+ }
6
+ `)}async function f(z){const Q=(await S(z))?.data?.wbi_img??{},$=Q.img_url??"",Z=Q.sub_url??"",V=$.split("/").pop()?.split(".")[0]??"",H=Z.split("/").pop()?.split(".")[0]??"";return{imgKey:V,subKey:H}}function J(z,F){const Q=z+F;return R.map(($)=>Q[$]||"").join("").slice(0,32)}async function P(z){const{createHash:F}=await import("node:crypto");return F("md5").update(z).digest("hex")}export async function wbiSign(z,F){const{imgKey:Q,subKey:$}=await f(z),Z=J(Q,$),V=Math.floor(Date.now()/1000),H={},O={...F,wts:String(V)};for(const Y of Object.keys(O).sort())H[Y]=String(O[Y]).replace(/[!'()*]/g,"");const T=new URLSearchParams(H).toString().replace(/\+/g,"%20"),X=await P(T+Z);H.w_rid=X;return H}export async function apiGet(z,F,Q={}){const $="https://api.bilibili.com";let Z=Q.params??{};if(Q.signed)Z=await wbiSign(z,Z);const V=new URLSearchParams(Object.fromEntries(Object.entries(Z).map(([O,T])=>[O,String(T)]))).toString().replace(/\+/g,"%20"),H=`${$}${F}?${V}`;return fetchJson(z,H)}export async function fetchJson(z,F){const Q=JSON.stringify(F);return z.evaluate(`
7
+ async () => {
8
+ const res = await fetch(${Q}, { credentials: "include" });
9
+ return await res.json();
10
+ }
11
+ `)}export function isAuthLikeBilibiliError(z,F){return z===-101||z===-111||z===-403||/csrf|登录|账号|权限|forbidden|permission|login/i.test(String(F??""))}export function requireOkPayload(z,F){if(!z||typeof z!=="object"||Array.isArray(z)||!Object.hasOwn(z,"code"))throw new W(`Bilibili ${F} API returned a malformed payload`);if(z.code!==0){const Q=z.message??"unknown error";if(isAuthLikeBilibiliError(z.code,Q))throw new L("bilibili.com",`Bilibili ${F} API requires login or permission: ${Q} (${z.code})`);throw new W(`Bilibili ${F} API failed: ${Q} (${z.code})`)}return z.data}export async function apiPost(z,F,Q={}){const $=Q.params??{},Z=Object.fromEntries(Object.entries($).map(([O,T])=>[O,String(T)])),V=JSON.stringify(Z),H=JSON.stringify(`https://api.bilibili.com${F}`);return z.evaluate(`
12
+ async () => {
13
+ const csrf = (document.cookie.match(/bili_jct=([^;]+)/) || [])[1] || "";
14
+ const body = new URLSearchParams(${V});
15
+ body.set("csrf", csrf);
16
+ const res = await fetch(${H}, {
17
+ method: "POST",
18
+ credentials: "include",
19
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
20
+ body: body.toString(),
21
+ });
22
+ // Bilibili write endpoints can return an HTML risk-control page (e.g. HTTP 412)
23
+ // instead of JSON. Surface that as a structured error rather than a parse crash.
24
+ const text = await res.text();
25
+ try {
26
+ return JSON.parse(text);
27
+ } catch {
28
+ return { code: -1, message: "Non-JSON response (HTTP " + res.status + "): " + text.slice(0, 200) };
29
+ }
30
+ }
31
+ `)}export async function apiPostAbs(z,F,Q={}){const $=Q.params??{},Z=Object.fromEntries(Object.entries($).map(([T,X])=>[T,String(X)])),V=JSON.stringify(Z);let H=F;if(Q.query&&Object.keys(Q.query).length>0){const T=new URLSearchParams(Object.fromEntries(Object.entries(Q.query).map(([X,Y])=>[X,String(Y)]))).toString().replace(/\+/g,"%20");H=`${F}?${T}`}const O=JSON.stringify(H);return z.evaluate(`
32
+ async () => {
33
+ const csrf = (document.cookie.match(/bili_jct=([^;]+)/) || [])[1] || "";
34
+ const body = new URLSearchParams(${V});
35
+ body.set("csrf", csrf);
36
+ body.set("csrf_token", csrf);
37
+ const res = await fetch(${O}, {
38
+ method: "POST",
39
+ credentials: "include",
40
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
41
+ body: body.toString(),
42
+ });
43
+ const text = await res.text();
44
+ try {
45
+ return JSON.parse(text);
46
+ } catch {
47
+ return { code: -1, message: "Non-JSON response (HTTP " + res.status + "): " + text.slice(0, 200) };
48
+ }
49
+ }
50
+ `)}export async function resolveVideoIds(z,F){let Q;try{Q=await resolveBvid(F)}catch(H){throw new G(`Cannot resolve Bilibili BV ID from input: ${String(F??"")}`,H instanceof Error?H.message:String(H))}const $=await apiGet(z,"/x/web-interface/view",{params:{bvid:Q}}),V=requireOkPayload($,"view")?.aid;if(!V)throw new W(`Cannot resolve aid for bvid: ${Q}`);return{bvid:Q,aid:Number(V)}}export async function getSelfUid(z){const Q=(await S(z))?.data?.mid;if(!Q)throw new L("bilibili.com");return String(Q)}export async function resolveUid(z,F){if(/^\d+$/.test(F))return F;const Q=await apiGet(z,"/x/web-interface/wbi/search/type",{params:{search_type:"bili_user",keyword:F},signed:!0});if(!Q||typeof Q!=="object"||Array.isArray(Q)||!Q.data||typeof Q.data!=="object"||Array.isArray(Q.data)||!Object.hasOwn(Q.data,"result"))throw new W(`Bilibili user search returned malformed result for ${F}`);const $=Q.data.result;if(!Array.isArray($))throw new W(`Bilibili user search returned malformed result for ${F}`);if($.length>0){const Z=String($[0]?.mid??"").trim();if(!Z)throw new W(`Bilibili user search returned malformed mid for ${F}`);return Z}throw new _(`bilibili user search: ${F}`,"User may not exist or username may have changed.")}
@@ -0,0 +1 @@
1
+ import{cli as B,Strategy as D}from"@jackwener/opencli/registry";import{CommandExecutionError as A}from"@jackwener/opencli/errors";async function F(q){for(let v=0;v<6;v++){await q.goto("https://member.bilibili.com/platform/upload-manager/article?group=draft");await q.wait({time:1});let z="";try{z=String(await q.evaluate("location.href")||"")}catch{z=""}if(/^https?:\/\/member\.bilibili\.com\//.test(z))return}throw new A("无法进入 B站创作中心(可能未登录或被风控)。请先在客户端登录哔哩哔哩。")}B({site:"bilibili",name:"video-drafts",aliases:["upload-drafts"],access:"read",description:"列出 B站视频投稿草稿箱里的草稿(id + 标题 + 时长 + 修改时间),供确认 `bilibili upload --draft` 结果。(专栏草稿见 `bilibili drafts`)",domain:"member.bilibili.com",strategy:D.COOKIE,browser:!0,columns:["id","title","duration","mtime","cid"],func:async(q)=>{if(!q)throw new A("B站视频草稿列举需要浏览器会话");await F(q);const v=await q.evaluate("(async () => {const r = await fetch('https://member.bilibili.com/x/vupre/web/draft/list', { credentials: 'include' });const j = await r.json();if (!j || j.code !== 0) {"+" throw new Error('获取 B站视频草稿失败(可能未登录 B站):' + ((j && j.message) || ('code=' + (j && j.code))));"+'}const arr = Array.isArray(j.data) ? j.data : (j.data && Array.isArray(j.data.drafts) ? j.data.drafts : []);return arr.map(function (d) { return { id: d.id, title: d.title || "", duration: d.duration != null ? d.duration : "", mtime: d.mtime != null ? d.mtime : "", cid: d.cid != null ? d.cid : "", };});})()');if(!Array.isArray(v))throw new A("未取到视频草稿列表(接口返回异常)");return v}});
@@ -0,0 +1 @@
1
+ import{cli as C,Strategy as h}from"@jackwener/opencli/registry";import{CommandExecutionError as Q}from"@jackwener/opencli/errors";import{apiGet as O,resolveBvid as E,parsePageArg as P,selectVideoPart as m}from"./utils.js";function $(f,H){if(!f||typeof f!=="object"||Array.isArray(f))throw new Q(`${H} returned a malformed payload`);return f}function y(f){if(f&&typeof f==="object"&&typeof f.session==="string"&&Object.hasOwn(f,"data"))return f.data;return f}function K(f,H){if(f==null)return!1;if(typeof f==="boolean")return f;if(typeof f==="number")return f!==0;throw new Q(`${H} returned a malformed flag`)}function b(f,H){if(f==null)return"";if(typeof f==="string")return f;throw new Q(`${H} returned a malformed string`)}C({site:"bilibili",name:"video",access:"read",description:"Get Bilibili video metadata (title, author, duration, stats, etc.)",strategy:h.COOKIE,args:[{name:"bvid",required:!0,positional:!0,help:"BV ID, video URL, or b23.tv short link"},{name:"page",required:!1,help:"分P 选集序号(从 1 开始)。多 P 视频指定某一集,title/cid 返回该集;缺省取整集默认(P1)"}],columns:["field","value"],func:async(f,H)=>{if(!f)throw new Q("Browser session required for bilibili video");const L=P(H.page),G=String(H.bvid??"").trim(),R=G.match(/bilibili\.com\/(?:video|bangumi\/play)\/(BV[A-Za-z0-9]+)/i),V=R?R[1]:await E(G);await f.goto(`https://www.bilibili.com/video/${V}/`);const N=y(await O(f,"/x/web-interface/view",{params:{bvid:V}}));$(N,"Bilibili view API");if(N.code!==0)throw new Q(`Bilibili view API failed: ${N.message} (${N.code})`);const z=$(N.data,"Bilibili view API data"),I=z.stat||{},Z=z.owner||{},W=$(z.rights,"Bilibili view API data.rights"),S=K(W.pay,"Bilibili rights.pay"),T=K(W.ugc_pay,"Bilibili rights.ugc_pay"),q=K(W.arc_pay,"Bilibili rights.arc_pay"),D=K(z.is_upower_exclusive,"Bilibili is_upower_exclusive"),_=S?"vip":T||q?"ugc_pay":D?"upower":"",U=K(W.ugc_pay_preview,"Bilibili rights.ugc_pay_preview")||K(z.is_upower_preview,"Bilibili is_upower_preview"),j=b(z.redirect_url,"Bilibili redirect_url"),k=z.pubdate?new Date(z.pubdate*1000).toISOString().slice(0,16).replace("T"," "):"";let A=z.title??"",B="",M=z.duration||0;if(L!=null){const J=m(z,L);B=String(J.cid??"");A=(typeof J.part==="string"?J.part.trim():"")||`${z.title??""} P${L}`;if(Number.isFinite(Number(J.duration))&&Number(J.duration)>0)M=Number(J.duration)}const X=M||0,x=Math.floor(X/60),F=X%60,Y=[{field:"bvid",value:z.bvid??""},{field:"aid",value:String(z.aid??"")},{field:"title",value:A},{field:"author",value:Z.name?`${Z.name} (mid: ${Z.mid})`:""},{field:"category",value:z.tname_v2||z.tname||""},{field:"publish_time",value:k},{field:"duration",value:X?`${x}m${F}s (${X}s)`:""},{field:"view",value:String(I.view??"")},{field:"danmaku",value:String(I.danmaku??"")},{field:"reply",value:String(I.reply??"")},{field:"like",value:String(I.like??"")},{field:"coin",value:String(I.coin??"")},{field:"favorite",value:String(I.favorite??"")},{field:"share",value:String(I.share??"")},{field:"parts",value:String(z.videos??1)},{field:"thumbnail",value:z.pic??""},{field:"description",value:z.desc??""},{field:"requires_payment",value:String(!!_)},{field:"payment_type",value:_},{field:"pay_preview",value:String(U)},{field:"redirect_url",value:j}];if(L!=null){Y.push({field:"page",value:String(L)});Y.push({field:"cid",value:B});Y.push({field:"series_title",value:z.title??""})}return Y}});
@@ -0,0 +1 @@
1
+ import{cli as i,Strategy as e}from"@jackwener/opencli/registry";i({site:"binance",name:"asks",access:"read",description:"Order book ask prices for a trading pair",domain:"data-api.binance.vision",strategy:e.PUBLIC,browser:!1,args:[{name:"symbol",type:"str",required:!0,positional:!0,help:"Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"},{name:"limit",type:"int",default:10,help:"Number of price levels (5, 10, 20, 50, 100)"}],columns:["rank","ask_price","ask_qty"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/depth?symbol=${{ args.symbol }}&limit=${{ args.limit }}"}},{select:"asks"},{map:{rank:"${{ index + 1 }}",ask_price:"${{ item.0 }}",ask_qty:"${{ item.1 }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as i,Strategy as e}from"@jackwener/opencli/registry";i({site:"binance",name:"depth",access:"read",description:"Order book bid and ask prices for a trading pair",domain:"data-api.binance.vision",strategy:e.PUBLIC,browser:!1,args:[{name:"symbol",type:"str",required:!0,positional:!0,help:"Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"},{name:"limit",type:"int",default:10,help:"Number of price levels (5, 10, 20, 50, 100)"}],columns:["rank","bid_price","bid_qty","ask_price","ask_qty"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/depth?symbol=${{ args.symbol }}&limit=${{ args.limit }}"}},{map:{select:"bids",rank:"${{ index + 1 }}",bid_price:"${{ item[0] }}",bid_qty:"${{ item[1] }}",ask_price:'${{ root.asks[index]?.[0] ?? "" }}',ask_qty:'${{ root.asks[index]?.[1] ?? "" }}'}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"gainers",access:"read",description:"Top gaining trading pairs by 24h price change",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:10,help:"Number of trading pairs"}],columns:["rank","symbol","price","change_24h","volume"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/ticker/24hr"}},{filter:"item.priceChangePercent"},{map:{symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_24h:"${{ item.priceChangePercent }}",volume:"${{ item.quoteVolume }}",sort_change:"${{ Number(item.priceChangePercent) }}"}},{sort:{by:"sort_change",order:"desc"}},{map:{rank:"${{ index + 1 }}",symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_24h:"${{ item.priceChangePercent }}",volume:"${{ item.quoteVolume }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"klines",access:"read",description:"Candlestick/kline data for a trading pair",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"symbol",type:"str",required:!0,positional:!0,help:"Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"},{name:"interval",type:"str",default:"1d",help:"Kline interval (1m, 5m, 15m, 1h, 4h, 1d, 1w, 1M)"},{name:"limit",type:"int",default:10,help:"Number of klines (max 1000)"}],columns:["open","high","low","close","volume"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/klines?symbol=${{ args.symbol }}&interval=${{ args.interval }}&limit=${{ args.limit }}"}},{map:{open:"${{ item.1 }}",high:"${{ item.2 }}",low:"${{ item.3 }}",close:"${{ item.4 }}",volume:"${{ item.5 }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"losers",access:"read",description:"Top losing trading pairs by 24h price change",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:10,help:"Number of trading pairs"}],columns:["rank","symbol","price","change_24h","volume"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/ticker/24hr"}},{filter:"item.priceChangePercent"},{map:{symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_24h:"${{ item.priceChangePercent }}",volume:"${{ item.quoteVolume }}",sort_change:"${{ Number(item.priceChangePercent) }}"}},{sort:{by:"sort_change"}},{map:{rank:"${{ index + 1 }}",symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_24h:"${{ item.priceChangePercent }}",volume:"${{ item.quoteVolume }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as t,Strategy as e}from"@jackwener/opencli/registry";t({site:"binance",name:"pairs",access:"read",description:"List active trading pairs on Binance",domain:"data-api.binance.vision",strategy:e.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"Number of trading pairs"}],columns:["symbol","base","quote","status"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/exchangeInfo"}},{select:"symbols"},{filter:"item.status === 'TRADING'"},{map:{symbol:"${{ item.symbol }}",base:"${{ item.baseAsset }}",quote:"${{ item.quoteAsset }}",status:"${{ item.status }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"price",access:"read",description:"Quick price check for a trading pair",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"symbol",type:"str",required:!0,positional:!0,help:"Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"}],columns:["symbol","price","change","change_pct","high","low","volume","quote_volume","trades"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/ticker/24hr?symbol=${{ args.symbol }}"}},{map:{symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change:"${{ item.priceChange }}",change_pct:"${{ item.priceChangePercent }}",high:"${{ item.highPrice }}",low:"${{ item.lowPrice }}",volume:"${{ item.volume }}",quote_volume:"${{ item.quoteVolume }}",trades:"${{ item.count }}"}}]});
@@ -0,0 +1 @@
1
+ import{cli as i,Strategy as e}from"@jackwener/opencli/registry";i({site:"binance",name:"prices",access:"read",description:"Latest prices for all trading pairs",domain:"data-api.binance.vision",strategy:e.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"Number of prices"}],columns:["rank","symbol","price"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/ticker/price"}},{map:{rank:"${{ index + 1 }}",symbol:"${{ item.symbol }}",price:"${{ item.price }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"ticker",access:"read",description:"24h ticker statistics for top trading pairs by volume",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"Number of tickers"}],columns:["symbol","price","change_pct","high","low","volume","quote_vol","trades"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/ticker/24hr"}},{map:{symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_pct:"${{ item.priceChangePercent }}",high:"${{ item.highPrice }}",low:"${{ item.lowPrice }}",volume:"${{ item.volume }}",quote_vol:"${{ item.quoteVolume }}",trades:"${{ item.count }}",sort_volume:"${{ Number(item.quoteVolume) }}"}},{sort:{by:"sort_volume",order:"desc"}},{map:{symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_pct:"${{ item.priceChangePercent }}",high:"${{ item.highPrice }}",low:"${{ item.lowPrice }}",volume:"${{ item.volume }}",quote_vol:"${{ item.quoteVolume }}",trades:"${{ item.count }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"top",access:"read",description:"Top trading pairs by 24h volume on Binance",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"Number of trading pairs"}],columns:["rank","symbol","price","change_24h","high","low","volume"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/ticker/24hr"}},{map:{symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_24h:"${{ item.priceChangePercent }}",high:"${{ item.highPrice }}",low:"${{ item.lowPrice }}",volume:"${{ item.quoteVolume }}",sort_volume:"${{ Number(item.quoteVolume) }}"}},{sort:{by:"sort_volume",order:"desc"}},{map:{rank:"${{ index + 1 }}",symbol:"${{ item.symbol }}",price:"${{ item.lastPrice }}",change_24h:"${{ item.priceChangePercent }}",high:"${{ item.highPrice }}",low:"${{ item.lowPrice }}",volume:"${{ item.quoteVolume }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as i}from"@jackwener/opencli/registry";e({site:"binance",name:"trades",access:"read",description:"Recent trades for a trading pair",domain:"data-api.binance.vision",strategy:i.PUBLIC,browser:!1,args:[{name:"symbol",type:"str",required:!0,positional:!0,help:"Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"},{name:"limit",type:"int",default:20,help:"Number of trades (max 1000)"}],columns:["id","price","qty","quote_qty","buyer_maker"],pipeline:[{fetch:{url:"https://data-api.binance.vision/api/v3/trades?symbol=${{ args.symbol }}&limit=${{ args.limit }}"}},{map:{id:"${{ item.id }}",price:"${{ item.price }}",qty:"${{ item.qty }}",quote_qty:"${{ item.quoteQty }}",buyer_maker:"${{ item.isBuyerMaker }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1,12 @@
1
+ import{cli as Y,Strategy as Z}from"@jackwener/opencli/registry";import{ArgumentError as $,CliError as Q}from"@jackwener/opencli/errors";const A="https://www.bloomberg.com/businessweek";export function parseBusinessweekLimit(f){const j=f==null||f===""?1:Number(f);if(!Number.isInteger(j)||j<1||j>20)throw new $("bloomberg businessweek --limit must be an integer between 1 and 20","Example: opencli bloomberg businessweek --limit 5");return j}export function normalizeBusinessweekStoryPath(f){const j=typeof f==="string"?f.trim():"";if(!j)return"";let q;try{q=new URL(j,"https://www.bloomberg.com")}catch{return""}if(q.protocol!=="https:"||q.hostname!=="www.bloomberg.com")return"";if(!/^\/(?:news|features)\//.test(q.pathname))return"";return`${q.pathname}${q.search}`}export function extractBusinessweekStoriesFromNextData(f){const j=f&&f.props&&f.props.pageProps&&f.props.pageProps.initialState&&f.props.pageProps.initialState.modulesById;if(!j||typeof j!=="object")return null;const q=new Set,J=[];for(const G of Object.values(j)){const K=G&&Array.isArray(G.items)?G.items:[];for(const b of K){const H=b&&typeof b.headline==="string"?b.headline.trim():"",M=normalizeBusinessweekStoryPath(b&&typeof b.url==="string"?b.url:"");if(!H||!M)continue;const V=M.split("?")[0];if(q.has(V))continue;q.add(V);const X=b.summary&&String(b.summary).trim()||(b.eyebrow&&b.eyebrow.text?String(b.eyebrow.text).trim():""),W=b.image&&(b.image.baseUrl||b.image.url)||b.lede&&(b.lede.baseUrl||b.lede.url)||"";J.push({title:H,summary:X,link:`https://www.bloomberg.com${M}`,mediaLinks:W?[W]:[]})}}return J}export const command=Y({site:"bloomberg",name:"businessweek",access:"read",description:"Bloomberg Businessweek top stories",domain:"www.bloomberg.com",strategy:Z.PUBLIC,browser:!0,args:[{name:"limit",type:"int",default:1,help:"Number of stories to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(f,j)=>{const q=parseBusinessweekLimit(j.limit);await f.goto(A);await f.wait({selector:"#__NEXT_DATA__",timeout:8});const J=normalizeBusinessweekStoryPath.toString(),G=extractBusinessweekStoriesFromNextData.toString(),K=async()=>f.evaluate(`(() => {
2
+ ${J}
3
+ ${G}
4
+ const el = document.getElementById('__NEXT_DATA__');
5
+ if (!el) return { ok: false, error: 'NO_NEXT_DATA', title: document.title };
6
+ let data;
7
+ try { data = JSON.parse(el.textContent); }
8
+ catch (err) { return { ok: false, error: 'BAD_NEXT_DATA', message: String(err) }; }
9
+ const stories = extractBusinessweekStoriesFromNextData(data);
10
+ if (!stories) return { ok: false, error: 'NO_MODULES' };
11
+ return { ok: true, stories };
12
+ })()`);let b=await K();if(b&&b.ok===!1&&(b.error==="NO_NEXT_DATA"||b.error==="NO_MODULES")){await f.wait(4);b=await K()}if(!b||typeof b!=="object")throw new Q("PARSE_ERROR","Bloomberg Businessweek page returned malformed story data","Bloomberg may have changed the page structure.");if(b.ok===!1)throw new Q("PARSE_ERROR",`Bloomberg Businessweek page did not expose story data (${b.error})`,"Bloomberg may have changed the page structure.");const H=Array.isArray(b.stories)?b.stories:[];if(!H.length)throw new Q("NOT_FOUND","No Bloomberg Businessweek stories found","Bloomberg may have changed the page structure.");return H.slice(0,q)}}),__test__={command,parseBusinessweekLimit,normalizeBusinessweekStoryPath,extractBusinessweekStoriesFromNextData};
@@ -0,0 +1 @@
1
+ import{cli as r,Strategy as t}from"@jackwener/opencli/registry";import{fetchBloombergFeed as o}from"./utils.js";r({site:"bloomberg",name:"crypto",access:"read",description:"Bloomberg Crypto top stories (RSS)",domain:"feeds.bloomberg.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return o("crypto",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as o,Strategy as m}from"@jackwener/opencli/registry";import{fetchBloombergFeed as r}from"./utils.js";o({site:"bloomberg",name:"economics",access:"read",description:"Bloomberg Economics top stories (RSS)",domain:"feeds.bloomberg.com",strategy:m.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return r("economics",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as s,Strategy as a}from"@jackwener/opencli/registry";import{BLOOMBERG_FEEDS as o}from"./utils.js";s({site:"bloomberg",name:"feeds",access:"read",description:"List the Bloomberg RSS feed aliases used by the adapter",domain:"feeds.bloomberg.com",strategy:a.PUBLIC,browser:!1,args:[],columns:["name","url"],func:async()=>{return Object.entries(o).map(([e,r])=>({name:e,url:r}))}});
@@ -0,0 +1 @@
1
+ import{cli as r,Strategy as t}from"@jackwener/opencli/registry";import{fetchBloombergFeed as m}from"./utils.js";r({site:"bloomberg",name:"green",access:"read",description:"Bloomberg Green (climate & energy) top stories (RSS)",domain:"feeds.bloomberg.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return m("green",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as r,Strategy as t}from"@jackwener/opencli/registry";import{fetchBloombergFeed as i}from"./utils.js";r({site:"bloomberg",name:"industries",access:"read",description:"Bloomberg Industries top stories (RSS)",domain:"feeds.bloomberg.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return i("industries",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as m,Strategy as o}from"@jackwener/opencli/registry";import{fetchBloombergFeed as r}from"./utils.js";m({site:"bloomberg",name:"main",access:"read",description:"Bloomberg homepage top stories (RSS)",domain:"feeds.bloomberg.com",strategy:o.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return r("main",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as r,Strategy as t}from"@jackwener/opencli/registry";import{fetchBloombergFeed as m}from"./utils.js";r({site:"bloomberg",name:"markets",access:"read",description:"Bloomberg Markets top stories (RSS)",domain:"feeds.bloomberg.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return m("markets",e.limit??1)}});
@@ -0,0 +1,57 @@
1
+ import{cli as I,Strategy as J}from"@jackwener/opencli/registry";import{CliError as A}from"@jackwener/opencli/errors";import{extractStoryMediaLinks as K,renderStoryBody as N,validateBloombergLink as O}from"./utils.js";I({site:"bloomberg",name:"news",access:"read",description:"Read a Bloomberg story/article page and return title, full content, and media links",domain:"www.bloomberg.com",strategy:J.COOKIE,browser:!0,args:[{name:"link",positional:!0,required:!0,help:"Bloomberg story/article URL or relative Bloomberg path"}],columns:["title","summary","link","mediaLinks","content"],func:async(z,H)=>{const D=O(H.link);await z.goto(D);await z.wait({selector:"article",timeout:5});const F=async()=>z.evaluate(`(() => {
2
+ const isRobot = /Are you a robot/i.test(document.title)
3
+ || /unusual activity/i.test(document.body.innerText)
4
+ || /click the box below to let us know you're not a robot/i.test(document.body.innerText);
5
+
6
+ if (isRobot) {
7
+ return {
8
+ errorCode: 'ROBOT_PAGE',
9
+ title: document.title,
10
+ preview: document.body.innerText.slice(0, 400),
11
+ };
12
+ }
13
+
14
+ const raw = document.querySelector('#__NEXT_DATA__')?.textContent;
15
+ if (!raw) {
16
+ return {
17
+ errorCode: 'NO_NEXT_DATA',
18
+ title: document.title,
19
+ preview: document.body.innerText.slice(0, 400),
20
+ };
21
+ }
22
+
23
+ let parsed;
24
+ try {
25
+ parsed = JSON.parse(raw);
26
+ } catch (err) {
27
+ return {
28
+ errorCode: 'BAD_NEXT_DATA',
29
+ title: document.title,
30
+ preview: document.body.innerText.slice(0, 400),
31
+ message: String(err),
32
+ };
33
+ }
34
+
35
+ const story = parsed?.props?.pageProps?.story;
36
+ if (!story) {
37
+ return {
38
+ errorCode: 'NO_STORY',
39
+ title: document.title,
40
+ preview: document.body.innerText.slice(0, 400),
41
+ };
42
+ }
43
+
44
+ return {
45
+ story: {
46
+ headline: story.headline || story.seoHeadline || story.seoTitle || document.querySelector('h1')?.textContent?.trim() || document.title,
47
+ summary: story.summary || story.socialDescription || story.seoDescription || document.querySelector('meta[name="description"]')?.getAttribute('content') || '',
48
+ url: story.url || story.readingUrl || location.href,
49
+ body: story.body || null,
50
+ lede: story.lede || null,
51
+ ledeImageUrl: story.ledeImageUrl || null,
52
+ socialImageUrl: story.socialImageUrl || null,
53
+ imageAttachments: story.imageAttachments || {},
54
+ videoAttachments: story.videoAttachments || {},
55
+ }
56
+ };
57
+ })()`);let f=await F();if(f?.errorCode==="NO_NEXT_DATA"||f?.errorCode==="NO_STORY"){await z.wait(4);f=await F()}if(f?.errorCode==="ROBOT_PAGE")throw new A("FETCH_ERROR","Bloomberg served the bot-protection page instead of article content","Try again later or open the article in a regular Chrome session first, then rerun the command. This command uses your current Bloomberg access and does not bypass paywall or entitlement checks.");if(f?.errorCode)throw new A("PARSE_ERROR",`Bloomberg page did not expose article story data (${f.errorCode})`,"This command currently works on standard Bloomberg story/article pages that expose __NEXT_DATA__. Audio, video, newsletter, or other non-standard/blocked pages may not work. Access still depends on your current Bloomberg session.");const q=f?.story;if(!q)throw new A("PARSE_ERROR","Failed to extract Bloomberg story data","Bloomberg may have changed the page structure.");const G=N(q.body);if(!G)throw new A("PARSE_ERROR","Bloomberg article body was empty after parsing","Bloomberg may have changed the story-body format, the URL may not point to a standard article page, or the page may not be accessible in your current Bloomberg session.");return[{title:q.headline||"",summary:q.summary||"",link:q.url||D,mediaLinks:K(q),content:G}]}});
@@ -0,0 +1 @@
1
+ import{cli as o,Strategy as i}from"@jackwener/opencli/registry";import{fetchBloombergFeed as r}from"./utils.js";o({site:"bloomberg",name:"opinions",access:"read",description:"Bloomberg Opinion top stories (RSS)",domain:"feeds.bloomberg.com",strategy:i.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return r("opinions",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as t,Strategy as i}from"@jackwener/opencli/registry";import{fetchBloombergFeed as o}from"./utils.js";t({site:"bloomberg",name:"politics",access:"read",description:"Bloomberg Politics top stories (RSS)",domain:"feeds.bloomberg.com",strategy:i.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return o("politics",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as t,Strategy as r}from"@jackwener/opencli/registry";import{fetchBloombergFeed as s}from"./utils.js";t({site:"bloomberg",name:"pursuits",access:"read",description:"Bloomberg Pursuits (lifestyle) top stories (RSS)",domain:"feeds.bloomberg.com",strategy:r.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return s("pursuits",e.limit??1)}});
@@ -0,0 +1 @@
1
+ import{cli as t,Strategy as r}from"@jackwener/opencli/registry";import{fetchBloombergFeed as m}from"./utils.js";t({site:"bloomberg",name:"tech",access:"read",description:"Bloomberg Tech top stories (RSS)",domain:"feeds.bloomberg.com",strategy:r.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:1,help:"Number of feed items to return (max 20)"}],columns:["title","summary","link","mediaLinks"],func:async(e)=>{return m("tech",e.limit??1)}});
@@ -0,0 +1,17 @@
1
+ import{CliError as H}from"@jackwener/opencli/errors";export const BLOOMBERG_FEEDS={main:"https://feeds.bloomberg.com/news.rss",markets:"https://feeds.bloomberg.com/markets/news.rss",economics:"https://feeds.bloomberg.com/economics/news.rss",industries:"https://feeds.bloomberg.com/industries/news.rss",tech:"https://feeds.bloomberg.com/technology/news.rss",politics:"https://feeds.bloomberg.com/politics/news.rss",opinions:"https://feeds.bloomberg.com/bview/news.rss",green:"https://feeds.bloomberg.com/green/news.rss",crypto:"https://feeds.bloomberg.com/crypto/news.rss",pursuits:"https://feeds.bloomberg.com/pursuits/news.rss"};const L="Mozilla/5.0 (compatible; opencli)";export async function fetchBloombergFeed(q,J=1){const K=BLOOMBERG_FEEDS[q];if(!K)throw new H("ARGUMENT",`Unknown Bloomberg feed: ${q}`);let P;for(let Q=0;Q<3;Q+=1){if(Q>0)await new Promise((A)=>setTimeout(A,400*Q));const V=await fetch(K,{headers:{"User-Agent":L}});if(!V.ok){P=new H("FETCH_ERROR",`Bloomberg RSS HTTP ${V.status}`,"Bloomberg may be temporarily unavailable; try again later.");continue}const Z=await V.text(),W=parseBloombergRss(Z);if(W.length){const A=Math.max(1,Math.min(Number(J)||1,20));return W.slice(0,A)}P=new H("NOT_FOUND","Bloomberg RSS feed returned no items","Bloomberg may have changed the feed format.")}throw P}export function parseBloombergRss(q){const J=[],K=/<item\b[^>]*>([\s\S]*?)<\/item>/gi;let P;while(P=K.exec(q)){const Q=P[1],V=G(Q,"title"),Z=G(Q,"description"),W=G(Q,"link")||G(Q,"guid"),A=M(Q);if(!V||!W)continue;J.push({title:V,summary:Z,link:W,mediaLinks:A})}return J}export function normalizeBloombergLink(q){const J=String(q||"").trim();if(!J)throw new H("ARGUMENT","A Bloomberg link is required");if(J.startsWith("/"))return`https://www.bloomberg.com${J}`;return J}export function validateBloombergLink(q){const J=normalizeBloombergLink(q);let K;try{K=new URL(J)}catch{throw new H("ARGUMENT",`Invalid Bloomberg link: ${q}`,"Pass a full https://www.bloomberg.com/... URL or a relative Bloomberg path.")}if(!/(?:\.|^)bloomberg\.com$/i.test(K.hostname))throw new H("ARGUMENT",`Expected a bloomberg.com link, got: ${K.hostname}`,"Pass a Bloomberg article URL from bloomberg.com.");return K.toString()}export function renderStoryBody(q){return(Array.isArray(q?.content)?q.content:[]).map((P)=>D(P,0)).map((P)=>j(P)).filter(Boolean).join(`
2
+
3
+ `).replace(/\n{3,}/g,`
4
+
5
+ `).trim()}export function extractStoryMediaLinks(q){const J=new Set;$(q?.ledeImageUrl,J);$(q?.socialImageUrl,J);$(q?.lede,J);$(q?.imageAttachments,J);$(q?.videoAttachments,J);const K=Array.isArray(q?.body?.content)?q.body.content.filter((P)=>P?.type==="media"):[];$(K,J);return[...J]}function D(q,J){if(!q||typeof q!=="object")return"";switch(q.type){case"paragraph":return S(q.content||[]);case"heading":{const K=S(q.content||[]);if(!K)return"";const P=Number(q.data?.level??q.data?.weight??2);return`${P<=1?"# ":P===2?"## ":"### "}${K}`}case"blockquote":{const K=S(q.content||[]);if(!K)return"";return K.split(`
6
+ `).map((P)=>P?`> ${P}`:">").join(`
7
+ `)}case"list":return w(q,J);case"tabularData":return N(q);case"media":return g(q);case"inline-newsletter":case"newsletter":case"ad":return"";default:{if(Array.isArray(q.content)&&q.content.length>0){const K=S(q.content);if(K)return K;const P=q.content.map((Q)=>D(Q,J+1)).filter(Boolean);if(P.length)return P.join(`
8
+ `)}return O(q)}}}function S(q){return q.map((J)=>X(J)).join("")}function X(q){if(q==null)return"";if(typeof q==="string")return Y(q);switch(q.type){case"text":return Y(q.value||"");case"linebreak":return`
9
+ `;case"link":case"entity":case"strong":case"emphasis":case"italic":case"underline":case"span":if(Array.isArray(q.content)&&q.content.length>0)return S(q.content);return Y(q.value||"");default:if(Array.isArray(q.content)&&q.content.length>0)return S(q.content);if(typeof q.value==="string")return Y(q.value);return""}}function w(q,J){const K=Array.isArray(q.content)?q.content:[];if(!K.length)return"";const P=String(q.subType||q.data?.style||q.data?.listType||""),Q=/\bordered\b|\bnumber(?:ed)?\b/i.test(P);let V=1;return K.map((Z)=>{const W=Q?`${V++}. `:"- ";return f(Z,W,J)}).filter(Boolean).join(`
10
+ `)}function f(q,J,K){const P=" ".repeat(K),Q=j(I(q,K+1));if(!Q)return"";const V=Q.split(`
11
+ `),Z=`${P}${J}${V[0]}`;if(V.length===1)return Z;const W=`${P}${" ".repeat(J.length)}`,A=V.slice(1).map((R)=>`${W}${R}`).join(`
12
+ `);return`${Z}
13
+ ${A}`}function I(q,J){if(!q||typeof q!=="object")return"";if(q.type==="list-item"&&Array.isArray(q.content))return q.content.map((P)=>P?.type==="paragraph"?S(P.content||[]):D(P,J)).map((P)=>j(P)).filter(Boolean).join(`
14
+ `);return D(q,J)}function N(q){const J=q?.data?.rows??q?.data?.table?.rows??q?.content;if(!Array.isArray(J)||!J.length)return O(q.data||q.content||q);return J.map((P)=>O(P)).map((P)=>j(P)).filter(Boolean).join(`
15
+ `)}function g(q){return[q?.data?.chart?.caption,q?.data?.attachment?.caption,q?.data?.attachment?.title,q?.data?.attachment?.subtitle,q?.data?.video?.caption].map((P)=>j(_(String(P||"")))).find(Boolean)||""}function O(q){const J=[];F(q,J);return J.join(" ").replace(/\s+/g," ").trim()}function F(q,J){if(q==null)return;if(typeof q==="string"){const K=j(_(Y(q)));if(K)J.push(K);return}if(Array.isArray(q)){for(const K of q)F(K,J);return}if(typeof q==="object"){if(typeof q.value==="string"){const K=j(_(Y(q.value)));if(K)J.push(K);return}if(Array.isArray(q.content)){F(q.content,J);return}for(const K of Object.values(q))F(K,J)}}function G(q,J){const K=B(J),P=q.match(new RegExp(`<${K}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${K}>`,"i"));if(!P)return"";return j(_(Y(U(P[1]))))}function M(q){const J=new Set,K=/<(?:media:content|media:thumbnail|enclosure)\b[^>]*\burl="([^"]+)"[^>]*>/gi;let P;while(P=K.exec(q)){const Q=Y(P[1]||"").trim();if(Q)J.add(Q)}return[...J]}function $(q,J,K=new WeakSet){if(q==null)return;if(typeof q==="string"){const P=C(q);if(P)J.add(P);return}if(Array.isArray(q)){for(const P of q)$(P,J,K);return}if(typeof q==="object"){if(K.has(q))return;K.add(q);for(const P of["url","src","fallback","poster"]){const Q=q[P];if(typeof Q==="string"){const V=C(Q);if(V)J.add(V)}}for(const P of Object.values(q))$(P,J,K)}}function C(q){const J=Y(String(q||"")).trim();if(!/^https?:\/\//i.test(J))return null;if(!z(J))return null;return J}function z(q){return/(?:assets\.bwbx\.io|resource\.bloomberg\.com|media\.bloomberg\.com)/i.test(q)||/\.(?:jpg|jpeg|png|webp|gif|svg|mp4|m3u8)(?:[?#].*)?$/i.test(q)}function U(q){const J=q.match(/^<!\[CDATA\[([\s\S]*?)\]\]>$/);return J?J[1]:q}function _(q){return String(q||"").replace(/<[^>]+>/g," ")}function Y(q){return String(q||"").replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g,"$1").replace(/&#(\d+);/g,(J,K)=>String.fromCodePoint(Number(K))).replace(/&#x([0-9a-f]+);/gi,(J,K)=>String.fromCodePoint(parseInt(K,16))).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/&nbsp;/g," ")}function j(q){return String(q||"").replace(/\r/g,"").replace(/[ \t]+\n/g,`
16
+ `).replace(/\n[ \t]+/g,`
17
+ `).replace(/[ \t]{2,}/g," ").trim()}function B(q){return q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}
@@ -0,0 +1 @@
1
+ import*as U from"node:fs";import*as y from"node:path";import{cli as f,Strategy as C}from"@jackwener/opencli/registry";import{AuthRequiredError as W,ArgumentError as N,CommandExecutionError as H}from"@jackwener/opencli/errors";import{assertLiteralContent as L}from"../_shared/content-guard.js";import{IMAGES_EMBED_TYPE as R,MAX_BLOB_BYTES as j,MAX_IMAGES as G,MAX_POST_GRAPHEMES as Y,POST_COLLECTION as X,POST_TYPE as O,graphemeLength as B,loadBskySession as I,postUriToWebUrl as T,uploadBlobWithRefresh as x,xrpcJsonWithRefresh as S}from"./shared.js";const b={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp"};function M(v,K){const Z=String(v).split(",").map((Q)=>Q.trim()).filter(Boolean);if(Z.length===0)return[];if(Z.length>G)throw new N(`图片过多:${Z.length} 张(Bluesky 单帖最多 ${G} 张)`);const D=K!=null&&String(K).length>0?String(K).split(",").map((Q)=>Q.trim()):[];return Z.map((Q,J)=>{const z=y.resolve(Q),$=y.extname(z).toLowerCase(),F=b[$];if(!F)throw new N(`不支持的图片格式 "${$}"。支持:jpg / png / gif / webp`);const V=U.statSync(z,{throwIfNoEntry:!1});if(!V||!V.isFile())throw new N(`不是有效文件:${z}`);if(V.size>j)throw new N(`图片超过 ${j} 字节上限(${z} 为 ${V.size} 字节)。请先本地压缩后再发。`);return{absPath:z,mime:F,alt:D[J]||""}})}async function P(v,K,Z){const D=[];for(const Q of Z){const J=U.readFileSync(Q.absPath).toString("base64"),z=await x(v,K,{base64:J,mime:Q.mime});if(z&&(z.httpStatus===401||z.httpStatus===403))throw new W("bsky.app",`uploadBlob 返回 HTTP ${z.httpStatus}`);const $=z&&z.bodyJson&&z.bodyJson.blob;if(!z||!z.ok||!$){const F=z&&z.bodyJson&&(z.bodyJson.message||z.bodyJson.error)||z?.error||`HTTP ${z?.httpStatus??0}`;throw new H(`图片上传失败(${Q.absPath}):${F}`)}D.push({alt:Q.alt,image:$})}return{$type:R,images:D}}f({site:"bluesky",name:"post",access:"write",description:"发布一条 Bluesky 帖子(支持文字 + 最多 4 张图)",domain:"bsky.app",strategy:C.UI,browser:!0,args:[{name:"text",type:"string",required:!0,positional:!0,help:"帖子正文(≤300 graphemes)"},{name:"images",type:"string",required:!1,help:"图片路径,逗号分隔,最多 4 张(jpg/png/gif/webp,每张≤1MB)"},{name:"alts",type:"string",required:!1,help:"图片 alt 文本,逗号分隔,与 images 一一对应(可选)"},{name:"langs",type:"string",required:!1,help:"语言标签,逗号分隔(如 zh,en);不传则不标注语言"}],columns:["status","message","text","uri","cid","url"],func:async(v,K)=>{if(!v)throw new H("Bluesky post 需要浏览器会话");const Z=String(K.text??"");L(Z,{label:"帖子正文"});if(Z.trim().length===0)throw new N("帖子正文不能为空");const D=B(Z);if(D>Y)throw new N(`帖子正文 ${D} graphemes,超过 Bluesky 上限 ${Y}`);const Q=K.images?M(String(K.images),K.alts):[],J=K.langs!=null&&String(K.langs).length>0?String(K.langs).split(",").map((q)=>q.trim()).filter(Boolean):[],z=await I(v),$={$type:O,text:Z,createdAt:new Date().toISOString()};if(J.length>0)$.langs=J;if(Q.length>0)$.embed=await P(v,z,Q);const F=await S(v,z,{path:"com.atproto.repo.createRecord",method:"POST",body:{repo:z.did,collection:X,record:$}});if(F&&(F.httpStatus===401||F.httpStatus===403))throw new W("bsky.app",`createRecord 返回 HTTP ${F.httpStatus}`);const V=F&&F.bodyJson;if(!F||!F.ok||!V||!V.uri){const q=V&&(V.message||V.error)||F?.error||`HTTP ${F?.httpStatus??0}`;throw new H(`发布失败:${q}`)}return[{status:"success",message:"帖子发布成功",text:Z,uri:String(V.uri),cid:String(V.cid||""),url:T(V.uri,z.handle)}]}});