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 h,Strategy as l}from"@jackwener/opencli/registry";import{ArgumentError as i}from"@jackwener/opencli/errors";import{authHeadersFragment as u,channelResolveFragment as p}from"./in-page.js";import{dispatchEvaluateResult as m}from"./errors.js";import{SLOCK_SITE as k,SLOCK_DOMAIN as f,SLOCK_HOME_URL as w,SLOCK_API_BASE as b}from"./shared.js";h({site:k,name:"task-create",access:"write",description:"Create a task in a channel (single title; batch 1-50 is server-supported but client surface is single — see backlog R4).",domain:f,strategy:l.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"title",positional:!0,required:!0,help:"Task title (single; batch TODO via R4)"},{name:"desc",help:"Optional description body for the task"},{name:"server",help:"Override active server"}],columns:["id","taskNumber","title","taskStatus","channelId"],func:async(a,t)=>{const r=String(t.channel??"").trim();if(!r)throw new i("channel required");const s=String(t.title??"").trim();if(!s)throw new i("title required (non-empty)");const n=t.desc!=null?String(t.desc):"";await a.goto(w);const o=n?{title:s,description:n}:{title:s},c=`
2
+ ${u({serverScoped:!0,serverIdOverride:t.server})}
3
+ ${p(r)}
4
+ // Body is always a batch array — N=1 here because the CLI exposes one
5
+ // title at a time (R4 will widen this). Keep the wrapper so the server
6
+ // sees the same shape as a real batch and we don't fork the contract.
7
+ const body = { tasks: [${JSON.stringify(o)}] };
8
+ const res = await fetch('${b}/tasks/channel/' + encodeURIComponent(channelId), {
9
+ method:'POST', credentials:'include', headers, body: JSON.stringify(body),
10
+ });
11
+ if (res.status === 400) {
12
+ const j = await res.json().catch(() => ({}));
13
+ return { kind: 'http', status: 400, where: '/tasks/channel/:id (bad request: ' + (j.error || j.message || 'title/limit/shape') + ')' };
14
+ }
15
+ if (res.status === 403) return { kind: 'http', status: 403, where: '/tasks/channel/:id (forbidden — channel archived or not a member)' };
16
+ if (res.status === 404) return { kind: 'http', status: 404, where: '/tasks/channel/:id (channel not found)' };
17
+ if (res.status === 409) return { kind: 'http', status: 409, where: '/tasks/channel/:id (conflict — thread channels do not accept tasks; pick the parent channel)' };
18
+ if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/tasks/channel/:id' };
19
+ const data = await res.json().catch(() => ({}));
20
+ if (!data || !Array.isArray(data.tasks)) {
21
+ return { kind: 'http', status: 200, where: '/tasks/channel/:id (expected {tasks:[]}, got drift)' };
22
+ }
23
+ return { kind: 'ok', rows: data.tasks };
24
+ `,d=await a.evaluate(`(async () => { ${c} })()`);return m(d).map((e)=>({id:e.id??"",taskNumber:e.taskNumber??null,title:e.content??e.title??s,taskStatus:e.taskStatus??"todo",channelId:e.channelId??null}))}});
@@ -0,0 +1,9 @@
1
+ import{cli as Q,Strategy as V}from"@jackwener/opencli/registry";import{ArgumentError as W}from"@jackwener/opencli/errors";import{authHeadersFragment as X}from"./in-page.js";import{dispatchEvaluateResult as Y}from"./errors.js";import{SLOCK_SITE as Z,SLOCK_DOMAIN as $,SLOCK_HOME_URL as x,SLOCK_API_BASE as B}from"./shared.js";import{assertMessageIdShape as D}from"./resolve.js";Q({site:Z,name:"task-delete",access:"write",description:"Delete a chat task (DELETE /tasks/:taskId). Requires --confirm — destructive, irreversible.",domain:$,strategy:V.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"taskId",positional:!0,required:!0,help:"Full task UUID (= message id; short ids rejected)"},{name:"confirm",type:"bool",default:!1,help:"Required acknowledgement: deletion is irreversible"},{name:"server",help:"Override active server"}],columns:["taskId","deleted"],func:async(z,q)=>{let b;try{b=D(String(q.taskId??""))}catch(f){throw new W(f.message)}if(!q.confirm)return[{taskId:b,deleted:!1,note:"no-op: pass --confirm to actually delete (irreversible)"}];await z.goto(x);const G=`
2
+ ${X({serverScoped:!0,serverIdOverride:q.server})}
3
+ const res = await fetch('${B}/tasks/' + encodeURIComponent(${JSON.stringify(b)}), { method:'DELETE', credentials:'include', headers });
4
+ if (res.status === 403) return { kind: 'http', status: 403, where: '/tasks/:taskId (forbidden — not the owner/admin or channel archived)' };
5
+ if (res.status === 404) return { kind: 'http', status: 404, where: '/tasks/:taskId (task not found)' };
6
+ if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/tasks/:taskId' };
7
+ // 204 No Content is common for DELETE; tolerate empty body.
8
+ return { kind: 'ok', rows: [{ taskId: ${JSON.stringify(b)}, deleted: true }] };
9
+ `,J=await z.evaluate(`(async () => { ${G} })()`);return Y(J).map((f)=>({taskId:f.taskId??b,deleted:f.deleted??!0}))}});
@@ -0,0 +1,11 @@
1
+ import{cli as c,Strategy as m}from"@jackwener/opencli/registry";import{ArgumentError as i}from"@jackwener/opencli/errors";import{authHeadersFragment as d,channelResolveFragment as h}from"./in-page.js";import{dispatchEvaluateResult as l}from"./errors.js";import{SLOCK_SITE as k,SLOCK_DOMAIN as p,SLOCK_HOME_URL as b,SLOCK_API_BASE as g}from"./shared.js";import{parsePositiveInteger as S}from"./resolve.js";c({site:k,name:"task-get",access:"read",description:"Fetch a task by channel + taskNumber (GET /tasks/channel/:channelId/number/:taskNumber).",domain:p,strategy:m.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"number",positional:!0,required:!0,help:'taskNumber (per-channel integer, as shown in "task #N")'},{name:"server",help:"Override active server"}],columns:["id","taskNumber","title","taskStatus","assigneeId"],func:async(r,t)=>{const s=String(t.channel??"").trim();if(!s)throw new i("channel required");const n=String(t.number??"").trim();if(!/^\d+$/.test(n))throw new i(`number "${n}" is not a positive integer`);const a=S(n,"number");await r.goto(b);const o=`
2
+ ${d({serverScoped:!0,serverIdOverride:t.server})}
3
+ ${h(s)}
4
+ const res = await fetch('${g}/tasks/channel/' + encodeURIComponent(channelId) + '/number/' + encodeURIComponent(${JSON.stringify(String(a))}), { credentials:'include', headers });
5
+ if (res.status === 404) return { kind: 'http', status: 404, where: '/tasks/channel/:id/number/:n (task #' + ${JSON.stringify(a)} + ' not found in channel)' };
6
+ if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/tasks/channel/:id/number/:n' };
7
+ const data = await res.json().catch(() => ({}));
8
+ // Single object or {task: ...} wrapped — accept either.
9
+ const task = data && data.task ? data.task : data;
10
+ return { kind: 'ok', rows: [task] };
11
+ `,u=await r.evaluate(`(async () => { ${o} })()`);return l(u).map((e)=>({id:e.id??"",taskNumber:e.taskNumber??a,title:e.content??e.title??"",taskStatus:e.taskStatus??e.status??"",assigneeId:e.claimedById??e.assigneeId??null}))}});
@@ -0,0 +1,12 @@
1
+ import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{ArgumentError as d,CommandExecutionError as l}from"@jackwener/opencli/errors";import{authHeadersFragment as m}from"./in-page.js";import{dispatchEvaluateResult as h}from"./errors.js";import{SLOCK_SITE as p,SLOCK_DOMAIN as v,SLOCK_HOME_URL as k,SLOCK_API_BASE as f}from"./shared.js";const a=["todo","in_progress","in_review","done","closed"];u({site:p,name:"task-list-server",access:"read",description:"List tasks across all channels in the active server (GET /tasks/server). Optional --status filter.",domain:v,strategy:c.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"status",help:`Filter by status: ${a.join("|")}`},{name:"server",help:"Override active server"}],columns:["id","taskNumber","title","taskStatus","channelId","assigneeId"],func:async(n,e)=>{const t=e.status?String(e.status).trim():"";if(t&&!a.includes(t))throw new d(`status "${t}" not in {${a.join("|")}}`);await n.goto(k);const i=`
2
+ ${m({serverScoped:!0,serverIdOverride:e.server})}
3
+ const status = ${JSON.stringify(t)};
4
+ const qs = status ? ('?status=' + encodeURIComponent(status)) : '';
5
+ const res = await fetch('${f}/tasks/server' + qs, { credentials:'include', headers });
6
+ if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where: '/tasks/server' };
7
+ const data = await res.json();
8
+ if (!data || !Array.isArray(data.tasks)) {
9
+ return { kind: 'http', status: 200, where: '/tasks/server (expected {tasks:[]}, got drift)' };
10
+ }
11
+ return { kind: 'ok', rows: data.tasks };
12
+ `,o=await n.evaluate(`(async () => { ${i} })()`),r=h(o);if(!Array.isArray(r))throw new l(`expected array of rows from server, got ${typeof r} (contract drift?)`);return r.map((s)=>({id:s.id??"",taskNumber:s.taskNumber??null,title:s.content??s.title??"",taskStatus:s.taskStatus??s.status??"",channelId:s.channelId??null,assigneeId:s.claimedById??s.assigneeId??null}))}});
@@ -0,0 +1,14 @@
1
+ import{cli as u,Strategy as l}from"@jackwener/opencli/registry";import{ArgumentError as o,CommandExecutionError as h}from"@jackwener/opencli/errors";import{authHeadersFragment as m,channelResolveFragment as p}from"./in-page.js";import{dispatchEvaluateResult as k}from"./errors.js";import{SLOCK_SITE as f,SLOCK_DOMAIN as S,SLOCK_HOME_URL as v,SLOCK_API_BASE as w}from"./shared.js";const r=["todo","in_progress","in_review","done","closed"];u({site:f,name:"task-list",access:"read",description:"List tasks (chat tasks = messages with task fields) attached to a channel. Optional --status filter.",domain:S,strategy:l.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"status",help:`Filter by status: ${r.join("|")}`},{name:"server",help:"Override active server"}],columns:["id","taskNumber","title","taskStatus","assigneeId"],func:async(n,s)=>{const i=String(s.channel??"").trim();if(!i)throw new o("channel required");const e=s.status?String(s.status).trim():"";if(e&&!r.includes(e))throw new o(`status "${e}" not in {${r.join("|")}}`);await n.goto(v);const d=`
2
+ ${m({serverScoped:!0,serverIdOverride:s.server})}
3
+ ${p(i)}
4
+ const status = ${JSON.stringify(e)};
5
+ const qs = status ? ('?status=' + encodeURIComponent(status)) : '';
6
+ const tres = await fetch('${w}/tasks/channel/' + encodeURIComponent(channelId) + qs, { credentials:'include', headers });
7
+ if (!tres.ok) return { kind: tres.status===401?'auth':'http', status: tres.status, where: '/tasks/channel/:id' };
8
+ const data = await tres.json();
9
+ // Server contract: { tasks: [...] }. Reject anything else as drift.
10
+ if (!data || !Array.isArray(data.tasks)) {
11
+ return { kind: 'http', status: 200, where: '/tasks/channel/:id (expected {tasks:[]}, got drift)' };
12
+ }
13
+ return { kind: 'ok', rows: data.tasks };
14
+ `,c=await n.evaluate(`(async () => { ${d} })()`),a=k(c);if(!Array.isArray(a))throw new h(`expected array of rows from server, got ${typeof a} (contract drift?)`);return a.map((t)=>({id:t.id??"",taskNumber:t.taskNumber??null,title:t.content??t.title??"",taskStatus:t.taskStatus??t.status??"",assigneeId:t.claimedById??t.assigneeId??null}))}});
@@ -0,0 +1,19 @@
1
+ import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{ArgumentError as d,CommandExecutionError as i}from"@jackwener/opencli/errors";import{authHeadersFragment as h}from"./in-page.js";import{dispatchEvaluateResult as m}from"./errors.js";import{SLOCK_SITE as f,SLOCK_DOMAIN as S,SLOCK_HOME_URL as p,SLOCK_API_BASE as w}from"./shared.js";import{assertMessageIdShape as I}from"./resolve.js";const o=["todo","in_progress","in_review","done","closed"];c({site:f,name:"task-status",access:"write",description:`Set a task's status (PATCH /tasks/:taskId/status, body {status}). One of ${o.join("|")}.`,domain:S,strategy:l.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"taskId",positional:!0,required:!0,help:"Full task UUID (= message id; short ids rejected)"},{name:"status",positional:!0,required:!0,help:`One of: ${o.join("|")}`},{name:"server",help:"Override active server"}],columns:["taskId","taskStatus","assigneeId","taskNumber"],func:async(e,s)=>{let a;try{a=I(String(s.taskId??""))}catch(n){throw new d(n.message)}const t=String(s.status??"").trim();if(!o.includes(t))throw new d(`status "${t}" not in {${o.join("|")}} — pre-network reject (saves a 400 round-trip).`);await e.goto(p);const r=`
2
+ ${h({serverScoped:!0,serverIdOverride:s.server})}
3
+ const res = await fetch('${w}/tasks/' + encodeURIComponent(${JSON.stringify(a)}) + '/status', {
4
+ method:'PATCH', credentials:'include', headers,
5
+ body: JSON.stringify({ status: ${JSON.stringify(t)} }),
6
+ });
7
+ if (res.status === 400) {
8
+ const j = await res.json().catch(() => ({}));
9
+ return { kind: 'http', status: 400, where: '/tasks/:taskId/status (bad request: ' + (j.error || j.message || 'invalid status transition') + ')' };
10
+ }
11
+ if (res.status === 403) return { kind: 'http', status: 403, where: '/tasks/:taskId/status (forbidden — terminal status (done/closed), not the assignee, or channel archived)' };
12
+ if (res.status === 404) return { kind: 'http', status: 404, where: '/tasks/:taskId/status (task not found)' };
13
+ // F6 — actionable hint for repeat-set 409 ("status already X").
14
+ if (res.status === 409) return { kind: 'http', status: 409, where: '/tasks/:taskId/status (conflict — task is already in status ' + ${JSON.stringify(t)} + '; no-op set rejected)' };
15
+ if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/tasks/:taskId/status' };
16
+ const data = await res.json().catch(() => ({}));
17
+ const t = (data && data.task) ? data.task : data;
18
+ return { kind: 'ok', rows: [t] };
19
+ `,k=await e.evaluate(`(async () => { ${r} })()`);return m(k).map((n)=>{const u=g(n,a,t);return{taskId:u.taskId,taskStatus:u.taskStatus,assigneeId:n.claimedById??n.assigneeId??null,taskNumber:n.taskNumber??null}})}});function g(e,s,a){const t=e?.id;if(!t)throw new i(`Slock task-status succeeded without returning task id ${s}; refusing to report a status row.`);if(t!==s)throw new i(`Slock task-status returned task id ${t}, expected ${s}.`);const r=e.taskStatus??e.status;if(!r)throw new i(`Slock task-status returned task ${s} without taskStatus.`);if(r!==a)throw new i(`Slock task-status returned status ${r}, expected ${a}.`);return{taskId:t,taskStatus:r}}
@@ -0,0 +1,13 @@
1
+ import{cli as o,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as d,CommandExecutionError as n}from"@jackwener/opencli/errors";import{authHeadersFragment as c}from"./in-page.js";import{dispatchEvaluateResult as l}from"./errors.js";import{SLOCK_SITE as m,SLOCK_DOMAIN as k,SLOCK_HOME_URL as h,SLOCK_API_BASE as p}from"./shared.js";import{assertMessageIdShape as f}from"./resolve.js";o({site:m,name:"task-unclaim",access:"write",description:"Release ownership of a chat task (PATCH /tasks/:id/unclaim).",domain:k,strategy:u.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"taskId",positional:!0,required:!0,help:"Full task UUID (= message id; short ids rejected)"},{name:"server",help:"Override active server"}],columns:["taskId","taskStatus","assigneeId","taskNumber"],func:async(r,s)=>{let e;try{e=f(String(s.taskId??""))}catch(t){throw new d(t.message)}await r.goto(h);const a=`
2
+ ${c({serverScoped:!0,serverIdOverride:s.server})}
3
+ const res = await fetch('${p}/tasks/' + encodeURIComponent(${JSON.stringify(e)}) + '/unclaim', { method:'PATCH', credentials:'include', headers });
4
+ if (res.status === 404) return { kind: 'http', status: 404, where: '/tasks/:id/unclaim (task not found)' };
5
+ if (res.status === 403) return { kind: 'http', status: 403, where: '/tasks/:id/unclaim (forbidden — not the assignee, terminal status, or channel archived)' };
6
+ // F6 — actionable hint for the most common reason this 409s (task already
7
+ // unclaimed, or terminal state). Bare "HTTP 409" was confusing.
8
+ if (res.status === 409) return { kind: 'http', status: 409, where: '/tasks/:id/unclaim (conflict — task is not claimed, or already in a terminal state (done/closed))' };
9
+ if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/tasks/:id/unclaim' };
10
+ const data = await res.json().catch(() => ({}));
11
+ const t = (data && data.task) ? data.task : data;
12
+ return { kind: 'ok', rows: [t] };
13
+ `,i=await r.evaluate(`(async () => { ${a} })()`);return l(i).map((t)=>({taskId:w(t,e,"task-unclaim"),taskStatus:t.taskStatus??t.status??"",assigneeId:t.claimedById??t.assigneeId??null,taskNumber:t.taskNumber??null}))}});function w(r,s,e){const a=r?.id;if(!a)throw new n(`Slock ${e} succeeded without returning task id ${s}; refusing to report a task row.`);if(a!==s)throw new n(`Slock ${e} returned task id ${a}, expected ${s}.`);return a}
@@ -0,0 +1 @@
1
+ import{makeThreadStateCommand as e}from"./thread-state.js";e({name:"thread-done",verb:"done",resultLabel:"done",description:"Mark a thread as done / hide it from the active list (POST /channels/threads/done)"});
@@ -0,0 +1 @@
1
+ import{cli as W,Strategy as X}from"@jackwener/opencli/registry";import{ArgumentError as Y,CommandExecutionError as Z}from"@jackwener/opencli/errors";import{buildFetchSnippet as $}from"./in-page.js";import{dispatchEvaluateResult as b}from"./errors.js";import{SLOCK_SITE as f,SLOCK_DOMAIN as x,SLOCK_HOME_URL as D}from"./shared.js";import{assertMessageIdShape as F}from"./resolve.js";W({site:f,name:"thread-follow",access:"write",description:"Follow the thread on a parent message (POST /channels/threads/follow)",domain:x,strategy:X.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"parentMessageId",positional:!0,required:!0,help:"Full parent messageId UUID (short ids rejected)"},{name:"server",help:"Override active server"}],columns:["parentMessageId","threadChannelId","result"],func:async(B,G)=>{let q;try{q=F(String(G.parentMessageId??""))}catch(V){throw new Y(V.message)}await B.goto(D);const P=$({method:"POST",path:"/channels/threads/follow",body:{parentMessageId:q},serverScoped:!0,serverIdOverride:G.server}),Q=await B.evaluate(`(async () => { ${P} })()`),z=b(Q),J=z?.threadChannelId??z?.channelId??z?.id;if(!J)throw new Z(`Slock thread-follow succeeded without returning a thread channel id for parent message ${q}.`);return[{parentMessageId:q,threadChannelId:J,result:"followed"}]}});
@@ -0,0 +1 @@
1
+ import{cli as d,Strategy as l}from"@jackwener/opencli/registry";import{CommandExecutionError as i}from"@jackwener/opencli/errors";import{buildFetchSnippet as p}from"./in-page.js";import{dispatchEvaluateResult as u}from"./errors.js";import{SLOCK_SITE as h,SLOCK_DOMAIN as c,SLOCK_HOME_URL as m}from"./shared.js";d({site:h,name:"thread-list",access:"read",description:"List followed threads in the active server (GET /channels/threads/followed)",domain:c,strategy:l.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"server",help:"Override active server"}],columns:["threadChannelId","parentMessageId","parentChannelName","unreadCount","replyCount","lastReplyAt"],func:async(a,n)=>{await a.goto(m);const s=p({method:"GET",path:"/channels/threads/followed",serverScoped:!0,serverIdOverride:n.server}),o=await a.evaluate(`(async () => { ${s} })()`),r=u(o),t=Array.isArray(r)?r:r.threads||[];if(!Array.isArray(t))throw new i(`expected threads array, got ${typeof t} (contract drift?)`);return t.map((e)=>({threadChannelId:e.threadChannelId??e.id??"",parentMessageId:e.parentMessageId??"",parentChannelName:e.parentChannelName??"",unreadCount:typeof e.unreadCount==="number"?e.unreadCount:0,replyCount:typeof e.replyCount==="number"?e.replyCount:null,lastReplyAt:e.lastReplyAt??null}))}});
@@ -0,0 +1 @@
1
+ import{cli as W,Strategy as X}from"@jackwener/opencli/registry";import{ArgumentError as Y}from"@jackwener/opencli/errors";import{buildFetchSnippet as Z}from"./in-page.js";import{dispatchEvaluateResult as $}from"./errors.js";import{SLOCK_SITE as F,SLOCK_DOMAIN as H,SLOCK_HOME_URL as N}from"./shared.js";import{UUID_RE as T}from"./resolve.js";export function makeThreadStateCommand({name:B,verb:G,resultLabel:J,description:P}){W({site:F,name:B,access:"write",description:P,domain:H,strategy:X.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"threadChannelId",positional:!0,required:!0,help:"Thread channel UUID (from thread-list / message-read)"},{name:"server",help:"Override active server"}],columns:["threadChannelId","result"],func:async(x,z)=>{const q=String(z.threadChannelId??"").trim();if(!T.test(q))throw new Y(`threadChannelId must be a full UUID (got "${q}"). Get it from thread-list or message-read's threadChannelId column.`);await x.goto(N);const Q=Z({method:"POST",path:`/channels/threads/${G}`,body:{threadChannelId:q},serverScoped:!0,serverIdOverride:z.server}),V=await x.evaluate(`(async () => { ${Q} })()`);$(V);return[{threadChannelId:q,result:J}]}})}
@@ -0,0 +1 @@
1
+ import{makeThreadStateCommand as e}from"./thread-state.js";e({name:"thread-undone",verb:"undone",resultLabel:"undone",description:"Restore a done thread to the active list (POST /channels/threads/undone)"});
@@ -0,0 +1 @@
1
+ import{makeThreadStateCommand as o}from"./thread-state.js";o({name:"thread-unfollow",verb:"unfollow",resultLabel:"unfollowed",description:"Stop following a thread (POST /channels/threads/unfollow)"});
@@ -0,0 +1,18 @@
1
+ import{cli as X,Strategy as Y}from"@jackwener/opencli/registry";import{CommandExecutionError as Z}from"@jackwener/opencli/errors";import{authHeadersFragment as $}from"./in-page.js";import{dispatchEvaluateResult as b}from"./errors.js";import{SLOCK_SITE as f,SLOCK_DOMAIN as q,SLOCK_HOME_URL as x,SLOCK_API_BASE as Q}from"./shared.js";X({site:f,name:"unread-summary",access:"read",description:"Global unread counts across every server you belong to.",domain:q,strategy:Y.COOKIE,browser:!0,siteSession:"persistent",args:[],columns:["serverId","slug","name","unreadCount"],func:async(J)=>{await J.goto(x);const V=`
2
+ ${$({serverScoped:!1})}
3
+ const sres = await fetch('${Q}/servers/', { credentials:'include', headers });
4
+ if (sres.status === 401) return { kind: 'auth', detail: '/servers/ returned 401' };
5
+ if (!sres.ok) return { kind: 'http', status: sres.status, where:'/servers/' };
6
+ const servers = await sres.json();
7
+ const ures = await fetch('${Q}/servers/unread-summary', { credentials:'include', headers });
8
+ if (ures.status === 401) return { kind: 'auth', detail: '/servers/unread-summary returned 401' };
9
+ if (!ures.ok) return { kind: 'http', status: ures.status, where:'/servers/unread-summary' };
10
+ const summary = await ures.json();
11
+ const byId = {};
12
+ (Array.isArray(servers) ? servers : []).forEach((s) => { if (s && s.id) byId[s.id] = s; });
13
+ const rows = (Array.isArray(summary) ? summary : []).map((u) => {
14
+ const s = byId[u.serverId] || {};
15
+ return { serverId: u.serverId, slug: s.slug || '', name: s.name || '', unreadCount: u.unreadCount || 0 };
16
+ });
17
+ return { kind: 'ok', rows };
18
+ `,W=await J.evaluate(`(async () => { ${V} })()`),z=b(W);if(!Array.isArray(z))throw new Z(`expected array of summary rows, got ${typeof z} (contract drift?)`);return z}});
@@ -0,0 +1 @@
1
+ import{registerSiteAuthCommands as e}from"../_shared/site-auth.js";import{SLOCK_SITE as o,SLOCK_DOMAIN as r,SLOCK_HOME_URL as m}from"./shared.js";import{verifySlockSession as s}from"./auth-verify.js";e({site:o,domain:r,loginUrl:m,verify:(i)=>s(i),columns:["id","name","email"]});
@@ -0,0 +1,71 @@
1
+ import{cli as O,Strategy as P}from"@jackwener/opencli/registry";import{ArgumentError as D,CommandExecutionError as Q}from"@jackwener/opencli/errors";function F(f){if(f&&!Array.isArray(f)&&typeof f==="object"&&"session"in f&&"data"in f)return f.data;return f}function G(f){const B=F(f);if(!Array.isArray(B))throw new Q("Unexpected SMZDM search extraction payload shape; expected an array of rows.");return B}function H(f){let B;if(f==null)B=20;else if(typeof f==="number")B=f;else if(typeof f==="string"&&/^[0-9]+$/.test(f))B=Number(f);else B=NaN;if(!Number.isFinite(B)||!Number.isInteger(B))throw new D(`--limit must be an integer between 1 and 100, got ${JSON.stringify(f)}`);if(B<1||B>100)throw new D(`--limit must be between 1 and 100, got ${B}`);return B}function I(f){return`
2
+ (() => {
3
+ const limit = ${f};
4
+ const items = document.querySelectorAll('li.feed-row-wide');
5
+ const results = [];
6
+ const normalizeCount = (text) => {
7
+ const raw = (text || '').replace(/,/g, '').trim();
8
+ const match = raw.match(/(\\d+(?:\\.\\d+)?)\\s*([万kK]?)/);
9
+ if (!match) return 0;
10
+ const base = Number(match[1]);
11
+ if (!Number.isFinite(base)) return 0;
12
+ const unit = match[2];
13
+ if (unit === '万') return Math.round(base * 10000);
14
+ if (unit === 'k' || unit === 'K') return Math.round(base * 1000);
15
+ return Math.round(base);
16
+ };
17
+ const intFrom = (el) => {
18
+ if (!el) return 0;
19
+ return normalizeCount(el.textContent || '');
20
+ };
21
+ const trustedSmzdmUrl = (raw) => {
22
+ const text = (raw || '').trim();
23
+ if (!text) return '';
24
+ let url;
25
+ try {
26
+ url = text.startsWith('/')
27
+ ? new URL(text, 'https://www.smzdm.com')
28
+ : new URL(text, location.href);
29
+ } catch {
30
+ return '';
31
+ }
32
+ const hostname = url.hostname.toLowerCase();
33
+ if (url.protocol !== 'https:' || (hostname !== 'www.smzdm.com' && hostname !== 'post.smzdm.com')) {
34
+ return '';
35
+ }
36
+ return url.toString();
37
+ };
38
+ items.forEach((li) => {
39
+ if (results.length >= limit) return;
40
+ const titleEl = li.querySelector('h5.feed-block-title > a')
41
+ || li.querySelector('h5 > a');
42
+ if (!titleEl) return;
43
+ const title = (titleEl.getAttribute('title') || titleEl.textContent || '').trim();
44
+ const url = trustedSmzdmUrl(titleEl.getAttribute('href') || titleEl.href || '');
45
+ if (!title || !url) return;
46
+ const priceEl = li.querySelector('.z-highlight');
47
+ const price = priceEl ? priceEl.textContent.trim() : '';
48
+ let mall = '';
49
+ const mallEl = li.querySelector('.z-feed-foot-r .feed-block-extras span')
50
+ || li.querySelector('.z-feed-foot-r span');
51
+ if (mallEl) mall = mallEl.textContent.trim();
52
+ // Update time lives as the direct text node(s) of .feed-block-extras,
53
+ // alongside the nested mall <span> which we exclude here.
54
+ let updated_at = '';
55
+ const extrasEl = li.querySelector('.z-feed-foot-r .feed-block-extras');
56
+ if (extrasEl) {
57
+ updated_at = Array.from(extrasEl.childNodes)
58
+ .filter((node) => node.nodeType === 3)
59
+ .map((node) => (node.textContent || '').trim())
60
+ .filter(Boolean)
61
+ .join(' ');
62
+ }
63
+ const zhi_count = intFrom(li.querySelector('.price-btn-up .unvoted-wrap span'));
64
+ const buzhi_count = intFrom(li.querySelector('.price-btn-down .unvoted-wrap span'));
65
+ const favorite_count = intFrom(li.querySelector('.feed-btn-fav span'));
66
+ const comments = intFrom(li.querySelector('.feed-btn-comment'));
67
+ results.push({ rank: results.length + 1, title, price, mall, updated_at, zhi_count, buzhi_count, favorite_count, comments, url });
68
+ });
69
+ return results;
70
+ })()
71
+ `}export const smzdmSearchCommand=O({site:"smzdm",name:"search",access:"read",description:"什么值得买搜索好价",domain:"www.smzdm.com",strategy:P.COOKIE,args:[{name:"query",required:!0,positional:!0,help:"Search keyword"},{name:"limit",type:"int",default:20,help:"Number of results"}],columns:["rank","title","price","mall","updated_at","zhi_count","buzhi_count","favorite_count","comments","url"],func:async(f,B)=>{const K=encodeURIComponent(B.query),M=H(B.limit);await f.goto(`https://search.smzdm.com/?c=home&s=${K}&v=b`);return G(await f.evaluate(I(M)))}}),__test__={buildSmzdmSearchJs:I,parseLimit:H,requireSearchRows:G,unwrapEvaluateResult:F};
@@ -0,0 +1 @@
1
+ import{CliError as $,CommandExecutionError as v}from"@jackwener/opencli/errors";import{cli as N,Strategy as b}from"@jackwener/opencli/registry";import{publishArticle as f,gotoWritePage as P}from"../_shared/article/publish.js";import{SOHU_MPBP_HEADERS_JS as R}from"./mpbp.js";function k(){const Q="0123456789abcdef";let K="";for(let z=0;z<32;z++)K+=Q[Math.floor(Math.random()*Q.length)];return K}export const sohuProfile={home:"https://mp.sohu.com/mpfe/v3/main/first/page?newsType=1",outputFormat:"html",preprocessConfig:{},checkAuth:async(Q)=>{try{const z=await(await fetch("https://mp.sohu.com/mpbp/bp/account/list?_="+Date.now(),{method:"GET",credentials:"include"})).json();if(z.code!==2000000||!z.data?.data?.length)return{isAuthenticated:!1};const L=[];for(const V of z.data.data)if(V.accounts)L.push(...V.accounts);if(!L.length)return{isAuthenticated:!1};const G=L[0],X=L.length>1?G.nickName+"(共"+L.length+"个子账号)":G.nickName;return{isAuthenticated:!0,userId:String(G.id),username:X,avatar:G.avatar||""}}catch(K){return{isAuthenticated:!1,error:String(K&&K.message||K)}}},image:{skip:["sohu.com"],uploadFn:async(Q,K)=>{const L=await(await fetch("https://mp.sohu.com/mpbp/bp/account/list?_="+Date.now(),{method:"GET",credentials:"include"})).json();if(L.code!==2000000||!L.data?.data?.length)throw Error("获取搜狐账号信息失败,请确认已登录搜狐号");const G=[];for(const H of L.data.data)if(H.accounts)G.push(...H.accounts);if(!G.length)throw Error("搜狐号子账号列表为空");const X=String(G[0].id),V=await fetch(Q,{credentials:"omit"});if(!V.ok)throw Error("图片下载失败("+V.status+"):"+Q);const Y=await V.blob(),M=new FormData;M.append("file",Y,"image.jpg");M.append("accountId",X);const W=await(await fetch("https://mp.sohu.com/commons/front/outerUpload/image/file?accountId="+X,{method:"POST",credentials:"include",body:M})).json();if(!W.url)throw Error("搜狐图片上传失败:"+(W.msg||JSON.stringify(W).slice(0,100)));return{url:W.url}}},publish:async(Q,K)=>{const z=Q.params||{},L=await fetch("https://mp.sohu.com/mpbp/bp/account/list?_="+Date.now(),{method:"GET",credentials:"include"}),G=await L.json();if(G.code!==2000000||!G.data?.data?.length)return{ok:!1,stage:"auth",status:L.status,message:"获取搜狐账号信息失败,请确认已登录搜狐号"};const X=[];for(const F of G.data.data)if(F.accounts)X.push(...F.accounts);if(!X.length)return{ok:!1,stage:"auth",status:0,message:"搜狐号子账号列表为空"};const V=Number(X[0].id),Y="0123456789abcdef";let M="";for(let F=0;F<32;F++)M+=Y[Math.floor(Math.random()*Y.length)];const B="100-"+Date.now()+"-"+M,W=Number(z.channelId);if(!Number.isFinite(W)||W<=0)return{ok:!1,stage:"params",status:0,message:"缺少合法 channelId(频道 id),请先用 `sohu channels` 取值"};const H=z.categoryId==null||z.categoryId===""?-1:Number(z.categoryId),_={title:Q.title,brief:typeof z.brief==="string"?z.brief:"",content:Q.content,channelId:W,categoryId:H,id:0,userColumnId:z.userColumnId==null||z.userColumnId==-1?0:Number(z.userColumnId),columnNewsIds:Array.isArray(z.columnNewsIds)?z.columnNewsIds:[],businessCode:0,declareOriginal:Boolean(z.declareOriginal),cover:typeof z.cover==="string"?z.cover:"",topicIds:Array.isArray(z.topicIds)?z.topicIds:[],isAd:0,userLabels:"[]",reprint:!1,customTags:typeof z.customTags==="string"?z.customTags:"",infoResource:0,sourceUrl:"",visibleToLoginedUsers:0,attrIds:Array.isArray(z.attrIds)?z.attrIds:[],accountId:V};if(Q.draftOnly){const F=Object.assign({},_,{auto:!0}),q=await fetch("https://mp.sohu.com/mpbp/bp/news/v4/news/draft/v2?accountId="+V,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","dv-id":M,"sp-cm":B},body:JSON.stringify(F)}),x=await q.text();let D=null;try{D=JSON.parse(x)}catch(i){}if(!q.ok||!D||!D.success)return{ok:!1,stage:"draft",status:q.status,message:D&&D.msg||x.slice(0,300)};const A=String(D.data),E="https://mp.sohu.com/mpfe/v4/contentManagement/news/addarticle?spm=smmp.articlelist.0.0&contentStatus=2&id="+A;return{ok:!0,id:A,url:E,draft:!0}}const U=await fetch("https://mp.sohu.com/mpbp/bp/news/v4/news/publish/v2?accountId="+V,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","dv-id":M,"sp-cm":B},body:JSON.stringify(_)}),S=await U.text();let Z=null;try{Z=JSON.parse(S)}catch(F){}if(!U.ok||!Z||Z.code!==2000000){let F=Z&&(Z.msg||Z.message)||"";if(!F){const q=[];if(H!==-1)q.push("--category");if(Array.isArray(z.topicIds)&&z.topicIds.length>0)q.push("--topics");if(_.cover)q.push("--cover");F="搜狐发布接口返回非 JSON 错误页(HTTP "+U.status+")。"+(q.length?"实测该 500 多由可选参数触发——去掉 "+q.join(" / ")+"、只保留必填 --channel 重试即可。":"稍后重试;若持续失败,用 `sohu stats` 确认是否已产生重复内容。")}return{ok:!1,stage:"publish",status:U.status,message:F}}if(Z.data!=null&&Object.prototype.toString.call(Z.data)==="[object Object]")return{ok:!1,stage:"origin_check",status:U.status,message:"声明原创触发了原创校验(需在搜狐后台完成原创确认):"+JSON.stringify(Z.data).slice(0,200)};const J=String(Z.data),T="https://mp.sohu.com/mpfe/v4/contentManagement/news/addarticle?spm=smmp.articlelist.0.0&contentStatus=1&id="+J;return{ok:!0,id:J,url:T,draft:!1}}},sohuAuthProfile={home:sohuProfile.home,checkAuth:sohuProfile.checkAuth};function y(Q){if(!Q.execute)throw new $("INVALID_INPUT","此命令需要 --execute 才会真正写入。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function j(Q){const K=typeof Q.text==="string"?Q.text:void 0,z=typeof Q.file==="string"?Q.file:void 0;if(K&&z)throw new $("INVALID_INPUT","text 和 --file 只能二选一");let L=K??"";if(z){const{readFile:G,stat:X}=await import("node:fs/promises");let V;try{V=await X(z)}catch{throw new $("INVALID_INPUT","文件不存在:"+z)}if(!V.isFile())throw new $("INVALID_INPUT","路径不是可读文本文件:"+z);let Y;try{Y=await G(z)}catch{throw new $("INVALID_INPUT","文件读取失败:"+z)}try{L=new TextDecoder("utf-8",{fatal:!0}).decode(Y)}catch{throw new $("INVALID_INPUT","文件不是合法 UTF-8 编码:"+z)}}if(!L.trim())throw new $("INVALID_INPUT","正文不能为空");return L}function C(Q,K,z,L,G={}){return[{status:"success",outcome:L,message:Q,target_type:K,target:z,...G}]}async function O(Q,K,z){const L="(async () => {try {"+R+"const r = await fetch("+JSON.stringify(K)+', { method: "GET", credentials: "include", headers: HDRS });const t = await r.text();let j = null; try { j = JSON.parse(t); } catch (e) {}return { ok: r.ok, status: r.status, json: j, text: t.slice(0, 300) };} catch (e) { return { ok: false, status: 0, json: null, text: String((e && e.message) || e) }; }})()',G=await Q.evaluate(L);if(!G||!G.ok||!G.json)throw new $("INVALID_INPUT","搜狐"+z+"接口请求失败(HTTP "+(G?G.status:"?")+"):"+(G?G.text:""));if(G.json.success===!1||G.json.code!=null&&G.json.code!==2000000&&G.json.code!==2000)throw new $("INVALID_INPUT","搜狐"+z+"接口返回错误:"+(G.json.msg||G.json.message||"未登录或无权限"));return G.json}async function m(Q){const K=await O(Q,"https://mp.sohu.com/mpbp/bp/account/list?_="+Date.now(),"账号列表"),z=K.data&&K.data.data||[],L=[];for(const G of z)if(G.accounts)L.push(...G.accounts);if(!L.length)throw new $("INVALID_INPUT","搜狐号子账号列表为空,请确认已登录搜狐号");return String(L[0].id)}async function I(Q,K,z){const L=await O(Q,"https://mp.sohu.com/mpbp/bp/account/common/channels-data-api?status=1&accountId="+encodeURIComponent(K),"频道列举"),G=Array.isArray(L)?L:L.data||[],X=G.find((V)=>String(V.name)===String(z));if(!X)throw new $("INVALID_INPUT","未找到频道「"+z+"」,可选:"+(G.map((V)=>V.name).join(" / ")||"(空)")+"。用 `sohu channels` 查看完整列表。");return Number(X.id!=null?X.id:X.channelId)}async function h(Q,K,z,L){const G=await O(Q,"https://mp.sohu.com/mpbp/bp/account/common/channels/"+z+"/categories?accountId="+encodeURIComponent(K),"分类列举"),X=Array.isArray(G)?G:G.data||[],V=X.find((Y)=>String(Y.name)===String(L));if(!V)throw new $("INVALID_INPUT","频道(id="+z+")下未找到分类「"+L+"」,可选:"+(X.map((Y)=>Y.name).join(" / ")||"(该频道无分类)")+"。用 `sohu categories --channel <频道名>` 查看。");return Number(V.id)}async function w(Q,K,z){const L=await O(Q,"https://mp.sohu.com/mpbp/bp/account/column/v2/list?accountId="+encodeURIComponent(K)+"&page=1&size=100","专栏列举"),G=Array.isArray(L)?L:L.data&&(L.data.data||L.data)||L.data||[],X=Array.isArray(G)?G:[],V=X.find((Y)=>String(Y.name)===String(z));if(!V)throw new $("INVALID_INPUT","未找到专栏「"+z+"」,可选:"+(X.map((Y)=>Y.name).join(" / ")||"(你还没有任何专栏)")+"。用 `sohu columns` 查看。");return Number(V.id)}async function d(Q,K,z){const L=z.split(",").map((X)=>X.trim()).filter(Boolean);if(!L.length)return[];const G=[];for(const X of L){const V=await O(Q,"https://mp.sohu.com/mpbp/bp/news/v4/label/topic/search?accountId="+K+"&keyword="+encodeURIComponent(X),"话题搜索"),M=(Array.isArray(V)?V:V.data||[]).find((B)=>String(B.name)===String(X));if(!M)throw new $("INVALID_INPUT","未找到话题「"+X+"」,请用 `sohu topics --keyword "+X+"` 搜索确认确切名称。");G.push(M.id)}return G}N({site:"sohu",name:"article",access:"write",description:"发布文章到搜狐号(HTML 格式,外链图片自动转存到搜狐图床)。默认正式发布,加 --draft 仅存草稿。频道必填,合法值用 `sohu channels` 取。",domain:"mp.sohu.com",strategy:b.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(默认 Markdown,传 --html 则视为 HTML)"},{name:"file",help:"正文文件路径(UTF-8,Markdown 或 HTML)"},{name:"html",type:"boolean",help:"将正文视为原始 HTML 而非 Markdown"},{name:"channel",help:"频道名(精确匹配,必填),合法值用 `sohu channels` 列举"},{name:"category",help:"分类名(精确匹配,依赖所选频道),合法值用 `sohu categories --channel <频道名>` 列举;不传=不限"},{name:"column",help:"专栏名(精确匹配),合法值用 `sohu columns` 列举;不传=不归属专栏"},{name:"topics",help:"话题名,逗号分隔(每个精确匹配),用 `sohu topics` 搜索取确切名"},{name:"cover",help:"封面图 URL(须为搜狐图床地址);可空"},{name:"brief",help:"文章摘要;可空"},{name:"declare-original",type:"boolean",help:"声明原创(会触发搜狐原创校验,发布将被拦到原创确认流程)"},{name:"draft",type:"boolean",help:"仅保存草稿,不正式发布"},{name:"execute",type:"boolean",help:"实际执行写入操作;不加此参数则拒绝写入(干跑保护)"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(Q,K)=>{if(!Q)throw new v("搜狐号文章发布需要浏览器会话");y(K);const z=String(K.title??"").trim();if(!z)throw new $("INVALID_INPUT","文章标题不能为空");const L=await j(K),G=Boolean(K.draft),X=typeof K.channel==="string"?K.channel.trim():"";if(!X)throw new $("INVALID_INPUT","缺少 --channel(频道名)。请先运行 `sohu channels` 取合法频道名再传入,不提供默认值。");await P(Q,sohuProfile.home);const V=await m(Q),Y=await I(Q,V,X);let M=-1;const B=typeof K.category==="string"?K.category.trim():"";if(B)M=await h(Q,V,Y,B);let W=0;const H=typeof K.column==="string"?K.column.trim():"";if(H)W=await w(Q,V,H);let _=[];const U=typeof K.topics==="string"?K.topics.trim():"";if(U)_=await d(Q,V,U);const S={channelId:Y,categoryId:M,userColumnId:W,topicIds:_,cover:typeof K.cover==="string"?K.cover.trim():"",brief:typeof K.brief==="string"?K.brief:"",declareOriginal:Boolean(K["declare-original"])},Z=await f(Q,{title:z,body:L,format:K.html?"html":"markdown",draftOnly:G,profile:sohuProfile,publishParams:S}),J=Z.images.uploaded.length|0,T=Z.images.failed.length|0;let F=Z.draft?"已保存搜狐号草稿":"已正式发布到搜狐号";if(J||T)F+=`;图片:${J} 张已转存${T?`,${T} 张失败`:""}`;return C(F,"article","",Z.draft?"draft":"created",{created_target:(Z.draft?"draft:":"article:")+Z.id,created_url:Z.url})}});export const __test__={sohuProfile,requireExecute:y,buildResultRow:C,resolvePayload:j,generateDeviceId:k};
@@ -0,0 +1 @@
1
+ import{cli as z,Strategy as A}from"@jackwener/opencli/registry";import{CommandExecutionError as B}from"@jackwener/opencli/errors";import{gotoWritePage as D}from"../_shared/article/publish.js";import{sohuProfile as F}from"./article.js";z({site:"sohu",name:"attributes",access:"read",description:"列出搜狐号文章属性候选(id + 名称),供发布时选择文章属性。",domain:"mp.sohu.com",strategy:A.COOKIE,browser:!0,columns:["attr_id","attr_name"],func:async(q)=>{if(!q)throw new B("搜狐号文章属性列举需要浏览器会话");await D(q,F.home);const v=await q.evaluate("(async () => {const r = await fetch('https://mp.sohu.com/mpbp/bp/news/v4/news/attribute', { method: 'GET', credentials: 'include' });const j = await r.json();"+"if (!j || j.success === false) throw new Error('文章属性列举失败:' + ((j && j.msg) || '未登录或无权限'));"+"const raw = (j && j.data) || [];const list = Array.isArray(raw) ? raw : (Array.isArray(raw.data) ? raw.data : []);return list.map(a => ({ attr_id: String(a.id), attr_name: a.name || a.attrName || '' }));})()");return Array.isArray(v)?v:[]}});
@@ -0,0 +1 @@
1
+ import{cli as G,Strategy as K}from"@jackwener/opencli/registry";import{CliError as L,CommandExecutionError as Q}from"@jackwener/opencli/errors";import{gotoWritePage as T}from"../_shared/article/publish.js";import{sohuProfile as V}from"./article.js";import{SOHU_MPBP_HEADERS_JS as X}from"./mpbp.js";G({site:"sohu",name:"categories",access:"read",description:"列出某个搜狐号频道下的分类(id + 名称),供 `sohu article --category` 取合法分类名。须用 --channel 指定频道名。",domain:"mp.sohu.com",strategy:K.COOKIE,browser:!0,args:[{name:"channel",required:!0,help:"频道名(精确匹配),合法值用 `sohu channels` 列举"}],columns:["category_id","category_name"],func:async(q,F)=>{if(!q)throw new Q("搜狐号分类列举需要浏览器会话");const v=String(F.channel??"").trim();if(!v)throw new L("INVALID_INPUT","请用 --channel 指定频道名");await T(q,V.home);const z=await q.evaluate("(async () => {"+X+"const ar = await fetch('https://mp.sohu.com/mpbp/bp/account/list?_=' + Date.now(), { method: 'GET', credentials: 'include', headers: HDRS });const aj = await ar.json();"+"if (!aj || aj.code !== 2000000 || !(aj.data && aj.data.data && aj.data.data.length)) throw new Error('获取搜狐账号失败,请确认已登录搜狐号');"+"let accountId = '';for (const g of aj.data.data) { if (g.accounts && g.accounts.length) { accountId = String(g.accounts[0].id); break; } }"+"if (!accountId) throw new Error('搜狐号子账号列表为空');"+"const cr = await fetch('https://mp.sohu.com/mpbp/bp/account/common/channels-data-api?status=1&accountId=' + accountId, { method: 'GET', credentials: 'include', headers: HDRS });const cj = await cr.json();"+"if (!cj || cj.success === false) throw new Error('频道列举失败:' + ((cj && cj.msg) || '未登录或无权限'));"+"const channels = Array.isArray(cj) ? cj : ((cj && cj.data) || []);const ch = channels.find(c => String(c.name) === "+JSON.stringify(v)+");"+"if (!ch) throw new Error('未找到频道「"+v.replace(/"/g,"\\\"")+"」,可选:' + (channels.map(c => c.name).join(' / ') || '(空)'));"+"const channelId = ch.id != null ? ch.id : ch.channelId;const r = await fetch('https://mp.sohu.com/mpbp/bp/account/common/channels/' + channelId + '/categories?accountId=' + accountId, { method: 'GET', credentials: 'include', headers: HDRS });const j = await r.json();"+"if (!j || j.success === false) throw new Error('分类列举失败:' + ((j && j.msg) || '未登录或无权限'));"+"const list = Array.isArray(j) ? j : ((j && j.data) || []);return list.map(c => ({ category_id: String(c.id), category_name: c.name || '' }));})()");return Array.isArray(z)?z:[]}});
@@ -0,0 +1 @@
1
+ import{cli as z,Strategy as F}from"@jackwener/opencli/registry";import{CommandExecutionError as G}from"@jackwener/opencli/errors";import{gotoWritePage as I}from"../_shared/article/publish.js";import{sohuProfile as K}from"./article.js";import{SOHU_MPBP_HEADERS_JS as L}from"./mpbp.js";z({site:"sohu",name:"channels",access:"read",description:"列出当前搜狐号可发布的频道(id + 名称),供 `sohu article --channel` 取合法频道名。",domain:"mp.sohu.com",strategy:F.COOKIE,browser:!0,columns:["channel_id","channel_name"],func:async(q)=>{if(!q)throw new G("搜狐号频道列举需要浏览器会话");await I(q,K.home);const v=await q.evaluate("(async () => {"+L+"const ar = await fetch('https://mp.sohu.com/mpbp/bp/account/list?_=' + Date.now(), { method: 'GET', credentials: 'include', headers: HDRS });const aj = await ar.json();"+"if (!aj || aj.code !== 2000000 || !(aj.data && aj.data.data && aj.data.data.length)) throw new Error('获取搜狐账号失败,请确认已登录搜狐号');"+"let accountId = '';for (const g of aj.data.data) { if (g.accounts && g.accounts.length) { accountId = String(g.accounts[0].id); break; } }"+"if (!accountId) throw new Error('搜狐号子账号列表为空');"+"const r = await fetch('https://mp.sohu.com/mpbp/bp/account/common/channels-data-api?status=1&accountId=' + accountId, { method: 'GET', credentials: 'include', headers: HDRS });const j = await r.json();"+"if (!j || j.success === false) throw new Error('频道列举失败:' + ((j && j.msg) || '未登录或无权限'));"+"const list = Array.isArray(j) ? j : ((j && j.data) || []);return list.map(c => ({ channel_id: String(c.id != null ? c.id : c.channelId), channel_name: c.name || '' }));})()");return Array.isArray(v)?v:[]}});
@@ -0,0 +1 @@
1
+ import{cli as z,Strategy as F}from"@jackwener/opencli/registry";import{CommandExecutionError as G}from"@jackwener/opencli/errors";import{gotoWritePage as I}from"../_shared/article/publish.js";import{sohuProfile as K}from"./article.js";import{SOHU_MPBP_HEADERS_JS as L}from"./mpbp.js";z({site:"sohu",name:"columns",access:"read",description:"列出当前搜狐号的专栏(id + 名称),供 `sohu article --column` 取合法专栏名。",domain:"mp.sohu.com",strategy:F.COOKIE,browser:!0,columns:["column_id","column_name"],func:async(q)=>{if(!q)throw new G("搜狐号专栏列举需要浏览器会话");await I(q,K.home);const v=await q.evaluate("(async () => {"+L+"const ar = await fetch('https://mp.sohu.com/mpbp/bp/account/list?_=' + Date.now(), { method: 'GET', credentials: 'include', headers: HDRS });const aj = await ar.json();"+"if (!aj || aj.code !== 2000000 || !(aj.data && aj.data.data && aj.data.data.length)) throw new Error('获取搜狐账号失败,请确认已登录搜狐号');"+"let accountId = '';for (const g of aj.data.data) { if (g.accounts && g.accounts.length) { accountId = String(g.accounts[0].id); break; } }"+"if (!accountId) throw new Error('搜狐号子账号列表为空');"+"const r = await fetch('https://mp.sohu.com/mpbp/bp/account/column/v2/list?accountId=' + accountId + '&page=1&size=100', { method: 'GET', credentials: 'include', headers: HDRS });const j = await r.json();"+"if (!j || j.success === false) throw new Error('专栏列举失败:' + ((j && j.msg) || '未登录或无权限'));"+"const raw = Array.isArray(j) ? j : ((j && j.data) || []);const list = Array.isArray(raw) ? raw : (Array.isArray(raw.data) ? raw.data : []);return list.map(c => ({ column_id: String(c.id), column_name: c.name || '' }));})()");return Array.isArray(v)?v:[]}});
@@ -0,0 +1 @@
1
+ import{registerArticleLogin as k}from"../_shared/article/login.js";import{sohuAuthProfile as b}from"./article.js";k({site:"sohu",domain:"mp.sohu.com",profile:{home:b.home,checkAuth:b.checkAuth},loginDescription:"打开搜狐号登录页并等待浏览器完成登录(供桌面客户端引导登录)。"});
@@ -0,0 +1 @@
1
+ export const SOHU_MPBP_HEADERS_JS="let __dvId = '', __spCm = '';try { __dvId = localStorage.getItem('preview-dv-id') || ''; __spCm = localStorage.getItem('preview-sp-cm') || ''; } catch (e) {}if (!__dvId || !__spCm) { const __chars = '0123456789abcdef'; let __gen = ''; for (let __i = 0; __i < 32; __i++) __gen += __chars[Math.floor(Math.random() * 16)]; if (!__dvId) __dvId = __gen; if (!__spCm) __spCm = '100-' + Date.now() + '-' + __gen;}const HDRS = { 'X-Requested-With': 'XMLHttpRequest', 'dv-id': __dvId, 'sp-cm': __spCm };";
@@ -0,0 +1,95 @@
1
+ import{cli as A,Strategy as C}from"@jackwener/opencli/registry";import{CommandExecutionError as L,EmptyResultError as G}from"@jackwener/opencli/errors";import{gotoWritePage as P}from"../_shared/article/publish.js";const T="https://mp.sohu.com/mpfe/v4/contentManagement/news/articlelist",_=10;function R(M){if(!M)return"";const F=new Date(M+28800000),J=(Q)=>String(Q).padStart(2,"0");return`${F.getUTCFullYear()}-${J(F.getUTCMonth()+1)}-${J(F.getUTCDate())} ${J(F.getUTCHours())}:${J(F.getUTCMinutes())}`}function W(M){const F=new Date(Date.now()+28800000-M*86400000),J=(Q)=>String(Q).padStart(2,"0");return`${F.getUTCFullYear()}-${J(F.getUTCMonth()+1)}-${J(F.getUTCDate())}`}A({site:"sohu",name:"stats",access:"read",description:"搜狐号文章数据(每篇阅读/评论/播放等全量运营指标;点赞/分享/投票仅覆盖最近30天已发布内容)",domain:"mp.sohu.com",strategy:C.COOKIE,browser:!0,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","status","views","likes","comments","collects","shares","video_plays","votes","extra"],func:async(M,F)=>{if(!M)throw new L("搜狐号文章数据需要浏览器会话");const J=Number(F.limit)>0?Math.floor(Number(F.limit)):20;await P(M,T);const Q={limit:J,pageSize:_,startDate:W(30),endDate:W(0)},H=await M.evaluate(`(async () => {
2
+ const P = ${JSON.stringify(Q)};
3
+
4
+ // ── 请求头:dv-id / sp-cm 优先取页面自己存的值,逐字复刻 ──
5
+ let dvId = '', spCm = '';
6
+ try {
7
+ dvId = localStorage.getItem('preview-dv-id') || '';
8
+ spCm = localStorage.getItem('preview-sp-cm') || '';
9
+ } catch (e) {}
10
+ if (!dvId || !spCm) {
11
+ const chars = '0123456789abcdef';
12
+ let gen = '';
13
+ for (let i = 0; i < 32; i++) gen += chars[Math.floor(Math.random() * chars.length)];
14
+ if (!dvId) dvId = gen;
15
+ if (!spCm) spCm = '100-' + Date.now() + '-' + gen;
16
+ }
17
+ const HDRS = { 'X-Requested-With': 'XMLHttpRequest', 'dv-id': dvId, 'sp-cm': spCm };
18
+
19
+ const getJson = async (url) => {
20
+ const r = await fetch(url, { method: 'GET', credentials: 'include', headers: HDRS });
21
+ const t = await r.text();
22
+ let j = null;
23
+ try { j = JSON.parse(t); } catch (e) {}
24
+ if (!r.ok || !j || j.success === false || (j.code != null && j.code !== 2000000)) {
25
+ throw new Error('HTTP ' + r.status + ' ' + ((j && (j.msg || j.message)) || t.slice(0, 150)));
26
+ }
27
+ return j;
28
+ };
29
+
30
+ // ── accountId(与 article.js checkAuth 同一接口)──
31
+ let accountId = '';
32
+ try {
33
+ const auth = await getJson('https://mp.sohu.com/mpbp/bp/account/list?_=' + Date.now());
34
+ const accounts = [];
35
+ for (const g of (auth.data && auth.data.data) || []) {
36
+ if (g.accounts) accounts.push(...g.accounts);
37
+ }
38
+ if (!accounts.length) return { err: '搜狐号子账号列表为空,请确认已登录搜狐号' };
39
+ accountId = String(accounts[0].id);
40
+ } catch (e) {
41
+ return { err: '获取搜狐账号信息失败(可能未登录搜狐号):' + String((e && e.message) || e) };
42
+ }
43
+
44
+ // ── 内容列表:statusType=1(全部),按页面原样 psize=10 翻页 ──
45
+ const listUrl = (statusType, pno) =>
46
+ 'https://mp.sohu.com/mpbp/bp/news/v4/users/news?psize=' + P.pageSize
47
+ + '&newsType=0&statusType=' + statusType + '&columnId=&pno=' + pno
48
+ + '&streamId=&accountId=' + accountId + '&_=' + Date.now();
49
+ const news = [];
50
+ let total = 0;
51
+ try {
52
+ for (let pno = 1; news.length < P.limit; pno++) {
53
+ const j = await getJson(listUrl(1, pno));
54
+ const rows = (j.data && j.data.news) || [];
55
+ total = (j.data && j.data.totalCount) || total;
56
+ news.push(...rows);
57
+ if (!rows.length || news.length >= total) break;
58
+ }
59
+ } catch (e) {
60
+ return { err: '搜狐号内容列表接口请求失败:' + String((e && e.message) || e) };
61
+ }
62
+
63
+ // ── 已发布集合:statusType=2(「已发布」tab,同样为观测值)──
64
+ const publishedIds = [];
65
+ try {
66
+ for (let pno = 1; ; pno++) {
67
+ const j = await getJson(listUrl(2, pno));
68
+ const rows = (j.data && j.data.news) || [];
69
+ for (const r of rows) publishedIds.push(String(r.id));
70
+ const tc = (j.data && j.data.totalCount) || 0;
71
+ if (!rows.length || publishedIds.length >= tc || pno >= 20) break;
72
+ }
73
+ } catch (e) { /* 已发布集合仅用于 status 标注,失败不阻断(下方 status 回落为空) */ }
74
+
75
+ // ── 单篇统计(最近30天,实时):{data:{news:[...], totalCount}} ──
76
+ const statRows = [];
77
+ let statError = '';
78
+ try {
79
+ for (let pg = 1; pg <= 20; pg++) {
80
+ const j = await getJson(
81
+ 'https://mp.sohu.com/mpbp/bp/news/v4/users/stat/single/list?page=' + pg
82
+ + '&type=0&startDate=' + P.startDate + '&endDate=' + P.endDate
83
+ + '&accountId=' + accountId,
84
+ );
85
+ const rows = (j.data && j.data.news) || [];
86
+ statRows.push(...rows);
87
+ const tc = (j.data && j.data.totalCount) || 0;
88
+ if (!rows.length || statRows.length >= tc) break;
89
+ }
90
+ } catch (e) {
91
+ statError = String((e && e.message) || e);
92
+ }
93
+
94
+ return { accountId, news: news.slice(0, P.limit), totalCount: total, publishedIds, statRows, statError };
95
+ })()`);if(!H||H.err)throw new L(H&&H.err||"搜狐号文章数据获取失败:页面未返回任何数据(请确认已登录 mp.sohu.com)");const V=Array.isArray(H.news)?H.news:[];if(!V.length)throw new G("sohu stats","该搜狐号名下没有任何内容(或列表接口返回为空)。请先在 mp.sohu.com 发布内容后再查数据。");const X=new Map,Y=new Map;for(const q of Array.isArray(H.statRows)?H.statRows:[]){if(q&&q.id!=null)X.set(String(q.id),q);if(q&&typeof q.title==="string"&&q.title)Y.set(q.title,q)}const U=(q,O)=>{if(!q)return"";for(const K of O)if(typeof q[K]==="number")return q[K];return""},Z=new Set(Array.isArray(H.publishedIds)?H.publishedIds:[]);return V.map((q)=>{const O=q.id!=null?String(q.id):"",K=X.get(O)||Y.get(q.title||"")||null,$=Z.has(O),z={};if(q.auditStatus!=null)z.audit_status=q.auditStatus;if(q.status!=null)z.status_raw=q.status;if(q.rejectReason)z.reject_reason=q.rejectReason;if(q.original!=null)z.original=q.original;if(q.star!=null)z.star=q.star;if(q.secureScore!=null)z.secure_score=q.secureScore;if(q.channelId!=null)z.channel_id=q.channelId;if(q.modifiedTime)z.modified_at=R(q.modifiedTime);if(q.brief)z.brief=String(q.brief).slice(0,80);if(K)z.stat=K;if(H.statError)z.stat_error="单篇统计接口失败:"+H.statError;return{id:O,type:q.type!=null?String(q.type):"",title:q.title||q.mobileTitle||"",url:O?"https://mp.sohu.com/mpfe/v4/contentManagement/news/addarticle?spm=smmp.articlelist.0.0&contentStatus="+($?1:2)+"&id="+O:"",published_at:R(q.postTime||q.createdTime),status:$?"已发布":"未发布",views:typeof q.pv==="number"?q.pv:"",likes:U(K,["digg","diggCount","like","likeCount","praise","zan"]),comments:typeof q.cmt==="number"?q.cmt:U(K,["cmt","comment","commentCount"]),collects:"",shares:U(K,["share","shareCount","forward","forwardCount"]),video_plays:typeof q.videoPlayPv==="number"?q.videoPlayPv:"",votes:U(K,["vote","voteCount"]),extra:Object.keys(z).length?JSON.stringify(z):""}})}});
@@ -0,0 +1 @@
1
+ import{cli as G,Strategy as I}from"@jackwener/opencli/registry";import{CommandExecutionError as K}from"@jackwener/opencli/errors";import{gotoWritePage as L}from"../_shared/article/publish.js";import{sohuProfile as N}from"./article.js";import{SOHU_MPBP_HEADERS_JS as Q}from"./mpbp.js";G({site:"sohu",name:"topics",access:"read",description:"列举/搜索搜狐号话题(id + 名称 + 类型),供 `sohu article --topics` 取确切话题名。不传 --keyword 为推荐话题,传则按关键词搜索。",domain:"mp.sohu.com",strategy:I.COOKIE,browser:!0,args:[{name:"keyword",help:"搜索关键词;不传则返回推荐话题列表"}],columns:["topic_id","topic_name","topic_type"],func:async(q,v)=>{if(!q)throw new K("搜狐号话题列举需要浏览器会话");const F=typeof v.keyword==="string"?v.keyword.trim():"";await L(q,N.home);const z=await q.evaluate("(async () => {"+Q+"const ar = await fetch('https://mp.sohu.com/mpbp/bp/account/list?_=' + Date.now(), { method: 'GET', credentials: 'include', headers: HDRS });const aj = await ar.json();"+"if (!aj || aj.code !== 2000000 || !(aj.data && aj.data.data && aj.data.data.length)) throw new Error('获取搜狐账号失败,请确认已登录搜狐号');"+"let accountId = '';for (const g of aj.data.data) { if (g.accounts && g.accounts.length) { accountId = String(g.accounts[0].id); break; } }"+"if (!accountId) throw new Error('搜狐号子账号列表为空');"+"const kw = "+JSON.stringify(F)+";const url = kw ? 'https://mp.sohu.com/mpbp/bp/news/v4/label/topic/search?accountId=' + accountId + '&keyword=' + encodeURIComponent(kw) : 'https://mp.sohu.com/mpbp/bp/news/v4/label/topic/list?accountId=' + accountId;const r = await fetch(url, { method: 'GET', credentials: 'include', headers: HDRS });const j = await r.json();"+"if (!j || j.success === false) throw new Error('话题接口失败:' + ((j && j.msg) || '未登录或无权限'));"+"const list = Array.isArray(j) ? j : ((j && j.data) || []);return list.map(t => ({ topic_id: String(t.id), topic_name: t.name || '', topic_type: t.type != null ? String(t.type) : '' }));})()");return Array.isArray(z)?z:[]}});
@@ -0,0 +1 @@
1
+ import{cli as q,Strategy as v}from"@jackwener/opencli/registry";import{checkLogin as x,cookieQuickCheck as z}from"../_shared/article/auth.js";import{sohuAuthProfile as B}from"./article.js";q({site:"sohu",name:"whoami",access:"read",description:"查看当前搜狐号登录账号信息(用户名、用户 ID)。",domain:"mp.sohu.com",strategy:v.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:z("https://mp.sohu.com",["pprdig"])},func:async(m)=>{const b=await x(m,B);return[{logged_in:b.isAuthenticated,user_id:b.userId||"",username:b.username||""}]}});
@@ -0,0 +1 @@
1
+ import{cli as X,Strategy as Y}from"@jackwener/opencli/registry";import{CliError as Z}from"@jackwener/opencli/errors";import{readFileSync as q,writeFileSync as j,mkdirSync as R,existsSync as f}from"fs";import{createServer as h}from"http";import{homedir as P}from"os";import{join as x}from"path";import{exec as m}from"child_process";import{assertSpotifyCredentialsConfigured as I,getFirstSpotifyTrack as v,mapSpotifyTrackResults as p,parseDotEnv as u,resolveSpotifyCredentials as C}from"./utils.js";const K=x(P(),".opencli","spotify.env");function w(){if(!f(K))return{};return u(q(K,"utf-8"))}const T=w(),O=C(T),V=O.clientId,D=O.clientSecret,U="http://127.0.0.1:8888/callback",S=["user-read-playback-state","user-modify-playback-state","user-read-currently-playing","playlist-read-private"].join(" "),F=x(P(),".opencli","spotify-tokens.json");function y(){try{return JSON.parse(q(F,"utf-8"))}catch{return null}}function L(z){R(x(P(),".opencli"),{recursive:!0});j(F,JSON.stringify(z,null,2))}async function E(z){const G=await fetch("https://accounts.spotify.com/api/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+Buffer.from(`${V}:${D}`).toString("base64")},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:z})});if(!G.ok){const J=await G.json().catch(()=>({}));throw new Z("REFRESH_FAILED",J?.error_description||`Token refresh failed (${G.status})`)}const H=await G.json(),M={access_token:H.access_token,refresh_token:H.refresh_token||z,expires_at:Date.now()+H.expires_in*1000};L(M);return M.access_token}async function g(){const z=y();if(!z)throw new Z("AUTH_REQUIRED","Not authenticated. Run: opencli spotify auth");if(!z.access_token||!z.refresh_token||!(z.expires_at>0))throw new Z("AUTH_CORRUPTED","Token file is corrupted. Run: opencli spotify auth");if(Date.now()>z.expires_at-60000)return E(z.refresh_token);return z.access_token}async function Q(z,G,H){const M=await g(),J=await fetch(`https://api.spotify.com/v1${G}`,{method:z,headers:{Authorization:`Bearer ${M}`,"Content-Type":"application/json"},body:H?JSON.stringify(H):void 0});if(J.status===204||J.status===202)return null;if(!J.ok){const W=await J.json().catch(()=>({}));throw new Z("API_ERROR",W?.error?.message||`Spotify API error ${J.status}`)}return J.json()}async function N(z){const G=await Q("GET",`/search?q=${encodeURIComponent(z)}&type=track&limit=1`),H=v(G);if(!H)throw new Z("EMPTY_RESULT",`No track found for: ${z}`);return H}function d(z){const G=process.platform==="win32"?`start "" "${z}"`:process.platform==="darwin"?`open "${z}"`:`xdg-open "${z}"`;m(G)}X({site:"spotify",name:"auth",access:"write",description:"Authenticate with Spotify (OAuth — run once)",strategy:Y.PUBLIC,browser:!1,args:[],columns:["status"],func:async()=>{I(O,K);return new Promise((z,G)=>{const H=h(async(J,W)=>{try{const $=new URL(J.url,"http://localhost:8888");if($.pathname!=="/callback"){W.end();return}const b=$.searchParams.get("code");if(!b){W.end("Missing code");return}const A=await fetch("https://accounts.spotify.com/api/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+Buffer.from(`${V}:${D}`).toString("base64")},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:U})});if(!A.ok){const _=await A.json().catch(()=>({}));H.close();G(new Z("AUTH_FAILED",_?.error_description||`Token exchange failed (${A.status})`));return}const B=await A.json();L({access_token:B.access_token,refresh_token:B.refresh_token,expires_at:Date.now()+B.expires_in*1000});W.writeHead(200,{"Content-Type":"text/html"});W.end("<h2>Spotify authenticated! You can close this tab.</h2>");H.close();z([{status:"Authenticated successfully"}])}catch($){H.close();G($)}});H.on("error",(J)=>{if(J.code==="EADDRINUSE")G(new Z("PORT_IN_USE","Port 8888 is already in use. Stop the other process and retry."));else G(J)});const M=setTimeout(()=>{H.close();G(new Z("AUTH_TIMEOUT","Authentication timed out after 5 minutes"))},300000);H.listen(8888,()=>{const J=`https://accounts.spotify.com/authorize?${new URLSearchParams({client_id:V,response_type:"code",redirect_uri:U,scope:S})}`;console.log("Opening browser for Spotify login...");console.log("If it does not open, visit:",J);d(J)});H.on("close",()=>clearTimeout(M))})}});X({site:"spotify",name:"status",access:"read",description:"Show current playback status",strategy:Y.PUBLIC,browser:!1,args:[],columns:["track","artist","album","status","progress"],func:async()=>{const z=await Q("GET","/me/player");if(!z||!z.item)return[{track:"Nothing playing",artist:"",album:"",status:"",progress:""}];const G=z.item;if(G.type!=="track")return[{track:G.name,artist:"",album:G.show?.name??"",status:z.is_playing?"playing":"paused",progress:""}];const H=(z.progress_ms??0)/1000|0,M=G.duration_ms/1000|0,J=(W)=>`${W/60|0}:${String(W%60).padStart(2,"0")}`;return[{track:G.name,artist:G.artists.map((W)=>W.name).join(", "),album:G.album.name,status:z.is_playing?"playing":"paused",progress:`${J(H)} / ${J(M)}`}]}});X({site:"spotify",name:"play",access:"write",description:"Resume playback or search and play a track/artist",strategy:Y.PUBLIC,browser:!1,args:[{name:"query",type:"str",default:"",positional:!0,help:"Track or artist to play (optional)"}],columns:["track","artist","status"],func:async(z)=>{if(z.query){const{uri:G,name:H,artist:M}=await N(z.query);await Q("PUT","/me/player/play",{uris:[G]});return[{track:H,artist:M,status:"playing"}]}await Q("PUT","/me/player/play");return[{track:"",artist:"",status:"resumed"}]}});X({site:"spotify",name:"pause",access:"write",description:"Pause playback",strategy:Y.PUBLIC,browser:!1,args:[],columns:["status"],func:async()=>{await Q("PUT","/me/player/pause");return[{status:"paused"}]}});X({site:"spotify",name:"next",access:"write",description:"Skip to next track",strategy:Y.PUBLIC,browser:!1,args:[],columns:["status"],func:async()=>{await Q("POST","/me/player/next");return[{status:"skipped to next"}]}});X({site:"spotify",name:"prev",access:"write",description:"Skip to previous track",strategy:Y.PUBLIC,browser:!1,args:[],columns:["status"],func:async()=>{await Q("POST","/me/player/previous");return[{status:"skipped to previous"}]}});X({site:"spotify",name:"volume",access:"write",description:"Set playback volume (0-100)",strategy:Y.PUBLIC,browser:!1,args:[{name:"level",type:"int",default:50,positional:!0,required:!0,help:"Volume 0–100"}],columns:["volume"],func:async(z)=>{const G=Math.round(z.level);if(G<0||G>100)throw new Z("INVALID_ARGS","Volume must be between 0 and 100");await Q("PUT",`/me/player/volume?volume_percent=${G}`);return[{volume:`${G}%`}]}});X({site:"spotify",name:"search",access:"read",description:"Search for tracks",strategy:Y.PUBLIC,browser:!1,args:[{name:"query",type:"str",required:!0,positional:!0,help:"Search query"},{name:"limit",type:"int",default:10,help:"Number of results (default: 10)"}],columns:["track","artist","album","uri"],func:async(z)=>{const G=Math.min(50,Math.max(1,Math.round(z.limit))),H=await Q("GET",`/search?q=${encodeURIComponent(z.query)}&type=track&limit=${G}`),M=p(H);if(!M.length)throw new Z("EMPTY_RESULT",`No results found for: ${z.query}`);return M}});X({site:"spotify",name:"queue",access:"write",description:"Add a track to the playback queue",strategy:Y.PUBLIC,browser:!1,args:[{name:"query",type:"str",required:!0,positional:!0,help:"Track to add to queue"}],columns:["track","artist","status"],func:async(z)=>{const{uri:G,name:H,artist:M}=await N(z.query);await Q("POST",`/me/player/queue?uri=${encodeURIComponent(G)}`);return[{track:H,artist:M,status:"added to queue"}]}});X({site:"spotify",name:"shuffle",access:"write",description:"Toggle shuffle on/off",strategy:Y.PUBLIC,browser:!1,args:[{name:"state",type:"str",default:"on",positional:!0,choices:["on","off"],help:"on or off"}],columns:["shuffle"],func:async(z)=>{await Q("PUT",`/me/player/shuffle?state=${z.state==="on"}`);return[{shuffle:z.state}]}});X({site:"spotify",name:"repeat",access:"write",description:"Set repeat mode (off / track / context)",strategy:Y.PUBLIC,browser:!1,args:[{name:"mode",type:"str",default:"context",positional:!0,choices:["off","track","context"],help:"off / track / context"}],columns:["repeat"],func:async(z)=>{await Q("PUT",`/me/player/repeat?state=${z.mode}`);return[{repeat:z.mode}]}});
@@ -0,0 +1,8 @@
1
+ import{CliError as n}from"@jackwener/opencli/errors";const o=[/^your_spotify_client_id_here$/i,/^your_spotify_client_secret_here$/i,/^your_.+_here$/i];export function parseDotEnv(r){return Object.fromEntries(r.split(/\r?\n/).map((t)=>t.trim()).filter((t)=>t&&!t.startsWith("#")&&t.includes("=")).map((t)=>{const e=t.indexOf("=");return[t.slice(0,e).trim(),t.slice(e+1).trim()]}))}export function resolveSpotifyCredentials(r,t=process.env){return{clientId:t.SPOTIFY_CLIENT_ID||r.SPOTIFY_CLIENT_ID||"",clientSecret:t.SPOTIFY_CLIENT_SECRET||r.SPOTIFY_CLIENT_SECRET||""}}export function isPlaceholderCredential(r){const t=r?.trim()||"";if(!t)return!1;return o.some((e)=>e.test(t))}export function hasConfiguredSpotifyCredentials(r){return Boolean(r.clientId.trim())&&Boolean(r.clientSecret.trim())&&!isPlaceholderCredential(r.clientId)&&!isPlaceholderCredential(r.clientSecret)}export function assertSpotifyCredentialsConfigured(r,t){if(hasConfiguredSpotifyCredentials(r))return;throw new n("CONFIG",`Missing Spotify credentials.
2
+
3
+ 1. Go to https://developer.spotify.com/dashboard and create an app
4
+ 2. Add http://127.0.0.1:8888/callback as a Redirect URI
5
+ 3. Copy your Client ID and Client Secret
6
+ 4. Open the file: ${t}
7
+ 5. Fill in SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET, then save
8
+ 6. Run: opencli spotify auth`)}export function mapSpotifyTrackResults(r){const t=r?.tracks?.items;if(!Array.isArray(t))return[];return t.map((e)=>({track:e?.name||"",artist:Array.isArray(e?.artists)?e.artists.map((i)=>i.name).join(", "):"",album:e?.album?.name||"",uri:e?.uri||""}))}export function getFirstSpotifyTrack(r){const t=mapSpotifyTrackResults(r)[0];if(!t)return null;return{uri:t.uri,name:t.track,artist:t.artist}}
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as t}from"@jackwener/opencli/registry";e({site:"stackoverflow",name:"bounties",access:"read",description:"Active bounties on Stack Overflow",domain:"stackoverflow.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:10,help:"Max number of results"}],columns:["rank","id","bounty","title","score","answers","views","is_answered","tags","author","creation_date","url"],pipeline:[{fetch:{url:"https://api.stackexchange.com/2.3/questions/featured?order=desc&sort=activity&site=stackoverflow&pagesize=${{ args.limit }}"}},{select:"items"},{map:{rank:"${{ index + 1 }}",id:"${{ item.question_id }}",bounty:"${{ item.bounty_amount }}",title:"${{ item.title }}",score:"${{ item.score }}",answers:"${{ item.answer_count }}",views:"${{ item.view_count }}",is_answered:"${{ item.is_answered }}",tags:"${{ item.tags | join(', ') }}",author:"${{ item.owner.display_name }}",creation_date:"${{ item.creation_date }}",url:"${{ item.link }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as t}from"@jackwener/opencli/registry";e({site:"stackoverflow",name:"hot",access:"read",description:"Hot Stack Overflow questions",domain:"stackoverflow.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:10,help:"Max number of results"}],columns:["rank","id","title","score","answers","views","is_answered","tags","author","creation_date","url"],pipeline:[{fetch:{url:"https://api.stackexchange.com/2.3/questions?order=desc&sort=hot&site=stackoverflow&pagesize=${{ args.limit }}"}},{select:"items"},{map:{rank:"${{ index + 1 }}",id:"${{ item.question_id }}",title:"${{ item.title }}",score:"${{ item.score }}",answers:"${{ item.answer_count }}",views:"${{ item.view_count }}",is_answered:"${{ item.is_answered }}",tags:"${{ item.tags | join(', ') }}",author:"${{ item.owner.display_name }}",creation_date:"${{ item.creation_date }}",url:"${{ item.link }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1,13 @@
1
+ import{cli as h,Strategy as x}from"@jackwener/opencli/registry";import{ArgumentError as f,CommandExecutionError as G,EmptyResultError as B}from"@jackwener/opencli/errors";const O="https://api.stackexchange.com/2.3",R="stackoverflow",M=100;async function X(F,H){let V;try{V=await fetch(F)}catch(Y){const $=Y instanceof Error?Y.message:String(Y);throw new G(`Network failure fetching ${H}: ${$}`,"Check connectivity to api.stackexchange.com")}if(V.status===404)throw new B(H,`${H} not found`);if(!V.ok)throw new G(`Stack Exchange API HTTP ${V.status} for ${H}`,"Check the question id and quota (300/day per IP)");let K;try{K=await V.json()}catch(Y){const $=Y instanceof Error?Y.message:String(Y);throw new G(`Malformed JSON from Stack Exchange API for ${H}: ${$}`,"The API returned a non-JSON body — likely a transient outage")}if(K&&K.error_id)throw new G(`Stack Exchange API error ${K.error_id} (${K.error_name}) for ${H}: ${K.error_message||""}`,"Common causes: invalid filter, throttled, or quota exhausted");return K}function v(F){if(F===void 0||F===null||F==="")return NaN;const H=typeof F==="number"?F:Number(F);return Number.isFinite(H)&&Number.isInteger(H)?H:NaN}function A(F,H,V){const K=v(F);if(!Number.isInteger(K)||K<H)throw new f(`${V} must be an integer >= ${H}, got ${JSON.stringify(F)}`);return K}function C(F,H,V,K){const Y=v(F);if(!Number.isInteger(Y)||Y<H||Y>V)throw new f(`${K} must be an integer between ${H} and ${V}, got ${JSON.stringify(F)}`);return Y}function E(F,H){const V=F.accepted_answer_id;return H.slice().sort((K,Y)=>{const $=K.is_accepted||V&&K.answer_id===V,W=Y.is_accepted||V&&Y.answer_id===V;if($!==W)return $?-1:1;return(Y.score??0)-(K.score??0)})}async function u(F,H,V){const K=F.accepted_answer_id;if(!K||H.some((W)=>W.answer_id===K))return H;const $=((await X(`${O}/answers/${K}?site=${R}&filter=withbody`,`${V}/accepted-answer`)).items||[])[0];return $?H.concat($):H}async function w(F,H,V){const K=new Map;if(F.length===0)return K;const Y=F.map((Q)=>Q.answer_id).join(";"),$=Math.min(M,F.length*H),W=await X(`${O}/answers/${Y}/comments?site=${R}&filter=withbody&order=asc&sort=creation&pagesize=${$}`,`${V}/answer-comments`);for(const Q of W.items||[]){if(!Q.post_id)continue;if(!K.has(Q.post_id))K.set(Q.post_id,[]);K.get(Q.post_id).push(Q)}if(W.has_more){if(F.some((z)=>{return(K.get(z.answer_id)||[]).length<H}))throw new G(`Stack Exchange answer comments for ${V} exceed one API page`,"Lower --answers-limit or --comments-limit; refusing to return a partial answer-comment set.")}return K}const d={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",hellip:"…",mdash:"—",ndash:"–",laquo:"«",raquo:"»",copy:"©",reg:"®",trade:"™",euro:"€",pound:"£",yen:"¥",rsquo:"’",lsquo:"‘",rdquo:"”",ldquo:"“"};function L(F){if(!F)return"";return String(F).replace(/&#x([0-9a-fA-F]+);/g,(H,V)=>{const K=parseInt(V,16);return Number.isFinite(K)?String.fromCodePoint(K):""}).replace(/&#(\d+);/g,(H,V)=>{const K=parseInt(V,10);return Number.isFinite(K)?String.fromCodePoint(K):""}).replace(/&([a-zA-Z]+);/g,(H,V)=>d[V]??H)}function Z(F){if(!F)return"";const H=String(F).replace(/<pre[^>]*><code[^>]*>([\s\S]*?)<\/code><\/pre>/gi,`
2
+ $1
3
+ `).replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`").replace(/<p[^>]*>/gi,`
4
+
5
+ `).replace(/<\/p>/gi,"").replace(/<br\s*\/?>/gi,`
6
+ `).replace(/<li[^>]*>/gi,`
7
+ - `).replace(/<\/li>/gi,"").replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gi,"$2 ($1)").replace(/<[^>]+>/g,"");return L(H).replace(/\n{3,}/g,`
8
+
9
+ `).trim()}function J(F){return L(F?.display_name||"")||"[deleted]"}function D(F,H){if(!F||F.length<=H)return F||"";return F.slice(0,H)+" ... [truncated]"}function T(F,H){if(H===0)return F;const K=`${" ".repeat(H)}> `;return F.split(`
10
+ `).map((Y)=>K+Y).join(`
11
+ `)}h({site:"stackoverflow",name:"read",access:"read",description:"Read a Stack Overflow question with answers and comments",domain:"stackoverflow.com",strategy:x.PUBLIC,browser:!1,args:[{name:"id",required:!0,positional:!0,help:"Stack Overflow question id (numeric, e.g. 79935770)"},{name:"answers-limit",type:"int",default:10,help:"Max answers to include (1-100; accepted answer always included first)"},{name:"comments-limit",type:"int",default:5,help:"Max comments per question/answer (1-100)"},{name:"max-length",type:"int",default:4000,help:"Max characters per body / answer / comment (min 100)"}],columns:["type","author","score","accepted","text"],func:async(F)=>{const H=String(F.id||"").trim();if(!/^\d+$/.test(H))throw new f(`Invalid Stack Overflow question id: ${F.id}`,"Pass a numeric id like 79935770");const V=C(F["answers-limit"]??10,1,M,"stackoverflow read --answers-limit"),K=C(F["comments-limit"]??5,1,M,"stackoverflow read --comments-limit"),Y=A(F["max-length"]??4000,100,"stackoverflow read --max-length"),$=`stackoverflow/${H}`,W=`${O}/questions/${H}?site=${R}&filter=withbody`,z=((await X(W,$)).items||[])[0];if(!z)throw new B($,"Question not found");const[P,q]=await Promise.all([X(`${O}/questions/${H}/comments?site=${R}&filter=withbody&order=asc&sort=creation&pagesize=${K}`,`${$}/comments`),X(`${O}/questions/${H}/answers?site=${R}&filter=withbody&order=desc&sort=votes&pagesize=${V}`,`${$}/answers`)]),g=await u(z,q.items||[],$),y=E(z,g).slice(0,V),_=await w(y,K,$),k=[],p=Z(z.body||""),S=[z.title||"",p,z.link||""].filter(Boolean);k.push({type:"POST",author:J(z.owner),score:z.score??0,accepted:"",text:D(S.join(`
12
+
13
+ `),Y)});const I=(P.items||[]).slice(0,K);for(const U of I){const j=T(Z(U.body||""),1);k.push({type:"Q-COMMENT",author:J(U.owner),score:U.score??0,accepted:"",text:D(j,Y)})}for(const U of y){k.push({type:"ANSWER",author:J(U.owner),score:U.score??0,accepted:U.is_accepted?"true":"",text:D(Z(U.body||""),Y)});const j=(_.get(U.answer_id)||[]).slice(0,K);for(const N of j){const b=T(Z(N.body||""),1);k.push({type:"A-COMMENT",author:J(N.owner),score:N.score??0,accepted:"",text:D(b,Y)})}}return k}});
@@ -0,0 +1 @@
1
+ import{cli as u,Strategy as m}from"@jackwener/opencli/registry";import{ArgumentError as a}from"@jackwener/opencli/errors";import{seFetch as w,normalizeLimit as f,epochToDate as n,ensureItems as p,decodeHtmlEntities as l}from"./utils.js";const r=["rank","activity","votes","creation"];u({site:"stackoverflow",name:"related",access:"read",description:"List Stack Overflow questions related to a given question id.",domain:"stackoverflow.com",strategy:m.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,type:"string",help:"Stack Overflow question id (numeric, e.g. 79935770)."},{name:"sort",type:"string",default:"rank",help:`Sort key: ${r.join(", ")} (rank = SO relevance default).`},{name:"limit",type:"int",default:20,help:"Max related questions (1-100)."}],columns:["rank","id","title","score","answers","views","isAnswered","tags","author","createdAt","lastActivityAt","url"],func:async(t)=>{const i=String(t.id??"").trim();if(!/^\d+$/.test(i))throw new a(`stackoverflow related id must be a numeric question id, got ${JSON.stringify(t.id)}`);const s=String(t.sort??"rank").toLowerCase();if(!r.includes(s))throw new a(`stackoverflow related sort must be one of ${r.join(", ")}`);const o=f(t.limit,20,100,"limit"),c=await w(`/questions/${encodeURIComponent(i)}/related`,{searchParams:{order:"desc",sort:s,pagesize:o}});return p(c,`stackoverflow related ${i}`).slice(0,o).map((e,d)=>({rank:d+1,id:e.question_id,title:l(e.title||""),score:e.score??0,answers:e.answer_count??0,views:e.view_count??0,isAnswered:Boolean(e.is_answered),tags:Array.isArray(e.tags)?e.tags.join(", "):"",author:l(e.owner?.display_name||""),createdAt:n(e.creation_date),lastActivityAt:n(e.last_activity_date),url:e.link||(e.question_id?`https://stackoverflow.com/questions/${e.question_id}`:"")}))}});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as t}from"@jackwener/opencli/registry";e({site:"stackoverflow",name:"search",access:"read",description:"Search Stack Overflow questions",domain:"stackoverflow.com",strategy:t.PUBLIC,browser:!1,args:[{name:"query",type:"string",required:!0,positional:!0,help:"Search query"},{name:"limit",type:"int",default:10,help:"Max number of results"}],columns:["rank","id","title","score","answers","views","is_answered","tags","author","creation_date","url"],pipeline:[{fetch:{url:"https://api.stackexchange.com/2.3/search/advanced?order=desc&sort=relevance&q=${{ args.query }}&site=stackoverflow&pagesize=${{ args.limit }}"}},{select:"items"},{map:{rank:"${{ index + 1 }}",id:"${{ item.question_id }}",title:"${{ item.title }}",score:"${{ item.score }}",answers:"${{ item.answer_count }}",views:"${{ item.view_count }}",is_answered:"${{ item.is_answered }}",tags:"${{ item.tags | join(', ') }}",author:"${{ item.owner.display_name }}",creation_date:"${{ item.creation_date }}",url:"${{ item.link }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as m,Strategy as g}from"@jackwener/opencli/registry";import{ArgumentError as u}from"@jackwener/opencli/errors";import{seFetch as d,normalizeLimit as w,requireString as v,epochToDate as r,ensureItems as p,decodeHtmlEntities as n}from"./utils.js";const i=["activity","votes","creation","hot","week","month"];m({site:"stackoverflow",name:"tag",access:"read",description:"List Stack Overflow questions tagged with a given tag (most active first).",domain:"stackoverflow.com",strategy:g.PUBLIC,browser:!1,args:[{name:"tag",positional:!0,required:!0,type:"string",help:"Tag slug (e.g. python, rust, typescript)."},{name:"sort",type:"string",default:"activity",help:`Sort key: ${i.join(", ")}`},{name:"limit",type:"int",default:20,help:"Max questions to return (max 100)."}],columns:["rank","id","title","score","answers","views","isAnswered","tags","author","createdAt","lastActivityAt","url"],func:async(e)=>{const s=v(e.tag,"tag").toLowerCase(),a=String(e.sort??"activity").toLowerCase();if(!i.includes(a))throw new u(`sort must be one of ${i.join(", ")}`);const o=w(e.limit,20,100,"limit"),c=await d("/questions",{searchParams:{tagged:s,order:"desc",sort:a,pagesize:o}});return p(c,`stackoverflow tag "${s}"`).slice(0,o).map((t,l)=>({rank:l+1,id:t.question_id,title:n(t.title||""),score:t.score??0,answers:t.answer_count??0,views:t.view_count??0,isAnswered:Boolean(t.is_answered),tags:Array.isArray(t.tags)?t.tags.join(", "):"",author:n(t.owner?.display_name||""),createdAt:r(t.creation_date),lastActivityAt:r(t.last_activity_date),url:t.link||(t.question_id?`https://stackoverflow.com/questions/${t.question_id}`:"")}))}});
@@ -0,0 +1 @@
1
+ import{cli as e,Strategy as t}from"@jackwener/opencli/registry";e({site:"stackoverflow",name:"unanswered",access:"read",description:"Top voted unanswered questions on Stack Overflow",domain:"stackoverflow.com",strategy:t.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:10,help:"Max number of results"}],columns:["rank","id","title","score","answers","views","tags","author","creation_date","url"],pipeline:[{fetch:{url:"https://api.stackexchange.com/2.3/questions/unanswered?order=desc&sort=votes&site=stackoverflow&pagesize=${{ args.limit }}"}},{select:"items"},{map:{rank:"${{ index + 1 }}",id:"${{ item.question_id }}",title:"${{ item.title }}",score:"${{ item.score }}",answers:"${{ item.answer_count }}",views:"${{ item.view_count }}",tags:"${{ item.tags | join(', ') }}",author:"${{ item.owner.display_name }}",creation_date:"${{ item.creation_date }}",url:"${{ item.link }}"}},{limit:"${{ args.limit }}"}]});
@@ -0,0 +1 @@
1
+ import{cli as n,Strategy as c}from"@jackwener/opencli/registry";import{seFetch as l,normalizeLimit as d,requireString as m,epochToDate as a,ensureItems as u,decodeHtmlEntities as r}from"./utils.js";n({site:"stackoverflow",name:"user",access:"read",description:"Find Stack Overflow users by display name (highest reputation first).",domain:"stackoverflow.com",strategy:c.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,type:"string",help:"Display name (or substring) to search."},{name:"limit",type:"int",default:10,help:"Max users to return (max 100)."}],columns:["userId","displayName","reputation","goldBadges","silverBadges","bronzeBadges","location","createdAt","lastAccessAt","url"],func:async(s)=>{const i=m(s.name,"name"),t=d(s.limit,10,100,"limit"),o=await l("/users",{searchParams:{inname:i,order:"desc",sort:"reputation",pagesize:t}});return u(o,"stackoverflow user").slice(0,t).map((e)=>({userId:e.user_id,displayName:r(e.display_name||""),reputation:e.reputation??0,goldBadges:e.badge_counts?.gold??0,silverBadges:e.badge_counts?.silver??0,bronzeBadges:e.badge_counts?.bronze??0,location:r(e.location||""),createdAt:a(e.creation_date),lastAccessAt:a(e.last_access_date),url:e.link||(e.user_id?`https://stackoverflow.com/users/${e.user_id}`:"")}))}});
@@ -0,0 +1 @@
1
+ import{ArgumentError as W,CommandExecutionError as O,EmptyResultError as X}from"@jackwener/opencli/errors";export const SE_API="https://api.stackexchange.com/2.3",SE_SITE="stackoverflow";const Z="opencli-stackoverflow (+https://github.com/jackwener/opencli)";export function normalizeLimit(q,z,B,G="limit"){const F=Number(q??z);if(!Number.isInteger(F)||F<=0)throw new W(`${G} must be a positive integer`);if(F>B)throw new W(`${G} must be <= ${B}`);return F}export function requireString(q,z){const B=String(q??"").trim();if(!B)throw new W(`${z} cannot be empty`);return B}export async function seFetch(q,{searchParams:z}={}){const B=new URL(q.startsWith("http")?q:`${SE_API}${q.startsWith("/")?"":"/"}${q}`);if(z)for(const[F,Q]of Object.entries(z)){if(Q==null||Q==="")continue;B.searchParams.set(F,String(Q))}if(!B.searchParams.has("site"))B.searchParams.set("site",SE_SITE);let G;try{G=await fetch(B,{headers:{Accept:"application/json","Accept-Encoding":"gzip","User-Agent":Z}})}catch(F){throw new O(`stack exchange request failed: ${F?.message||F}`)}if(G.status===429)throw new O("stack exchange returned HTTP 429 (rate limited)","Wait a few seconds and retry, or lower --limit.");if(!G.ok){let F="";try{F=(await G.json())?.error_message||""}catch{}throw new O(`stack exchange HTTP ${G.status}: ${F||G.statusText}`)}let K;try{K=await G.json()}catch(F){throw new O(`stack exchange returned malformed JSON: ${F?.message||F}`)}if(K?.error_id)throw new O(`stack exchange API error: ${K.error_message||K.error_name}`,"Inspect the URL in a browser for the canonical error context.");return K}export function epochToDate(q){if(q==null||q==="")return"";const z=Number(q);if(!Number.isFinite(z)||z<=0)return"";return new Date(z*1000).toISOString().slice(0,10)}export function ensureItems(q,z){const B=Array.isArray(q?.items)?q.items:[];if(B.length===0)throw new X(z,`${z} returned no items.`);return B}const $={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&apos;":"'","&nbsp;":" "};export function decodeHtmlEntities(q){if(q==null)return"";return String(q).replace(/&#x([0-9a-fA-F]+);/g,(z,B)=>String.fromCodePoint(parseInt(B,16))).replace(/&#(\d+);/g,(z,B)=>String.fromCodePoint(parseInt(B,10))).replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/g,(z)=>$[z]||z)}