publishport-opencli 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1041) hide show
  1. package/clis/12306/me.js +2 -2
  2. package/clis/12306/orders.js +3 -3
  3. package/clis/12306/passengers.js +3 -3
  4. package/clis/12306/price.js +1 -1
  5. package/clis/12306/stations.js +1 -1
  6. package/clis/12306/train.js +1 -1
  7. package/clis/12306/trains.js +1 -1
  8. package/clis/12306/utils.js +1 -1
  9. package/clis/1688/download.js +1 -1
  10. package/clis/1688/item.js +4 -4
  11. package/clis/1688/search.js +4 -4
  12. package/clis/1688/store.js +4 -4
  13. package/clis/1point3acres/forum.js +1 -1
  14. package/clis/1point3acres/forums.js +1 -1
  15. package/clis/1point3acres/notifications.js +1 -1
  16. package/clis/1point3acres/search.js +1 -1
  17. package/clis/1point3acres/thread.js +2 -2
  18. package/clis/1point3acres/user.js +1 -1
  19. package/clis/1point3acres/utils.js +2 -2
  20. package/clis/36kr/article.js +2 -2
  21. package/clis/36kr/hot.js +2 -2
  22. package/clis/36kr/news.js +1 -1
  23. package/clis/36kr/search.js +2 -2
  24. package/clis/51job/company.js +2 -2
  25. package/clis/51job/detail.js +2 -2
  26. package/clis/51job/hot.js +1 -1
  27. package/clis/51job/search.js +1 -1
  28. package/clis/51job/utils.js +7 -7
  29. package/clis/_atlassian/shared.js +9 -9
  30. package/clis/_shared/article/auth.js +4 -4
  31. package/clis/_shared/article/douban-md2draft.js +4 -4
  32. package/clis/_shared/article/format.js +1 -1
  33. package/clis/_shared/article/images.js +7 -7
  34. package/clis/_shared/article/login.js +1 -1
  35. package/clis/_shared/article/publish.js +11 -11
  36. package/clis/_shared/common.js +1 -1
  37. package/clis/_shared/content-guard.js +1 -1
  38. package/clis/_shared/desktop-commands.js +1 -1
  39. package/clis/_shared/file-inject.js +12 -12
  40. package/clis/_shared/self-hosted-sites.js +2 -2
  41. package/clis/_shared/site-auth.js +1 -1
  42. package/clis/_shared/token-auth.js +2 -2
  43. package/clis/_shared/video-publish.js +9 -9
  44. package/clis/amazon/offer.js +3 -3
  45. package/clis/amazon/product.js +5 -5
  46. package/clis/amazon/shared.js +6 -6
  47. package/clis/antigravity/_actions.js +13 -13
  48. package/clis/antigravity/audit-extras.js +10 -10
  49. package/clis/antigravity/delete.js +1 -1
  50. package/clis/antigravity/model.js +6 -6
  51. package/clis/antigravity/new.js +2 -2
  52. package/clis/antigravity/read.js +2 -2
  53. package/clis/antigravity/rename.js +1 -1
  54. package/clis/antigravity/send.js +3 -3
  55. package/clis/antigravity/serve.js +17 -17
  56. package/clis/antigravity/storage.js +6 -6
  57. package/clis/antigravity/watch.js +2 -2
  58. package/clis/apple-podcasts/episodes.js +1 -1
  59. package/clis/apple-podcasts/top.js +1 -1
  60. package/clis/apple-podcasts/utils.js +1 -1
  61. package/clis/archive/item.js +1 -1
  62. package/clis/archive/search.js +1 -1
  63. package/clis/archive/snapshots.js +1 -1
  64. package/clis/archive/wayback.js +1 -1
  65. package/clis/arxiv/author.js +1 -1
  66. package/clis/arxiv/utils.js +1 -1
  67. package/clis/autohome/brand.js +1 -1
  68. package/clis/autohome/score.js +1 -1
  69. package/clis/autohome/utils.js +1 -1
  70. package/clis/baijiahao/article.js +1 -1
  71. package/clis/baijiahao/lists.js +1 -1
  72. package/clis/baijiahao/login.js +1 -1
  73. package/clis/baijiahao/publish.js +9 -9
  74. package/clis/baijiahao/stats.js +1 -1
  75. package/clis/baijiahao/whoami.js +1 -1
  76. package/clis/band/bands.js +2 -2
  77. package/clis/band/mentions.js +2 -2
  78. package/clis/band/post.js +4 -4
  79. package/clis/band/posts.js +3 -3
  80. package/clis/barchart/flow.js +3 -3
  81. package/clis/barchart/greeks.js +2 -2
  82. package/clis/barchart/quote.js +3 -3
  83. package/clis/bbc/news.js +1 -1
  84. package/clis/bbc/topic.js +1 -1
  85. package/clis/bbc/utils.js +1 -1
  86. package/clis/bilibili/article.js +1 -1
  87. package/clis/bilibili/categories.js +1 -1
  88. package/clis/bilibili/coin.js +1 -1
  89. package/clis/bilibili/comment-del.js +1 -1
  90. package/clis/bilibili/comment-like.js +1 -1
  91. package/clis/bilibili/comment.js +1 -1
  92. package/clis/bilibili/comments.js +1 -1
  93. package/clis/bilibili/dm-list.js +1 -1
  94. package/clis/bilibili/dm-read.js +1 -1
  95. package/clis/bilibili/dm-send.js +1 -1
  96. package/clis/bilibili/download.js +2 -2
  97. package/clis/bilibili/drafts.js +1 -1
  98. package/clis/bilibili/dynamic-post.js +3 -3
  99. package/clis/bilibili/favorite-add.js +1 -1
  100. package/clis/bilibili/favorite.js +1 -1
  101. package/clis/bilibili/feed.js +2 -2
  102. package/clis/bilibili/follow.js +1 -1
  103. package/clis/bilibili/following.js +1 -1
  104. package/clis/bilibili/like.js +1 -1
  105. package/clis/bilibili/partitions.js +1 -1
  106. package/clis/bilibili/stats.js +1 -1
  107. package/clis/bilibili/subtitle.js +3 -3
  108. package/clis/bilibili/summary.js +1 -1
  109. package/clis/bilibili/topics.js +1 -1
  110. package/clis/bilibili/unfollow.js +1 -1
  111. package/clis/bilibili/upload.js +1 -1
  112. package/clis/bilibili/utils.js +10 -10
  113. package/clis/bilibili/video-drafts.js +1 -1
  114. package/clis/bilibili/video.js +1 -1
  115. package/clis/bloomberg/businessweek.js +4 -4
  116. package/clis/bloomberg/news.js +2 -2
  117. package/clis/bloomberg/utils.js +13 -13
  118. package/clis/bluesky/post.js +1 -1
  119. package/clis/bluesky/shared.js +11 -11
  120. package/clis/bluesky/whoami.js +1 -1
  121. package/clis/booking/search.js +2 -2
  122. package/clis/boss/accept.js +1 -1
  123. package/clis/boss/applied.js +1 -1
  124. package/clis/boss/auth.js +1 -1
  125. package/clis/boss/batchgreet.js +1 -1
  126. package/clis/boss/bossinfo.js +1 -1
  127. package/clis/boss/chatlist.js +1 -1
  128. package/clis/boss/chatmsg.js +1 -1
  129. package/clis/boss/cities.js +1 -1
  130. package/clis/boss/detail.js +1 -1
  131. package/clis/boss/exchange.js +1 -1
  132. package/clis/boss/greet.js +1 -1
  133. package/clis/boss/interviews.js +1 -1
  134. package/clis/boss/invite.js +1 -1
  135. package/clis/boss/joblist.js +1 -1
  136. package/clis/boss/mark.js +1 -1
  137. package/clis/boss/me.js +2 -2
  138. package/clis/boss/recommend.js +1 -1
  139. package/clis/boss/resumedelete.js +1 -1
  140. package/clis/boss/resumelist.js +1 -1
  141. package/clis/boss/resumeupload.js +11 -11
  142. package/clis/boss/search.js +1 -1
  143. package/clis/boss/send.js +1 -1
  144. package/clis/boss/sendresume.js +1 -1
  145. package/clis/boss/stats.js +1 -1
  146. package/clis/boss/unread.js +1 -1
  147. package/clis/boss/utils.js +13 -13
  148. package/clis/chaoxing/assignments.js +1 -1
  149. package/clis/chaoxing/exams.js +1 -1
  150. package/clis/chaoxing/utils.js +9 -9
  151. package/clis/chatgpt/ask.js +1 -1
  152. package/clis/chatgpt/auth.js +2 -2
  153. package/clis/chatgpt/detail.js +1 -1
  154. package/clis/chatgpt/image.js +1 -1
  155. package/clis/chatgpt/read.js +1 -1
  156. package/clis/chatgpt/send.js +1 -1
  157. package/clis/chatgpt/utils.js +59 -59
  158. package/clis/chatgpt-app/ask.js +1 -1
  159. package/clis/chatgpt-app/send.js +1 -1
  160. package/clis/chatwise/model.js +6 -6
  161. package/clis/chess/analyze.js +1 -1
  162. package/clis/chess/game.js +1 -1
  163. package/clis/chess/games.js +1 -1
  164. package/clis/chess/stats.js +1 -1
  165. package/clis/chess/utils.js +1 -1
  166. package/clis/claude/ask.js +2 -2
  167. package/clis/claude/detail.js +1 -1
  168. package/clis/claude/new.js +1 -1
  169. package/clis/claude/read.js +1 -1
  170. package/clis/claude/send.js +1 -1
  171. package/clis/claude/utils.js +23 -23
  172. package/clis/cnblogs/article.js +1 -1
  173. package/clis/cnblogs/login.js +1 -1
  174. package/clis/cnblogs/stats.js +7 -7
  175. package/clis/cnblogs/whoami.js +1 -1
  176. package/clis/codex/_actions.js +3 -3
  177. package/clis/codex/archive.js +1 -1
  178. package/clis/codex/ask.js +6 -6
  179. package/clis/codex/model.js +8 -8
  180. package/clis/codex/pin.js +1 -1
  181. package/clis/codex/rename.js +4 -4
  182. package/clis/codex/send.js +3 -3
  183. package/clis/codex/sidebar.js +1 -1
  184. package/clis/coingecko/categories.js +1 -1
  185. package/clis/coingecko/coin.js +1 -1
  186. package/clis/coingecko/derivatives.js +1 -1
  187. package/clis/coingecko/exchanges.js +1 -1
  188. package/clis/coingecko/global.js +1 -1
  189. package/clis/coingecko/trending.js +1 -1
  190. package/clis/confluence/search.js +1 -1
  191. package/clis/coupang/product.js +3 -3
  192. package/clis/coupang/utils.js +1 -1
  193. package/clis/crates/crate.js +1 -1
  194. package/clis/crates/search.js +1 -1
  195. package/clis/crates/utils.js +1 -1
  196. package/clis/csdn/article.js +13 -13
  197. package/clis/csdn/columns.js +1 -1
  198. package/clis/csdn/login.js +1 -1
  199. package/clis/csdn/stats.js +4 -4
  200. package/clis/csdn/whoami.js +1 -1
  201. package/clis/cto51/article.js +1 -1
  202. package/clis/cto51/whoami.js +1 -1
  203. package/clis/ctrip/flight.js +2 -2
  204. package/clis/ctrip/hotel-search.js +3 -3
  205. package/clis/ctrip/hotel-suggest.js +1 -1
  206. package/clis/ctrip/search.js +1 -1
  207. package/clis/ctrip/utils.js +6 -6
  208. package/clis/cursor/ask.js +5 -5
  209. package/clis/cursor/composer.js +2 -2
  210. package/clis/cursor/model.js +4 -4
  211. package/clis/cursor/send.js +2 -2
  212. package/clis/dblp/author.js +1 -1
  213. package/clis/dblp/paper.js +1 -1
  214. package/clis/dblp/search.js +1 -1
  215. package/clis/dblp/utils.js +1 -1
  216. package/clis/dblp/venue.js +1 -1
  217. package/clis/deepseek/ask.js +1 -1
  218. package/clis/deepseek/auth.js +2 -2
  219. package/clis/deepseek/detail.js +1 -1
  220. package/clis/deepseek/new.js +1 -1
  221. package/clis/deepseek/read.js +1 -1
  222. package/clis/deepseek/send.js +7 -7
  223. package/clis/deepseek/utils.js +25 -25
  224. package/clis/defillama/protocol.js +1 -1
  225. package/clis/defillama/protocols.js +1 -1
  226. package/clis/defillama/utils.js +1 -1
  227. package/clis/devto/auth.js +2 -2
  228. package/clis/devto/latest.js +1 -1
  229. package/clis/devto/publish.js +5 -5
  230. package/clis/devto/read.js +2 -2
  231. package/clis/devto/stats.js +3 -3
  232. package/clis/dianping/auth.js +2 -2
  233. package/clis/dianping/cityResolver.js +2 -2
  234. package/clis/dianping/search.js +1 -1
  235. package/clis/dianping/shop.js +1 -1
  236. package/clis/dianping/utils.js +1 -1
  237. package/clis/discord-app/delete.js +3 -3
  238. package/clis/discord-app/read.js +1 -1
  239. package/clis/discord-app/thread-read.js +1 -1
  240. package/clis/discord-web/auth.js +2 -2
  241. package/clis/discord-web/send.js +5 -5
  242. package/clis/dockerhub/image.js +1 -1
  243. package/clis/dockerhub/search.js +1 -1
  244. package/clis/dockerhub/utils.js +1 -1
  245. package/clis/dongchedi/koubei.js +1 -1
  246. package/clis/dongchedi/models.js +1 -1
  247. package/clis/dongchedi/score.js +1 -1
  248. package/clis/dongchedi/search.js +1 -1
  249. package/clis/dongchedi/series.js +1 -1
  250. package/clis/dongchedi/specs.js +1 -1
  251. package/clis/dongchedi/utils.js +1 -1
  252. package/clis/douban/article.js +3 -3
  253. package/clis/douban/auth.js +2 -2
  254. package/clis/douban/download.js +1 -1
  255. package/clis/douban/utils.js +23 -23
  256. package/clis/doubao/auth.js +3 -3
  257. package/clis/doubao/utils.js +39 -39
  258. package/clis/doubao-app/ask.js +1 -1
  259. package/clis/doubao-app/utils.js +4 -4
  260. package/clis/douyin/_shared/browser-fetch.js +7 -7
  261. package/clis/douyin/_shared/draft-cache.js +1 -1
  262. package/clis/douyin/_shared/imagex-upload.js +1 -1
  263. package/clis/douyin/_shared/sts2.js +1 -1
  264. package/clis/douyin/_shared/text-extra.js +1 -1
  265. package/clis/douyin/_shared/tos-upload.js +4 -4
  266. package/clis/douyin/_shared/transcode.js +1 -1
  267. package/clis/douyin/_shared/vod-upload.js +4 -4
  268. package/clis/douyin/draft.js +18 -18
  269. package/clis/douyin/drafts.js +1 -1
  270. package/clis/douyin/publish-image.js +12 -12
  271. package/clis/douyin/publish.js +9 -9
  272. package/clis/douyin/search.js +3 -3
  273. package/clis/douyin/videos.js +1 -1
  274. package/clis/eastmoney/_secid.js +1 -1
  275. package/clis/eastmoney/announcement.js +1 -1
  276. package/clis/eastmoney/article.js +1 -1
  277. package/clis/eastmoney/convertible.js +1 -1
  278. package/clis/eastmoney/etf.js +1 -1
  279. package/clis/eastmoney/holders.js +1 -1
  280. package/clis/eastmoney/index-board.js +1 -1
  281. package/clis/eastmoney/kline.js +1 -1
  282. package/clis/eastmoney/kuaixun.js +1 -1
  283. package/clis/eastmoney/longhu.js +1 -1
  284. package/clis/eastmoney/money-flow.js +1 -1
  285. package/clis/eastmoney/northbound.js +1 -1
  286. package/clis/eastmoney/quote.js +1 -1
  287. package/clis/eastmoney/rank.js +1 -1
  288. package/clis/eastmoney/sectors.js +1 -1
  289. package/clis/endoflife/product.js +1 -1
  290. package/clis/endoflife/utils.js +1 -1
  291. package/clis/facebook/comment.js +8 -8
  292. package/clis/facebook/feed.js +4 -4
  293. package/clis/facebook/like.js +5 -5
  294. package/clis/facebook/notifications.js +3 -3
  295. package/clis/facebook/post.js +11 -11
  296. package/clis/facebook/search.js +3 -3
  297. package/clis/flathub/app.js +1 -1
  298. package/clis/flathub/search.js +1 -1
  299. package/clis/flathub/utils.js +1 -1
  300. package/clis/flomo/memos.js +1 -1
  301. package/clis/gemini/deep-research-result.js +4 -4
  302. package/clis/gemini/deep-research.js +1 -1
  303. package/clis/gemini/detail.js +1 -1
  304. package/clis/gemini/history.js +1 -1
  305. package/clis/gemini/image.js +2 -2
  306. package/clis/gemini/status.js +1 -1
  307. package/clis/gemini/utils.js +43 -43
  308. package/clis/geogebra/hexagon.js +1 -1
  309. package/clis/geogebra/info.js +3 -3
  310. package/clis/geogebra/triangle.js +1 -1
  311. package/clis/geogebra/utils.js +11 -11
  312. package/clis/ghost/login.js +1 -1
  313. package/clis/ghost/shared.js +2 -2
  314. package/clis/gitee/auth.js +2 -2
  315. package/clis/github-trending/repos.js +1 -1
  316. package/clis/google/news.js +1 -1
  317. package/clis/google/search.js +2 -2
  318. package/clis/google/suggest.js +1 -1
  319. package/clis/google/trends.js +1 -1
  320. package/clis/google/utils.js +1 -1
  321. package/clis/goproxy/module.js +1 -1
  322. package/clis/goproxy/utils.js +1 -1
  323. package/clis/goproxy/versions.js +1 -1
  324. package/clis/gov-policy/recent.js +2 -2
  325. package/clis/gov-policy/search.js +2 -2
  326. package/clis/grok/ask.js +1 -1
  327. package/clis/grok/detail.js +1 -1
  328. package/clis/grok/image.js +8 -8
  329. package/clis/grok/pin.js +1 -1
  330. package/clis/grok/send.js +1 -1
  331. package/clis/grok/status.js +1 -1
  332. package/clis/grok/utils.js +21 -21
  333. package/clis/guazi/browse.js +1 -1
  334. package/clis/guazi/car.js +1 -1
  335. package/clis/guazi/utils.js +1 -1
  336. package/clis/hackernews/auth.js +2 -2
  337. package/clis/hackernews/comment.js +8 -8
  338. package/clis/hackernews/read.js +7 -7
  339. package/clis/hackernews/submit.js +7 -7
  340. package/clis/hashnode/auth.js +3 -3
  341. package/clis/hashnode/publish.js +14 -14
  342. package/clis/hf/auth.js +2 -2
  343. package/clis/hf/models.js +1 -1
  344. package/clis/hf/paper.js +1 -1
  345. package/clis/hf/spaces.js +1 -1
  346. package/clis/hf/top.js +1 -1
  347. package/clis/homebrew/cask.js +1 -1
  348. package/clis/homebrew/formula.js +1 -1
  349. package/clis/homebrew/popular.js +1 -1
  350. package/clis/homebrew/utils.js +1 -1
  351. package/clis/huodongxing/events.js +1 -1
  352. package/clis/hupu/detail.js +4 -4
  353. package/clis/hupu/hot.js +3 -3
  354. package/clis/hupu/reply.js +1 -1
  355. package/clis/hupu/search.js +1 -1
  356. package/clis/hupu/unlike.js +1 -1
  357. package/clis/hupu/utils.js +10 -10
  358. package/clis/imdb/person.js +2 -2
  359. package/clis/imdb/reviews.js +3 -3
  360. package/clis/imdb/search.js +2 -2
  361. package/clis/imdb/title.js +1 -1
  362. package/clis/imdb/top.js +1 -1
  363. package/clis/imdb/trending.js +1 -1
  364. package/clis/imdb/utils.js +13 -13
  365. package/clis/imooc/article.js +6 -6
  366. package/clis/imooc/login.js +1 -1
  367. package/clis/imooc/whoami.js +1 -1
  368. package/clis/indeed/job.js +2 -2
  369. package/clis/indeed/search.js +2 -2
  370. package/clis/indeed/utils.js +1 -1
  371. package/clis/infoq/article.js +2 -2
  372. package/clis/infoq/login.js +1 -1
  373. package/clis/infoq/whoami.js +1 -1
  374. package/clis/instagram/_shared/private-publish.js +4 -4
  375. package/clis/instagram/_shared/protocol-capture.js +9 -9
  376. package/clis/instagram/detail.js +3 -3
  377. package/clis/instagram/post.js +25 -25
  378. package/clis/instagram/reel.js +18 -18
  379. package/clis/instagram/story.js +4 -4
  380. package/clis/instagram/user.js +2 -2
  381. package/clis/jd/item.js +65 -65
  382. package/clis/jianshu/article.js +1 -1
  383. package/clis/jianshu/login.js +1 -1
  384. package/clis/jianshu/notebooks.js +1 -1
  385. package/clis/jianshu/whoami.js +1 -1
  386. package/clis/jianyu/search.js +6 -6
  387. package/clis/jianyu/shared/procurement-contract.js +1 -1
  388. package/clis/jike/api.js +6 -6
  389. package/clis/jike/auth.js +3 -3
  390. package/clis/jike/comment.js +1 -1
  391. package/clis/jike/create.js +6 -6
  392. package/clis/jike/feed.js +3 -3
  393. package/clis/jike/like.js +1 -1
  394. package/clis/jike/notifications.js +3 -3
  395. package/clis/jike/repost.js +13 -13
  396. package/clis/jike/search.js +3 -3
  397. package/clis/jimeng/auth.js +2 -2
  398. package/clis/jimeng/generate.js +10 -10
  399. package/clis/jira/shared.js +1 -1
  400. package/clis/juejin/article.js +4 -4
  401. package/clis/juejin/categories.js +1 -1
  402. package/clis/juejin/hot.js +1 -1
  403. package/clis/juejin/login.js +1 -1
  404. package/clis/juejin/recommend.js +1 -1
  405. package/clis/juejin/stats.js +3 -3
  406. package/clis/juejin/tags.js +1 -1
  407. package/clis/juejin/utils.js +1 -1
  408. package/clis/juejin/whoami.js +1 -1
  409. package/clis/ke/utils.js +4 -4
  410. package/clis/kimi/_utils.js +7 -7
  411. package/clis/kimi/audit-extras.js +14 -14
  412. package/clis/kimi/auth.js +3 -3
  413. package/clis/kimi/chat.js +15 -15
  414. package/clis/kimi/storage.js +5 -5
  415. package/clis/kimi/ui.js +13 -13
  416. package/clis/kimi/usage.js +3 -3
  417. package/clis/kuaishou/auth.js +1 -1
  418. package/clis/kuaishou/publish.js +6 -6
  419. package/clis/lesswrong/_helpers.js +5 -5
  420. package/clis/lesswrong/comments.js +5 -5
  421. package/clis/lichess/top.js +1 -1
  422. package/clis/lichess/user.js +1 -1
  423. package/clis/lichess/utils.js +1 -1
  424. package/clis/linkedin/comment.js +1 -1
  425. package/clis/linkedin/connect.js +11 -11
  426. package/clis/linkedin/create.js +5 -5
  427. package/clis/linkedin/follow.js +1 -1
  428. package/clis/linkedin/inbox.js +1 -1
  429. package/clis/linkedin/job-detail.js +3 -3
  430. package/clis/linkedin/like.js +1 -1
  431. package/clis/linkedin/notifications.js +1 -1
  432. package/clis/linkedin/people-search.js +1 -1
  433. package/clis/linkedin/post-comments.js +1 -1
  434. package/clis/linkedin/post-detail.js +1 -1
  435. package/clis/linkedin/profile-analytics.js +1 -1
  436. package/clis/linkedin/profile-api.js +13 -13
  437. package/clis/linkedin/profile-experience.js +1 -1
  438. package/clis/linkedin/profile-projects.js +1 -1
  439. package/clis/linkedin/profile-read.js +3 -3
  440. package/clis/linkedin/reply.js +1 -1
  441. package/clis/linkedin/repost.js +1 -1
  442. package/clis/linkedin/safe-send.js +8 -8
  443. package/clis/linkedin/salesnav-inbox.js +5 -5
  444. package/clis/linkedin/salesnav-message.js +3 -3
  445. package/clis/linkedin/salesnav-search.js +4 -4
  446. package/clis/linkedin/salesnav-thread.js +1 -1
  447. package/clis/linkedin/search-api.js +3 -3
  448. package/clis/linkedin/search.js +8 -8
  449. package/clis/linkedin/social-api.js +31 -31
  450. package/clis/linkedin/timeline.js +3 -3
  451. package/clis/linkedin-learning/search.js +2 -2
  452. package/clis/linkedin-learning/trending.js +2 -2
  453. package/clis/linux-do/feed.js +4 -4
  454. package/clis/linux-do/topic-content.js +8 -8
  455. package/clis/lobsters/domain.js +1 -1
  456. package/clis/lobsters/read.js +7 -7
  457. package/clis/maimai/auth.js +2 -2
  458. package/clis/maimai/search-talents.js +4 -4
  459. package/clis/manus/_utils.js +1 -1
  460. package/clis/mastodon/login.js +1 -1
  461. package/clis/mastodon/post.js +1 -1
  462. package/clis/mastodon/shared.js +12 -12
  463. package/clis/mastodon/whoami.js +1 -1
  464. package/clis/maven/artifact.js +1 -1
  465. package/clis/maven/search.js +1 -1
  466. package/clis/maven/utils.js +1 -1
  467. package/clis/mdn/search.js +1 -1
  468. package/clis/medium/article.js +5 -5
  469. package/clis/medium/login.js +1 -1
  470. package/clis/medium/stats.js +3 -3
  471. package/clis/medium/tag.js +1 -1
  472. package/clis/medium/whoami.js +1 -1
  473. package/clis/mubu/notes.js +1 -1
  474. package/clis/mubu/utils.js +15 -15
  475. package/clis/note/auth.js +2 -2
  476. package/clis/note/note-utils.js +2 -2
  477. package/clis/note/publish.js +8 -8
  478. package/clis/notebooklm/add-source.js +8 -8
  479. package/clis/notebooklm/create.js +1 -1
  480. package/clis/notebooklm/generate-slides.js +1 -1
  481. package/clis/notebooklm/notes-get.js +1 -1
  482. package/clis/notebooklm/rpc.js +8 -8
  483. package/clis/notebooklm/source-fulltext.js +1 -1
  484. package/clis/notebooklm/utils.js +10 -10
  485. package/clis/nowcoder/auth.js +2 -2
  486. package/clis/nowcoder/comment.js +1 -1
  487. package/clis/nowcoder/comments.js +1 -1
  488. package/clis/nowcoder/dm-list.js +1 -1
  489. package/clis/nowcoder/dm-read.js +1 -1
  490. package/clis/nowcoder/dm-send.js +1 -1
  491. package/clis/nowcoder/drafts.js +1 -1
  492. package/clis/nowcoder/inbox.js +1 -1
  493. package/clis/nowcoder/like.js +1 -1
  494. package/clis/nowcoder/my.js +1 -1
  495. package/clis/nowcoder/post.js +1 -1
  496. package/clis/nowcoder/utils.js +13 -13
  497. package/clis/npm/downloads.js +1 -1
  498. package/clis/npm/package.js +1 -1
  499. package/clis/npm/search.js +1 -1
  500. package/clis/npm/utils.js +1 -1
  501. package/clis/nuget/package.js +1 -1
  502. package/clis/nuget/search.js +1 -1
  503. package/clis/nuget/utils.js +1 -1
  504. package/clis/nvd/cve.js +1 -1
  505. package/clis/oeis/search.js +1 -1
  506. package/clis/oeis/sequence.js +1 -1
  507. package/clis/oeis/utils.js +1 -1
  508. package/clis/ones/common.js +6 -6
  509. package/clis/ones/enrich-tasks.js +1 -1
  510. package/clis/ones/my-tasks.js +1 -1
  511. package/clis/ones/resolve-labels.js +1 -1
  512. package/clis/ones/task-helpers.js +1 -1
  513. package/clis/ones/task.js +1 -1
  514. package/clis/ones/worklog.js +7 -7
  515. package/clis/openalex/search.js +1 -1
  516. package/clis/openalex/utils.js +1 -1
  517. package/clis/openalex/work.js +1 -1
  518. package/clis/openfda/drug-label.js +1 -1
  519. package/clis/openfda/food-recall.js +1 -1
  520. package/clis/openfda/utils.js +1 -1
  521. package/clis/openreview/author.js +1 -1
  522. package/clis/openreview/paper.js +1 -1
  523. package/clis/openreview/reviews.js +3 -3
  524. package/clis/openreview/search.js +1 -1
  525. package/clis/openreview/utils.js +1 -1
  526. package/clis/openreview/venue.js +1 -1
  527. package/clis/oschina/article.js +1 -1
  528. package/clis/oschina/catalogs.js +1 -1
  529. package/clis/oschina/login.js +1 -1
  530. package/clis/oschina/stats.js +6 -6
  531. package/clis/oschina/whoami.js +1 -1
  532. package/clis/osv/query.js +1 -1
  533. package/clis/osv/utils.js +1 -1
  534. package/clis/osv/vulnerability.js +1 -1
  535. package/clis/packagist/package.js +1 -1
  536. package/clis/packagist/search.js +1 -1
  537. package/clis/packagist/utils.js +1 -1
  538. package/clis/pinterest/api.js +1 -1
  539. package/clis/pinterest/auth.js +1 -1
  540. package/clis/pinterest/boards.js +1 -1
  541. package/clis/pinterest/client.js +6 -6
  542. package/clis/pinterest/publish.js +5 -5
  543. package/clis/pixiv/auth.js +2 -2
  544. package/clis/pixiv/download.js +1 -1
  545. package/clis/pixiv/illusts.js +1 -1
  546. package/clis/pixiv/search.js +1 -1
  547. package/clis/pixiv/utils.js +3 -3
  548. package/clis/powerchina/auth.js +2 -2
  549. package/clis/powerchina/search.js +1 -1
  550. package/clis/producthunt/browse.js +2 -2
  551. package/clis/producthunt/hot.js +2 -2
  552. package/clis/producthunt/posts.js +1 -1
  553. package/clis/producthunt/today.js +1 -1
  554. package/clis/producthunt/utils.js +1 -1
  555. package/clis/pypi/downloads.js +1 -1
  556. package/clis/pypi/package.js +1 -1
  557. package/clis/pypi/utils.js +1 -1
  558. package/clis/qiita/auth.js +1 -1
  559. package/clis/qiita/gql.js +6 -6
  560. package/clis/qiita/publish.js +4 -4
  561. package/clis/qiita/stats.js +4 -4
  562. package/clis/qoder/_utils.js +16 -16
  563. package/clis/qoder/composer.js +1 -1
  564. package/clis/qoder/quest.js +1 -1
  565. package/clis/qoder/ui.js +14 -14
  566. package/clis/quark/auth.js +2 -2
  567. package/clis/quark/utils.js +2 -2
  568. package/clis/quora/answer-comments.js +3 -3
  569. package/clis/quora/create-answer.js +4 -4
  570. package/clis/quora/create-question.js +3 -3
  571. package/clis/quora/shared.js +17 -17
  572. package/clis/quora/whoami.js +1 -1
  573. package/clis/qwen/ask.js +1 -1
  574. package/clis/qwen/auth.js +3 -3
  575. package/clis/qwen/detail.js +1 -1
  576. package/clis/qwen/image.js +5 -5
  577. package/clis/qwen/status.js +1 -1
  578. package/clis/qwen/utils.js +16 -16
  579. package/clis/reddit/home.js +3 -3
  580. package/clis/reddit/read.js +10 -10
  581. package/clis/reddit/reply.js +4 -4
  582. package/clis/reddit/submit.js +11 -11
  583. package/clis/reddit/subreddit-info.js +3 -3
  584. package/clis/reddit/subscribed.js +4 -4
  585. package/clis/reddit/whoami.js +2 -2
  586. package/clis/rednote/comments.js +1 -1
  587. package/clis/rednote/download.js +1 -1
  588. package/clis/rednote/feed.js +1 -1
  589. package/clis/rednote/note.js +1 -1
  590. package/clis/rednote/notifications.js +2 -2
  591. package/clis/rednote/search.js +2 -2
  592. package/clis/rest-countries/country.js +1 -1
  593. package/clis/rest-countries/region.js +1 -1
  594. package/clis/rest-countries/utils.js +1 -1
  595. package/clis/reuters/article-detail.js +1 -1
  596. package/clis/reuters/auth.js +3 -3
  597. package/clis/reuters/search.js +1 -1
  598. package/clis/reuters/utils.js +4 -4
  599. package/clis/rfc/rfc.js +1 -1
  600. package/clis/rfc/utils.js +1 -1
  601. package/clis/rubygems/gem.js +1 -1
  602. package/clis/rubygems/search.js +1 -1
  603. package/clis/rubygems/utils.js +1 -1
  604. package/clis/segmentfault/article.js +3 -3
  605. package/clis/segmentfault/channels.js +1 -1
  606. package/clis/segmentfault/login.js +1 -1
  607. package/clis/segmentfault/stats.js +4 -4
  608. package/clis/segmentfault/tags.js +1 -1
  609. package/clis/segmentfault/whoami.js +1 -1
  610. package/clis/semanticscholar/citations.js +1 -1
  611. package/clis/semanticscholar/paper.js +1 -1
  612. package/clis/semanticscholar/recommendations.js +1 -1
  613. package/clis/semanticscholar/search.js +1 -1
  614. package/clis/semanticscholar/utils.js +1 -1
  615. package/clis/sinafinance/news.js +1 -1
  616. package/clis/sinafinance/stock-rank.js +1 -1
  617. package/clis/sinafinance/stock.js +1 -1
  618. package/clis/slock/attachment-download.js +1 -1
  619. package/clis/slock/attachment-upload.js +7 -7
  620. package/clis/slock/attachment-url.js +1 -1
  621. package/clis/slock/auth-verify.js +1 -1
  622. package/clis/slock/bookmark-add.js +1 -1
  623. package/clis/slock/bookmark-remove.js +1 -1
  624. package/clis/slock/channel-action.js +1 -1
  625. package/clis/slock/channel-create.js +1 -1
  626. package/clis/slock/channel-files.js +1 -1
  627. package/clis/slock/channel-list.js +1 -1
  628. package/clis/slock/channel-mark.js +1 -1
  629. package/clis/slock/channel-members.js +1 -1
  630. package/clis/slock/channel-unarchive.js +1 -1
  631. package/clis/slock/dm-list.js +1 -1
  632. package/clis/slock/errors.js +1 -1
  633. package/clis/slock/in-page.js +28 -28
  634. package/clis/slock/inbox-done.js +5 -5
  635. package/clis/slock/inbox.js +1 -1
  636. package/clis/slock/message-read.js +22 -22
  637. package/clis/slock/message-search.js +10 -10
  638. package/clis/slock/message-send.js +25 -25
  639. package/clis/slock/reaction-add.js +1 -1
  640. package/clis/slock/reaction-remove.js +1 -1
  641. package/clis/slock/resolve.js +1 -1
  642. package/clis/slock/server-list.js +2 -2
  643. package/clis/slock/task-claim.js +4 -4
  644. package/clis/slock/task-convert.js +13 -13
  645. package/clis/slock/task-create.js +1 -1
  646. package/clis/slock/task-delete.js +5 -5
  647. package/clis/slock/task-get.js +5 -5
  648. package/clis/slock/task-list-server.js +4 -4
  649. package/clis/slock/task-list.js +5 -5
  650. package/clis/slock/task-status.js +3 -3
  651. package/clis/slock/task-unclaim.js +3 -3
  652. package/clis/slock/thread-follow.js +1 -1
  653. package/clis/slock/thread-state.js +1 -1
  654. package/clis/slock/unread-summary.js +5 -5
  655. package/clis/slock/whoami.js +1 -1
  656. package/clis/smzdm/search.js +3 -3
  657. package/clis/sohu/article.js +1 -1
  658. package/clis/sohu/attributes.js +1 -1
  659. package/clis/sohu/categories.js +1 -1
  660. package/clis/sohu/channels.js +1 -1
  661. package/clis/sohu/columns.js +1 -1
  662. package/clis/sohu/login.js +1 -1
  663. package/clis/sohu/stats.js +3 -3
  664. package/clis/sohu/topics.js +1 -1
  665. package/clis/sohu/whoami.js +1 -1
  666. package/clis/spotify/spotify.js +1 -1
  667. package/clis/stackoverflow/read.js +6 -6
  668. package/clis/stackoverflow/related.js +1 -1
  669. package/clis/stackoverflow/tag.js +1 -1
  670. package/clis/stackoverflow/user.js +1 -1
  671. package/clis/stackoverflow/utils.js +1 -1
  672. package/clis/steam/app.js +1 -1
  673. package/clis/steam/search.js +1 -1
  674. package/clis/steam/utils.js +1 -1
  675. package/clis/substack/auth.js +2 -2
  676. package/clis/substack/post-utils.js +2 -2
  677. package/clis/substack/publish.js +5 -5
  678. package/clis/suno/auth.js +2 -2
  679. package/clis/suno/download.js +5 -5
  680. package/clis/suno/generate.js +3 -3
  681. package/clis/suno/list.js +1 -1
  682. package/clis/suno/status.js +1 -1
  683. package/clis/suno/utils.js +29 -29
  684. package/clis/telegram/send.js +7 -7
  685. package/clis/telegram/shared.js +2 -2
  686. package/clis/telegram/whoami.js +1 -1
  687. package/clis/test-utils.js +1 -1
  688. package/clis/threads/post.js +23 -23
  689. package/clis/threads/shared.js +3 -3
  690. package/clis/threads/whoami.js +1 -1
  691. package/clis/tieba/hot.js +3 -3
  692. package/clis/tieba/posts.js +1 -1
  693. package/clis/tieba/read.js +2 -2
  694. package/clis/tieba/search.js +3 -3
  695. package/clis/tieba/utils.js +1 -1
  696. package/clis/tiktok/comment.js +2 -2
  697. package/clis/tiktok/creator-videos.js +3 -3
  698. package/clis/tiktok/explore.js +3 -3
  699. package/clis/tiktok/follow.js +8 -8
  700. package/clis/tiktok/following.js +4 -4
  701. package/clis/tiktok/friends.js +7 -7
  702. package/clis/tiktok/live.js +3 -3
  703. package/clis/tiktok/notifications.js +6 -6
  704. package/clis/tiktok/publish.js +17 -17
  705. package/clis/tiktok/unfollow.js +4 -4
  706. package/clis/tiktok/user.js +2 -2
  707. package/clis/tiktok/utils.js +1 -1
  708. package/clis/toutiao/article.js +1 -1
  709. package/clis/toutiao/articles.js +2 -2
  710. package/clis/toutiao/auth.js +2 -2
  711. package/clis/toutiao/hot.js +1 -1
  712. package/clis/toutiao/recommend.js +1 -1
  713. package/clis/toutiao/utils.js +2 -2
  714. package/clis/trae-solo/_actions.js +4 -4
  715. package/clis/trae-solo/_fs.js +5 -5
  716. package/clis/trae-solo/_state.js +2 -2
  717. package/clis/trae-solo/automation.js +4 -4
  718. package/clis/trae-solo/mode.js +4 -4
  719. package/clis/trae-solo/model.js +4 -4
  720. package/clis/trae-solo/renderer-storage.js +4 -4
  721. package/clis/trae-solo/settings.js +1 -1
  722. package/clis/trae-solo/skill-fs.js +1 -1
  723. package/clis/trae-solo/skill.js +12 -12
  724. package/clis/trae-solo/state-fs.js +2 -2
  725. package/clis/trae-solo/task-fs.js +5 -5
  726. package/clis/trae-solo/workspaces-fs.js +1 -1
  727. package/clis/tumblr/auth.js +2 -2
  728. package/clis/tumblr/publish.js +3 -3
  729. package/clis/tvmaze/search.js +1 -1
  730. package/clis/tvmaze/show.js +1 -1
  731. package/clis/tvmaze/utils.js +1 -1
  732. package/clis/twitter/accept.js +7 -7
  733. package/clis/twitter/article.js +7 -7
  734. package/clis/twitter/bookmark-folder.js +3 -3
  735. package/clis/twitter/bookmark-folders.js +3 -3
  736. package/clis/twitter/bookmarks.js +4 -4
  737. package/clis/twitter/delete.js +5 -5
  738. package/clis/twitter/device-follow.js +3 -3
  739. package/clis/twitter/dm-list.js +1 -1
  740. package/clis/twitter/dm-read.js +1 -1
  741. package/clis/twitter/dm-send.js +5 -5
  742. package/clis/twitter/dm-shared.js +3 -3
  743. package/clis/twitter/download.js +6 -6
  744. package/clis/twitter/followers.js +5 -5
  745. package/clis/twitter/following.js +2 -2
  746. package/clis/twitter/like.js +3 -3
  747. package/clis/twitter/likes.js +8 -8
  748. package/clis/twitter/list-add-core.js +9 -9
  749. package/clis/twitter/list-create.js +5 -5
  750. package/clis/twitter/list-remove-core.js +9 -9
  751. package/clis/twitter/list-tweets.js +7 -7
  752. package/clis/twitter/lists.js +6 -6
  753. package/clis/twitter/notifications.js +2 -2
  754. package/clis/twitter/post.js +24 -24
  755. package/clis/twitter/profile.js +7 -7
  756. package/clis/twitter/quote.js +7 -7
  757. package/clis/twitter/reply-dm.js +7 -7
  758. package/clis/twitter/reply.js +12 -12
  759. package/clis/twitter/retweet.js +3 -3
  760. package/clis/twitter/scheduled-delete.js +3 -3
  761. package/clis/twitter/scheduled-list.js +2 -2
  762. package/clis/twitter/scheduled-utils.js +3 -3
  763. package/clis/twitter/search.js +5 -5
  764. package/clis/twitter/shared.js +6 -6
  765. package/clis/twitter/thread.js +4 -4
  766. package/clis/twitter/timeline.js +3 -3
  767. package/clis/twitter/trending.js +2 -2
  768. package/clis/twitter/tweets.js +11 -11
  769. package/clis/twitter/unlike.js +3 -3
  770. package/clis/twitter/unretweet.js +3 -3
  771. package/clis/twitter/utils.js +6 -6
  772. package/clis/upwork/detail.js +2 -2
  773. package/clis/upwork/feed.js +2 -2
  774. package/clis/upwork/search.js +2 -2
  775. package/clis/upwork/utils.js +1 -1
  776. package/clis/v2ex/auth.js +2 -2
  777. package/clis/v2ex/daily.js +3 -3
  778. package/clis/v2ex/me.js +2 -2
  779. package/clis/v2ex/notifications.js +2 -2
  780. package/clis/vk/post.js +1 -1
  781. package/clis/vk/shared.js +2 -2
  782. package/clis/vk/whoami.js +1 -1
  783. package/clis/web/read.js +8 -8
  784. package/clis/wechat-channels/auth.js +2 -2
  785. package/clis/wechat-channels/publish.js +30 -30
  786. package/clis/weibo/article.js +1 -1
  787. package/clis/weibo/auth.js +3 -3
  788. package/clis/weibo/comments.js +1 -1
  789. package/clis/weibo/delete.js +2 -2
  790. package/clis/weibo/feed.js +3 -3
  791. package/clis/weibo/hot.js +1 -1
  792. package/clis/weibo/publish.js +10 -10
  793. package/clis/weibo/search.js +2 -2
  794. package/clis/weibo/user-posts.js +3 -3
  795. package/clis/weibo/user.js +2 -2
  796. package/clis/weibo/utils.js +3 -3
  797. package/clis/weixin/article.js +1 -1
  798. package/clis/weixin/create-draft.js +26 -26
  799. package/clis/weixin/download.js +2 -2
  800. package/clis/weixin/login.js +1 -1
  801. package/clis/weixin/search.js +2 -2
  802. package/clis/weixin/stats.js +3 -3
  803. package/clis/weixin/whoami.js +1 -1
  804. package/clis/weread/ai-outline.js +2 -2
  805. package/clis/weread/book-search.js +2 -2
  806. package/clis/weread/book.js +2 -2
  807. package/clis/weread/notebooks.js +1 -1
  808. package/clis/weread/search.js +1 -1
  809. package/clis/weread/shelf.js +1 -1
  810. package/clis/weread/utils.js +6 -6
  811. package/clis/weread-official/book.js +1 -1
  812. package/clis/weread-official/discover.js +1 -1
  813. package/clis/weread-official/list-apis.js +1 -1
  814. package/clis/weread-official/notes.js +1 -1
  815. package/clis/weread-official/readdata.js +1 -1
  816. package/clis/weread-official/review.js +1 -1
  817. package/clis/weread-official/search.js +1 -1
  818. package/clis/weread-official/shelf.js +1 -1
  819. package/clis/weread-official/utils.js +1 -1
  820. package/clis/wikidata/entity.js +1 -1
  821. package/clis/wikidata/search.js +1 -1
  822. package/clis/wikidata/utils.js +1 -1
  823. package/clis/wikipedia/page.js +1 -1
  824. package/clis/wikipedia/trending.js +1 -1
  825. package/clis/wikipedia/utils.js +1 -1
  826. package/clis/wordpress/login.js +1 -1
  827. package/clis/wordpress/publish.js +1 -1
  828. package/clis/wordpress/shared.js +3 -3
  829. package/clis/wordpress/whoami.js +1 -1
  830. package/clis/woshipm/article.js +1 -1
  831. package/clis/woshipm/login.js +1 -1
  832. package/clis/woshipm/stats.js +4 -4
  833. package/clis/woshipm/whoami.js +1 -1
  834. package/clis/wttr/current.js +1 -1
  835. package/clis/wttr/forecast.js +1 -1
  836. package/clis/wttr/utils.js +1 -1
  837. package/clis/xianyu/collect.js +1 -1
  838. package/clis/xianyu/inbox.js +1 -1
  839. package/clis/xianyu/item-stats.js +2 -2
  840. package/clis/xianyu/location.js +1 -1
  841. package/clis/xianyu/manage.js +1 -1
  842. package/clis/xianyu/messages.js +1 -1
  843. package/clis/xianyu/mtop.js +5 -5
  844. package/clis/xianyu/order.js +1 -1
  845. package/clis/xianyu/promote-stats.js +2 -2
  846. package/clis/xianyu/publish.js +17 -17
  847. package/clis/xianyu/rate.js +1 -1
  848. package/clis/xianyu/reply.js +1 -1
  849. package/clis/xianyu/search.js +8 -8
  850. package/clis/xianyu/seller-data.js +1 -1
  851. package/clis/xianyu/seller-list.js +1 -1
  852. package/clis/xianyu/user.js +1 -1
  853. package/clis/xiaoe/catalog.js +2 -2
  854. package/clis/xiaoe/content.js +2 -2
  855. package/clis/xiaoe/courses.js +2 -2
  856. package/clis/xiaohongshu/ask.js +6 -6
  857. package/clis/xiaohongshu/comments.js +6 -6
  858. package/clis/xiaohongshu/creator-note-detail.js +7 -7
  859. package/clis/xiaohongshu/creator-notes-summary.js +1 -1
  860. package/clis/xiaohongshu/creator-notes.js +13 -13
  861. package/clis/xiaohongshu/creator-profile.js +2 -2
  862. package/clis/xiaohongshu/creator-stats.js +2 -2
  863. package/clis/xiaohongshu/delete-note.js +7 -7
  864. package/clis/xiaohongshu/download.js +4 -4
  865. package/clis/xiaohongshu/feed.js +2 -2
  866. package/clis/xiaohongshu/follow.js +3 -3
  867. package/clis/xiaohongshu/human.js +3 -3
  868. package/clis/xiaohongshu/note-helpers.js +1 -1
  869. package/clis/xiaohongshu/note.js +2 -2
  870. package/clis/xiaohongshu/notifications.js +1 -1
  871. package/clis/xiaohongshu/publish-video.js +8 -8
  872. package/clis/xiaohongshu/publish.js +59 -59
  873. package/clis/xiaohongshu/search.js +8 -8
  874. package/clis/xiaohongshu/unfollow.js +4 -4
  875. package/clis/xiaohongshu/user-helpers.js +1 -1
  876. package/clis/xiaohongshu/user.js +2 -2
  877. package/clis/xiaoyuzhou/auth.js +3 -3
  878. package/clis/xiaoyuzhou/download.js +1 -1
  879. package/clis/xiaoyuzhou/utils.js +1 -1
  880. package/clis/xueqiu/article.js +4 -4
  881. package/clis/xueqiu/comments.js +4 -4
  882. package/clis/xueqiu/danjuan-utils.js +4 -4
  883. package/clis/xueqiu/earnings-date.js +1 -1
  884. package/clis/xueqiu/events.js +3 -3
  885. package/clis/xueqiu/hashtags.js +3 -3
  886. package/clis/xueqiu/stocks.js +3 -3
  887. package/clis/xueqiu/users.js +3 -3
  888. package/clis/xueqiu/utils.js +3 -3
  889. package/clis/yahoo-finance/quote.js +1 -1
  890. package/clis/yollomi/background.js +1 -1
  891. package/clis/yollomi/edit.js +1 -1
  892. package/clis/yollomi/face-swap.js +1 -1
  893. package/clis/yollomi/generate.js +1 -1
  894. package/clis/yollomi/object-remover.js +1 -1
  895. package/clis/yollomi/remove-bg.js +1 -1
  896. package/clis/yollomi/restore.js +1 -1
  897. package/clis/yollomi/try-on.js +1 -1
  898. package/clis/yollomi/upload.js +4 -4
  899. package/clis/yollomi/upscale.js +1 -1
  900. package/clis/yollomi/utils.js +4 -4
  901. package/clis/yollomi/video.js +1 -1
  902. package/clis/youtube/channel.js +4 -4
  903. package/clis/youtube/feed.js +2 -2
  904. package/clis/youtube/like.js +5 -5
  905. package/clis/youtube/playlist.js +7 -7
  906. package/clis/youtube/publish.js +11 -11
  907. package/clis/youtube/search.js +3 -3
  908. package/clis/youtube/subscribe.js +7 -7
  909. package/clis/youtube/subscriptions.js +1 -1
  910. package/clis/youtube/transcript-group.js +2 -2
  911. package/clis/youtube/transcript.js +13 -13
  912. package/clis/youtube/unlike.js +5 -5
  913. package/clis/youtube/unsubscribe.js +7 -7
  914. package/clis/youtube/utils.js +3 -3
  915. package/clis/youtube/video.js +4 -4
  916. package/clis/youtube/watch-later.js +2 -2
  917. package/clis/yuanbao/ask.js +18 -18
  918. package/clis/yuanbao/detail.js +1 -1
  919. package/clis/yuanbao/read.js +1 -1
  920. package/clis/yuanbao/shared.js +9 -9
  921. package/clis/yuanbao/status.js +1 -1
  922. package/clis/yuque/article.js +1 -1
  923. package/clis/yuque/whoami.js +1 -1
  924. package/clis/zhihu/answer-comments.js +2 -2
  925. package/clis/zhihu/answer-detail.js +3 -3
  926. package/clis/zhihu/answer.js +1 -1
  927. package/clis/zhihu/article-transform.js +1 -1
  928. package/clis/zhihu/article.js +1 -1
  929. package/clis/zhihu/auth.js +2 -2
  930. package/clis/zhihu/collection.js +3 -3
  931. package/clis/zhihu/collections.js +3 -3
  932. package/clis/zhihu/download.js +2 -2
  933. package/clis/zhihu/image-profile.js +6 -6
  934. package/clis/zhihu/paginate.js +3 -3
  935. package/clis/zhihu/pin.js +4 -4
  936. package/clis/zhihu/question.js +3 -3
  937. package/clis/zhihu/recommend.js +3 -3
  938. package/clis/zhihu/search.js +3 -3
  939. package/clis/zhihu/stats.js +3 -3
  940. package/clis/zhihu/user-arg.js +1 -1
  941. package/clis/zhihu/write-shared.js +7 -7
  942. package/clis/zlibrary/utils.js +6 -6
  943. package/clis/zsxq/auth.js +3 -3
  944. package/clis/zsxq/search.js +1 -1
  945. package/clis/zsxq/topic.js +1 -1
  946. package/clis/zsxq/utils.js +5 -5
  947. package/dist/src/adapter-source.js +1 -1
  948. package/dist/src/browser/analyze.js +1 -1
  949. package/dist/src/browser/article-extract.js +2 -2
  950. package/dist/src/browser/ax-snapshot.js +2 -2
  951. package/dist/src/browser/base-page.js +25 -25
  952. package/dist/src/browser/bridge.js +1 -1
  953. package/dist/src/browser/cdp.js +1 -1
  954. package/dist/src/browser/daemon-client.js +1 -1
  955. package/dist/src/browser/daemon-lifecycle.js +7 -7
  956. package/dist/src/browser/dom-helpers.js +35 -35
  957. package/dist/src/browser/dom-snapshot.js +19 -19
  958. package/dist/src/browser/errors.js +3 -3
  959. package/dist/src/browser/extract.js +5 -5
  960. package/dist/src/browser/find.js +13 -13
  961. package/dist/src/browser/fingerprint.js +2 -2
  962. package/dist/src/browser/html-tree.js +6 -6
  963. package/dist/src/browser/managed-chrome.js +1 -1
  964. package/dist/src/browser/network-cache.js +1 -1
  965. package/dist/src/browser/network-key.js +1 -1
  966. package/dist/src/browser/page.js +7 -7
  967. package/dist/src/browser/profile.js +2 -2
  968. package/dist/src/browser/proxy-test.js +8 -8
  969. package/dist/src/browser/shape-filter.js +1 -1
  970. package/dist/src/browser/shape.js +1 -1
  971. package/dist/src/browser/stealth.js +3 -3
  972. package/dist/src/browser/tabs.js +2 -2
  973. package/dist/src/browser/target-errors.js +1 -1
  974. package/dist/src/browser/target-resolver.js +23 -23
  975. package/dist/src/browser/trace.js +2 -2
  976. package/dist/src/browser/utils.js +1 -1
  977. package/dist/src/browser/verify-fixture.js +2 -2
  978. package/dist/src/browser-session-lock.js +1 -1
  979. package/dist/src/build-manifest.js +11 -11
  980. package/dist/src/capabilityRouting.js +1 -1
  981. package/dist/src/cli-argv-preprocess.js +1 -1
  982. package/dist/src/cli.js +32 -32
  983. package/dist/src/commanderAdapter.js +3 -3
  984. package/dist/src/commands/auth.js +3 -3
  985. package/dist/src/commands/daemon.js +1 -1
  986. package/dist/src/completion-fast.js +1 -1
  987. package/dist/src/completion.js +1 -1
  988. package/dist/src/constants.js +1 -1
  989. package/dist/src/convention-audit.js +2 -2
  990. package/dist/src/daemon-utils.js +1 -1
  991. package/dist/src/daemon.js +1 -1
  992. package/dist/src/discovery.js +2 -2
  993. package/dist/src/doctor.js +9 -9
  994. package/dist/src/download/article-download.js +15 -15
  995. package/dist/src/download/index.js +4 -4
  996. package/dist/src/download/media-download.js +1 -1
  997. package/dist/src/download/progress.js +3 -3
  998. package/dist/src/electron-apps.js +1 -1
  999. package/dist/src/errors.js +2 -2
  1000. package/dist/src/execution.js +2 -2
  1001. package/dist/src/external.js +1 -1
  1002. package/dist/src/help.js +8 -8
  1003. package/dist/src/hooks.js +1 -1
  1004. package/dist/src/interceptor.js +21 -21
  1005. package/dist/src/launcher.js +7 -7
  1006. package/dist/src/logger.js +8 -8
  1007. package/dist/src/main.js +7 -7
  1008. package/dist/src/observation/artifact.js +5 -5
  1009. package/dist/src/observation/retention.js +1 -1
  1010. package/dist/src/output.js +2 -2
  1011. package/dist/src/package-paths.js +1 -1
  1012. package/dist/src/pipeline/executor.js +1 -1
  1013. package/dist/src/pipeline/registry.js +1 -1
  1014. package/dist/src/pipeline/steps/browser.js +1 -1
  1015. package/dist/src/pipeline/steps/download.js +1 -1
  1016. package/dist/src/pipeline/steps/fetch.js +6 -6
  1017. package/dist/src/pipeline/steps/intercept.js +1 -1
  1018. package/dist/src/pipeline/steps/tap.js +17 -17
  1019. package/dist/src/pipeline/steps/transform.js +1 -1
  1020. package/dist/src/pipeline/template.js +1 -1
  1021. package/dist/src/plugin-manifest.js +1 -1
  1022. package/dist/src/plugin-scaffold.js +19 -19
  1023. package/dist/src/plugin.js +12 -12
  1024. package/dist/src/rate-limit.js +1 -1
  1025. package/dist/src/registry.js +1 -1
  1026. package/dist/src/runtime-detect.js +1 -1
  1027. package/dist/src/runtime.js +1 -1
  1028. package/dist/src/scripts/framework.js +1 -1
  1029. package/dist/src/scripts/interact.js +1 -1
  1030. package/dist/src/scripts/store.js +1 -1
  1031. package/dist/src/serialization.js +2 -2
  1032. package/dist/src/session-lease.js +1 -1
  1033. package/dist/src/snapshotFormatter.js +2 -2
  1034. package/dist/src/tui.js +12 -12
  1035. package/dist/src/user-runtime.js +1 -1
  1036. package/dist/src/utils.d.ts +12 -0
  1037. package/dist/src/utils.js +4 -4
  1038. package/dist/src/validate.js +2 -2
  1039. package/dist/src/verify.js +2 -2
  1040. package/dist/src/version.js +1 -1
  1041. package/package.json +1 -1
package/dist/src/main.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- if(process.platform!=="win32"){const q=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin"],Q=new Set((process.env.PATH??"").split(":").filter(Boolean));for(const z of q)Q.add(z);process.env.PATH=[...Q].join(":")}import*as J from"node:fs";import*as B from"node:os";import*as K from"node:path";import{fileURLToPath as X}from"node:url";import{getCompletionsFromManifest as k,hasAllManifests as R,printCompletionScriptFast as M}from"./completion-fast.js";import{findPackageRoot as N,getCliManifestPath as y}from"./package-paths.js";import{PKG_VERSION as O}from"./version.js";import{EXIT_CODES as Z}from"./errors.js";import{isSupportedNodeVersion as j,MIN_SUPPORTED_NODE_MAJOR as D}from"./runtime-detect.js";import{unsupportedDaemonPortEnvMessage as U}from"./constants.js";const x=X(import.meta.url),d=K.dirname(x),G=K.join(N(x),"clis"),F=K.join(B.homedir(),".ppcli","clis"),b=process.argv.slice(2);if(typeof globalThis.Bun>"u"&&!j(process.version)){process.stderr.write([`ppcli requires Node.js >= ${D}.0.0.`,`Current runtime: ${process.version}`,"Upgrade Node.js, then retry the same command.",""].join(`
3
- `));process.exit(Z.CONFIG_ERROR)}if(process.env.OPENCLI_DAEMON_PORT){process.stderr.write(`error: ${U(process.env.OPENCLI_DAEMON_PORT)}
4
- `);process.exit(Z.CONFIG_ERROR)}if(b[0]==="--version"||b[0]==="-V"){process.stdout.write(O+`
5
- `);process.exit(Z.SUCCESS)}if(b[0]==="completion"&&b.length>=2){if(M(b[1]))process.exit(Z.SUCCESS)}const H=process.argv.indexOf("--get-completions");if(H!==-1){const q=[y(G)],Q=y(F);try{J.accessSync(Q);q.push(Q)}catch{}if(R(q)){const z=process.argv.slice(H+1);let $;const W=[];for(let Y=0;Y<z.length;Y++)if(z[Y]==="--cursor"&&Y+1<z.length){$=parseInt(z[Y+1],10);Y++}else W.push(z[Y]);if($===void 0)$=W.length;const A=k(W,$,q);process.stdout.write(A.join(`
2
+ if(process.platform!=="win32"){const s=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin"],r=new Set((process.env.PATH??"").split(":").filter(Boolean));for(const e of s)r.add(e);process.env.PATH=[...r].join(":")}import*as m from"node:fs";import*as h from"node:os";import*as l from"node:path";import{fileURLToPath as w}from"node:url";import{getCompletionsFromManifest as C,hasAllManifests as v,printCompletionScriptFast as _}from"./completion-fast.js";import{findPackageRoot as E,getCliManifestPath as f}from"./package-paths.js";import{PKG_VERSION as O}from"./version.js";import{EXIT_CODES as i}from"./errors.js";import{isSupportedNodeVersion as P,MIN_SUPPORTED_NODE_MAJOR as R}from"./runtime-detect.js";import{unsupportedDaemonPortEnvMessage as N}from"./constants.js";const g=w(import.meta.url),q=l.dirname(g),a=l.join(E(g),"clis"),d=l.join(h.homedir(),".ppcli","clis"),c=process.argv.slice(2);if(typeof globalThis.Bun>"u"&&!P(process.version)){process.stderr.write([`ppcli requires Node.js >= ${R}.0.0.`,`Current runtime: ${process.version}`,"Upgrade Node.js, then retry the same command.",""].join(`
3
+ `));process.exit(i.CONFIG_ERROR)}if(process.env.OPENCLI_DAEMON_PORT){process.stderr.write(`error: ${N(process.env.OPENCLI_DAEMON_PORT)}
4
+ `);process.exit(i.CONFIG_ERROR)}if(c[0]==="--version"||c[0]==="-V"){process.stdout.write(O+`
5
+ `);process.exit(i.SUCCESS)}if(c[0]==="completion"&&c.length>=2){if(_(c[1]))process.exit(i.SUCCESS)}const p=process.argv.indexOf("--get-completions");if(p!==-1){const s=[f(a)],r=f(d);try{m.accessSync(r);s.push(r)}catch{}if(v(s)){const e=process.argv.slice(p+1);let n;const t=[];for(let o=0;o<e.length;o++)if(e[o]==="--cursor"&&o+1<e.length){n=parseInt(e[o+1],10);o++}else t.push(e[o]);if(n===void 0)n=t.length;const S=C(t,n,s);process.stdout.write(S.join(`
6
6
  `)+`
7
- `);process.exit(Z.SUCCESS)}}const{discoverClis:V,discoverPlugins:w,ensureUserCliCompatShims:T,ensureUserAdapters:L}=await import("./discovery.js"),{getCompletions:P}=await import("./completion.js"),{runCli:v}=await import("./cli.js"),{emitHook:h}=await import("./hooks.js"),{installNodeNetwork:u}=await import("./node-network.js");u();const E=b[0]==="convention-audit";if(E)await V(G);else{const[,,]=await Promise.all([T(),L(),V(G)]);await V(F);await w()}if(H!==-1){const q=process.argv.slice(H+1);let Q;const z=[];for(let W=0;W<q.length;W++)if(q[W]==="--cursor"&&W+1<q.length){Q=parseInt(q[W+1],10);W++}else z.push(q[W]);if(Q===void 0)Q=z.length;const $=P(z,Q);process.stdout.write($.join(`
7
+ `);process.exit(i.SUCCESS)}}const{discoverClis:u,discoverPlugins:I,ensureUserCliCompatShims:U,ensureUserAdapters:y}=await import("./discovery.js"),{getCompletions:A}=await import("./completion.js"),{runCli:x}=await import("./cli.js"),{emitHook:M}=await import("./hooks.js"),{installNodeNetwork:T}=await import("./node-network.js");T();const j=c[0]==="convention-audit";if(j)await u(a);else{const[,,]=await Promise.all([U(),y(),u(a)]);await u(d);await I()}if(p!==-1){const s=process.argv.slice(p+1);let r;const e=[];for(let t=0;t<s.length;t++)if(s[t]==="--cursor"&&t+1<s.length){r=parseInt(s[t+1],10);t++}else e.push(s[t]);if(r===void 0)r=e.length;const n=A(e,r);process.stdout.write(n.join(`
8
8
  `)+`
9
- `);process.exit(Z.SUCCESS)}const{rewriteBrowserArgv:g,BrowserSessionArgvError:_,escapeLeadingDashPositional:f}=await import("./cli-argv-preprocess.js");try{let q=g(process.argv.slice(2));try{const Q=y(G);if(J.existsSync(Q)){const z=JSON.parse(J.readFileSync(Q,"utf-8"));if(Array.isArray(z))q=f(q,z)}}catch{}process.argv.splice(2,process.argv.length-2,...q)}catch(q){if(q instanceof _){process.stderr.write(`error: ${q.message}
10
- `);process.exit(Z.GENERIC_ERROR)}throw q}await h("onStartup",{command:"__startup__",args:{}});v(G,F);
9
+ `);process.exit(i.SUCCESS)}const{rewriteBrowserArgv:D,BrowserSessionArgvError:b,escapeLeadingDashPositional:L}=await import("./cli-argv-preprocess.js");try{let s=D(process.argv.slice(2));try{const r=f(a);if(m.existsSync(r)){const e=JSON.parse(m.readFileSync(r,"utf-8"));if(Array.isArray(e))s=L(s,e)}}catch{}process.argv.splice(2,process.argv.length-2,...s)}catch(s){if(s instanceof b){process.stderr.write(`error: ${s.message}
10
+ `);process.exit(i.GENERIC_ERROR)}throw s}await M("onStartup",{command:"__startup__",args:{}});x(a,d);
@@ -1,8 +1,8 @@
1
- import*as c from"node:fs";import*as R from"node:os";import*as s from"node:path";import{redactValue as p}from"./redaction.js";import{pruneTraceArtifacts as V,traceExpiresAt as N}from"./retention.js";import{CliError as b,getErrorMessage as k}from"../errors.js";import{log as T}from"../logger.js";import{PKG_VERSION as C}from"../version.js";function J(){return process.env.OPENCLI_CONFIG_DIR||s.join(R.homedir(),".ppcli")}function F(e){return(e||"default").replace(/[^a-zA-Z0-9_-]+/g,"_")||"default"}export function getTraceDirectory(e,n,t=J()){return s.join(t,"profiles",F(e),"traces",F(n))}export function exportObservationSession(e,n={}){const t=getTraceDirectory(e.scope.contextId,e.id,n.baseDir),r=n.status??(n.error===void 0?"success":"failure"),o=new Date().toISOString();c.mkdirSync(t,{recursive:!0});c.mkdirSync(s.join(t,"screenshots"),{recursive:!0});c.mkdirSync(s.join(t,"state"),{recursive:!0});const l=e.events(),h=l.map((f)=>L(f)),S=[],g=[],$=[];let i=0,d=0;for(let f=0;f<h.length;f++){const j=l[f],m=h[f],u={...m};if(m.stream==="screenshot"&&j.stream==="screenshot"&&typeof j.data==="string"){const y=m.format==="jpeg"?"jpg":"png",I=`screenshots/${String(++i).padStart(4,"0")}.${y}`;c.writeFileSync(s.join(t,I),j.data,"base64");u.path=I;delete u.data}if(m.stream==="state"&&u.snapshot!==void 0){const y=`state/${String(++d).padStart(4,"0")}.json`;c.writeFileSync(s.join(t,y),JSON.stringify(u.snapshot,null,2),"utf-8");u.snapshotPath=y;delete u.snapshot}const P=JSON.stringify(u);S.push(P);if(m.stream==="network")g.push(P);if(m.stream==="console")$.push(P)}c.writeFileSync(s.join(t,"trace.jsonl"),S.join(`
1
+ import*as c from"node:fs";import*as V from"node:os";import*as s from"node:path";import{redactValue as p}from"./redaction.js";import{pruneTraceArtifacts as J,traceExpiresAt as b}from"./retention.js";import{CliError as k,getErrorMessage as T}from"../errors.js";import{log as C}from"../logger.js";import{PKG_VERSION as F}from"../version.js";function L(){return process.env.OPENCLI_CONFIG_DIR||s.join(V.homedir(),".ppcli")}function D(e){return(e||"default").replace(/[^a-zA-Z0-9_-]+/g,"_")||"default"}export function getTraceDirectory(e,n,t=L()){return s.join(t,"profiles",D(e),"traces",D(n))}export function exportObservationSession(e,n={}){const t=getTraceDirectory(e.scope.contextId,e.id,n.baseDir),r=n.status??(n.error===void 0?"success":"failure"),o=new Date().toISOString();c.mkdirSync(t,{recursive:!0});c.mkdirSync(s.join(t,"screenshots"),{recursive:!0});c.mkdirSync(s.join(t,"state"),{recursive:!0});const l=e.events(),h=l.map((f)=>_(f)),S=[],g=[],y=[];let i=0,d=0;for(let f=0;f<h.length;f++){const P=l[f],m=h[f],u={...m};if(m.stream==="screenshot"&&P.stream==="screenshot"&&typeof P.data==="string"){const w=m.format==="jpeg"?"jpg":"png",N=`screenshots/${String(++i).padStart(4,"0")}.${w}`;c.writeFileSync(s.join(t,N),P.data,"base64");u.path=N;delete u.data}if(m.stream==="state"&&u.snapshot!==void 0){const w=`state/${String(++d).padStart(4,"0")}.json`;c.writeFileSync(s.join(t,w),JSON.stringify(u.snapshot,null,2),"utf-8");u.snapshotPath=w;delete u.snapshot}const E=JSON.stringify(u);S.push(E);if(m.stream==="network")g.push(E);if(m.stream==="console")y.push(E)}c.writeFileSync(s.join(t,"trace.jsonl"),S.join(`
2
2
  `)+(S.length?`
3
3
  `:""),"utf-8");c.writeFileSync(s.join(t,"network.jsonl"),g.join(`
4
4
  `)+(g.length?`
5
- `:""),"utf-8");c.writeFileSync(s.join(t,"console.jsonl"),$.join(`
6
- `)+($.length?`
7
- `:""),"utf-8");const E=s.join(t,"summary.md");c.writeFileSync(E,z(e,h,{error:n.error,status:r,dir:t,createdAt:o,retentionPolicy:n.retentionPolicy}),"utf-8");const x=s.join(t,"receipt.json"),O={traceId:e.id,dir:t,summaryPath:E,receiptPath:x},A=buildTraceReceipt(O,r,n.error,{createdAt:o,scope:e.scope,retentionPolicy:n.retentionPolicy});c.writeFileSync(x,JSON.stringify(A,null,2),"utf-8");_(s.dirname(t),t,n.retentionPolicy);return{...O,receipt:A}}function L(e){return p(e)}export function buildTraceReceipt(e,n,t,r={}){const o=t instanceof b?t:void 0,l=r.createdAt??new Date().toISOString();return{schemaVersion:1,opencliVersion:C,traceId:e.traceId,traceDir:e.dir,summaryPath:e.summaryPath,receiptPath:e.receiptPath,status:n,createdAt:l,expiresAt:N(l,r.retentionPolicy),...r.scope?{scope:r.scope}:{},...t===void 0?{}:{error:{...t instanceof Error?{name:t.name}:{},...o?{code:o.code,hint:o.hint,exitCode:o.exitCode}:{},message:String(p(k(t)))}}}}function _(e,n,t){try{V(e,{policy:t,protectedTraceDirs:[n],warn:(r)=>T.warn(`[trace] ${r}`)})}catch(r){T.warn(`[trace] Failed to prune trace artifacts: ${r instanceof Error?r.message:String(r)}`)}}function z(e,n,t){const r=n.reduce((i,d)=>{i[d.stream]=(i[d.stream]??0)+1;return i},{}),o=v(t.error),l=n.filter((i)=>i.stream==="error").slice(-20).reverse(),h=n.filter((i)=>i.stream==="network").filter((i)=>i.status===void 0||i.status===0||i.status>=400).slice(-20).reverse(),S=n.filter((i)=>i.stream==="console").filter((i)=>/^(error|warning|warn|assert)$/i.test(i.level)).slice(-20).reverse(),g=n.filter((i)=>i.stream==="action").slice(-30);return["---","schemaVersion: 1",`opencliVersion: ${a(C)}`,`traceId: ${a(e.id)}`,`status: ${t.status}`,`contextId: ${a(e.scope.contextId??"default")}`,`session: ${a(e.scope.session)}`,...e.scope.target?[`target: ${a(e.scope.target)}`]:[],...e.scope.site?[`site: ${a(e.scope.site)}`]:[],...e.scope.command?[`command: ${a(e.scope.command)}`]:[],...e.scope.adapterSourcePath?[`adapterSourcePath: ${a(e.scope.adapterSourcePath)}`]:[],...e.scope.adapterSourcePath?[`adapterSourcePathExists: ${c.existsSync(e.scope.adapterSourcePath)}`]:[],`traceDir: ${a(t.dir)}`,`startedAt: ${a(new Date(e.startedAt).toISOString())}`,`exportedAt: ${a(t.createdAt)}`,`expiresAt: ${a(N(t.createdAt,t.retentionPolicy))}`,...o?[`errorCode: ${a(o.code??"UNKNOWN")}`,`errorMessage: ${a(o.message)}`]:[],"---","","# ppcli Trace Summary","","## How To Use","","- Start with this summary, then inspect `trace.jsonl` only when the evidence below is insufficient.","- For adapter repair policy and retry limits, use the `opencli-autofix` skill.","- `adapterSourcePathExists: false` means the path is a best-effort hint, not a confirmed editable file.","","## Error","",...G(o,l),"","## Failed Network","",...K(h),"","## Suspicious Console","",...U(S),"","## Action Timeline","",...B(g),"","## Event Counts","",...Object.entries(r).map(([i,d])=>`- ${i}: ${d}`),"","## Artifact Files","","- `trace.jsonl`: full redacted event timeline","- `network.jsonl`: redacted network events","- `console.jsonl`: redacted console events","- `state/`: final state snapshots when available","- `screenshots/`: final screenshots when available",""].join(`
8
- `)}function v(e){if(e===void 0)return;if(e instanceof b)return{code:e.code,message:String(p(e.message)),...e.hint?{hint:String(p(e.hint))}:{}};return{message:String(p(k(e)))}}function a(e){return JSON.stringify(e)}function G(e,n){const t=[];if(e){t.push(`- ${e.code??"UNKNOWN"}: ${e.message}`);if(e.hint)t.push(`- hint: ${e.hint}`)}for(const r of n){if(r.stream!=="error")continue;t.push(`- ${w(r.ts)} ${r.code??"ERROR"}: ${r.message}`)}return t.length?t:["- none"]}function K(e){if(!e.length)return["- none"];return e.map((n)=>{const t=n.status??"unknown",r=n.method??"GET",o=n.contentType?` ${n.contentType}`:"";return`- ${w(n.ts)} ${t} ${r} ${n.url}${o}`})}function U(e){if(!e.length)return["- none"];return e.map((n)=>`- ${w(n.ts)} ${n.level}: ${D(n.text,240)}`)}function B(e){if(!e.length)return["- none"];return e.map((n)=>{const t=n.phase?` ${n.phase}`:"",r=n.data&&Object.keys(n.data).length?` ${D(JSON.stringify(p(n.data)),240)}`:"";return`- ${w(n.ts)} ${n.name}${t}${r}`})}function w(e){return new Date(e).toISOString()}function D(e,n){const t=e.replace(/\s+/g," ").trim();return t.length>n?`${t.slice(0,n)}...`:t}
5
+ `:""),"utf-8");c.writeFileSync(s.join(t,"console.jsonl"),y.join(`
6
+ `)+(y.length?`
7
+ `:""),"utf-8");const x=s.join(t,"summary.md");c.writeFileSync(x,v(e,h,{error:n.error,status:r,dir:t,createdAt:o,retentionPolicy:n.retentionPolicy}),"utf-8");const O=s.join(t,"receipt.json"),A={traceId:e.id,dir:t,summaryPath:x,receiptPath:O},I=buildTraceReceipt(A,r,n.error,{createdAt:o,scope:e.scope,retentionPolicy:n.retentionPolicy});c.writeFileSync(O,JSON.stringify(I,null,2),"utf-8");z(s.dirname(t),t,n.retentionPolicy);return{...A,receipt:I}}function _(e){return p(e)}export function buildTraceReceipt(e,n,t,r={}){const o=t instanceof k?t:void 0,l=r.createdAt??new Date().toISOString();return{schemaVersion:1,opencliVersion:F,traceId:e.traceId,traceDir:e.dir,summaryPath:e.summaryPath,receiptPath:e.receiptPath,status:n,createdAt:l,expiresAt:b(l,r.retentionPolicy),...r.scope?{scope:r.scope}:{},...t===void 0?{}:{error:{...t instanceof Error?{name:t.name}:{},...o?{code:o.code,hint:o.hint,exitCode:o.exitCode}:{},message:String(p(T(t)))}}}}function z(e,n,t){try{J(e,{policy:t,protectedTraceDirs:[n],warn:(r)=>C.warn(`[trace] ${r}`)})}catch(r){C.warn(`[trace] Failed to prune trace artifacts: ${r instanceof Error?r.message:String(r)}`)}}function v(e,n,t){const r=n.reduce((i,d)=>{i[d.stream]=(i[d.stream]??0)+1;return i},{}),o=G(t.error),l=n.filter((i)=>i.stream==="error").slice(-20).reverse(),h=n.filter((i)=>i.stream==="network").filter((i)=>i.status===void 0||i.status===0||i.status>=400).slice(-20).reverse(),S=n.filter((i)=>i.stream==="console").filter((i)=>/^(error|warning|warn|assert)$/i.test(i.level)).slice(-20).reverse(),g=n.filter((i)=>i.stream==="action").slice(-30);return["---","schemaVersion: 1",`opencliVersion: ${a(F)}`,`traceId: ${a(e.id)}`,`status: ${t.status}`,`contextId: ${a(e.scope.contextId??"default")}`,`session: ${a(e.scope.session)}`,...e.scope.target?[`target: ${a(e.scope.target)}`]:[],...e.scope.site?[`site: ${a(e.scope.site)}`]:[],...e.scope.command?[`command: ${a(e.scope.command)}`]:[],...e.scope.adapterSourcePath?[`adapterSourcePath: ${a(e.scope.adapterSourcePath)}`]:[],...e.scope.adapterSourcePath?[`adapterSourcePathExists: ${c.existsSync(e.scope.adapterSourcePath)}`]:[],`traceDir: ${a(t.dir)}`,`startedAt: ${a(new Date(e.startedAt).toISOString())}`,`exportedAt: ${a(t.createdAt)}`,`expiresAt: ${a(b(t.createdAt,t.retentionPolicy))}`,...o?[`errorCode: ${a(o.code??"UNKNOWN")}`,`errorMessage: ${a(o.message)}`]:[],"---","","# ppcli Trace Summary","","## How To Use","","- Start with this summary, then inspect `trace.jsonl` only when the evidence below is insufficient.","- For adapter repair policy and retry limits, use the `opencli-autofix` skill.","- `adapterSourcePathExists: false` means the path is a best-effort hint, not a confirmed editable file.","","## Error","",...K(o,l),"","## Failed Network","",...U(h),"","## Suspicious Console","",...B(S),"","## Action Timeline","",...M(g),"","## Event Counts","",...Object.entries(r).map(([i,d])=>`- ${i}: ${d}`),"","## Artifact Files","","- `trace.jsonl`: full redacted event timeline","- `network.jsonl`: redacted network events","- `console.jsonl`: redacted console events","- `state/`: final state snapshots when available","- `screenshots/`: final screenshots when available",""].join(`
8
+ `)}function G(e){if(e===void 0)return;if(e instanceof k)return{code:e.code,message:String(p(e.message)),...e.hint?{hint:String(p(e.hint))}:{}};return{message:String(p(T(e)))}}function a(e){return JSON.stringify(e)}function K(e,n){const t=[];if(e){t.push(`- ${e.code??"UNKNOWN"}: ${e.message}`);if(e.hint)t.push(`- hint: ${e.hint}`)}for(const r of n){if(r.stream!=="error")continue;t.push(`- ${j(r.ts)} ${r.code??"ERROR"}: ${r.message}`)}return t.length?t:["- none"]}function U(e){if(!e.length)return["- none"];return e.map((n)=>{const t=n.status??"unknown",r=n.method??"GET",o=n.contentType?` ${n.contentType}`:"";return`- ${j(n.ts)} ${t} ${r} ${n.url}${o}`})}function B(e){if(!e.length)return["- none"];return e.map((n)=>`- ${j(n.ts)} ${n.level}: ${R(n.text,240)}`)}function M(e){if(!e.length)return["- none"];return e.map((n)=>{const t=n.phase?` ${n.phase}`:"",r=n.data&&Object.keys(n.data).length?` ${R(JSON.stringify(p(n.data)),240)}`:"";return`- ${j(n.ts)} ${n.name}${t}${r}`})}function j(e){return new Date(e).toISOString()}function R(e,n){const t=e.replace(/\s+/g," ").trim();return t.length>n?`${t.slice(0,n)}...`:t}
@@ -1 +1 @@
1
- import*as j from"node:fs";import*as F from"node:path";import{log as b}from"../logger.js";export const DEFAULT_TRACE_RETENTION_POLICY={maxAgeDays:7,maxCountPerProfile:20,maxBytesPerProfile:"500MB"};const w={B:1,KB:1024,MB:1048576,GB:1073741824};export function parseByteSize(G){if(typeof G==="number"){if(!Number.isFinite(G)||G<0)throw Error(`Invalid byte size: ${G}`);return Math.floor(G)}const H=G.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)?$/i);if(!H)throw Error(`Invalid byte size: ${G}`);const K=Number(H[1]),Q=(H[2]??"B").toUpperCase();return Math.floor(K*w[Q])}export function resolveTraceRetentionPolicy(G={}){const H=G.maxAgeDays??DEFAULT_TRACE_RETENTION_POLICY.maxAgeDays,K=G.maxCountPerProfile??DEFAULT_TRACE_RETENTION_POLICY.maxCountPerProfile;if(!Number.isFinite(H)||H<0)throw Error(`Invalid trace maxAgeDays: ${H}`);if(!Number.isInteger(K)||K<0)throw Error(`Invalid trace maxCountPerProfile: ${K}`);return{maxAgeDays:H,maxAgeMs:H*24*60*60*1000,maxCountPerProfile:K,maxBytesPerProfile:parseByteSize(G.maxBytesPerProfile??DEFAULT_TRACE_RETENTION_POLICY.maxBytesPerProfile)}}export function traceExpiresAt(G,H={}){const K=resolveTraceRetentionPolicy(H),Q=Date.parse(G),W=Number.isFinite(Q)?Q:Date.now();return new Date(W+K.maxAgeMs).toISOString()}export function pruneTraceArtifacts(G,H={}){const K=H.warn??((q)=>b.warn(`[trace] ${q}`)),Q=resolveTraceRetentionPolicy(H.policy),W=H.now??Date.now,Z=new Set((H.protectedTraceDirs??[]).map((q)=>F.resolve(q))),V=N(G,Z,K),X=V.reduce((q,J)=>q+J.sizeBytes,0),z=new Set,k=[...V].sort((q,J)=>q.createdAtMs-J.createdAtMs||q.dir.localeCompare(J.dir)),L=W()-Q.maxAgeMs;for(const q of k)if(!q.protected&&q.createdAtMs<L)z.add(q.dir);let $=k.filter((q)=>!z.has(q.dir));while($.length>Q.maxCountPerProfile){const q=$.find((J)=>!J.protected);if(!q)break;z.add(q.dir);$=$.filter((J)=>J.dir!==q.dir)}let Y=$.reduce((q,J)=>q+J.sizeBytes,0);while(Y>Q.maxBytesPerProfile){const q=$.find((J)=>!J.protected);if(!q)break;z.add(q.dir);$=$.filter((J)=>J.dir!==q.dir);Y-=q.sizeBytes}const U=[];for(const q of k.map((J)=>J.dir).filter((J)=>z.has(J)))try{j.rmSync(q,{recursive:!0,force:!0});U.push(q)}catch(J){K(`Failed to prune trace artifact ${q}: ${J instanceof Error?J.message:String(J)}`)}const M=V.filter((q)=>!U.includes(q.dir));return{scanned:V.length,deleted:U,kept:M.map((q)=>q.dir),totalBytesBefore:X,totalBytesAfter:M.reduce((q,J)=>q+J.sizeBytes,0)}}function N(G,H,K){let Q;try{Q=j.readdirSync(G)}catch(Z){if(B(Z))return[];K(`Failed to list trace artifacts in ${G}: ${Z instanceof Error?Z.message:String(Z)}`);return[]}const W=[];for(const Z of Q){const V=F.join(G,Z);try{const X=j.statSync(V);if(!X.isDirectory())continue;W.push({dir:V,createdAtMs:O(V,X.mtimeMs),sizeBytes:S(V),protected:H.has(F.resolve(V))})}catch(X){if(!B(X))K(`Failed to inspect trace artifact ${V}: ${X instanceof Error?X.message:String(X)}`)}}return W}function O(G,H){try{const K=JSON.parse(j.readFileSync(F.join(G,"receipt.json"),"utf-8"));if(typeof K.createdAt==="string"){const Q=Date.parse(K.createdAt);if(Number.isFinite(Q))return Q}}catch{}return H}function S(G){let H=0;for(const K of j.readdirSync(G)){const Q=F.join(G,K),W=j.lstatSync(Q);if(W.isDirectory())H+=S(Q);else H+=W.size}return H}function B(G){return typeof G==="object"&&G!==null&&"code"in G&&G.code==="ENOENT"}
1
+ import*as m from"node:fs";import*as u from"node:path";import{log as A}from"../logger.js";export const DEFAULT_TRACE_RETENTION_POLICY={maxAgeDays:7,maxCountPerProfile:20,maxBytesPerProfile:"500MB"};const w={B:1,KB:1024,MB:1048576,GB:1073741824};export function parseByteSize(t){if(typeof t==="number"){if(!Number.isFinite(t)||t<0)throw Error(`Invalid byte size: ${t}`);return Math.floor(t)}const r=t.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)?$/i);if(!r)throw Error(`Invalid byte size: ${t}`);const n=Number(r[1]),o=(r[2]??"B").toUpperCase();return Math.floor(n*w[o])}export function resolveTraceRetentionPolicy(t={}){const r=t.maxAgeDays??DEFAULT_TRACE_RETENTION_POLICY.maxAgeDays,n=t.maxCountPerProfile??DEFAULT_TRACE_RETENTION_POLICY.maxCountPerProfile;if(!Number.isFinite(r)||r<0)throw Error(`Invalid trace maxAgeDays: ${r}`);if(!Number.isInteger(n)||n<0)throw Error(`Invalid trace maxCountPerProfile: ${n}`);return{maxAgeDays:r,maxAgeMs:r*24*60*60*1000,maxCountPerProfile:n,maxBytesPerProfile:parseByteSize(t.maxBytesPerProfile??DEFAULT_TRACE_RETENTION_POLICY.maxBytesPerProfile)}}export function traceExpiresAt(t,r={}){const n=resolveTraceRetentionPolicy(r),o=Date.parse(t),c=Number.isFinite(o)?o:Date.now();return new Date(c+n.maxAgeMs).toISOString()}export function pruneTraceArtifacts(t,r={}){const n=r.warn??((e)=>A.warn(`[trace] ${e}`)),o=resolveTraceRetentionPolicy(r.policy),c=r.now??Date.now,f=new Set((r.protectedTraceDirs??[]).map((e)=>u.resolve(e))),s=E(t,f,n),a=s.reduce((e,i)=>e+i.sizeBytes,0),l=new Set,y=[...s].sort((e,i)=>e.createdAtMs-i.createdAtMs||e.dir.localeCompare(i.dir)),h=c()-o.maxAgeMs;for(const e of y)if(!e.protected&&e.createdAtMs<h)l.add(e.dir);let d=y.filter((e)=>!l.has(e.dir));while(d.length>o.maxCountPerProfile){const e=d.find((i)=>!i.protected);if(!e)break;l.add(e.dir);d=d.filter((i)=>i.dir!==e.dir)}let B=d.reduce((e,i)=>e+i.sizeBytes,0);while(B>o.maxBytesPerProfile){const e=d.find((i)=>!i.protected);if(!e)break;l.add(e.dir);d=d.filter((i)=>i.dir!==e.dir);B-=e.sizeBytes}const p=[];for(const e of y.map((i)=>i.dir).filter((i)=>l.has(i)))try{m.rmSync(e,{recursive:!0,force:!0});p.push(e)}catch(i){n(`Failed to prune trace artifact ${e}: ${i instanceof Error?i.message:String(i)}`)}const x=s.filter((e)=>!p.includes(e.dir));return{scanned:s.length,deleted:p,kept:x.map((e)=>e.dir),totalBytesBefore:a,totalBytesAfter:x.reduce((e,i)=>e+i.sizeBytes,0)}}function E(t,r,n){let o;try{o=m.readdirSync(t)}catch(f){if(g(f))return[];n(`Failed to list trace artifacts in ${t}: ${f instanceof Error?f.message:String(f)}`);return[]}const c=[];for(const f of o){const s=u.join(t,f);try{const a=m.statSync(s);if(!a.isDirectory())continue;c.push({dir:s,createdAtMs:S(s,a.mtimeMs),sizeBytes:P(s),protected:r.has(u.resolve(s))})}catch(a){if(!g(a))n(`Failed to inspect trace artifact ${s}: ${a instanceof Error?a.message:String(a)}`)}}return c}function S(t,r){try{const n=JSON.parse(m.readFileSync(u.join(t,"receipt.json"),"utf-8"));if(typeof n.createdAt==="string"){const o=Date.parse(n.createdAt);if(Number.isFinite(o))return o}}catch{}return r}function P(t){let r=0;for(const n of m.readdirSync(t)){const o=u.join(t,n),c=m.lstatSync(o);if(c.isDirectory())r+=P(o);else r+=c.size}return r}function g(t){return typeof t==="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}
@@ -1,2 +1,2 @@
1
- import O from"cli-table3";import Q from"js-yaml";function I(q){if(Array.isArray(q))return q;if(q&&typeof q==="object")return[q];return[{value:q}]}function L(q,D){return D.columns??Object.keys(q[0]??{})}export function render(q,D={}){let B=D.fmt??"table";if(!D.fmtExplicit){if(B==="table"&&!process.stdout.isTTY)B="yaml"}if(q===null||q===void 0){console.log(q);return}switch(B){case"json":U(q);break;case"plain":V(q,D);break;case"md":case"markdown":W(q,D);break;case"csv":X(q,D);break;case"yaml":case"yml":Z(q);break;default:S(q,D);break}}function S(q,D){const B=I(q);if(!B.length){console.log("(no data)");return}const F=L(B,D),G=F.map((H)=>_(H)),E=new O({head:G.map((H)=>H),style:{head:[],border:[]},wordWrap:!0,wrapOnWordBoundary:!0});for(const H of B)E.push(F.map((N)=>{const K=H[N];return K===null||K===void 0?"":String(K)}));console.log();if(D.title)console.log(` ${D.title}`);console.log(E.toString());const A=[];A.push(`${B.length} items`);if(D.elapsed!==void 0)A.push(`${D.elapsed.toFixed(1)}s`);if(D.source)A.push(D.source);if(D.footerExtra)A.push(D.footerExtra);console.log(A.join(" · "))}function U(q){console.log(JSON.stringify(q,null,2))}function V(q,D){const B=I(q);if(!B.length)return;if(B.length===1){const F=B[0],G=Object.entries(F);if(G.length===1){const[E,A]=G[0];if(E==="response"||E==="content"||E==="markdown"||E==="text"||E==="value"){console.log(String(A??""));return}}}B.forEach((F,G)=>{Object.entries(F).filter(([,A])=>A!==void 0&&A!==null&&String(A)!=="").forEach(([A,H])=>{console.log(`${A}: ${H}`)});if(G<B.length-1)console.log("")})}function W(q,D){const B=I(q);if(!B.length)return;if(B.length===1){const E=Object.entries(B[0]);if(E.length===1){const[A,H]=E[0];if(A==="content"||A==="markdown"||A==="text"||A==="value"){console.log(String(H??""));return}}}const F=L(B,D),G=(E)=>E.replace(/\|/g,"\\|").replace(/\r\n|\r|\n/g,"<br>");console.log("| "+F.map(G).join(" | ")+" |");console.log("| "+F.map(()=>"---").join(" | ")+" |");for(const E of B)console.log("| "+F.map((A)=>G(String(E[A]??""))).join(" | ")+" |")}function X(q,D){const B=I(q);if(!B.length)return;const F=L(B,D);console.log(F.join(","));for(const G of B)console.log(F.map((E)=>{const A=String(G[E]??"");return A.includes(",")||A.includes('"')||A.includes(`
2
- `)||A.includes("\r")?`"${A.replace(/"/g,'""')}"`:A}).join(","))}function Z(q){console.log(Q.dump(q,{sortKeys:!1,lineWidth:120,noRefs:!0}))}function _(q){return q.charAt(0).toUpperCase()+q.slice(1)}
1
+ import g from"cli-table3";import m from"js-yaml";function i(e){if(Array.isArray(e))return e;if(e&&typeof e==="object")return[e];return[{value:e}]}function f(e,r){return r.columns??Object.keys(e[0]??{})}export function render(e,r={}){let o=r.fmt??"table";if(!r.fmtExplicit){if(o==="table"&&!process.stdout.isTTY)o="yaml"}if(e===null||e===void 0){console.log(e);return}switch(o){case"json":h(e);break;case"plain":p(e,r);break;case"md":case"markdown":b(e,r);break;case"csv":w(e,r);break;case"yaml":case"yml":y(e);break;default:d(e,r);break}}function d(e,r){const o=i(e);if(!o.length){console.log("(no data)");return}const l=f(o,r),s=l.map((c)=>k(c)),t=new g({head:s.map((c)=>c),style:{head:[],border:[]},wordWrap:!0,wrapOnWordBoundary:!0});for(const c of o)t.push(l.map((a)=>{const u=c[a];return u===null||u===void 0?"":String(u)}));console.log();if(r.title)console.log(` ${r.title}`);console.log(t.toString());const n=[];n.push(`${o.length} items`);if(r.elapsed!==void 0)n.push(`${r.elapsed.toFixed(1)}s`);if(r.source)n.push(r.source);if(r.footerExtra)n.push(r.footerExtra);console.log(n.join(" · "))}function h(e){console.log(JSON.stringify(e,null,2))}function p(e,r){const o=i(e);if(!o.length)return;if(o.length===1){const l=o[0],s=Object.entries(l);if(s.length===1){const[t,n]=s[0];if(t==="response"||t==="content"||t==="markdown"||t==="text"||t==="value"){console.log(String(n??""));return}}}o.forEach((l,s)=>{Object.entries(l).filter(([,n])=>n!==void 0&&n!==null&&String(n)!=="").forEach(([n,c])=>{console.log(`${n}: ${c}`)});if(s<o.length-1)console.log("")})}function b(e,r){const o=i(e);if(!o.length)return;if(o.length===1){const t=Object.entries(o[0]);if(t.length===1){const[n,c]=t[0];if(n==="content"||n==="markdown"||n==="text"||n==="value"){console.log(String(c??""));return}}}const l=f(o,r),s=(t)=>t.replace(/\|/g,"\\|").replace(/\r\n|\r|\n/g,"<br>");console.log("| "+l.map(s).join(" | ")+" |");console.log("| "+l.map(()=>"---").join(" | ")+" |");for(const t of o)console.log("| "+l.map((n)=>s(String(t[n]??""))).join(" | ")+" |")}function w(e,r){const o=i(e);if(!o.length)return;const l=f(o,r);console.log(l.join(","));for(const s of o)console.log(l.map((t)=>{const n=String(s[t]??"");return n.includes(",")||n.includes('"')||n.includes(`
2
+ `)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}).join(","))}function y(e){console.log(m.dump(e,{sortKeys:!1,lineWidth:120,noRefs:!0}))}function k(e){return e.charAt(0).toUpperCase()+e.slice(1)}
@@ -1 +1 @@
1
- import*as B from"node:fs";import*as v from"node:path";export function findPackageRoot(j,z=B.existsSync){let q=v.dirname(j);while(!0){if(z(v.join(q,"package.json")))return q;const w=v.dirname(q);if(w===q)throw Error(`Could not find package.json above ${j}`);q=w}}export function getBuiltEntryCandidates(j,z=(q)=>B.readFileSync(q,"utf-8")){const q=[];try{const w=JSON.parse(z(v.join(j,"package.json")));if(typeof w.bin==="string")q.push(v.join(j,w.bin));else if(w.bin&&typeof w.bin==="object")for(const G of["ppcli","opencli"]){const A=w.bin[G];if(typeof A==="string")q.push(v.join(j,A))}if(typeof w.main==="string")q.push(v.join(j,w.main))}catch{}q.push(v.join(j,"dist","src","main.js"),v.join(j,"dist","main.js"));return[...new Set(q)]}export function getCliManifestPath(j){return v.resolve(j,"..","cli-manifest.json")}export function getFetchAdaptersScriptPath(j){return v.join(j,"scripts","fetch-adapters.js")}
1
+ import*as o from"node:fs";import*as t from"node:path";export function findPackageRoot(n,r=o.existsSync){let i=t.dirname(n);while(!0){if(r(t.join(i,"package.json")))return i;const e=t.dirname(i);if(e===i)throw Error(`Could not find package.json above ${n}`);i=e}}export function getBuiltEntryCandidates(n,r=(i)=>o.readFileSync(i,"utf-8")){const i=[];try{const e=JSON.parse(r(t.join(n,"package.json")));if(typeof e.bin==="string")i.push(t.join(n,e.bin));else if(e.bin&&typeof e.bin==="object")for(const f of["ppcli","opencli"]){const s=e.bin[f];if(typeof s==="string")i.push(t.join(n,s))}if(typeof e.main==="string")i.push(t.join(n,e.main))}catch{}i.push(t.join(n,"dist","src","main.js"),t.join(n,"dist","main.js"));return[...new Set(i)]}export function getCliManifestPath(n){return t.resolve(n,"..","cli-manifest.json")}export function getFetchAdaptersScriptPath(n){return t.join(n,"scripts","fetch-adapters.js")}
@@ -1 +1 @@
1
- import{getStep as X}from"./registry.js";import{log as K}from"../logger.js";import{ConfigError as Z}from"../errors.js";import{BROWSER_ONLY_STEPS as $}from"../capabilityRouting.js";import{isTransientBrowserError as k}from"../browser/errors.js";export async function executePipeline(G,q,A={}){const z=A.args??{},H=A.debug??!1;let I=null;const Q=q.length;try{for(let D=0;D<q.length;D++){const J=q[D];if(!J||typeof J!=="object")continue;for(const[F,M]of Object.entries(J)){if(H)L(D+1,Q,F,M);const V=X(F);if(V)I=await C(V,G,M,I,z,F,A.stepRetries);else throw new Z(`Unknown pipeline step "${F}" at index ${D}.`,"Check the YAML pipeline step name or register the custom step before execution.");if(H)P(F,I)}}}catch(D){if(G?.closeWindow)try{await G.closeWindow()}catch{}throw D}return I}async function C(G,q,A,z,H,I,Q){const D=Q??($.has(I)?2:0);for(let J=0;J<=D;J++)try{return await G(q,A,z,H)}catch(F){if(J>=D)throw F;if(!k(F))throw F;await new Promise((M)=>setTimeout(M,1000))}throw Error(`Step "${I}" failed after ${D} retries`)}function L(G,q,A,z){let H="";if(typeof z==="string")H=z.length<=80?` → ${z}`:` → ${z.slice(0,77)}...`;else if(z&&typeof z==="object"&&!Array.isArray(z))H=` (${Object.keys(z).join(", ")})`;K.step(G,q,A,H)}function P(G,q){if(q===null||q===void 0)K.stepResult("(no data)");else if(Array.isArray(q))K.stepResult(`${q.length} items`);else if(typeof q==="object"){const A=Object.keys(q).slice(0,5);K.stepResult(`dict (${A.join(", ")}${Object.keys(q).length>5?"...":""})`)}else if(typeof q==="string"){const A=q.slice(0,60).replace(/\n/g,"\\n");K.stepResult(`"${A}${q.length>60?"...":""}"`)}else K.stepResult(`${typeof q}`)}
1
+ import{getStep as y}from"./registry.js";import{log as l}from"../logger.js";import{ConfigError as g}from"../errors.js";import{BROWSER_ONLY_STEPS as w}from"../capabilityRouting.js";import{isTransientBrowserError as b}from"../browser/errors.js";export async function executePipeline(n,e,o={}){const t=o.args??{},s=o.debug??!1;let c=null;const u=e.length;try{for(let r=0;r<e.length;r++){const f=e[r];if(!f||typeof f!=="object")continue;for(const[i,p]of Object.entries(f)){if(s)R(r+1,u,i,p);const h=y(i);if(h)c=await m(h,n,p,c,t,i,o.stepRetries);else throw new g(`Unknown pipeline step "${i}" at index ${r}.`,"Check the YAML pipeline step name or register the custom step before execution.");if(s)j(i,c)}}}catch(r){if(n?.closeWindow)try{await n.closeWindow()}catch{}throw r}return c}async function m(n,e,o,t,s,c,u){const r=u??(w.has(c)?2:0);for(let f=0;f<=r;f++)try{return await n(e,o,t,s)}catch(i){if(f>=r)throw i;if(!b(i))throw i;await new Promise((p)=>setTimeout(p,1000))}throw Error(`Step "${c}" failed after ${r} retries`)}function R(n,e,o,t){let s="";if(typeof t==="string")s=t.length<=80?` → ${t}`:` → ${t.slice(0,77)}...`;else if(t&&typeof t==="object"&&!Array.isArray(t))s=` (${Object.keys(t).join(", ")})`;l.step(n,e,o,s)}function j(n,e){if(e===null||e===void 0)l.stepResult("(no data)");else if(Array.isArray(e))l.stepResult(`${e.length} items`);else if(typeof e==="object"){const o=Object.keys(e).slice(0,5);l.stepResult(`dict (${o.join(", ")}${Object.keys(e).length>5?"...":""})`)}else if(typeof e==="string"){const o=e.slice(0,60).replace(/\n/g,"\\n");l.stepResult(`"${o}${e.length>60?"...":""}"`)}else l.stepResult(`${typeof e}`)}
@@ -1 +1 @@
1
- import{stepNavigate as A,stepClick as B,stepType as G,stepFill as H,stepWait as J,stepPress as K,stepSnapshot as O,stepEvaluate as Q}from"./steps/browser.js";import{stepFetch as U}from"./steps/fetch.js";import{stepSelect as V,stepMap as X,stepFilter as Y,stepSort as Z,stepLimit as $}from"./steps/transform.js";import{stepIntercept as b}from"./steps/intercept.js";import{stepTap as k}from"./steps/tap.js";import{stepDownload as u}from"./steps/download.js";const x=new Map;export function getStep(q){return x.get(q)}export function getRegisteredStepNames(){return[...x.keys()]}export function registerStep(q,z){x.set(q,z)}registerStep("navigate",A);registerStep("fetch",U);registerStep("select",V);registerStep("evaluate",Q);registerStep("snapshot",O);registerStep("click",B);registerStep("type",G);registerStep("fill",H);registerStep("wait",J);registerStep("press",K);registerStep("map",X);registerStep("filter",Y);registerStep("sort",Z);registerStep("limit",$);registerStep("intercept",b);registerStep("tap",k);registerStep("download",u);
1
+ import{stepNavigate as s,stepClick as r,stepType as i,stepFill as o,stepWait as a,stepPress as n,stepSnapshot as m,stepEvaluate as l}from"./steps/browser.js";import{stepFetch as c}from"./steps/fetch.js";import{stepSelect as f,stepMap as g,stepFilter as u,stepSort as S,stepLimit as d}from"./steps/transform.js";import{stepIntercept as h}from"./steps/intercept.js";import{stepTap as v}from"./steps/tap.js";import{stepDownload as w}from"./steps/download.js";const e=new Map;export function getStep(t){return e.get(t)}export function getRegisteredStepNames(){return[...e.keys()]}export function registerStep(t,p){e.set(t,p)}registerStep("navigate",s);registerStep("fetch",c);registerStep("select",f);registerStep("evaluate",l);registerStep("snapshot",m);registerStep("click",r);registerStep("type",i);registerStep("fill",o);registerStep("wait",a);registerStep("press",n);registerStep("map",g);registerStep("filter",u);registerStep("sort",S);registerStep("limit",d);registerStep("intercept",h);registerStep("tap",v);registerStep("download",w);
@@ -1 +1 @@
1
- import{render as z}from"../template.js";import{isRecord as D}from"../../utils.js";export async function stepNavigate(k,b,h,q){if(D(b)&&"url"in b){const v=String(z(b.url,{args:q,data:h}));await k.goto(v,{waitUntil:b.waitUntil,settleMs:typeof b.settleMs==="number"?b.settleMs:void 0})}else{const v=z(b,{args:q,data:h});await k.goto(String(v))}return h}export async function stepClick(k,b,h,q){await k.click(String(z(b,{args:q,data:h})).replace(/^@/,""));return h}export async function stepType(k,b,h,q){if(D(b)){const v=String(z(b.ref??"",{args:q,data:h})).replace(/^@/,""),A=String(z(b.text??"",{args:q,data:h}));await k.typeText(v,A);if(b.submit)await k.pressKey("Enter")}return h}export async function stepFill(k,b,h,q){if(D(b)){const v=String(z(b.ref??"",{args:q,data:h})).replace(/^@/,""),A=String(z(b.text??"",{args:q,data:h}));await k.fillText(v,A);if(b.submit)await k.pressKey("Enter")}return h}export async function stepWait(k,b,h,q){if(typeof b==="number")await k.wait(b);else if(D(b)){if("text"in b)await k.wait({text:String(z(b.text,{args:q,data:h})),timeout:typeof b.timeout==="number"?b.timeout:void 0});else if("time"in b)await k.wait(Number(b.time))}else if(typeof b==="string")await k.wait(Number(z(b,{args:q,data:h})));return h}export async function stepPress(k,b,h,q){await k.pressKey(String(z(b,{args:q,data:h})));return h}export async function stepSnapshot(k,b,h,q){const v=D(b)?b:{};return k.snapshot({interactive:typeof v.interactive==="boolean"?v.interactive:!1,compact:typeof v.compact==="boolean"?v.compact:!1,maxDepth:typeof v.max_depth==="number"?v.max_depth:void 0,raw:typeof v.raw==="boolean"?v.raw:!1})}export async function stepEvaluate(k,b,h,q){const v=String(z(b,{args:q,data:h}));let A=await k.evaluate(v);if(typeof A==="string"){const C=A.trim();if(C.startsWith("[")&&C.endsWith("]")||C.startsWith("{")&&C.endsWith("}"))try{A=JSON.parse(C)}catch{}}return A}
1
+ import{render as r}from"../template.js";import{isRecord as s}from"../../utils.js";export async function stepNavigate(i,t,e,n){if(s(t)&&"url"in t){const o=String(r(t.url,{args:n,data:e}));await i.goto(o,{waitUntil:t.waitUntil,settleMs:typeof t.settleMs==="number"?t.settleMs:void 0})}else{const o=r(t,{args:n,data:e});await i.goto(String(o))}return e}export async function stepClick(i,t,e,n){await i.click(String(r(t,{args:n,data:e})).replace(/^@/,""));return e}export async function stepType(i,t,e,n){if(s(t)){const o=String(r(t.ref??"",{args:n,data:e})).replace(/^@/,""),c=String(r(t.text??"",{args:n,data:e}));await i.typeText(o,c);if(t.submit)await i.pressKey("Enter")}return e}export async function stepFill(i,t,e,n){if(s(t)){const o=String(r(t.ref??"",{args:n,data:e})).replace(/^@/,""),c=String(r(t.text??"",{args:n,data:e}));await i.fillText(o,c);if(t.submit)await i.pressKey("Enter")}return e}export async function stepWait(i,t,e,n){if(typeof t==="number")await i.wait(t);else if(s(t)){if("text"in t)await i.wait({text:String(r(t.text,{args:n,data:e})),timeout:typeof t.timeout==="number"?t.timeout:void 0});else if("time"in t)await i.wait(Number(t.time))}else if(typeof t==="string")await i.wait(Number(r(t,{args:n,data:e})));return e}export async function stepPress(i,t,e,n){await i.pressKey(String(r(t,{args:n,data:e})));return e}export async function stepSnapshot(i,t,e,n){const o=s(t)?t:{};return i.snapshot({interactive:typeof o.interactive==="boolean"?o.interactive:!1,compact:typeof o.compact==="boolean"?o.compact:!1,maxDepth:typeof o.max_depth==="number"?o.max_depth:void 0,raw:typeof o.raw==="boolean"?o.raw:!1})}export async function stepEvaluate(i,t,e,n){const o=String(r(t,{args:n,data:e}));let c=await i.evaluate(o);if(typeof c==="string"){const f=c.trim();if(f.startsWith("[")&&f.endsWith("]")||f.startsWith("{")&&f.endsWith("}"))try{c=JSON.parse(f)}catch{}}return c}
@@ -1 +1 @@
1
- import*as S from"node:fs";import*as H from"node:path";import{render as M}from"../template.js";import{getErrorMessage as m}from"../../errors.js";import{httpDownload as p,ytdlpDownload as d,saveDocument as i,detectContentType as s,requiresYtdlp as j,sanitizeFilename as o,generateFilename as t,exportCookiesToNetscape as r,getTempDir as a,formatCookieHeader as e}from"../../download/index.js";import{DownloadProgressTracker as bb,formatBytes as Y}from"../../download/progress.js";import{mapConcurrent as Gb}from"../../utils.js";async function Jb(V,O){try{const b=await V.getCookies({domain:O});return e(b)}catch{return""}}async function Kb(V,O){try{return(await V.getCookies({domain:O})).filter((J)=>J.name).map((J)=>({name:J.name,value:J.value,domain:J.domain,path:J.path??"/",secure:J.secure??!1,httpOnly:J.httpOnly??!1}))}catch{return[]}}function Lb(V){const O=new Map;for(const b of V)O.set(`${b.domain} ${b.path} ${b.name}`,b);return[...O.values()]}export async function stepDownload(V,O,b,J){const K=typeof O==="object"&&O!==null?O:{},q=typeof O==="string"?O:K.url??"",h=K.dir??"./downloads",v=K.filename??"",y=typeof K.concurrency==="number"?K.concurrency:3,T=K.skip_existing!==!1,f=typeof K.timeout==="number"?K.timeout*1000:30000,A=K.use_ytdlp??!1,x=Array.isArray(K.ytdlp_args)?K.ytdlp_args.map((L)=>String(L)):[],F=K.type??"auto",u=K.progress!==!1,w=K.content,C=K.metadata,D=String(M(h,{args:J,data:b}));S.mkdirSync(D,{recursive:!0});const E=Array.isArray(b)?b:b?[b]:[];if(E.length===0)return[];const U=new bb(E.length,u),P=new Map;let N;if(V){if(A||E.some((L,R)=>{const W=String(M(q,{args:J,data:b,item:L,index:R}));return j(W)}))try{const L=[...new Set(E.flatMap((W,_)=>{const X=String(M(q,{args:J,data:b,item:W,index:_}));if(!A&&!j(X))return[];try{return[new URL(X).hostname]}catch{return[]}}))],R=Lb((await Promise.all(L.map((W)=>Kb(V,W)))).flat());if(R.length>0){const W=a();S.mkdirSync(W,{recursive:!0});N=H.join(W,`cookies_${Date.now()}.txt`);r(R,N)}}catch{}}const g=await Gb(E,y,async(L,R)=>{const W=Date.now(),_=String(M(q,{args:J,data:b,item:L,index:R}));if(!_){U.onFileComplete(!1);return{...L,_download:{status:"failed",error:"Empty URL"}}}let X;if(v)X=String(M(v,{args:J,data:b,item:L,index:R}));else X=t(_,R);X=o(X);const I=H.join(D,X);if(T&&S.existsSync(I)){U.onFileComplete(!0,!0);return{...L,_download:{status:"skipped",path:I,size:S.statSync(I).size}}}const Q=U.onFileStart(X,R),B=F==="auto"?s(_):F,k=A||B==="video"&&j(_);let G;try{if(B==="document"&&w){const $=String(M(w,{args:J,data:b,item:L,index:R})),Z=C?Object.fromEntries(Object.entries(C).map(([n,l])=>[n,M(l,{args:J,data:b,item:L,index:R})])):void 0,z=H.extname(X).toLowerCase();G=await i($,I,z===".json"?"json":z===".html"?"html":"markdown",Z);if(Q)Q.complete(G.success,G.success?Y(G.size):void 0)}else if(k){G=await d(_,I,{cookiesFile:N,extraArgs:x,onProgress:($)=>{if(Q)Q.update($,100)}});if(Q)Q.complete(G.success,G.success?Y(G.size):void 0)}else{let $="";if(V)try{const Z=new URL(_).hostname;let z=P.get(Z);if(!z){z=Jb(V,Z);P.set(Z,z)}$=await z}catch{$=""}G=await p(_,I,{cookies:$,timeout:f,onProgress:(Z,z)=>{if(Q)Q.update(Z,z)}});if(Q)Q.complete(G.success,G.success?Y(G.size):void 0)}}catch($){const Z=m($);G={success:!1,size:0,error:Z};if(Q)Q.fail(Z)}U.onFileComplete(G.success);const c=Date.now()-W;return{...L,_download:{status:G.success?"success":"failed",path:G.success?I:void 0,size:G.size,error:G.error,duration:c}}});if(N&&S.existsSync(N))try{S.unlinkSync(N)}catch{}U.finish();return g}
1
+ import*as g from"node:fs";import*as T from"node:path";import{render as w}from"../template.js";import{getErrorMessage as G}from"../../errors.js";import{httpDownload as I,ytdlpDownload as J,saveDocument as K,detectContentType as Q,requiresYtdlp as z,sanitizeFilename as V,generateFilename as W,exportCookiesToNetscape as X,getTempDir as Z,formatCookieHeader as ee}from"../../download/index.js";import{DownloadProgressTracker as te,formatBytes as A}from"../../download/progress.js";import{mapConcurrent as oe}from"../../utils.js";async function se(a,r){try{const e=await a.getCookies({domain:r});return ee(e)}catch{return""}}async function ne(a,r){try{return(await a.getCookies({domain:r})).filter((o)=>o.name).map((o)=>({name:o.name,value:o.value,domain:o.domain,path:o.path??"/",secure:o.secure??!1,httpOnly:o.httpOnly??!1}))}catch{return[]}}function re(a){const r=new Map;for(const e of a)r.set(`${e.domain} ${e.path} ${e.name}`,e);return[...r.values()]}export async function stepDownload(a,r,e,o){const s=typeof r==="object"&&r!==null?r:{},C=typeof r==="string"?r:s.url??"",E=s.dir??"./downloads",_=s.filename??"",L=typeof s.concurrency==="number"?s.concurrency:3,M=s.skip_existing!==!1,O=typeof s.timeout==="number"?s.timeout*1000:30000,D=s.use_ytdlp??!1,U=Array.isArray(s.ytdlp_args)?s.ytdlp_args.map((n)=>String(n)):[],j=s.type??"auto",B=s.progress!==!1,v=s.content,x=s.metadata,F=String(w(E,{args:o,data:e}));g.mkdirSync(F,{recursive:!0});const k=Array.isArray(e)?e:e?[e]:[];if(k.length===0)return[];const S=new te(k.length,B),P=new Map;let h;if(a){if(D||k.some((n,i)=>{const l=String(w(C,{args:o,data:e,item:n,index:i}));return z(l)}))try{const n=[...new Set(k.flatMap((l,f)=>{const u=String(w(C,{args:o,data:e,item:l,index:f}));if(!D&&!z(u))return[];try{return[new URL(u).hostname]}catch{return[]}}))],i=re((await Promise.all(n.map((l)=>ne(a,l)))).flat());if(i.length>0){const l=Z();g.mkdirSync(l,{recursive:!0});h=T.join(l,`cookies_${Date.now()}.txt`);X(i,h)}}catch{}}const R=await oe(k,L,async(n,i)=>{const l=Date.now(),f=String(w(C,{args:o,data:e,item:n,index:i}));if(!f){S.onFileComplete(!1);return{...n,_download:{status:"failed",error:"Empty URL"}}}let u;if(_)u=String(w(_,{args:o,data:e,item:n,index:i}));else u=W(f,i);u=V(u);const y=T.join(F,u);if(M&&g.existsSync(y)){S.onFileComplete(!0,!0);return{...n,_download:{status:"skipped",path:y,size:g.statSync(y).size}}}const c=S.onFileStart(u,i),b=j==="auto"?Q(f):j,Y=D||b==="video"&&z(f);let t;try{if(b==="document"&&v){const p=String(w(v,{args:o,data:e,item:n,index:i})),m=x?Object.fromEntries(Object.entries(x).map(([q,N])=>[q,w(N,{args:o,data:e,item:n,index:i})])):void 0,d=T.extname(u).toLowerCase();t=await K(p,y,d===".json"?"json":d===".html"?"html":"markdown",m);if(c)c.complete(t.success,t.success?A(t.size):void 0)}else if(Y){t=await J(f,y,{cookiesFile:h,extraArgs:U,onProgress:(p)=>{if(c)c.update(p,100)}});if(c)c.complete(t.success,t.success?A(t.size):void 0)}else{let p="";if(a)try{const m=new URL(f).hostname;let d=P.get(m);if(!d){d=se(a,m);P.set(m,d)}p=await d}catch{p=""}t=await I(f,y,{cookies:p,timeout:O,onProgress:(m,d)=>{if(c)c.update(m,d)}});if(c)c.complete(t.success,t.success?A(t.size):void 0)}}catch(p){const m=G(p);t={success:!1,size:0,error:m};if(c)c.fail(m)}S.onFileComplete(t.success);const H=Date.now()-l;return{...n,_download:{status:t.success?"success":"failed",path:t.success?y:void 0,size:t.size,error:t.error,duration:H}}});if(h&&g.existsSync(h))try{g.unlinkSync(h)}catch{}S.finish();return R}
@@ -1,9 +1,9 @@
1
- import{CliError as x,getErrorMessage as E}from"../../errors.js";import{log as k}from"../../logger.js";import{render as w}from"../template.js";import{isRecord as _,mapConcurrent as I}from"../../utils.js";const R=/\$\{\{[^}]*\b(?:item|index)\b[^}]*\}\}/;async function v(Z,$,A,V,F,D,z){const Y={};for(const[K,C]of Object.entries(V))Y[K]=String(w(C,{args:D,data:z}));const G={};for(const[K,C]of Object.entries(F))G[K]=String(w(C,{args:D,data:z}));let X=$;if(Object.keys(Y).length>0){const K=new URLSearchParams(Y).toString();X=`${X}${X.includes("?")?"&":"?"}${K}`}if(Z===null){const K=await fetch(X,{method:A.toUpperCase(),headers:G});if(!K.ok)throw new x("FETCH_ERROR",`HTTP ${K.status} ${K.statusText} from ${X}`);return K.json()}return Z.fetchJson(X,{method:A.toUpperCase(),headers:G})}async function T(Z,$,A,V,F){const D=JSON.stringify(V),z=JSON.stringify($),Y=JSON.stringify(A);return await Z.evaluate(`
1
+ import{CliError as E,getErrorMessage as T}from"../../errors.js";import{log as j}from"../../logger.js";import{render as d}from"../template.js";import{isRecord as g,mapConcurrent as P}from"../../utils.js";const x=/\$\{\{[^}]*\b(?:item|index)\b[^}]*\}\}/;async function k(u,a,r,o,e,h,f){const l={};for(const[t,y]of Object.entries(o))l[t]=String(d(y,{args:h,data:f}));const m={};for(const[t,y]of Object.entries(e))m[t]=String(d(y,{args:h,data:f}));let i=a;if(Object.keys(l).length>0){const t=new URLSearchParams(l).toString();i=`${i}${i.includes("?")?"&":"?"}${t}`}if(u===null){const t=await fetch(i,{method:r.toUpperCase(),headers:m});if(!t.ok)throw new E("FETCH_ERROR",`HTTP ${t.status} ${t.statusText} from ${i}`);return t.json()}return u.fetchJson(i,{method:r.toUpperCase(),headers:m})}async function J(u,a,r,o,e){const h=JSON.stringify(o),f=JSON.stringify(a),l=JSON.stringify(r);return await u.evaluate(`
2
2
  async () => {
3
- const urls = ${z};
4
- const method = ${Y};
5
- const headers = ${D};
6
- const concurrency = ${F};
3
+ const urls = ${f};
4
+ const method = ${l};
5
+ const headers = ${h};
6
+ const concurrency = ${e};
7
7
 
8
8
  const results = new Array(urls.length);
9
9
  let idx = 0;
@@ -28,4 +28,4 @@ import{CliError as x,getErrorMessage as E}from"../../errors.js";import{log as k}
28
28
  await Promise.all(workers);
29
29
  return results;
30
30
  }
31
- `)}export async function stepFetch(Z,$,A,V){const F=_($)?$:{},D=typeof $==="string"?$:F.url??"",z=typeof F.method==="string"?F.method:"GET",Y=_(F.params)?F.params:{},G=_(F.headers)?F.headers:{},X=String(D);if(Array.isArray(A)&&R.test(X)){const C=typeof F.concurrency==="number"?F.concurrency:5,B={};for(const[W,L]of Object.entries(G))B[W]=String(w(L,{args:V,data:A}));const M={};for(const[W,L]of Object.entries(Y))M[W]=String(w(L,{args:V,data:A}));const J=A.map((W,L)=>{let Q=String(w(X,{args:V,data:A,item:W,index:L}));if(Object.keys(M).length>0){const S=new URLSearchParams(M).toString();Q=`${Q}${Q.includes("?")?"&":"?"}${S}`}return Q});if(Z!==null){const W=await T(Z,J,z.toUpperCase(),B,C);for(let L=0;L<W.length;L++){const Q=W[L];if(Q&&typeof Q==="object"&&"error"in Q)k.warn(`Batch fetch failed for ${J[L]}: ${Q.error}`)}return W}return I(A,C,async(W,L)=>{const Q=String(w(X,{args:V,data:A,item:W,index:L}));try{return await v(null,Q,z,Y,G,V,A)}catch(S){const N=E(S);k.warn(`Batch fetch failed for ${Q}: ${N}`);return{error:N}}})}const K=w(D,{args:V,data:A});return v(Z,String(K),z,Y,G,V,A)}
31
+ `)}export async function stepFetch(u,a,r,o){const e=g(a)?a:{},h=typeof a==="string"?a:e.url??"",f=typeof e.method==="string"?e.method:"GET",l=g(e.params)?e.params:{},m=g(e.headers)?e.headers:{},i=String(h);if(Array.isArray(r)&&x.test(i)){const y=typeof e.concurrency==="number"?e.concurrency:5,S={};for(const[c,n]of Object.entries(m))S[c]=String(d(n,{args:o,data:r}));const p={};for(const[c,n]of Object.entries(l))p[c]=String(d(n,{args:o,data:r}));const O=r.map((c,n)=>{let s=String(d(i,{args:o,data:r,item:c,index:n}));if(Object.keys(p).length>0){const w=new URLSearchParams(p).toString();s=`${s}${s.includes("?")?"&":"?"}${w}`}return s});if(u!==null){const c=await J(u,O,f.toUpperCase(),S,y);for(let n=0;n<c.length;n++){const s=c[n];if(s&&typeof s==="object"&&"error"in s)j.warn(`Batch fetch failed for ${O[n]}: ${s.error}`)}return c}return P(r,y,async(c,n)=>{const s=String(d(i,{args:o,data:r,item:c,index:n}));try{return await k(null,s,f,l,m,o,r)}catch(w){const b=T(w);j.warn(`Batch fetch failed for ${s}: ${b}`);return{error:b}}})}const t=d(h,{args:o,data:r});return k(u,String(t),f,l,m,o,r)}
@@ -1 +1 @@
1
- import{render as D,normalizeEvaluateSource as J}from"../template.js";export async function stepIntercept(k,B,w,C){const y=typeof B==="object"&&B!==null?B:{},q=y.trigger??"",F=y.capture??"",H=y.timeout??8,G=y.select??null;if(!F)return w;await k.installInterceptor(F);if(q.startsWith("navigate:")){const b=D(q.slice(9),{args:C,data:w});await k.goto(String(b))}else if(q.startsWith("evaluate:")){const b=q.slice(9);await k.evaluate(J(D(b,{args:C,data:w})))}else if(q.startsWith("click:")){const b=D(q.slice(6),{args:C,data:w});await k.click(String(b).replace(/^@/,""))}else if(q==="scroll")await k.scroll("down");await k.waitForCapture(H);const A=await k.getInterceptedRequests();let x=A.length===1?A[0]:A.length>1?A:w;if(G&&x){let b=x;for(const I of String(G).split("."))if(b&&typeof b==="object"&&!Array.isArray(b))b=b[I];else break;x=b??x}return x}
1
+ import{render as a,normalizeEvaluateSource as w}from"../template.js";export async function stepIntercept(e,s,i,o){const n=typeof s==="object"&&s!==null?s:{},r=n.trigger??"",u=n.capture??"",g=n.timeout??8,f=n.select??null;if(!u)return i;await e.installInterceptor(u);if(r.startsWith("navigate:")){const t=a(r.slice(9),{args:o,data:i});await e.goto(String(t))}else if(r.startsWith("evaluate:")){const t=r.slice(9);await e.evaluate(w(a(t,{args:o,data:i})))}else if(r.startsWith("click:")){const t=a(r.slice(6),{args:o,data:i});await e.click(String(t).replace(/^@/,""))}else if(r==="scroll")await e.scroll("down");await e.waitForCapture(g);const c=await e.getInterceptedRequests();let l=c.length===1?c[0]:c.length>1?c:i;if(f&&l){let t=l;for(const h of String(f).split("."))if(t&&typeof t==="object"&&!Array.isArray(t))t=t[h];else break;l=t??l}return l}
@@ -1,15 +1,15 @@
1
- import{render as z}from"../template.js";import{generateTapInterceptorJs as _}from"../../interceptor.js";import{CliError as $}from"../../errors.js";export async function stepTap(L,B,x,y){const q=typeof B==="object"&&B!==null?B:{},F=String(z(q.store??"",{args:y,data:x})),v=String(z(q.action??"",{args:y,data:x})),M=String(z(q.capture??"",{args:y,data:x})),O=q.timeout??5,G=q.select?String(z(q.select,{args:y,data:x})):null,Q=q.framework??null,S=q.args??[];if(!F||!v)throw new $("TAP_MISSING_PARAMS","tap: store and action are required");const V=G?G.split(".").map((D)=>`?.[${JSON.stringify(D)}]`).join(""):"",K=S.map((D)=>{const Z=z(D,{args:y,data:x});return JSON.stringify(Z)}),W=K.length?`store[${JSON.stringify(v)}](${K.join(", ")})`:`store[${JSON.stringify(v)}]()`,b=_(JSON.stringify(M)),Y=`
1
+ import{render as i}from"../template.js";import{generateTapInterceptorJs as d}from"../../interceptor.js";import{CliError as P}from"../../errors.js";export async function stepTap(u,s,o,n){const e=typeof s==="object"&&s!==null?s:{},c=String(i(e.store??"",{args:n,data:o})),r=String(i(e.action??"",{args:n,data:o})),l=String(i(e.capture??"",{args:n,data:o})),m=e.timeout??5,p=e.select?String(i(e.select,{args:n,data:o})):null,y=e.framework??null,g=e.args??[];if(!c||!r)throw new P("TAP_MISSING_PARAMS","tap: store and action are required");const S=p?p.split(".").map((a)=>`?.[${JSON.stringify(a)}]`).join(""):"",f=g.map((a)=>{const h=i(a,{args:n,data:o});return JSON.stringify(h)}),N=f.length?`store[${JSON.stringify(r)}](${f.join(", ")})`:`store[${JSON.stringify(r)}]()`,t=d(JSON.stringify(l)),_=`
2
2
  async () => {
3
3
  // ── 1. Setup capture proxy (fetch + XHR dual interception) ──
4
- ${b.setupVar}
5
- ${b.fetchPatch}
6
- ${b.xhrPatch}
4
+ ${t.setupVar}
5
+ ${t.fetchPatch}
6
+ ${t.xhrPatch}
7
7
 
8
8
  try {
9
9
  // ── 2. Find store ──
10
10
  let store = null;
11
- const storeName = ${JSON.stringify(F)};
12
- const fw = ${JSON.stringify(Q)};
11
+ const storeName = ${JSON.stringify(c)};
12
+ const fw = ${JSON.stringify(y)};
13
13
 
14
14
  const app = document.querySelector('#app');
15
15
  if (!fw || fw === 'pinia') {
@@ -23,31 +23,31 @@ import{render as z}from"../template.js";import{generateTapInterceptorJs as _}fro
23
23
  const vuexStore = app?.__vue_app__?.config?.globalProperties?.$store
24
24
  ?? app?.__vue__?.$store;
25
25
  if (vuexStore) {
26
- store = { [${JSON.stringify(v)}]: (...a) => vuexStore.dispatch(storeName + '/' + ${JSON.stringify(v)}, ...a) };
26
+ store = { [${JSON.stringify(r)}]: (...a) => vuexStore.dispatch(storeName + '/' + ${JSON.stringify(r)}, ...a) };
27
27
  }
28
28
  } catch {}
29
29
  }
30
30
 
31
31
  if (!store) return { error: 'Store not found: ' + storeName, hint: 'Page may not be fully loaded or store name may be incorrect' };
32
- if (typeof store[${JSON.stringify(v)}] !== 'function') {
33
- return { error: 'Action not found: ' + ${JSON.stringify(v)} + ' on store ' + storeName,
32
+ if (typeof store[${JSON.stringify(r)}] !== 'function') {
33
+ return { error: 'Action not found: ' + ${JSON.stringify(r)} + ' on store ' + storeName,
34
34
  hint: 'Available: ' + Object.keys(store).filter(k => typeof store[k] === 'function' && !k.startsWith('$') && !k.startsWith('_')).join(', ') };
35
35
  }
36
36
 
37
37
  // ── 3. Call store action ──
38
- await ${W};
38
+ await ${N};
39
39
 
40
40
  // ── 4. Wait for network response ──
41
- if (!${b.capturedVar}) {
42
- const timeoutPromise = new Promise(r => setTimeout(r, ${O} * 1000));
43
- await Promise.race([${b.promiseVar}, timeoutPromise]);
41
+ if (!${t.capturedVar}) {
42
+ const timeoutPromise = new Promise(r => setTimeout(r, ${m} * 1000));
43
+ await Promise.race([${t.promiseVar}, timeoutPromise]);
44
44
  }
45
45
  } finally {
46
46
  // ── 5. Always restore originals ──
47
- ${b.restorePatch}
47
+ ${t.restorePatch}
48
48
  }
49
49
 
50
- if (!${b.capturedVar}) return { error: 'No matching response captured for pattern: ' + capturePattern };
51
- return ${b.capturedVar}${V} ?? ${b.capturedVar};
50
+ if (!${t.capturedVar}) return { error: 'No matching response captured for pattern: ' + capturePattern };
51
+ return ${t.capturedVar}${S} ?? ${t.capturedVar};
52
52
  }
53
- `;return L.evaluate(Y)}
53
+ `;return u.evaluate(_)}
@@ -1 +1 @@
1
- import{render as Q,evalExpr as U}from"../template.js";import{isRecord as I}from"../../utils.js";export async function stepSelect(G,A,q,C){const z=String(Q(A,{args:C,data:q}));if(q&&typeof q==="object"){let B=q;for(const D of z.split("."))if(I(B))B=B[D];else if(Array.isArray(B)&&/^\d+$/.test(D))B=B[parseInt(D,10)];else return null;return B}return q}export async function stepMap(G,A,q,C){if(!q||typeof q!=="object")return q;let z=q;if(I(A)&&"select"in A)z=await stepSelect(null,A.select,q,C);if(!z||typeof z!=="object")return z;let B=Array.isArray(z)?z:[z];if(I(z)&&Array.isArray(z.data))B=z.data;const D=[],M=I(A)?A:{};for(let J=0;J<B.length;J++){const O=B[J],K={};for(const[L,H]of Object.entries(M)){if(L==="select")continue;K[L]=Q(H,{args:C,data:z,root:q,item:O,index:J})}D.push(K)}return D}export async function stepFilter(G,A,q,C){if(!Array.isArray(q))return q;return q.filter((z,B)=>U(String(A),{args:C,item:z,index:B}))}function T(G){return typeof G==="number"&&Number.isFinite(G)?G:null}export async function stepSort(G,A,q,C){if(!Array.isArray(q))return q;const z=I(A)?String(A.by??""):String(A),B=I(A)?A.order==="desc":!1;return[...q].sort((D,M)=>{const J=I(D)?D[z]:void 0,O=I(M)?M[z]:void 0,K=T(J),L=T(O);let H;if(K!==null&&L!==null)H=K-L;else if(K!==null)H=-1;else if(L!==null)H=1;else H=String(J??"").localeCompare(String(O??""),void 0,{numeric:!0});return B?-H:H})}export async function stepLimit(G,A,q,C){if(!Array.isArray(q))return q;return q.slice(0,Number(Q(A,{args:C,data:q})))}
1
+ import{render as A,evalExpr as S}from"../template.js";import{isRecord as u}from"../../utils.js";export async function stepSelect(s,t,e,i){const r=String(A(t,{args:i,data:e}));if(e&&typeof e==="object"){let n=e;for(const o of r.split("."))if(u(n))n=n[o];else if(Array.isArray(n)&&/^\d+$/.test(o))n=n[parseInt(o,10)];else return null;return n}return e}export async function stepMap(s,t,e,i){if(!e||typeof e!=="object")return e;let r=e;if(u(t)&&"select"in t)r=await stepSelect(null,t.select,e,i);if(!r||typeof r!=="object")return r;let n=Array.isArray(r)?r:[r];if(u(r)&&Array.isArray(r.data))n=r.data;const o=[],y=u(t)?t:{};for(let l=0;l<n.length;l++){const g=n[l],f={};for(const[p,c]of Object.entries(y)){if(p==="select")continue;f[p]=A(c,{args:i,data:r,root:e,item:g,index:l})}o.push(f)}return o}export async function stepFilter(s,t,e,i){if(!Array.isArray(e))return e;return e.filter((r,n)=>S(String(t),{args:i,item:r,index:n}))}function m(s){return typeof s==="number"&&Number.isFinite(s)?s:null}export async function stepSort(s,t,e,i){if(!Array.isArray(e))return e;const r=u(t)?String(t.by??""):String(t),n=u(t)?t.order==="desc":!1;return[...e].sort((o,y)=>{const l=u(o)?o[r]:void 0,g=u(y)?y[r]:void 0,f=m(l),p=m(g);let c;if(f!==null&&p!==null)c=f-p;else if(f!==null)c=-1;else if(p!==null)c=1;else c=String(l??"").localeCompare(String(g??""),void 0,{numeric:!0});return n?-c:c})}export async function stepLimit(s,t,e,i){if(!Array.isArray(e))return e;return e.slice(0,Number(A(t,{args:i,data:e})))}
@@ -1 +1 @@
1
- import P from"node:vm";import{isRecord as I}from"../utils.js";import{log as M}from"../logger.js";export function render(G,q){if(typeof G!=="string")return G;const $=G.trim(),Q=$.match(/^\$\{\{\s*([^}]*(?:\}[^}][^}]*)*)\s*\}\}$/);if(Q&&!$.includes("}}-")&&!$.includes("}}${{"))return evalExpr(Q[1].trim(),q);const Z=$.match(/^\$\{\{\s*([\s\S]*?)\s*\}\}$/);if(Z){const Y=Z[1];if(!Y.includes("${{"))return evalExpr(Y.trim(),q)}return G.replace(/\$\{\{\s*(.*?)\s*\}\}/g,(Y,U)=>String(evalExpr(U.trim(),q)))}export function evalExpr(G,q){const $=q.args??{},Q=q.item??{},Z=q.data,Y=q.root,U=q.index??0,k=G.split(/(?<!\|)\|(?!\|)/).map((B)=>B.trim());if(k.length>1){let B=evalExpr(k[0],q);for(let H=1;H<k.length;H++)B=T(k[H],B);return B}const F=G.match(/^(['"])(.*)\1$/);if(F)return F[2];if(/^\d+(\.\d+)?$/.test(G))return Number(G);const W=resolvePath(G,{args:$,item:Q,data:Z,root:Y,index:U});if(W!==null&&W!==void 0)return W;return R(G,{args:$,item:Q,data:Z,root:Y,index:U})}function T(G,q){const $=G.match(/^(\w+)(?:\((.+)\))?$/);if(!$)return q;const[,Q,Z]=$,Y=Z?.replace(/^['"]|['"]$/g,"")??"";switch(Q){case"default":{if(q===null||q===void 0||q===""){const U=parseInt(Y,10);if(!Number.isNaN(U)&&String(U)===Y.trim())return U;return Y}return q}case"join":return Array.isArray(q)?q.join(Y||", "):q;case"upper":return typeof q==="string"?q.toUpperCase():q;case"lower":return typeof q==="string"?q.toLowerCase():q;case"trim":return typeof q==="string"?q.trim():q;case"truncate":{const U=parseInt(Y,10)||50;return typeof q==="string"&&q.length>U?`${q.slice(0,U)}...`:q}case"replace":{if(typeof q!=="string")return q;if(Z==null)return q;const U=Z.indexOf(",");if(U===-1)return q;const k=(B)=>B.trim().replace(/^['"]|['"]$/g,""),F=k(Z.slice(0,U)),W=k(Z.slice(U+1));return q.replaceAll(F,W)}case"keys":return q&&typeof q==="object"?Object.keys(q):q;case"length":return Array.isArray(q)?q.length:typeof q==="string"?q.length:q;case"first":return Array.isArray(q)?q[0]:q;case"last":return Array.isArray(q)?q[q.length-1]:q;case"json":return JSON.stringify(q??null);case"slugify":return typeof q==="string"?q.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,""):q;case"sanitize":return typeof q==="string"?q.replace(/[<>:"/\\|?*\x00-\x1f]/g,"_"):q;case"ext":{if(typeof q!=="string")return q;const U=q.lastIndexOf("."),k=Math.max(q.lastIndexOf("/"),q.lastIndexOf("\\"));return U>k?q.slice(U):""}case"basename":{if(typeof q!=="string")return q;const U=q.split(/[/\\]/);return U[U.length-1]||q}case"urlencode":return typeof q==="string"?encodeURIComponent(q):q;case"urldecode":return typeof q==="string"?decodeURIComponent(q):q;default:return q}}export function resolvePath(G,q){const $=q.args??{},Q=q.item??{},Z=q.data,Y=q.root,U=q.index??0,k=G.split("."),F=k[0];let W,B;if(F==="args"){W=$;B=k.slice(1)}else if(F==="item"){W=Q;B=k.slice(1)}else if(F==="data"){W=Z;B=k.slice(1)}else if(F==="root"){W=Y;B=k.slice(1)}else if(F==="index")return U;else{W=Q;B=k}for(const H of B)if(I(W))W=W[H];else if(Array.isArray(W)&&/^\d+$/.test(H))W=W[parseInt(H,10)];else return null;return W}const y=/\b(constructor|__proto__|prototype|globalThis|process|require|import|eval)\b/,X=new WeakMap;function L(G){if(G===null||G===void 0)return G;if(typeof G!=="object"&&typeof G!=="function")return G;const q=G,$=X.get(q);if($!==void 0)return JSON.parse($);try{const Q=JSON.stringify(G,(Z,Y)=>typeof Y==="bigint"?Y.toString():Y);X.set(q,Q);return JSON.parse(Q)}catch(Q){M.warn(`[pipeline/template] sanitizeContext failed: ${Q instanceof Error?Q.message:String(Q)}. Returning {} for this branch. Likely cause: circular reference, Symbol, or other non-serializable value in pipeline context.`);return{}}}const D=256,J=new Map;function V(G){let q=J.get(G);if(q)return q;if(J.size>=D){const $=J.keys().next().value;if($!==void 0)J.delete($)}q=new P.Script(`(${G})`);J.set(G,q);return q}let K=null,O=null;function w(){if(K&&O)return{sandbox:K,context:O};K={args:{},item:{},data:null,root:null,index:0,encodeURIComponent,decodeURIComponent,JSON,Math,Number,String,Boolean,Array,Date};O=P.createContext(K,{codeGeneration:{strings:!1,wasm:!1}});return{sandbox:K,context:O}}const z=new Set(["args","item","data","root","index","encodeURIComponent","decodeURIComponent","JSON","Math","Number","String","Boolean","Array","Date"]);function R(G,q){if(G.length>2000)return;if(y.test(G))return;try{const $=V(G),{sandbox:Q,context:Z}=w();for(const Y of Object.keys(Q))if(!z.has(Y))delete Q[Y];Q.args=L(q.args??{});Q.item=L(q.item??{});Q.data=L(q.data);Q.root=L(q.root);Q.index=q.index??0;return $.runInContext(Z,{timeout:50})}catch{return}}export function normalizeEvaluateSource(G){const q=G.trim();if(!q)return"() => undefined";if(q.startsWith("(")&&q.endsWith(")()"))return`() => (${q})`;if(/^(async\s+)?\([^)]*\)\s*=>/.test(q))return q;if(/^(async\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=>/.test(q))return q;if(q.startsWith("function ")||q.startsWith("async function "))return q;return`() => (${q})`}
1
+ import y from"node:vm";import{isRecord as S}from"../utils.js";import{log as A}from"../logger.js";export function render(r,t){if(typeof r!=="string")return r;const i=r.trim(),e=i.match(/^\$\{\{\s*([^}]*(?:\}[^}][^}]*)*)\s*\}\}$/);if(e&&!i.includes("}}-")&&!i.includes("}}${{"))return evalExpr(e[1].trim(),t);const c=i.match(/^\$\{\{\s*([\s\S]*?)\s*\}\}$/);if(c){const s=c[1];if(!s.includes("${{"))return evalExpr(s.trim(),t)}return r.replace(/\$\{\{\s*(.*?)\s*\}\}/g,(s,n)=>String(evalExpr(n.trim(),t)))}export function evalExpr(r,t){const i=t.args??{},e=t.item??{},c=t.data,s=t.root,n=t.index??0,f=r.split(/(?<!\|)\|(?!\|)/).map((a)=>a.trim());if(f.length>1){let a=evalExpr(f[0],t);for(let p=1;p<f.length;p++)a=C(f[p],a);return a}const d=r.match(/^(['"])(.*)\1$/);if(d)return d[2];if(/^\d+(\.\d+)?$/.test(r))return Number(r);const o=resolvePath(r,{args:i,item:e,data:c,root:s,index:n});if(o!==null&&o!==void 0)return o;return O(r,{args:i,item:e,data:c,root:s,index:n})}function C(r,t){const i=r.match(/^(\w+)(?:\((.+)\))?$/);if(!i)return t;const[,e,c]=i,s=c?.replace(/^['"]|['"]$/g,"")??"";switch(e){case"default":{if(t===null||t===void 0||t===""){const n=parseInt(s,10);if(!Number.isNaN(n)&&String(n)===s.trim())return n;return s}return t}case"join":return Array.isArray(t)?t.join(s||", "):t;case"upper":return typeof t==="string"?t.toUpperCase():t;case"lower":return typeof t==="string"?t.toLowerCase():t;case"trim":return typeof t==="string"?t.trim():t;case"truncate":{const n=parseInt(s,10)||50;return typeof t==="string"&&t.length>n?`${t.slice(0,n)}...`:t}case"replace":{if(typeof t!=="string")return t;if(c==null)return t;const n=c.indexOf(",");if(n===-1)return t;const f=(a)=>a.trim().replace(/^['"]|['"]$/g,""),d=f(c.slice(0,n)),o=f(c.slice(n+1));return t.replaceAll(d,o)}case"keys":return t&&typeof t==="object"?Object.keys(t):t;case"length":return Array.isArray(t)?t.length:typeof t==="string"?t.length:t;case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"json":return JSON.stringify(t??null);case"slugify":return typeof t==="string"?t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,""):t;case"sanitize":return typeof t==="string"?t.replace(/[<>:"/\\|?*\x00-\x1f]/g,"_"):t;case"ext":{if(typeof t!=="string")return t;const n=t.lastIndexOf("."),f=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>f?t.slice(n):""}case"basename":{if(typeof t!=="string")return t;const n=t.split(/[/\\]/);return n[n.length-1]||t}case"urlencode":return typeof t==="string"?encodeURIComponent(t):t;case"urldecode":return typeof t==="string"?decodeURIComponent(t):t;default:return t}}export function resolvePath(r,t){const i=t.args??{},e=t.item??{},c=t.data,s=t.root,n=t.index??0,f=r.split("."),d=f[0];let o,a;if(d==="args"){o=i;a=f.slice(1)}else if(d==="item"){o=e;a=f.slice(1)}else if(d==="data"){o=c;a=f.slice(1)}else if(d==="root"){o=s;a=f.slice(1)}else if(d==="index")return n;else{o=e;a=f}for(const p of a)if(S(o))o=o[p];else if(Array.isArray(o)&&/^\d+$/.test(p))o=o[parseInt(p,10)];else return null;return o}const _=/\b(constructor|__proto__|prototype|globalThis|process|require|import|eval)\b/,h=new WeakMap;function u(r){if(r===null||r===void 0)return r;if(typeof r!=="object"&&typeof r!=="function")return r;const t=r,i=h.get(t);if(i!==void 0)return JSON.parse(i);try{const e=JSON.stringify(r,(c,s)=>typeof s==="bigint"?s.toString():s);h.set(t,e);return JSON.parse(e)}catch(e){A.warn(`[pipeline/template] sanitizeContext failed: ${e instanceof Error?e.message:String(e)}. Returning {} for this branch. Likely cause: circular reference, Symbol, or other non-serializable value in pipeline context.`);return{}}}const b=256,g=new Map;function I(r){let t=g.get(r);if(t)return t;if(g.size>=b){const i=g.keys().next().value;if(i!==void 0)g.delete(i)}t=new y.Script(`(${r})`);g.set(r,t);return t}let m=null,l=null;function N(){if(m&&l)return{sandbox:m,context:l};m={args:{},item:{},data:null,root:null,index:0,encodeURIComponent,decodeURIComponent,JSON,Math,Number,String,Boolean,Array,Date};l=y.createContext(m,{codeGeneration:{strings:!1,wasm:!1}});return{sandbox:m,context:l}}const x=new Set(["args","item","data","root","index","encodeURIComponent","decodeURIComponent","JSON","Math","Number","String","Boolean","Array","Date"]);function O(r,t){if(r.length>2000)return;if(_.test(r))return;try{const i=I(r),{sandbox:e,context:c}=N();for(const s of Object.keys(e))if(!x.has(s))delete e[s];e.args=u(t.args??{});e.item=u(t.item??{});e.data=u(t.data);e.root=u(t.root);e.index=t.index??0;return i.runInContext(c,{timeout:50})}catch{return}}export function normalizeEvaluateSource(r){const t=r.trim();if(!t)return"() => undefined";if(t.startsWith("(")&&t.endsWith(")()"))return`() => (${t})`;if(/^(async\s+)?\([^)]*\)\s*=>/.test(t))return t;if(/^(async\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=>/.test(t))return t;if(t.startsWith("function ")||t.startsWith("async function "))return t;return`() => (${t})`}
@@ -1 +1 @@
1
- import*as U from"node:fs";import*as W from"node:path";import{PKG_VERSION as X}from"./version.js";export const MANIFEST_FILENAME="opencli-plugin.json";export function readPluginManifest(q){const D=W.join(q,MANIFEST_FILENAME);try{const z=U.readFileSync(D,"utf-8"),J=JSON.parse(z);if(typeof J!=="object"||J===null||Array.isArray(J))return null;return J}catch{return null}}export function isMonorepo(q){return q.plugins!==void 0&&q.plugins!==null&&typeof q.plugins==="object"&&Object.keys(q.plugins).length>0}export function getEnabledPlugins(q){if(!q.plugins)return[];return Object.entries(q.plugins).filter(([,D])=>!D.disabled).map(([D,z])=>({name:D,entry:z})).sort((D,z)=>D.name.localeCompare(z.name))}export function checkCompatibility(q){if(!q||q.trim()==="")return!0;return satisfiesRange(X,q)}export function getCompatibilityRange(q){return q?.ppcli??q?.opencli}export function parseVersion(q){const D=q.trim().match(/^(\d+)\.(\d+)\.(\d+)/);if(!D)return null;return[parseInt(D[1],10),parseInt(D[2],10),parseInt(D[3],10)]}function H(q,D){for(let z=0;z<3;z++){if(q[z]<D[z])return-1;if(q[z]>D[z])return 1}return 0}function Y(q,D){const z=D.trim();if(!z)return!0;if(z.startsWith("^")){const B=parseVersion(z.slice(1));if(!B)return!0;const Q=[B[0]+1,0,0];return H(q,B)>=0&&H(q,Q)<0}if(z.startsWith("~")){const B=parseVersion(z.slice(1));if(!B)return!0;const Q=[B[0],B[1]+1,0];return H(q,B)>=0&&H(q,Q)<0}if(z.startsWith(">=")){const B=parseVersion(z.slice(2));if(!B)return!0;return H(q,B)>=0}if(z.startsWith("<=")){const B=parseVersion(z.slice(2));if(!B)return!0;return H(q,B)<=0}if(z.startsWith(">")){const B=parseVersion(z.slice(1));if(!B)return!0;return H(q,B)>0}if(z.startsWith("<")){const B=parseVersion(z.slice(1));if(!B)return!0;return H(q,B)<0}if(z.startsWith("=")){const B=parseVersion(z.slice(1));if(!B)return!0;return H(q,B)===0}const J=parseVersion(z);if(!J)return!0;return H(q,J)===0}export function satisfiesRange(q,D){const z=parseVersion(q);if(!z)return!0;return D.trim().split(/\s+/).every((B)=>Y(z,B))}export{readPluginManifest as _readPluginManifest,isMonorepo as _isMonorepo,getEnabledPlugins as _getEnabledPlugins,checkCompatibility as _checkCompatibility,parseVersion as _parseVersion,satisfiesRange as _satisfiesRange};
1
+ import*as o from"node:fs";import*as a from"node:path";import{PKG_VERSION as c}from"./version.js";export const MANIFEST_FILENAME="opencli-plugin.json";export function readPluginManifest(t){const n=a.join(t,MANIFEST_FILENAME);try{const r=o.readFileSync(n,"utf-8"),s=JSON.parse(r);if(typeof s!=="object"||s===null||Array.isArray(s))return null;return s}catch{return null}}export function isMonorepo(t){return t.plugins!==void 0&&t.plugins!==null&&typeof t.plugins==="object"&&Object.keys(t.plugins).length>0}export function getEnabledPlugins(t){if(!t.plugins)return[];return Object.entries(t.plugins).filter(([,n])=>!n.disabled).map(([n,r])=>({name:n,entry:r})).sort((n,r)=>n.name.localeCompare(r.name))}export function checkCompatibility(t){if(!t||t.trim()==="")return!0;return satisfiesRange(c,t)}export function getCompatibilityRange(t){return t?.ppcli??t?.opencli}export function parseVersion(t){const n=t.trim().match(/^(\d+)\.(\d+)\.(\d+)/);if(!n)return null;return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)]}function i(t,n){for(let r=0;r<3;r++){if(t[r]<n[r])return-1;if(t[r]>n[r])return 1}return 0}function p(t,n){const r=n.trim();if(!r)return!0;if(r.startsWith("^")){const e=parseVersion(r.slice(1));if(!e)return!0;const u=[e[0]+1,0,0];return i(t,e)>=0&&i(t,u)<0}if(r.startsWith("~")){const e=parseVersion(r.slice(1));if(!e)return!0;const u=[e[0],e[1]+1,0];return i(t,e)>=0&&i(t,u)<0}if(r.startsWith(">=")){const e=parseVersion(r.slice(2));if(!e)return!0;return i(t,e)>=0}if(r.startsWith("<=")){const e=parseVersion(r.slice(2));if(!e)return!0;return i(t,e)<=0}if(r.startsWith(">")){const e=parseVersion(r.slice(1));if(!e)return!0;return i(t,e)>0}if(r.startsWith("<")){const e=parseVersion(r.slice(1));if(!e)return!0;return i(t,e)<0}if(r.startsWith("=")){const e=parseVersion(r.slice(1));if(!e)return!0;return i(t,e)===0}const s=parseVersion(r);if(!s)return!0;return i(t,s)===0}export function satisfiesRange(t,n){const r=parseVersion(t);if(!r)return!0;return n.trim().split(/\s+/).every((e)=>p(r,e))}export{readPluginManifest as _readPluginManifest,isMonorepo as _isMonorepo,getEnabledPlugins as _getEnabledPlugins,checkCompatibility as _checkCompatibility,parseVersion as _parseVersion,satisfiesRange as _satisfiesRange};
@@ -1,14 +1,14 @@
1
- import*as H from"node:fs";import*as J from"node:path";import{PKG_VERSION as L}from"./version.js";export function createPluginScaffold(b,x={}){if(!/^[a-z][a-z0-9-]*$/.test(b))throw Error(`Invalid plugin name "${b}". Plugin names must start with a lowercase letter and contain only lowercase letters, digits, and hyphens.`);const q=x.dir?J.resolve(x.dir):J.resolve(b);if(H.existsSync(q)&&H.readdirSync(q).length>0)throw Error(`Directory "${q}" already exists and is not empty.`);H.mkdirSync(q,{recursive:!0});const z=[],Q={name:b,version:"0.1.0",description:x.description??`A ppcli plugin: ${b}`,ppcli:`>=${L}`};B(q,"opencli-plugin.json",JSON.stringify(Q,null,2)+`
2
- `);z.push("opencli-plugin.json");const U={name:`opencli-plugin-${b}`,version:"0.1.0",type:"module",description:x.description??`A ppcli plugin: ${b}`,peerDependencies:{"@jackwener/opencli":`>=${L}`}};B(q,"package.json",JSON.stringify(U,null,2)+`
3
- `);z.push("package.json");const W=`/**
4
- * Sample pipeline command for ${b}.
1
+ import*as n from"node:fs";import*as o from"node:path";import{PKG_VERSION as p}from"./version.js";export function createPluginScaffold(e,t={}){if(!/^[a-z][a-z0-9-]*$/.test(e))throw Error(`Invalid plugin name "${e}". Plugin names must start with a lowercase letter and contain only lowercase letters, digits, and hyphens.`);const i=t.dir?o.resolve(t.dir):o.resolve(e);if(n.existsSync(i)&&n.readdirSync(i).length>0)throw Error(`Directory "${i}" already exists and is not empty.`);n.mkdirSync(i,{recursive:!0});const r=[],s={name:e,version:"0.1.0",description:t.description??`A ppcli plugin: ${e}`,ppcli:`>=${p}`};l(i,"opencli-plugin.json",JSON.stringify(s,null,2)+`
2
+ `);r.push("opencli-plugin.json");const c={name:`opencli-plugin-${e}`,version:"0.1.0",type:"module",description:t.description??`A ppcli plugin: ${e}`,peerDependencies:{"@jackwener/opencli":`>=${p}`}};l(i,"package.json",JSON.stringify(c,null,2)+`
3
+ `);r.push("package.json");const a=`/**
4
+ * Sample pipeline command for ${e}.
5
5
  * Demonstrates the declarative pipeline API.
6
6
  */
7
7
 
8
8
  import { cli, Strategy } from '@jackwener/opencli/registry';
9
9
 
10
10
  cli({
11
- site: '${b}',
11
+ site: '${e}',
12
12
  name: 'hello',
13
13
  description: 'A sample pipeline command',
14
14
  strategy: Strategy.PUBLIC,
@@ -19,15 +19,15 @@ cli({
19
19
  { select: 'args' },
20
20
  ],
21
21
  });
22
- `;B(q,"hello.ts",W);z.push("hello.ts");const X=`/**
23
- * Sample TypeScript command for ${b}.
22
+ `;l(i,"hello.ts",a);r.push("hello.ts");const g=`/**
23
+ * Sample TypeScript command for ${e}.
24
24
  * Demonstrates the programmatic cli() registration API.
25
25
  */
26
26
 
27
27
  import { cli, Strategy } from '@jackwener/opencli/registry';
28
28
 
29
29
  cli({
30
- site: '${b}',
30
+ site: '${e}',
31
31
  name: 'greet',
32
32
  description: 'Greet someone by name',
33
33
  strategy: Strategy.PUBLIC,
@@ -38,38 +38,38 @@ cli({
38
38
  columns: ['greeting'],
39
39
  func: async (kwargs) => [{ greeting: \`Hello, \${String(kwargs.name ?? 'World')}!\` }],
40
40
  });
41
- `;B(q,"greet.ts",X);z.push("greet.ts");const Y=`# opencli-plugin-${b}
41
+ `;l(i,"greet.ts",g);r.push("greet.ts");const m=`# opencli-plugin-${e}
42
42
 
43
- ${x.description??`A ppcli plugin: ${b}`}
43
+ ${t.description??`A ppcli plugin: ${e}`}
44
44
 
45
45
  ## Install
46
46
 
47
47
  \`\`\`bash
48
48
  # From local development directory
49
- ppcli plugin install file://${q}
49
+ ppcli plugin install file://${i}
50
50
 
51
51
  # From GitHub (after publishing)
52
- ppcli plugin install github:<user>/opencli-plugin-${b}
52
+ ppcli plugin install github:<user>/opencli-plugin-${e}
53
53
  \`\`\`
54
54
 
55
55
  ## Commands
56
56
 
57
57
  | Command | Type | Description |
58
58
  |---------|------|-------------|
59
- | \`${b}/hello\` | Pipeline | Sample pipeline command |
60
- | \`${b}/greet\` | TypeScript | Sample TS command with func() |
59
+ | \`${e}/hello\` | Pipeline | Sample pipeline command |
60
+ | \`${e}/greet\` | TypeScript | Sample TS command with func() |
61
61
 
62
62
  ## Development
63
63
 
64
64
  \`\`\`bash
65
65
  # Install locally for development (symlinked, changes reflect immediately)
66
- ppcli plugin install file://${q}
66
+ ppcli plugin install file://${i}
67
67
 
68
68
  # Verify commands are registered
69
- ppcli list | grep ${b}
69
+ ppcli list | grep ${e}
70
70
 
71
71
  # Run a command
72
- ppcli ${b} hello
73
- ppcli ${b} greet --name World
72
+ ppcli ${e} hello
73
+ ppcli ${e} greet --name World
74
74
  \`\`\`
75
- `;B(q,"README.md",Y);z.push("README.md");return{name:b,dir:q,files:z}}function B(b,x,q){H.writeFileSync(J.join(b,x),q)}
75
+ `;l(i,"README.md",m);r.push("README.md");return{name:e,dir:i,files:r}}function l(e,t,i){n.writeFileSync(o.join(e,t),i)}