publishport-opencli 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1041) hide show
  1. package/clis/12306/me.js +2 -2
  2. package/clis/12306/orders.js +3 -3
  3. package/clis/12306/passengers.js +3 -3
  4. package/clis/12306/price.js +1 -1
  5. package/clis/12306/stations.js +1 -1
  6. package/clis/12306/train.js +1 -1
  7. package/clis/12306/trains.js +1 -1
  8. package/clis/12306/utils.js +1 -1
  9. package/clis/1688/download.js +1 -1
  10. package/clis/1688/item.js +4 -4
  11. package/clis/1688/search.js +4 -4
  12. package/clis/1688/store.js +4 -4
  13. package/clis/1point3acres/forum.js +1 -1
  14. package/clis/1point3acres/forums.js +1 -1
  15. package/clis/1point3acres/notifications.js +1 -1
  16. package/clis/1point3acres/search.js +1 -1
  17. package/clis/1point3acres/thread.js +2 -2
  18. package/clis/1point3acres/user.js +1 -1
  19. package/clis/1point3acres/utils.js +2 -2
  20. package/clis/36kr/article.js +2 -2
  21. package/clis/36kr/hot.js +2 -2
  22. package/clis/36kr/news.js +1 -1
  23. package/clis/36kr/search.js +2 -2
  24. package/clis/51job/company.js +2 -2
  25. package/clis/51job/detail.js +2 -2
  26. package/clis/51job/hot.js +1 -1
  27. package/clis/51job/search.js +1 -1
  28. package/clis/51job/utils.js +7 -7
  29. package/clis/_atlassian/shared.js +9 -9
  30. package/clis/_shared/article/auth.js +4 -4
  31. package/clis/_shared/article/douban-md2draft.js +4 -4
  32. package/clis/_shared/article/format.js +1 -1
  33. package/clis/_shared/article/images.js +7 -7
  34. package/clis/_shared/article/login.js +1 -1
  35. package/clis/_shared/article/publish.js +11 -11
  36. package/clis/_shared/common.js +1 -1
  37. package/clis/_shared/content-guard.js +1 -1
  38. package/clis/_shared/desktop-commands.js +1 -1
  39. package/clis/_shared/file-inject.js +12 -12
  40. package/clis/_shared/self-hosted-sites.js +2 -2
  41. package/clis/_shared/site-auth.js +1 -1
  42. package/clis/_shared/token-auth.js +2 -2
  43. package/clis/_shared/video-publish.js +9 -9
  44. package/clis/amazon/offer.js +3 -3
  45. package/clis/amazon/product.js +5 -5
  46. package/clis/amazon/shared.js +6 -6
  47. package/clis/antigravity/_actions.js +13 -13
  48. package/clis/antigravity/audit-extras.js +10 -10
  49. package/clis/antigravity/delete.js +1 -1
  50. package/clis/antigravity/model.js +6 -6
  51. package/clis/antigravity/new.js +2 -2
  52. package/clis/antigravity/read.js +2 -2
  53. package/clis/antigravity/rename.js +1 -1
  54. package/clis/antigravity/send.js +3 -3
  55. package/clis/antigravity/serve.js +17 -17
  56. package/clis/antigravity/storage.js +6 -6
  57. package/clis/antigravity/watch.js +2 -2
  58. package/clis/apple-podcasts/episodes.js +1 -1
  59. package/clis/apple-podcasts/top.js +1 -1
  60. package/clis/apple-podcasts/utils.js +1 -1
  61. package/clis/archive/item.js +1 -1
  62. package/clis/archive/search.js +1 -1
  63. package/clis/archive/snapshots.js +1 -1
  64. package/clis/archive/wayback.js +1 -1
  65. package/clis/arxiv/author.js +1 -1
  66. package/clis/arxiv/utils.js +1 -1
  67. package/clis/autohome/brand.js +1 -1
  68. package/clis/autohome/score.js +1 -1
  69. package/clis/autohome/utils.js +1 -1
  70. package/clis/baijiahao/article.js +1 -1
  71. package/clis/baijiahao/lists.js +1 -1
  72. package/clis/baijiahao/login.js +1 -1
  73. package/clis/baijiahao/publish.js +9 -9
  74. package/clis/baijiahao/stats.js +1 -1
  75. package/clis/baijiahao/whoami.js +1 -1
  76. package/clis/band/bands.js +2 -2
  77. package/clis/band/mentions.js +2 -2
  78. package/clis/band/post.js +4 -4
  79. package/clis/band/posts.js +3 -3
  80. package/clis/barchart/flow.js +3 -3
  81. package/clis/barchart/greeks.js +2 -2
  82. package/clis/barchart/quote.js +3 -3
  83. package/clis/bbc/news.js +1 -1
  84. package/clis/bbc/topic.js +1 -1
  85. package/clis/bbc/utils.js +1 -1
  86. package/clis/bilibili/article.js +1 -1
  87. package/clis/bilibili/categories.js +1 -1
  88. package/clis/bilibili/coin.js +1 -1
  89. package/clis/bilibili/comment-del.js +1 -1
  90. package/clis/bilibili/comment-like.js +1 -1
  91. package/clis/bilibili/comment.js +1 -1
  92. package/clis/bilibili/comments.js +1 -1
  93. package/clis/bilibili/dm-list.js +1 -1
  94. package/clis/bilibili/dm-read.js +1 -1
  95. package/clis/bilibili/dm-send.js +1 -1
  96. package/clis/bilibili/download.js +2 -2
  97. package/clis/bilibili/drafts.js +1 -1
  98. package/clis/bilibili/dynamic-post.js +3 -3
  99. package/clis/bilibili/favorite-add.js +1 -1
  100. package/clis/bilibili/favorite.js +1 -1
  101. package/clis/bilibili/feed.js +2 -2
  102. package/clis/bilibili/follow.js +1 -1
  103. package/clis/bilibili/following.js +1 -1
  104. package/clis/bilibili/like.js +1 -1
  105. package/clis/bilibili/partitions.js +1 -1
  106. package/clis/bilibili/stats.js +1 -1
  107. package/clis/bilibili/subtitle.js +3 -3
  108. package/clis/bilibili/summary.js +1 -1
  109. package/clis/bilibili/topics.js +1 -1
  110. package/clis/bilibili/unfollow.js +1 -1
  111. package/clis/bilibili/upload.js +1 -1
  112. package/clis/bilibili/utils.js +10 -10
  113. package/clis/bilibili/video-drafts.js +1 -1
  114. package/clis/bilibili/video.js +1 -1
  115. package/clis/bloomberg/businessweek.js +4 -4
  116. package/clis/bloomberg/news.js +2 -2
  117. package/clis/bloomberg/utils.js +13 -13
  118. package/clis/bluesky/post.js +1 -1
  119. package/clis/bluesky/shared.js +11 -11
  120. package/clis/bluesky/whoami.js +1 -1
  121. package/clis/booking/search.js +2 -2
  122. package/clis/boss/accept.js +1 -1
  123. package/clis/boss/applied.js +1 -1
  124. package/clis/boss/auth.js +1 -1
  125. package/clis/boss/batchgreet.js +1 -1
  126. package/clis/boss/bossinfo.js +1 -1
  127. package/clis/boss/chatlist.js +1 -1
  128. package/clis/boss/chatmsg.js +1 -1
  129. package/clis/boss/cities.js +1 -1
  130. package/clis/boss/detail.js +1 -1
  131. package/clis/boss/exchange.js +1 -1
  132. package/clis/boss/greet.js +1 -1
  133. package/clis/boss/interviews.js +1 -1
  134. package/clis/boss/invite.js +1 -1
  135. package/clis/boss/joblist.js +1 -1
  136. package/clis/boss/mark.js +1 -1
  137. package/clis/boss/me.js +2 -2
  138. package/clis/boss/recommend.js +1 -1
  139. package/clis/boss/resumedelete.js +1 -1
  140. package/clis/boss/resumelist.js +1 -1
  141. package/clis/boss/resumeupload.js +11 -11
  142. package/clis/boss/search.js +1 -1
  143. package/clis/boss/send.js +1 -1
  144. package/clis/boss/sendresume.js +1 -1
  145. package/clis/boss/stats.js +1 -1
  146. package/clis/boss/unread.js +1 -1
  147. package/clis/boss/utils.js +13 -13
  148. package/clis/chaoxing/assignments.js +1 -1
  149. package/clis/chaoxing/exams.js +1 -1
  150. package/clis/chaoxing/utils.js +9 -9
  151. package/clis/chatgpt/ask.js +1 -1
  152. package/clis/chatgpt/auth.js +2 -2
  153. package/clis/chatgpt/detail.js +1 -1
  154. package/clis/chatgpt/image.js +1 -1
  155. package/clis/chatgpt/read.js +1 -1
  156. package/clis/chatgpt/send.js +1 -1
  157. package/clis/chatgpt/utils.js +59 -59
  158. package/clis/chatgpt-app/ask.js +1 -1
  159. package/clis/chatgpt-app/send.js +1 -1
  160. package/clis/chatwise/model.js +6 -6
  161. package/clis/chess/analyze.js +1 -1
  162. package/clis/chess/game.js +1 -1
  163. package/clis/chess/games.js +1 -1
  164. package/clis/chess/stats.js +1 -1
  165. package/clis/chess/utils.js +1 -1
  166. package/clis/claude/ask.js +2 -2
  167. package/clis/claude/detail.js +1 -1
  168. package/clis/claude/new.js +1 -1
  169. package/clis/claude/read.js +1 -1
  170. package/clis/claude/send.js +1 -1
  171. package/clis/claude/utils.js +23 -23
  172. package/clis/cnblogs/article.js +1 -1
  173. package/clis/cnblogs/login.js +1 -1
  174. package/clis/cnblogs/stats.js +7 -7
  175. package/clis/cnblogs/whoami.js +1 -1
  176. package/clis/codex/_actions.js +3 -3
  177. package/clis/codex/archive.js +1 -1
  178. package/clis/codex/ask.js +6 -6
  179. package/clis/codex/model.js +8 -8
  180. package/clis/codex/pin.js +1 -1
  181. package/clis/codex/rename.js +4 -4
  182. package/clis/codex/send.js +3 -3
  183. package/clis/codex/sidebar.js +1 -1
  184. package/clis/coingecko/categories.js +1 -1
  185. package/clis/coingecko/coin.js +1 -1
  186. package/clis/coingecko/derivatives.js +1 -1
  187. package/clis/coingecko/exchanges.js +1 -1
  188. package/clis/coingecko/global.js +1 -1
  189. package/clis/coingecko/trending.js +1 -1
  190. package/clis/confluence/search.js +1 -1
  191. package/clis/coupang/product.js +3 -3
  192. package/clis/coupang/utils.js +1 -1
  193. package/clis/crates/crate.js +1 -1
  194. package/clis/crates/search.js +1 -1
  195. package/clis/crates/utils.js +1 -1
  196. package/clis/csdn/article.js +13 -13
  197. package/clis/csdn/columns.js +1 -1
  198. package/clis/csdn/login.js +1 -1
  199. package/clis/csdn/stats.js +4 -4
  200. package/clis/csdn/whoami.js +1 -1
  201. package/clis/cto51/article.js +1 -1
  202. package/clis/cto51/whoami.js +1 -1
  203. package/clis/ctrip/flight.js +2 -2
  204. package/clis/ctrip/hotel-search.js +3 -3
  205. package/clis/ctrip/hotel-suggest.js +1 -1
  206. package/clis/ctrip/search.js +1 -1
  207. package/clis/ctrip/utils.js +6 -6
  208. package/clis/cursor/ask.js +5 -5
  209. package/clis/cursor/composer.js +2 -2
  210. package/clis/cursor/model.js +4 -4
  211. package/clis/cursor/send.js +2 -2
  212. package/clis/dblp/author.js +1 -1
  213. package/clis/dblp/paper.js +1 -1
  214. package/clis/dblp/search.js +1 -1
  215. package/clis/dblp/utils.js +1 -1
  216. package/clis/dblp/venue.js +1 -1
  217. package/clis/deepseek/ask.js +1 -1
  218. package/clis/deepseek/auth.js +2 -2
  219. package/clis/deepseek/detail.js +1 -1
  220. package/clis/deepseek/new.js +1 -1
  221. package/clis/deepseek/read.js +1 -1
  222. package/clis/deepseek/send.js +7 -7
  223. package/clis/deepseek/utils.js +25 -25
  224. package/clis/defillama/protocol.js +1 -1
  225. package/clis/defillama/protocols.js +1 -1
  226. package/clis/defillama/utils.js +1 -1
  227. package/clis/devto/auth.js +2 -2
  228. package/clis/devto/latest.js +1 -1
  229. package/clis/devto/publish.js +5 -5
  230. package/clis/devto/read.js +2 -2
  231. package/clis/devto/stats.js +3 -3
  232. package/clis/dianping/auth.js +2 -2
  233. package/clis/dianping/cityResolver.js +2 -2
  234. package/clis/dianping/search.js +1 -1
  235. package/clis/dianping/shop.js +1 -1
  236. package/clis/dianping/utils.js +1 -1
  237. package/clis/discord-app/delete.js +3 -3
  238. package/clis/discord-app/read.js +1 -1
  239. package/clis/discord-app/thread-read.js +1 -1
  240. package/clis/discord-web/auth.js +2 -2
  241. package/clis/discord-web/send.js +5 -5
  242. package/clis/dockerhub/image.js +1 -1
  243. package/clis/dockerhub/search.js +1 -1
  244. package/clis/dockerhub/utils.js +1 -1
  245. package/clis/dongchedi/koubei.js +1 -1
  246. package/clis/dongchedi/models.js +1 -1
  247. package/clis/dongchedi/score.js +1 -1
  248. package/clis/dongchedi/search.js +1 -1
  249. package/clis/dongchedi/series.js +1 -1
  250. package/clis/dongchedi/specs.js +1 -1
  251. package/clis/dongchedi/utils.js +1 -1
  252. package/clis/douban/article.js +3 -3
  253. package/clis/douban/auth.js +2 -2
  254. package/clis/douban/download.js +1 -1
  255. package/clis/douban/utils.js +23 -23
  256. package/clis/doubao/auth.js +3 -3
  257. package/clis/doubao/utils.js +39 -39
  258. package/clis/doubao-app/ask.js +1 -1
  259. package/clis/doubao-app/utils.js +4 -4
  260. package/clis/douyin/_shared/browser-fetch.js +7 -7
  261. package/clis/douyin/_shared/draft-cache.js +1 -1
  262. package/clis/douyin/_shared/imagex-upload.js +1 -1
  263. package/clis/douyin/_shared/sts2.js +1 -1
  264. package/clis/douyin/_shared/text-extra.js +1 -1
  265. package/clis/douyin/_shared/tos-upload.js +4 -4
  266. package/clis/douyin/_shared/transcode.js +1 -1
  267. package/clis/douyin/_shared/vod-upload.js +4 -4
  268. package/clis/douyin/draft.js +18 -18
  269. package/clis/douyin/drafts.js +1 -1
  270. package/clis/douyin/publish-image.js +12 -12
  271. package/clis/douyin/publish.js +9 -9
  272. package/clis/douyin/search.js +3 -3
  273. package/clis/douyin/videos.js +1 -1
  274. package/clis/eastmoney/_secid.js +1 -1
  275. package/clis/eastmoney/announcement.js +1 -1
  276. package/clis/eastmoney/article.js +1 -1
  277. package/clis/eastmoney/convertible.js +1 -1
  278. package/clis/eastmoney/etf.js +1 -1
  279. package/clis/eastmoney/holders.js +1 -1
  280. package/clis/eastmoney/index-board.js +1 -1
  281. package/clis/eastmoney/kline.js +1 -1
  282. package/clis/eastmoney/kuaixun.js +1 -1
  283. package/clis/eastmoney/longhu.js +1 -1
  284. package/clis/eastmoney/money-flow.js +1 -1
  285. package/clis/eastmoney/northbound.js +1 -1
  286. package/clis/eastmoney/quote.js +1 -1
  287. package/clis/eastmoney/rank.js +1 -1
  288. package/clis/eastmoney/sectors.js +1 -1
  289. package/clis/endoflife/product.js +1 -1
  290. package/clis/endoflife/utils.js +1 -1
  291. package/clis/facebook/comment.js +8 -8
  292. package/clis/facebook/feed.js +4 -4
  293. package/clis/facebook/like.js +5 -5
  294. package/clis/facebook/notifications.js +3 -3
  295. package/clis/facebook/post.js +11 -11
  296. package/clis/facebook/search.js +3 -3
  297. package/clis/flathub/app.js +1 -1
  298. package/clis/flathub/search.js +1 -1
  299. package/clis/flathub/utils.js +1 -1
  300. package/clis/flomo/memos.js +1 -1
  301. package/clis/gemini/deep-research-result.js +4 -4
  302. package/clis/gemini/deep-research.js +1 -1
  303. package/clis/gemini/detail.js +1 -1
  304. package/clis/gemini/history.js +1 -1
  305. package/clis/gemini/image.js +2 -2
  306. package/clis/gemini/status.js +1 -1
  307. package/clis/gemini/utils.js +43 -43
  308. package/clis/geogebra/hexagon.js +1 -1
  309. package/clis/geogebra/info.js +3 -3
  310. package/clis/geogebra/triangle.js +1 -1
  311. package/clis/geogebra/utils.js +11 -11
  312. package/clis/ghost/login.js +1 -1
  313. package/clis/ghost/shared.js +2 -2
  314. package/clis/gitee/auth.js +2 -2
  315. package/clis/github-trending/repos.js +1 -1
  316. package/clis/google/news.js +1 -1
  317. package/clis/google/search.js +2 -2
  318. package/clis/google/suggest.js +1 -1
  319. package/clis/google/trends.js +1 -1
  320. package/clis/google/utils.js +1 -1
  321. package/clis/goproxy/module.js +1 -1
  322. package/clis/goproxy/utils.js +1 -1
  323. package/clis/goproxy/versions.js +1 -1
  324. package/clis/gov-policy/recent.js +2 -2
  325. package/clis/gov-policy/search.js +2 -2
  326. package/clis/grok/ask.js +1 -1
  327. package/clis/grok/detail.js +1 -1
  328. package/clis/grok/image.js +8 -8
  329. package/clis/grok/pin.js +1 -1
  330. package/clis/grok/send.js +1 -1
  331. package/clis/grok/status.js +1 -1
  332. package/clis/grok/utils.js +21 -21
  333. package/clis/guazi/browse.js +1 -1
  334. package/clis/guazi/car.js +1 -1
  335. package/clis/guazi/utils.js +1 -1
  336. package/clis/hackernews/auth.js +2 -2
  337. package/clis/hackernews/comment.js +8 -8
  338. package/clis/hackernews/read.js +7 -7
  339. package/clis/hackernews/submit.js +7 -7
  340. package/clis/hashnode/auth.js +3 -3
  341. package/clis/hashnode/publish.js +14 -14
  342. package/clis/hf/auth.js +2 -2
  343. package/clis/hf/models.js +1 -1
  344. package/clis/hf/paper.js +1 -1
  345. package/clis/hf/spaces.js +1 -1
  346. package/clis/hf/top.js +1 -1
  347. package/clis/homebrew/cask.js +1 -1
  348. package/clis/homebrew/formula.js +1 -1
  349. package/clis/homebrew/popular.js +1 -1
  350. package/clis/homebrew/utils.js +1 -1
  351. package/clis/huodongxing/events.js +1 -1
  352. package/clis/hupu/detail.js +4 -4
  353. package/clis/hupu/hot.js +3 -3
  354. package/clis/hupu/reply.js +1 -1
  355. package/clis/hupu/search.js +1 -1
  356. package/clis/hupu/unlike.js +1 -1
  357. package/clis/hupu/utils.js +10 -10
  358. package/clis/imdb/person.js +2 -2
  359. package/clis/imdb/reviews.js +3 -3
  360. package/clis/imdb/search.js +2 -2
  361. package/clis/imdb/title.js +1 -1
  362. package/clis/imdb/top.js +1 -1
  363. package/clis/imdb/trending.js +1 -1
  364. package/clis/imdb/utils.js +13 -13
  365. package/clis/imooc/article.js +6 -6
  366. package/clis/imooc/login.js +1 -1
  367. package/clis/imooc/whoami.js +1 -1
  368. package/clis/indeed/job.js +2 -2
  369. package/clis/indeed/search.js +2 -2
  370. package/clis/indeed/utils.js +1 -1
  371. package/clis/infoq/article.js +2 -2
  372. package/clis/infoq/login.js +1 -1
  373. package/clis/infoq/whoami.js +1 -1
  374. package/clis/instagram/_shared/private-publish.js +4 -4
  375. package/clis/instagram/_shared/protocol-capture.js +9 -9
  376. package/clis/instagram/detail.js +3 -3
  377. package/clis/instagram/post.js +25 -25
  378. package/clis/instagram/reel.js +18 -18
  379. package/clis/instagram/story.js +4 -4
  380. package/clis/instagram/user.js +2 -2
  381. package/clis/jd/item.js +65 -65
  382. package/clis/jianshu/article.js +1 -1
  383. package/clis/jianshu/login.js +1 -1
  384. package/clis/jianshu/notebooks.js +1 -1
  385. package/clis/jianshu/whoami.js +1 -1
  386. package/clis/jianyu/search.js +6 -6
  387. package/clis/jianyu/shared/procurement-contract.js +1 -1
  388. package/clis/jike/api.js +6 -6
  389. package/clis/jike/auth.js +3 -3
  390. package/clis/jike/comment.js +1 -1
  391. package/clis/jike/create.js +6 -6
  392. package/clis/jike/feed.js +3 -3
  393. package/clis/jike/like.js +1 -1
  394. package/clis/jike/notifications.js +3 -3
  395. package/clis/jike/repost.js +13 -13
  396. package/clis/jike/search.js +3 -3
  397. package/clis/jimeng/auth.js +2 -2
  398. package/clis/jimeng/generate.js +10 -10
  399. package/clis/jira/shared.js +1 -1
  400. package/clis/juejin/article.js +4 -4
  401. package/clis/juejin/categories.js +1 -1
  402. package/clis/juejin/hot.js +1 -1
  403. package/clis/juejin/login.js +1 -1
  404. package/clis/juejin/recommend.js +1 -1
  405. package/clis/juejin/stats.js +3 -3
  406. package/clis/juejin/tags.js +1 -1
  407. package/clis/juejin/utils.js +1 -1
  408. package/clis/juejin/whoami.js +1 -1
  409. package/clis/ke/utils.js +4 -4
  410. package/clis/kimi/_utils.js +7 -7
  411. package/clis/kimi/audit-extras.js +14 -14
  412. package/clis/kimi/auth.js +3 -3
  413. package/clis/kimi/chat.js +15 -15
  414. package/clis/kimi/storage.js +5 -5
  415. package/clis/kimi/ui.js +13 -13
  416. package/clis/kimi/usage.js +3 -3
  417. package/clis/kuaishou/auth.js +1 -1
  418. package/clis/kuaishou/publish.js +6 -6
  419. package/clis/lesswrong/_helpers.js +5 -5
  420. package/clis/lesswrong/comments.js +5 -5
  421. package/clis/lichess/top.js +1 -1
  422. package/clis/lichess/user.js +1 -1
  423. package/clis/lichess/utils.js +1 -1
  424. package/clis/linkedin/comment.js +1 -1
  425. package/clis/linkedin/connect.js +11 -11
  426. package/clis/linkedin/create.js +5 -5
  427. package/clis/linkedin/follow.js +1 -1
  428. package/clis/linkedin/inbox.js +1 -1
  429. package/clis/linkedin/job-detail.js +3 -3
  430. package/clis/linkedin/like.js +1 -1
  431. package/clis/linkedin/notifications.js +1 -1
  432. package/clis/linkedin/people-search.js +1 -1
  433. package/clis/linkedin/post-comments.js +1 -1
  434. package/clis/linkedin/post-detail.js +1 -1
  435. package/clis/linkedin/profile-analytics.js +1 -1
  436. package/clis/linkedin/profile-api.js +13 -13
  437. package/clis/linkedin/profile-experience.js +1 -1
  438. package/clis/linkedin/profile-projects.js +1 -1
  439. package/clis/linkedin/profile-read.js +3 -3
  440. package/clis/linkedin/reply.js +1 -1
  441. package/clis/linkedin/repost.js +1 -1
  442. package/clis/linkedin/safe-send.js +8 -8
  443. package/clis/linkedin/salesnav-inbox.js +5 -5
  444. package/clis/linkedin/salesnav-message.js +3 -3
  445. package/clis/linkedin/salesnav-search.js +4 -4
  446. package/clis/linkedin/salesnav-thread.js +1 -1
  447. package/clis/linkedin/search-api.js +3 -3
  448. package/clis/linkedin/search.js +8 -8
  449. package/clis/linkedin/social-api.js +31 -31
  450. package/clis/linkedin/timeline.js +3 -3
  451. package/clis/linkedin-learning/search.js +2 -2
  452. package/clis/linkedin-learning/trending.js +2 -2
  453. package/clis/linux-do/feed.js +4 -4
  454. package/clis/linux-do/topic-content.js +8 -8
  455. package/clis/lobsters/domain.js +1 -1
  456. package/clis/lobsters/read.js +7 -7
  457. package/clis/maimai/auth.js +2 -2
  458. package/clis/maimai/search-talents.js +4 -4
  459. package/clis/manus/_utils.js +1 -1
  460. package/clis/mastodon/login.js +1 -1
  461. package/clis/mastodon/post.js +1 -1
  462. package/clis/mastodon/shared.js +12 -12
  463. package/clis/mastodon/whoami.js +1 -1
  464. package/clis/maven/artifact.js +1 -1
  465. package/clis/maven/search.js +1 -1
  466. package/clis/maven/utils.js +1 -1
  467. package/clis/mdn/search.js +1 -1
  468. package/clis/medium/article.js +5 -5
  469. package/clis/medium/login.js +1 -1
  470. package/clis/medium/stats.js +3 -3
  471. package/clis/medium/tag.js +1 -1
  472. package/clis/medium/whoami.js +1 -1
  473. package/clis/mubu/notes.js +1 -1
  474. package/clis/mubu/utils.js +15 -15
  475. package/clis/note/auth.js +2 -2
  476. package/clis/note/note-utils.js +2 -2
  477. package/clis/note/publish.js +8 -8
  478. package/clis/notebooklm/add-source.js +8 -8
  479. package/clis/notebooklm/create.js +1 -1
  480. package/clis/notebooklm/generate-slides.js +1 -1
  481. package/clis/notebooklm/notes-get.js +1 -1
  482. package/clis/notebooklm/rpc.js +8 -8
  483. package/clis/notebooklm/source-fulltext.js +1 -1
  484. package/clis/notebooklm/utils.js +10 -10
  485. package/clis/nowcoder/auth.js +2 -2
  486. package/clis/nowcoder/comment.js +1 -1
  487. package/clis/nowcoder/comments.js +1 -1
  488. package/clis/nowcoder/dm-list.js +1 -1
  489. package/clis/nowcoder/dm-read.js +1 -1
  490. package/clis/nowcoder/dm-send.js +1 -1
  491. package/clis/nowcoder/drafts.js +1 -1
  492. package/clis/nowcoder/inbox.js +1 -1
  493. package/clis/nowcoder/like.js +1 -1
  494. package/clis/nowcoder/my.js +1 -1
  495. package/clis/nowcoder/post.js +1 -1
  496. package/clis/nowcoder/utils.js +13 -13
  497. package/clis/npm/downloads.js +1 -1
  498. package/clis/npm/package.js +1 -1
  499. package/clis/npm/search.js +1 -1
  500. package/clis/npm/utils.js +1 -1
  501. package/clis/nuget/package.js +1 -1
  502. package/clis/nuget/search.js +1 -1
  503. package/clis/nuget/utils.js +1 -1
  504. package/clis/nvd/cve.js +1 -1
  505. package/clis/oeis/search.js +1 -1
  506. package/clis/oeis/sequence.js +1 -1
  507. package/clis/oeis/utils.js +1 -1
  508. package/clis/ones/common.js +6 -6
  509. package/clis/ones/enrich-tasks.js +1 -1
  510. package/clis/ones/my-tasks.js +1 -1
  511. package/clis/ones/resolve-labels.js +1 -1
  512. package/clis/ones/task-helpers.js +1 -1
  513. package/clis/ones/task.js +1 -1
  514. package/clis/ones/worklog.js +7 -7
  515. package/clis/openalex/search.js +1 -1
  516. package/clis/openalex/utils.js +1 -1
  517. package/clis/openalex/work.js +1 -1
  518. package/clis/openfda/drug-label.js +1 -1
  519. package/clis/openfda/food-recall.js +1 -1
  520. package/clis/openfda/utils.js +1 -1
  521. package/clis/openreview/author.js +1 -1
  522. package/clis/openreview/paper.js +1 -1
  523. package/clis/openreview/reviews.js +3 -3
  524. package/clis/openreview/search.js +1 -1
  525. package/clis/openreview/utils.js +1 -1
  526. package/clis/openreview/venue.js +1 -1
  527. package/clis/oschina/article.js +1 -1
  528. package/clis/oschina/catalogs.js +1 -1
  529. package/clis/oschina/login.js +1 -1
  530. package/clis/oschina/stats.js +6 -6
  531. package/clis/oschina/whoami.js +1 -1
  532. package/clis/osv/query.js +1 -1
  533. package/clis/osv/utils.js +1 -1
  534. package/clis/osv/vulnerability.js +1 -1
  535. package/clis/packagist/package.js +1 -1
  536. package/clis/packagist/search.js +1 -1
  537. package/clis/packagist/utils.js +1 -1
  538. package/clis/pinterest/api.js +1 -1
  539. package/clis/pinterest/auth.js +1 -1
  540. package/clis/pinterest/boards.js +1 -1
  541. package/clis/pinterest/client.js +6 -6
  542. package/clis/pinterest/publish.js +5 -5
  543. package/clis/pixiv/auth.js +2 -2
  544. package/clis/pixiv/download.js +1 -1
  545. package/clis/pixiv/illusts.js +1 -1
  546. package/clis/pixiv/search.js +1 -1
  547. package/clis/pixiv/utils.js +3 -3
  548. package/clis/powerchina/auth.js +2 -2
  549. package/clis/powerchina/search.js +1 -1
  550. package/clis/producthunt/browse.js +2 -2
  551. package/clis/producthunt/hot.js +2 -2
  552. package/clis/producthunt/posts.js +1 -1
  553. package/clis/producthunt/today.js +1 -1
  554. package/clis/producthunt/utils.js +1 -1
  555. package/clis/pypi/downloads.js +1 -1
  556. package/clis/pypi/package.js +1 -1
  557. package/clis/pypi/utils.js +1 -1
  558. package/clis/qiita/auth.js +1 -1
  559. package/clis/qiita/gql.js +6 -6
  560. package/clis/qiita/publish.js +4 -4
  561. package/clis/qiita/stats.js +4 -4
  562. package/clis/qoder/_utils.js +16 -16
  563. package/clis/qoder/composer.js +1 -1
  564. package/clis/qoder/quest.js +1 -1
  565. package/clis/qoder/ui.js +14 -14
  566. package/clis/quark/auth.js +2 -2
  567. package/clis/quark/utils.js +2 -2
  568. package/clis/quora/answer-comments.js +3 -3
  569. package/clis/quora/create-answer.js +4 -4
  570. package/clis/quora/create-question.js +3 -3
  571. package/clis/quora/shared.js +17 -17
  572. package/clis/quora/whoami.js +1 -1
  573. package/clis/qwen/ask.js +1 -1
  574. package/clis/qwen/auth.js +3 -3
  575. package/clis/qwen/detail.js +1 -1
  576. package/clis/qwen/image.js +5 -5
  577. package/clis/qwen/status.js +1 -1
  578. package/clis/qwen/utils.js +16 -16
  579. package/clis/reddit/home.js +3 -3
  580. package/clis/reddit/read.js +10 -10
  581. package/clis/reddit/reply.js +4 -4
  582. package/clis/reddit/submit.js +11 -11
  583. package/clis/reddit/subreddit-info.js +3 -3
  584. package/clis/reddit/subscribed.js +4 -4
  585. package/clis/reddit/whoami.js +2 -2
  586. package/clis/rednote/comments.js +1 -1
  587. package/clis/rednote/download.js +1 -1
  588. package/clis/rednote/feed.js +1 -1
  589. package/clis/rednote/note.js +1 -1
  590. package/clis/rednote/notifications.js +2 -2
  591. package/clis/rednote/search.js +2 -2
  592. package/clis/rest-countries/country.js +1 -1
  593. package/clis/rest-countries/region.js +1 -1
  594. package/clis/rest-countries/utils.js +1 -1
  595. package/clis/reuters/article-detail.js +1 -1
  596. package/clis/reuters/auth.js +3 -3
  597. package/clis/reuters/search.js +1 -1
  598. package/clis/reuters/utils.js +4 -4
  599. package/clis/rfc/rfc.js +1 -1
  600. package/clis/rfc/utils.js +1 -1
  601. package/clis/rubygems/gem.js +1 -1
  602. package/clis/rubygems/search.js +1 -1
  603. package/clis/rubygems/utils.js +1 -1
  604. package/clis/segmentfault/article.js +3 -3
  605. package/clis/segmentfault/channels.js +1 -1
  606. package/clis/segmentfault/login.js +1 -1
  607. package/clis/segmentfault/stats.js +4 -4
  608. package/clis/segmentfault/tags.js +1 -1
  609. package/clis/segmentfault/whoami.js +1 -1
  610. package/clis/semanticscholar/citations.js +1 -1
  611. package/clis/semanticscholar/paper.js +1 -1
  612. package/clis/semanticscholar/recommendations.js +1 -1
  613. package/clis/semanticscholar/search.js +1 -1
  614. package/clis/semanticscholar/utils.js +1 -1
  615. package/clis/sinafinance/news.js +1 -1
  616. package/clis/sinafinance/stock-rank.js +1 -1
  617. package/clis/sinafinance/stock.js +1 -1
  618. package/clis/slock/attachment-download.js +1 -1
  619. package/clis/slock/attachment-upload.js +7 -7
  620. package/clis/slock/attachment-url.js +1 -1
  621. package/clis/slock/auth-verify.js +1 -1
  622. package/clis/slock/bookmark-add.js +1 -1
  623. package/clis/slock/bookmark-remove.js +1 -1
  624. package/clis/slock/channel-action.js +1 -1
  625. package/clis/slock/channel-create.js +1 -1
  626. package/clis/slock/channel-files.js +1 -1
  627. package/clis/slock/channel-list.js +1 -1
  628. package/clis/slock/channel-mark.js +1 -1
  629. package/clis/slock/channel-members.js +1 -1
  630. package/clis/slock/channel-unarchive.js +1 -1
  631. package/clis/slock/dm-list.js +1 -1
  632. package/clis/slock/errors.js +1 -1
  633. package/clis/slock/in-page.js +28 -28
  634. package/clis/slock/inbox-done.js +5 -5
  635. package/clis/slock/inbox.js +1 -1
  636. package/clis/slock/message-read.js +22 -22
  637. package/clis/slock/message-search.js +10 -10
  638. package/clis/slock/message-send.js +25 -25
  639. package/clis/slock/reaction-add.js +1 -1
  640. package/clis/slock/reaction-remove.js +1 -1
  641. package/clis/slock/resolve.js +1 -1
  642. package/clis/slock/server-list.js +2 -2
  643. package/clis/slock/task-claim.js +4 -4
  644. package/clis/slock/task-convert.js +13 -13
  645. package/clis/slock/task-create.js +1 -1
  646. package/clis/slock/task-delete.js +5 -5
  647. package/clis/slock/task-get.js +5 -5
  648. package/clis/slock/task-list-server.js +4 -4
  649. package/clis/slock/task-list.js +5 -5
  650. package/clis/slock/task-status.js +3 -3
  651. package/clis/slock/task-unclaim.js +3 -3
  652. package/clis/slock/thread-follow.js +1 -1
  653. package/clis/slock/thread-state.js +1 -1
  654. package/clis/slock/unread-summary.js +5 -5
  655. package/clis/slock/whoami.js +1 -1
  656. package/clis/smzdm/search.js +3 -3
  657. package/clis/sohu/article.js +1 -1
  658. package/clis/sohu/attributes.js +1 -1
  659. package/clis/sohu/categories.js +1 -1
  660. package/clis/sohu/channels.js +1 -1
  661. package/clis/sohu/columns.js +1 -1
  662. package/clis/sohu/login.js +1 -1
  663. package/clis/sohu/stats.js +3 -3
  664. package/clis/sohu/topics.js +1 -1
  665. package/clis/sohu/whoami.js +1 -1
  666. package/clis/spotify/spotify.js +1 -1
  667. package/clis/stackoverflow/read.js +6 -6
  668. package/clis/stackoverflow/related.js +1 -1
  669. package/clis/stackoverflow/tag.js +1 -1
  670. package/clis/stackoverflow/user.js +1 -1
  671. package/clis/stackoverflow/utils.js +1 -1
  672. package/clis/steam/app.js +1 -1
  673. package/clis/steam/search.js +1 -1
  674. package/clis/steam/utils.js +1 -1
  675. package/clis/substack/auth.js +2 -2
  676. package/clis/substack/post-utils.js +2 -2
  677. package/clis/substack/publish.js +5 -5
  678. package/clis/suno/auth.js +2 -2
  679. package/clis/suno/download.js +5 -5
  680. package/clis/suno/generate.js +3 -3
  681. package/clis/suno/list.js +1 -1
  682. package/clis/suno/status.js +1 -1
  683. package/clis/suno/utils.js +29 -29
  684. package/clis/telegram/send.js +7 -7
  685. package/clis/telegram/shared.js +2 -2
  686. package/clis/telegram/whoami.js +1 -1
  687. package/clis/test-utils.js +1 -1
  688. package/clis/threads/post.js +23 -23
  689. package/clis/threads/shared.js +3 -3
  690. package/clis/threads/whoami.js +1 -1
  691. package/clis/tieba/hot.js +3 -3
  692. package/clis/tieba/posts.js +1 -1
  693. package/clis/tieba/read.js +2 -2
  694. package/clis/tieba/search.js +3 -3
  695. package/clis/tieba/utils.js +1 -1
  696. package/clis/tiktok/comment.js +2 -2
  697. package/clis/tiktok/creator-videos.js +3 -3
  698. package/clis/tiktok/explore.js +3 -3
  699. package/clis/tiktok/follow.js +8 -8
  700. package/clis/tiktok/following.js +4 -4
  701. package/clis/tiktok/friends.js +7 -7
  702. package/clis/tiktok/live.js +3 -3
  703. package/clis/tiktok/notifications.js +6 -6
  704. package/clis/tiktok/publish.js +17 -17
  705. package/clis/tiktok/unfollow.js +4 -4
  706. package/clis/tiktok/user.js +2 -2
  707. package/clis/tiktok/utils.js +1 -1
  708. package/clis/toutiao/article.js +1 -1
  709. package/clis/toutiao/articles.js +2 -2
  710. package/clis/toutiao/auth.js +2 -2
  711. package/clis/toutiao/hot.js +1 -1
  712. package/clis/toutiao/recommend.js +1 -1
  713. package/clis/toutiao/utils.js +2 -2
  714. package/clis/trae-solo/_actions.js +4 -4
  715. package/clis/trae-solo/_fs.js +5 -5
  716. package/clis/trae-solo/_state.js +2 -2
  717. package/clis/trae-solo/automation.js +4 -4
  718. package/clis/trae-solo/mode.js +4 -4
  719. package/clis/trae-solo/model.js +4 -4
  720. package/clis/trae-solo/renderer-storage.js +4 -4
  721. package/clis/trae-solo/settings.js +1 -1
  722. package/clis/trae-solo/skill-fs.js +1 -1
  723. package/clis/trae-solo/skill.js +12 -12
  724. package/clis/trae-solo/state-fs.js +2 -2
  725. package/clis/trae-solo/task-fs.js +5 -5
  726. package/clis/trae-solo/workspaces-fs.js +1 -1
  727. package/clis/tumblr/auth.js +2 -2
  728. package/clis/tumblr/publish.js +3 -3
  729. package/clis/tvmaze/search.js +1 -1
  730. package/clis/tvmaze/show.js +1 -1
  731. package/clis/tvmaze/utils.js +1 -1
  732. package/clis/twitter/accept.js +7 -7
  733. package/clis/twitter/article.js +7 -7
  734. package/clis/twitter/bookmark-folder.js +3 -3
  735. package/clis/twitter/bookmark-folders.js +3 -3
  736. package/clis/twitter/bookmarks.js +4 -4
  737. package/clis/twitter/delete.js +5 -5
  738. package/clis/twitter/device-follow.js +3 -3
  739. package/clis/twitter/dm-list.js +1 -1
  740. package/clis/twitter/dm-read.js +1 -1
  741. package/clis/twitter/dm-send.js +5 -5
  742. package/clis/twitter/dm-shared.js +3 -3
  743. package/clis/twitter/download.js +6 -6
  744. package/clis/twitter/followers.js +5 -5
  745. package/clis/twitter/following.js +2 -2
  746. package/clis/twitter/like.js +3 -3
  747. package/clis/twitter/likes.js +8 -8
  748. package/clis/twitter/list-add-core.js +9 -9
  749. package/clis/twitter/list-create.js +5 -5
  750. package/clis/twitter/list-remove-core.js +9 -9
  751. package/clis/twitter/list-tweets.js +7 -7
  752. package/clis/twitter/lists.js +6 -6
  753. package/clis/twitter/notifications.js +2 -2
  754. package/clis/twitter/post.js +24 -24
  755. package/clis/twitter/profile.js +7 -7
  756. package/clis/twitter/quote.js +7 -7
  757. package/clis/twitter/reply-dm.js +7 -7
  758. package/clis/twitter/reply.js +12 -12
  759. package/clis/twitter/retweet.js +3 -3
  760. package/clis/twitter/scheduled-delete.js +3 -3
  761. package/clis/twitter/scheduled-list.js +2 -2
  762. package/clis/twitter/scheduled-utils.js +3 -3
  763. package/clis/twitter/search.js +5 -5
  764. package/clis/twitter/shared.js +6 -6
  765. package/clis/twitter/thread.js +4 -4
  766. package/clis/twitter/timeline.js +3 -3
  767. package/clis/twitter/trending.js +2 -2
  768. package/clis/twitter/tweets.js +11 -11
  769. package/clis/twitter/unlike.js +3 -3
  770. package/clis/twitter/unretweet.js +3 -3
  771. package/clis/twitter/utils.js +6 -6
  772. package/clis/upwork/detail.js +2 -2
  773. package/clis/upwork/feed.js +2 -2
  774. package/clis/upwork/search.js +2 -2
  775. package/clis/upwork/utils.js +1 -1
  776. package/clis/v2ex/auth.js +2 -2
  777. package/clis/v2ex/daily.js +3 -3
  778. package/clis/v2ex/me.js +2 -2
  779. package/clis/v2ex/notifications.js +2 -2
  780. package/clis/vk/post.js +1 -1
  781. package/clis/vk/shared.js +2 -2
  782. package/clis/vk/whoami.js +1 -1
  783. package/clis/web/read.js +8 -8
  784. package/clis/wechat-channels/auth.js +2 -2
  785. package/clis/wechat-channels/publish.js +30 -30
  786. package/clis/weibo/article.js +1 -1
  787. package/clis/weibo/auth.js +3 -3
  788. package/clis/weibo/comments.js +1 -1
  789. package/clis/weibo/delete.js +2 -2
  790. package/clis/weibo/feed.js +3 -3
  791. package/clis/weibo/hot.js +1 -1
  792. package/clis/weibo/publish.js +10 -10
  793. package/clis/weibo/search.js +2 -2
  794. package/clis/weibo/user-posts.js +3 -3
  795. package/clis/weibo/user.js +2 -2
  796. package/clis/weibo/utils.js +3 -3
  797. package/clis/weixin/article.js +1 -1
  798. package/clis/weixin/create-draft.js +26 -26
  799. package/clis/weixin/download.js +2 -2
  800. package/clis/weixin/login.js +1 -1
  801. package/clis/weixin/search.js +2 -2
  802. package/clis/weixin/stats.js +3 -3
  803. package/clis/weixin/whoami.js +1 -1
  804. package/clis/weread/ai-outline.js +2 -2
  805. package/clis/weread/book-search.js +2 -2
  806. package/clis/weread/book.js +2 -2
  807. package/clis/weread/notebooks.js +1 -1
  808. package/clis/weread/search.js +1 -1
  809. package/clis/weread/shelf.js +1 -1
  810. package/clis/weread/utils.js +6 -6
  811. package/clis/weread-official/book.js +1 -1
  812. package/clis/weread-official/discover.js +1 -1
  813. package/clis/weread-official/list-apis.js +1 -1
  814. package/clis/weread-official/notes.js +1 -1
  815. package/clis/weread-official/readdata.js +1 -1
  816. package/clis/weread-official/review.js +1 -1
  817. package/clis/weread-official/search.js +1 -1
  818. package/clis/weread-official/shelf.js +1 -1
  819. package/clis/weread-official/utils.js +1 -1
  820. package/clis/wikidata/entity.js +1 -1
  821. package/clis/wikidata/search.js +1 -1
  822. package/clis/wikidata/utils.js +1 -1
  823. package/clis/wikipedia/page.js +1 -1
  824. package/clis/wikipedia/trending.js +1 -1
  825. package/clis/wikipedia/utils.js +1 -1
  826. package/clis/wordpress/login.js +1 -1
  827. package/clis/wordpress/publish.js +1 -1
  828. package/clis/wordpress/shared.js +3 -3
  829. package/clis/wordpress/whoami.js +1 -1
  830. package/clis/woshipm/article.js +1 -1
  831. package/clis/woshipm/login.js +1 -1
  832. package/clis/woshipm/stats.js +4 -4
  833. package/clis/woshipm/whoami.js +1 -1
  834. package/clis/wttr/current.js +1 -1
  835. package/clis/wttr/forecast.js +1 -1
  836. package/clis/wttr/utils.js +1 -1
  837. package/clis/xianyu/collect.js +1 -1
  838. package/clis/xianyu/inbox.js +1 -1
  839. package/clis/xianyu/item-stats.js +2 -2
  840. package/clis/xianyu/location.js +1 -1
  841. package/clis/xianyu/manage.js +1 -1
  842. package/clis/xianyu/messages.js +1 -1
  843. package/clis/xianyu/mtop.js +5 -5
  844. package/clis/xianyu/order.js +1 -1
  845. package/clis/xianyu/promote-stats.js +2 -2
  846. package/clis/xianyu/publish.js +17 -17
  847. package/clis/xianyu/rate.js +1 -1
  848. package/clis/xianyu/reply.js +1 -1
  849. package/clis/xianyu/search.js +8 -8
  850. package/clis/xianyu/seller-data.js +1 -1
  851. package/clis/xianyu/seller-list.js +1 -1
  852. package/clis/xianyu/user.js +1 -1
  853. package/clis/xiaoe/catalog.js +2 -2
  854. package/clis/xiaoe/content.js +2 -2
  855. package/clis/xiaoe/courses.js +2 -2
  856. package/clis/xiaohongshu/ask.js +6 -6
  857. package/clis/xiaohongshu/comments.js +6 -6
  858. package/clis/xiaohongshu/creator-note-detail.js +7 -7
  859. package/clis/xiaohongshu/creator-notes-summary.js +1 -1
  860. package/clis/xiaohongshu/creator-notes.js +13 -13
  861. package/clis/xiaohongshu/creator-profile.js +2 -2
  862. package/clis/xiaohongshu/creator-stats.js +2 -2
  863. package/clis/xiaohongshu/delete-note.js +7 -7
  864. package/clis/xiaohongshu/download.js +4 -4
  865. package/clis/xiaohongshu/feed.js +2 -2
  866. package/clis/xiaohongshu/follow.js +3 -3
  867. package/clis/xiaohongshu/human.js +3 -3
  868. package/clis/xiaohongshu/note-helpers.js +1 -1
  869. package/clis/xiaohongshu/note.js +2 -2
  870. package/clis/xiaohongshu/notifications.js +1 -1
  871. package/clis/xiaohongshu/publish-video.js +8 -8
  872. package/clis/xiaohongshu/publish.js +59 -59
  873. package/clis/xiaohongshu/search.js +8 -8
  874. package/clis/xiaohongshu/unfollow.js +4 -4
  875. package/clis/xiaohongshu/user-helpers.js +1 -1
  876. package/clis/xiaohongshu/user.js +2 -2
  877. package/clis/xiaoyuzhou/auth.js +3 -3
  878. package/clis/xiaoyuzhou/download.js +1 -1
  879. package/clis/xiaoyuzhou/utils.js +1 -1
  880. package/clis/xueqiu/article.js +4 -4
  881. package/clis/xueqiu/comments.js +4 -4
  882. package/clis/xueqiu/danjuan-utils.js +4 -4
  883. package/clis/xueqiu/earnings-date.js +1 -1
  884. package/clis/xueqiu/events.js +3 -3
  885. package/clis/xueqiu/hashtags.js +3 -3
  886. package/clis/xueqiu/stocks.js +3 -3
  887. package/clis/xueqiu/users.js +3 -3
  888. package/clis/xueqiu/utils.js +3 -3
  889. package/clis/yahoo-finance/quote.js +1 -1
  890. package/clis/yollomi/background.js +1 -1
  891. package/clis/yollomi/edit.js +1 -1
  892. package/clis/yollomi/face-swap.js +1 -1
  893. package/clis/yollomi/generate.js +1 -1
  894. package/clis/yollomi/object-remover.js +1 -1
  895. package/clis/yollomi/remove-bg.js +1 -1
  896. package/clis/yollomi/restore.js +1 -1
  897. package/clis/yollomi/try-on.js +1 -1
  898. package/clis/yollomi/upload.js +4 -4
  899. package/clis/yollomi/upscale.js +1 -1
  900. package/clis/yollomi/utils.js +4 -4
  901. package/clis/yollomi/video.js +1 -1
  902. package/clis/youtube/channel.js +4 -4
  903. package/clis/youtube/feed.js +2 -2
  904. package/clis/youtube/like.js +5 -5
  905. package/clis/youtube/playlist.js +7 -7
  906. package/clis/youtube/publish.js +11 -11
  907. package/clis/youtube/search.js +3 -3
  908. package/clis/youtube/subscribe.js +7 -7
  909. package/clis/youtube/subscriptions.js +1 -1
  910. package/clis/youtube/transcript-group.js +2 -2
  911. package/clis/youtube/transcript.js +13 -13
  912. package/clis/youtube/unlike.js +5 -5
  913. package/clis/youtube/unsubscribe.js +7 -7
  914. package/clis/youtube/utils.js +3 -3
  915. package/clis/youtube/video.js +4 -4
  916. package/clis/youtube/watch-later.js +2 -2
  917. package/clis/yuanbao/ask.js +18 -18
  918. package/clis/yuanbao/detail.js +1 -1
  919. package/clis/yuanbao/read.js +1 -1
  920. package/clis/yuanbao/shared.js +9 -9
  921. package/clis/yuanbao/status.js +1 -1
  922. package/clis/yuque/article.js +1 -1
  923. package/clis/yuque/whoami.js +1 -1
  924. package/clis/zhihu/answer-comments.js +2 -2
  925. package/clis/zhihu/answer-detail.js +3 -3
  926. package/clis/zhihu/answer.js +1 -1
  927. package/clis/zhihu/article-transform.js +1 -1
  928. package/clis/zhihu/article.js +1 -1
  929. package/clis/zhihu/auth.js +2 -2
  930. package/clis/zhihu/collection.js +3 -3
  931. package/clis/zhihu/collections.js +3 -3
  932. package/clis/zhihu/download.js +2 -2
  933. package/clis/zhihu/image-profile.js +6 -6
  934. package/clis/zhihu/paginate.js +3 -3
  935. package/clis/zhihu/pin.js +4 -4
  936. package/clis/zhihu/question.js +3 -3
  937. package/clis/zhihu/recommend.js +3 -3
  938. package/clis/zhihu/search.js +3 -3
  939. package/clis/zhihu/stats.js +3 -3
  940. package/clis/zhihu/user-arg.js +1 -1
  941. package/clis/zhihu/write-shared.js +7 -7
  942. package/clis/zlibrary/utils.js +6 -6
  943. package/clis/zsxq/auth.js +3 -3
  944. package/clis/zsxq/search.js +1 -1
  945. package/clis/zsxq/topic.js +1 -1
  946. package/clis/zsxq/utils.js +5 -5
  947. package/dist/src/adapter-source.js +1 -1
  948. package/dist/src/browser/analyze.js +1 -1
  949. package/dist/src/browser/article-extract.js +2 -2
  950. package/dist/src/browser/ax-snapshot.js +2 -2
  951. package/dist/src/browser/base-page.js +25 -25
  952. package/dist/src/browser/bridge.js +1 -1
  953. package/dist/src/browser/cdp.js +1 -1
  954. package/dist/src/browser/daemon-client.js +1 -1
  955. package/dist/src/browser/daemon-lifecycle.js +7 -7
  956. package/dist/src/browser/dom-helpers.js +35 -35
  957. package/dist/src/browser/dom-snapshot.js +19 -19
  958. package/dist/src/browser/errors.js +3 -3
  959. package/dist/src/browser/extract.js +5 -5
  960. package/dist/src/browser/find.js +13 -13
  961. package/dist/src/browser/fingerprint.js +2 -2
  962. package/dist/src/browser/html-tree.js +6 -6
  963. package/dist/src/browser/managed-chrome.js +1 -1
  964. package/dist/src/browser/network-cache.js +1 -1
  965. package/dist/src/browser/network-key.js +1 -1
  966. package/dist/src/browser/page.js +7 -7
  967. package/dist/src/browser/profile.js +2 -2
  968. package/dist/src/browser/proxy-test.js +8 -8
  969. package/dist/src/browser/shape-filter.js +1 -1
  970. package/dist/src/browser/shape.js +1 -1
  971. package/dist/src/browser/stealth.js +3 -3
  972. package/dist/src/browser/tabs.js +2 -2
  973. package/dist/src/browser/target-errors.js +1 -1
  974. package/dist/src/browser/target-resolver.js +23 -23
  975. package/dist/src/browser/trace.js +2 -2
  976. package/dist/src/browser/utils.js +1 -1
  977. package/dist/src/browser/verify-fixture.js +2 -2
  978. package/dist/src/browser-session-lock.js +1 -1
  979. package/dist/src/build-manifest.js +11 -11
  980. package/dist/src/capabilityRouting.js +1 -1
  981. package/dist/src/cli-argv-preprocess.js +1 -1
  982. package/dist/src/cli.js +32 -32
  983. package/dist/src/commanderAdapter.js +3 -3
  984. package/dist/src/commands/auth.js +3 -3
  985. package/dist/src/commands/daemon.js +1 -1
  986. package/dist/src/completion-fast.js +1 -1
  987. package/dist/src/completion.js +1 -1
  988. package/dist/src/constants.js +1 -1
  989. package/dist/src/convention-audit.js +2 -2
  990. package/dist/src/daemon-utils.js +1 -1
  991. package/dist/src/daemon.js +1 -1
  992. package/dist/src/discovery.js +2 -2
  993. package/dist/src/doctor.js +9 -9
  994. package/dist/src/download/article-download.js +15 -15
  995. package/dist/src/download/index.js +4 -4
  996. package/dist/src/download/media-download.js +1 -1
  997. package/dist/src/download/progress.js +3 -3
  998. package/dist/src/electron-apps.js +1 -1
  999. package/dist/src/errors.js +2 -2
  1000. package/dist/src/execution.js +2 -2
  1001. package/dist/src/external.js +1 -1
  1002. package/dist/src/help.js +8 -8
  1003. package/dist/src/hooks.js +1 -1
  1004. package/dist/src/interceptor.js +21 -21
  1005. package/dist/src/launcher.js +7 -7
  1006. package/dist/src/logger.js +8 -8
  1007. package/dist/src/main.js +7 -7
  1008. package/dist/src/observation/artifact.js +5 -5
  1009. package/dist/src/observation/retention.js +1 -1
  1010. package/dist/src/output.js +2 -2
  1011. package/dist/src/package-paths.js +1 -1
  1012. package/dist/src/pipeline/executor.js +1 -1
  1013. package/dist/src/pipeline/registry.js +1 -1
  1014. package/dist/src/pipeline/steps/browser.js +1 -1
  1015. package/dist/src/pipeline/steps/download.js +1 -1
  1016. package/dist/src/pipeline/steps/fetch.js +6 -6
  1017. package/dist/src/pipeline/steps/intercept.js +1 -1
  1018. package/dist/src/pipeline/steps/tap.js +17 -17
  1019. package/dist/src/pipeline/steps/transform.js +1 -1
  1020. package/dist/src/pipeline/template.js +1 -1
  1021. package/dist/src/plugin-manifest.js +1 -1
  1022. package/dist/src/plugin-scaffold.js +19 -19
  1023. package/dist/src/plugin.js +12 -12
  1024. package/dist/src/rate-limit.js +1 -1
  1025. package/dist/src/registry.js +1 -1
  1026. package/dist/src/runtime-detect.js +1 -1
  1027. package/dist/src/runtime.js +1 -1
  1028. package/dist/src/scripts/framework.js +1 -1
  1029. package/dist/src/scripts/interact.js +1 -1
  1030. package/dist/src/scripts/store.js +1 -1
  1031. package/dist/src/serialization.js +2 -2
  1032. package/dist/src/session-lease.js +1 -1
  1033. package/dist/src/snapshotFormatter.js +2 -2
  1034. package/dist/src/tui.js +12 -12
  1035. package/dist/src/user-runtime.js +1 -1
  1036. package/dist/src/utils.d.ts +12 -0
  1037. package/dist/src/utils.js +4 -4
  1038. package/dist/src/validate.js +2 -2
  1039. package/dist/src/verify.js +2 -2
  1040. package/dist/src/version.js +1 -1
  1041. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJsonAssignmentFromHtml as S,parseVideoId as b,prepareYoutubeApiPage as B}from"./utils.js";import{groupTranscriptSegments as M,formatGroupedTranscript as N}from"./transcript-group.js";import{CommandExecutionError as V,EmptyResultError as G}from"@jackwener/opencli/errors";function A(q){if(q&&typeof q==="object"&&"session"in q&&"data"in q)return q.data;return q}function P(q,K,{allowNull:L=!1}={}){const H=A(q);if(H==null&&L)return null;if(Array.isArray(H))return H;if(H&&typeof H==="object"&&H.error)throw new V(String(H.error));throw new V(`Malformed ${K} payload`)}function R(q){let K;try{K=JSON.parse(q)}catch(H){throw new V(`Malformed json3 timedtext response: ${H?.message||H}`)}if(!Array.isArray(K?.events))throw new V("Malformed json3 timedtext response: missing events array");const L=[];for(const H of K.events){const Q=Number(H?.tStartMs||0),X=Number(H?.dDurationMs||0),W=(Array.isArray(H?.segs)?H.segs:[]).map((J)=>J?.utf8||"").join("").replace(/\s+/g," ").trim();if(!W)continue;L.push({start:Q/1000,end:(Q+X)/1000,text:W})}return L}function f(q,K){if(!K)return!0;try{return new URL(q).searchParams.get("v")===K}catch{return!1}}function h(q,K,L){const H=A(q);if(!Array.isArray(H)||H.length===0)return{segments:[]};const Q=String(K||"").toLowerCase(),X=Q.split("-")[0],Z=H.filter((J)=>{const j=String(J?.url||"");if(!j.includes("/api/timedtext"))return!1;if(!j.includes("fmt=json3")||!j.includes("pot="))return!1;if(!f(j,L))return!1;if(!Q)return!0;try{const O=new URL(j),_=String(O.searchParams.get("lang")||"").toLowerCase(),F=_.split("-")[0];return _===Q||F===X||X===_}catch{return!1}}).reverse();let W="";for(const J of Z){const j=typeof J?.responsePreview==="string"?J.responsePreview:"";if(!j)continue;try{const O=R(j);if(O.length>0)return{segments:O}}catch(O){W=O?.message||String(O)}}return W?{error:W}:{segments:[]}}T({site:"youtube",name:"transcript",access:"read",description:"Get YouTube video transcript/subtitles",domain:"www.youtube.com",strategy:Y.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"},{name:"lang",required:!1,help:"Language code (e.g. en, zh-Hans). Omit to auto-select"},{name:"mode",required:!1,default:"grouped",help:"Output mode: grouped (readable paragraphs) or raw (every segment)"}],func:async(q,K)=>{const L=b(K.url),H=K.lang||"",Q=K.mode||"grouped",X="https://www.youtube.com/watch?v="+encodeURIComponent(L),Z=typeof q.startNetworkCapture==="function"&&typeof q.readNetworkCapture==="function";if(Z)try{await q.startNetworkCapture("/api/timedtext")}catch{}await q.goto(X,{waitUntil:"none"});await q.wait(3);const W=await q.evaluate(`
1
+ import{cli as w,Strategy as x}from"@jackwener/opencli/registry";import{extractJsonAssignmentFromHtml as v,parseVideoId as T,prepareYoutubeApiPage as b}from"./utils.js";import{groupTranscriptSegments as S,formatGroupedTranscript as A}from"./transcript-group.js";import{CommandExecutionError as c,EmptyResultError as h}from"@jackwener/opencli/errors";function m(e){if(e&&typeof e==="object"&&"session"in e&&"data"in e)return e.data;return e}function k(e,s,{allowNull:i=!1}={}){const a=m(e);if(a==null&&i)return null;if(Array.isArray(a))return a;if(a&&typeof a==="object"&&a.error)throw new c(String(a.error));throw new c(`Malformed ${s} payload`)}function C(e){let s;try{s=JSON.parse(e)}catch(a){throw new c(`Malformed json3 timedtext response: ${a?.message||a}`)}if(!Array.isArray(s?.events))throw new c("Malformed json3 timedtext response: missing events array");const i=[];for(const a of s.events){const l=Number(a?.tStartMs||0),d=Number(a?.dDurationMs||0),u=(Array.isArray(a?.segs)?a.segs:[]).map((n)=>n?.utf8||"").join("").replace(/\s+/g," ").trim();if(!u)continue;i.push({start:l/1000,end:(l+d)/1000,text:u})}return i}function R(e,s){if(!s)return!0;try{return new URL(e).searchParams.get("v")===s}catch{return!1}}function P(e,s,i){const a=m(e);if(!Array.isArray(a)||a.length===0)return{segments:[]};const l=String(s||"").toLowerCase(),d=l.split("-")[0],p=a.filter((n)=>{const t=String(n?.url||"");if(!t.includes("/api/timedtext"))return!1;if(!t.includes("fmt=json3")||!t.includes("pot="))return!1;if(!R(t,i))return!1;if(!l)return!0;try{const o=new URL(t),f=String(o.searchParams.get("lang")||"").toLowerCase(),y=f.split("-")[0];return f===l||y===d||d===f}catch{return!1}}).reverse();let u="";for(const n of p){const t=typeof n?.responsePreview==="string"?n.responsePreview:"";if(!t)continue;try{const o=C(t);if(o.length>0)return{segments:o}}catch(o){u=o?.message||String(o)}}return u?{error:u}:{segments:[]}}w({site:"youtube",name:"transcript",access:"read",description:"Get YouTube video transcript/subtitles",domain:"www.youtube.com",strategy:x.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"},{name:"lang",required:!1,help:"Language code (e.g. en, zh-Hans). Omit to auto-select"},{name:"mode",required:!1,default:"grouped",help:"Output mode: grouped (readable paragraphs) or raw (every segment)"}],func:async(e,s)=>{const i=T(s.url),a=s.lang||"",l=s.mode||"grouped",d="https://www.youtube.com/watch?v="+encodeURIComponent(i),p=typeof e.startNetworkCapture==="function"&&typeof e.readNetworkCapture==="function";if(p)try{await e.startNetworkCapture("/api/timedtext")}catch{}await e.goto(d,{waitUntil:"none"});await e.wait(3);const u=await e.evaluate(`
2
2
  (async () => {
3
- const langPref = ${JSON.stringify(H)};
3
+ const langPref = ${JSON.stringify(a)};
4
4
  // Scope all timedtext URL matching to the current video. YouTube is an
5
5
  // SPA, so watch→watch navigations preserve performance.getEntriesByType
6
6
  // entries from prior videos. Without this check a stale same-language
7
7
  // URL can be picked up by the polling loop before the current video's
8
8
  // fetch hook fires, leaking the predecessor's captions.
9
- const targetVideoId = ${JSON.stringify(L)};
9
+ const targetVideoId = ${JSON.stringify(i)};
10
10
  const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
11
11
 
12
12
  function textFromJson3Event(event) {
@@ -221,11 +221,11 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
221
221
  if (OriginalXHR) globalThis.XMLHttpRequest = OriginalXHR;
222
222
  }
223
223
  })()
224
- `);let J=P(W,"player caption extraction",{allowNull:!0});if(!J&&Z)try{const z=h(await q.readNetworkCapture(),H,L);if(z.error)throw new V(z.error);if(z.segments.length>0)J=z.segments}catch(z){if(z instanceof V)throw z}if(!J)await B(q);const j=J?null:A(await q.evaluate(`
224
+ `);let n=k(u,"player caption extraction",{allowNull:!0});if(!n&&p)try{const r=P(await e.readNetworkCapture(),a,i);if(r.error)throw new c(r.error);if(r.segments.length>0)n=r.segments}catch(r){if(r instanceof c)throw r}if(!n)await b(e);const t=n?null:m(await e.evaluate(`
225
225
  (async () => {
226
- const extractJsonAssignmentFromHtml = ${S.toString()};
226
+ const extractJsonAssignmentFromHtml = ${v.toString()};
227
227
 
228
- const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(L)}), {
228
+ const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(i)}), {
229
229
  credentials: 'include',
230
230
  });
231
231
  if (!watchResp.ok) return { error: 'Watch HTML returned HTTP ' + watchResp.status };
@@ -242,7 +242,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
242
242
  const tracks = renderer.captionTracks;
243
243
  const available = tracks.map(t => t.languageCode + (t.kind === 'asr' ? ' (auto)' : ''));
244
244
 
245
- const langPref = ${JSON.stringify(H)};
245
+ const langPref = ${JSON.stringify(a)};
246
246
  let track = null;
247
247
  if (langPref) {
248
248
  track = tracks.find(t => t.languageCode === langPref)
@@ -262,7 +262,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
262
262
  langPrefixMatched: !!(langPref && track.languageCode !== langPref && track.languageCode.startsWith(langPref))
263
263
  };
264
264
  })()
265
- `));if(!J&&(!j||typeof j!=="object"||Array.isArray(j)))throw new V(`Failed to get caption info: ${typeof j==="string"?j:"malformed response"}`);if(j?.error){const z=`${j.error}${j.available?" (available: "+j.available.join(", ")+")":""}`;if(j.error==="No captions available for this video")throw new G("youtube transcript","该视频没有字幕(作者未开启 + 无自动字幕)。");throw new V(z)}if(!J&&typeof j?.captionUrl!=="string")throw new V("Malformed caption info payload");if(j?.requestedLang&&!j.langMatched&&!j.langPrefixMatched)console.error(`Warning: --lang "${j.requestedLang}" not found. Using "${j.language}" instead. Available: ${j.available.join(", ")}`);if(!J){const z=j.captionUrl;let $=z;if(!/[&?]fmt=/.test(z))$=z+(z.includes("?")?"&":"?")+"fmt=srv3";J=P(await q.evaluate(`
265
+ `));if(!n&&(!t||typeof t!=="object"||Array.isArray(t)))throw new c(`Failed to get caption info: ${typeof t==="string"?t:"malformed response"}`);if(t?.error){const r=`${t.error}${t.available?" (available: "+t.available.join(", ")+")":""}`;if(t.error==="No captions available for this video")throw new h("youtube transcript","该视频没有字幕(作者未开启 + 无自动字幕)。");throw new c(r)}if(!n&&typeof t?.captionUrl!=="string")throw new c("Malformed caption info payload");if(t?.requestedLang&&!t.langMatched&&!t.langPrefixMatched)console.error(`Warning: --lang "${t.requestedLang}" not found. Using "${t.language}" instead. Available: ${t.available.join(", ")}`);if(!n){const r=t.captionUrl;let g=r;if(!/[&?]fmt=/.test(r))g=r+(r.includes("?")?"&":"?")+"fmt=srv3";n=k(await e.evaluate(`
266
266
  (async () => {
267
267
  async function fetchCaptionXml(url) {
268
268
  const resp = await fetch(url);
@@ -270,8 +270,8 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
270
270
  return { xml: await resp.text() || '' };
271
271
  }
272
272
 
273
- const primaryUrl = ${JSON.stringify($)};
274
- const originalUrl = ${JSON.stringify(z)};
273
+ const primaryUrl = ${JSON.stringify(g)};
274
+ const originalUrl = ${JSON.stringify(r)};
275
275
  let result = await fetchCaptionXml(primaryUrl);
276
276
  if (result.error) return result;
277
277
 
@@ -350,7 +350,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
350
350
 
351
351
  return results;
352
352
  })()
353
- `),"caption XML extraction")}if(J.length===0)throw new G("youtube transcript");let O=[];if(Q==="grouped")try{const z=A(await q.evaluate(`
353
+ `),"caption XML extraction")}if(n.length===0)throw new h("youtube transcript");let o=[];if(l==="grouped")try{const r=m(await e.evaluate(`
354
354
  (async () => {
355
355
  const cfg = window.ytcfg?.data_ || {};
356
356
  const apiKey = cfg.INNERTUBE_API_KEY;
@@ -362,7 +362,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
362
362
  headers: { 'Content-Type': 'application/json' },
363
363
  body: JSON.stringify({
364
364
  context: { client: { clientName: 'WEB', clientVersion: '2.20240101.00.00' } },
365
- videoId: ${JSON.stringify(L)}
365
+ videoId: ${JSON.stringify(i)}
366
366
  })
367
367
  });
368
368
  if (!resp.ok) return [];
@@ -414,4 +414,4 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
414
414
  }
415
415
  return chapters;
416
416
  })()
417
- `));if(Array.isArray(z))O=z}catch{}if(Q==="raw")return J.map((z,$)=>({index:$+1,start:Number(z.start).toFixed(2)+"s",end:Number(z.end).toFixed(2)+"s",text:z.text}));const _=M(J.map((z)=>({start:z.start,text:z.text}))),{rows:F}=N(_,O);return F}});
417
+ `));if(Array.isArray(r))o=r}catch{}if(l==="raw")return n.map((r,g)=>({index:g+1,start:Number(r.start).toFixed(2)+"s",end:Number(r.end).toFixed(2)+"s",text:r.text}));const f=S(n.map((r)=>({start:r.start,text:r.text}))),{rows:y}=A(f,o);return y}});
@@ -1,13 +1,13 @@
1
- import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{parseVideoId as T,prepareYoutubeApiPage as U,readYoutubeSapisid as W,SAPISID_HASH_FN as X}from"./utils.js";import{CommandExecutionError as Z,AuthRequiredError as L}from"@jackwener/opencli/errors";O({site:"youtube",name:"unlike",access:"write",description:"Remove like from a YouTube video",domain:"www.youtube.com",strategy:Q.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"}],columns:["status","message"],func:async(B,M)=>{const J=T(String(M.url));await U(B);const K=await W(B);if(!K)throw new L("www.youtube.com","Not logged in (SAPISID cookie missing)");const G=await B.evaluate(`
1
+ import{cli as a,Strategy as u}from"@jackwener/opencli/registry";import{parseVideoId as n,prepareYoutubeApiPage as c,readYoutubeSapisid as d,SAPISID_HASH_FN as g}from"./utils.js";import{CommandExecutionError as m,AuthRequiredError as s}from"@jackwener/opencli/errors";a({site:"youtube",name:"unlike",access:"write",description:"Remove like from a YouTube video",domain:"www.youtube.com",strategy:u.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"}],columns:["status","message"],func:async(e,i)=>{const r=n(String(i.url));await c(e);const o=await d(e);if(!o)throw new s("www.youtube.com","Not logged in (SAPISID cookie missing)");const t=await e.evaluate(`
2
2
  (async () => {
3
- ${X}
3
+ ${g}
4
4
 
5
5
  const cfg = window.ytcfg?.data_ || {};
6
6
  const apiKey = cfg.INNERTUBE_API_KEY;
7
7
  const context = cfg.INNERTUBE_CONTEXT;
8
8
  if (!apiKey || !context) return { error: 'config', message: 'YouTube config not found' };
9
9
 
10
- const authHash = await getSapisidHash(${JSON.stringify(K)}, 'https://www.youtube.com');
10
+ const authHash = await getSapisidHash(${JSON.stringify(o)}, 'https://www.youtube.com');
11
11
  if (!authHash) return { error: 'auth', message: 'Not logged in (SAPISID cookie missing)' };
12
12
 
13
13
  const resp = await fetch('/youtubei/v1/like/removelike?key=' + apiKey + '&prettyPrint=false', {
@@ -18,7 +18,7 @@ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{parseVide
18
18
  'Authorization': authHash,
19
19
  'X-Origin': 'https://www.youtube.com',
20
20
  },
21
- body: JSON.stringify({ context, target: { videoId: ${JSON.stringify(J)} } }),
21
+ body: JSON.stringify({ context, target: { videoId: ${JSON.stringify(r)} } }),
22
22
  });
23
23
 
24
24
  if (resp.status === 401 || resp.status === 403) return { error: 'auth', message: 'Not logged in' };
@@ -30,4 +30,4 @@ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{parseVide
30
30
  }
31
31
  return { ok: true };
32
32
  })()
33
- `);if(G?.error==="auth")throw new L("www.youtube.com");if(G?.error)throw new Z(G.message||"Failed to remove like");return[{status:"success",message:"Unliked: "+J}]}});
33
+ `);if(t?.error==="auth")throw new s("www.youtube.com");if(t?.error)throw new m(t.message||"Failed to remove like");return[{status:"success",message:"Unliked: "+r}]}});
@@ -1,22 +1,22 @@
1
- import{cli as T,Strategy as U}from"@jackwener/opencli/registry";import{prepareYoutubeApiPage as W,readYoutubeSapisid as X,SAPISID_HASH_FN as Z,RESOLVE_CHANNEL_HANDLE_FN as $}from"./utils.js";import{CommandExecutionError as f,AuthRequiredError as M}from"@jackwener/opencli/errors";T({site:"youtube",name:"unsubscribe",access:"write",description:"Unsubscribe from a YouTube channel",domain:"www.youtube.com",strategy:U.COOKIE,args:[{name:"channel",required:!0,positional:!0,help:"Channel ID (UCxxxx) or handle (@name)"}],columns:["status","message"],func:async(G,Q)=>{const J=String(Q.channel);await W(G);const K=await X(G);if(!K)throw new M("www.youtube.com","Not logged in (SAPISID cookie missing)");const B=await G.evaluate(`
1
+ import{cli as o,Strategy as i}from"@jackwener/opencli/registry";import{prepareYoutubeApiPage as u,readYoutubeSapisid as c,SAPISID_HASH_FN as h,RESOLVE_CHANNEL_HANDLE_FN as d}from"./utils.js";import{CommandExecutionError as l,AuthRequiredError as n}from"@jackwener/opencli/errors";o({site:"youtube",name:"unsubscribe",access:"write",description:"Unsubscribe from a YouTube channel",domain:"www.youtube.com",strategy:i.COOKIE,args:[{name:"channel",required:!0,positional:!0,help:"Channel ID (UCxxxx) or handle (@name)"}],columns:["status","message"],func:async(t,a)=>{const r=String(a.channel);await u(t);const s=await c(t);if(!s)throw new n("www.youtube.com","Not logged in (SAPISID cookie missing)");const e=await t.evaluate(`
2
2
  (async () => {
3
- ${Z}
3
+ ${h}
4
4
 
5
5
  const cfg = window.ytcfg?.data_ || {};
6
6
  const apiKey = cfg.INNERTUBE_API_KEY;
7
7
  const context = cfg.INNERTUBE_CONTEXT;
8
8
  if (!apiKey || !context) return { error: 'config', message: 'YouTube config not found' };
9
9
 
10
- const authHash = await getSapisidHash(${JSON.stringify(K)}, 'https://www.youtube.com');
10
+ const authHash = await getSapisidHash(${JSON.stringify(s)}, 'https://www.youtube.com');
11
11
  if (!authHash) return { error: 'auth', message: 'Not logged in (SAPISID cookie missing)' };
12
12
 
13
- ${$}
13
+ ${d}
14
14
 
15
- let channelId = ${JSON.stringify(J)};
15
+ let channelId = ${JSON.stringify(r)};
16
16
  channelId = await resolveChannelHandle(channelId, apiKey, context);
17
17
 
18
18
  if (!channelId.startsWith('UC')) {
19
- return { error: 'arg', message: 'Could not resolve channel ID from: ' + ${JSON.stringify(J)} };
19
+ return { error: 'arg', message: 'Could not resolve channel ID from: ' + ${JSON.stringify(r)} };
20
20
  }
21
21
 
22
22
  const resp = await fetch('/youtubei/v1/subscription/unsubscribe?key=' + apiKey + '&prettyPrint=false', {
@@ -39,4 +39,4 @@ import{cli as T,Strategy as U}from"@jackwener/opencli/registry";import{prepareYo
39
39
  }
40
40
  return { ok: true, channelId };
41
41
  })()
42
- `);if(B?.error==="auth")throw new M("www.youtube.com");if(B?.error)throw new f(B.message||"Failed to unsubscribe");return[{status:"success",message:"Unsubscribed from: "+(B.channelId||J)}]}});
42
+ `);if(e?.error==="auth")throw new n("www.youtube.com");if(e?.error)throw new l(e.message||"Failed to unsubscribe");return[{status:"success",message:"Unsubscribed from: "+(e.channelId||r)}]}});
@@ -1,4 +1,4 @@
1
- export function parseVideoId(z){if(!z.startsWith("http"))return z;try{const w=new URL(z);if(w.searchParams.has("v"))return w.searchParams.get("v");if(w.hostname==="youtu.be")return w.pathname.slice(1).split("/")[0];const q=w.pathname.match(/^\/(shorts|embed|live|v)\/([^/?]+)/);if(q)return q[2]}catch{}return z}export function extractJsonAssignmentFromHtml(z,w){const q=Array.isArray(w)?w:[w];for(const E of q){const J=[`var ${E} = `,`window["${E}"] = `,`window.${E} = `,`${E} = `];for(const K of J){const G=z.indexOf(K);if(G===-1)continue;const F=z.indexOf("{",G+K.length);if(F===-1)continue;let L=0,N=!1,O=!1;for(let B=F;B<z.length;B+=1){const H=z[B];if(N){if(O)O=!1;else if(H==="\\")O=!0;else if(H==='"')N=!1;continue}if(H==='"'){N=!0;continue}if(H==="{"){L+=1;continue}if(H==="}"){L-=1;if(L===0)try{return JSON.parse(z.slice(F,B+1))}catch{break}}}}}return null}export async function prepareYoutubeApiPage(z){await z.goto("https://www.youtube.com",{waitUntil:"none"});await z.wait(2)}export const FETCH_BROWSE_FN=`
1
+ export function parseVideoId(n){if(!n.startsWith("http"))return n;try{const e=new URL(n);if(e.searchParams.has("v"))return e.searchParams.get("v");if(e.hostname==="youtu.be")return e.pathname.slice(1).split("/")[0];const t=e.pathname.match(/^\/(shorts|embed|live|v)\/([^/?]+)/);if(t)return t[2]}catch{}return n}export function extractJsonAssignmentFromHtml(n,e){const t=Array.isArray(e)?e:[e];for(const i of t){const c=[`var ${i} = `,`window["${i}"] = `,`window.${i} = `,`${i} = `];for(const u of c){const s=n.indexOf(u);if(s===-1)continue;const o=n.indexOf("{",s+u.length);if(o===-1)continue;let p=0,d=!1,l=!1;for(let r=o;r<n.length;r+=1){const a=n[r];if(d){if(l)l=!1;else if(a==="\\")l=!0;else if(a==='"')d=!1;continue}if(a==='"'){d=!0;continue}if(a==="{"){p+=1;continue}if(a==="}"){p-=1;if(p===0)try{return JSON.parse(n.slice(o,r+1))}catch{break}}}}}return null}export async function prepareYoutubeApiPage(n){await n.goto("https://www.youtube.com",{waitUntil:"none"});await n.wait(2)}export const FETCH_BROWSE_FN=`
2
2
  async function fetchBrowse(apiKey, body) {
3
3
  const resp = await fetch('/youtubei/v1/browse?key=' + apiKey + '&prettyPrint=false', {
4
4
  method: 'POST',
@@ -9,7 +9,7 @@ async function fetchBrowse(apiKey, body) {
9
9
  if (!resp.ok) return { error: 'InnerTube browse API returned HTTP ' + resp.status };
10
10
  return resp.json();
11
11
  }
12
- `;export function extractPlaylistVideos(z){return z.filter((w)=>w.playlistVideoRenderer).map((w)=>{const q=w.playlistVideoRenderer,E=q.videoInfo?.runs||[];return{rank:parseInt(q.index?.simpleText||"0",10),title:q.title?.runs?.[0]?.text||"",channel:q.shortBylineText?.runs?.[0]?.text||"",duration:q.lengthText?.simpleText||"",views:E[0]?.text||"",published:E[2]?.text||"",url:"https://www.youtube.com/watch?v="+q.videoId}})}export function extractSubscriptionChannel(z){const w=(B)=>{if(!B)return"";if(typeof B.simpleText==="string")return B.simpleText.trim();if(Array.isArray(B.runs))return B.runs.map((H)=>H?.text||"").join("").trim();return""},q=z||{},E=w(q.title),J=q.navigationEndpoint?.browseEndpoint?.canonicalBaseUrl||"",K=q.channelId||q.navigationEndpoint?.browseEndpoint?.browseId||"",G=w(q.subscriberCountText),F=w(q.videoCountText),L=[w(q.channelHandleText),J.startsWith("/@")?J.slice(1):"",G.startsWith("@")?G:"",F.startsWith("@")?F:""].find(Boolean)||"",N=[!G.startsWith("@")?G:"",!F.startsWith("@")?F:""].find(Boolean)||"",O=J?"https://www.youtube.com"+J:K?"https://www.youtube.com/channel/"+K:"";return{name:E,handle:L,subscribers:N,url:O}}export const RESOLVE_CHANNEL_HANDLE_FN=`
12
+ `;export function extractPlaylistVideos(n){return n.filter((e)=>e.playlistVideoRenderer).map((e)=>{const t=e.playlistVideoRenderer,i=t.videoInfo?.runs||[];return{rank:parseInt(t.index?.simpleText||"0",10),title:t.title?.runs?.[0]?.text||"",channel:t.shortBylineText?.runs?.[0]?.text||"",duration:t.lengthText?.simpleText||"",views:i[0]?.text||"",published:i[2]?.text||"",url:"https://www.youtube.com/watch?v="+t.videoId}})}export function extractSubscriptionChannel(n){const e=(r)=>{if(!r)return"";if(typeof r.simpleText==="string")return r.simpleText.trim();if(Array.isArray(r.runs))return r.runs.map((a)=>a?.text||"").join("").trim();return""},t=n||{},i=e(t.title),c=t.navigationEndpoint?.browseEndpoint?.canonicalBaseUrl||"",u=t.channelId||t.navigationEndpoint?.browseEndpoint?.browseId||"",s=e(t.subscriberCountText),o=e(t.videoCountText),p=[e(t.channelHandleText),c.startsWith("/@")?c.slice(1):"",s.startsWith("@")?s:"",o.startsWith("@")?o:""].find(Boolean)||"",d=[!s.startsWith("@")?s:"",!o.startsWith("@")?o:""].find(Boolean)||"",l=c?"https://www.youtube.com"+c:u?"https://www.youtube.com/channel/"+u:"";return{name:i,handle:p,subscribers:d,url:l}}export const RESOLVE_CHANNEL_HANDLE_FN=`
13
13
  async function resolveChannelHandle(input, apiKey, context) {
14
14
  if (!input.startsWith('@')) return input;
15
15
  const resp = await fetch('/youtubei/v1/navigation/resolve_url?key=' + apiKey + '&prettyPrint=false', {
@@ -31,4 +31,4 @@ async function getSapisidHash(sapisid, origin) {
31
31
  const hashHex = Array.from(new Uint8Array(hashBuffer)).map(b => b.toString(16).padStart(2, '0')).join('');
32
32
  return 'SAPISIDHASH ' + time + '_' + hashHex;
33
33
  }
34
- `;export async function readYoutubeSapisid(z){const w=await z.getCookies({url:"https://www.youtube.com"});return w.find((q)=>q.name==="__Secure-3PAPISID")?.value||w.find((q)=>q.name==="SAPISID")?.value||null}
34
+ `;export async function readYoutubeSapisid(n){const e=await n.getCookies({url:"https://www.youtube.com"});return e.find((t)=>t.name==="__Secure-3PAPISID")?.value||e.find((t)=>t.name==="SAPISID")?.value||null}
@@ -1,8 +1,8 @@
1
- import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{extractJsonAssignmentFromHtml as T,parseVideoId as U,prepareYoutubeApiPage as W}from"./utils.js";import{CommandExecutionError as D}from"@jackwener/opencli/errors";function X(h){if(h&&typeof h==="object"&&"session"in h&&"data"in h)return h.data;return h}function Z(h){const z=X(h);if(!z||typeof z!=="object"||Array.isArray(z))throw new D("Failed to extract video metadata from page");if(z.error)throw new D(String(z.error));if(typeof z.playabilityStatus!=="string")throw new D("YouTube video metadata is missing playabilityStatus");if(typeof z.playabilityReason!=="string")throw new D("YouTube video metadata is missing playabilityReason");if(typeof z.membersOnly!=="boolean")throw new D("YouTube video metadata is missing membersOnly");return z}O({site:"youtube",name:"video",access:"read",description:"Get YouTube video metadata (title, views, description, etc.)",domain:"www.youtube.com",strategy:Q.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"}],columns:["field","value"],func:async(h,z)=>{const G=U(z.url);await W(h);const K=await h.evaluate(`
1
+ import{cli as l,Strategy as c}from"@jackwener/opencli/registry";import{extractJsonAssignmentFromHtml as d,parseVideoId as u,prepareYoutubeApiPage as m}from"./utils.js";import{CommandExecutionError as o}from"@jackwener/opencli/errors";function y(t){if(t&&typeof t==="object"&&"session"in t&&"data"in t)return t.data;return t}function p(t){const e=y(t);if(!e||typeof e!=="object"||Array.isArray(e))throw new o("Failed to extract video metadata from page");if(e.error)throw new o(String(e.error));if(typeof e.playabilityStatus!=="string")throw new o("YouTube video metadata is missing playabilityStatus");if(typeof e.playabilityReason!=="string")throw new o("YouTube video metadata is missing playabilityReason");if(typeof e.membersOnly!=="boolean")throw new o("YouTube video metadata is missing membersOnly");return e}l({site:"youtube",name:"video",access:"read",description:"Get YouTube video metadata (title, views, description, etc.)",domain:"www.youtube.com",strategy:c.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"}],columns:["field","value"],func:async(t,e)=>{const i=u(e.url);await m(t);const n=await t.evaluate(`
2
2
  (async () => {
3
- const extractJsonAssignmentFromHtml = ${T.toString()};
3
+ const extractJsonAssignmentFromHtml = ${d.toString()};
4
4
 
5
- const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(G)}), {
5
+ const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(i)}), {
6
6
  credentials: 'include',
7
7
  });
8
8
  if (!watchResp.ok) return { error: 'Watch HTML returned HTTP ' + watchResp.status };
@@ -93,4 +93,4 @@ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{extractJs
93
93
  membersOnly,
94
94
  };
95
95
  })()
96
- `),L=Z(K);return Object.entries(L).map(([M,N])=>({field:M,value:String(N)}))}});
96
+ `),s=p(n);return Object.entries(s).map(([a,r])=>({field:a,value:String(r)}))}});
@@ -1,4 +1,4 @@
1
- import{cli as s,Strategy as r}from"@jackwener/opencli/registry";import{FETCH_BROWSE_FN as c,extractPlaylistVideos as l}from"./utils.js";import{CommandExecutionError as n,EmptyResultError as d}from"@jackwener/opencli/errors";s({site:"youtube",name:"watch-later",access:"read",description:"Get your YouTube Watch Later queue",domain:"www.youtube.com",strategy:r.COOKIE,args:[{name:"limit",type:"int",default:50,help:"Max videos to return (default 50, max 200)"}],columns:["rank","title","channel","duration","views","published","url"],func:async(e,o)=>{const i=Math.min(o.limit||50,200);await e.goto("https://www.youtube.com/playlist?list=WL");await e.wait(3);const t=await e.evaluate(`
1
+ import{cli as a,Strategy as r}from"@jackwener/opencli/registry";import{FETCH_BROWSE_FN as c,extractPlaylistVideos as l}from"./utils.js";import{CommandExecutionError as n,EmptyResultError as d}from"@jackwener/opencli/errors";a({site:"youtube",name:"watch-later",access:"read",description:"Get your YouTube Watch Later queue",domain:"www.youtube.com",strategy:r.COOKIE,args:[{name:"limit",type:"int",default:50,help:"Max videos to return (default 50, max 200)"}],columns:["rank","title","channel","duration","views","published","url"],func:async(e,o)=>{const i=Math.min(o.limit||50,200);await e.goto("https://www.youtube.com/playlist?list=WL");await e.wait(3);const t=await e.evaluate(`
2
2
  (async () => {
3
3
  const d = window.ytInitialData;
4
4
  if (!d) return { error: 'YouTube data not found — are you logged in?' };
@@ -37,5 +37,5 @@ import{cli as s,Strategy as r}from"@jackwener/opencli/registry";import{FETCH_BRO
37
37
 
38
38
  return { title, stats, videos: videos.slice(0, limit) };
39
39
  })()
40
- `);if(!t||typeof t!=="object")throw new n("Failed to fetch Watch Later — make sure you are logged into YouTube");if(t.error)throw new n(String(t.error));if(!t.videos?.length)throw new d("youtube watch-later");const a=(t.stats||[]).join(" | ");process.stderr.write(`${t.title} ${a}
40
+ `);if(!t||typeof t!=="object")throw new n("Failed to fetch Watch Later — make sure you are logged into YouTube");if(t.error)throw new n(String(t.error));if(!t.videos?.length)throw new d("youtube watch-later");const s=(t.stats||[]).join(" | ");process.stderr.write(`${t.title} ${s}
41
41
  `);return t.videos}});
@@ -1,17 +1,17 @@
1
- import{cli as N,Strategy as U}from"@jackwener/opencli/registry";import{htmlToMarkdown as O}from"@jackwener/opencli/utils";import{ArgumentError as _,CommandExecutionError as h,TimeoutError as R}from"@jackwener/opencli/errors";import{YUANBAO_DOMAIN as Y,IS_VISIBLE_JS as Z,authRequired as H,isOnYuanbao as z,ensureYuanbaoPage as M,hasLoginGate as P,normalizeBooleanFlag as Q,sendYuanbaoMessage as k}from"./shared.js";const L=2,w=8000,C=3;function S(j,y){const q=y?` Detail: ${y}`:"";return new h(`${j||"Unknown Yuanbao send failure."}${q}`,"Make sure the Yuanbao chat composer is visible and ready before retrying.")}function I(j){return typeof j==="string"?j.trim():""}export function convertYuanbaoHtmlToMarkdown(j){return O(j,(y)=>{y.addRule("table",{filter:"table",replacement:(q)=>`
1
+ import{cli as w,Strategy as y}from"@jackwener/opencli/registry";import{htmlToMarkdown as S}from"@jackwener/opencli/utils";import{ArgumentError as A,CommandExecutionError as x,TimeoutError as T}from"@jackwener/opencli/errors";import{YUANBAO_DOMAIN as L,IS_VISIBLE_JS as u,authRequired as f,isOnYuanbao as E,ensureYuanbaoPage as Y,hasLoginGate as m,normalizeBooleanFlag as b,sendYuanbaoMessage as C}from"./shared.js";const v=2,k=8000,M=3;function q(e,n){const t=n?` Detail: ${n}`:"";return new x(`${e||"Unknown Yuanbao send failure."}${t}`,"Make sure the Yuanbao chat composer is visible and ready before retrying.")}function h(e){return typeof e==="string"?e.trim():""}export function convertYuanbaoHtmlToMarkdown(e){return S(e,(n)=>{n.addRule("table",{filter:"table",replacement:(t)=>`
2
2
 
3
- ${q}
3
+ ${t}
4
4
 
5
- `});y.addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:(q)=>q});y.addRule("tableRow",{filter:"tr",replacement:(q,F)=>{const G=F,J=Array.from(G.children),W=G.parentElement?.tagName==="THEAD"||J.length>0&&J.every((X)=>X.tagName==="TH"),K=`${q}
6
- `;if(!W)return K;const V=`| ${J.map(()=>"---").join(" | ")} |
7
- `;return`${K}${V}`}});y.addRule("tableCell",{filter:["th","td"],replacement:(q,F)=>{const G=F;return`${(G.parentElement?Array.from(G.parentElement.children).indexOf(G):0)===0?"| ":" "}${q.trim()} |`}})})}export function sanitizeYuanbaoResponseText(j,y){let q=j.replace(/内容由AI生成,仅供参考/gi,"").replace(/重新回答/gi,"").trim();if(/^(正在搜索资料|搜索资料中|正在思考|思考中)[.。…]*$/u.test(q))return"";const F=y.trim();if(!F)return q;if(q===F)return"";for(const G of[`
5
+ `});n.addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:(t)=>t});n.addRule("tableRow",{filter:"tr",replacement:(t,o)=>{const a=o,r=Array.from(a.children),l=a.parentElement?.tagName==="THEAD"||r.length>0&&r.every((c)=>c.tagName==="TH"),i=`${t}
6
+ `;if(!l)return i;const s=`| ${r.map(()=>"---").join(" | ")} |
7
+ `;return`${i}${s}`}});n.addRule("tableCell",{filter:["th","td"],replacement:(t,o)=>{const a=o;return`${(a.parentElement?Array.from(a.parentElement.children).indexOf(a):0)===0?"| ":" "}${t.trim()} |`}})})}export function sanitizeYuanbaoResponseText(e,n){let t=e.replace(/内容由AI生成,仅供参考/gi,"").replace(/重新回答/gi,"").trim();if(/^(正在搜索资料|搜索资料中|正在思考|思考中)[.。…]*$/u.test(t))return"";const o=n.trim();if(!o)return t;if(t===o)return"";for(const a of[`
8
8
 
9
9
  `,`
10
10
  `,`\r
11
11
  \r
12
12
  `,`\r
13
- `," "]){const J=`${F}${G}`;if(q.startsWith(J)){q=q.slice(J.length).trim();break}}return q}export function collectYuanbaoTranscriptAdditions(j,y,q){const F=new Set(j);return y.filter((J)=>!F.has(J)).map((J)=>sanitizeYuanbaoResponseText(J,q)).filter((J)=>J&&J!==q).join(`
14
- `).trim()}export function pickLatestYuanbaoAssistantCandidate(j,y,q){const F=j.slice(Math.max(0,y)).map((G)=>sanitizeYuanbaoResponseText(G,q)).filter(Boolean);for(let G=F.length-1;G>=0;G-=1)if(F[G]!==q.trim())return F[G];return""}export function updateStableState(j,y,q){if(!q)return{previousText:"",stableCount:0};if(q===j)return{previousText:j,stableCount:y+1};return{previousText:q,stableCount:0}}function A(){return`
13
+ `," "]){const r=`${o}${a}`;if(t.startsWith(r)){t=t.slice(r.length).trim();break}}return t}export function collectYuanbaoTranscriptAdditions(e,n,t){const o=new Set(e);return n.filter((r)=>!o.has(r)).map((r)=>sanitizeYuanbaoResponseText(r,t)).filter((r)=>r&&r!==t).join(`
14
+ `).trim()}export function pickLatestYuanbaoAssistantCandidate(e,n,t){const o=e.slice(Math.max(0,n)).map((a)=>sanitizeYuanbaoResponseText(a,t)).filter(Boolean);for(let a=o.length-1;a>=0;a-=1)if(o[a]!==t.trim())return o[a];return""}export function updateStableState(e,n,t){if(!t)return{previousText:"",stableCount:0};if(t===e)return{previousText:e,stableCount:n+1};return{previousText:t,stableCount:0}}function N(){return`
15
15
  (() => {
16
16
  const clean = (value) => (value || '')
17
17
  .replace(/\\u00a0/g, ' ')
@@ -82,8 +82,8 @@ ${q}
82
82
  && !stopLines.has(line)
83
83
  && !noisyPatterns.some((pattern) => pattern.test(line)));
84
84
  })()
85
- `}async function B(j){const y=await j.evaluate(A());return Array.isArray(y)?y.map(I).filter(Boolean):[]}async function E(j){const y=await j.evaluate(`(() => {
86
- ${Z}
85
+ `}async function _(e){const n=await e.evaluate(N());return Array.isArray(n)?n.map(h).filter(Boolean):[]}async function g(e){const n=await e.evaluate(`(() => {
86
+ ${u}
87
87
 
88
88
  const roots = Array.from(document.querySelectorAll('.agent-chat__list__item--ai'))
89
89
  .filter((node) => isVisible(node));
@@ -101,8 +101,8 @@ ${q}
101
101
 
102
102
  return root instanceof HTMLElement ? (root.innerHTML || root.textContent || '') : '';
103
103
  }).filter(Boolean);
104
- })()`);return Array.isArray(y)?y.map((q)=>convertYuanbaoHtmlToMarkdown(typeof q==="string"?q:"")).map(I).filter(Boolean):[]}async function f(j){return await j.evaluate(`(() => {
105
- ${Z}
104
+ })()`);return Array.isArray(n)?n.map((t)=>convertYuanbaoHtmlToMarkdown(typeof t==="string"?t:"")).map(h).filter(Boolean):[]}async function R(e){return await e.evaluate(`(() => {
105
+ ${u}
106
106
 
107
107
  const button = Array.from(document.querySelectorAll('[dt-button-id="internet_search"]'))
108
108
  .find((node) => isVisible(node));
@@ -115,15 +115,15 @@ ${q}
115
115
  found: true,
116
116
  enabled: attr === 'openInternetSearch' || className.includes('index_v2_active__'),
117
117
  };
118
- })()`)}async function v(j,y){const q=await f(j);if(!q.found||q.enabled===y)return;await j.evaluate(`(() => {
119
- ${Z}
118
+ })()`)}async function I(e,n){const t=await R(e);if(!t.found||t.enabled===n)return;await e.evaluate(`(() => {
119
+ ${u}
120
120
 
121
121
  const button = Array.from(document.querySelectorAll('[dt-button-id="internet_search"]'))
122
122
  .find((node) => isVisible(node));
123
123
 
124
124
  if (button instanceof HTMLElement) button.click();
125
- })()`);await j.wait(0.5)}async function b(j){return await j.evaluate(`(() => {
126
- ${Z}
125
+ })()`);await e.wait(0.5)}async function B(e){return await e.evaluate(`(() => {
126
+ ${u}
127
127
 
128
128
  const button = Array.from(document.querySelectorAll('[dt-button-id="deep_think"]'))
129
129
  .find((node) => isVisible(node));
@@ -135,11 +135,11 @@ ${q}
135
135
  found: true,
136
136
  enabled: className.includes('ThinkSelector_selected__'),
137
137
  };
138
- })()`)}async function T(j,y){const q=await b(j);if(!q.found||q.enabled===y)return;await j.evaluate(`(() => {
139
- ${Z}
138
+ })()`)}async function H(e,n){const t=await B(e);if(!t.found||t.enabled===n)return;await e.evaluate(`(() => {
139
+ ${u}
140
140
 
141
141
  const button = Array.from(document.querySelectorAll('[dt-button-id="deep_think"]'))
142
142
  .find((node) => isVisible(node));
143
143
 
144
144
  if (button instanceof HTMLElement) button.click();
145
- })()`);await j.wait(0.5)}async function c(j,y,q,F,G){const J=Date.now();let W="",K=0,V="";while(Date.now()-J<G*1000){await j.wait(L);if(await P(j))return"blocked";const X=await E(j),$=pickLatestYuanbaoAssistantCandidate(X,y,F)||collectYuanbaoTranscriptAdditions(q,await B(j),F);if(!$)continue;V=$;const D=updateStableState(W,K,$);W=D.previousText;K=D.stableCount;if(Date.now()-J>=w&&K>=C)return $}return V||null}export const askCommand=N({site:"yuanbao",name:"ask",access:"write",description:"Send a prompt to Yuanbao web chat and wait for the assistant response",domain:Y,strategy:U.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,defaultFormat:"plain",args:[{name:"prompt",fromFile:!0,required:!0,positional:!0,help:"Prompt to send"},{name:"timeout",type:"int",required:!1,help:"Max seconds to wait (default: 60)",default:60},{name:"search",type:"boolean",required:!1,help:"Enable Yuanbao internet search (default: true)",default:!0},{name:"think",type:"boolean",required:!1,help:"Enable Yuanbao deep thinking (default: false)",default:!1}],columns:["Role","Text"],func:async(j,y)=>{const{prompt:q,timeout:F}=y;if(!Number.isInteger(F)||F<1)throw new _("--timeout must be a positive integer (seconds)");const G=Q(y.search,!0),J=Q(y.think,!1);await M(j);if(await P(j))throw H("Yuanbao opened a login gate before sending the prompt.");await v(j,G);await T(j,J);const W=await E(j),K=await B(j),V=await k(j,q);if(!V?.ok){if(await P(j))throw H("Yuanbao opened a login gate instead of accepting the prompt.");throw S(V?.reason,V?.detail)}const X=await c(j,W.length,K,q,F);if(X==="blocked")throw H("Yuanbao opened a login gate instead of returning a chat response.");if(!X)throw new R("yuanbao ask",F,"No Yuanbao response was observed before the timeout. Retry with --timeout, and verify the current browser session is still interactive.");return[{Role:"User",Text:q},{Role:"Assistant",Text:X}]}}),__test__={collectYuanbaoTranscriptAdditions,convertYuanbaoHtmlToMarkdown,isOnYuanbao:z,normalizeBooleanFlag:Q,pickLatestYuanbaoAssistantCandidate,sanitizeYuanbaoResponseText,updateStableState};
145
+ })()`);await e.wait(0.5)}async function O(e,n,t,o,a){const r=Date.now();let l="",i=0,s="";while(Date.now()-r<a*1000){await e.wait(v);if(await m(e))return"blocked";const c=await g(e),d=pickLatestYuanbaoAssistantCandidate(c,n,o)||collectYuanbaoTranscriptAdditions(t,await _(e),o);if(!d)continue;s=d;const p=updateStableState(l,i,d);l=p.previousText;i=p.stableCount;if(Date.now()-r>=k&&i>=M)return d}return s||null}export const askCommand=w({site:"yuanbao",name:"ask",access:"write",description:"Send a prompt to Yuanbao web chat and wait for the assistant response",domain:L,strategy:y.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,defaultFormat:"plain",args:[{name:"prompt",fromFile:!0,required:!0,positional:!0,help:"Prompt to send"},{name:"timeout",type:"int",required:!1,help:"Max seconds to wait (default: 60)",default:60},{name:"search",type:"boolean",required:!1,help:"Enable Yuanbao internet search (default: true)",default:!0},{name:"think",type:"boolean",required:!1,help:"Enable Yuanbao deep thinking (default: false)",default:!1}],columns:["Role","Text"],func:async(e,n)=>{const{prompt:t,timeout:o}=n;if(!Number.isInteger(o)||o<1)throw new A("--timeout must be a positive integer (seconds)");const a=b(n.search,!0),r=b(n.think,!1);await Y(e);if(await m(e))throw f("Yuanbao opened a login gate before sending the prompt.");await I(e,a);await H(e,r);const l=await g(e),i=await _(e),s=await C(e,t);if(!s?.ok){if(await m(e))throw f("Yuanbao opened a login gate instead of accepting the prompt.");throw q(s?.reason,s?.detail)}const c=await O(e,l.length,i,t,o);if(c==="blocked")throw f("Yuanbao opened a login gate instead of returning a chat response.");if(!c)throw new T("yuanbao ask",o,"No Yuanbao response was observed before the timeout. Retry with --timeout, and verify the current browser session is still interactive.");return[{Role:"User",Text:t},{Role:"Assistant",Text:c}]}}),__test__={collectYuanbaoTranscriptAdditions,convertYuanbaoHtmlToMarkdown,isOnYuanbao:E,normalizeBooleanFlag:b,pickLatestYuanbaoAssistantCandidate,sanitizeYuanbaoResponseText,updateStableState};
@@ -1 +1 @@
1
- import{cli as $,Strategy as q}from"@jackwener/opencli/registry";import{EmptyResultError as x}from"@jackwener/opencli/errors";import{YUANBAO_DOMAIN as G,YUANBAO_URL as H,getYuanbaoMessageBubbles as V,parseYuanbaoSessionId as P,hasLoginGate as T,authRequired as f}from"./shared.js";import{convertYuanbaoHtmlToMarkdown as m}from"./ask.js";$({site:"yuanbao",name:"detail",access:"read",description:"Open a Yuanbao conversation by ID and read its messages",domain:G,strategy:q.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[{name:"id",positional:!0,required:!0,help:'Full https://yuanbao.tencent.com/chat/<agentId>/<convId> URL or "<agentId>/<convId>" pair (a UUID alone is not enough — Yuanbao requires the agent slug)'}],columns:["Role","Text"],func:async(C,Q)=>{const{agentId:J,convId:K}=P(Q.id);await C.goto(`${H}chat/${J}/${K}`,{waitUntil:"load",settleMs:2500});await C.wait(2);if(await T(C))throw f("Yuanbao opened a login gate when navigating to the conversation.");let F=[];const W=20000,X=1,Z=Date.now();while(Date.now()-Z<W){F=await V(C);if(F.length>0)break;await C.wait(X)}if(!F.length)throw new x("yuanbao detail",`No visible messages found for conversation ${J}/${K}. Verify the IDs are correct and that the session belongs to the current login.`);return F.map((z)=>({Role:z.role,Text:z.role==="Assistant"&&z.html?m(z.html).trim()||z.text:z.text}))}});
1
+ import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{EmptyResultError as d}from"@jackwener/opencli/errors";import{YUANBAO_DOMAIN as h,YUANBAO_URL as m,getYuanbaoMessageBubbles as g,parseYuanbaoSessionId as w,hasLoginGate as b,authRequired as I}from"./shared.js";import{convertYuanbaoHtmlToMarkdown as f}from"./ask.js";u({site:"yuanbao",name:"detail",access:"read",description:"Open a Yuanbao conversation by ID and read its messages",domain:h,strategy:c.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[{name:"id",positional:!0,required:!0,help:'Full https://yuanbao.tencent.com/chat/<agentId>/<convId> URL or "<agentId>/<convId>" pair (a UUID alone is not enough — Yuanbao requires the agent slug)'}],columns:["Role","Text"],func:async(e,s)=>{const{agentId:o,convId:n}=w(s.id);await e.goto(`${m}chat/${o}/${n}`,{waitUntil:"load",settleMs:2500});await e.wait(2);if(await b(e))throw I("Yuanbao opened a login gate when navigating to the conversation.");let a=[];const i=20000,r=1,l=Date.now();while(Date.now()-l<i){a=await g(e);if(a.length>0)break;await e.wait(r)}if(!a.length)throw new d("yuanbao detail",`No visible messages found for conversation ${o}/${n}. Verify the IDs are correct and that the session belongs to the current login.`);return a.map((t)=>({Role:t.role,Text:t.role==="Assistant"&&t.html?f(t.html).trim()||t.text:t.text}))}});
@@ -1 +1 @@
1
- import{cli as C,Strategy as E}from"@jackwener/opencli/registry";import{YUANBAO_DOMAIN as F,ensureYuanbaoPage as G,getYuanbaoMessageBubbles as J}from"./shared.js";import{convertYuanbaoHtmlToMarkdown as K}from"./ask.js";C({site:"yuanbao",name:"read",access:"read",description:"Read messages in the current Yuanbao conversation",domain:F,strategy:E.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Role","Text"],func:async(q)=>{await G(q);await q.wait(1.5);const z=await J(q);if(!z.length)return[{Role:"system",Text:"No visible messages in the current Yuanbao conversation."}];return z.map((f)=>({Role:f.role,Text:f.role==="Assistant"&&f.html?K(f.html).trim()||f.text:f.text}))}});
1
+ import{cli as s,Strategy as r}from"@jackwener/opencli/registry";import{YUANBAO_DOMAIN as o,ensureYuanbaoPage as n,getYuanbaoMessageBubbles as i}from"./shared.js";import{convertYuanbaoHtmlToMarkdown as m}from"./ask.js";s({site:"yuanbao",name:"read",access:"read",description:"Read messages in the current Yuanbao conversation",domain:o,strategy:r.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Role","Text"],func:async(t)=>{await n(t);await t.wait(1.5);const a=await i(t);if(!a.length)return[{Role:"system",Text:"No visible messages in the current Yuanbao conversation."}];return a.map((e)=>({Role:e.role,Text:e.role==="Assistant"&&e.html?m(e.html).trim()||e.text:e.text}))}});
@@ -1,4 +1,4 @@
1
- import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors";export const YUANBAO_DOMAIN="yuanbao.tencent.com",YUANBAO_URL="https://yuanbao.tencent.com/";const W="Likely login/auth/challenge/session issue in the existing yuanbao.tencent.com browser session.",q=/^[A-Za-z0-9_-]{4,40}$/,H=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;export const IS_VISIBLE_JS=`const isVisible = (node) => {
1
+ import{ArgumentError as i,AuthRequiredError as l}from"@jackwener/opencli/errors";export const YUANBAO_DOMAIN="yuanbao.tencent.com",YUANBAO_URL="https://yuanbao.tencent.com/";const d="Likely login/auth/challenge/session issue in the existing yuanbao.tencent.com browser session.",s=/^[A-Za-z0-9_-]{4,40}$/,c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;export const IS_VISIBLE_JS=`const isVisible = (node) => {
2
2
  if (!(node instanceof HTMLElement)) return false;
3
3
  const rect = node.getBoundingClientRect();
4
4
  const style = window.getComputedStyle(node);
@@ -6,20 +6,20 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
6
6
  && rect.height > 0
7
7
  && style.display !== 'none'
8
8
  && style.visibility !== 'hidden';
9
- };`;export function authRequired(x){return new P(YUANBAO_DOMAIN,`${x} ${W}`)}export function normalizeBooleanFlag(x,F=!1){if(typeof x==="boolean")return x;if(x==null||x==="")return F;const K=String(x).trim().toLowerCase();return K==="true"||K==="1"||K==="yes"||K==="on"}export async function isOnYuanbao(x){const F=await x.evaluate("window.location.href").catch(()=>"");if(typeof F!=="string"||!F)return!1;try{const K=new URL(F).hostname;return K===YUANBAO_DOMAIN||K.endsWith(`.${YUANBAO_DOMAIN}`)}catch{return!1}}export async function ensureYuanbaoPage(x){if(!await isOnYuanbao(x)){await x.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await x.wait(1)}}export async function hasLoginGate(x){const F=await x.evaluate(`(() => {
9
+ };`;export function authRequired(t){return new l(YUANBAO_DOMAIN,`${t} ${d}`)}export function normalizeBooleanFlag(t,e=!1){if(typeof t==="boolean")return t;if(t==null||t==="")return e;const n=String(t).trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"}export async function isOnYuanbao(t){const e=await t.evaluate("window.location.href").catch(()=>"");if(typeof e!=="string"||!e)return!1;try{const n=new URL(e).hostname;return n===YUANBAO_DOMAIN||n.endsWith(`.${YUANBAO_DOMAIN}`)}catch{return!1}}export async function ensureYuanbaoPage(t){if(!await isOnYuanbao(t)){await t.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await t.wait(1)}}export async function hasLoginGate(t){const e=await t.evaluate(`(() => {
10
10
  const bodyText = document.body.innerText || '';
11
11
  const hasWechatLoginText = bodyText.includes('微信扫码登录');
12
12
  const hasWechatIframe = Array.from(document.querySelectorAll('iframe'))
13
13
  .some((frame) => (frame.getAttribute('src') || '').includes('open.weixin.qq.com/connect/qrconnect'));
14
14
 
15
15
  return hasWechatLoginText || hasWechatIframe;
16
- })()`);return Boolean(F)}export async function isLoggedIn(x){return!await hasLoginGate(x)}export function parseYuanbaoSessionId(x){const F=String(x??"").trim();if(!F)throw new j("id",'must be a non-empty Yuanbao chat URL or "<agentId>/<convId>" pair');const K=F.match(/yuanbao\.tencent\.com\/chat\/([A-Za-z0-9_-]+)\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[/?#]|$)/i);if(K){const[,X,$]=K;if(!q.test(X)||!H.test($))throw new j("id",`not a valid Yuanbao chat URL (got "${x}"); expected https://yuanbao.tencent.com/chat/<agentId>/<convId>`);return{agentId:X,convId:$.toLowerCase()}}const Z=F.match(/^([A-Za-z0-9_-]+)\/([0-9a-f-]{36})$/i);if(Z){const[,X,$]=Z;if(!q.test(X)||!H.test($))throw new j("id",`not a valid Yuanbao "<agentId>/<convId>" pair (got "${x}"); agentId must be 4-40 word chars, convId must be a UUID`);return{agentId:X,convId:$.toLowerCase()}}throw new j("id",`not a valid Yuanbao session reference (got "${x}"); pass either a full https://yuanbao.tencent.com/chat/<agentId>/<convId> URL or a bare "<agentId>/<convId>" pair. A UUID alone is not enough — Yuanbao requires the agentId.`)}export async function getCurrentYuanbaoSessionId(x){const F=await x.evaluate("window.location.href").catch(()=>"");if(typeof F!=="string")return null;const K=F.match(/yuanbao\.tencent\.com\/chat\/([A-Za-z0-9_-]+)\/([0-9a-f-]{36})(?:[/?#]|$)/i);if(!K)return null;const[,Z,X]=K;if(!q.test(Z)||!H.test(X))return null;return{agentId:Z,convId:X.toLowerCase()}}export async function getYuanbaoModelLabel(x){const F=await x.evaluate(`(() => {
16
+ })()`);return Boolean(e)}export async function isLoggedIn(t){return!await hasLoginGate(t)}export function parseYuanbaoSessionId(t){const e=String(t??"").trim();if(!e)throw new i("id",'must be a non-empty Yuanbao chat URL or "<agentId>/<convId>" pair');const n=e.match(/yuanbao\.tencent\.com\/chat\/([A-Za-z0-9_-]+)\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[/?#]|$)/i);if(n){const[,o,r]=n;if(!s.test(o)||!c.test(r))throw new i("id",`not a valid Yuanbao chat URL (got "${t}"); expected https://yuanbao.tencent.com/chat/<agentId>/<convId>`);return{agentId:o,convId:r.toLowerCase()}}const a=e.match(/^([A-Za-z0-9_-]+)\/([0-9a-f-]{36})$/i);if(a){const[,o,r]=a;if(!s.test(o)||!c.test(r))throw new i("id",`not a valid Yuanbao "<agentId>/<convId>" pair (got "${t}"); agentId must be 4-40 word chars, convId must be a UUID`);return{agentId:o,convId:r.toLowerCase()}}throw new i("id",`not a valid Yuanbao session reference (got "${t}"); pass either a full https://yuanbao.tencent.com/chat/<agentId>/<convId> URL or a bare "<agentId>/<convId>" pair. A UUID alone is not enough — Yuanbao requires the agentId.`)}export async function getCurrentYuanbaoSessionId(t){const e=await t.evaluate("window.location.href").catch(()=>"");if(typeof e!=="string")return null;const n=e.match(/yuanbao\.tencent\.com\/chat\/([A-Za-z0-9_-]+)\/([0-9a-f-]{36})(?:[/?#]|$)/i);if(!n)return null;const[,a,o]=n;if(!s.test(a)||!c.test(o))return null;return{agentId:a,convId:o.toLowerCase()}}export async function getYuanbaoModelLabel(t){const e=await t.evaluate(`(() => {
17
17
  const btn = document.querySelector('[dt-button-id="model_switch"]');
18
18
  if (!(btn instanceof HTMLElement)) return null;
19
19
  const label = (btn.querySelector('.t-button__text')?.textContent || btn.textContent || '').trim();
20
20
  const modelId = btn.getAttribute('dt-model-id') || '';
21
21
  return { label, modelId };
22
- })()`);if(!F||typeof F!=="object")return{label:null,modelId:null};return{label:typeof F.label==="string"&&F.label?F.label:null,modelId:typeof F.modelId==="string"&&F.modelId?F.modelId:null}}export async function getYuanbaoMessageBubbles(x){const F=await x.evaluate(`(() => {
22
+ })()`);if(!e||typeof e!=="object")return{label:null,modelId:null};return{label:typeof e.label==="string"&&e.label?e.label:null,modelId:typeof e.modelId==="string"&&e.modelId?e.modelId:null}}export async function getYuanbaoMessageBubbles(t){const e=await t.evaluate(`(() => {
23
23
  ${IS_VISIBLE_JS}
24
24
  const items = Array.from(document.querySelectorAll('.agent-chat__list__item--human, .agent-chat__list__item--ai'))
25
25
  .filter((node) => isVisible(node));
@@ -48,7 +48,7 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
48
48
  html,
49
49
  };
50
50
  });
51
- })()`);if(!Array.isArray(F))return[];return F.map((K)=>({id:String(K?.id||""),idx:Number.isInteger(K?.idx)?K.idx:0,role:K?.role==="Assistant"?"Assistant":"User",text:String(K?.text||"").trim(),html:String(K?.html||"")})).filter((K)=>K.id&&(K.text||K.html))}export async function getYuanbaoSessionList(x,F){const K=Number(F??20);if(!Number.isInteger(K)||K<=0)throw new j("limit","must be a positive integer");const Z=await x.evaluate(`(() => {
51
+ })()`);if(!Array.isArray(e))return[];return e.map((n)=>({id:String(n?.id||""),idx:Number.isInteger(n?.idx)?n.idx:0,role:n?.role==="Assistant"?"Assistant":"User",text:String(n?.text||"").trim(),html:String(n?.html||"")})).filter((n)=>n.id&&(n.text||n.html))}export async function getYuanbaoSessionList(t,e){const n=Number(e??20);if(!Number.isInteger(n)||n<=0)throw new i("limit","must be a positive integer");const a=await t.evaluate(`(() => {
52
52
  ${IS_VISIBLE_JS}
53
53
  const nodes = Array.from(document.querySelectorAll('.yb-recent-conv-list__item'))
54
54
  .filter((node) => isVisible(node));
@@ -59,7 +59,7 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
59
59
  const title = (titleEl?.getAttribute('data-item-name') || titleEl?.textContent || '').trim();
60
60
  return { cid, agentId, title };
61
61
  });
62
- })()`);if(!Array.isArray(Z))return[];return Z.map((X)=>({cid:String(X?.cid||"").toLowerCase(),agentId:String(X?.agentId||""),title:String(X?.title||"").trim()})).filter((X)=>H.test(X.cid)&&q.test(X.agentId)).slice(0,K)}export async function startNewYuanbaoChat(x){await ensureYuanbaoPage(x);if(await hasLoginGate(x))return"blocked";const F=await x.evaluate("window.location.href").catch(()=>"");if(await x.evaluate(`(() => {
62
+ })()`);if(!Array.isArray(a))return[];return a.map((o)=>({cid:String(o?.cid||"").toLowerCase(),agentId:String(o?.agentId||""),title:String(o?.title||"").trim()})).filter((o)=>c.test(o.cid)&&s.test(o.agentId)).slice(0,n)}export async function startNewYuanbaoChat(t){await ensureYuanbaoPage(t);if(await hasLoginGate(t))return"blocked";const e=await t.evaluate("window.location.href").catch(()=>"");if(await t.evaluate(`(() => {
63
63
  ${IS_VISIBLE_JS}
64
64
  const trigger = Array.from(document.querySelectorAll('.yb-common-nav__trigger[data-desc="new-chat"], [dt-button-id="new_temp_chat"]'))
65
65
  .find((node) => isVisible(node));
@@ -68,7 +68,7 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
68
68
  return 'clicked';
69
69
  }
70
70
  return 'navigate';
71
- })()`)==="navigate"){await x.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await x.wait(1);return await hasLoginGate(x)?"blocked":"navigate"}await x.wait(1);if(await hasLoginGate(x))return"blocked";const Z=await x.evaluate("window.location.href").catch(()=>"");if(typeof Z==="string"&&typeof F==="string"&&Z!==F)return"clicked";await x.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await x.wait(1);return"navigate"}export async function sendYuanbaoMessage(x,F){return await x.evaluate(`(async () => {
71
+ })()`)==="navigate"){await t.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await t.wait(1);return await hasLoginGate(t)?"blocked":"navigate"}await t.wait(1);if(await hasLoginGate(t))return"blocked";const a=await t.evaluate("window.location.href").catch(()=>"");if(typeof a==="string"&&typeof e==="string"&&a!==e)return"clicked";await t.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await t.wait(1);return"navigate"}export async function sendYuanbaoMessage(t,e){return await t.evaluate(`(async () => {
72
72
  const waitFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
73
73
  ${IS_VISIBLE_JS}
74
74
 
@@ -91,8 +91,8 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
91
91
  selection?.removeAllRanges();
92
92
  selection?.addRange(range);
93
93
  composer.textContent = '';
94
- document.execCommand('insertText', false, ${JSON.stringify(F)});
95
- composer.dispatchEvent(new InputEvent('input', { bubbles: true, data: ${JSON.stringify(F)}, inputType: 'insertText' }));
94
+ document.execCommand('insertText', false, ${JSON.stringify(e)});
95
+ composer.dispatchEvent(new InputEvent('input', { bubbles: true, data: ${JSON.stringify(e)}, inputType: 'insertText' }));
96
96
  } catch (error) {
97
97
  return {
98
98
  ok: false,
@@ -1 +1 @@
1
- import{cli as F,Strategy as G}from"@jackwener/opencli/registry";import{YUANBAO_DOMAIN as H,ensureYuanbaoPage as J,isLoggedIn as K,getCurrentYuanbaoSessionId as Q,getYuanbaoModelLabel as R}from"./shared.js";F({site:"yuanbao",name:"status",access:"read",description:"Check Yuanbao page availability, login state, current session and model",domain:H,strategy:G.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Status","Login","Model","ModelId","AgentId","SessionId","Url"],func:async(q)=>{await J(q);await q.wait(1.5);const[E,v,x,z]=await Promise.all([K(q),Q(q),R(q),q.evaluate("window.location.href").catch(()=>"")]);return[{Status:"Connected",Login:E?"Yes":"No (login gate)",Model:x.label,ModelId:x.modelId,AgentId:v?.agentId??null,SessionId:v?.convId??null,Url:typeof z==="string"?z:""}]}});
1
+ import{cli as s,Strategy as i}from"@jackwener/opencli/registry";import{YUANBAO_DOMAIN as l,ensureYuanbaoPage as r,isLoggedIn as d,getCurrentYuanbaoSessionId as u,getYuanbaoModelLabel as g}from"./shared.js";s({site:"yuanbao",name:"status",access:"read",description:"Check Yuanbao page availability, login state, current session and model",domain:l,strategy:i.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Status","Login","Model","ModelId","AgentId","SessionId","Url"],func:async(e)=>{await r(e);await e.wait(1.5);const[t,o,a,n]=await Promise.all([d(e),u(e),g(e),e.evaluate("window.location.href").catch(()=>"")]);return[{Status:"Connected",Login:t?"Yes":"No (login gate)",Model:a.label,ModelId:a.modelId,AgentId:o?.agentId??null,SessionId:o?.convId??null,Url:typeof n==="string"?n:""}]}});
@@ -1 +1 @@
1
- import{CliError as W,CommandExecutionError as n}from"@jackwener/opencli/errors";import{cli as R,Strategy as m}from"@jackwener/opencli/registry";import{publishArticle as w}from"../_shared/article/publish.js";export const yuqueProfile={home:"https://www.yuque.com/dashboard",outputFormat:"markdown",preprocessConfig:null,image:null,publish:async(X,K)=>{const $=K.cookie("yuque_ctoken");if(!$)return{ok:!1,stage:"auth",message:"未检测到语雀登录态,请先在 Chrome 中登录语雀(缺少 yuque_ctoken cookie)"};const L={"Content-Type":"application/json","x-csrf-token":$},q=await fetch("https://www.yuque.com/api/mine/common_used",{method:"GET",credentials:"include",headers:L});let G=null;try{G=await q.json()}catch(z){}if(!q.ok||!G?.data?.books?.length)return{ok:!1,stage:"auth",status:q.status,message:"无法获取语雀知识库列表,请确认已登录语雀"};const Q=G.data.books[0].target_id,A=await fetch("https://www.yuque.com/api/docs",{method:"POST",credentials:"include",headers:L,body:JSON.stringify({title:X.title,type:"Doc",format:"lake",book_id:Q,status:0})});let V=null;try{V=await A.json()}catch(z){}if(!A.ok||!V?.data?.id)return{ok:!1,stage:"create",status:A.status,message:V?.message||"创建语雀草稿文档失败"};const J=V.data.id,H="https://www.yuque.com/go/doc/"+J+"/edit";let F=X.content;const N=["yuque.com","cdn.nlark.com"],j=/!\[([^\]]*)\]\(\s*<?([^)\s>]+)>?\s*\)/g,O=[];let S;while((S=j.exec(F))!==null)O.push({full:S[0],alt:S[1],src:S[2]});const _=[],B=[],D="https://www.yuque.com/api/upload/attach?attachable_type=Doc&attachable_id="+J+"&type=image";for(let z=0;z<O.length;z++){const Y=O[z],Z=Y.src;if(!Z)continue;if(Z.indexOf("data:")===0)continue;if(N.some(function(M){return Z.indexOf(M)!==-1}))continue;try{const M=await fetch(Z,{credentials:"omit"});if(!M.ok)throw Error("图片下载失败 HTTP "+M.status);const I=await M.blob(),C=new FormData;C.append("file",I,"image.jpg");const T=await fetch(D,{method:"POST",credentials:"include",headers:{"x-csrf-token":$},body:C});let h=null;try{h=await T.json()}catch(u){}if(!T.ok||!h?.data?.url)throw Error(h&&h.message||"图片上传失败 HTTP "+T.status);const b=h.data.url;F=F.split(Y.full).join("!["+Y.alt+"]("+b+")");_.push({src:Z.slice(0,120),url:b})}catch(M){B.push({src:Z.slice(0,120),error:String(M&&M.message||M)})}}const P=await fetch("https://www.yuque.com/api/docs/convert",{method:"POST",credentials:"include",headers:L,body:JSON.stringify({from:"markdown",to:"lake",content:F})});let U=null;try{U=await P.json()}catch(z){}if(!P.ok||!U?.data?.content)return{ok:!1,stage:"convert",status:P.status,message:"内容格式转换失败(markdown→lake)",id:String(J),uploaded:_,failed:B};const E=U.data.content,v='<div class="lake-content" typography="traditional">'+E+"</div>",x=await fetch("https://www.yuque.com/api/docs/"+J+"/content",{method:"PUT",credentials:"include",headers:L,body:JSON.stringify({format:"lake",body_asl:E,body:v,body_html:v,draft_version:0,sync_dynamic_data:!1,save_type:"auto",edit_type:"Lake"})});if(!x.ok){let z="";try{z=await x.text()}catch(Y){}return{ok:!1,stage:"save",status:x.status,message:"保存正文失败:"+z.slice(0,300),id:String(J),uploaded:_,failed:B}}if(!X.draftOnly){const z=await fetch("https://www.yuque.com/api/docs/"+J+"/publish",{method:"PUT",credentials:"include",headers:L,body:JSON.stringify({status:1})});if(!z.ok){let Y="";try{Y=await z.text()}catch(Z){}return{ok:!1,stage:"publish",status:z.status,message:"发布失败:"+Y.slice(0,300),id:String(J),url:H,uploaded:_,failed:B}}}return{ok:!0,id:String(J),url:H,draft:Boolean(X.draftOnly),uploaded:_,failed:B}}};R({site:"yuque",name:"article",access:"write",description:"发布语雀文章(知识库文档)。正文默认为 Markdown,外链图片自动转存到语雀图床。",domain:"www.yuque.com",strategy:m.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(Markdown 格式;或用 --file 读文件)"},{name:"file",help:"正文文件路径(UTF-8,Markdown 格式)"},{name:"html",type:"boolean",help:"把正文当 HTML 输入(语雀仍转 lake 发布)"},{name:"draft",type:"boolean",help:"仅保存草稿,不发布"},{name:"execute",type:"boolean",help:"实际执行写操作。不加此参数命令拒绝写入。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(X,K)=>{if(!X)throw new n("语雀文章发布需要浏览器会话");if(!K.execute)throw new W("INVALID_INPUT","此命令需要加 --execute 才会实际写入(防误操作)");const $=String(K.title??"").trim();if(!$)throw new W("INVALID_INPUT","文章标题不能为空");let L="";const q=typeof K.text==="string"?K.text:void 0,G=typeof K.file==="string"?K.file:void 0;if(q&&G)throw new W("INVALID_INPUT","正文和 --file 不能同时使用");if(G){const{readFile:F,stat:N}=await import("node:fs/promises");let j;try{j=await N(G)}catch{throw new W("INVALID_INPUT",`文件不存在:${G}`)}if(!j.isFile())throw new W("INVALID_INPUT",`路径不是文件:${G}`);let O;try{O=await F(G)}catch{throw new W("INVALID_INPUT",`文件无法读取:${G}`)}try{L=new TextDecoder("utf-8",{fatal:!0}).decode(O)}catch{throw new W("INVALID_INPUT",`文件无法以 UTF-8 解码:${G}`)}}else L=q??"";if(!L.trim())throw new W("INVALID_INPUT","正文不能为空");const y=Boolean(K.draft),Q=await w(X,{title:$,body:L,format:K.html?"html":"markdown",draftOnly:y,profile:yuqueProfile}),A=Q.images.uploaded.length|0,V=Q.images.failed.length|0;let J=Q.draft?"已保存语雀草稿":"语雀文章发布成功";if(A||V)J+=`(图片:${A} 张已转存${V?`,${V} 张失败`:""})`;return[{status:"success",outcome:Q.draft?"draft":"created",message:J,target_type:"article",target:"",created_target:"article:"+Q.id,created_url:Q.url}]}});
1
+ import{CliError as c,CommandExecutionError as R}from"@jackwener/opencli/errors";import{cli as V,Strategy as j}from"@jackwener/opencli/registry";import{publishArticle as C}from"../_shared/article/publish.js";export const yuqueProfile={home:"https://www.yuque.com/dashboard",outputFormat:"markdown",preprocessConfig:null,image:null,publish:async(l,o)=>{const f=o.cookie("yuque_ctoken");if(!f)return{ok:!1,stage:"auth",message:"未检测到语雀登录态,请先在 Chrome 中登录语雀(缺少 yuque_ctoken cookie)"};const s={"Content-Type":"application/json","x-csrf-token":f},m=await fetch("https://www.yuque.com/api/mine/common_used",{method:"GET",credentials:"include",headers:s});let e=null;try{e=await m.json()}catch(t){}if(!m.ok||!e?.data?.books?.length)return{ok:!1,stage:"auth",status:m.status,message:"无法获取语雀知识库列表,请确认已登录语雀"};const r=e.data.books[0].target_id,p=await fetch("https://www.yuque.com/api/docs",{method:"POST",credentials:"include",headers:s,body:JSON.stringify({title:l.title,type:"Doc",format:"lake",book_id:r,status:0})});let i=null;try{i=await p.json()}catch(t){}if(!p.ok||!i?.data?.id)return{ok:!1,stage:"create",status:p.status,message:i?.message||"创建语雀草稿文档失败"};const a=i.data.id,T="https://www.yuque.com/go/doc/"+a+"/edit";let h=l.content;const I=["yuque.com","cdn.nlark.com"],b=/!\[([^\]]*)\]\(\s*<?([^)\s>]+)>?\s*\)/g,w=[];let _;while((_=b.exec(h))!==null)w.push({full:_[0],alt:_[1],src:_[2]});const y=[],g=[],L="https://www.yuque.com/api/upload/attach?attachable_type=Doc&attachable_id="+a+"&type=image";for(let t=0;t<w.length;t++){const d=w[t],u=d.src;if(!u)continue;if(u.indexOf("data:")===0)continue;if(I.some(function(n){return u.indexOf(n)!==-1}))continue;try{const n=await fetch(u,{credentials:"omit"});if(!n.ok)throw Error("图片下载失败 HTTP "+n.status);const A=await n.blob(),O=new FormData;O.append("file",A,"image.jpg");const P=await fetch(L,{method:"POST",credentials:"include",headers:{"x-csrf-token":f},body:O});let k=null;try{k=await P.json()}catch(E){}if(!P.ok||!k?.data?.url)throw Error(k&&k.message||"图片上传失败 HTTP "+P.status);const v=k.data.url;h=h.split(d.full).join("!["+d.alt+"]("+v+")");y.push({src:u.slice(0,120),url:v})}catch(n){g.push({src:u.slice(0,120),error:String(n&&n.message||n)})}}const N=await fetch("https://www.yuque.com/api/docs/convert",{method:"POST",credentials:"include",headers:s,body:JSON.stringify({from:"markdown",to:"lake",content:h})});let x=null;try{x=await N.json()}catch(t){}if(!N.ok||!x?.data?.content)return{ok:!1,stage:"convert",status:N.status,message:"内容格式转换失败(markdown→lake)",id:String(a),uploaded:y,failed:g};const S=x.data.content,U='<div class="lake-content" typography="traditional">'+S+"</div>",D=await fetch("https://www.yuque.com/api/docs/"+a+"/content",{method:"PUT",credentials:"include",headers:s,body:JSON.stringify({format:"lake",body_asl:S,body:U,body_html:U,draft_version:0,sync_dynamic_data:!1,save_type:"auto",edit_type:"Lake"})});if(!D.ok){let t="";try{t=await D.text()}catch(d){}return{ok:!1,stage:"save",status:D.status,message:"保存正文失败:"+t.slice(0,300),id:String(a),uploaded:y,failed:g}}if(!l.draftOnly){const t=await fetch("https://www.yuque.com/api/docs/"+a+"/publish",{method:"PUT",credentials:"include",headers:s,body:JSON.stringify({status:1})});if(!t.ok){let d="";try{d=await t.text()}catch(u){}return{ok:!1,stage:"publish",status:t.status,message:"发布失败:"+d.slice(0,300),id:String(a),url:T,uploaded:y,failed:g}}}return{ok:!0,id:String(a),url:T,draft:Boolean(l.draftOnly),uploaded:y,failed:g}}};V({site:"yuque",name:"article",access:"write",description:"发布语雀文章(知识库文档)。正文默认为 Markdown,外链图片自动转存到语雀图床。",domain:"www.yuque.com",strategy:j.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(Markdown 格式;或用 --file 读文件)"},{name:"file",help:"正文文件路径(UTF-8,Markdown 格式)"},{name:"html",type:"boolean",help:"把正文当 HTML 输入(语雀仍转 lake 发布)"},{name:"draft",type:"boolean",help:"仅保存草稿,不发布"},{name:"execute",type:"boolean",help:"实际执行写操作。不加此参数命令拒绝写入。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(l,o)=>{if(!l)throw new R("语雀文章发布需要浏览器会话");if(!o.execute)throw new c("INVALID_INPUT","此命令需要加 --execute 才会实际写入(防误操作)");const f=String(o.title??"").trim();if(!f)throw new c("INVALID_INPUT","文章标题不能为空");let s="";const m=typeof o.text==="string"?o.text:void 0,e=typeof o.file==="string"?o.file:void 0;if(m&&e)throw new c("INVALID_INPUT","正文和 --file 不能同时使用");if(e){const{readFile:h,stat:I}=await import("node:fs/promises");let b;try{b=await I(e)}catch{throw new c("INVALID_INPUT",`文件不存在:${e}`)}if(!b.isFile())throw new c("INVALID_INPUT",`路径不是文件:${e}`);let w;try{w=await h(e)}catch{throw new c("INVALID_INPUT",`文件无法读取:${e}`)}try{s=new TextDecoder("utf-8",{fatal:!0}).decode(w)}catch{throw new c("INVALID_INPUT",`文件无法以 UTF-8 解码:${e}`)}}else s=m??"";if(!s.trim())throw new c("INVALID_INPUT","正文不能为空");const q=Boolean(o.draft),r=await C(l,{title:f,body:s,format:o.html?"html":"markdown",draftOnly:q,profile:yuqueProfile}),p=r.images.uploaded.length|0,i=r.images.failed.length|0;let a=r.draft?"已保存语雀草稿":"语雀文章发布成功";if(p||i)a+=`(图片:${p} 张已转存${i?`,${i} 张失败`:""})`;return[{status:"success",outcome:r.draft?"draft":"created",message:a,target_type:"article",target:"",created_target:"article:"+r.id,created_url:r.url}]}});
@@ -1 +1 @@
1
- import{cli as B,Strategy as C}from"@jackwener/opencli/registry";import{checkLogin as D}from"../_shared/article/auth.js";const yuqueAuthProfile={home:"https://www.yuque.com/dashboard",checkAuth:async(v)=>{const m=v.cookie("yuque_ctoken");if(!m)return{isAuthenticated:!1,error:"未检测到 yuque_ctoken cookie,请先登录语雀"};try{const b=await fetch("https://www.yuque.com/api/mine/common_used",{method:"GET",credentials:"include",headers:{"x-csrf-token":m}});if(!b.ok)return{isAuthenticated:!1,error:"接口返回 HTTP "+b.status};let x=null;try{x=await b.json()}catch(E){}if(!x?.data?.books?.length)return{isAuthenticated:!1,error:"未获取到语雀知识库信息"};const z=x.data.books[0].user;return{isAuthenticated:!0,userId:String(z.id),username:z.name,avatar:z.avatar_url||""}}catch(b){return{isAuthenticated:!1,error:String(b&&b.message||b)}}}};B({site:"yuque",name:"whoami",access:"read",description:"查看当前语雀登录账号信息。",domain:"www.yuque.com",strategy:C.COOKIE,browser:!0,columns:["logged_in","user_id","username"],func:async(v)=>{const m=await D(v,yuqueAuthProfile);return[{logged_in:m.isAuthenticated,user_id:m.userId||"",username:m.username||""}]}});export{yuqueAuthProfile};
1
+ import{cli as u,Strategy as n}from"@jackwener/opencli/registry";import{checkLogin as o}from"../_shared/article/auth.js";const yuqueAuthProfile={home:"https://www.yuque.com/dashboard",checkAuth:async(r)=>{const t=r.cookie("yuque_ctoken");if(!t)return{isAuthenticated:!1,error:"未检测到 yuque_ctoken cookie,请先登录语雀"};try{const e=await fetch("https://www.yuque.com/api/mine/common_used",{method:"GET",credentials:"include",headers:{"x-csrf-token":t}});if(!e.ok)return{isAuthenticated:!1,error:"接口返回 HTTP "+e.status};let a=null;try{a=await e.json()}catch(i){}if(!a?.data?.books?.length)return{isAuthenticated:!1,error:"未获取到语雀知识库信息"};const s=a.data.books[0].user;return{isAuthenticated:!0,userId:String(s.id),username:s.name,avatar:s.avatar_url||""}}catch(e){return{isAuthenticated:!1,error:String(e&&e.message||e)}}}};u({site:"yuque",name:"whoami",access:"read",description:"查看当前语雀登录账号信息。",domain:"www.yuque.com",strategy:n.COOKIE,browser:!0,columns:["logged_in","user_id","username"],func:async(r)=>{const t=await o(r,yuqueAuthProfile);return[{logged_in:t.isAuthenticated,user_id:t.userId||"",username:t.username||""}]}});export{yuqueAuthProfile};