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,4 +1,4 @@
1
- import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError as k,AuthRequiredError as _,CommandExecutionError as F,TimeoutError as O}from"@jackwener/opencli/errors";export const CHATGPT_DOMAIN="chatgpt.com",CHATGPT_URL="https://chatgpt.com";const I={instant:{label:"Instant",labels:["Instant","即时","极速"],optionLabels:["Instant","极速","即时"],testIds:["model-switcher-gpt-5-5"],intelligenceOrder:0},medium:{label:"Medium",labels:["Medium","均衡"],optionLabels:["Medium","均衡"],testIds:[],intelligenceOrder:1},high:{label:"High",labels:["High","高级","Thinking","思考"],optionLabels:["High","高级","Thinking","思考"],testIds:["model-switcher-gpt-5-5-thinking"],intelligenceOrder:2},"extra-high":{label:"Extra High",labels:["Extra High","超高"],optionLabels:["Extra High","超高"],testIds:[],intelligenceOrder:3},pro:{label:"Pro",labels:["Pro","进阶专业","专业"],optionLabels:["专业","Pro","进阶专业"],testIds:["model-switcher-gpt-5-5-pro"],intelligenceOrder:4}},w={thinking:"high"};export const CHATGPT_MODEL_CHOICES=[...Object.keys(I),...Object.keys(w)];const G={"deep-research":{label:"Deep Research",labels:["深度研究","Deep Research"]},"web-search":{label:"Web Search",labels:["网页搜索","搜索","Web Search","Search"]}};export const CHATGPT_TOOL_CHOICES=Object.keys(G);const x=['[contenteditable="true"][role="textbox"]','#prompt-textarea[contenteditable="true"]','[aria-label="Chat with ChatGPT"]','[aria-label="与 ChatGPT 聊天"]','[placeholder="Ask anything"]','[placeholder="有问题,尽管问"]',"#prompt-textarea",'[data-testid="prompt-textarea"]'],U='button[data-testid="send-button"]:not([disabled])',L=["#composer-submit-button:not([disabled])"],y=["Send prompt","Send message","Send","发送","发送消息","发送提示"],A=["Close sidebar","关闭边栏"];function N(Q,X){if(!Q||!X)return!1;return Q===X||Q.startsWith(`${X}?`)||Q.startsWith(`${X}#`)}function v(){return`
1
+ import{htmlToMarkdown as V}from"@jackwener/opencli/utils";import{ArgumentError as g,AuthRequiredError as A,CommandExecutionError as d,TimeoutError as E}from"@jackwener/opencli/errors";export const CHATGPT_DOMAIN="chatgpt.com",CHATGPT_URL="https://chatgpt.com";const y={instant:{label:"Instant",labels:["Instant","即时","极速"],optionLabels:["Instant","极速","即时"],testIds:["model-switcher-gpt-5-5"],intelligenceOrder:0},medium:{label:"Medium",labels:["Medium","均衡"],optionLabels:["Medium","均衡"],testIds:[],intelligenceOrder:1},high:{label:"High",labels:["High","高级","Thinking","思考"],optionLabels:["High","高级","Thinking","思考"],testIds:["model-switcher-gpt-5-5-thinking"],intelligenceOrder:2},"extra-high":{label:"Extra High",labels:["Extra High","超高"],optionLabels:["Extra High","超高"],testIds:[],intelligenceOrder:3},pro:{label:"Pro",labels:["Pro","进阶专业","专业"],optionLabels:["专业","Pro","进阶专业"],testIds:["model-switcher-gpt-5-5-pro"],intelligenceOrder:4}},M={thinking:"high"};export const CHATGPT_MODEL_CHOICES=[...Object.keys(y),...Object.keys(M)];const v={"deep-research":{label:"Deep Research",labels:["深度研究","Deep Research"]},"web-search":{label:"Web Search",labels:["网页搜索","搜索","Web Search","Search"]}};export const CHATGPT_TOOL_CHOICES=Object.keys(v);const b=['[contenteditable="true"][role="textbox"]','#prompt-textarea[contenteditable="true"]','[aria-label="Chat with ChatGPT"]','[aria-label="与 ChatGPT 聊天"]','[placeholder="Ask anything"]','[placeholder="有问题,尽管问"]',"#prompt-textarea",'[data-testid="prompt-textarea"]'],T='button[data-testid="send-button"]:not([disabled])',S=["#composer-submit-button:not([disabled])"],k=["Send prompt","Send message","Send","发送","发送消息","发送提示"],I=["Close sidebar","关闭边栏"];function x(e,t){if(!e||!t)return!1;return e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}#`)}function P(){return`
2
2
  const isVisible = (el) => {
3
3
  if (!(el instanceof HTMLElement)) return false;
4
4
  const style = window.getComputedStyle(el);
@@ -15,7 +15,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
15
15
  };
16
16
 
17
17
  const findComposer = () => {
18
- for (const selector of ${JSON.stringify(x)}) {
18
+ for (const selector of ${JSON.stringify(b)}) {
19
19
  const candidates = Array.from(document.querySelectorAll(selector)).filter(c => c instanceof HTMLElement && isVisible(c));
20
20
  const node = candidates.find(c => c.isContentEditable) || candidates[0];
21
21
  if (node instanceof HTMLElement) {
@@ -28,7 +28,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
28
28
  };
29
29
 
30
30
  findComposer.toString = () => 'findComposer';
31
- `}export function normalizeBooleanFlag(Q,X=!1){if(typeof Q==="boolean")return Q;if(Q==null||Q==="")return X;const Y=String(Q).trim().toLowerCase();return Y==="true"||Y==="1"||Y==="yes"||Y==="on"}export function requireNonEmptyPrompt(Q,X){const Y=String(Q??"").trim();if(!Y)throw new k(`${X} prompt cannot be empty`,`Example: ppcli ${X} "hello"`);return Y}export function requirePositiveInt(Q,X,Y){if(!Number.isInteger(Q)||Q<1)throw new k(`${X} must be a positive integer`,Y);return Q}export function requireNonNegativeInt(Q,X,Y){if(!Number.isInteger(Q)||Q<0)throw new k(`${X} must be a non-negative integer`,Y);return Q}export function unwrapEvaluateResult(Q){if(Q&&!Array.isArray(Q)&&typeof Q==="object"&&"session"in Q&&"data"in Q)return Q.data;return Q}export function requireArrayEvaluateResult(Q,X){if(!Array.isArray(Q)){if(Q&&typeof Q==="object"&&"error"in Q)throw new F(`${X}: ${String(Q.error)}`);throw new F(`${X} returned malformed extraction payload`)}return Q}export function requireObjectEvaluateResult(Q,X){if(!Q||Array.isArray(Q)||typeof Q!=="object")throw new F(`${X} returned malformed extraction payload`);return Q}export function requireBooleanEvaluateResult(Q,X){if(typeof Q!=="boolean")throw new F(`${X} returned malformed extraction payload`);return Q}function u(Q){return Q===CHATGPT_DOMAIN||Q.endsWith(`.${CHATGPT_DOMAIN}`)}function n(Q){const X=String(Q||"").match(/^\/g\/g-p-([a-f0-9]{8,})(?:[-/]|$)/i);return X?X[1].toLowerCase():""}function S(Q){try{const X=new URL(String(Q||""),CHATGPT_URL);if(X.protocol!=="https:"||!u(X.hostname))return"";return n(X.pathname)}catch{return""}}export function parseChatGPTConversationId(Q){const X=String(Q??"").trim();if(/^https?:\/\//i.test(X)){try{const Z=new URL(X);if(Z.protocol!=="https:"||Z.hostname!==CHATGPT_DOMAIN&&!Z.hostname.endsWith(`.${CHATGPT_DOMAIN}`))throw Error("off-domain");const $=Z.pathname.match(/^\/(?:g\/g-p-[^/]+\/)?c\/([A-Za-z0-9_-]{8,})$/);if($)return $[1]}catch{}throw new k("chatgpt detail requires a conversation id or chatgpt.com /c/<id> URL","Example: ppcli chatgpt detail https://chatgpt.com/c/123e4567-e89b-12d3-a456-426614174000")}const Y=X.match(/^\/(?:g\/g-p-[^/]+\/)?c\/([A-Za-z0-9_-]{8,})(?:[?#].*)?$/);if(Y)return Y[1];if(/^[A-Za-z0-9_-]{8,}$/.test(X))return X;throw new k("chatgpt detail requires a conversation id or chatgpt.com /c/<id> URL","Example: ppcli chatgpt detail 123e4567-e89b-12d3-a456-426614174000")}export async function currentChatGPTUrl(Q){const X=unwrapEvaluateResult(await Q.evaluate("window.location.href").catch(()=>""));return typeof X==="string"?X:""}export async function isOnChatGPT(Q){const X=await currentChatGPTUrl(Q);if(!X)return!1;try{const Y=new URL(X).hostname;return Y===CHATGPT_DOMAIN||Y.endsWith(`.${CHATGPT_DOMAIN}`)}catch{return!1}}const f='#prompt-textarea, [data-testid="prompt-textarea"]',R='a[href*="/c/"]',c='a[href*="/g/g-p-"]';export const CONVERSATION_MESSAGE_SELECTOR='[data-message-author-role], article[data-testid*="conversation-turn"]';export async function ensureOnChatGPT(Q){if(await isOnChatGPT(Q))return!1;await Q.goto(CHATGPT_URL,{settleMs:2000});try{await Q.wait({selector:f,timeout:8})}catch{}return!0}export async function startNewChat(Q){await Q.goto(`${CHATGPT_URL}/new`,{settleMs:2000});try{await Q.wait({selector:f,timeout:8})}catch{}}export async function openChatGPTConversation(Q,X){const Y=parseChatGPTConversationId(X);await Q.goto(`${CHATGPT_URL}/c/${Y}`,{settleMs:2000});try{await Q.wait({selector:f,timeout:8})}catch{}return Y}export async function getPageState(Q){return requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
31
+ `}export function normalizeBooleanFlag(e,t=!1){if(typeof e==="boolean")return e;if(e==null||e==="")return t;const n=String(e).trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"}export function requireNonEmptyPrompt(e,t){const n=String(e??"").trim();if(!n)throw new g(`${t} prompt cannot be empty`,`Example: ppcli ${t} "hello"`);return n}export function requirePositiveInt(e,t,n){if(!Number.isInteger(e)||e<1)throw new g(`${t} must be a positive integer`,n);return e}export function requireNonNegativeInt(e,t,n){if(!Number.isInteger(e)||e<0)throw new g(`${t} must be a non-negative integer`,n);return e}export function unwrapEvaluateResult(e){if(e&&!Array.isArray(e)&&typeof e==="object"&&"session"in e&&"data"in e)return e.data;return e}export function requireArrayEvaluateResult(e,t){if(!Array.isArray(e)){if(e&&typeof e==="object"&&"error"in e)throw new d(`${t}: ${String(e.error)}`);throw new d(`${t} returned malformed extraction payload`)}return e}export function requireObjectEvaluateResult(e,t){if(!e||Array.isArray(e)||typeof e!=="object")throw new d(`${t} returned malformed extraction payload`);return e}export function requireBooleanEvaluateResult(e,t){if(typeof e!=="boolean")throw new d(`${t} returned malformed extraction payload`);return e}function F(e){return e===CHATGPT_DOMAIN||e.endsWith(`.${CHATGPT_DOMAIN}`)}function W(e){const t=String(e||"").match(/^\/g\/g-p-([a-f0-9]{8,})(?:[-/]|$)/i);return t?t[1].toLowerCase():""}function j(e){try{const t=new URL(String(e||""),CHATGPT_URL);if(t.protocol!=="https:"||!F(t.hostname))return"";return W(t.pathname)}catch{return""}}export function parseChatGPTConversationId(e){const t=String(e??"").trim();if(/^https?:\/\//i.test(t)){try{const r=new URL(t);if(r.protocol!=="https:"||r.hostname!==CHATGPT_DOMAIN&&!r.hostname.endsWith(`.${CHATGPT_DOMAIN}`))throw Error("off-domain");const o=r.pathname.match(/^\/(?:g\/g-p-[^/]+\/)?c\/([A-Za-z0-9_-]{8,})$/);if(o)return o[1]}catch{}throw new g("chatgpt detail requires a conversation id or chatgpt.com /c/<id> URL","Example: ppcli chatgpt detail https://chatgpt.com/c/123e4567-e89b-12d3-a456-426614174000")}const n=t.match(/^\/(?:g\/g-p-[^/]+\/)?c\/([A-Za-z0-9_-]{8,})(?:[?#].*)?$/);if(n)return n[1];if(/^[A-Za-z0-9_-]{8,}$/.test(t))return t;throw new g("chatgpt detail requires a conversation id or chatgpt.com /c/<id> URL","Example: ppcli chatgpt detail 123e4567-e89b-12d3-a456-426614174000")}export async function currentChatGPTUrl(e){const t=unwrapEvaluateResult(await e.evaluate("window.location.href").catch(()=>""));return typeof t==="string"?t:""}export async function isOnChatGPT(e){const t=await currentChatGPTUrl(e);if(!t)return!1;try{const n=new URL(t).hostname;return n===CHATGPT_DOMAIN||n.endsWith(`.${CHATGPT_DOMAIN}`)}catch{return!1}}const C='#prompt-textarea, [data-testid="prompt-textarea"]',R='a[href*="/c/"]',O='a[href*="/g/g-p-"]';export const CONVERSATION_MESSAGE_SELECTOR='[data-message-author-role], article[data-testid*="conversation-turn"]';export async function ensureOnChatGPT(e){if(await isOnChatGPT(e))return!1;await e.goto(CHATGPT_URL,{settleMs:2000});try{await e.wait({selector:C,timeout:8})}catch{}return!0}export async function startNewChat(e){await e.goto(`${CHATGPT_URL}/new`,{settleMs:2000});try{await e.wait({selector:C,timeout:8})}catch{}}export async function openChatGPTConversation(e,t){const n=parseChatGPTConversationId(t);await e.goto(`${CHATGPT_URL}/c/${n}`,{settleMs:2000});try{await e.wait({selector:C,timeout:8})}catch{}return n}export async function getPageState(e){return requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
32
32
  const isVisible = (el) => {
33
33
  if (!(el instanceof HTMLElement)) return false;
34
34
  const style = window.getComputedStyle(el);
@@ -36,7 +36,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
36
36
  const rect = el.getBoundingClientRect();
37
37
  return rect.width > 0 && rect.height > 0;
38
38
  };
39
- const composerSelectors = ${JSON.stringify(x)};
39
+ const composerSelectors = ${JSON.stringify(b)};
40
40
  const hasComposer = composerSelectors.some((selector) =>
41
41
  Array.from(document.querySelectorAll(selector)).some((node) => isVisible(node))
42
42
  );
@@ -54,7 +54,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
54
54
  isLoggedIn: hasComposer || !!userMenu || !hasLoginGate,
55
55
  hasLoginGate,
56
56
  };
57
- })()`)),"chatgpt page state")}export async function ensureChatGPTLogin(Q,X="ChatGPT requires a logged-in browser session."){const Y=await getPageState(Q);if(!Y.isLoggedIn||Y.hasLoginGate)throw new _(CHATGPT_DOMAIN,X);return Y}export async function ensureChatGPTComposer(Q,X="ChatGPT composer is not available on the current page."){const Y=await ensureChatGPTLogin(Q,X);if(!Y.hasComposer)throw new F(X);return Y}function o(Q){const X=String(Q??"").trim().toLowerCase(),Y=w[X]||X,Z=I[Y];if(!Z)throw new k(`Unknown ChatGPT model "${Q}"`,`Choose one of: ${CHATGPT_MODEL_CHOICES.join(", ")}`);return{key:Y,alias:X!==Y?X:null,...Z}}function g(Q){const X=String(Q??"").trim().toLowerCase(),Y=G[X];if(!Y)throw new k(`Unknown ChatGPT tool "${Q}"`,`Choose one of: ${CHATGPT_TOOL_CHOICES.join(", ")}`);return{key:X,...Y}}export async function getCurrentChatGPTModel(Q){return requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
57
+ })()`)),"chatgpt page state")}export async function ensureChatGPTLogin(e,t="ChatGPT requires a logged-in browser session."){const n=await getPageState(e);if(!n.isLoggedIn||n.hasLoginGate)throw new A(CHATGPT_DOMAIN,t);return n}export async function ensureChatGPTComposer(e,t="ChatGPT composer is not available on the current page."){const n=await ensureChatGPTLogin(e,t);if(!n.hasComposer)throw new d(t);return n}function _(e){const t=String(e??"").trim().toLowerCase(),n=M[t]||t,r=y[n];if(!r)throw new g(`Unknown ChatGPT model "${e}"`,`Choose one of: ${CHATGPT_MODEL_CHOICES.join(", ")}`);return{key:n,alias:t!==n?t:null,...r}}function D(e){const t=String(e??"").trim().toLowerCase(),n=v[t];if(!n)throw new g(`Unknown ChatGPT tool "${e}"`,`Choose one of: ${CHATGPT_TOOL_CHOICES.join(", ")}`);return{key:t,...n}}export async function getCurrentChatGPTModel(e){return requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
58
58
  const isVisible = (el) => {
59
59
  if (!(el instanceof HTMLElement)) return false;
60
60
  const style = window.getComputedStyle(el);
@@ -74,7 +74,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
74
74
  }
75
75
  return normalizedText.replace(/\\s+/g, '').includes(normalizedLabel.replace(/\\s+/g, ''));
76
76
  };
77
- const labels = ${JSON.stringify(I)};
77
+ const labels = ${JSON.stringify(y)};
78
78
  const findEntryForText = (text) => {
79
79
  const matches = [];
80
80
  for (const [key, value] of Object.entries(labels)) {
@@ -114,7 +114,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
114
114
  model: entry?.key ?? null,
115
115
  label: entry?.value?.label ?? null,
116
116
  };
117
- })()`)),"chatgpt current model")}export async function selectChatGPTModel(Q,X){const Y=o(X);if(typeof Q.nativeClick!=="function")throw new F("ChatGPT model selection requires native browser click support.");await ensureOnChatGPT(Q);await ensureChatGPTComposer(Q,"ChatGPT model selection requires a logged-in ChatGPT session with a visible composer.");if((await getCurrentChatGPTModel(Q)).model===Y.key)return{Status:"Already selected",Model:Y.label};const $=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
117
+ })()`)),"chatgpt current model")}export async function selectChatGPTModel(e,t){const n=_(t);if(typeof e.nativeClick!=="function")throw new d("ChatGPT model selection requires native browser click support.");await ensureOnChatGPT(e);await ensureChatGPTComposer(e,"ChatGPT model selection requires a logged-in ChatGPT session with a visible composer.");if((await getCurrentChatGPTModel(e)).model===n.key)return{Status:"Already selected",Model:n.label};const o=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
118
118
  const isVisible = (el) => {
119
119
  if (!(el instanceof HTMLElement)) return false;
120
120
  const style = window.getComputedStyle(el);
@@ -134,7 +134,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
134
134
  }
135
135
  return normalizedText.replace(/\\s+/g, '').includes(normalizedLabel.replace(/\\s+/g, ''));
136
136
  };
137
- const labels = ${JSON.stringify(Object.values(I).flatMap((z)=>z.labels))};
137
+ const labels = ${JSON.stringify(Object.values(y).flatMap((a)=>a.labels))};
138
138
  const menuButtonSelectors = [
139
139
  'button[data-testid="model-switcher-dropdown-button"]',
140
140
  'button[aria-label*="model" i]',
@@ -157,7 +157,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
157
157
  x: Math.round(rect.left + rect.width / 2),
158
158
  y: Math.round(rect.top + rect.height / 2),
159
159
  };
160
- })()`)),"chatgpt model menu button");if(!$.found)throw new F("Could not find the ChatGPT model selector in the composer.");await Q.nativeClick(Number($.x),Number($.y));await Q.wait(0.5);let W=null;for(let z=0;z<10;z+=1){W=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
160
+ })()`)),"chatgpt model menu button");if(!o.found)throw new d("Could not find the ChatGPT model selector in the composer.");await e.nativeClick(Number(o.x),Number(o.y));await e.wait(0.5);let i=null;for(let a=0;a<10;a+=1){i=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
161
161
  const isVisible = (el) => {
162
162
  if (!(el instanceof HTMLElement)) return false;
163
163
  const style = window.getComputedStyle(el);
@@ -177,7 +177,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
177
177
  }
178
178
  return normalizedText.replace(/\\s+/g, '').includes(normalizedLabel.replace(/\\s+/g, ''));
179
179
  };
180
- const target = ${JSON.stringify(Y)};
180
+ const target = ${JSON.stringify(n)};
181
181
  const clickableSelector = '[role="menuitemradio"], [role="menuitem"], [role="option"], button, [data-testid^="model-switcher"]';
182
182
  const intelligenceContent = document.querySelector('[data-testid="composer-intelligence-picker-content"]');
183
183
  const intelligenceOptions = intelligenceContent
@@ -223,7 +223,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
223
223
  x: Math.round(rect.left + rect.width / 2),
224
224
  y: Math.round(rect.top + rect.height / 2),
225
225
  };
226
- })()`)),"chatgpt model option click");if(W.found)break;await Q.wait(0.5)}if(!W?.found)throw new F(`Could not click the ChatGPT ${Y.label} model option.`);await Q.nativeClick(Number(W.x),Number(W.y));await Q.wait(0.5);if((await getCurrentChatGPTModel(Q)).model!==Y.key){await Q.nativeClick(Number($.x),Number($.y));await Q.wait(0.5);const z=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
226
+ })()`)),"chatgpt model option click");if(i.found)break;await e.wait(0.5)}if(!i?.found)throw new d(`Could not click the ChatGPT ${n.label} model option.`);await e.nativeClick(Number(i.x),Number(i.y));await e.wait(0.5);if((await getCurrentChatGPTModel(e)).model!==n.key){await e.nativeClick(Number(o.x),Number(o.y));await e.wait(0.5);const a=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
227
227
  const isVisible = (el) => {
228
228
  if (!(el instanceof HTMLElement)) return false;
229
229
  const style = window.getComputedStyle(el);
@@ -231,7 +231,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
231
231
  const rect = el.getBoundingClientRect();
232
232
  return rect.width > 0 && rect.height > 0;
233
233
  };
234
- const target = ${JSON.stringify(Y)};
234
+ const target = ${JSON.stringify(n)};
235
235
  const intelligenceContent = document.querySelector('[data-testid="composer-intelligence-picker-content"]');
236
236
  const options = intelligenceContent
237
237
  ? Array.from(intelligenceContent.querySelectorAll('[role="menuitemradio"]')).filter(isVisible)
@@ -241,7 +241,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
241
241
  recognized: options.length === 5 && Number.isInteger(target.intelligenceOrder),
242
242
  checkedIndex,
243
243
  };
244
- })()`)),"chatgpt model checked intelligence option");if(z.recognized&&z.checkedIndex===Y.intelligenceOrder){await Q.nativeClick(Number($.x),Number($.y));return{Status:"Success",Model:Y.label}}await Q.nativeClick(Number($.x),Number($.y));throw new F(`ChatGPT model did not switch to ${Y.label}.`)}return{Status:"Success",Model:Y.label}}export async function getCurrentChatGPTTool(Q){return requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
244
+ })()`)),"chatgpt model checked intelligence option");if(a.recognized&&a.checkedIndex===n.intelligenceOrder){await e.nativeClick(Number(o.x),Number(o.y));return{Status:"Success",Model:n.label}}await e.nativeClick(Number(o.x),Number(o.y));throw new d(`ChatGPT model did not switch to ${n.label}.`)}return{Status:"Success",Model:n.label}}export async function getCurrentChatGPTTool(e){return requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
245
245
  const isVisible = (el) => {
246
246
  if (!(el instanceof HTMLElement)) return false;
247
247
  const style = window.getComputedStyle(el);
@@ -250,7 +250,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
250
250
  return rect.width > 0 && rect.height > 0;
251
251
  };
252
252
  const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
253
- const labels = ${JSON.stringify(G)};
253
+ const labels = ${JSON.stringify(v)};
254
254
  const form = Array.from(document.querySelectorAll('form')).find((node) => node instanceof HTMLElement && isVisible(node));
255
255
  const root = form || document.body;
256
256
  const nodes = Array.from(root.querySelectorAll('button, [role="button"], [role="menuitemradio"], span, div'));
@@ -265,7 +265,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
265
265
  tool: entry?.[0] ?? null,
266
266
  label: entry?.[1]?.label ?? null,
267
267
  };
268
- })()`)),"chatgpt current tool")}export async function selectChatGPTTool(Q,X){const Y=g(X);if(typeof Q.nativeClick!=="function")throw new F("ChatGPT tool selection requires native browser click support.");await ensureOnChatGPT(Q);await ensureChatGPTComposer(Q,"ChatGPT tool selection requires a logged-in ChatGPT session with a visible composer.");if((await getCurrentChatGPTTool(Q)).tool===Y.key)return{Status:"Already selected",Tool:Y.label};const $=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
268
+ })()`)),"chatgpt current tool")}export async function selectChatGPTTool(e,t){const n=D(t);if(typeof e.nativeClick!=="function")throw new d("ChatGPT tool selection requires native browser click support.");await ensureOnChatGPT(e);await ensureChatGPTComposer(e,"ChatGPT tool selection requires a logged-in ChatGPT session with a visible composer.");if((await getCurrentChatGPTTool(e)).tool===n.key)return{Status:"Already selected",Tool:n.label};const o=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
269
269
  const isVisible = (el) => {
270
270
  if (!(el instanceof HTMLElement)) return false;
271
271
  const style = window.getComputedStyle(el);
@@ -282,7 +282,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
282
282
  x: Math.round(rect.left + rect.width / 2),
283
283
  y: Math.round(rect.top + rect.height / 2),
284
284
  };
285
- })()`)),"chatgpt tools menu button");if(!$.found)throw new F("Could not find the ChatGPT tools menu button in the composer.");await Q.nativeClick(Number($.x),Number($.y));await Q.wait(0.5);let W=null;for(let z=0;z<10;z+=1){W=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
285
+ })()`)),"chatgpt tools menu button");if(!o.found)throw new d("Could not find the ChatGPT tools menu button in the composer.");await e.nativeClick(Number(o.x),Number(o.y));await e.wait(0.5);let i=null;for(let a=0;a<10;a+=1){i=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
286
286
  const isVisible = (el) => {
287
287
  if (!(el instanceof HTMLElement)) return false;
288
288
  const style = window.getComputedStyle(el);
@@ -291,7 +291,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
291
291
  return rect.width > 0 && rect.height > 0;
292
292
  };
293
293
  const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
294
- const labels = ${JSON.stringify(Y.labels)};
294
+ const labels = ${JSON.stringify(n.labels)};
295
295
  const options = Array.from(document.querySelectorAll('[role="menuitemradio"]'));
296
296
  const option = options.find((node) => node instanceof HTMLElement && isVisible(node) && labels.includes(normalize(node.textContent)));
297
297
  if (!(option instanceof HTMLElement)) return { found: false };
@@ -304,7 +304,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
304
304
  x: Math.round(rect.left + rect.width / 2),
305
305
  y: Math.round(rect.top + rect.height / 2),
306
306
  };
307
- })()`)),"chatgpt tool option click");if(W.found)break;await Q.wait(0.5)}if(!W?.found)throw new F(`Could not find the ChatGPT ${Y.label} tool option.`);if(!W.checked)await Q.nativeClick(Number(W.x),Number(W.y));await Q.wait(0.5);if((await getCurrentChatGPTTool(Q)).tool!==Y.key)throw new F(`ChatGPT tool did not switch to ${Y.label}.`);return{Status:W.checked?"Already selected":"Success",Tool:Y.label}}export async function clearChatGPTDraft(Q){await Q.evaluate(`
307
+ })()`)),"chatgpt tool option click");if(i.found)break;await e.wait(0.5)}if(!i?.found)throw new d(`Could not find the ChatGPT ${n.label} tool option.`);if(!i.checked)await e.nativeClick(Number(i.x),Number(i.y));await e.wait(0.5);if((await getCurrentChatGPTTool(e)).tool!==n.key)throw new d(`ChatGPT tool did not switch to ${n.label}.`);return{Status:i.checked?"Already selected":"Success",Tool:n.label}}export async function clearChatGPTDraft(e){await e.evaluate(`
308
308
  (() => {
309
309
  const removeLabels = [/^remove file/i, /^移除文件/];
310
310
  for (let pass = 0; pass < 10; pass += 1) {
@@ -316,7 +316,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
316
316
  button.click();
317
317
  }
318
318
 
319
- const selectors = ${JSON.stringify(x)};
319
+ const selectors = ${JSON.stringify(b)};
320
320
  for (const selector of selectors) {
321
321
  for (const node of document.querySelectorAll(selector)) {
322
322
  if (!(node instanceof HTMLElement)) continue;
@@ -333,15 +333,15 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
333
333
  }
334
334
  }
335
335
  })()
336
- `);await Q.wait(0.5)}export function parseChatGPTProjectId(Q){const X=String(Q??"").trim();if(/^https?:\/\//i.test(X)||X.startsWith("/")){const Z=S(X);if(Z)return Z;throw new k("chatgpt project commands require a chatgpt.com project id or /g/g-p-<id> URL","Example: ppcli chatgpt project-file-add report.pdf --id 12345678")}const Y=X.match(/^g-p-([a-f0-9]{8,})/i);if(Y)return Y[1].toLowerCase();if(/^[a-f0-9]{8,}$/i.test(X))return X.toLowerCase();throw new k("chatgpt project commands require a project id or /g/g-p-<id> URL","Example: ppcli chatgpt project-file-add report.pdf --id 12345678")}export async function sendChatGPTMessage(Q,X){await Q.evaluate(`
336
+ `);await e.wait(0.5)}export function parseChatGPTProjectId(e){const t=String(e??"").trim();if(/^https?:\/\//i.test(t)||t.startsWith("/")){const r=j(t);if(r)return r;throw new g("chatgpt project commands require a chatgpt.com project id or /g/g-p-<id> URL","Example: ppcli chatgpt project-file-add report.pdf --id 12345678")}const n=t.match(/^g-p-([a-f0-9]{8,})/i);if(n)return n[1].toLowerCase();if(/^[a-f0-9]{8,}$/i.test(t))return t.toLowerCase();throw new g("chatgpt project commands require a project id or /g/g-p-<id> URL","Example: ppcli chatgpt project-file-add report.pdf --id 12345678")}export async function sendChatGPTMessage(e,t){await e.evaluate(`
337
337
  (() => {
338
- const labels = ${JSON.stringify(A)};
338
+ const labels = ${JSON.stringify(I)};
339
339
  const closeBtn = Array.from(document.querySelectorAll('button')).find(b => labels.includes(b.getAttribute('aria-label') || ''));
340
340
  if (closeBtn) closeBtn.click();
341
341
  })()
342
- `);const Y=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
342
+ `);const n=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
343
343
  (() => {
344
- ${v()}
344
+ ${P()}
345
345
  const composer = findComposer();
346
346
  if (!composer) return { ready: false };
347
347
  composer.focus();
@@ -363,16 +363,16 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
363
363
  y: Math.round(rect.top + Math.max(8, Math.min(rect.height / 2, rect.height - 8))),
364
364
  };
365
365
  })()
366
- `)),"chatgpt composer readiness");if(!Y.ready)return!1;try{if(Q.nativeType){if(typeof Q.nativeClick==="function"){await Q.nativeClick(Number(Y.x),Number(Y.y));await Q.wait(0.2)}await Q.nativeType(X)}else throw Error("nativeType unavailable")}catch($){await Q.evaluate(`
366
+ `)),"chatgpt composer readiness");if(!n.ready)return!1;try{if(e.nativeType){if(typeof e.nativeClick==="function"){await e.nativeClick(Number(n.x),Number(n.y));await e.wait(0.2)}await e.nativeType(t)}else throw Error("nativeType unavailable")}catch(o){await e.evaluate(`
367
367
  (() => {
368
368
  var composer = null;
369
- var sels = ${JSON.stringify(x)};
369
+ var sels = ${JSON.stringify(b)};
370
370
  for (var si = 0; si < sels.length; si++) { composer = document.querySelector(sels[si]); if (composer) break; }
371
371
  if (!composer) return;
372
372
  composer.focus();
373
- document.execCommand('insertText', false, ${JSON.stringify(X)});
373
+ document.execCommand('insertText', false, ${JSON.stringify(t)});
374
374
  })()
375
- `)}let Z=null;for(let $=0;$<20;$+=1){await Q.wait(0.5);Z=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
375
+ `)}let r=null;for(let o=0;o<20;o+=1){await e.wait(0.5);r=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
376
376
  (() => {
377
377
  const isVisible = (el) => {
378
378
  if (!(el instanceof HTMLElement)) return false;
@@ -387,10 +387,10 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
387
387
  && button.getAttribute('aria-disabled') !== 'true';
388
388
  const form = Array.from(document.querySelectorAll('form')).find((node) => node instanceof HTMLElement && isVisible(node));
389
389
  const root = form || document.body;
390
- const primary = root.querySelector(${JSON.stringify(U)})
391
- || ${JSON.stringify(L)}.map(selector => root.querySelector(selector)).find(Boolean);
390
+ const primary = root.querySelector(${JSON.stringify(T)})
391
+ || ${JSON.stringify(S)}.map(selector => root.querySelector(selector)).find(Boolean);
392
392
  const btns = Array.from(root.querySelectorAll('button'));
393
- const labels = ${JSON.stringify(y)};
393
+ const labels = ${JSON.stringify(k)};
394
394
  const looksLikeSend = (button) => {
395
395
  const label = button.getAttribute('aria-label') || '';
396
396
  const text = (button.innerText || button.textContent || '').replace(/\\s+/g, ' ').trim();
@@ -401,7 +401,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
401
401
  : btns.find(b => looksLikeSend(b) && isUsable(b));
402
402
  return { sendBtnFound: !!sendBtn };
403
403
  })()
404
- `)),"chatgpt send button readiness");if(Z?.sendBtnFound)break}if(!Z?.sendBtnFound)return!1;await Q.evaluate(`
404
+ `)),"chatgpt send button readiness");if(r?.sendBtnFound)break}if(!r?.sendBtnFound)return!1;await e.evaluate(`
405
405
  (() => {
406
406
  const isVisible = (el) => {
407
407
  if (!(el instanceof HTMLElement)) return false;
@@ -416,9 +416,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
416
416
  && button.getAttribute('aria-disabled') !== 'true';
417
417
  const form = Array.from(document.querySelectorAll('form')).find((node) => node instanceof HTMLElement && isVisible(node));
418
418
  const root = form || document.body;
419
- const primary = root.querySelector(${JSON.stringify(U)})
420
- || ${JSON.stringify(L)}.map(selector => root.querySelector(selector)).find(Boolean);
421
- const labels = ${JSON.stringify(y)};
419
+ const primary = root.querySelector(${JSON.stringify(T)})
420
+ || ${JSON.stringify(S)}.map(selector => root.querySelector(selector)).find(Boolean);
421
+ const labels = ${JSON.stringify(k)};
422
422
  const looksLikeSend = (button) => {
423
423
  const label = button.getAttribute('aria-label') || '';
424
424
  const text = (button.innerText || button.textContent || '').replace(/\\s+/g, ' ').trim();
@@ -429,7 +429,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
429
429
  : Array.from(root.querySelectorAll('button')).find(b => looksLikeSend(b) && isUsable(b));
430
430
  if (sendBtn) sendBtn.click();
431
431
  })()
432
- `);return!0}export async function getVisibleMessages(Q){return requireArrayEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
432
+ `);return!0}export async function getVisibleMessages(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
433
433
  const isVisible = (el) => {
434
434
  if (!(el instanceof HTMLElement)) return false;
435
435
  const style = window.getComputedStyle(el);
@@ -475,7 +475,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
475
475
  rows.push({ role, text, html });
476
476
  }
477
477
  return rows;
478
- })()`)),"chatgpt visible messages").map((Y,Z)=>({Index:Z+1,Role:Y?.role==="Assistant"?"Assistant":"User",Text:String(Y?.text||"").trim(),Html:String(Y?.html||"")})).filter((Y)=>Y.Text)}function h(Q,{wantMarkdown:X,generating:Y,stableSeconds:Z}){return Q.map(($)=>({Index:$.Index,Role:$.Role,Text:X&&$.Role==="Assistant"&&$.Html?messageHtmlToMarkdown($.Html)||$.Text:$.Text,Generating:Y,StableSeconds:Z}))}export async function getChatGPTDetailRows(Q,{wantMarkdown:X=!1,stableSeconds:Y=0}={}){const Z=await isGenerating(Q),$=await getVisibleMessages(Q);return{messages:$,rows:h($,{wantMarkdown:X,generating:Z,stableSeconds:Y}),generating:Z}}export async function waitForChatGPTDetailRows(Q,{wantMarkdown:X=!1,timeoutSeconds:Y=120,stableSeconds:Z=6}={}){const $=Date.now();let W="",V=0;while(Date.now()-$<Y*1000){const z=await isGenerating(Q),q=await getVisibleMessages(Q),j=JSON.stringify(q.map((J)=>[J.Role,J.Text]));if(!z&&q.length&&q[q.length-1]?.Role==="Assistant")if(j===W){if(!V)V=Date.now();const J=Math.floor((Date.now()-V)/1000);if(J>=Z)return{messages:q,rows:h(q,{wantMarkdown:X,generating:!1,stableSeconds:J}),generating:!1}}else{W=j;V=Date.now()}else{W=j;V=0}await Q.wait(3)}throw new O("chatgpt detail",Y,"Conversation did not finish or stabilize before timeout. Re-run with a higher --timeout if it is still generating.")}export function messageHtmlToMarkdown(Q){try{return m(Q).trim()}catch{return String(Q||"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}}export async function getBubbleCount(Q){return(await getVisibleMessages(Q)).length}function M(Q){return String(Q||"").replace(/\s+/g," ").trim()}function E(Q,X){return JSON.stringify([M(Q?.Text),String(X?.Text||"").trim()])}export function getChatGPTResponsePairKeys(Q,X){const Y=M(X);if(!Y)return[];const Z=[];for(let $=0;$<Q.length;$+=1){const W=Q[$];if(W?.Role!=="User"||M(W.Text)!==Y)continue;const V=Q.slice($+1).find((z)=>z?.Role==="Assistant");if(!V||!String(V.Text||"").trim())continue;Z.push(E(W,V))}return Z}export function getChatGPTResponsePairCounts(Q,X){const Y=new Map;for(const Z of getChatGPTResponsePairKeys(Q,X))Y.set(Z,(Y.get(Z)||0)+1);return Y}function l(Q){if(Q.baselinePairCounts instanceof Map)return Q.baselinePairCounts;return new Map(Array.from(Q.baselinePairKeys||[]).map((X)=>[X,1]))}function r(Q,X,Y){const Z=M(X);if(!Z)return"";const $=getChatGPTResponsePairCounts(Q,X);for(let W=Q.length-1;W>=0;W-=1){const V=Q[W];if(V?.Role!=="User"||M(V.Text)!==Z)continue;const z=Q.findIndex((J,K)=>K>W&&J?.Role==="Assistant"&&String(J.Text||"").trim());if(z<0)continue;const q=Q[z],j=E(V,q);if(($.get(j)||0)<=(Y.get(j)||0))continue;return String(q.Text||"").trim()}return""}export async function waitForChatGPTResponse(Q,X,Y,Z,$={}){const W=Date.now();let V="",z=0;const q=l($);while(Date.now()-W<Z*1000){await Q.wait(3);if($.conversationUrl){const K=await currentChatGPTUrl(Q);if(K&&!N(K,$.conversationUrl))throw new F(`ChatGPT navigated away from the target conversation (${$.conversationUrl}); current URL is ${K}`)}if(await isGenerating(Q)){z=0;continue}const j=await getVisibleMessages(Q),J=r(j,Y,q);if(!J||J===String(Y||"").trim())continue;if(J===V){z+=1;if(z>=2)return J}else{V=J;z=0}}throw new O("chatgpt ask",Z,"No ChatGPT response appeared before timeout. Re-run with a higher --timeout if it is still generating.")}export async function getConversationList(Q){await ensureOnChatGPT(Q);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
478
+ })()`)),"chatgpt visible messages").map((n,r)=>({Index:r+1,Role:n?.role==="Assistant"?"Assistant":"User",Text:String(n?.text||"").trim(),Html:String(n?.html||"")})).filter((n)=>n.Text)}function N(e,{wantMarkdown:t,generating:n,stableSeconds:r}){return e.map((o)=>({Index:o.Index,Role:o.Role,Text:t&&o.Role==="Assistant"&&o.Html?messageHtmlToMarkdown(o.Html)||o.Text:o.Text,Generating:n,StableSeconds:r}))}export async function getChatGPTDetailRows(e,{wantMarkdown:t=!1,stableSeconds:n=0}={}){const r=await isGenerating(e),o=await getVisibleMessages(e);return{messages:o,rows:N(o,{wantMarkdown:t,generating:r,stableSeconds:n}),generating:r}}export async function waitForChatGPTDetailRows(e,{wantMarkdown:t=!1,timeoutSeconds:n=120,stableSeconds:r=6}={}){const o=Date.now();let i="",l=0;while(Date.now()-o<n*1000){const a=await isGenerating(e),u=await getVisibleMessages(e),c=JSON.stringify(u.map((s)=>[s.Role,s.Text]));if(!a&&u.length&&u[u.length-1]?.Role==="Assistant")if(c===i){if(!l)l=Date.now();const s=Math.floor((Date.now()-l)/1000);if(s>=r)return{messages:u,rows:N(u,{wantMarkdown:t,generating:!1,stableSeconds:s}),generating:!1}}else{i=c;l=Date.now()}else{i=c;l=0}await e.wait(3)}throw new E("chatgpt detail",n,"Conversation did not finish or stabilize before timeout. Re-run with a higher --timeout if it is still generating.")}export function messageHtmlToMarkdown(e){try{return V(e).trim()}catch{return String(e||"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}}export async function getBubbleCount(e){return(await getVisibleMessages(e)).length}function w(e){return String(e||"").replace(/\s+/g," ").trim()}function H(e,t){return JSON.stringify([w(e?.Text),String(t?.Text||"").trim()])}export function getChatGPTResponsePairKeys(e,t){const n=w(t);if(!n)return[];const r=[];for(let o=0;o<e.length;o+=1){const i=e[o];if(i?.Role!=="User"||w(i.Text)!==n)continue;const l=e.slice(o+1).find((a)=>a?.Role==="Assistant");if(!l||!String(l.Text||"").trim())continue;r.push(H(i,l))}return r}export function getChatGPTResponsePairCounts(e,t){const n=new Map;for(const r of getChatGPTResponsePairKeys(e,t))n.set(r,(n.get(r)||0)+1);return n}function J(e){if(e.baselinePairCounts instanceof Map)return e.baselinePairCounts;return new Map(Array.from(e.baselinePairKeys||[]).map((t)=>[t,1]))}function K(e,t,n){const r=w(t);if(!r)return"";const o=getChatGPTResponsePairCounts(e,t);for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l?.Role!=="User"||w(l.Text)!==r)continue;const a=e.findIndex((s,f)=>f>i&&s?.Role==="Assistant"&&String(s.Text||"").trim());if(a<0)continue;const u=e[a],c=H(l,u);if((o.get(c)||0)<=(n.get(c)||0))continue;return String(u.Text||"").trim()}return""}export async function waitForChatGPTResponse(e,t,n,r,o={}){const i=Date.now();let l="",a=0;const u=J(o);while(Date.now()-i<r*1000){await e.wait(3);if(o.conversationUrl){const f=await currentChatGPTUrl(e);if(f&&!x(f,o.conversationUrl))throw new d(`ChatGPT navigated away from the target conversation (${o.conversationUrl}); current URL is ${f}`)}if(await isGenerating(e)){a=0;continue}const c=await getVisibleMessages(e),s=K(c,n,u);if(!s||s===String(n||"").trim())continue;if(s===l){a+=1;if(a>=2)return s}else{l=s;a=0}}throw new E("chatgpt ask",r,"No ChatGPT response appeared before timeout. Re-run with a higher --timeout if it is still generating.")}export async function getConversationList(e){await ensureOnChatGPT(e);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
479
479
  const button = Array.from(document.querySelectorAll('button'))
480
480
  .find((node) => /open sidebar/i.test(node.getAttribute('aria-label') || ''));
481
481
  if (button instanceof HTMLElement) {
@@ -483,7 +483,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
483
483
  return true;
484
484
  }
485
485
  return false;
486
- })()`)),"chatgpt sidebar open state"))try{await Q.wait({selector:R,timeout:3})}catch{}let Y=await C(Q);if(!Y.length){await Q.goto(CHATGPT_URL,{settleMs:2000});try{await Q.wait({selector:R,timeout:8})}catch{}Y=await C(Q)}return Y}async function C(Q){return requireArrayEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
486
+ })()`)),"chatgpt sidebar open state"))try{await e.wait({selector:R,timeout:3})}catch{}let n=await q(e);if(!n.length){await e.goto(CHATGPT_URL,{settleMs:2000});try{await e.wait({selector:R,timeout:8})}catch{}n=await q(e)}return n}async function q(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
487
487
  const isVisible = (el) => {
488
488
  if (!(el instanceof HTMLElement)) return false;
489
489
  const style = window.getComputedStyle(el);
@@ -508,9 +508,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
508
508
  });
509
509
  }
510
510
  return rows;
511
- })()`)),"chatgpt conversation link extraction").map((Y,Z)=>({Index:Z+1,Id:String(Y?.Id||""),Title:String(Y?.Title||"(untitled)").trim()||"(untitled)",Url:String(Y?.Url||"")})).filter((Y)=>Y.Id)}function P(Q){const X=String(Q||"").toLowerCase();if(X.endsWith(".png"))return"image/png";if(X.endsWith(".webp"))return"image/webp";if(X.endsWith(".gif"))return"image/gif";if(X.endsWith(".heic"))return"image/heic";if(X.endsWith(".heif"))return"image/heif";return"image/jpeg"}export async function prepareChatGPTImagePaths(Q){const X=await import("node:fs"),Y=await import("node:path"),Z=Q.map((W)=>Y.default.resolve(W)),$=new Set([".jpg",".jpeg",".png",".webp",".gif",".heic",".heif"]);for(const W of Z){if(!X.default.existsSync(W))return{ok:!1,reason:`Image not found: ${W}`};const V=X.default.statSync(W);if(!V.isFile())return{ok:!1,reason:`Not a file: ${W}`};if(V.size>26214400)return{ok:!1,reason:`Image too large (${(V.size/1024/1024).toFixed(1)} MB). Max: 25 MB`};const z=Y.default.extname(W).toLowerCase();if(!$.has(z))return{ok:!1,reason:`Unsupported image type: ${W}`}}return{ok:!0,paths:Z}}async function p(Q,X){const Y=JSON.stringify(X);for(let Z=0;Z<10;Z+=1){await Q.wait(1);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
511
+ })()`)),"chatgpt conversation link extraction").map((n,r)=>({Index:r+1,Id:String(n?.Id||""),Title:String(n?.Title||"(untitled)").trim()||"(untitled)",Url:String(n?.Url||"")})).filter((n)=>n.Id)}function U(e){const t=String(e||"").toLowerCase();if(t.endsWith(".png"))return"image/png";if(t.endsWith(".webp"))return"image/webp";if(t.endsWith(".gif"))return"image/gif";if(t.endsWith(".heic"))return"image/heic";if(t.endsWith(".heif"))return"image/heif";return"image/jpeg"}export async function prepareChatGPTImagePaths(e){const t=await import("node:fs"),n=await import("node:path"),r=e.map((i)=>n.default.resolve(i)),o=new Set([".jpg",".jpeg",".png",".webp",".gif",".heic",".heif"]);for(const i of r){if(!t.default.existsSync(i))return{ok:!1,reason:`Image not found: ${i}`};const l=t.default.statSync(i);if(!l.isFile())return{ok:!1,reason:`Not a file: ${i}`};if(l.size>26214400)return{ok:!1,reason:`Image too large (${(l.size/1024/1024).toFixed(1)} MB). Max: 25 MB`};const a=n.default.extname(i).toLowerCase();if(!o.has(a))return{ok:!1,reason:`Unsupported image type: ${i}`}}return{ok:!0,paths:r}}async function X(e,t){const n=JSON.stringify(t);for(let r=0;r<10;r+=1){await e.wait(1);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
512
512
  (() => {
513
- const names = ${Y};
513
+ const names = ${n};
514
514
  const text = document.body ? (document.body.innerText || '') : '';
515
515
  const matchedNames = names.filter(name => text.includes(name)).length;
516
516
  if (matchedNames >= names.length) return true;
@@ -535,9 +535,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
535
535
  const previewNodes = Array.from(scope.querySelectorAll('img[src], canvas, video, [style*="background-image"]')).filter(isVisibleMedia);
536
536
  return previewNodes.length >= names.length;
537
537
  })()
538
- `)),"chatgpt upload preview detection"))return!0}return!1}export async function uploadChatGPTImages(Q,X){const Y=await import("node:fs"),Z=await import("node:path"),$=await prepareChatGPTImagePaths(X);if(!$.ok)return $;const W=$.paths,V=W.map((j)=>Z.default.basename(j));let z=!1;if(Q.setFileInput)try{await Q.setFileInput(W,'input[type="file"]');z=!0}catch(j){const J=String(j?.message||j);if(!J.includes("Unknown action")&&!J.includes("not supported")&&!J.includes("Not allowed")&&!J.includes("File access not granted")&&!J.includes("No element found"))throw j}if(!z){const j=W.map((K)=>({name:Z.default.basename(K),mime:P(K),base64:Y.default.readFileSync(K).toString("base64")})),J=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
538
+ `)),"chatgpt upload preview detection"))return!0}return!1}export async function uploadChatGPTImages(e,t){const n=await import("node:fs"),r=await import("node:path"),o=await prepareChatGPTImagePaths(t);if(!o.ok)return o;const i=o.paths,l=i.map((c)=>r.default.basename(c));let a=!1;if(e.setFileInput)try{await e.setFileInput(i,'input[type="file"]');a=!0}catch(c){const s=String(c?.message||c);if(!s.includes("Unknown action")&&!s.includes("not supported")&&!s.includes("Not allowed")&&!s.includes("File access not granted")&&!s.includes("No element found"))throw c}if(!a){const c=i.map((f)=>({name:r.default.basename(f),mime:U(f),base64:n.default.readFileSync(f).toString("base64")})),s=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
539
539
  (() => {
540
- const files = ${JSON.stringify(j)};
540
+ const files = ${JSON.stringify(c)};
541
541
  const input = document.querySelector('input[type="file"]');
542
542
  if (!(input instanceof HTMLInputElement)) {
543
543
  return { ok: false, reason: 'file input not found' };
@@ -571,7 +571,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
571
571
  }
572
572
  return { ok: true };
573
573
  })()
574
- `)),"chatgpt image upload fallback");if(J&&!J.ok)return J}if(!await p(Q,V))return{ok:!1,reason:"image upload preview did not appear"};return{ok:!0,files:W}}export async function isGenerating(Q){return requireBooleanEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
574
+ `)),"chatgpt image upload fallback");if(s&&!s.ok)return s}if(!await X(e,l))return{ok:!1,reason:"image upload preview did not appear"};return{ok:!0,files:i}}export async function isGenerating(e){return requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
575
575
  (() => {
576
576
  const text = (document.body?.innerText || '').replace(/\\s+/g, ' ');
577
577
  if (/正在思考|停止生成|Thinking/.test(text)) return true;
@@ -583,7 +583,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
583
583
  || label.includes('正在思考');
584
584
  });
585
585
  })()
586
- `)),"chatgpt generation state")}export async function getChatGPTVisibleImageUrls(Q){return requireArrayEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
586
+ `)),"chatgpt generation state")}export async function getChatGPTVisibleImageUrls(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
587
587
  (() => {
588
588
  const isVisible = (el) => {
589
589
  if (!(el instanceof HTMLElement)) return false;
@@ -701,9 +701,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
701
701
  }
702
702
  return urls;
703
703
  })()
704
- `)),"chatgpt visible image url extraction")}export async function waitForChatGPTImages(Q,X,Y,Z){const $=new Set(X),W=3,V=Math.max(1,Math.ceil(Y/W));let z=[],q=0;for(let j=0;j<V;j++){await Q.wait(j===0?3:W);let J="";if(Z&&Z.includes("/c/")){J=unwrapEvaluateResult(await Q.evaluate("window.location.href").catch(()=>""));if(J&&!N(J,Z)){await Q.goto(Z);await Q.sleep(3)}}if(await isGenerating(Q))continue;if(Z&&Z.includes("/c/")&&j>0&&j%5===0){if(!J||N(J,Z)){await Q.goto(Z);await Q.sleep(3)}}const B=(await getChatGPTVisibleImageUrls(Q)).filter((b)=>!$.has(b));if(B.length===0)continue;const H=B.join(`
705
- `),D=z.join(`
706
- `);if(H===D)q+=1;else{z=B;q=1}if(q>=2||j===V-1)return z}return z}export async function getProjectList(Q){await ensureOnChatGPT(Q);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
704
+ `)),"chatgpt visible image url extraction")}export async function waitForChatGPTImages(e,t,n,r){const o=new Set(t),i=3,l=Math.max(1,Math.ceil(n/i));let a=[],u=0;for(let c=0;c<l;c++){await e.wait(c===0?3:i);let s="";if(r&&r.includes("/c/")){s=unwrapEvaluateResult(await e.evaluate("window.location.href").catch(()=>""));if(s&&!x(s,r)){await e.goto(r);await e.sleep(3)}}if(await isGenerating(e))continue;if(r&&r.includes("/c/")&&c>0&&c%5===0){if(!s||x(s,r)){await e.goto(r);await e.sleep(3)}}const p=(await getChatGPTVisibleImageUrls(e)).filter((L)=>!o.has(L));if(p.length===0)continue;const h=p.join(`
705
+ `),m=a.join(`
706
+ `);if(h===m)u+=1;else{a=p;u=1}if(u>=2||c===l-1)return a}return a}export async function getProjectList(e){await ensureOnChatGPT(e);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
707
707
  const button = Array.from(document.querySelectorAll('button'))
708
708
  .find((node) => /open sidebar/i.test(node.getAttribute('aria-label') || ''));
709
709
  if (button instanceof HTMLElement) {
@@ -711,7 +711,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
711
711
  return true;
712
712
  }
713
713
  return false;
714
- })()`)),"chatgpt sidebar open state"))await Q.wait(0.5);await Q.evaluate(`(() => {
714
+ })()`)),"chatgpt sidebar open state"))await e.wait(0.5);await e.evaluate(`(() => {
715
715
  var btn = Array.from(document.querySelectorAll('button')).find(function(b) {
716
716
  var text = (b.innerText || '').trim();
717
717
  return text === 'Show more' || text === '显示更多' || text === '查看更多';
@@ -719,7 +719,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
719
719
  if (btn instanceof HTMLElement) {
720
720
  btn.click();
721
721
  }
722
- })()`);await Q.wait(0.5);let Y=await T(Q);if(!Y.length){await Q.goto(CHATGPT_URL,{settleMs:2000});await Q.wait(1);await Q.evaluate(`(() => {
722
+ })()`);await e.wait(0.5);let n=await z(e);if(!n.length){await e.goto(CHATGPT_URL,{settleMs:2000});await e.wait(1);await e.evaluate(`(() => {
723
723
  var btn = Array.from(document.querySelectorAll('button')).find(function(b) {
724
724
  var text = (b.innerText || '').trim();
725
725
  return text === 'Show more' || text === '显示更多' || text === '查看更多';
@@ -727,8 +727,8 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
727
727
  if (btn instanceof HTMLElement) {
728
728
  btn.click();
729
729
  }
730
- })()`);await Q.wait(0.5);Y=await T(Q)}return Y}async function T(Q){return requireArrayEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`(() => {
731
- const projectLinkSelector = ${JSON.stringify(c)};
730
+ })()`);await e.wait(0.5);n=await z(e)}return n}async function z(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
731
+ const projectLinkSelector = ${JSON.stringify(O)};
732
732
  const isVisible = (el) => {
733
733
  if (!(el instanceof HTMLElement)) return false;
734
734
  const style = window.getComputedStyle(el);
@@ -837,9 +837,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
837
837
  }
838
838
 
839
839
  return rows;
840
- })()`)),"chatgpt project link extraction").map(function(Y,Z){return{Index:Z+1,Id:String(Y?.Id||""),Title:String(Y?.Title||"(untitled project)").trim()||"(untitled project)",Url:String(Y?.Url||"")}}).filter(function(Y){return Y.Id})}const s=["Add files","Add sources","添加文件","Project files","项目文件"],d=['[role="tabpanel"][data-state="active"] [data-project-home-sources-surface="true"] input[type="file"]:not([accept])','[data-project-home-sources-surface="true"] input[type="file"]:not([accept])','[role="dialog"] input[type="file"]','[data-testid*="project-files"] input[type="file"]','[data-testid*="project"] input[type="file"]'];export async function navigateToProject(Q,X){const Y=parseChatGPTProjectId(X);await Q.goto(`${CHATGPT_URL}/g/g-p-${Y}`,{settleMs:2000});try{await Q.wait({selector:f,timeout:10})}catch{}const Z=await getPageState(Q);if(S(Z.url)===Y)return Y;if(Z.hasLoginGate||!Z.isLoggedIn)throw new _(CHATGPT_DOMAIN,"ChatGPT project requires a logged-in ChatGPT session.");throw new F(`ChatGPT did not open the requested project ${Y}.`,`Current URL: ${Z.url||"(unknown)"}`)}export async function openProjectKnowledgeDialog(Q){const X=unwrapEvaluateResult(await Q.evaluate(`
840
+ })()`)),"chatgpt project link extraction").map(function(n,r){return{Index:r+1,Id:String(n?.Id||""),Title:String(n?.Title||"(untitled project)").trim()||"(untitled project)",Url:String(n?.Url||"")}}).filter(function(n){return n.Id})}const Y=["Add files","Add sources","添加文件","Project files","项目文件"],G=['[role="tabpanel"][data-state="active"] [data-project-home-sources-surface="true"] input[type="file"]:not([accept])','[data-project-home-sources-surface="true"] input[type="file"]:not([accept])','[role="dialog"] input[type="file"]','[data-testid*="project-files"] input[type="file"]','[data-testid*="project"] input[type="file"]'];export async function navigateToProject(e,t){const n=parseChatGPTProjectId(t);await e.goto(`${CHATGPT_URL}/g/g-p-${n}`,{settleMs:2000});try{await e.wait({selector:C,timeout:10})}catch{}const r=await getPageState(e);if(j(r.url)===n)return n;if(r.hasLoginGate||!r.isLoggedIn)throw new A(CHATGPT_DOMAIN,"ChatGPT project requires a logged-in ChatGPT session.");throw new d(`ChatGPT did not open the requested project ${n}.`,`Current URL: ${r.url||"(unknown)"}`)}export async function openProjectKnowledgeDialog(e){const t=unwrapEvaluateResult(await e.evaluate(`
841
841
  (() => {
842
- const labels = ${JSON.stringify(s)};
842
+ const labels = ${JSON.stringify(Y)};
843
843
  const isVisible = (el) => {
844
844
  if (!(el instanceof HTMLElement)) return false;
845
845
  const style = window.getComputedStyle(el);
@@ -919,12 +919,12 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
919
919
 
920
920
  return { ok: false };
921
921
  })()
922
- `)),Y=typeof X==="boolean"?{ok:X}:requireObjectEvaluateResult(X,"chatgpt project knowledge dialog open");if(Y.ok){if(Y.nativeClick&&typeof Q.nativeClick==="function")try{await Q.nativeClick(Y.nativeClick.x,Y.nativeClick.y)}catch{}if(Y.nativeClick&&typeof Q.click==="function")try{await Q.click('[role="tab"][id$="-sources"]')}catch{}await Q.wait(1);try{await Q.wait({selector:'[role="dialog"], [data-project-home-sources-surface="true"] input[type="file"]',timeout:5})}catch{}return!0}return!1}export async function uploadChatGPTProjectFiles(Q,X,Y){const Z=parseChatGPTProjectId(X),$=await import("node:fs"),W=await import("node:path"),V=await prepareChatGPTFilePaths(Y);if(!V.ok)return{...V,inputError:!0};const z=V.paths;await navigateToProject(Q,Z);await ensureChatGPTLogin(Q,"ChatGPT project file upload requires a logged-in ChatGPT session.");if(!await openProjectKnowledgeDialog(Q))return{ok:!1,reason:'could not find or click the project "Add files" button'};const j=z.map((B)=>W.default.basename(B));let J=!1;if(Q.setFileInput)for(const B of d)try{await Q.setFileInput(z,B);J=!0;break}catch(H){const D=String(H?.message||H);if(!D.includes("Unknown action")&&!D.includes("not supported")&&!D.includes("Not allowed")&&!D.includes("File access not granted")&&!D.includes("No element found"))throw H}if(!J){const B=z.map((D)=>({name:W.default.basename(D),mime:i(D),base64:$.default.readFileSync(D).toString("base64")})),H=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
922
+ `)),n=typeof t==="boolean"?{ok:t}:requireObjectEvaluateResult(t,"chatgpt project knowledge dialog open");if(n.ok){if(n.nativeClick&&typeof e.nativeClick==="function")try{await e.nativeClick(n.nativeClick.x,n.nativeClick.y)}catch{}if(n.nativeClick&&typeof e.click==="function")try{await e.click('[role="tab"][id$="-sources"]')}catch{}await e.wait(1);try{await e.wait({selector:'[role="dialog"], [data-project-home-sources-surface="true"] input[type="file"]',timeout:5})}catch{}return!0}return!1}export async function uploadChatGPTProjectFiles(e,t,n){const r=parseChatGPTProjectId(t),o=await import("node:fs"),i=await import("node:path"),l=await prepareChatGPTFilePaths(n);if(!l.ok)return{...l,inputError:!0};const a=l.paths;await navigateToProject(e,r);await ensureChatGPTLogin(e,"ChatGPT project file upload requires a logged-in ChatGPT session.");if(!await openProjectKnowledgeDialog(e))return{ok:!1,reason:'could not find or click the project "Add files" button'};const c=a.map((p)=>i.default.basename(p));let s=!1;if(e.setFileInput)for(const p of G)try{await e.setFileInput(a,p);s=!0;break}catch(h){const m=String(h?.message||h);if(!m.includes("Unknown action")&&!m.includes("not supported")&&!m.includes("Not allowed")&&!m.includes("File access not granted")&&!m.includes("No element found"))throw h}if(!s){const p=a.map((m)=>({name:i.default.basename(m),mime:B(m),base64:o.default.readFileSync(m).toString("base64")})),h=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
923
923
  (() => {
924
- const files = ${JSON.stringify(B)};
924
+ const files = ${JSON.stringify(p)};
925
925
 
926
926
  // Look for file input inside a dialog or the project area
927
- const selectors = ${JSON.stringify(d)};
927
+ const selectors = ${JSON.stringify(G)};
928
928
  let input = null;
929
929
  for (const sel of selectors) {
930
930
  input = document.querySelector(sel);
@@ -973,9 +973,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
973
973
  }
974
974
  return { ok: true };
975
975
  })()
976
- `)),"chatgpt project file upload fallback");if(H&&!H.ok)return H}const K=await t(Q,j);if(!K.ok)return K;return{ok:!0,files:z}}async function t(Q,X){const Y=X.map(($)=>String($||"").trim()).filter(Boolean);if(!Y.length)return{ok:!0};let Z="uploaded file did not appear in project knowledge";for(let $=0;$<10;$+=1){const W=requireObjectEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
976
+ `)),"chatgpt project file upload fallback");if(h&&!h.ok)return h}const f=await Z(e,c);if(!f.ok)return f;return{ok:!0,files:a}}async function Z(e,t){const n=t.map((o)=>String(o||"").trim()).filter(Boolean);if(!n.length)return{ok:!0};let r="uploaded file did not appear in project knowledge";for(let o=0;o<10;o+=1){const i=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
977
977
  (() => {
978
- const expectedFileNames = ${JSON.stringify(Y)};
978
+ const expectedFileNames = ${JSON.stringify(n)};
979
979
  const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
980
980
  const root = document.querySelector('[role="dialog"]')
981
981
  || document.querySelector('[data-project-home-sources-surface="true"]')
@@ -995,7 +995,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
995
995
  if (!missing.length) return { ok: true };
996
996
  return { ok: false, pending: true, reason: 'uploaded file did not appear in project knowledge: ' + missing.join(', ') };
997
997
  })()
998
- `)),"chatgpt project upload confirmation");if(W.ok===!0)return{ok:!0};Z=String(W.reason||Z);if(!W.pending)return{ok:!1,reason:Z};await Q.wait(0.5)}return{ok:!1,reason:Z}}export async function prepareChatGPTFilePaths(Q){const X=await import("node:fs"),Y=await import("node:path"),Z=Q.map(($)=>Y.default.resolve($));for(const $ of Z){if(!X.default.existsSync($))return{ok:!1,reason:`File not found: ${$}`};const W=X.default.statSync($);if(!W.isFile())return{ok:!1,reason:`Not a file: ${$}`};if(W.size>536870912)return{ok:!1,reason:`File too large (${(W.size/1024/1024).toFixed(1)} MB). Max: 512 MB`}}return{ok:!0,paths:Z}}function i(Q){const X=String(Q||"").toLowerCase();if(X.endsWith(".pdf"))return"application/pdf";if(X.endsWith(".doc"))return"application/msword";if(X.endsWith(".docx"))return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";if(X.endsWith(".xls"))return"application/vnd.ms-excel";if(X.endsWith(".xlsx"))return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(X.endsWith(".ppt"))return"application/vnd.ms-powerpoint";if(X.endsWith(".pptx"))return"application/vnd.openxmlformats-officedocument.presentationml.presentation";if(X.endsWith(".csv"))return"text/csv";if(X.endsWith(".txt"))return"text/plain";if(X.endsWith(".json"))return"application/json";if(X.endsWith(".xml"))return"application/xml";if(X.endsWith(".html")||X.endsWith(".htm"))return"text/html";if(X.endsWith(".md"))return"text/markdown";if(X.endsWith(".py"))return"text/x-python";if(X.endsWith(".js"))return"text/javascript";if(X.endsWith(".ts"))return"application/typescript";if(X.endsWith(".jsx"))return"text/jsx";if(X.endsWith(".tsx"))return"text/tsx";if(X.endsWith(".png"))return"image/png";if(X.endsWith(".jpg")||X.endsWith(".jpeg"))return"image/jpeg";if(X.endsWith(".gif"))return"image/gif";if(X.endsWith(".webp"))return"image/webp";if(X.endsWith(".svg"))return"image/svg+xml";return"application/octet-stream"}export const __test__={COMPOSER_SELECTORS:x,SEND_BUTTON_SELECTOR:U,SEND_BUTTON_FALLBACK_SELECTORS:L,SEND_BUTTON_LABELS:y,CLOSE_SIDEBAR_LABELS:A,buildComposerLocatorScript:v,isSameChatGPTConversation:N,parseChatGPTConversationId,parseChatGPTProjectId,imageMimeFromPath:P,mimeFromFilePath:i,PROJECT_LINK_SELECTOR:c};export async function getChatGPTImageAssets(Q,X){const Y=JSON.stringify(X);return requireArrayEvaluateResult(unwrapEvaluateResult(await Q.evaluate(`
998
+ `)),"chatgpt project upload confirmation");if(i.ok===!0)return{ok:!0};r=String(i.reason||r);if(!i.pending)return{ok:!1,reason:r};await e.wait(0.5)}return{ok:!1,reason:r}}export async function prepareChatGPTFilePaths(e){const t=await import("node:fs"),n=await import("node:path"),r=e.map((o)=>n.default.resolve(o));for(const o of r){if(!t.default.existsSync(o))return{ok:!1,reason:`File not found: ${o}`};const i=t.default.statSync(o);if(!i.isFile())return{ok:!1,reason:`Not a file: ${o}`};if(i.size>536870912)return{ok:!1,reason:`File too large (${(i.size/1024/1024).toFixed(1)} MB). Max: 512 MB`}}return{ok:!0,paths:r}}function B(e){const t=String(e||"").toLowerCase();if(t.endsWith(".pdf"))return"application/pdf";if(t.endsWith(".doc"))return"application/msword";if(t.endsWith(".docx"))return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";if(t.endsWith(".xls"))return"application/vnd.ms-excel";if(t.endsWith(".xlsx"))return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(t.endsWith(".ppt"))return"application/vnd.ms-powerpoint";if(t.endsWith(".pptx"))return"application/vnd.openxmlformats-officedocument.presentationml.presentation";if(t.endsWith(".csv"))return"text/csv";if(t.endsWith(".txt"))return"text/plain";if(t.endsWith(".json"))return"application/json";if(t.endsWith(".xml"))return"application/xml";if(t.endsWith(".html")||t.endsWith(".htm"))return"text/html";if(t.endsWith(".md"))return"text/markdown";if(t.endsWith(".py"))return"text/x-python";if(t.endsWith(".js"))return"text/javascript";if(t.endsWith(".ts"))return"application/typescript";if(t.endsWith(".jsx"))return"text/jsx";if(t.endsWith(".tsx"))return"text/tsx";if(t.endsWith(".png"))return"image/png";if(t.endsWith(".jpg")||t.endsWith(".jpeg"))return"image/jpeg";if(t.endsWith(".gif"))return"image/gif";if(t.endsWith(".webp"))return"image/webp";if(t.endsWith(".svg"))return"image/svg+xml";return"application/octet-stream"}export const __test__={COMPOSER_SELECTORS:b,SEND_BUTTON_SELECTOR:T,SEND_BUTTON_FALLBACK_SELECTORS:S,SEND_BUTTON_LABELS:k,CLOSE_SIDEBAR_LABELS:I,buildComposerLocatorScript:P,isSameChatGPTConversation:x,parseChatGPTConversationId,parseChatGPTProjectId,imageMimeFromPath:U,mimeFromFilePath:B,PROJECT_LINK_SELECTOR:O};export async function getChatGPTImageAssets(e,t){const n=JSON.stringify(t);return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
999
999
  (async (targetUrls) => {
1000
1000
  const blobToDataUrl = (blob) => new Promise((resolve, reject) => {
1001
1001
  const reader = new FileReader();
@@ -1088,5 +1088,5 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
1088
1088
  }
1089
1089
 
1090
1090
  return results;
1091
- })(${Y})
1091
+ })(${n})
1092
1092
  `)),"chatgpt image asset export")}
@@ -1 +1 @@
1
- import{statSync as B}from"node:fs";import{cli as N,Strategy as O}from"@jackwener/opencli/registry";import{ArgumentError as U,ConfigError as V,TimeoutError as j}from"@jackwener/opencli/errors";import{activateChatGPT as W,getVisibleChatMessages as R,selectModel as A,MODEL_CHOICES as I,isGenerating as y,sendPrompt as M}from"./ax.js";export const askCommand=N({site:"chatgpt-app",name:"ask",access:"write",description:"Send a prompt and wait for the AI response (send + wait + read)",domain:"localhost",strategy:O.PUBLIC,browser:!1,args:[{name:"text",fromFile:!0,required:!0,positional:!0,help:"Prompt to send"},{name:"model",required:!1,help:"Model/mode to use: auto, instant, thinking, 5.2-instant, 5.2-thinking",choices:I},{name:"timeout",type:"int",required:!1,help:"Max seconds to wait for response (default: 30)",default:30},{name:"image",required:!1,help:"Path to local image to attach (optional)"}],columns:["Role","Text"],func:async(F)=>{if(process.platform!=="darwin")throw new V("ChatGPT Desktop integration requires macOS (osascript is not available on this platform)");const{text:K,model:X,timeout:J,image:z}=F;if(z){let q;try{q=B(z)}catch{throw new U(`The specified image path does not exist: ${z}`)}if(!q.isFile())throw new U(`The specified image path is not a file: ${z}`)}if(!Number.isInteger(J)||J<1)throw new U("--timeout must be a positive integer (seconds)");if(X){W();A(X)}const Y=R();W();M(K,z);const Z=2,_=Math.ceil(J/Z);let Q="",$=!1;for(let q=0;q<_;q++){await new Promise((H)=>setTimeout(H,Z*1000));if(y()){$=!0;continue}if(!$&&q<3)continue;W(0.3);const D=R();if(D.length>Y.length){const L=[...D.slice(Y.length)].reverse().find((b)=>b!==K);if(L)Q=L}break}if(!Q)throw new j("chatgpt-app/ask",J,"ChatGPT may still be generating; rerun read or increase --timeout");return[{Role:"User",Text:K},{Role:"Assistant",Text:Q}]}});
1
+ import{statSync as x}from"node:fs";import{cli as T,Strategy as C}from"@jackwener/opencli/registry";import{ArgumentError as n,ConfigError as P,TimeoutError as M}from"@jackwener/opencli/errors";import{activateChatGPT as r,getVisibleChatMessages as h,selectModel as b,MODEL_CHOICES as y,isGenerating as S,sendPrompt as q}from"./ax.js";export const askCommand=T({site:"chatgpt-app",name:"ask",access:"write",description:"Send a prompt and wait for the AI response (send + wait + read)",domain:"localhost",strategy:C.PUBLIC,browser:!1,args:[{name:"text",fromFile:!0,required:!0,positional:!0,help:"Prompt to send"},{name:"model",required:!1,help:"Model/mode to use: auto, instant, thinking, 5.2-instant, 5.2-thinking",choices:y},{name:"timeout",type:"int",required:!1,help:"Max seconds to wait for response (default: 30)",default:30},{name:"image",required:!1,help:"Path to local image to attach (optional)"}],columns:["Role","Text"],func:async(o)=>{if(process.platform!=="darwin")throw new P("ChatGPT Desktop integration requires macOS (osascript is not available on this platform)");const{text:s,model:l,timeout:i,image:t}=o;if(t){let e;try{e=x(t)}catch{throw new n(`The specified image path does not exist: ${t}`)}if(!e.isFile())throw new n(`The specified image path is not a file: ${t}`)}if(!Number.isInteger(i)||i<1)throw new n("--timeout must be a positive integer (seconds)");if(l){r();b(l)}const m=h();r();q(s,t);const c=2,u=Math.ceil(i/c);let a="",p=!1;for(let e=0;e<u;e++){await new Promise((d)=>setTimeout(d,c*1000));if(S()){p=!0;continue}if(!p&&e<3)continue;r(0.3);const f=h();if(f.length>m.length){const g=[...f.slice(m.length)].reverse().find((w)=>w!==s);if(g)a=g}break}if(!a)throw new M("chatgpt-app/ask",i,"ChatGPT may still be generating; rerun read or increase --timeout");return[{Role:"User",Text:s},{Role:"Assistant",Text:a}]}});
@@ -1 +1 @@
1
- import{cli as K,Strategy as N}from"@jackwener/opencli/registry";import{CommandExecutionError as Q,ConfigError as R,getErrorMessage as U}from"@jackwener/opencli/errors";import{activateChatGPT as B,selectModel as V,MODEL_CHOICES as W,sendPrompt as X}from"./ax.js";export const sendCommand=K({site:"chatgpt-app",name:"send",access:"write",description:"Send a message to the active ChatGPT Desktop App window",domain:"localhost",strategy:N.PUBLIC,browser:!1,args:[{name:"text",fromFile:!0,required:!0,positional:!0,help:"Message to send"},{name:"model",required:!1,help:"Model/mode to use: auto, instant, thinking, 5.2-instant, 5.2-thinking",choices:W}],columns:["Status"],func:async(z)=>{if(process.platform!=="darwin")throw new R("ChatGPT Desktop integration requires macOS (osascript is not available on this platform)");const{text:F,model:A}=z;try{if(A){B();V(A)}B();X(F);return[{Status:"Success"}]}catch(J){throw new Q("Failed to send ChatGPT message: "+U(J))}}});
1
+ import{cli as a,Strategy as n}from"@jackwener/opencli/registry";import{CommandExecutionError as i,ConfigError as m,getErrorMessage as c}from"@jackwener/opencli/errors";import{activateChatGPT as o,selectModel as d,MODEL_CHOICES as l,sendPrompt as p}from"./ax.js";export const sendCommand=a({site:"chatgpt-app",name:"send",access:"write",description:"Send a message to the active ChatGPT Desktop App window",domain:"localhost",strategy:n.PUBLIC,browser:!1,args:[{name:"text",fromFile:!0,required:!0,positional:!0,help:"Message to send"},{name:"model",required:!1,help:"Model/mode to use: auto, instant, thinking, 5.2-instant, 5.2-thinking",choices:l}],columns:["Status"],func:async(e)=>{if(process.platform!=="darwin")throw new m("ChatGPT Desktop integration requires macOS (osascript is not available on this platform)");const{text:r,model:t}=e;try{if(t){o();d(t)}o();p(r);return[{Status:"Success"}]}catch(s){throw new i("Failed to send ChatGPT message: "+c(s))}}});