publishport-opencli 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-manifest.json +35 -0
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +16 -16
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/clis/v2ex/me.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CommandExecutionError as
|
|
1
|
+
import{CommandExecutionError as r}from"@jackwener/opencli/errors";import{cli as o,Strategy as i}from"@jackwener/opencli/registry";o({site:"v2ex",name:"me",access:"read",description:"V2EX 获取个人资料 (余额/未读提醒)",domain:"www.v2ex.com",strategy:i.COOKIE,browser:!0,args:[],columns:["username","balance","unread_notifications","daily_reward_ready"],func:async(t)=>{if(!t)throw new r("Browser page required");if(process.env.OPENCLI_VERBOSE)console.error("[ppcli:v2ex] Navigating to /");await t.goto("https://www.v2ex.com/");for(let n=0;n<5;n++){await new Promise((a)=>setTimeout(a,1500));if(!(await t.evaluate("() => document.title"))?.includes("Just a moment"))break;if(process.env.OPENCLI_VERBOSE)console.error("[ppcli:v2ex] Waiting for Cloudflare...")}const e=await t.evaluate(`
|
|
2
2
|
async () => {
|
|
3
3
|
let username = 'Unknown';
|
|
4
4
|
const navLinks = Array.from(document.querySelectorAll('a.top')).map(a => a.textContent?.trim());
|
|
@@ -55,4 +55,4 @@ import{CommandExecutionError as z}from"@jackwener/opencli/errors";import{cli as
|
|
|
55
55
|
daily_reward_ready: daily_reward_ready ? '是' : '否'
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
`);if(
|
|
58
|
+
`);if(e.error){if(process.env.OPENCLI_VERBOSE){console.error(`[ppcli:v2ex:debug] Page Title: ${e.debug_title}`);console.error(`[ppcli:v2ex:debug] Page Body: ${e.debug_body}`)}throw new r(e.error)}return[e]}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CommandExecutionError as
|
|
1
|
+
import{CommandExecutionError as i}from"@jackwener/opencli/errors";import{cli as r,Strategy as l}from"@jackwener/opencli/registry";r({site:"v2ex",name:"notifications",access:"read",description:"V2EX 获取提醒 (回复/由于)",domain:"www.v2ex.com",strategy:l.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:20,help:"Number of notifications"}],columns:["type","content","time"],func:async(t,n)=>{if(!t)throw new i("Browser page required");if(process.env.OPENCLI_VERBOSE)console.error("[ppcli:v2ex] Navigating to /notifications");await t.goto("https://www.v2ex.com/notifications");await new Promise((a)=>setTimeout(a,1500));const e=await t.evaluate(`
|
|
2
2
|
async () => {
|
|
3
3
|
const items = Array.from(document.querySelectorAll('#Main .box .cell[id^="n_"]'));
|
|
4
4
|
return items.map(item => {
|
|
@@ -37,4 +37,4 @@ import{CommandExecutionError as q}from"@jackwener/opencli/errors";import{cli as
|
|
|
37
37
|
return { type, content, time };
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
`);if(!Array.isArray(
|
|
40
|
+
`);if(!Array.isArray(e))throw new i("Failed to parse notifications data");const o=n.limit||20;return e.slice(0,o)}});
|
package/clis/vk/post.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as f,Strategy as c}from"@jackwener/opencli/registry";import{ArgumentError as a,CommandExecutionError as w,EmptyResultError as y}from"@jackwener/opencli/errors";import{assertLiteralContent as g}from"../_shared/content-guard.js";import{mintVkToken as h,vkApiCall as v}from"./shared.js";function _(e){if(e===void 0||e===null||String(e).trim()==="")return null;const t=String(e).trim();if(!/^-?\d+$/.test(t))throw new a(`Invalid --owner-id: ${JSON.stringify(t)}`,"个人墙用当前用户 id(正整数),社区墙用社区 id 加负号(如 -123456)。");return t}f({site:"vk",name:"post",access:"write",description:"Publish a text post to a VK wall (wall.post). Posts to your own wall by default; pass --owner-id (negative for a community) to target another wall, and --from-group to post as the community. Text-only for now (attachments not yet supported).",domain:"vk.com",strategy:c.COOKIE,browser:!0,args:[{name:"text",fromFile:!0,type:"string",required:!0,positional:!0,help:"帖子正文(message)"},{name:"owner-id",type:"string",required:!1,help:"目标墙 id:默认你自己的墙;社区加负号(如 -123456)"},{name:"from-group",type:"bool",default:!1,help:"以社区身份发帖(仅对社区墙有效)"},{name:"friends-only",type:"bool",default:!1,help:"仅好友可见"}],columns:["status","message","post_id","url"],func:async(e,t)=>{if(!e)throw new w("Browser session required for vk post");const n=String(t.text??"");g(n,{label:"帖子正文"});if(!n.trim())throw new a("帖子正文(text)不能为空。");const u=_(t["owner-id"]),m=t["from-group"]===!0,p=t["friends-only"]===!0,{token:d,userId:i}=await h(e),o=u??(i?String(i):null),r={message:n};if(o)r.owner_id=o;if(m)r.from_group=1;if(p)r.friends_only=1;const s=(await v("wall.post",r,d))?.post_id;if(!s)throw new y("vk post","wall.post 未返回 post_id — 发布可能未成功,请回查后再重试。");const l=o?`https://vk.com/wall${o}_${s}`:null;return[{status:"success",message:"VK post published.",post_id:String(s),...l?{url:l}:{}}]}});
|
package/clis/vk/shared.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as f,CommandExecutionError as u}from"@jackwener/opencli/errors";export const VK_ADMIN_CLIENT_ID=6222115,VK_API_VERSION="5.131",VK_API_BASES=["https://api.vk.com/method","https://api.vk.ru/method"],VK_BLANK_URL="https://oauth.vk.com/blank.html";const d={friends:2,photos:4,video:16,wall:8192,offline:65536,docs:131072,groups:262144};export const VK_SCOPE=Object.values(d).reduce((e,o)=>e|o,0);export function buildAuthorizeUrl(){return`https://oauth.vk.com/authorize?${new URLSearchParams({client_id:String(VK_ADMIN_CLIENT_ID),scope:String(VK_SCOPE),redirect_uri:VK_BLANK_URL,display:"mobile",response_type:"token",revoke:"1",v:VK_API_VERSION}).toString()}`}export function parseTokenFromUrl(e){const o=String(e||""),n=o.indexOf("#"),s=n>=0?o.slice(n+1):"",c=o.indexOf("?"),r=c>=0?o.slice(c+1,n>=0?n:void 0):"";for(const t of[s,r]){if(!t)continue;const a=new URLSearchParams(t),i=a.get("access_token");if(i)return{token:i,userId:a.get("user_id")||""}}return null}export async function mintVkToken(e){if(!e)throw new u("Browser session required to mint VK access token");await e.goto(buildAuthorizeUrl(),{waitUntil:"load",settleMs:1500});const o=12;let n=!1;for(let s=0;s<o;s++){const c=await e.evaluate("location.href"),r=parseTokenFromUrl(c);if(r?.token)return r;const t=String(c||"");if(t.includes("oauth.vk.com")&&!t.includes("blank.html")&&!n){n=!0;await e.evaluate(`(() => {
|
|
2
2
|
const forms = Array.from(document.querySelectorAll('form'));
|
|
3
3
|
const form = forms.find(f => (f.method || '').toLowerCase() === 'post') || forms[0];
|
|
4
4
|
if (form) { form.submit(); return true; }
|
|
5
5
|
const btn = document.querySelector('button[type="submit"], input[type="submit"]');
|
|
6
6
|
if (btn) { btn.click(); return true; }
|
|
7
7
|
return false;
|
|
8
|
-
})()`)}await
|
|
8
|
+
})()`)}await e.wait(1)}throw new f("vk.com","Could not mint a VK access token — VK never redirected to blank.html#access_token. "+"Open Chrome and make sure you are logged in to https://vk.com (and approve access if prompted).")}export async function vkApiCall(e,o,n){const s=new URLSearchParams;for(const[r,t]of Object.entries(o)){if(t===void 0||t===null||t==="")continue;s.set(r,String(t))}s.set("access_token",n);s.set("v",VK_API_VERSION);let c=null;for(const r of VK_API_BASES){let t;try{t=await fetch(`${r}/${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()})}catch(i){c=new u(`VK ${e}: request to ${r} failed: ${i?.message??i}`);continue}let a=null;try{a=await t.json()}catch{c=new u(`VK ${e}: non-JSON response (HTTP ${t.status}) from ${r}`);continue}if(a?.error){const i=a.error.error_code,l=a.error.error_msg||"VK API error";if(i===5)throw new f("vk.com",`VK ${e}: ${l} (token invalid/expired) [code ${i}]`);throw new u(`VK ${e} error ${i}: ${l}`)}return a?.response}throw c??new u(`VK ${e}: all API bases failed`)}
|
package/clis/vk/whoami.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as s,Strategy as o}from"@jackwener/opencli/registry";import{mintVkToken as u,vkApiCall as m}from"./shared.js";s({site:"vk",name:"whoami",access:"read",description:"查询当前 VK(vk.com)登录账号",domain:"vk.com",strategy:o.COOKIE,browser:!0,columns:["logged_in","user_id","name"],func:async(i)=>{let r,l="";try{const t=await u(i);r=t.token;l=t.userId}catch{return[{logged_in:!1,user_id:null,name:null}]}let n;try{n=await m("users.get",{},r)}catch{return[{logged_in:!1,user_id:null,name:null}]}const e=Array.isArray(n)?n[0]:null;if(!e?.id)return[{logged_in:!1,user_id:null,name:null}];const a=[e.first_name,e.last_name].filter(Boolean).join(" ").trim();return[{logged_in:!0,user_id:String(l||e.id),name:a||null}]}});
|
package/clis/web/read.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as v,Strategy as E}from"@jackwener/opencli/registry";import{downloadArticle as x}from"@jackwener/opencli/download/article-download";const C=1000,L=500,T=50;function k(e){return new Promise((t)=>setTimeout(t,e))}function F(e){if(e===!0)return!0;if(typeof e==="string")return["1","true","yes","on"].includes(e.toLowerCase());return!1}function h(e){const t=String(e||"same-origin").toLowerCase();if(["same-origin","all-same-origin","none"].includes(t))return t;return"same-origin"}function p(e){const t=String(e||"domstable").toLowerCase();if(["domstable","networkidle"].includes(t))return t;return"domstable"}function N(e){const t=typeof e?.responsePreview==="string"?e.responsePreview:"";return{method:typeof e?.method==="string"?e.method:"GET",url:typeof e?.url==="string"?e.url:"",status:typeof e?.responseStatus==="number"?e.responseStatus:0,contentType:typeof e?.responseContentType==="string"?e.responseContentType:"",size:typeof e?.responseBodyFullSize==="number"?e.responseBodyFullSize:t.length,bodyTruncated:e?.responseBodyTruncated===!0}}function g(e){const t=(e.contentType||"").toLowerCase(),i=e.url||"",n=(e.method||"GET").toUpperCase(),o=/\.(js|css|png|jpg|jpeg|gif|svg|woff|woff2|ico|map)(\?|$)/i.test(i),a=/analytics|tracking|telemetry|beacon|pixel|gtag|fbevents/i.test(i),r=/\/(api|ajax|graphql|rest|service|handler)(\/|[?._-]|$)|\.(ashx|aspx|asmx|php)(\?|$)/i.test(i),l=t.includes("json")||t.includes("xml")||t.includes("text/plain")||t.includes("javascript")||r&&t.includes("text/html");return!o&&!a&&(l||r||n!=="GET")}async function w(e,t){if(!e.readNetworkCapture)return[];const i=await e.readNetworkCapture().catch(()=>[]),n=Array.isArray(i)?i.map(N).filter((o)=>o.url):[];t.push(...n);return n}async function q(e){if(!e.startNetworkCapture)return!1;try{return await e.startNetworkCapture("")}catch{return!1}}async function D(e,t,i){const n=Math.max(1,Number(t)||1)*1000,o=Date.now()+n;let a=Date.now();while(Date.now()<o){if((await w(e,i)).length>0)a=Date.now();if(Date.now()-a>=C)return{ok:!0};await k(L)}return{ok:!1,timedOut:!0}}function y(e,t){return`
|
|
2
2
|
(async () => {
|
|
3
|
-
const selector = ${JSON.stringify(
|
|
4
|
-
const timeoutAt = Date.now() + ${Number(
|
|
3
|
+
const selector = ${JSON.stringify(e)};
|
|
4
|
+
const timeoutAt = Date.now() + ${Number(t)||1e4};
|
|
5
5
|
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
6
6
|
const sameOriginFrameDocs = () => Array.from(document.querySelectorAll('iframe')).map((frame) => {
|
|
7
7
|
try {
|
|
@@ -32,10 +32,10 @@ import{cli as h,Strategy as A}from"@jackwener/opencli/registry";import{downloadA
|
|
|
32
32
|
}
|
|
33
33
|
return { ok: false, timedOut: true, selector };
|
|
34
34
|
})()
|
|
35
|
-
`}function
|
|
35
|
+
`}function b(e){return`
|
|
36
36
|
(() => {
|
|
37
|
-
const frameMode = ${JSON.stringify(
|
|
38
|
-
const minNonStructuralIframeTextChars = ${
|
|
37
|
+
const frameMode = ${JSON.stringify(e.frames)};
|
|
38
|
+
const minNonStructuralIframeTextChars = ${T};
|
|
39
39
|
const result = {
|
|
40
40
|
title: '',
|
|
41
41
|
author: '',
|
|
@@ -255,6 +255,6 @@ import{cli as h,Strategy as A}from"@jackwener/opencli/registry";import{downloadA
|
|
|
255
255
|
|
|
256
256
|
return result;
|
|
257
257
|
})()
|
|
258
|
-
`}function
|
|
258
|
+
`}function S(e,t,i){const n=[],o=e?.diagnostics||{};n.push("[web-read diagnose]");n.push(`url: ${o.url||"-"}`);n.push(`frames: ${Array.isArray(o.frames)?o.frames.length:0}, included_same_origin: ${o.includedFrameCount||0}`);for(const r of(o.frames||[]).slice(0,20))n.push(` [frame ${r.index}] ${r.sameOrigin?"same-origin":"cross-origin"} ${r.accessible?"accessible":"blocked"} text=${r.textLength||0} ${r.src||"-"}`);if(Array.isArray(o.emptyContainers)&&o.emptyContainers.length>0){n.push(`empty_containers: ${o.emptyContainers.length}`);for(const r of o.emptyContainers.slice(0,12)){const l=`${r.tag}${r.id?`#${r.id}`:""}${r.className?`.${String(r.className).trim().split(/\\s+/).filter(Boolean).join(".")}`:""}`;n.push(` ${r.scope}: ${l} (${r.url||"-"})`)}}const a=t.filter(g);n.push(`network_capture: ${i?"enabled":"unavailable"}, entries=${t.length}, api_like=${a.length}`);for(const r of a.slice(0,20))n.push(` ${r.method} ${r.status||"-"} ${r.contentType||"-"} ${r.url}`);return`${n.join(`
|
|
259
259
|
`)}
|
|
260
|
-
`}const
|
|
260
|
+
`}const O=v({site:"web",name:"read",access:"read",description:"Fetch any web page and export as Markdown",strategy:E.COOKIE,navigateBefore:!1,args:[{name:"url",required:!0,help:"Any web page URL"},{name:"output",default:"./web-articles",help:"Output directory"},{name:"download-images",type:"boolean",default:!0,help:"Download images locally"},{name:"wait",type:"int",default:3,help:"Seconds to wait after page load"},{name:"wait-for",valueRequired:!0,help:"CSS selector to wait for in the main document or same-origin iframes"},{name:"wait-until",default:"domstable",choices:["domstable","networkidle"],help:"Readiness policy after navigation: domstable or networkidle"},{name:"frames",default:"same-origin",choices:["same-origin","all-same-origin","none"],help:"Iframe handling mode: relevant same-origin, all-same-origin, or none"},{name:"diagnose",type:"boolean",default:!1,help:"Print render diagnostics (frames, empty containers, XHR/API-like requests) to stderr"},{name:"stdout",type:"boolean",default:!1,help:"Print markdown to stdout instead of saving to a file"}],columns:["title","author","publish_time","status","size","saved"],func:async(e,t,i=!1)=>{const n=t.url,o=t.wait??3,a=p(t["wait-until"]),r=h(t.frames),l=F(t.diagnose)||i||!!process.env.OPENCLI_VERBOSE,u=[],d=a==="networkidle"||l?await q(e):!1;await e.goto(n);if(t["wait-for"]){const s=await e.evaluate(y(String(t["wait-for"]),o*1000));if(s?.invalidSelector)throw Error(`Invalid --wait-for selector "${t["wait-for"]}": ${s.error||"querySelector failed"}`);if(!s?.ok)throw Error(`Timed out waiting for selector "${t["wait-for"]}" in main document or same-origin iframes`)}else if(a!=="networkidle")await e.wait(o);if(a==="networkidle"){if(!d)throw Error("Network capture is unavailable, so --wait-until networkidle cannot be satisfied");if(!(await D(e,o,u))?.ok)throw Error(`Timed out waiting for network idle after ${o}s`)}const c=await e.evaluate(b({frames:r}));if(d)await w(e,u);if(l)process.stderr.write(S(c,u,d));let m="";try{m=new URL(n).origin+"/"}catch{}const A=await x({title:c?.title||"untitled",author:c?.author,publishTime:c?.publishTime,sourceUrl:n,contentHtml:c?.contentHtml||"",imageUrls:c?.imageUrls},{output:t.output,downloadImages:t["download-images"],imageHeaders:m?{Referer:m}:void 0,stdout:t.stdout,configureTurndown:(s)=>{s.addRule("preserveButtons",{filter:(f)=>f.nodeName==="BUTTON",replacement:(f)=>f})}});return t.stdout?null:A}});export const __test__={command:O,buildRenderAwareExtractorJs:b,buildWaitForSelectorAcrossFramesJs:y,formatDiagnostics:S,isInterestingNetworkEntry:g,normalizeFrameMode:h,normalizeWaitUntil:p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as i,CommandExecutionError as r}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as o}from"../_shared/site-auth.js";async function a(t){return(await t.getCookies({url:"https://channels.weixin.qq.com"})).some((n)=>n.name==="sessionid"&&n.value)}async function s(t){if(!await a(t))throw new i("channels.weixin.qq.com","WeChat Channels sessionid cookie missing");await t.goto("https://channels.weixin.qq.com/platform");let e=null;for(let n=0;n<30;n++){e=await t.evaluate(`(async () => {
|
|
2
2
|
try {
|
|
3
3
|
var href = location.href || '';
|
|
4
4
|
if (!/^https?:\\/\\/channels\\.weixin\\.qq\\.com/.test(href)) {
|
|
@@ -28,4 +28,4 @@ import{AuthRequiredError as F,CommandExecutionError as H}from"@jackwener/opencli
|
|
|
28
28
|
} catch (e) {
|
|
29
29
|
return { kind: 'pending', detail: String(e && e.message || e) };
|
|
30
30
|
}
|
|
31
|
-
})()`);if(
|
|
31
|
+
})()`);if(e?.ok||e?.kind==="auth"||e?.kind==="http")break;await t.wait({time:0.5})}if(e?.kind==="auth")throw new i("channels.weixin.qq.com",e.detail);if(e?.kind==="http")throw new r(`HTTP ${e.httpStatus} from auth_data`);if(e?.kind==="pending")throw new i("channels.weixin.qq.com",`WeChat Channels auth probe not settled: ${e.detail}`);if(!e?.ok)throw new r(`Unexpected WeChat Channels probe: ${JSON.stringify(e)}`);return{user_id:e.user_id,name:e.name}}o({site:"wechat-channels",domain:"channels.weixin.qq.com",loginUrl:"https://channels.weixin.qq.com/login.html?from=assistant",columns:["user_id","name"],quickCheck:a,verify:s,poll:async(t)=>{if(!await a(t))throw new i("channels.weixin.qq.com","Waiting for WeChat Channels sessionid cookie");return s(t)}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as Q from"node:fs";import*as k from"node:path";import{cli as j,Strategy as R}from"@jackwener/opencli/registry";import{ArgumentError as p,AuthRequiredError as F,CommandExecutionError as c}from"@jackwener/opencli/errors";import{setInputFiles as I}from"../_shared/file-inject.js";const _="https://channels.weixin.qq.com/platform/post/create",P=['input[placeholder*="短标题"]','input[placeholder*="填写短标题"]','input.weui-desktop-form__input[placeholder*="短标题"]',"input.weui-desktop-form__input"],L=['div[contenteditable][data-placeholder="添加描述"]','div.input-editor[contenteditable=""][data-placeholder="添加描述"]','div[data-placeholder*="描述"][contenteditable]',"div.input-editor[contenteditable]"],U=["span.add-icon.weui-icon-outlined-add","div.upload-content",".finder-video-upload-btn"],H=new Set([".mp4",".mov",".avi",".webm"]);function Y(e){if(e&&typeof e==="object"&&"data"in e&&"session"in e)return e.data;return e}async function u(e,t){return Y(await e.evaluate(t))}function T(e,t,n){const i=k.resolve(String(e));let r;try{r=Q.statSync(i)}catch{throw new p(`${t}文件不存在: ${i}`)}if(!r.isFile())throw new p(`${t}路径不是文件: ${i}`);const a=k.extname(i).toLowerCase();if(!n.has(a))throw new p(`不支持的${t}格式: ${a}(支持 ${Array.from(n).join("/")})`);return i}function E(e){const t=e==null||e===""?600:Number(e);if(!Number.isInteger(t)||t<30)throw new p("--timeout must be an integer >= 30 seconds");return t}function D(e){if(!e)return null;const t=typeof e==="number"?new Date(e<1000000000000?e*1000:e):new Date(String(e));if(Number.isNaN(t.getTime()))throw new p(`无法解析定时时间: ${e}`);if(t.getTime()<=Date.now())throw new p("定时时间必须晚于当前时间");return t}function g(e){return e===!0||e==="true"||e==="1"||e===1}function J(e,t){const n=e-Date.now();if(n<=0)throw new c(`${t}超时,请增加 --timeout 后重试`);return n}function O({isDraft:e,finalUrl:t,successMsg:n}){const i=String(n||"");if(e)return/草稿已保存|暂存成功|保存成功/.test(i);if(/已发表|发布成功|发表成功|审核中/.test(i))return!0;const r=String(t||"");return/\/platform\/post\/list\b/.test(r)}export const __test__={parseTimeoutSeconds:E,parseScheduleDate:D,parseBooleanFlag:g,requireFilePath:T,submitSucceeded:O};const d=`
|
|
2
2
|
function wujieRoot() {
|
|
3
3
|
var w = document.querySelector('wujie-app');
|
|
4
4
|
return (w && w.shadowRoot) || null;
|
|
@@ -25,10 +25,10 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
25
25
|
var rect = el.getBoundingClientRect();
|
|
26
26
|
return rect.width > 0 && rect.height > 0;
|
|
27
27
|
}
|
|
28
|
-
`;async function
|
|
28
|
+
`;async function B(e){return await u(e,`
|
|
29
29
|
(() => {
|
|
30
|
-
${
|
|
31
|
-
var sels = ${JSON.stringify(
|
|
30
|
+
${d}
|
|
31
|
+
var sels = ${JSON.stringify(U)};
|
|
32
32
|
for (var i = 0; i < sels.length; i++) {
|
|
33
33
|
var el = deepQuery(sels[i]);
|
|
34
34
|
if (el && isVisible(el)) {
|
|
@@ -38,19 +38,19 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
38
38
|
}
|
|
39
39
|
return { ok: false };
|
|
40
40
|
})()
|
|
41
|
-
`)}async function
|
|
41
|
+
`)}async function V(e,t=15000){const n=500,i=Math.max(1,Math.ceil(t/n));for(let r=0;r<i;r++){if(await u(e,`
|
|
42
42
|
(() => {
|
|
43
|
-
${
|
|
43
|
+
${d}
|
|
44
44
|
var inputSels = ['input[type="file"][accept*="video"]', 'input[type="file"]'];
|
|
45
45
|
for (var i = 0; i < inputSels.length; i++) {
|
|
46
46
|
if (deepQuery(inputSels[i])) return true;
|
|
47
47
|
}
|
|
48
48
|
return false;
|
|
49
49
|
})()
|
|
50
|
-
`))return!0;if(
|
|
51
|
-
截图已保存到 /tmp/wechat-channels_publish_upload_debug.png`)}}async function
|
|
50
|
+
`))return!0;if(r<i-1)await e.wait({time:n/1000})}return!1}async function G(e,t){await B(e);await e.wait({time:1});await V(e);try{await I(e,['input[type="file"][accept*="video"]','input[type="file"]'],[t],{findInputJs:`((sel) => { ${d} return deepQuery(sel); })`})}catch(n){await e.screenshot({path:"/tmp/wechat-channels_publish_upload_debug.png"});throw new c(`视频文件注入失败: ${n instanceof Error?n.message:String(n)}
|
|
51
|
+
截图已保存到 /tmp/wechat-channels_publish_upload_debug.png`)}}async function X(e,t,n=180000){const i=3000,r=Math.ceil(n/i);for(let a=0;a<r;a++){let s;try{s=await u(e,`
|
|
52
52
|
((fileName) => {
|
|
53
|
-
${
|
|
53
|
+
${d}
|
|
54
54
|
var root = wujieRoot() || document;
|
|
55
55
|
var bodyText = (root.innerText || root.textContent || '').trim();
|
|
56
56
|
var uploading = deepQuery('[class*="upload"][class*="progress"]') ||
|
|
@@ -69,11 +69,11 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
69
69
|
var hasFileEvidence = fileName && bodyText.indexOf(fileName) >= 0;
|
|
70
70
|
var hasSuccessText = /上传成功|转码完成|处理完成/.test(bodyText);
|
|
71
71
|
return { done: !uploading && (!!preview || hasFileEvidence || hasSuccessText), failed: false };
|
|
72
|
-
})(${JSON.stringify(
|
|
73
|
-
`)}catch(
|
|
74
|
-
`);await
|
|
72
|
+
})(${JSON.stringify(t)})
|
|
73
|
+
`)}catch(l){const o=l instanceof Error?l.message:String(l);if(o.includes("ECONNRESET")||o.includes("fetch failed")){process.stderr.write(` [retry] bridge reconnecting after page re-render (${a+1}/${r})...
|
|
74
|
+
`);await e.wait({time:i/1000});continue}throw l}if(s?.failed)throw new c("视频上传失败,请检查文件格式和网络连接");if(s?.done)return;await e.wait({time:i/1000})}throw new c(`视频上传/转码超时(${Math.ceil(n/1000)}秒),请检查网络或稍后重试`)}async function q(e,t,n,i){const r=30;let a;for(let s=0;s<r;s++){a=await u(e,`
|
|
75
75
|
(function(selectors, text) {
|
|
76
|
-
${
|
|
76
|
+
${d}
|
|
77
77
|
|
|
78
78
|
var el = null;
|
|
79
79
|
var foundSel = null;
|
|
@@ -117,10 +117,10 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
117
117
|
var actual = el.isContentEditable ? (el.innerText || el.textContent || '') : (el.value || '');
|
|
118
118
|
el.blur();
|
|
119
119
|
return { ok: actual.indexOf(text) >= 0, sel: foundSel, actual: actual };
|
|
120
|
-
})(${JSON.stringify(
|
|
121
|
-
`);if(
|
|
120
|
+
})(${JSON.stringify(t)}, ${JSON.stringify(n)})
|
|
121
|
+
`);if(a?.ok)break;if(s<r-1)await e.wait({time:0.5})}if(!a?.ok){await e.screenshot({path:`/tmp/wechat-channels_publish_${i}_debug.png`});throw new c(`找不到 ${i} 输入框,截图已保存到 /tmp/wechat-channels_publish_${i}_debug.png`)}}async function K(e,t){const n=t.getFullYear(),i=t.getMonth()+1,r=t.getDate(),a=t.getHours(),s=t.getMinutes(),l=(m)=>String(m).padStart(2,"0"),o=await u(e,`
|
|
122
122
|
(async function(TY, TM, TD, TH, TMin) {
|
|
123
|
-
${
|
|
123
|
+
${d}
|
|
124
124
|
function sleep(ms) { return new Promise(function(r) { setTimeout(r, ms); }); }
|
|
125
125
|
function click(el) {
|
|
126
126
|
el.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true, view: window }));
|
|
@@ -218,11 +218,11 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
218
218
|
// 6. Read back the display input to confirm the value landed.
|
|
219
219
|
var inp = deepQuery('input[placeholder*="发表时间"]');
|
|
220
220
|
return { ok: true, value: inp ? inp.value : null };
|
|
221
|
-
})(${
|
|
222
|
-
`);if(!
|
|
223
|
-
`)}async function
|
|
221
|
+
})(${n}, ${i}, ${r}, ${a}, ${s})
|
|
222
|
+
`);if(!o?.ok){await e.screenshot({path:"/tmp/wechat-channels_schedule_debug.png"});const m=o?.reason?String(o.reason):"empty picker result";throw new c(`定时设置失败 (${m}),截图: /tmp/wechat-channels_schedule_debug.png`)}const f=`${n}-${l(i)}-${l(r)} ${l(a)}:${l(s)}`;if(!String(o.value||"").includes(f))throw new c(`定时设置未验证成功: expected=${f} actual=${o.value||""}`);process.stderr.write(` 定时设置完成: ${o.value||f}
|
|
223
|
+
`)}async function z(e,t){const n=t?["存草稿","保存草稿","草稿"]:["发表","发布"],i=30;let r;for(let a=0;a<i;a++){r=await u(e,`
|
|
224
224
|
(function(labels) {
|
|
225
|
-
${
|
|
225
|
+
${d}
|
|
226
226
|
var btns = deepQueryAll('button');
|
|
227
227
|
for (var i = 0; i < btns.length; i++) {
|
|
228
228
|
var btn = btns[i];
|
|
@@ -239,22 +239,22 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
return { ok: false };
|
|
242
|
-
})(${JSON.stringify(
|
|
243
|
-
`);if(
|
|
242
|
+
})(${JSON.stringify(n)})
|
|
243
|
+
`);if(r?.ok)break;if(a<i-1)await e.wait({time:0.5})}if(!r?.ok){await e.screenshot({path:"/tmp/wechat-channels_publish_submit_debug.png"});throw new c(`找不到"${n[0]}"按钮(按钮可能被禁用或表单未完成),`+"截图已保存到 /tmp/wechat-channels_publish_submit_debug.png")}return r}j({site:"wechat-channels",name:"publish",access:"write",description:"发布视频到视频号",domain:"channels.weixin.qq.com",strategy:R.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"video",required:!0,positional:!0,help:"视频文件路径 (.mp4/.mov/.avi/.webm)"},{name:"title",required:!1,help:"短标题(建议 6-16 字)"},{name:"caption",fromFile:!0,required:!1,help:"描述内容,支持直接写 #话题(如:日常生活 #搞笑 #生活)"},{name:"schedule",required:!1,help:'定时发布时间(ISO8601 或 Unix 秒,如 "2026-05-20 10:00")'},{name:"draft",type:"bool",default:!1,help:"保存为草稿"},{name:"manual",type:"bool",default:!1,help:"填完所有字段后不自动发布,由用户手动点击发表(务必同时传 --site-session persistent,否则表单页约 30 秒后会被重置为空白页)"},{name:"timeout",type:"int",required:!1,default:600,help:"命令整体超时秒数(含登录等待 + 上传转码,默认 600)"}],columns:["status","title","detail"],func:async(e,t)=>{if(!e)throw new c("需要浏览器页面");const n=E(t.timeout),i=Date.now()+n*1000,r=T(t.video,"视频",H),a=String(t.title??"").trim(),s=String(t.caption??"").trim(),l=D(t.schedule||null),o=g(t.draft),f=g(t.manual);await e.goto(_);await e.wait({time:4});{const h=(v)=>typeof v==="string"&&v.includes("/platform/post/create"),S=await u(e,"() => location.href");if(!h(S)){process.stderr.write(`
|
|
244
244
|
⚠️ 未登录视频号(已被重定向离开发布页)。请在 Chrome 中扫码登录...
|
|
245
|
-
`+" 当前地址: "+
|
|
245
|
+
`+" 当前地址: "+S+`
|
|
246
246
|
`+` 登录完成后将自动继续发布。
|
|
247
247
|
|
|
248
|
-
`);const
|
|
249
|
-
`)}if(!
|
|
248
|
+
`);const v=Math.min(i,Date.now()+120000);let x=!1;while(Date.now()<v){await e.wait({time:3});await e.goto(_);await e.wait({time:2});const N=await u(e,"() => location.href");if(h(N)){x=!0;break}process.stderr.write(` 等待扫码中...
|
|
249
|
+
`)}if(!x)throw new F("channels.weixin.qq.com","登录超时(2分钟),请手动登录后重试");process.stderr.write(`✅ 登录成功,继续发布...
|
|
250
250
|
|
|
251
|
-
`);await
|
|
251
|
+
`);await e.wait({time:3});await e.goto(_);await e.wait({time:5})}}await G(e,r);await e.wait({time:2});await X(e,k.basename(r),Math.min(180000,J(i,"视频上传/转码")));await e.wait({time:1});if(a){await q(e,P,a,"title");await e.wait({time:0.5})}if(s){await q(e,L,s,"caption");await e.wait({time:0.5})}if(l){await K(e,l);await e.wait({time:0.5})}if(f){process.stderr.write(`
|
|
252
252
|
ℹ️ 手动模式:表单已填好,请在浏览器中检查并点击「发表」。
|
|
253
253
|
`+` 若未加 --site-session persistent,此标签页约 30 秒后会被重置为空白页。
|
|
254
254
|
|
|
255
|
-
`);return[{status:"⏸️ 已填写完毕,请在浏览器中手动点击发表",title:
|
|
255
|
+
`);return[{status:"⏸️ 已填写完毕,请在浏览器中手动点击发表",title:a||"",detail:[l?`定时: ${l}`:null].filter(Boolean).join(" · ")||"表单已就绪"}]}await z(e,o);await e.wait({time:4});const m=o?["草稿已保存","暂存成功","保存成功"]:["已发表","发布成功","发表成功","审核中"];let w="",b="",y=!1;for(let h=0;h<30;h++){w=await u(e,"() => location.href");b=await u(e,`
|
|
256
256
|
(function(markers) {
|
|
257
|
-
${
|
|
257
|
+
${d}
|
|
258
258
|
var all = deepQueryAll('*');
|
|
259
259
|
for (var i = 0; i < all.length; i++) {
|
|
260
260
|
var el = all[i];
|
|
@@ -266,5 +266,5 @@ import*as f from"node:fs";import*as T from"node:path";import{cli as x,Strategy a
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
return '';
|
|
269
|
-
})(${JSON.stringify(
|
|
270
|
-
`);
|
|
269
|
+
})(${JSON.stringify(m)})
|
|
270
|
+
`);y=O({isDraft:o,finalUrl:w,successMsg:b});if(y)break;await e.wait({time:0.5})}if(!y){await e.screenshot({path:"/tmp/wechat-channels_publish_result_debug.png"});throw new c(`未能验证${o?"草稿保存":"发布"}成功,截图已保存到 /tmp/wechat-channels_publish_result_debug.png`,`url=${w||""} message=${b||""}`)}const M=o?"草稿已保存":"发布成功",C=[l?`定时: ${l.toISOString()}`:null,b||w].filter(Boolean),A=[{status:`✅ ${M}`,title:a||"",detail:C.join(" · ")||w}];await e.goto("https://channels.weixin.qq.com/platform/post/list",{waitUntil:"none"}).catch(()=>{});return A}});
|
package/clis/weibo/article.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as f,CommandExecutionError as x}from"@jackwener/opencli/errors";import{cli as S,Strategy as v}from"@jackwener/opencli/registry";import{publishArticle as T}from"../_shared/article/publish.js";import{readFile as P,stat as O}from"node:fs/promises";function U(t){if(!t.execute)throw new f("INVALID_INPUT","微博头条文章写操作需要 --execute 确认,避免误发。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function A(t){const c=typeof t.text==="string"?t.text:void 0,r=typeof t.file==="string"?t.file:void 0;if(c&&r)throw new f("INVALID_INPUT","请只提供 <text> 或 --file 中的一种,不能同时使用。");let i=c??"";if(r){let e;try{e=await O(r)}catch{throw new f("INVALID_INPUT",`文件不存在:${r}`)}if(!e.isFile())throw new f("INVALID_INPUT",`路径不是可读文本文件:${r}`);let u;try{u=await P(r)}catch{throw new f("INVALID_INPUT",`文件无法读取:${r}`)}try{i=new TextDecoder("utf-8",{fatal:!0}).decode(u)}catch{throw new f("INVALID_INPUT",`文件无法解码为 UTF-8:${r}`)}}if(!i.trim())throw new f("INVALID_INPUT","正文不能为空。");return i}function L(t,c,r,i,e={}){return[{status:"success",outcome:i,message:t,target_type:c,target:r,...e}]}export const weiboProfile={home:"https://card.weibo.com/article/v5/editor",outputFormat:"html",preprocessConfig:{compactHtml:!0},image:{skip:["sinaimg.cn","weibo.com"],uploadFn:async(t,c)=>{async function r(){let a=document.documentElement.innerHTML||"",n=a.match(/config:\s*JSON\.parse\('(.+?)'\)/);if(!n){a=await(await fetch("https://card.weibo.com/article/v5/editor",{credentials:"include"})).text();n=a.match(/config:\s*JSON\.parse\('(.+?)'\)/)}if(!n)return"";try{const o=JSON.parse(n[1].replace(/\\'/g,"'").replace(/\\\\/g,"\\"));return o.uid?String(o.uid):""}catch(o){return""}}function i(a){const n=btoa(a+"&"+Date.now()).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";let s=n;while(s.length<43)s+=o.charAt(Math.floor(Math.random()*o.length));return s.slice(0,43)}const e=await r();if(!e)throw Error("未取到微博 uid,请先登录微博");if(t.indexOf("data:")===0){const a=c.dataUriToBlob(t),o="https://picupload.weibo.com/interface/pic_upload.php?app=miniblog&s=json&p=1&data=1&url=&markpos=1&logo=0&nick=&file_source=4&_rid="+i(e),l=await(await fetch(o,{method:"POST",credentials:"include",body:a})).json(),d=l&&l.data&&l.data.pics&&l.data.pics.pic_1&&l.data.pics.pic_1.pid;if(!d)throw Error("图片直传失败:"+JSON.stringify(l).slice(0,200));return{url:"https://wx3.sinaimg.cn/large/"+d+".jpg"}}const u=i(e);try{await fetch("https://card.weibo.com/article/v5/aj/editor/plugins/asyncuploadimg?uid="+e+"&_rid="+u,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json, text/plain, */*","SN-REQID":u},body:new URLSearchParams({"urls[0]":t})})}catch(a){}for(let a=0;a<30;a++){const n=i(e),s=await(await fetch("https://card.weibo.com/article/v5/aj/editor/plugins/asyncimginfo?uid="+e+"&_rid="+n,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json, text/plain, */*","SN-REQID":n},body:new URLSearchParams({"urls[0]":t})})).json(),l=s&&s.data&&s.data[0],d=l&&l.task_status_code;if(d===1&&l.pid)return{url:"https://wx3.sinaimg.cn/large/"+l.pid+".jpg"};if(d===2)throw Error("微博图片转存失败:"+t);await new Promise((g)=>setTimeout(g,1000))}throw Error("微博图片转存超时:"+t)}},checkAuth:async(t)=>{const i=(await(await fetch("https://card.weibo.com/article/v5/editor",{credentials:"include"})).text()).match(/config:\s*JSON\.parse\('(.+?)'\)/);if(!i)return{isAuthenticated:!1};let e=null;try{e=JSON.parse(i[1].replace(/\\'/g,"'").replace(/\\\\/g,"\\"))}catch(u){return{isAuthenticated:!1,error:"编辑器 config 解析失败"}}if(!e||!e.uid)return{isAuthenticated:!1};return{isAuthenticated:!0,userId:String(e.uid),username:e.nick||"",avatar:e.avatar_large||""}},publish:async(t,c)=>{async function r(){let m=document.documentElement.innerHTML||"",p=m.match(/config:\s*JSON\.parse\('(.+?)'\)/);if(!p){m=await(await fetch("https://card.weibo.com/article/v5/editor",{credentials:"include"})).text();p=m.match(/config:\s*JSON\.parse\('(.+?)'\)/)}if(!p)return"";try{const h=JSON.parse(p[1].replace(/\\'/g,"'").replace(/\\\\/g,"\\"));return h.uid?String(h.uid):""}catch(h){return""}}function i(m){const p=btoa(m+"&"+Date.now()).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";let w=p;while(w.length<43)w+=h.charAt(Math.floor(Math.random()*h.length));return w.slice(0,43)}const e=await r();if(!e)return{ok:!1,stage:"auth",message:"未取到微博 uid,请先登录微博"};let u=(t.content||"").replace(/>\s+</g,"><");const a=document.createElement("div");a.innerHTML=u;const n=a.querySelectorAll("img");for(let m=0;m<n.length;m++){const p=n[m],h=(p.getAttribute("src")||"").match(/sinaimg\.cn\/large\/([^/."]+)\.jpg/);if(!h)continue;p.setAttribute("data-pid",h[1]);if(!p.closest("figure")){const w=document.createElement("figure");w.className="image";p.parentNode.insertBefore(w,p);w.appendChild(p)}}u=a.innerHTML;const o=i(e),s=await fetch("https://card.weibo.com/article/v5/aj/editor/draft/create?uid="+e+"&_rid="+o,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json, text/plain, */*","SN-REQID":o},body:new URLSearchParams({})}),l=await s.text();let d=null;try{d=JSON.parse(l)}catch(m){}if(!s.ok||!d||d.code!==1e5||!d.data||!d.data.id)return{ok:!1,stage:"create",status:s.status,message:d&&d.msg||"创建草稿失败:"+l.slice(0,200)};const g=String(d.data.id),N=t.params&&typeof t.params.cover==="string"?t.params.cover:"",_=i(e),b=await fetch("https://card.weibo.com/article/v5/aj/editor/draft/save?uid="+e+"&id="+g+"&_rid="+_,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json, text/plain, */*","SN-REQID":_},body:new URLSearchParams({id:g,title:t.title,subtitle:"",type:"",status:"0",publish_at:"",error_msg:"",error_code:"0",collection:"[]",free_content:"",content:u,cover:N,summary:"",writer:"",extra:"null",is_word:"0",article_recommend:"[]",follow_to_read:"1",isreward:"1",pay_setting:'{"ispay":0,"isvclub":0}',source:"0",action:"1",content_type:"0",save:"1"})}),I=await b.text();let y=null;try{y=JSON.parse(I)}catch(m){}if(!b.ok||!y||String(y.code)!=="100000")return{ok:!1,stage:"save",status:b.status,message:y&&y.msg||"保存草稿失败:"+I.slice(0,200)};return{ok:!0,id:g,url:"https://card.weibo.com/article/v5/editor#/draft/"+g,draft:!0}}};S({site:"weibo",name:"article",access:"write",description:"把长文以微博头条文章形式保存到草稿箱(card.weibo.com)。正文默认 Markdown,外链/本机图片自动转存到微博图床,支持 --cover 题图。注意:平台接口只到草稿态,正式发布需在微博头条文章编辑器里手动操作。",domain:"weibo.com",strategy:v.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(默认 Markdown;加 --html 则当 HTML 处理)"},{name:"file",help:"正文文件路径(UTF-8,默认 Markdown)"},{name:"html",type:"boolean",help:"把正文当 HTML 处理而不是 Markdown"},{name:"cover",help:"题图(本机图片路径或图片 URL,自动转存到微博图床)"},{name:"draft",type:"boolean",help:"仅保存草稿(微博头条文章目前只支持草稿,此参数保留兼容性)"},{name:"execute",type:"boolean",help:"实际执行写入。不加此参数时命令拒绝写入。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(t,c)=>{if(!t)throw new x("微博头条文章命令需要浏览器会话。");U(c);const r=String(c.title??"").trim();if(!r)throw new f("INVALID_INPUT","文章标题不能为空。");const i=await A(c),e=typeof c.cover==="string"&&c.cover.trim()?c.cover.trim():"",u=!0,a=await T(t,{title:r,body:i,format:c.html?"html":"markdown",draftOnly:u,profile:weiboProfile,publishParams:e?{cover:e}:null}),n=a.images.uploaded.length|0,o=a.images.failed.length|0;let s="已保存微博头条文章草稿(正式发布请在编辑器里手动操作)";if(n||o)s+="·图片:"+n+" 张已转存"+(o?","+o+" 张失败":"");return L(s,"article","","draft",{created_target:"draft:"+a.id,created_url:a.url})}});
|
package/clis/weibo/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as r,CommandExecutionError as n}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as c}from"../_shared/site-auth.js";import{getSelfUid as d}from"./utils.js";const l="_2AkM";async function s(i){const o=await i.getCookies({url:"https://weibo.com"}),e=o.find((t)=>t.name==="SUB"&&t.value),u=o.some((t)=>t.name==="SUBP"&&t.value);return Boolean(e&&u&&!e.value.startsWith(l))}async function a(i){if(!await s(i))throw new r("weibo.com","微博登录态 cookie 缺失(或仅为访客态 SUB)");await i.goto("https://weibo.com/");await i.wait(3);const o=await d(i),e=await i.evaluate(`(async () => {
|
|
2
2
|
try {
|
|
3
|
-
const res = await fetch('/ajax/profile/info?uid=' + ${JSON.stringify(
|
|
3
|
+
const res = await fetch('/ajax/profile/info?uid=' + ${JSON.stringify(o)}, { credentials: 'include', headers: { 'Accept': 'application/json' } });
|
|
4
4
|
if (res.status === 401 || res.status === 403) {
|
|
5
5
|
return { kind: 'auth', detail: 'Weibo /ajax/profile/info HTTP ' + res.status };
|
|
6
6
|
}
|
|
@@ -14,4 +14,4 @@ import{AuthRequiredError as K,CommandExecutionError as L}from"@jackwener/opencli
|
|
|
14
14
|
} catch (e) {
|
|
15
15
|
return { kind: 'exception', detail: String(e && e.message || e) };
|
|
16
16
|
}
|
|
17
|
-
})()`);if(
|
|
17
|
+
})()`);if(e?.kind==="auth")throw new r("weibo.com",e.detail);if(e?.kind==="http")throw new n(`HTTP ${e.httpStatus} from /ajax/profile/info`);if(e?.kind==="exception")throw new n(`Weibo whoami failed: ${e.detail}`);if(!e?.ok)throw new n(`Unexpected Weibo probe: ${JSON.stringify(e)}`);return{user_id:e.user_id,screen_name:e.screen_name,profile_url:e.profile_url}}c({site:"weibo",domain:"weibo.com",loginUrl:"https://weibo.com/login",columns:["user_id","screen_name","profile_url"],quickCheck:s,verify:a,poll:async(i)=>{if(!await s(i))throw new r("weibo.com","等待微博登录态 cookie(访客态 SUB 不算)");return a(i)}});
|
package/clis/weibo/comments.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as i,Strategy as n}from"@jackwener/opencli/registry";import{requireArrayEvaluateResult as
|
|
1
|
+
import{cli as i,Strategy as n}from"@jackwener/opencli/registry";import{requireArrayEvaluateResult as s,unwrapEvaluateResult as o}from"./utils.js";i({site:"weibo",name:"comments",access:"read",description:"Get comments on a Weibo post",domain:"weibo.com",strategy:n.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Post ID (numeric idstr)"},{name:"limit",type:"int",default:20,help:"Number of comments (max 50)"}],columns:["rank","author","text","likes","replies","time"],func:async(t,e)=>{const r=Math.min(e.limit||20,50);await t.goto("https://weibo.com");await t.wait(2);const a=String(e.id);return s(o(await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const id = ${JSON.stringify(a)};
|
|
4
4
|
const count = ${r};
|
package/clis/weibo/delete.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as a,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as i,AuthRequiredError as
|
|
1
|
+
import{cli as a,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as i,AuthRequiredError as f,CommandExecutionError as n,EmptyResultError as l}from"@jackwener/opencli/errors";import{requireObjectEvaluateResult as m,unwrapEvaluateResult as p}from"./utils.js";const c=/(^|\.)weibo\.(com|cn)$/i,y=/^[A-Za-z0-9]{4,32}$/;function d(r){const s=String(r??"").trim();if(!s)throw new i("weibo delete: id cannot be empty");let o=s;try{const t=new URL(s);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new i("weibo delete: URL must use http or https");if(!c.test(t.hostname))throw new i("weibo delete: URL must be a weibo.com or weibo.cn post URL");const e=t.pathname.split("/").filter(Boolean);if(t.hostname.toLowerCase().endsWith("weibo.cn")&&e[0]==="status")o=e[1]??"";else o=e.at(-1)??""}catch(t){if(t instanceof i)throw t}o=String(o??"").trim();if(!y.test(o))throw new i("weibo delete: id must be a numeric idstr, mblogid, or Weibo post URL");return o}a({site:"weibo",name:"delete",access:"write",description:"Delete one of my Weibo posts by id",domain:"weibo.com",strategy:u.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Post ID (numeric idstr or mblogid from URL / weibo me / weibo post output)"}],columns:["status","id","mblogid"],func:async(r,s)=>{if(!r)throw new n("Browser session required for weibo delete");const o=String(s.id??"").trim(),t=d(o);await r.goto("https://weibo.com");await r.wait(2);const e=m(p(await r.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const input = ${JSON.stringify(t)};
|
|
4
4
|
const readCookie = (name) => {
|
|
@@ -81,4 +81,4 @@ import{cli as a,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
81
81
|
}
|
|
82
82
|
return { ok: false, error: 'verify_mismatch', msg: 'verify returned a different post id', id: idstr };
|
|
83
83
|
})()
|
|
84
|
-
`)),"weibo delete");if(e.error==="auth")throw new
|
|
84
|
+
`)),"weibo delete");if(e.error==="auth")throw new f("weibo.com","Cookie 已过期!请在当前 Chrome 浏览器中重新登录 Weibo。");if(e.error==="not_found")throw new l("weibo delete",`Post not found for id "${String(e.input??o)}". Verify the post still exists and belongs to the logged-in account.`);if(e.error==="show_http"||e.error==="destroy_http"||e.error==="verify_http")throw new n(`weibo delete: HTTP ${e.status}`);if(e.error==="api"||e.error==="verify_malformed"||e.error==="verify_mismatch"||e.error==="still_exists")throw new n(`weibo delete: ${String(e.msg??e.error)}`);if(!e.ok)throw new n("weibo delete returned an unexpected response");return[{status:"deleted",id:String(e.id??""),mblogid:String(e.mblogid??"")}]}});export const __test__={normalizePostId:d};
|
package/clis/weibo/feed.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{cli as n,Strategy as a}from"@jackwener/opencli/registry";import{getSelfUid as
|
|
1
|
+
import{cli as n,Strategy as a}from"@jackwener/opencli/registry";import{getSelfUid as c,requireArrayEvaluateResult as l,unwrapEvaluateResult as u}from"./utils.js";const d={"for-you":"unreadfriendstimeline",following:"friendstimeline"};n({site:"weibo",name:"feed",access:"read",description:"Fetch Weibo timeline (for-you or following)",domain:"weibo.com",strategy:a.COOKIE,args:[{name:"type",default:"for-you",choices:["for-you","following"],help:"Timeline type: for-you (algorithmic) or following (chronological)"},{name:"limit",type:"int",default:15,help:"Number of posts (max 50)"}],columns:["id","author","text","reposts","comments","likes","time","url"],func:async(t,e)=>{const s=Math.min(e.limit||15,50),o=e.type==="following"?"following":"for-you",i=d[o];await t.goto("https://weibo.com");await t.wait(2);const r=await c(t);return l(u(await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const uid = ${JSON.stringify(r)};
|
|
4
|
-
const count = ${
|
|
5
|
-
const endpoint = ${JSON.stringify(
|
|
4
|
+
const count = ${s};
|
|
5
|
+
const endpoint = ${JSON.stringify(i)};
|
|
6
6
|
const listId = '10001' + uid;
|
|
7
7
|
const strip = (html) => (html || '').replace(/<[^>]+>/g, '').replace(/ /g, ' ').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&').trim();
|
|
8
8
|
|
package/clis/weibo/hot.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as r,Strategy as o}from"@jackwener/opencli/registry";import{requireArrayEvaluateResult as i,unwrapEvaluateResult as s}from"./utils.js";r({site:"weibo",name:"hot",access:"read",description:"微博热搜",domain:"weibo.com",strategy:o.COOKIE,args:[{name:"limit",type:"int",default:30,help:"Number of items (max 50)"}],columns:["rank","word","hot_value","category","label","url"],func:async(t,e)=>{const a=Math.min(e.limit||30,50);await t.goto("https://weibo.com");return i(s(await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const resp = await fetch('/ajax/statuses/hot_band', {credentials: 'include'});
|
|
4
4
|
if (!resp.ok) return {error: 'HTTP ' + resp.status};
|