publishport-opencli 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1042) hide show
  1. package/cli-manifest.json +35 -0
  2. package/clis/12306/me.js +2 -2
  3. package/clis/12306/orders.js +3 -3
  4. package/clis/12306/passengers.js +3 -3
  5. package/clis/12306/price.js +1 -1
  6. package/clis/12306/stations.js +1 -1
  7. package/clis/12306/train.js +1 -1
  8. package/clis/12306/trains.js +1 -1
  9. package/clis/12306/utils.js +1 -1
  10. package/clis/1688/download.js +1 -1
  11. package/clis/1688/item.js +4 -4
  12. package/clis/1688/search.js +4 -4
  13. package/clis/1688/store.js +4 -4
  14. package/clis/1point3acres/forum.js +1 -1
  15. package/clis/1point3acres/forums.js +1 -1
  16. package/clis/1point3acres/notifications.js +1 -1
  17. package/clis/1point3acres/search.js +1 -1
  18. package/clis/1point3acres/thread.js +2 -2
  19. package/clis/1point3acres/user.js +1 -1
  20. package/clis/1point3acres/utils.js +2 -2
  21. package/clis/36kr/article.js +2 -2
  22. package/clis/36kr/hot.js +2 -2
  23. package/clis/36kr/news.js +1 -1
  24. package/clis/36kr/search.js +2 -2
  25. package/clis/51job/company.js +2 -2
  26. package/clis/51job/detail.js +2 -2
  27. package/clis/51job/hot.js +1 -1
  28. package/clis/51job/search.js +1 -1
  29. package/clis/51job/utils.js +7 -7
  30. package/clis/_atlassian/shared.js +9 -9
  31. package/clis/_shared/article/auth.js +4 -4
  32. package/clis/_shared/article/douban-md2draft.js +4 -4
  33. package/clis/_shared/article/format.js +1 -1
  34. package/clis/_shared/article/images.js +7 -7
  35. package/clis/_shared/article/login.js +1 -1
  36. package/clis/_shared/article/publish.js +11 -11
  37. package/clis/_shared/common.js +1 -1
  38. package/clis/_shared/content-guard.js +1 -1
  39. package/clis/_shared/desktop-commands.js +1 -1
  40. package/clis/_shared/file-inject.js +12 -12
  41. package/clis/_shared/self-hosted-sites.js +2 -2
  42. package/clis/_shared/site-auth.js +1 -1
  43. package/clis/_shared/token-auth.js +2 -2
  44. package/clis/_shared/video-publish.js +9 -9
  45. package/clis/amazon/offer.js +3 -3
  46. package/clis/amazon/product.js +5 -5
  47. package/clis/amazon/shared.js +6 -6
  48. package/clis/antigravity/_actions.js +13 -13
  49. package/clis/antigravity/audit-extras.js +10 -10
  50. package/clis/antigravity/delete.js +1 -1
  51. package/clis/antigravity/model.js +6 -6
  52. package/clis/antigravity/new.js +2 -2
  53. package/clis/antigravity/read.js +2 -2
  54. package/clis/antigravity/rename.js +1 -1
  55. package/clis/antigravity/send.js +3 -3
  56. package/clis/antigravity/serve.js +17 -17
  57. package/clis/antigravity/storage.js +6 -6
  58. package/clis/antigravity/watch.js +2 -2
  59. package/clis/apple-podcasts/episodes.js +1 -1
  60. package/clis/apple-podcasts/top.js +1 -1
  61. package/clis/apple-podcasts/utils.js +1 -1
  62. package/clis/archive/item.js +1 -1
  63. package/clis/archive/search.js +1 -1
  64. package/clis/archive/snapshots.js +1 -1
  65. package/clis/archive/wayback.js +1 -1
  66. package/clis/arxiv/author.js +1 -1
  67. package/clis/arxiv/utils.js +1 -1
  68. package/clis/autohome/brand.js +1 -1
  69. package/clis/autohome/score.js +1 -1
  70. package/clis/autohome/utils.js +1 -1
  71. package/clis/baijiahao/article.js +1 -1
  72. package/clis/baijiahao/lists.js +1 -1
  73. package/clis/baijiahao/login.js +1 -1
  74. package/clis/baijiahao/publish.js +9 -9
  75. package/clis/baijiahao/stats.js +1 -1
  76. package/clis/baijiahao/whoami.js +1 -1
  77. package/clis/band/bands.js +2 -2
  78. package/clis/band/mentions.js +2 -2
  79. package/clis/band/post.js +4 -4
  80. package/clis/band/posts.js +3 -3
  81. package/clis/barchart/flow.js +3 -3
  82. package/clis/barchart/greeks.js +2 -2
  83. package/clis/barchart/quote.js +3 -3
  84. package/clis/bbc/news.js +1 -1
  85. package/clis/bbc/topic.js +1 -1
  86. package/clis/bbc/utils.js +1 -1
  87. package/clis/bilibili/article.js +1 -1
  88. package/clis/bilibili/categories.js +1 -1
  89. package/clis/bilibili/coin.js +1 -1
  90. package/clis/bilibili/comment-del.js +1 -1
  91. package/clis/bilibili/comment-like.js +1 -1
  92. package/clis/bilibili/comment.js +1 -1
  93. package/clis/bilibili/comments.js +1 -1
  94. package/clis/bilibili/dm-list.js +1 -1
  95. package/clis/bilibili/dm-read.js +1 -1
  96. package/clis/bilibili/dm-send.js +1 -1
  97. package/clis/bilibili/download.js +2 -2
  98. package/clis/bilibili/drafts.js +1 -1
  99. package/clis/bilibili/dynamic-post.js +3 -3
  100. package/clis/bilibili/favorite-add.js +1 -1
  101. package/clis/bilibili/favorite.js +1 -1
  102. package/clis/bilibili/feed.js +2 -2
  103. package/clis/bilibili/follow.js +1 -1
  104. package/clis/bilibili/following.js +1 -1
  105. package/clis/bilibili/like.js +1 -1
  106. package/clis/bilibili/partitions.js +1 -1
  107. package/clis/bilibili/stats.js +1 -1
  108. package/clis/bilibili/subtitle.js +3 -3
  109. package/clis/bilibili/summary.js +1 -1
  110. package/clis/bilibili/topics.js +1 -1
  111. package/clis/bilibili/unfollow.js +1 -1
  112. package/clis/bilibili/upload.js +1 -1
  113. package/clis/bilibili/utils.js +10 -10
  114. package/clis/bilibili/video-drafts.js +1 -1
  115. package/clis/bilibili/video.js +1 -1
  116. package/clis/bloomberg/businessweek.js +4 -4
  117. package/clis/bloomberg/news.js +2 -2
  118. package/clis/bloomberg/utils.js +13 -13
  119. package/clis/bluesky/post.js +1 -1
  120. package/clis/bluesky/shared.js +11 -11
  121. package/clis/bluesky/whoami.js +1 -1
  122. package/clis/booking/search.js +2 -2
  123. package/clis/boss/accept.js +1 -1
  124. package/clis/boss/applied.js +1 -1
  125. package/clis/boss/auth.js +1 -1
  126. package/clis/boss/batchgreet.js +1 -1
  127. package/clis/boss/bossinfo.js +1 -1
  128. package/clis/boss/chatlist.js +1 -1
  129. package/clis/boss/chatmsg.js +1 -1
  130. package/clis/boss/cities.js +1 -1
  131. package/clis/boss/detail.js +1 -1
  132. package/clis/boss/exchange.js +1 -1
  133. package/clis/boss/greet.js +1 -1
  134. package/clis/boss/interviews.js +1 -1
  135. package/clis/boss/invite.js +1 -1
  136. package/clis/boss/joblist.js +1 -1
  137. package/clis/boss/mark.js +1 -1
  138. package/clis/boss/me.js +2 -2
  139. package/clis/boss/recommend.js +1 -1
  140. package/clis/boss/resumedelete.js +1 -1
  141. package/clis/boss/resumelist.js +1 -1
  142. package/clis/boss/resumeupload.js +11 -11
  143. package/clis/boss/search.js +1 -1
  144. package/clis/boss/send.js +1 -1
  145. package/clis/boss/sendresume.js +1 -1
  146. package/clis/boss/stats.js +1 -1
  147. package/clis/boss/unread.js +1 -1
  148. package/clis/boss/utils.js +13 -13
  149. package/clis/chaoxing/assignments.js +1 -1
  150. package/clis/chaoxing/exams.js +1 -1
  151. package/clis/chaoxing/utils.js +9 -9
  152. package/clis/chatgpt/ask.js +1 -1
  153. package/clis/chatgpt/auth.js +2 -2
  154. package/clis/chatgpt/detail.js +1 -1
  155. package/clis/chatgpt/image.js +1 -1
  156. package/clis/chatgpt/read.js +1 -1
  157. package/clis/chatgpt/send.js +1 -1
  158. package/clis/chatgpt/utils.js +59 -59
  159. package/clis/chatgpt-app/ask.js +1 -1
  160. package/clis/chatgpt-app/send.js +1 -1
  161. package/clis/chatwise/model.js +6 -6
  162. package/clis/chess/analyze.js +1 -1
  163. package/clis/chess/game.js +1 -1
  164. package/clis/chess/games.js +1 -1
  165. package/clis/chess/stats.js +1 -1
  166. package/clis/chess/utils.js +1 -1
  167. package/clis/claude/ask.js +2 -2
  168. package/clis/claude/detail.js +1 -1
  169. package/clis/claude/new.js +1 -1
  170. package/clis/claude/read.js +1 -1
  171. package/clis/claude/send.js +1 -1
  172. package/clis/claude/utils.js +23 -23
  173. package/clis/cnblogs/article.js +1 -1
  174. package/clis/cnblogs/login.js +1 -1
  175. package/clis/cnblogs/stats.js +7 -7
  176. package/clis/cnblogs/whoami.js +1 -1
  177. package/clis/codex/_actions.js +3 -3
  178. package/clis/codex/archive.js +1 -1
  179. package/clis/codex/ask.js +6 -6
  180. package/clis/codex/model.js +8 -8
  181. package/clis/codex/pin.js +1 -1
  182. package/clis/codex/rename.js +4 -4
  183. package/clis/codex/send.js +3 -3
  184. package/clis/codex/sidebar.js +1 -1
  185. package/clis/coingecko/categories.js +1 -1
  186. package/clis/coingecko/coin.js +1 -1
  187. package/clis/coingecko/derivatives.js +1 -1
  188. package/clis/coingecko/exchanges.js +1 -1
  189. package/clis/coingecko/global.js +1 -1
  190. package/clis/coingecko/trending.js +1 -1
  191. package/clis/confluence/search.js +1 -1
  192. package/clis/coupang/product.js +3 -3
  193. package/clis/coupang/utils.js +1 -1
  194. package/clis/crates/crate.js +1 -1
  195. package/clis/crates/search.js +1 -1
  196. package/clis/crates/utils.js +1 -1
  197. package/clis/csdn/article.js +13 -13
  198. package/clis/csdn/columns.js +1 -1
  199. package/clis/csdn/login.js +1 -1
  200. package/clis/csdn/stats.js +4 -4
  201. package/clis/csdn/whoami.js +1 -1
  202. package/clis/cto51/article.js +1 -1
  203. package/clis/cto51/whoami.js +1 -1
  204. package/clis/ctrip/flight.js +2 -2
  205. package/clis/ctrip/hotel-search.js +3 -3
  206. package/clis/ctrip/hotel-suggest.js +1 -1
  207. package/clis/ctrip/search.js +1 -1
  208. package/clis/ctrip/utils.js +6 -6
  209. package/clis/cursor/ask.js +5 -5
  210. package/clis/cursor/composer.js +2 -2
  211. package/clis/cursor/model.js +4 -4
  212. package/clis/cursor/send.js +2 -2
  213. package/clis/dblp/author.js +1 -1
  214. package/clis/dblp/paper.js +1 -1
  215. package/clis/dblp/search.js +1 -1
  216. package/clis/dblp/utils.js +1 -1
  217. package/clis/dblp/venue.js +1 -1
  218. package/clis/deepseek/ask.js +1 -1
  219. package/clis/deepseek/auth.js +2 -2
  220. package/clis/deepseek/detail.js +1 -1
  221. package/clis/deepseek/new.js +1 -1
  222. package/clis/deepseek/read.js +1 -1
  223. package/clis/deepseek/send.js +7 -7
  224. package/clis/deepseek/utils.js +25 -25
  225. package/clis/defillama/protocol.js +1 -1
  226. package/clis/defillama/protocols.js +1 -1
  227. package/clis/defillama/utils.js +1 -1
  228. package/clis/devto/auth.js +2 -2
  229. package/clis/devto/latest.js +1 -1
  230. package/clis/devto/publish.js +5 -5
  231. package/clis/devto/read.js +2 -2
  232. package/clis/devto/stats.js +3 -3
  233. package/clis/dianping/auth.js +2 -2
  234. package/clis/dianping/cityResolver.js +2 -2
  235. package/clis/dianping/search.js +1 -1
  236. package/clis/dianping/shop.js +1 -1
  237. package/clis/dianping/utils.js +1 -1
  238. package/clis/discord-app/delete.js +3 -3
  239. package/clis/discord-app/read.js +1 -1
  240. package/clis/discord-app/thread-read.js +1 -1
  241. package/clis/discord-web/auth.js +2 -2
  242. package/clis/discord-web/send.js +5 -5
  243. package/clis/dockerhub/image.js +1 -1
  244. package/clis/dockerhub/search.js +1 -1
  245. package/clis/dockerhub/utils.js +1 -1
  246. package/clis/dongchedi/koubei.js +1 -1
  247. package/clis/dongchedi/models.js +1 -1
  248. package/clis/dongchedi/score.js +1 -1
  249. package/clis/dongchedi/search.js +1 -1
  250. package/clis/dongchedi/series.js +1 -1
  251. package/clis/dongchedi/specs.js +1 -1
  252. package/clis/dongchedi/utils.js +1 -1
  253. package/clis/douban/article.js +3 -3
  254. package/clis/douban/auth.js +2 -2
  255. package/clis/douban/download.js +1 -1
  256. package/clis/douban/utils.js +23 -23
  257. package/clis/doubao/auth.js +3 -3
  258. package/clis/doubao/utils.js +39 -39
  259. package/clis/doubao-app/ask.js +1 -1
  260. package/clis/doubao-app/utils.js +4 -4
  261. package/clis/douyin/_shared/browser-fetch.js +7 -7
  262. package/clis/douyin/_shared/draft-cache.js +1 -1
  263. package/clis/douyin/_shared/imagex-upload.js +1 -1
  264. package/clis/douyin/_shared/sts2.js +1 -1
  265. package/clis/douyin/_shared/text-extra.js +1 -1
  266. package/clis/douyin/_shared/tos-upload.js +4 -4
  267. package/clis/douyin/_shared/transcode.js +1 -1
  268. package/clis/douyin/_shared/vod-upload.js +4 -4
  269. package/clis/douyin/draft.js +18 -18
  270. package/clis/douyin/drafts.js +1 -1
  271. package/clis/douyin/publish-image.js +12 -12
  272. package/clis/douyin/publish.js +9 -9
  273. package/clis/douyin/search.js +3 -3
  274. package/clis/douyin/videos.js +1 -1
  275. package/clis/eastmoney/_secid.js +1 -1
  276. package/clis/eastmoney/announcement.js +1 -1
  277. package/clis/eastmoney/article.js +1 -1
  278. package/clis/eastmoney/convertible.js +1 -1
  279. package/clis/eastmoney/etf.js +1 -1
  280. package/clis/eastmoney/holders.js +1 -1
  281. package/clis/eastmoney/index-board.js +1 -1
  282. package/clis/eastmoney/kline.js +1 -1
  283. package/clis/eastmoney/kuaixun.js +1 -1
  284. package/clis/eastmoney/longhu.js +1 -1
  285. package/clis/eastmoney/money-flow.js +1 -1
  286. package/clis/eastmoney/northbound.js +1 -1
  287. package/clis/eastmoney/quote.js +1 -1
  288. package/clis/eastmoney/rank.js +1 -1
  289. package/clis/eastmoney/sectors.js +1 -1
  290. package/clis/endoflife/product.js +1 -1
  291. package/clis/endoflife/utils.js +1 -1
  292. package/clis/facebook/comment.js +8 -8
  293. package/clis/facebook/feed.js +4 -4
  294. package/clis/facebook/like.js +5 -5
  295. package/clis/facebook/notifications.js +3 -3
  296. package/clis/facebook/post.js +11 -11
  297. package/clis/facebook/search.js +3 -3
  298. package/clis/flathub/app.js +1 -1
  299. package/clis/flathub/search.js +1 -1
  300. package/clis/flathub/utils.js +1 -1
  301. package/clis/flomo/memos.js +1 -1
  302. package/clis/gemini/deep-research-result.js +4 -4
  303. package/clis/gemini/deep-research.js +1 -1
  304. package/clis/gemini/detail.js +1 -1
  305. package/clis/gemini/history.js +1 -1
  306. package/clis/gemini/image.js +2 -2
  307. package/clis/gemini/status.js +1 -1
  308. package/clis/gemini/utils.js +43 -43
  309. package/clis/geogebra/hexagon.js +1 -1
  310. package/clis/geogebra/info.js +3 -3
  311. package/clis/geogebra/triangle.js +1 -1
  312. package/clis/geogebra/utils.js +11 -11
  313. package/clis/ghost/login.js +1 -1
  314. package/clis/ghost/shared.js +2 -2
  315. package/clis/gitee/auth.js +2 -2
  316. package/clis/github-trending/repos.js +1 -1
  317. package/clis/google/news.js +1 -1
  318. package/clis/google/search.js +2 -2
  319. package/clis/google/suggest.js +1 -1
  320. package/clis/google/trends.js +1 -1
  321. package/clis/google/utils.js +1 -1
  322. package/clis/goproxy/module.js +1 -1
  323. package/clis/goproxy/utils.js +1 -1
  324. package/clis/goproxy/versions.js +1 -1
  325. package/clis/gov-policy/recent.js +2 -2
  326. package/clis/gov-policy/search.js +2 -2
  327. package/clis/grok/ask.js +1 -1
  328. package/clis/grok/detail.js +1 -1
  329. package/clis/grok/image.js +8 -8
  330. package/clis/grok/pin.js +1 -1
  331. package/clis/grok/send.js +1 -1
  332. package/clis/grok/status.js +1 -1
  333. package/clis/grok/utils.js +21 -21
  334. package/clis/guazi/browse.js +1 -1
  335. package/clis/guazi/car.js +1 -1
  336. package/clis/guazi/utils.js +1 -1
  337. package/clis/hackernews/auth.js +2 -2
  338. package/clis/hackernews/comment.js +8 -8
  339. package/clis/hackernews/read.js +7 -7
  340. package/clis/hackernews/submit.js +7 -7
  341. package/clis/hashnode/auth.js +3 -3
  342. package/clis/hashnode/publish.js +14 -14
  343. package/clis/hf/auth.js +2 -2
  344. package/clis/hf/models.js +1 -1
  345. package/clis/hf/paper.js +1 -1
  346. package/clis/hf/spaces.js +1 -1
  347. package/clis/hf/top.js +1 -1
  348. package/clis/homebrew/cask.js +1 -1
  349. package/clis/homebrew/formula.js +1 -1
  350. package/clis/homebrew/popular.js +1 -1
  351. package/clis/homebrew/utils.js +1 -1
  352. package/clis/huodongxing/events.js +1 -1
  353. package/clis/hupu/detail.js +4 -4
  354. package/clis/hupu/hot.js +3 -3
  355. package/clis/hupu/reply.js +1 -1
  356. package/clis/hupu/search.js +1 -1
  357. package/clis/hupu/unlike.js +1 -1
  358. package/clis/hupu/utils.js +10 -10
  359. package/clis/imdb/person.js +2 -2
  360. package/clis/imdb/reviews.js +3 -3
  361. package/clis/imdb/search.js +2 -2
  362. package/clis/imdb/title.js +1 -1
  363. package/clis/imdb/top.js +1 -1
  364. package/clis/imdb/trending.js +1 -1
  365. package/clis/imdb/utils.js +13 -13
  366. package/clis/imooc/article.js +6 -6
  367. package/clis/imooc/login.js +1 -1
  368. package/clis/imooc/whoami.js +1 -1
  369. package/clis/indeed/job.js +2 -2
  370. package/clis/indeed/search.js +2 -2
  371. package/clis/indeed/utils.js +1 -1
  372. package/clis/infoq/article.js +2 -2
  373. package/clis/infoq/login.js +1 -1
  374. package/clis/infoq/whoami.js +1 -1
  375. package/clis/instagram/_shared/private-publish.js +4 -4
  376. package/clis/instagram/_shared/protocol-capture.js +9 -9
  377. package/clis/instagram/detail.js +3 -3
  378. package/clis/instagram/post.js +25 -25
  379. package/clis/instagram/reel.js +18 -18
  380. package/clis/instagram/story.js +4 -4
  381. package/clis/instagram/user.js +2 -2
  382. package/clis/jd/item.js +65 -65
  383. package/clis/jianshu/article.js +1 -1
  384. package/clis/jianshu/login.js +1 -1
  385. package/clis/jianshu/notebooks.js +1 -1
  386. package/clis/jianshu/whoami.js +1 -1
  387. package/clis/jianyu/search.js +6 -6
  388. package/clis/jianyu/shared/procurement-contract.js +1 -1
  389. package/clis/jike/api.js +6 -6
  390. package/clis/jike/auth.js +3 -3
  391. package/clis/jike/comment.js +1 -1
  392. package/clis/jike/create.js +6 -6
  393. package/clis/jike/feed.js +3 -3
  394. package/clis/jike/like.js +1 -1
  395. package/clis/jike/notifications.js +3 -3
  396. package/clis/jike/repost.js +13 -13
  397. package/clis/jike/search.js +3 -3
  398. package/clis/jimeng/auth.js +2 -2
  399. package/clis/jimeng/generate.js +10 -10
  400. package/clis/jira/shared.js +1 -1
  401. package/clis/juejin/article.js +4 -4
  402. package/clis/juejin/categories.js +1 -1
  403. package/clis/juejin/hot.js +1 -1
  404. package/clis/juejin/login.js +1 -1
  405. package/clis/juejin/recommend.js +1 -1
  406. package/clis/juejin/stats.js +3 -3
  407. package/clis/juejin/tags.js +1 -1
  408. package/clis/juejin/utils.js +1 -1
  409. package/clis/juejin/whoami.js +1 -1
  410. package/clis/ke/utils.js +4 -4
  411. package/clis/kimi/_utils.js +7 -7
  412. package/clis/kimi/audit-extras.js +14 -14
  413. package/clis/kimi/auth.js +3 -3
  414. package/clis/kimi/chat.js +15 -15
  415. package/clis/kimi/storage.js +5 -5
  416. package/clis/kimi/ui.js +13 -13
  417. package/clis/kimi/usage.js +3 -3
  418. package/clis/kuaishou/auth.js +1 -1
  419. package/clis/kuaishou/publish.js +6 -6
  420. package/clis/lesswrong/_helpers.js +5 -5
  421. package/clis/lesswrong/comments.js +5 -5
  422. package/clis/lichess/top.js +1 -1
  423. package/clis/lichess/user.js +1 -1
  424. package/clis/lichess/utils.js +1 -1
  425. package/clis/linkedin/comment.js +1 -1
  426. package/clis/linkedin/connect.js +11 -11
  427. package/clis/linkedin/create.js +5 -5
  428. package/clis/linkedin/follow.js +1 -1
  429. package/clis/linkedin/inbox.js +1 -1
  430. package/clis/linkedin/job-detail.js +3 -3
  431. package/clis/linkedin/like.js +1 -1
  432. package/clis/linkedin/notifications.js +1 -1
  433. package/clis/linkedin/people-search.js +1 -1
  434. package/clis/linkedin/post-comments.js +1 -1
  435. package/clis/linkedin/post-detail.js +1 -1
  436. package/clis/linkedin/profile-analytics.js +1 -1
  437. package/clis/linkedin/profile-api.js +13 -13
  438. package/clis/linkedin/profile-experience.js +1 -1
  439. package/clis/linkedin/profile-projects.js +1 -1
  440. package/clis/linkedin/profile-read.js +3 -3
  441. package/clis/linkedin/reply.js +1 -1
  442. package/clis/linkedin/repost.js +1 -1
  443. package/clis/linkedin/safe-send.js +8 -8
  444. package/clis/linkedin/salesnav-inbox.js +5 -5
  445. package/clis/linkedin/salesnav-message.js +3 -3
  446. package/clis/linkedin/salesnav-search.js +4 -4
  447. package/clis/linkedin/salesnav-thread.js +1 -1
  448. package/clis/linkedin/search-api.js +3 -3
  449. package/clis/linkedin/search.js +8 -8
  450. package/clis/linkedin/social-api.js +31 -31
  451. package/clis/linkedin/timeline.js +3 -3
  452. package/clis/linkedin-learning/search.js +2 -2
  453. package/clis/linkedin-learning/trending.js +2 -2
  454. package/clis/linux-do/feed.js +4 -4
  455. package/clis/linux-do/topic-content.js +8 -8
  456. package/clis/lobsters/domain.js +1 -1
  457. package/clis/lobsters/read.js +7 -7
  458. package/clis/maimai/auth.js +2 -2
  459. package/clis/maimai/search-talents.js +4 -4
  460. package/clis/manus/_utils.js +1 -1
  461. package/clis/mastodon/login.js +1 -1
  462. package/clis/mastodon/post.js +1 -1
  463. package/clis/mastodon/shared.js +12 -12
  464. package/clis/mastodon/whoami.js +1 -1
  465. package/clis/maven/artifact.js +1 -1
  466. package/clis/maven/search.js +1 -1
  467. package/clis/maven/utils.js +1 -1
  468. package/clis/mdn/search.js +1 -1
  469. package/clis/medium/article.js +5 -5
  470. package/clis/medium/login.js +1 -1
  471. package/clis/medium/stats.js +3 -3
  472. package/clis/medium/tag.js +1 -1
  473. package/clis/medium/whoami.js +1 -1
  474. package/clis/mubu/notes.js +1 -1
  475. package/clis/mubu/utils.js +15 -15
  476. package/clis/note/auth.js +2 -2
  477. package/clis/note/note-utils.js +2 -2
  478. package/clis/note/publish.js +8 -8
  479. package/clis/notebooklm/add-source.js +8 -8
  480. package/clis/notebooklm/create.js +1 -1
  481. package/clis/notebooklm/generate-slides.js +1 -1
  482. package/clis/notebooklm/notes-get.js +1 -1
  483. package/clis/notebooklm/rpc.js +8 -8
  484. package/clis/notebooklm/source-fulltext.js +1 -1
  485. package/clis/notebooklm/utils.js +10 -10
  486. package/clis/nowcoder/auth.js +2 -2
  487. package/clis/nowcoder/comment.js +1 -1
  488. package/clis/nowcoder/comments.js +1 -1
  489. package/clis/nowcoder/dm-list.js +1 -1
  490. package/clis/nowcoder/dm-read.js +1 -1
  491. package/clis/nowcoder/dm-send.js +1 -1
  492. package/clis/nowcoder/drafts.js +1 -1
  493. package/clis/nowcoder/inbox.js +1 -1
  494. package/clis/nowcoder/like.js +1 -1
  495. package/clis/nowcoder/my.js +1 -1
  496. package/clis/nowcoder/post.js +1 -1
  497. package/clis/nowcoder/utils.js +13 -13
  498. package/clis/npm/downloads.js +1 -1
  499. package/clis/npm/package.js +1 -1
  500. package/clis/npm/search.js +1 -1
  501. package/clis/npm/utils.js +1 -1
  502. package/clis/nuget/package.js +1 -1
  503. package/clis/nuget/search.js +1 -1
  504. package/clis/nuget/utils.js +1 -1
  505. package/clis/nvd/cve.js +1 -1
  506. package/clis/oeis/search.js +1 -1
  507. package/clis/oeis/sequence.js +1 -1
  508. package/clis/oeis/utils.js +1 -1
  509. package/clis/ones/common.js +6 -6
  510. package/clis/ones/enrich-tasks.js +1 -1
  511. package/clis/ones/my-tasks.js +1 -1
  512. package/clis/ones/resolve-labels.js +1 -1
  513. package/clis/ones/task-helpers.js +1 -1
  514. package/clis/ones/task.js +1 -1
  515. package/clis/ones/worklog.js +7 -7
  516. package/clis/openalex/search.js +1 -1
  517. package/clis/openalex/utils.js +1 -1
  518. package/clis/openalex/work.js +1 -1
  519. package/clis/openfda/drug-label.js +1 -1
  520. package/clis/openfda/food-recall.js +1 -1
  521. package/clis/openfda/utils.js +1 -1
  522. package/clis/openreview/author.js +1 -1
  523. package/clis/openreview/paper.js +1 -1
  524. package/clis/openreview/reviews.js +3 -3
  525. package/clis/openreview/search.js +1 -1
  526. package/clis/openreview/utils.js +1 -1
  527. package/clis/openreview/venue.js +1 -1
  528. package/clis/oschina/article.js +1 -1
  529. package/clis/oschina/catalogs.js +1 -1
  530. package/clis/oschina/login.js +1 -1
  531. package/clis/oschina/stats.js +6 -6
  532. package/clis/oschina/whoami.js +1 -1
  533. package/clis/osv/query.js +1 -1
  534. package/clis/osv/utils.js +1 -1
  535. package/clis/osv/vulnerability.js +1 -1
  536. package/clis/packagist/package.js +1 -1
  537. package/clis/packagist/search.js +1 -1
  538. package/clis/packagist/utils.js +1 -1
  539. package/clis/pinterest/api.js +1 -1
  540. package/clis/pinterest/auth.js +1 -1
  541. package/clis/pinterest/boards.js +1 -1
  542. package/clis/pinterest/client.js +6 -6
  543. package/clis/pinterest/publish.js +5 -5
  544. package/clis/pixiv/auth.js +2 -2
  545. package/clis/pixiv/download.js +1 -1
  546. package/clis/pixiv/illusts.js +1 -1
  547. package/clis/pixiv/search.js +1 -1
  548. package/clis/pixiv/utils.js +3 -3
  549. package/clis/powerchina/auth.js +2 -2
  550. package/clis/powerchina/search.js +1 -1
  551. package/clis/producthunt/browse.js +2 -2
  552. package/clis/producthunt/hot.js +2 -2
  553. package/clis/producthunt/posts.js +1 -1
  554. package/clis/producthunt/today.js +1 -1
  555. package/clis/producthunt/utils.js +1 -1
  556. package/clis/pypi/downloads.js +1 -1
  557. package/clis/pypi/package.js +1 -1
  558. package/clis/pypi/utils.js +1 -1
  559. package/clis/qiita/auth.js +1 -1
  560. package/clis/qiita/gql.js +6 -6
  561. package/clis/qiita/publish.js +4 -4
  562. package/clis/qiita/stats.js +4 -4
  563. package/clis/qoder/_utils.js +16 -16
  564. package/clis/qoder/composer.js +1 -1
  565. package/clis/qoder/quest.js +1 -1
  566. package/clis/qoder/ui.js +14 -14
  567. package/clis/quark/auth.js +2 -2
  568. package/clis/quark/utils.js +2 -2
  569. package/clis/quora/answer-comments.js +3 -3
  570. package/clis/quora/create-answer.js +4 -4
  571. package/clis/quora/create-question.js +3 -3
  572. package/clis/quora/shared.js +17 -17
  573. package/clis/quora/whoami.js +1 -1
  574. package/clis/qwen/ask.js +1 -1
  575. package/clis/qwen/auth.js +3 -3
  576. package/clis/qwen/detail.js +1 -1
  577. package/clis/qwen/image.js +5 -5
  578. package/clis/qwen/status.js +1 -1
  579. package/clis/qwen/utils.js +16 -16
  580. package/clis/reddit/home.js +3 -3
  581. package/clis/reddit/read.js +10 -10
  582. package/clis/reddit/reply.js +4 -4
  583. package/clis/reddit/submit.js +11 -11
  584. package/clis/reddit/subreddit-info.js +3 -3
  585. package/clis/reddit/subscribed.js +4 -4
  586. package/clis/reddit/whoami.js +2 -2
  587. package/clis/rednote/comments.js +1 -1
  588. package/clis/rednote/download.js +1 -1
  589. package/clis/rednote/feed.js +1 -1
  590. package/clis/rednote/note.js +1 -1
  591. package/clis/rednote/notifications.js +2 -2
  592. package/clis/rednote/search.js +2 -2
  593. package/clis/rest-countries/country.js +1 -1
  594. package/clis/rest-countries/region.js +1 -1
  595. package/clis/rest-countries/utils.js +1 -1
  596. package/clis/reuters/article-detail.js +1 -1
  597. package/clis/reuters/auth.js +3 -3
  598. package/clis/reuters/search.js +1 -1
  599. package/clis/reuters/utils.js +4 -4
  600. package/clis/rfc/rfc.js +1 -1
  601. package/clis/rfc/utils.js +1 -1
  602. package/clis/rubygems/gem.js +1 -1
  603. package/clis/rubygems/search.js +1 -1
  604. package/clis/rubygems/utils.js +1 -1
  605. package/clis/segmentfault/article.js +3 -3
  606. package/clis/segmentfault/channels.js +1 -1
  607. package/clis/segmentfault/login.js +1 -1
  608. package/clis/segmentfault/stats.js +4 -4
  609. package/clis/segmentfault/tags.js +1 -1
  610. package/clis/segmentfault/whoami.js +1 -1
  611. package/clis/semanticscholar/citations.js +1 -1
  612. package/clis/semanticscholar/paper.js +1 -1
  613. package/clis/semanticscholar/recommendations.js +1 -1
  614. package/clis/semanticscholar/search.js +1 -1
  615. package/clis/semanticscholar/utils.js +1 -1
  616. package/clis/sinafinance/news.js +1 -1
  617. package/clis/sinafinance/stock-rank.js +1 -1
  618. package/clis/sinafinance/stock.js +1 -1
  619. package/clis/slock/attachment-download.js +1 -1
  620. package/clis/slock/attachment-upload.js +7 -7
  621. package/clis/slock/attachment-url.js +1 -1
  622. package/clis/slock/auth-verify.js +1 -1
  623. package/clis/slock/bookmark-add.js +1 -1
  624. package/clis/slock/bookmark-remove.js +1 -1
  625. package/clis/slock/channel-action.js +1 -1
  626. package/clis/slock/channel-create.js +1 -1
  627. package/clis/slock/channel-files.js +1 -1
  628. package/clis/slock/channel-list.js +1 -1
  629. package/clis/slock/channel-mark.js +1 -1
  630. package/clis/slock/channel-members.js +1 -1
  631. package/clis/slock/channel-unarchive.js +1 -1
  632. package/clis/slock/dm-list.js +1 -1
  633. package/clis/slock/errors.js +1 -1
  634. package/clis/slock/in-page.js +28 -28
  635. package/clis/slock/inbox-done.js +5 -5
  636. package/clis/slock/inbox.js +1 -1
  637. package/clis/slock/message-read.js +22 -22
  638. package/clis/slock/message-search.js +10 -10
  639. package/clis/slock/message-send.js +25 -25
  640. package/clis/slock/reaction-add.js +1 -1
  641. package/clis/slock/reaction-remove.js +1 -1
  642. package/clis/slock/resolve.js +1 -1
  643. package/clis/slock/server-list.js +2 -2
  644. package/clis/slock/task-claim.js +4 -4
  645. package/clis/slock/task-convert.js +13 -13
  646. package/clis/slock/task-create.js +1 -1
  647. package/clis/slock/task-delete.js +5 -5
  648. package/clis/slock/task-get.js +5 -5
  649. package/clis/slock/task-list-server.js +4 -4
  650. package/clis/slock/task-list.js +5 -5
  651. package/clis/slock/task-status.js +3 -3
  652. package/clis/slock/task-unclaim.js +3 -3
  653. package/clis/slock/thread-follow.js +1 -1
  654. package/clis/slock/thread-state.js +1 -1
  655. package/clis/slock/unread-summary.js +5 -5
  656. package/clis/slock/whoami.js +1 -1
  657. package/clis/smzdm/search.js +3 -3
  658. package/clis/sohu/article.js +1 -1
  659. package/clis/sohu/attributes.js +1 -1
  660. package/clis/sohu/categories.js +1 -1
  661. package/clis/sohu/channels.js +1 -1
  662. package/clis/sohu/columns.js +1 -1
  663. package/clis/sohu/login.js +1 -1
  664. package/clis/sohu/stats.js +3 -3
  665. package/clis/sohu/topics.js +1 -1
  666. package/clis/sohu/whoami.js +1 -1
  667. package/clis/spotify/spotify.js +1 -1
  668. package/clis/stackoverflow/read.js +6 -6
  669. package/clis/stackoverflow/related.js +1 -1
  670. package/clis/stackoverflow/tag.js +1 -1
  671. package/clis/stackoverflow/user.js +1 -1
  672. package/clis/stackoverflow/utils.js +1 -1
  673. package/clis/steam/app.js +1 -1
  674. package/clis/steam/search.js +1 -1
  675. package/clis/steam/utils.js +1 -1
  676. package/clis/substack/auth.js +2 -2
  677. package/clis/substack/post-utils.js +2 -2
  678. package/clis/substack/publish.js +5 -5
  679. package/clis/suno/auth.js +2 -2
  680. package/clis/suno/download.js +5 -5
  681. package/clis/suno/generate.js +3 -3
  682. package/clis/suno/list.js +1 -1
  683. package/clis/suno/status.js +1 -1
  684. package/clis/suno/utils.js +29 -29
  685. package/clis/telegram/send.js +7 -7
  686. package/clis/telegram/shared.js +2 -2
  687. package/clis/telegram/whoami.js +1 -1
  688. package/clis/test-utils.js +1 -1
  689. package/clis/threads/post.js +23 -23
  690. package/clis/threads/shared.js +3 -3
  691. package/clis/threads/whoami.js +1 -1
  692. package/clis/tieba/hot.js +3 -3
  693. package/clis/tieba/posts.js +1 -1
  694. package/clis/tieba/read.js +2 -2
  695. package/clis/tieba/search.js +3 -3
  696. package/clis/tieba/utils.js +1 -1
  697. package/clis/tiktok/comment.js +2 -2
  698. package/clis/tiktok/creator-videos.js +3 -3
  699. package/clis/tiktok/explore.js +3 -3
  700. package/clis/tiktok/follow.js +8 -8
  701. package/clis/tiktok/following.js +4 -4
  702. package/clis/tiktok/friends.js +7 -7
  703. package/clis/tiktok/live.js +3 -3
  704. package/clis/tiktok/notifications.js +6 -6
  705. package/clis/tiktok/publish.js +16 -16
  706. package/clis/tiktok/unfollow.js +4 -4
  707. package/clis/tiktok/user.js +2 -2
  708. package/clis/tiktok/utils.js +1 -1
  709. package/clis/toutiao/article.js +1 -1
  710. package/clis/toutiao/articles.js +2 -2
  711. package/clis/toutiao/auth.js +2 -2
  712. package/clis/toutiao/hot.js +1 -1
  713. package/clis/toutiao/recommend.js +1 -1
  714. package/clis/toutiao/utils.js +2 -2
  715. package/clis/trae-solo/_actions.js +4 -4
  716. package/clis/trae-solo/_fs.js +5 -5
  717. package/clis/trae-solo/_state.js +2 -2
  718. package/clis/trae-solo/automation.js +4 -4
  719. package/clis/trae-solo/mode.js +4 -4
  720. package/clis/trae-solo/model.js +4 -4
  721. package/clis/trae-solo/renderer-storage.js +4 -4
  722. package/clis/trae-solo/settings.js +1 -1
  723. package/clis/trae-solo/skill-fs.js +1 -1
  724. package/clis/trae-solo/skill.js +12 -12
  725. package/clis/trae-solo/state-fs.js +2 -2
  726. package/clis/trae-solo/task-fs.js +5 -5
  727. package/clis/trae-solo/workspaces-fs.js +1 -1
  728. package/clis/tumblr/auth.js +2 -2
  729. package/clis/tumblr/publish.js +3 -3
  730. package/clis/tvmaze/search.js +1 -1
  731. package/clis/tvmaze/show.js +1 -1
  732. package/clis/tvmaze/utils.js +1 -1
  733. package/clis/twitter/accept.js +7 -7
  734. package/clis/twitter/article.js +7 -7
  735. package/clis/twitter/bookmark-folder.js +3 -3
  736. package/clis/twitter/bookmark-folders.js +3 -3
  737. package/clis/twitter/bookmarks.js +4 -4
  738. package/clis/twitter/delete.js +5 -5
  739. package/clis/twitter/device-follow.js +3 -3
  740. package/clis/twitter/dm-list.js +1 -1
  741. package/clis/twitter/dm-read.js +1 -1
  742. package/clis/twitter/dm-send.js +5 -5
  743. package/clis/twitter/dm-shared.js +3 -3
  744. package/clis/twitter/download.js +6 -6
  745. package/clis/twitter/followers.js +5 -5
  746. package/clis/twitter/following.js +2 -2
  747. package/clis/twitter/like.js +3 -3
  748. package/clis/twitter/likes.js +8 -8
  749. package/clis/twitter/list-add-core.js +9 -9
  750. package/clis/twitter/list-create.js +5 -5
  751. package/clis/twitter/list-remove-core.js +9 -9
  752. package/clis/twitter/list-tweets.js +7 -7
  753. package/clis/twitter/lists.js +6 -6
  754. package/clis/twitter/notifications.js +2 -2
  755. package/clis/twitter/post.js +24 -24
  756. package/clis/twitter/profile.js +7 -7
  757. package/clis/twitter/quote.js +7 -7
  758. package/clis/twitter/reply-dm.js +7 -7
  759. package/clis/twitter/reply.js +12 -12
  760. package/clis/twitter/retweet.js +3 -3
  761. package/clis/twitter/scheduled-delete.js +3 -3
  762. package/clis/twitter/scheduled-list.js +2 -2
  763. package/clis/twitter/scheduled-utils.js +3 -3
  764. package/clis/twitter/search.js +5 -5
  765. package/clis/twitter/shared.js +6 -6
  766. package/clis/twitter/thread.js +4 -4
  767. package/clis/twitter/timeline.js +3 -3
  768. package/clis/twitter/trending.js +2 -2
  769. package/clis/twitter/tweets.js +11 -11
  770. package/clis/twitter/unlike.js +3 -3
  771. package/clis/twitter/unretweet.js +3 -3
  772. package/clis/twitter/utils.js +6 -6
  773. package/clis/upwork/detail.js +2 -2
  774. package/clis/upwork/feed.js +2 -2
  775. package/clis/upwork/search.js +2 -2
  776. package/clis/upwork/utils.js +1 -1
  777. package/clis/v2ex/auth.js +2 -2
  778. package/clis/v2ex/daily.js +3 -3
  779. package/clis/v2ex/me.js +2 -2
  780. package/clis/v2ex/notifications.js +2 -2
  781. package/clis/vk/post.js +1 -1
  782. package/clis/vk/shared.js +2 -2
  783. package/clis/vk/whoami.js +1 -1
  784. package/clis/web/read.js +8 -8
  785. package/clis/wechat-channels/auth.js +2 -2
  786. package/clis/wechat-channels/publish.js +30 -30
  787. package/clis/weibo/article.js +1 -1
  788. package/clis/weibo/auth.js +3 -3
  789. package/clis/weibo/comments.js +1 -1
  790. package/clis/weibo/delete.js +2 -2
  791. package/clis/weibo/feed.js +3 -3
  792. package/clis/weibo/hot.js +1 -1
  793. package/clis/weibo/publish.js +10 -10
  794. package/clis/weibo/search.js +2 -2
  795. package/clis/weibo/user-posts.js +3 -3
  796. package/clis/weibo/user.js +2 -2
  797. package/clis/weibo/utils.js +3 -3
  798. package/clis/weixin/article.js +1 -1
  799. package/clis/weixin/create-draft.js +26 -26
  800. package/clis/weixin/download.js +2 -2
  801. package/clis/weixin/login.js +1 -1
  802. package/clis/weixin/search.js +2 -2
  803. package/clis/weixin/stats.js +3 -3
  804. package/clis/weixin/whoami.js +1 -1
  805. package/clis/weread/ai-outline.js +2 -2
  806. package/clis/weread/book-search.js +2 -2
  807. package/clis/weread/book.js +2 -2
  808. package/clis/weread/notebooks.js +1 -1
  809. package/clis/weread/search.js +1 -1
  810. package/clis/weread/shelf.js +1 -1
  811. package/clis/weread/utils.js +6 -6
  812. package/clis/weread-official/book.js +1 -1
  813. package/clis/weread-official/discover.js +1 -1
  814. package/clis/weread-official/list-apis.js +1 -1
  815. package/clis/weread-official/notes.js +1 -1
  816. package/clis/weread-official/readdata.js +1 -1
  817. package/clis/weread-official/review.js +1 -1
  818. package/clis/weread-official/search.js +1 -1
  819. package/clis/weread-official/shelf.js +1 -1
  820. package/clis/weread-official/utils.js +1 -1
  821. package/clis/wikidata/entity.js +1 -1
  822. package/clis/wikidata/search.js +1 -1
  823. package/clis/wikidata/utils.js +1 -1
  824. package/clis/wikipedia/page.js +1 -1
  825. package/clis/wikipedia/trending.js +1 -1
  826. package/clis/wikipedia/utils.js +1 -1
  827. package/clis/wordpress/login.js +1 -1
  828. package/clis/wordpress/publish.js +1 -1
  829. package/clis/wordpress/shared.js +3 -3
  830. package/clis/wordpress/whoami.js +1 -1
  831. package/clis/woshipm/article.js +1 -1
  832. package/clis/woshipm/login.js +1 -1
  833. package/clis/woshipm/stats.js +4 -4
  834. package/clis/woshipm/whoami.js +1 -1
  835. package/clis/wttr/current.js +1 -1
  836. package/clis/wttr/forecast.js +1 -1
  837. package/clis/wttr/utils.js +1 -1
  838. package/clis/xianyu/collect.js +1 -1
  839. package/clis/xianyu/inbox.js +1 -1
  840. package/clis/xianyu/item-stats.js +2 -2
  841. package/clis/xianyu/location.js +1 -1
  842. package/clis/xianyu/manage.js +1 -1
  843. package/clis/xianyu/messages.js +1 -1
  844. package/clis/xianyu/mtop.js +5 -5
  845. package/clis/xianyu/order.js +1 -1
  846. package/clis/xianyu/promote-stats.js +2 -2
  847. package/clis/xianyu/publish.js +17 -17
  848. package/clis/xianyu/rate.js +1 -1
  849. package/clis/xianyu/reply.js +1 -1
  850. package/clis/xianyu/search.js +8 -8
  851. package/clis/xianyu/seller-data.js +1 -1
  852. package/clis/xianyu/seller-list.js +1 -1
  853. package/clis/xianyu/user.js +1 -1
  854. package/clis/xiaoe/catalog.js +2 -2
  855. package/clis/xiaoe/content.js +2 -2
  856. package/clis/xiaoe/courses.js +2 -2
  857. package/clis/xiaohongshu/ask.js +6 -6
  858. package/clis/xiaohongshu/comments.js +6 -6
  859. package/clis/xiaohongshu/creator-note-detail.js +7 -7
  860. package/clis/xiaohongshu/creator-notes-summary.js +1 -1
  861. package/clis/xiaohongshu/creator-notes.js +13 -13
  862. package/clis/xiaohongshu/creator-profile.js +2 -2
  863. package/clis/xiaohongshu/creator-stats.js +2 -2
  864. package/clis/xiaohongshu/delete-note.js +7 -7
  865. package/clis/xiaohongshu/download.js +4 -4
  866. package/clis/xiaohongshu/feed.js +2 -2
  867. package/clis/xiaohongshu/follow.js +3 -3
  868. package/clis/xiaohongshu/human.js +3 -3
  869. package/clis/xiaohongshu/note-helpers.js +1 -1
  870. package/clis/xiaohongshu/note.js +2 -2
  871. package/clis/xiaohongshu/notifications.js +1 -1
  872. package/clis/xiaohongshu/publish-video.js +8 -8
  873. package/clis/xiaohongshu/publish.js +59 -59
  874. package/clis/xiaohongshu/search.js +8 -8
  875. package/clis/xiaohongshu/unfollow.js +4 -4
  876. package/clis/xiaohongshu/user-helpers.js +1 -1
  877. package/clis/xiaohongshu/user.js +2 -2
  878. package/clis/xiaoyuzhou/auth.js +3 -3
  879. package/clis/xiaoyuzhou/download.js +1 -1
  880. package/clis/xiaoyuzhou/utils.js +1 -1
  881. package/clis/xueqiu/article.js +4 -4
  882. package/clis/xueqiu/comments.js +4 -4
  883. package/clis/xueqiu/danjuan-utils.js +4 -4
  884. package/clis/xueqiu/earnings-date.js +1 -1
  885. package/clis/xueqiu/events.js +3 -3
  886. package/clis/xueqiu/hashtags.js +3 -3
  887. package/clis/xueqiu/stocks.js +3 -3
  888. package/clis/xueqiu/users.js +3 -3
  889. package/clis/xueqiu/utils.js +3 -3
  890. package/clis/yahoo-finance/quote.js +1 -1
  891. package/clis/yollomi/background.js +1 -1
  892. package/clis/yollomi/edit.js +1 -1
  893. package/clis/yollomi/face-swap.js +1 -1
  894. package/clis/yollomi/generate.js +1 -1
  895. package/clis/yollomi/object-remover.js +1 -1
  896. package/clis/yollomi/remove-bg.js +1 -1
  897. package/clis/yollomi/restore.js +1 -1
  898. package/clis/yollomi/try-on.js +1 -1
  899. package/clis/yollomi/upload.js +4 -4
  900. package/clis/yollomi/upscale.js +1 -1
  901. package/clis/yollomi/utils.js +4 -4
  902. package/clis/yollomi/video.js +1 -1
  903. package/clis/youtube/channel.js +4 -4
  904. package/clis/youtube/feed.js +2 -2
  905. package/clis/youtube/like.js +5 -5
  906. package/clis/youtube/playlist.js +7 -7
  907. package/clis/youtube/publish.js +11 -11
  908. package/clis/youtube/search.js +3 -3
  909. package/clis/youtube/subscribe.js +7 -7
  910. package/clis/youtube/subscriptions.js +1 -1
  911. package/clis/youtube/transcript-group.js +2 -2
  912. package/clis/youtube/transcript.js +13 -13
  913. package/clis/youtube/unlike.js +5 -5
  914. package/clis/youtube/unsubscribe.js +7 -7
  915. package/clis/youtube/utils.js +3 -3
  916. package/clis/youtube/video.js +4 -4
  917. package/clis/youtube/watch-later.js +2 -2
  918. package/clis/yuanbao/ask.js +18 -18
  919. package/clis/yuanbao/detail.js +1 -1
  920. package/clis/yuanbao/read.js +1 -1
  921. package/clis/yuanbao/shared.js +9 -9
  922. package/clis/yuanbao/status.js +1 -1
  923. package/clis/yuque/article.js +1 -1
  924. package/clis/yuque/whoami.js +1 -1
  925. package/clis/zhihu/answer-comments.js +2 -2
  926. package/clis/zhihu/answer-detail.js +3 -3
  927. package/clis/zhihu/answer.js +1 -1
  928. package/clis/zhihu/article-transform.js +1 -1
  929. package/clis/zhihu/article.js +1 -1
  930. package/clis/zhihu/auth.js +2 -2
  931. package/clis/zhihu/collection.js +3 -3
  932. package/clis/zhihu/collections.js +3 -3
  933. package/clis/zhihu/download.js +2 -2
  934. package/clis/zhihu/image-profile.js +6 -6
  935. package/clis/zhihu/paginate.js +3 -3
  936. package/clis/zhihu/pin.js +4 -4
  937. package/clis/zhihu/question.js +3 -3
  938. package/clis/zhihu/recommend.js +3 -3
  939. package/clis/zhihu/search.js +3 -3
  940. package/clis/zhihu/stats.js +3 -3
  941. package/clis/zhihu/user-arg.js +1 -1
  942. package/clis/zhihu/write-shared.js +7 -7
  943. package/clis/zlibrary/utils.js +6 -6
  944. package/clis/zsxq/auth.js +3 -3
  945. package/clis/zsxq/search.js +1 -1
  946. package/clis/zsxq/topic.js +1 -1
  947. package/clis/zsxq/utils.js +5 -5
  948. package/dist/src/adapter-source.js +1 -1
  949. package/dist/src/browser/analyze.js +1 -1
  950. package/dist/src/browser/article-extract.js +2 -2
  951. package/dist/src/browser/ax-snapshot.js +2 -2
  952. package/dist/src/browser/base-page.js +25 -25
  953. package/dist/src/browser/bridge.js +1 -1
  954. package/dist/src/browser/cdp.js +1 -1
  955. package/dist/src/browser/daemon-client.js +1 -1
  956. package/dist/src/browser/daemon-lifecycle.js +7 -7
  957. package/dist/src/browser/dom-helpers.js +35 -35
  958. package/dist/src/browser/dom-snapshot.js +19 -19
  959. package/dist/src/browser/errors.js +3 -3
  960. package/dist/src/browser/extract.js +5 -5
  961. package/dist/src/browser/find.js +13 -13
  962. package/dist/src/browser/fingerprint.js +2 -2
  963. package/dist/src/browser/html-tree.js +6 -6
  964. package/dist/src/browser/managed-chrome.js +1 -1
  965. package/dist/src/browser/network-cache.js +1 -1
  966. package/dist/src/browser/network-key.js +1 -1
  967. package/dist/src/browser/page.js +7 -7
  968. package/dist/src/browser/profile.js +2 -2
  969. package/dist/src/browser/proxy-test.js +8 -8
  970. package/dist/src/browser/shape-filter.js +1 -1
  971. package/dist/src/browser/shape.js +1 -1
  972. package/dist/src/browser/stealth.js +3 -3
  973. package/dist/src/browser/tabs.js +2 -2
  974. package/dist/src/browser/target-errors.js +1 -1
  975. package/dist/src/browser/target-resolver.js +23 -23
  976. package/dist/src/browser/trace.js +2 -2
  977. package/dist/src/browser/utils.js +1 -1
  978. package/dist/src/browser/verify-fixture.js +2 -2
  979. package/dist/src/browser-session-lock.js +1 -1
  980. package/dist/src/build-manifest.js +11 -11
  981. package/dist/src/capabilityRouting.js +1 -1
  982. package/dist/src/cli-argv-preprocess.js +1 -1
  983. package/dist/src/cli.js +32 -32
  984. package/dist/src/commanderAdapter.js +3 -3
  985. package/dist/src/commands/auth.js +3 -3
  986. package/dist/src/commands/daemon.js +1 -1
  987. package/dist/src/completion-fast.js +1 -1
  988. package/dist/src/completion.js +1 -1
  989. package/dist/src/constants.js +1 -1
  990. package/dist/src/convention-audit.js +2 -2
  991. package/dist/src/daemon-utils.js +1 -1
  992. package/dist/src/daemon.js +1 -1
  993. package/dist/src/discovery.js +2 -2
  994. package/dist/src/doctor.js +9 -9
  995. package/dist/src/download/article-download.js +15 -15
  996. package/dist/src/download/index.js +4 -4
  997. package/dist/src/download/media-download.js +1 -1
  998. package/dist/src/download/progress.js +3 -3
  999. package/dist/src/electron-apps.js +1 -1
  1000. package/dist/src/errors.js +2 -2
  1001. package/dist/src/execution.js +2 -2
  1002. package/dist/src/external.js +1 -1
  1003. package/dist/src/help.js +8 -8
  1004. package/dist/src/hooks.js +1 -1
  1005. package/dist/src/interceptor.js +21 -21
  1006. package/dist/src/launcher.js +7 -7
  1007. package/dist/src/logger.js +8 -8
  1008. package/dist/src/main.js +7 -7
  1009. package/dist/src/observation/artifact.js +5 -5
  1010. package/dist/src/observation/retention.js +1 -1
  1011. package/dist/src/output.js +2 -2
  1012. package/dist/src/package-paths.js +1 -1
  1013. package/dist/src/pipeline/executor.js +1 -1
  1014. package/dist/src/pipeline/registry.js +1 -1
  1015. package/dist/src/pipeline/steps/browser.js +1 -1
  1016. package/dist/src/pipeline/steps/download.js +1 -1
  1017. package/dist/src/pipeline/steps/fetch.js +6 -6
  1018. package/dist/src/pipeline/steps/intercept.js +1 -1
  1019. package/dist/src/pipeline/steps/tap.js +17 -17
  1020. package/dist/src/pipeline/steps/transform.js +1 -1
  1021. package/dist/src/pipeline/template.js +1 -1
  1022. package/dist/src/plugin-manifest.js +1 -1
  1023. package/dist/src/plugin-scaffold.js +19 -19
  1024. package/dist/src/plugin.js +12 -12
  1025. package/dist/src/rate-limit.js +1 -1
  1026. package/dist/src/registry.js +1 -1
  1027. package/dist/src/runtime-detect.js +1 -1
  1028. package/dist/src/runtime.js +1 -1
  1029. package/dist/src/scripts/framework.js +1 -1
  1030. package/dist/src/scripts/interact.js +1 -1
  1031. package/dist/src/scripts/store.js +1 -1
  1032. package/dist/src/serialization.js +2 -2
  1033. package/dist/src/session-lease.js +1 -1
  1034. package/dist/src/snapshotFormatter.js +2 -2
  1035. package/dist/src/tui.js +12 -12
  1036. package/dist/src/user-runtime.js +1 -1
  1037. package/dist/src/utils.d.ts +12 -0
  1038. package/dist/src/utils.js +4 -4
  1039. package/dist/src/validate.js +2 -2
  1040. package/dist/src/verify.js +2 -2
  1041. package/dist/src/version.js +1 -1
  1042. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import*as R from"node:net";const $="ip-api.com",A=80,I="/json/?fields=status,message,country,countryCode,region,city,timezone,query",F=12000,B={US:"en-US",GB:"en-GB",CA:"en-CA",AU:"en-AU",SG:"en-SG",HK:"zh-HK",TW:"zh-TW",CN:"zh-CN",MO:"zh-MO",JP:"ja-JP",KR:"ko-KR",DE:"de-DE",FR:"fr-FR",ES:"es-ES",IT:"it-IT",NL:"nl-NL",RU:"ru-RU",BR:"pt-BR",PT:"pt-PT",IN:"en-IN",ID:"id-ID",TH:"th-TH",VN:"vi-VN",MY:"ms-MY",PH:"en-PH",TR:"tr-TR",PL:"pl-PL",SE:"sv-SE",NO:"nb-NO",DK:"da-DK",FI:"fi-FI",UA:"uk-UA",MX:"es-MX",AR:"es-AR"};export function localeForCountry(z){if(!z)return;return B[z.toUpperCase()]??"en-US"}function L(z){const V=z.indexOf(`\r
1
+ import*as h from"node:net";const i="ip-api.com",d=80,l="/json/?fields=status,message,country,countryCode,region,city,timezone,query",a=12000,T={US:"en-US",GB:"en-GB",CA:"en-CA",AU:"en-AU",SG:"en-SG",HK:"zh-HK",TW:"zh-TW",CN:"zh-CN",MO:"zh-MO",JP:"ja-JP",KR:"ko-KR",DE:"de-DE",FR:"fr-FR",ES:"es-ES",IT:"it-IT",NL:"nl-NL",RU:"ru-RU",BR:"pt-BR",PT:"pt-PT",IN:"en-IN",ID:"id-ID",TH:"th-TH",VN:"vi-VN",MY:"ms-MY",PH:"en-PH",TR:"tr-TR",PL:"pl-PL",SE:"sv-SE",NO:"nb-NO",DK:"da-DK",FI:"fi-FI",UA:"uk-UA",MX:"es-MX",AR:"es-AR"};export function localeForCountry(e){if(!e)return;return T[e.toUpperCase()]??"en-US"}function C(e){const s=e.indexOf(`\r
2
2
  \r
3
- `);return V>=0?z.slice(V+4):z}function U(z,V){return new Promise((D)=>{let W="";const J=(K)=>{try{z.destroy()}catch{}D(K)};z.setTimeout(F,()=>J({ok:!1,error:"代理请求超时"}));z.on("data",(K)=>{W+=K.toString("utf8")});z.on("end",()=>{try{const K=L(W),Q=K.indexOf("{"),X=K.lastIndexOf("}");if(Q<0||X<0)return J({ok:!1,error:"代理返回无法解析"});const Z=JSON.parse(K.slice(Q,X+1));if(Z.status!=="success")return J({ok:!1,error:Z.message||"出口探测失败"});J({ok:!0,ip:Z.query,country:Z.country,countryCode:Z.countryCode,city:Z.city,timezone:Z.timezone,locale:localeForCountry(Z.countryCode)})}catch(K){J({ok:!1,error:K instanceof Error?K.message:"解析失败"})}});z.on("error",(K)=>J({ok:!1,error:K.message}));z.write(V)})}function b(z){return new Promise((V)=>{const D=R.connect({host:z.host,port:z.port});D.setTimeout(F,()=>{try{D.destroy()}catch{}V({ok:!1,error:"连接代理超时"})});D.on("error",(W)=>V({ok:!1,error:`连接代理失败:${W.message}`}));D.on("connect",()=>{const W=z.username?`Proxy-Authorization: Basic ${Buffer.from(`${z.username}:${z.password??""}`).toString("base64")}\r
4
- `:"",J=`GET http://${$}${I} HTTP/1.1\r
5
- Host: ${$}\r
6
- ${W}Connection: close\r
3
+ `);return s>=0?e.slice(s+4):e}function p(e,s){return new Promise((t)=>{let c="";const r=(n)=>{try{e.destroy()}catch{}t(n)};e.setTimeout(a,()=>r({ok:!1,error:"代理请求超时"}));e.on("data",(n)=>{c+=n.toString("utf8")});e.on("end",()=>{try{const n=C(c),o=n.indexOf("{"),f=n.lastIndexOf("}");if(o<0||f<0)return r({ok:!1,error:"代理返回无法解析"});const u=JSON.parse(n.slice(o,f+1));if(u.status!=="success")return r({ok:!1,error:u.message||"出口探测失败"});r({ok:!0,ip:u.query,country:u.country,countryCode:u.countryCode,city:u.city,timezone:u.timezone,locale:localeForCountry(u.countryCode)})}catch(n){r({ok:!1,error:n instanceof Error?n.message:"解析失败"})}});e.on("error",(n)=>r({ok:!1,error:n.message}));e.write(s)})}function S(e){return new Promise((s)=>{const t=h.connect({host:e.host,port:e.port});t.setTimeout(a,()=>{try{t.destroy()}catch{}s({ok:!1,error:"连接代理超时"})});t.on("error",(c)=>s({ok:!1,error:`连接代理失败:${c.message}`}));t.on("connect",()=>{const c=e.username?`Proxy-Authorization: Basic ${Buffer.from(`${e.username}:${e.password??""}`).toString("base64")}\r
4
+ `:"",r=`GET http://${i}${l} HTTP/1.1\r
5
+ Host: ${i}\r
6
+ ${c}Connection: close\r
7
7
  \r
8
- `;U(D,J).then(V)})})}function q(z){return new Promise((V)=>{const D=R.connect({host:z.host,port:z.port});let W="greet";const J=(Q)=>{try{D.destroy()}catch{}V({ok:!1,error:Q})};D.setTimeout(F,()=>J("SOCKS5 代理超时"));D.on("error",(Q)=>J(`连接代理失败:${Q.message}`));D.on("connect",()=>{D.write(Buffer.from([5,2,0,2]))});const K=()=>{W="connect";const Q=Buffer.from($,"ascii"),X=Buffer.concat([Buffer.from([5,1,0,3,Q.length]),Q,Buffer.from([A>>8&255,A&255])]);D.write(X)};D.on("data",(Q)=>{if(W==="greet"){if(Q[0]!==5)return J("非 SOCKS5 代理");const X=Q[1];if(X===0)return K();if(X===2){if(!z.username)return J("代理要求账密但未提供");const Z=Buffer.from(z.username,"ascii"),Y=Buffer.from(z.password??"","ascii");W="auth";D.write(Buffer.concat([Buffer.from([1,Z.length]),Z,Buffer.from([Y.length]),Y]));return}return J("代理不支持所需认证方式")}if(W==="auth"){if(Q[1]!==0)return J("代理账密认证失败");return K()}if(W==="connect"){if(Q[1]!==0)return J(`SOCKS5 连接源站失败(code ${Q[1]})`);D.removeAllListeners("data");const X=`GET ${I} HTTP/1.1\r
9
- Host: ${$}\r
8
+ `;p(t,r).then(s)})})}function O(e){return new Promise((s)=>{const t=h.connect({host:e.host,port:e.port});let c="greet";const r=(o)=>{try{t.destroy()}catch{}s({ok:!1,error:o})};t.setTimeout(a,()=>r("SOCKS5 代理超时"));t.on("error",(o)=>r(`连接代理失败:${o.message}`));t.on("connect",()=>{t.write(Buffer.from([5,2,0,2]))});const n=()=>{c="connect";const o=Buffer.from(i,"ascii"),f=Buffer.concat([Buffer.from([5,1,0,3,o.length]),o,Buffer.from([d>>8&255,d&255])]);t.write(f)};t.on("data",(o)=>{if(c==="greet"){if(o[0]!==5)return r("非 SOCKS5 代理");const f=o[1];if(f===0)return n();if(f===2){if(!e.username)return r("代理要求账密但未提供");const u=Buffer.from(e.username,"ascii"),m=Buffer.from(e.password??"","ascii");c="auth";t.write(Buffer.concat([Buffer.from([1,u.length]),u,Buffer.from([m.length]),m]));return}return r("代理不支持所需认证方式")}if(c==="auth"){if(o[1]!==0)return r("代理账密认证失败");return n()}if(c==="connect"){if(o[1]!==0)return r(`SOCKS5 连接源站失败(code ${o[1]})`);t.removeAllListeners("data");const f=`GET ${l} HTTP/1.1\r
9
+ Host: ${i}\r
10
10
  Connection: close\r
11
11
  \r
12
- `;U(D,X).then(V)}})})}export function testProxy(z){if(z.scheme==="socks5")return q(z);return b(z)}export function parseProxyUrl(z){const V=z.trim(),D=/^(https?|socks5):\/\/(?:([^:@/]+)(?::([^@/]*))?@)?([^:/@]+):(\d+)\/?$/.exec(V);if(!D)throw Error("代理格式应为 scheme://[user:pass@]host:port(scheme = http/https/socks5)");const[,W,J,K,Q,X]=D;return{scheme:W,host:Q,port:Number(X),...J?{username:decodeURIComponent(J)}:{},...K?{password:decodeURIComponent(K)}:{}}}export function proxyServerFlag(z){return`${z.scheme==="socks5"?"socks5":z.scheme}://${z.host}:${z.port}`}
12
+ `;p(t,f).then(s)}})})}export function testProxy(e){if(e.scheme==="socks5")return O(e);return S(e)}export function parseProxyUrl(e){const s=e.trim(),t=/^(https?|socks5):\/\/(?:([^:@/]+)(?::([^@/]*))?@)?([^:/@]+):(\d+)\/?$/.exec(s);if(!t)throw Error("代理格式应为 scheme://[user:pass@]host:port(scheme = http/https/socks5)");const[,c,r,n,o,f]=t;return{scheme:c,host:o,port:Number(f),...r?{username:decodeURIComponent(r)}:{},...n?{password:decodeURIComponent(n)}:{}}}export function proxyServerFlag(e){return`${e.scheme==="socks5"?"socks5":e.scheme}://${e.host}:${e.port}`}
@@ -1 +1 @@
1
- export function parseFilter(k){if(typeof k!=="string")return{reason:"--filter value must be a non-empty comma-separated field list"};const C=k.split(",").map((B)=>B.trim()).filter((B)=>B.length>0);if(C.length===0)return{reason:`--filter value must be a non-empty comma-separated field list (got "${k}")`};const z=new Set,E=[];for(const B of C)if(!z.has(B)){z.add(B);E.push(B)}return{fields:E}}export function extractSegments(k){if(!k||k==="$")return[];const C=[];let z=k.startsWith("$")?1:0;while(z<k.length){const E=k[z];if(E==="."){z++;continue}if(E==="["){const G=k.indexOf("]",z);if(G===-1)break;const F=k.slice(z+1,G);z=G+1;if(F.length>=2&&F.startsWith('"')&&F.endsWith('"'))try{C.push(JSON.parse(F))}catch{C.push(F.slice(1,-1))}continue}let B=z;while(B<k.length&&k[B]!=="."&&k[B]!=="[")B++;C.push(k.slice(z,B));z=B}return C}export function collectShapeSegments(k){const C=new Set;for(const z of Object.keys(k))for(const E of extractSegments(z))C.add(E);return C}export function shapeMatchesFilter(k,C){if(C.length===0)return!0;const z=collectShapeSegments(k);for(const E of C)if(!z.has(E))return!1;return!0}
1
+ export function parseFilter(e){if(typeof e!=="string")return{reason:"--filter value must be a non-empty comma-separated field list"};const s=e.split(",").map((n)=>n.trim()).filter((n)=>n.length>0);if(s.length===0)return{reason:`--filter value must be a non-empty comma-separated field list (got "${e}")`};const t=new Set,r=[];for(const n of s)if(!t.has(n)){t.add(n);r.push(n)}return{fields:r}}export function extractSegments(e){if(!e||e==="$")return[];const s=[];let t=e.startsWith("$")?1:0;while(t<e.length){const r=e[t];if(r==="."){t++;continue}if(r==="["){const i=e.indexOf("]",t);if(i===-1)break;const o=e.slice(t+1,i);t=i+1;if(o.length>=2&&o.startsWith('"')&&o.endsWith('"'))try{s.push(JSON.parse(o))}catch{s.push(o.slice(1,-1))}continue}let n=t;while(n<e.length&&e[n]!=="."&&e[n]!=="[")n++;s.push(e.slice(t,n));t=n}return s}export function collectShapeSegments(e){const s=new Set;for(const t of Object.keys(e))for(const r of extractSegments(t))s.add(r);return s}export function shapeMatchesFilter(e,s){if(s.length===0)return!0;const t=collectShapeSegments(e);for(const r of s)if(!t.has(r))return!1;return!0}
@@ -1 +1 @@
1
- const _="$";export function inferShape(J,K={}){const U=K.maxDepth??6,V=K.maxBytes??2048,Y=K.sampleStringLen??80,M={};let W=2,H=!1;const C=(A,q)=>{if(H)return!1;const F=JSON.stringify(A).length+JSON.stringify(q).length+2;if(W+F>V){M["(truncated)"]=`reached ${V}B budget`;H=!0;return!1}M[A]=q;W+=F;return!0},N=(A,q,F)=>{if(H)return;if(A===null){C(q,"null");return}const E=typeof A;if(E==="string"){const G=A;C(q,G.length>Y?`string(len=${G.length})`:"string");return}if(E==="number"||E==="boolean"){C(q,E);return}if(E==="undefined"||E==="function"||E==="symbol"||E==="bigint"){C(q,E);return}if(Array.isArray(A)){if(A.length===0){C(q,"array(0)");return}if(F>=U){C(q,`array(${A.length})`);return}if(!C(q,`array(${A.length})`))return;N(A[0],`${q}[0]`,F+1);return}const X=A,Q=Object.keys(X);if(Q.length===0){C(q,"object(empty)");return}if(F>=U){C(q,`object(keys=${Q.length})`);return}if(!C(q,"object"))return;for(const G of Q){if(H)return;const Z=$(G)?`${q}.${G}`:`${q}[${JSON.stringify(G)}]`;N(X[G],Z,F+1)}};N(J,_,0);return M}function $(J){return/^[A-Za-z_$][\w$]*$/.test(J)}
1
+ const j="$";export function inferShape(f,l={}){const y=l.maxDepth??6,a=l.maxBytes??2048,S=l.sampleStringLen??80,c={};let b=2,u=!1;const n=(t,r)=>{if(u)return!1;const i=JSON.stringify(t).length+JSON.stringify(r).length+2;if(b+i>a){c["(truncated)"]=`reached ${a}B budget`;u=!0;return!1}c[t]=r;b+=i;return!0},g=(t,r,i)=>{if(u)return;if(t===null){n(r,"null");return}const e=typeof t;if(e==="string"){const s=t;n(r,s.length>S?`string(len=${s.length})`:"string");return}if(e==="number"||e==="boolean"){n(r,e);return}if(e==="undefined"||e==="function"||e==="symbol"||e==="bigint"){n(r,e);return}if(Array.isArray(t)){if(t.length===0){n(r,"array(0)");return}if(i>=y){n(r,`array(${t.length})`);return}if(!n(r,`array(${t.length})`))return;g(t[0],`${r}[0]`,i+1);return}const m=t,o=Object.keys(m);if(o.length===0){n(r,"object(empty)");return}if(i>=y){n(r,`object(keys=${o.length})`);return}if(!n(r,"object"))return;for(const s of o){if(u)return;const O=k(s)?`${r}.${s}`:`${r}[${JSON.stringify(s)}]`;g(m[s],O,i+1)}};g(f,j,0);return c}function k(f){return/^[A-Za-z_$][\w$]*$/.test(f)}
@@ -1,4 +1,4 @@
1
- let j;const k=`
1
+ let e;const t=`
2
2
  (function () {
3
3
  try {
4
4
  var _ep = EventTarget.prototype;
@@ -35,7 +35,7 @@ let j;const k=`
35
35
  }
36
36
  } catch (e) {}
37
37
  })();
38
- `;export function generateBeforeUnloadGuardJs(){return k}export function generateStealthJs(){if(j!==void 0)return j;return j=`
38
+ `;export function generateBeforeUnloadGuardJs(){return t}export function generateStealthJs(){if(e!==void 0)return e;return e=`
39
39
  (() => {
40
40
  // Guard: prevent double-injection across separate CDP evaluations.
41
41
  // We cannot use a closure variable (each eval is a fresh scope), and
@@ -384,7 +384,7 @@ let j;const k=`
384
384
  // so no dialog can ever open. Injected on every navigation, covering
385
385
  // post, reply, and reads uniformly; page.goto() also runs the same
386
386
  // snippet before navigating away to cover the current document.
387
- ${k}
387
+ ${t}
388
388
 
389
389
  return 'applied';
390
390
  })()
@@ -1,2 +1,2 @@
1
- export function extractTabEntries(q){if(Array.isArray(q))return q.map((j,p)=>({index:p,identity:[j?.id??"",j?.url??"",j?.title??"",j?.name??""].join("|")}));if(typeof q==="string")return q.split(`
2
- `).map((j)=>j.trim()).filter(Boolean).map((j)=>{const p=j.match(/^-\s+(\d+):\s*(.*)$/);if(p)return{index:parseInt(p[1],10),identity:p[2].trim()||`tab-${p[1]}`};const v=j.match(/Tab\s+(\d+)\s*(.*)$/);if(v)return{index:parseInt(v[1],10),identity:v[2].trim()||`tab-${v[1]}`};return null}).filter((j)=>j!==null);return[]}export function extractTabIdentities(q){return extractTabEntries(q).map((j)=>j.identity)}export function diffTabIndexes(q,j){if(q.length===0||j.length===0)return[];const p=new Map;for(const z of q)p.set(z,(p.get(z)??0)+1);const v=[];for(const z of j){const A=p.get(z.identity)??0;if(A>0){p.set(z.identity,A-1);continue}v.push(z.index)}return v.sort((z,A)=>A-z)}export function appendLimited(q,j,p){const v=q+j;if(v.length<=p)return v;return v.slice(-p)}
1
+ export function extractTabEntries(e){if(Array.isArray(e))return e.map((t,n)=>({index:n,identity:[t?.id??"",t?.url??"",t?.title??"",t?.name??""].join("|")}));if(typeof e==="string")return e.split(`
2
+ `).map((t)=>t.trim()).filter(Boolean).map((t)=>{const n=t.match(/^-\s+(\d+):\s*(.*)$/);if(n)return{index:parseInt(n[1],10),identity:n[2].trim()||`tab-${n[1]}`};const i=t.match(/Tab\s+(\d+)\s*(.*)$/);if(i)return{index:parseInt(i[1],10),identity:i[2].trim()||`tab-${i[1]}`};return null}).filter((t)=>t!==null);return[]}export function extractTabIdentities(e){return extractTabEntries(e).map((t)=>t.identity)}export function diffTabIndexes(e,t){if(e.length===0||t.length===0)return[];const n=new Map;for(const r of e)n.set(r,(n.get(r)??0)+1);const i=[];for(const r of t){const o=n.get(r.identity)??0;if(o>0){n.set(r.identity,o-1);continue}i.push(r.index)}return i.sort((r,o)=>o-r)}export function appendLimited(e,t,n){const i=e+t;if(i.length<=n)return i;return i.slice(-n)}
@@ -1 +1 @@
1
- export class TargetError extends Error{code;hint;candidates;matches_n;constructor(b){super(b.message);this.name="TargetError";this.code=b.code;this.hint=b.hint;this.candidates=b.candidates;this.matches_n=b.matches_n}toJSON(){return{code:this.code,message:this.message,hint:this.hint,...this.candidates&&{candidates:this.candidates},...this.matches_n!==void 0&&{matches_n:this.matches_n}}}}
1
+ export class TargetError extends Error{code;hint;candidates;matches_n;constructor(t){super(t.message);this.name="TargetError";this.code=t.code;this.hint=t.hint;this.candidates=t.candidates;this.matches_n=t.matches_n}toJSON(){return{code:this.code,message:this.message,hint:this.hint,...this.candidates&&{candidates:this.candidates},...this.matches_n!==void 0&&{matches_n:this.matches_n}}}}
@@ -1,8 +1,8 @@
1
- export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void 0?String(g.nth|0):"null",y=g.firstOnMulti===!0?"true":"false";return`
1
+ export function resolveTargetJs(t,e={}){const r=JSON.stringify(t),n=e.nth!==void 0?String(e.nth|0):"null",o=e.firstOnMulti===!0?"true":"false";return`
2
2
  (() => {
3
- const ref = ${q};
4
- const nth = ${w};
5
- const firstOnMulti = ${y};
3
+ const ref = ${r};
4
+ const nth = ${n};
5
+ const firstOnMulti = ${o};
6
6
  const identity = window.__opencli_ref_identity || {};
7
7
 
8
8
  // ── Classify input ──
@@ -215,13 +215,13 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
215
215
  return { ok: true, matches_n: matches.length, match_level: 'exact' };
216
216
  }
217
217
  })()
218
- `}export function boundingRectResolvedJs(j={}){const g=j.skipScroll?"false":"true",q=j.forClick?"true":"false";return`
218
+ `}export function boundingRectResolvedJs(t={}){const e=t.skipScroll?"false":"true",r=t.forClick?"true":"false";return`
219
219
  (() => {
220
220
  const el = window.__resolved;
221
221
  if (!el) throw new Error('No resolved element');
222
- if (${g}) el.scrollIntoView({ behavior: 'instant', block: 'center' });
222
+ if (${e}) el.scrollIntoView({ behavior: 'instant', block: 'center' });
223
223
 
224
- const FOR_CLICK = ${q};
224
+ const FOR_CLICK = ${r};
225
225
  // hover()/dblClick() want the plain element centre — the retarget + hit-test
226
226
  // below are click-only so those actions keep their original behaviour.
227
227
  if (!FOR_CLICK) {
@@ -322,11 +322,11 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
322
322
  }
323
323
  return { x, y, w, h, visible, hit, retargeted };
324
324
  })()
325
- `}export function clickResolvedJs(j={}){return`
325
+ `}export function clickResolvedJs(t={}){return`
326
326
  (() => {
327
327
  const el = window.__resolved;
328
328
  if (!el) throw new Error('No resolved element');
329
- if (${j.skipScroll?"false":"true"}) el.scrollIntoView({ behavior: 'instant', block: 'center' });
329
+ if (${t.skipScroll?"false":"true"}) el.scrollIntoView({ behavior: 'instant', block: 'center' });
330
330
  const rect = el.getBoundingClientRect();
331
331
  const x = Math.round(rect.left + rect.width / 2);
332
332
  const y = Math.round(rect.top + rect.height / 2);
@@ -337,7 +337,7 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
337
337
  return { status: 'js_failed', x, y, w: Math.round(rect.width), h: Math.round(rect.height), error: e.message };
338
338
  }
339
339
  })()
340
- `}export function typeResolvedJs(j){const g=JSON.stringify(j);return`
340
+ `}export function typeResolvedJs(t){const e=JSON.stringify(t);return`
341
341
  (() => {
342
342
  const el = window.__resolved;
343
343
  if (!el) throw new Error('No resolved element');
@@ -349,7 +349,7 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
349
349
  sel.removeAllRanges();
350
350
  sel.addRange(range);
351
351
  document.execCommand('delete', false);
352
- document.execCommand('insertText', false, ${g});
352
+ document.execCommand('insertText', false, ${e});
353
353
  el.dispatchEvent(new Event('input', { bubbles: true }));
354
354
  } else {
355
355
  const proto = el instanceof HTMLTextAreaElement
@@ -357,16 +357,16 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
357
357
  : HTMLInputElement.prototype;
358
358
  const nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value')?.set;
359
359
  if (nativeSetter) {
360
- nativeSetter.call(el, ${g});
360
+ nativeSetter.call(el, ${e});
361
361
  } else {
362
- el.value = ${g};
362
+ el.value = ${e};
363
363
  }
364
364
  el.dispatchEvent(new Event('input', { bubbles: true }));
365
365
  el.dispatchEvent(new Event('change', { bubbles: true }));
366
366
  }
367
367
  return 'typed';
368
368
  })()
369
- `}export function prepareNativeTypeResolvedJs(j={}){const g=j.skipScroll?"false":"true",q=j.skipFocus?"false":"true";return`
369
+ `}export function prepareNativeTypeResolvedJs(t={}){const e=t.skipScroll?"false":"true",r=t.skipFocus?"false":"true";return`
370
370
  (() => {
371
371
  const original = window.__resolved;
372
372
  if (!original) throw new Error('No resolved element');
@@ -396,8 +396,8 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
396
396
  }
397
397
 
398
398
  window.__resolved = el;
399
- if (${g}) el.scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' });
400
- if (${q}) {
399
+ if (${e}) el.scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' });
400
+ if (${r}) {
401
401
  try {
402
402
  el.focus({ preventScroll: true });
403
403
  } catch (_) {
@@ -433,7 +433,7 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
433
433
  ? { ok: true, mode: isTextarea ? 'textarea' : 'input' }
434
434
  : { ok: false, reason: 'selection_unavailable', mode: isTextarea ? 'textarea' : 'input' };
435
435
  })()
436
- `}export function verifyFilledResolvedJs(j){const g=JSON.stringify(j);return`
436
+ `}export function verifyFilledResolvedJs(t){const e=JSON.stringify(t);return`
437
437
  (() => {
438
438
  const el = window.__resolved;
439
439
  if (!el) return { ok: false, reason: 'no_resolved_element' };
@@ -460,18 +460,18 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
460
460
 
461
461
  const actual = mode === 'contenteditable' ? (el.innerText || '') : String(el.value || '');
462
462
  return {
463
- ok: actual === ${g},
463
+ ok: actual === ${e},
464
464
  actual,
465
- expected: ${g},
465
+ expected: ${e},
466
466
  length: actual.length,
467
467
  mode,
468
468
  };
469
469
  })()
470
- `}export function scrollResolvedJs(j={}){return`
470
+ `}export function scrollResolvedJs(t={}){return`
471
471
  (() => {
472
472
  const el = window.__resolved;
473
473
  if (!el) throw new Error('No resolved element');
474
- if (${j.skipScroll?"false":"true"}) el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' });
474
+ if (${t.skipScroll?"false":"true"}) el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' });
475
475
  return { scrolled: true, tag: el.tagName.toLowerCase(), text: (el.textContent || '').trim().slice(0, 80) };
476
476
  })()
477
477
  `}export function getTextResolvedJs(){return`
@@ -492,12 +492,12 @@ export function resolveTargetJs(j,g={}){const q=JSON.stringify(j),w=g.nth!==void
492
492
  if (!el) throw new Error('No resolved element');
493
493
  return JSON.stringify(Object.fromEntries([...el.attributes].map(a => [a.name, a.value])));
494
494
  })()
495
- `}export function selectResolvedJs(j){const g=JSON.stringify(j);return`
495
+ `}export function selectResolvedJs(t){const e=JSON.stringify(t);return`
496
496
  (() => {
497
497
  const el = window.__resolved;
498
498
  if (!el) throw new Error('No resolved element');
499
499
  if (el.tagName !== 'SELECT') return { error: 'Not a <select>' };
500
- const match = Array.from(el.options).find(o => o.text.trim() === ${g} || o.value === ${g});
500
+ const match = Array.from(el.options).find(o => o.text.trim() === ${e} || o.value === ${e});
501
501
  if (!match) return { error: 'Option not found', available: Array.from(el.options).map(o => o.text.trim()) };
502
502
  const setter = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, 'value')?.set;
503
503
  if (setter) setter.call(el, match.value); else el.value = match.value;
@@ -1,2 +1,2 @@
1
- import{appendFileSync as N}from"node:fs";import{log as O}from"../logger.js";const H=process.env.OPENCLI_BROWSER_TRACE_FILE?.trim(),B=!!H;let J=!1;function G(q){if(!B)return;try{N(H,JSON.stringify({t:Date.now(),...q})+`
2
- `)}catch(z){if(!J){J=!0;O.warn(`[trace] failed to write browser trace to ${H}: ${z instanceof Error?z.message:String(z)} (further trace errors suppressed)`)}}}function Q(q,z){if(q!=="navigate"||typeof z!=="string"||!z)return;try{const D=new URL(z);return D.origin+D.pathname}catch{return}}export function traceDispatch(q){if(!B)return;G({ev:"dispatch",id:typeof q.id==="string"?q.id:void 0,action:typeof q.action==="string"?q.action:"unknown",ctx:typeof q.contextId==="string"?q.contextId:void 0,session:typeof q.session==="string"?q.session:void 0,surface:typeof q.surface==="string"?q.surface:void 0,url:Q(q.action,q.url)})}export function traceResult(q,z,D,K,M){if(!B)return;G({ev:"result",id:q,ok:z,ms:D,errorCode:K,page:M})}export function traceTimeout(q,z,D){if(!B)return;G({ev:"timeout",id:q,ms:z,action:D})}export function traceExtConnect(q,z){if(!B)return;G({ev:"ext-connect",ctx:q,extVersion:z??void 0})}export function traceExtDisconnect(q){if(!B)return;G({ev:"ext-disconnect",ctx:q})}export function traceExtLog(q,z){if(!B)return;G({ev:"ext-log",level:q,msg:z})}
1
+ import{appendFileSync as u}from"node:fs";import{log as a}from"../logger.js";const c=process.env.OPENCLI_BROWSER_TRACE_FILE?.trim(),n=!!c;let o=!1;function i(e){if(!n)return;try{u(c,JSON.stringify({t:Date.now(),...e})+`
2
+ `)}catch(t){if(!o){o=!0;a.warn(`[trace] failed to write browser trace to ${c}: ${t instanceof Error?t.message:String(t)} (further trace errors suppressed)`)}}}function p(e,t){if(e!=="navigate"||typeof t!=="string"||!t)return;try{const r=new URL(t);return r.origin+r.pathname}catch{return}}export function traceDispatch(e){if(!n)return;i({ev:"dispatch",id:typeof e.id==="string"?e.id:void 0,action:typeof e.action==="string"?e.action:"unknown",ctx:typeof e.contextId==="string"?e.contextId:void 0,session:typeof e.session==="string"?e.session:void 0,surface:typeof e.surface==="string"?e.surface:void 0,url:p(e.action,e.url)})}export function traceResult(e,t,r,f,s){if(!n)return;i({ev:"result",id:e,ok:t,ms:r,errorCode:f,page:s})}export function traceTimeout(e,t,r){if(!n)return;i({ev:"timeout",id:e,ms:t,action:r})}export function traceExtConnect(e,t){if(!n)return;i({ev:"ext-connect",ctx:e,extVersion:t??void 0})}export function traceExtDisconnect(e){if(!n)return;i({ev:"ext-disconnect",ctx:e})}export function traceExtLog(e,t){if(!n)return;i({ev:"ext-log",level:e,msg:t})}
@@ -1 +1 @@
1
- function G(q){return q instanceof Error?q.message:String(q)}export function serializeFunctionForEval(q,k=[]){const B=q.toString().trim();if(!(/^(async\s+)?function[\s(]/.test(B)||/^(async\s*)?(\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>/.test(B))||B.includes("[native code]"))throw Error("page.evaluate(fn) requires a serializable arrow/function expression");let C;try{C=JSON.stringify(k)}catch(D){throw Error(`page.evaluate arguments must be JSON-serializable: ${G(D)}`)}if(C===void 0)throw Error("page.evaluate arguments must be JSON-serializable");return`(${B})(...${C})`}export function wrapForEval(q){if(typeof q!=="string")return"undefined";const k=q.trim();if(!k)return"undefined";if(/^\([\s\S]*\)\s*\(.*\)\s*$/.test(k))return k;if(/^(async\s+)?(\([^)]*\)|[A-Za-z_]\w*)\s*=>/.test(k))return`(${k})()`;if(/^(async\s+)?function[\s(]/.test(k))return`(${k})()`;return k}export function buildEvaluateExpression(q,k=[]){if(typeof q==="function")return serializeFunctionForEval(q,k);if(k.length>0)throw Error("page.evaluate string input does not accept args; use page.evaluate(fn, ...args) instead");return wrapForEval(q)}
1
+ function i(r){return r instanceof Error?r.message:String(r)}export function serializeFunctionForEval(r,e=[]){const t=r.toString().trim();if(!(/^(async\s+)?function[\s(]/.test(t)||/^(async\s*)?(\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>/.test(t))||t.includes("[native code]"))throw Error("page.evaluate(fn) requires a serializable arrow/function expression");let n;try{n=JSON.stringify(e)}catch(s){throw Error(`page.evaluate arguments must be JSON-serializable: ${i(s)}`)}if(n===void 0)throw Error("page.evaluate arguments must be JSON-serializable");return`(${t})(...${n})`}export function wrapForEval(r){if(typeof r!=="string")return"undefined";const e=r.trim();if(!e)return"undefined";if(/^\([\s\S]*\)\s*\(.*\)\s*$/.test(e))return e;if(/^(async\s+)?(\([^)]*\)|[A-Za-z_]\w*)\s*=>/.test(e))return`(${e})()`;if(/^(async\s+)?function[\s(]/.test(e))return`(${e})()`;return e}export function buildEvaluateExpression(r,e=[]){if(typeof r==="function")return serializeFunctionForEval(r,e);if(e.length>0)throw Error("page.evaluate string input does not accept args; use page.evaluate(fn, ...args) instead");return wrapForEval(r)}
@@ -1,2 +1,2 @@
1
- import*as O from"node:fs";import*as b from"node:os";import*as M from"node:path";const I=12,K=1,S=[/^id$/i,/_id$/i,/Id$/,/^short_id$/i,/^bvid$/i,/^aid$/i,/^tid$/i,/^asin$/i,/^sku$/i,/^isbn$/i,/^doi$/i,/^slug$/i,/^hn_id$/i,/^username$/i,/^handle$/i,/^uri$/i];export function fixturePath(z,G){return M.join(b.homedir(),".ppcli","sites",z,"verify",`${G}.json`)}export function loadFixture(z,G){const q=fixturePath(z,G);if(!O.existsSync(q))return null;try{const B=O.readFileSync(q,"utf-8");return JSON.parse(B)}catch(B){throw Error(`Failed to parse fixture ${q}: ${B instanceof Error?B.message:String(B)}`)}}export function writeFixture(z,G,q){const B=fixturePath(z,G);O.mkdirSync(M.dirname(B),{recursive:!0});O.writeFileSync(B,`${JSON.stringify(q,null,2)}
2
- `,"utf-8");return B}export function deriveFixture(z,G){const q={};if(z.length===0){q.rowCount={min:0};return{...G?{args:G}:{},expect:q}}q.rowCount={min:1};const B=z[0],Z=Object.keys(B);q.columns=Z;const R={};for(const V of Z){const F=new Set;for(const H of z){const Q=H[V];F.add(j(Q))}R[V]=[...F].sort().join("|")}q.types=R;return{...G?{args:G}:{},expect:q}}export function validateRows(z,G){const q=[],B=G.expect;if(!B)return q;if(B.rowCount){const{min:Q,max:W}=B.rowCount;if(typeof Q==="number"&&z.length<Q)q.push({rule:"rowCount",detail:`got ${z.length} rows, expected at least ${Q}`});if(typeof W==="number"&&z.length>W)q.push({rule:"rowCount",detail:`got ${z.length} rows, expected at most ${W}`})}const Z=B.columns??[],R=B.types??{},V=B.patterns??{},F=B.notEmpty??[],H={};for(const[Q,W]of Object.entries(V))try{H[Q]=new RegExp(W)}catch(J){q.push({rule:"pattern",detail:`pattern for "${Q}" invalid: ${J instanceof Error?J.message:String(J)}`})}z.forEach((Q,W)=>{for(const J of Z)if(!(J in Q))q.push({rule:"column",detail:`missing column "${J}"`,rowIndex:W});for(const[J,$]of Object.entries(R)){if(!(J in Q))continue;const C=j(Q[J]);if(!A(C,$))q.push({rule:"type",detail:`"${J}" is ${C}, expected ${$}`,rowIndex:W})}for(const[J,$]of Object.entries(H)){if(!(J in Q))continue;const C=Q[J];if(C===null||C===void 0)continue;if(!$.test(String(C)))q.push({rule:"pattern",detail:`"${J}"=${JSON.stringify(String(C).slice(0,60))} does not match /${$.source}/`,rowIndex:W})}for(const J of F){const $=Q[J];if($===null||$===void 0||String($).trim()==="")q.push({rule:"notEmpty",detail:`"${J}" is empty`,rowIndex:W})}for(const[J,$]of Object.entries(B.mustNotContain??{})){if(!(J in Q))continue;const C=Q[J];if(C===null||C===void 0)continue;const N=String(C);for(const Y of $)if(N.includes(Y))q.push({rule:"mustNotContain",detail:`"${J}" contains forbidden substring ${JSON.stringify(Y)}`,rowIndex:W})}for(const J of B.mustBeTruthy??[]){if(!(J in Q))continue;if(!Q[J])q.push({rule:"mustBeTruthy",detail:`"${J}" is falsy (${JSON.stringify(Q[J])}) — likely silent fallback`,rowIndex:W})}});return q}export function validateRowShape(z,G={}){const q=[],B=G.maxTopLevelKeys??I,Z=G.maxNestedDepth??K;z.forEach((R,V)=>{const F=Object.keys(R);if(F.length>B)q.push({rule:"shapeKeyCount",detail:`row has ${F.length} top-level keys, expected at most ${B}`,rowIndex:V});for(const[H,Q]of Object.entries(R)){const W=U(Q);if(W>Z)q.push({rule:"shapeDepth",detail:`"${H}" nesting depth is ${W}, expected at most ${Z}`,rowIndex:V});for(const J of X(Q,H))q.push({rule:"shapeNestedId",detail:`id-shaped field "${J}" must be a top-level row key`,rowIndex:V})}});return q}export function expandFixtureArgs(z){if(!z)return[];if(Array.isArray(z))return z.map((q)=>String(q));const G=[];for(const[q,B]of Object.entries(z))G.push(`--${q}`,String(B));return G}export function parseSeedArgs(z){if(z===void 0)return;const G=z.trim();if(!G)return;try{const q=JSON.parse(G);if(Array.isArray(q))return q;if(q!==null&&typeof q==="object")return q;return[q]}catch{return[z]}}function j(z){if(z===null)return"null";if(Array.isArray(z))return"array";return typeof z}function U(z){if(z===null||z===void 0||typeof z!=="object")return 0;if(Array.isArray(z)){if(z.length===0)return 1;return 1+Math.max(...z.map(U))}const G=Object.values(z);if(G.length===0)return 1;return 1+Math.max(...G.map(U))}function X(z,G){if(z===null||z===void 0||typeof z!=="object")return[];const q=[];if(Array.isArray(z)){z.forEach((B,Z)=>{q.push(...X(B,`${G}[${Z}]`))});return q}for(const[B,Z]of Object.entries(z)){const R=`${G}.${B}`;if(L(B))q.push(R);q.push(...X(Z,R))}return q}function L(z){return S.some((G)=>G.test(z))}function A(z,G){const q=G.split("|").map((B)=>B.trim()).filter(Boolean);if(q.length===0)return!0;if(q.includes("any"))return!0;return q.includes(z)}
1
+ import*as h from"node:fs";import*as E from"node:os";import*as g from"node:path";const A=12,j=1,O=[/^id$/i,/_id$/i,/Id$/,/^short_id$/i,/^bvid$/i,/^aid$/i,/^tid$/i,/^asin$/i,/^sku$/i,/^isbn$/i,/^doi$/i,/^slug$/i,/^hn_id$/i,/^username$/i,/^handle$/i,/^uri$/i];export function fixturePath(e,r){return g.join(E.homedir(),".ppcli","sites",e,"verify",`${r}.json`)}export function loadFixture(e,r){const t=fixturePath(e,r);if(!h.existsSync(t))return null;try{const n=h.readFileSync(t,"utf-8");return JSON.parse(n)}catch(n){throw Error(`Failed to parse fixture ${t}: ${n instanceof Error?n.message:String(n)}`)}}export function writeFixture(e,r,t){const n=fixturePath(e,r);h.mkdirSync(g.dirname(n),{recursive:!0});h.writeFileSync(n,`${JSON.stringify(t,null,2)}
2
+ `,"utf-8");return n}export function deriveFixture(e,r){const t={};if(e.length===0){t.rowCount={min:0};return{...r?{args:r}:{},expect:t}}t.rowCount={min:1};const n=e[0],c=Object.keys(n);t.columns=c;const l={};for(const a of c){const d=new Set;for(const p of e){const i=p[a];d.add(S(i))}l[a]=[...d].sort().join("|")}t.types=l;return{...r?{args:r}:{},expect:t}}export function validateRows(e,r){const t=[],n=r.expect;if(!n)return t;if(n.rowCount){const{min:i,max:s}=n.rowCount;if(typeof i==="number"&&e.length<i)t.push({rule:"rowCount",detail:`got ${e.length} rows, expected at least ${i}`});if(typeof s==="number"&&e.length>s)t.push({rule:"rowCount",detail:`got ${e.length} rows, expected at most ${s}`})}const c=n.columns??[],l=n.types??{},a=n.patterns??{},d=n.notEmpty??[],p={};for(const[i,s]of Object.entries(a))try{p[i]=new RegExp(s)}catch(o){t.push({rule:"pattern",detail:`pattern for "${i}" invalid: ${o instanceof Error?o.message:String(o)}`})}e.forEach((i,s)=>{for(const o of c)if(!(o in i))t.push({rule:"column",detail:`missing column "${o}"`,rowIndex:s});for(const[o,u]of Object.entries(l)){if(!(o in i))continue;const f=S(i[o]);if(!k(f,u))t.push({rule:"type",detail:`"${o}" is ${f}, expected ${u}`,rowIndex:s})}for(const[o,u]of Object.entries(p)){if(!(o in i))continue;const f=i[o];if(f===null||f===void 0)continue;if(!u.test(String(f)))t.push({rule:"pattern",detail:`"${o}"=${JSON.stringify(String(f).slice(0,60))} does not match /${u.source}/`,rowIndex:s})}for(const o of d){const u=i[o];if(u===null||u===void 0||String(u).trim()==="")t.push({rule:"notEmpty",detail:`"${o}" is empty`,rowIndex:s})}for(const[o,u]of Object.entries(n.mustNotContain??{})){if(!(o in i))continue;const f=i[o];if(f===null||f===void 0)continue;const b=String(f);for(const x of u)if(b.includes(x))t.push({rule:"mustNotContain",detail:`"${o}" contains forbidden substring ${JSON.stringify(x)}`,rowIndex:s})}for(const o of n.mustBeTruthy??[]){if(!(o in i))continue;if(!i[o])t.push({rule:"mustBeTruthy",detail:`"${o}" is falsy (${JSON.stringify(i[o])}) — likely silent fallback`,rowIndex:s})}});return t}export function validateRowShape(e,r={}){const t=[],n=r.maxTopLevelKeys??A,c=r.maxNestedDepth??j;e.forEach((l,a)=>{const d=Object.keys(l);if(d.length>n)t.push({rule:"shapeKeyCount",detail:`row has ${d.length} top-level keys, expected at most ${n}`,rowIndex:a});for(const[p,i]of Object.entries(l)){const s=y(i);if(s>c)t.push({rule:"shapeDepth",detail:`"${p}" nesting depth is ${s}, expected at most ${c}`,rowIndex:a});for(const o of m(i,p))t.push({rule:"shapeNestedId",detail:`id-shaped field "${o}" must be a top-level row key`,rowIndex:a})}});return t}export function expandFixtureArgs(e){if(!e)return[];if(Array.isArray(e))return e.map((t)=>String(t));const r=[];for(const[t,n]of Object.entries(e))r.push(`--${t}`,String(n));return r}export function parseSeedArgs(e){if(e===void 0)return;const r=e.trim();if(!r)return;try{const t=JSON.parse(r);if(Array.isArray(t))return t;if(t!==null&&typeof t==="object")return t;return[t]}catch{return[e]}}function S(e){if(e===null)return"null";if(Array.isArray(e))return"array";return typeof e}function y(e){if(e===null||e===void 0||typeof e!=="object")return 0;if(Array.isArray(e)){if(e.length===0)return 1;return 1+Math.max(...e.map(y))}const r=Object.values(e);if(r.length===0)return 1;return 1+Math.max(...r.map(y))}function m(e,r){if(e===null||e===void 0||typeof e!=="object")return[];const t=[];if(Array.isArray(e)){e.forEach((n,c)=>{t.push(...m(n,`${r}[${c}]`))});return t}for(const[n,c]of Object.entries(e)){const l=`${r}.${n}`;if(I(n))t.push(l);t.push(...m(c,l))}return t}function I(e){return O.some((r)=>r.test(e))}function k(e,r){const t=r.split("|").map((n)=>n.trim()).filter(Boolean);if(t.length===0)return!0;if(t.includes("any"))return!0;return t.includes(e)}
@@ -1 +1 @@
1
- import{openSync as q,closeSync as H,writeSync as b,readFileSync as j,unlinkSync as Y,statSync as v,mkdirSync as D,utimesSync as Q}from"node:fs";import{join as N}from"node:path";import{homedir as F}from"node:os";const V=N(F(),".ppcli"),Z=N(V,"browser-adapter-session.lock");function m(z){if(!z)return Z;const x=z.replace(/[^A-Za-z0-9_-]/g,"_");return N(V,`browser-adapter-session.${x}.lock`)}const W=180000,$=600000,u=60;function w(z){return new Promise((x)=>setTimeout(x,z))}function K(z){try{process.kill(z,0);return!0}catch(x){return x?.code==="EPERM"}}function U(z){try{const x=parseInt(j(z,"utf8").trim(),10);return Number.isFinite(x)?x:null}catch{return null}}function g(z){try{const x=q(z,"wx");try{b(x,String(process.pid))}finally{H(x)}return!0}catch(x){if(x?.code==="EEXIST")return!1;throw x}}function C(z){try{const x=U(z),G=Date.now()-v(z).mtimeMs;if(x!==null&&!K(x)||G>$)Y(z)}catch{}}export async function withBrowserSessionLock(z,x){try{D(V,{recursive:!0})}catch{}const G=m(x),B=Date.now()+W;while(!g(G)){C(G);if(g(G))break;if(Date.now()>=B)throw Error(`browser session lock busy: waited ${Math.round(W/1000)}s for another browser command to finish`);await w(u)}const J=setInterval(()=>{try{const X=new Date;Q(G,X,X)}catch{}},60000);if(typeof J.unref==="function")J.unref();try{return await z()}finally{clearInterval(J);try{Y(G)}catch{}}}export async function withBrowserSessionLockIf(z,x,G){return z?withBrowserSessionLock(x,G):x()}export const __lockInternals={LOCK_PATH:Z,ACQUIRE_TIMEOUT_MS:W,STALE_AFTER_MS:$};
1
+ import{openSync as w,closeSync as p,writeSync as d,readFileSync as h,unlinkSync as a,statSync as m,mkdirSync as S,utimesSync as _}from"node:fs";import{join as o}from"node:path";import{homedir as k}from"node:os";const c=o(k(),".ppcli"),u=o(c,"browser-adapter-session.lock");function E(r){if(!r)return u;const t=r.replace(/[^A-Za-z0-9_-]/g,"_");return o(c,`browser-adapter-session.${t}.lock`)}const i=180000,l=600000,I=60;function L(r){return new Promise((t)=>setTimeout(t,r))}function b(r){try{process.kill(r,0);return!0}catch(t){return t?.code==="EPERM"}}function A(r){try{const t=parseInt(h(r,"utf8").trim(),10);return Number.isFinite(t)?t:null}catch{return null}}function f(r){try{const t=w(r,"wx");try{d(t,String(process.pid))}finally{p(t)}return!0}catch(t){if(t?.code==="EEXIST")return!1;throw t}}function M(r){try{const t=A(r),n=Date.now()-m(r).mtimeMs;if(t!==null&&!b(t)||n>l)a(r)}catch{}}export async function withBrowserSessionLock(r,t){try{S(c,{recursive:!0})}catch{}const n=E(t),y=Date.now()+i;while(!f(n)){M(n);if(f(n))break;if(Date.now()>=y)throw Error(`browser session lock busy: waited ${Math.round(i/1000)}s for another browser command to finish`);await L(I)}const e=setInterval(()=>{try{const s=new Date;_(n,s,s)}catch{}},60000);if(typeof e.unref==="function")e.unref();try{return await r()}finally{clearInterval(e);try{a(n)}catch{}}}export async function withBrowserSessionLockIf(r,t,n){return r?withBrowserSessionLock(t,n):t()}export const __lockInternals={LOCK_PATH:u,ACQUIRE_TIMEOUT_MS:i,STALE_AFTER_MS:l};
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import*as V from"node:fs";import*as $ from"node:path";import{fileURLToPath as A,pathToFileURL as L}from"node:url";import{getErrorMessage as O}from"./errors.js";import{fullName as C,getRegistry as b}from"./registry.js";import{findPackageRoot as k,getCliManifestPath as E}from"./package-paths.js";import{isRecord as U}from"./utils.js";const j=k(A(import.meta.url)),w=$.join(j,"clis"),H=E(w),I=/\bcli\s*\(|\bregisterSiteAuthCommands\s*\(|\bregisterArticleLogin\s*\(|\bregisterTokenAuth\s*\(|\bmake[A-Z]\w*Command\s*\(/;export class ManifestImportError extends Error{filePath;cause;constructor(q,J){super(`failed to scan ${q}: ${O(J)}`);this.filePath=q;this.cause=J;this.name="ManifestImportError"}}function T(q){return q.map((J)=>({name:J.name,type:J.type??"str",default:J.default,required:!!J.required,valueRequired:!!J.valueRequired||void 0,positional:J.positional||void 0,help:J.help??"",choices:J.choices,fromFile:J.fromFile||void 0,requiredUnlessFile:J.requiredUnlessFile||void 0,generatedFileFor:J.generatedFileFor||void 0}))}function D(q,J){const W=$.basename(q,$.extname(q));return`${J}/${W}.js`}export function normalizeManifestPath(q){return q.replace(/\\/g,"/")}function M(q,J){return normalizeManifestPath($.relative(J,q))}function y(q,J){return U(q)&&typeof q.site==="string"&&q.site===J&&typeof q.name==="string"&&(q.access==="read"||q.access==="write")&&Array.isArray(q.args)}function R(q,J,W){return{site:q.site,name:q.name,aliases:q.aliases,description:q.description??"",access:q.access,example:q.example,domain:q.domain,strategy:(q.strategy??"public").toString().toLowerCase(),browser:q.browser??!0,args:T(q.args),columns:q.columns,defaultFormat:q.defaultFormat,type:"js",modulePath:J,sourceFile:W,navigateBefore:q.navigateBefore,siteSession:q.siteSession,defaultWindowMode:q.defaultWindowMode}}export async function loadManifestEntries(q,J,W=(G)=>import(G),X=w){let G;try{G=V.readFileSync(q,"utf-8")}catch(Q){throw new ManifestImportError(q,Q)}if(!I.test(G))return[];try{const Q=D(q,J),Y=b(),Z=new Map(Y.entries()),F=await W(L(q).href),z=Object.values(U(F)?F:{}).filter((B)=>y(B,J)),N=z.length>0?z:[...Y.entries()].filter(([B,S])=>{if(S.site!==J)return!1;const x=Z.get(B);return!x||x!==S}).map(([,B])=>B),K=M(q,X),_=new Set;return N.filter((B)=>{const S=C(B);if(_.has(S))return!1;_.add(S);return!0}).sort((B,S)=>B.name.localeCompare(S.name)).map((B)=>R(B,Q,K))}catch(Q){throw new ManifestImportError(q,Q)}}export async function scanClisDir(q,J=(W)=>import(W)){const W=new Map,X=[];if(!V.existsSync(q))return{entries:[],failures:X};for(const Q of V.readdirSync(q)){const Y=$.join(q,Q);if(!V.statSync(Y).isDirectory())continue;for(const Z of V.readdirSync(Y))if(Z.endsWith(".js")&&!Z.endsWith(".d.js")&&!Z.endsWith(".test.js")&&Z!=="index.js"){const F=$.join(Y,Z);try{const z=await loadManifestEntries(F,Q,J,q);for(const N of z){const K=`${N.site}/${N.name}`;W.set(K,N)}}catch(z){if(z instanceof ManifestImportError){X.push(z);continue}throw z}}}return{entries:[...W.values()].sort((Q,Y)=>Q.site.localeCompare(Y.site)||Q.name.localeCompare(Y.name)),failures:X}}export async function buildManifest(){return scanClisDir(w)}export function serializeManifest(q){return`${JSON.stringify(q,null,2)}
3
- `}export function findManifestMetadataIssues(q){const J=[];for(const W of q){if(!Array.isArray(W.args))continue;for(const X of W.args){if(!X.positional)continue;if((typeof X.help==="string"?X.help.trim():"")==="")J.push({site:W.site,command:W.name,arg:X.name,sourceFile:W.sourceFile,reason:"positional arg missing non-empty `help` text"})}}return J}export function diffRemovedEntries(q,J){const W=new Set(J.map((X)=>`${X.site}/${X.name}`));return q.map((X)=>`${X.site}/${X.name}`).filter((X)=>!W.has(X)).sort()}export function parseBuildManifestArgs(q){let J=0;for(const W of q){if(W==="--allow-removals"){J=Number.POSITIVE_INFINITY;continue}const X=W.match(/^--allow-removals=(\d+)$/);if(X){J=Number.parseInt(X[1],10);continue}}return{allowRemovals:J}}function v(q){try{if(!V.existsSync(q))return null;const J=V.readFileSync(q,"utf-8"),W=JSON.parse(J);return Array.isArray(W)?W:null}catch{return null}}async function p(){if(A(import.meta.url).includes(`${$.sep}dist${$.sep}`)){process.stderr.write(`❌ Refusing to run build-manifest from dist/.
4
- `+" Stale compiled output silently drops adapters that import renamed/removed exports.\n Run `npm run build-manifest` (or `tsx src/build-manifest.ts`) from the source tree instead.\n");process.exit(1)}const q=parseBuildManifestArgs(process.argv.slice(2)),{entries:J,failures:W}=await buildManifest();if(W.length>0){process.stderr.write(`❌ ${W.length} adapter(s) failed to load:
5
- `);for(const Q of W){const Y=$.relative(j,Q.filePath)||Q.filePath;process.stderr.write(` - ${Y}: ${O(Q.cause)}
2
+ import*as c from"node:fs";import*as a from"node:path";import{fileURLToPath as x,pathToFileURL as S}from"node:url";import{getErrorMessage as F}from"./errors.js";import{fullName as R,getRegistry as A}from"./registry.js";import{findPackageRoot as C,getCliManifestPath as j}from"./package-paths.js";import{isRecord as M}from"./utils.js";const y=C(x(import.meta.url)),w=a.join(y,"clis"),h=j(w),k=/\bcli\s*\(|\bregisterSiteAuthCommands\s*\(|\bregisterArticleLogin\s*\(|\bregisterTokenAuth\s*\(|\bmake[A-Z]\w*Command\s*\(/;export class ManifestImportError extends Error{filePath;cause;constructor(e,t){super(`failed to scan ${e}: ${F(t)}`);this.filePath=e;this.cause=t;this.name="ManifestImportError"}}function I(e){return e.map((t)=>({name:t.name,type:t.type??"str",default:t.default,required:!!t.required,valueRequired:!!t.valueRequired||void 0,positional:t.positional||void 0,help:t.help??"",choices:t.choices,fromFile:t.fromFile||void 0,requiredUnlessFile:t.requiredUnlessFile||void 0,generatedFileFor:t.generatedFileFor||void 0}))}function N(e,t){const r=a.basename(e,a.extname(e));return`${t}/${r}.js`}export function normalizeManifestPath(e){return e.replace(/\\/g,"/")}function O(e,t){return normalizeManifestPath(a.relative(t,e))}function T(e,t){return M(e)&&typeof e.site==="string"&&e.site===t&&typeof e.name==="string"&&(e.access==="read"||e.access==="write")&&Array.isArray(e.args)}function E(e,t,r){return{site:e.site,name:e.name,aliases:e.aliases,description:e.description??"",access:e.access,example:e.example,domain:e.domain,strategy:(e.strategy??"public").toString().toLowerCase(),browser:e.browser??!0,args:I(e.args),columns:e.columns,defaultFormat:e.defaultFormat,type:"js",modulePath:t,sourceFile:r,navigateBefore:e.navigateBefore,siteSession:e.siteSession,defaultWindowMode:e.defaultWindowMode}}export async function loadManifestEntries(e,t,r=(u)=>import(u),n=w){let u;try{u=c.readFileSync(e,"utf-8")}catch(s){throw new ManifestImportError(e,s)}if(!k.test(u))return[];try{const s=N(e,t),o=A(),i=new Map(o.entries()),d=await r(S(e).href),l=Object.values(M(d)?d:{}).filter((f)=>T(f,t)),p=l.length>0?l:[...o.entries()].filter(([f,m])=>{if(m.site!==t)return!1;const v=i.get(f);return!v||v!==m}).map(([,f])=>f),g=O(e,n),b=new Set;return p.filter((f)=>{const m=R(f);if(b.has(m))return!1;b.add(m);return!0}).sort((f,m)=>f.name.localeCompare(m.name)).map((f)=>E(f,s,g))}catch(s){throw new ManifestImportError(e,s)}}export async function scanClisDir(e,t=(r)=>import(r)){const r=new Map,n=[];if(!c.existsSync(e))return{entries:[],failures:n};for(const s of c.readdirSync(e)){const o=a.join(e,s);if(!c.statSync(o).isDirectory())continue;for(const i of c.readdirSync(o))if(i.endsWith(".js")&&!i.endsWith(".d.js")&&!i.endsWith(".test.js")&&i!=="index.js"){const d=a.join(o,i);try{const l=await loadManifestEntries(d,s,t,e);for(const p of l){const g=`${p.site}/${p.name}`;r.set(g,p)}}catch(l){if(l instanceof ManifestImportError){n.push(l);continue}throw l}}}return{entries:[...r.values()].sort((s,o)=>s.site.localeCompare(o.site)||s.name.localeCompare(o.name)),failures:n}}export async function buildManifest(){return scanClisDir(w)}export function serializeManifest(e){return`${JSON.stringify(e,null,2)}
3
+ `}export function findManifestMetadataIssues(e){const t=[];for(const r of e){if(!Array.isArray(r.args))continue;for(const n of r.args){if(!n.positional)continue;if((typeof n.help==="string"?n.help.trim():"")==="")t.push({site:r.site,command:r.name,arg:n.name,sourceFile:r.sourceFile,reason:"positional arg missing non-empty `help` text"})}}return t}export function diffRemovedEntries(e,t){const r=new Set(t.map((n)=>`${n.site}/${n.name}`));return e.map((n)=>`${n.site}/${n.name}`).filter((n)=>!r.has(n)).sort()}export function parseBuildManifestArgs(e){let t=0;for(const r of e){if(r==="--allow-removals"){t=Number.POSITIVE_INFINITY;continue}const n=r.match(/^--allow-removals=(\d+)$/);if(n){t=Number.parseInt(n[1],10);continue}}return{allowRemovals:t}}function P(e){try{if(!c.existsSync(e))return null;const t=c.readFileSync(e,"utf-8"),r=JSON.parse(t);return Array.isArray(r)?r:null}catch{return null}}async function L(){if(x(import.meta.url).includes(`${a.sep}dist${a.sep}`)){process.stderr.write(`❌ Refusing to run build-manifest from dist/.
4
+ `+" Stale compiled output silently drops adapters that import renamed/removed exports.\n Run `npm run build-manifest` (or `tsx src/build-manifest.ts`) from the source tree instead.\n");process.exit(1)}const e=parseBuildManifestArgs(process.argv.slice(2)),{entries:t,failures:r}=await buildManifest();if(r.length>0){process.stderr.write(`❌ ${r.length} adapter(s) failed to load:
5
+ `);for(const s of r){const o=a.relative(y,s.filePath)||s.filePath;process.stderr.write(` - ${o}: ${F(s.cause)}
6
6
  `)}process.stderr.write(`
7
7
  Manifest NOT written. Likely cause: stale dist/ or a broken adapter import.
8
8
  Always run via tsx (\`npm run build-manifest\`), not against compiled dist/.
9
- `);process.exit(1)}const X=findManifestMetadataIssues(J);if(X.length>0){process.stderr.write(`❌ ${X.length} positional arg(s) missing \`help\` text:
10
- `);for(const Q of X){const Y=Q.sourceFile?` (${Q.sourceFile})`:"";process.stderr.write(` - ${Q.site}/${Q.command} positional "${Q.arg}"${Y}
11
- `)}process.stderr.write("\nEvery positional arg must declare a non-empty `help` string so\n`ppcli <site> <cmd> --help` shows callers what the parameter is for.\nAdd `help: '...'` to each arg above and re-run the build.\n");process.exit(1)}const G=v(H);if(G){const Q=diffRemovedEntries(G,J);if(Q.length>q.allowRemovals){process.stderr.write(`❌ ${Q.length} manifest entries would be removed; refusing to overwrite.
12
- `);const Y=Q.slice(0,20);for(const Z of Y)process.stderr.write(` - ${Z}
13
- `);if(Q.length>Y.length)process.stderr.write(` ... ${Q.length-Y.length} more
9
+ `);process.exit(1)}const n=findManifestMetadataIssues(t);if(n.length>0){process.stderr.write(`❌ ${n.length} positional arg(s) missing \`help\` text:
10
+ `);for(const s of n){const o=s.sourceFile?` (${s.sourceFile})`:"";process.stderr.write(` - ${s.site}/${s.command} positional "${s.arg}"${o}
11
+ `)}process.stderr.write("\nEvery positional arg must declare a non-empty `help` string so\n`ppcli <site> <cmd> --help` shows callers what the parameter is for.\nAdd `help: '...'` to each arg above and re-run the build.\n");process.exit(1)}const u=P(h);if(u){const s=diffRemovedEntries(u,t);if(s.length>e.allowRemovals){process.stderr.write(`❌ ${s.length} manifest entries would be removed; refusing to overwrite.
12
+ `);const o=s.slice(0,20);for(const i of o)process.stderr.write(` - ${i}
13
+ `);if(s.length>o.length)process.stderr.write(` ... ${s.length-o.length} more
14
14
  `);process.stderr.write(`
15
- If this removal is intentional, rerun with \`--allow-removals=${Q.length}\` (or \`--allow-removals\` to disable the check).
16
- `);process.exit(1)}}V.mkdirSync($.dirname(H),{recursive:!0});V.writeFileSync(H,serializeManifest(J));console.log(`✅ Manifest compiled: ${J.length} entries → ${H}`);if(process.platform!=="win32"){const Q=j,Y=$.resolve(Q,"package.json");try{const Z=JSON.parse(V.readFileSync(Y,"utf-8")),F=typeof Z.bin==="string"?{[Z.name??"cli"]:Z.bin}:Z.bin??{};for(const z of Object.values(F)){const N=$.resolve(Q,z);if(V.existsSync(N)){V.chmodSync(N,493);console.log(`✅ Restored executable permission: ${z}`)}}}catch{}}}const P=process.argv[1]?L($.resolve(process.argv[1])).href:null;if(P===import.meta.url)p();
15
+ If this removal is intentional, rerun with \`--allow-removals=${s.length}\` (or \`--allow-removals\` to disable the check).
16
+ `);process.exit(1)}}c.mkdirSync(a.dirname(h),{recursive:!0});c.writeFileSync(h,serializeManifest(t));console.log(`✅ Manifest compiled: ${t.length} entries → ${h}`);if(process.platform!=="win32"){const s=y,o=a.resolve(s,"package.json");try{const i=JSON.parse(c.readFileSync(o,"utf-8")),d=typeof i.bin==="string"?{[i.name??"cli"]:i.bin}:i.bin??{};for(const l of Object.values(d)){const p=a.resolve(s,l);if(c.existsSync(p)){c.chmodSync(p,493);console.log(`✅ Restored executable permission: ${l}`)}}}catch{}}}const U=process.argv[1]?S(a.resolve(process.argv[1])).href:null;if(U===import.meta.url)L();
@@ -1 +1 @@
1
- import{getRegisteredStepNames as C}from"./pipeline/registry.js";export const BROWSER_ONLY_STEPS=new Set(["navigate","click","type","fill","wait","press","snapshot","evaluate","intercept","tap"]);export function _validateBrowserOnlyStepsAgainstRegistry(){const k=new Set(C()),z=[];for(const A of BROWSER_ONLY_STEPS)if(!k.has(A))z.push(A);return{extras:z}}function D(k){return k.some((z)=>{if(!z||typeof z!=="object")return!1;return Object.keys(z).some((A)=>BROWSER_ONLY_STEPS.has(A))})}export function shouldUseBrowserSession(k){if(!k.browser)return!1;if(k.func)return!0;if(!k.pipeline||k.pipeline.length===0)return!0;if(k.navigateBefore)return!0;return D(k.pipeline)}
1
+ import{getRegisteredStepNames as n}from"./pipeline/registry.js";export const BROWSER_ONLY_STEPS=new Set(["navigate","click","type","fill","wait","press","snapshot","evaluate","intercept","tap"]);export function _validateBrowserOnlyStepsAgainstRegistry(){const e=new Set(n()),t=[];for(const r of BROWSER_ONLY_STEPS)if(!e.has(r))t.push(r);return{extras:t}}function s(e){return e.some((t)=>{if(!t||typeof t!=="object")return!1;return Object.keys(t).some((r)=>BROWSER_ONLY_STEPS.has(r))})}export function shouldUseBrowserSession(e){if(!e.browser)return!1;if(e.func)return!0;if(!e.pipeline||e.pipeline.length===0)return!0;if(e.navigateBefore)return!0;return s(e.pipeline)}
@@ -1 +1 @@
1
- const K=new Set(["analyze","back","bind","check","click","close","console","dblclick","dialog","drag","eval","extract","fill","find","focus","frames","get","help","hover","init","keys","network","open","screenshot","scroll","select","state","tab","type","unbind","uncheck","upload","verify","wait"]),W=new Set(["--profile"]);export function getBrowserSubcommandNames(){return K}export function rewriteBrowserArgv(X){const H=[...X];let z=0;while(z<H.length){const Z=H[z];if(!Z.startsWith("-"))break;if(Z.includes("=")){z+=1;continue}if(W.has(Z)&&z+1<H.length)z+=2;else z+=1}if(H[z]!=="browser")return H;const J=z+1,Q=H[J];if(Q===void 0)return H;if(Q==="--session"||Q==="--session="||Q.startsWith("--session="))throw new BrowserSessionArgvError("The `--session` flag is no longer a public option. Use the positional form: ppcli browser <session> <command>");if(Q.startsWith("-"))return H;if(K.has(Q))return H;H.splice(J,1,"--session",Q);q(H,J+2);return H}function q(X,H){const z=X.findIndex((J,Q)=>Q>=H&&K.has(J));if(z===-1)return;for(let J=z+1;J<X.length;J+=1){const Q=X[J];if(Q==="--")return;if(Q.startsWith("--window=")){const Z=X.splice(J,1);X.splice(z,0,...Z);return}if(Q==="--window"){const Z=X[J+1];if(Z===void 0||Z==="--")return;const h=X.splice(J,2);X.splice(z,0,...h);return}}}export class BrowserSessionArgvError extends Error{constructor(X){super(X);this.name="BrowserSessionArgvError"}}function F(X){const H=new Map([["-h","none"],["--help","none"],["-v","none"],["--verbose","none"],["-f","required"],["--format","required"],["--trace","required"]]);if(X.browser){H.set("--window","required");H.set("--site-session","required");H.set("--keep-tab","required")}for(const z of X.args??[]){if(z.positional)continue;H.set(`--${z.name}`,z.required||z.valueRequired?"required":"optional")}return H}function y(X,H,z){const J=X[H];if(!J||J==="--")return null;const Q=J.indexOf("="),Z=Q===-1?J:J.slice(0,Q),h=z.get(Z);if(!h&&Q===-1&&J.startsWith("-")&&!J.startsWith("--")&&J.length>2){const V=J.slice(0,2);if(z.get(V)==="required")return{values:[J],nextIndex:H+1}}if(!h)return null;if(Q!==-1||h==="none")return{values:[J],nextIndex:H+1};const G=X[H+1];if(h==="required")return G===void 0?{values:[J],nextIndex:H+1}:{values:[J,G],nextIndex:H+2};if(G!==void 0&&!G.startsWith("-"))return{values:[J,G],nextIndex:H+2};return{values:[J],nextIndex:H+1}}export function escapeLeadingDashPositional(X,H){const z=[...X],J=new Map;for(const Y of H){const T=Y.args?.find((b)=>b.positional);if(T?.required||T?.requiredUnlessFile)J.set(Y.site+"/"+Y.name,Y)}let Q=0;while(Q<z.length){const Y=z[Q];if(!Y.startsWith("-"))break;if(Y.includes("=")){Q+=1;continue}if(W.has(Y)&&Q+1<z.length)Q+=2;else Q+=1}const Z=z[Q],h=z[Q+1],G=Q+2;if(!Z||!h||G>=z.length)return z;const V=J.get(Z+"/"+h);if(!V)return z;const D=F(V),C=[];let $=G;while($<z.length){const Y=z[$];if(Y==="--")return z;const T=y(z,$,D);if(T){C.push(...T.values);$=T.nextIndex;continue}if(!Y.startsWith("-"))return z;if(Y.startsWith("--"))return z;break}if($>=z.length)return z;const U=z[$],L=[],P=[];$+=1;while($<z.length){const Y=y(z,$,D);if(Y){L.push(...Y.values);$=Y.nextIndex;continue}P.push(z[$]);$+=1}return[...z.slice(0,G),...C,...L,"--",U,...P]}
1
+ const h=new Set(["analyze","back","bind","check","click","close","console","dblclick","dialog","drag","eval","extract","fill","find","focus","frames","get","help","hover","init","keys","network","open","screenshot","scroll","select","state","tab","type","unbind","uncheck","upload","verify","wait"]),x=new Set(["--profile"]);export function getBrowserSubcommandNames(){return h}export function rewriteBrowserArgv(o){const n=[...o];let e=0;while(e<n.length){const r=n[e];if(!r.startsWith("-"))break;if(r.includes("=")){e+=1;continue}if(x.has(r)&&e+1<n.length)e+=2;else e+=1}if(n[e]!=="browser")return n;const t=e+1,s=n[t];if(s===void 0)return n;if(s==="--session"||s==="--session="||s.startsWith("--session="))throw new BrowserSessionArgvError("The `--session` flag is no longer a public option. Use the positional form: ppcli browser <session> <command>");if(s.startsWith("-"))return n;if(h.has(s))return n;n.splice(t,1,"--session",s);q(n,t+2);return n}function q(o,n){const e=o.findIndex((t,s)=>s>=n&&h.has(t));if(e===-1)return;for(let t=e+1;t<o.length;t+=1){const s=o[t];if(s==="--")return;if(s.startsWith("--window=")){const r=o.splice(t,1);o.splice(e,0,...r);return}if(s==="--window"){const r=o[t+1];if(r===void 0||r==="--")return;const u=o.splice(t,2);o.splice(e,0,...u);return}}}export class BrowserSessionArgvError extends Error{constructor(o){super(o);this.name="BrowserSessionArgvError"}}function I(o){const n=new Map([["-h","none"],["--help","none"],["-v","none"],["--verbose","none"],["-f","required"],["--format","required"],["--trace","required"]]);if(o.browser){n.set("--window","required");n.set("--site-session","required");n.set("--keep-tab","required")}for(const e of o.args??[]){if(e.positional)continue;n.set(`--${e.name}`,e.required||e.valueRequired?"required":"optional")}return n}function g(o,n,e){const t=o[n];if(!t||t==="--")return null;const s=t.indexOf("="),r=s===-1?t:t.slice(0,s),u=e.get(r);if(!u&&s===-1&&t.startsWith("-")&&!t.startsWith("--")&&t.length>2){const f=t.slice(0,2);if(e.get(f)==="required")return{values:[t],nextIndex:n+1}}if(!u)return null;if(s!==-1||u==="none")return{values:[t],nextIndex:n+1};const l=o[n+1];if(u==="required")return l===void 0?{values:[t],nextIndex:n+1}:{values:[t,l],nextIndex:n+2};if(l!==void 0&&!l.startsWith("-"))return{values:[t,l],nextIndex:n+2};return{values:[t],nextIndex:n+1}}export function escapeLeadingDashPositional(o,n){const e=[...o],t=new Map;for(const i of n){const a=i.args?.find((b)=>b.positional);if(a?.required||a?.requiredUnlessFile)t.set(i.site+"/"+i.name,i)}let s=0;while(s<e.length){const i=e[s];if(!i.startsWith("-"))break;if(i.includes("=")){s+=1;continue}if(x.has(i)&&s+1<e.length)s+=2;else s+=1}const r=e[s],u=e[s+1],l=s+2;if(!r||!u||l>=e.length)return e;const f=t.get(r+"/"+u);if(!f)return e;const d=I(f),p=[];let c=l;while(c<e.length){const i=e[c];if(i==="--")return e;const a=g(e,c,d);if(a){p.push(...a.values);c=a.nextIndex;continue}if(!i.startsWith("-"))return e;if(i.startsWith("--"))return e;break}if(c>=e.length)return e;const k=e[c],w=[],m=[];c+=1;while(c<e.length){const i=g(e,c,d);if(i){w.push(...i.values);c=i.nextIndex;continue}m.push(e[c]);c+=1}return[...e.slice(0,l),...p,...w,"--",k,...m]}