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/weibo/publish.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as _ from"node:fs";import*as p from"node:path";import{cli as E,Strategy as y}from"@jackwener/opencli/registry";import{ArgumentError as m,AuthRequiredError as M,CommandExecutionError as n}from"@jackwener/opencli/errors";import{getSelfUid as T}from"./utils.js";import{setInputFiles as P}from"../_shared/file-inject.js";const w=9,g=1500,C=30000,l=300,b=1e4,x=500,O=20000,A=new Set([".jpg",".jpeg",".png",".gif",".webp"]),S=['textarea[placeholder*="有什么新鲜事"]','textarea[placeholder*="新鲜事"]',"textarea._input_13iqr_8"],I='input[type="file"][class*="_file_"]';function k(t){const o=String(t??"").trim();if(!o)throw new m("weibo publish text cannot be empty");if(o.length>2000)throw new m("weibo publish text exceeds 2000 characters");return o}function v(t){if(!t)return[];const o=t.split(",").map((a)=>a.trim()).filter(Boolean);if(o.length>w)throw new m(`Too many images: ${o.length} (max ${w})`);return o.map((a)=>{const s=p.resolve(a),r=p.extname(s).toLowerCase();if(!A.has(r))throw new m(`Unsupported image format "${r}". Supported: jpg, png, gif, webp`);const c=_.statSync(s,{throwIfNoEntry:!1});if(!c||!c.isFile())throw new m(`Not a valid file: ${s}`);return s})}E({site:"weibo",name:"publish",access:"write",description:"Publish a new Weibo post immediately",domain:"weibo.com",strategy:y.UI,browser:!0,args:[{name:"text",type:"string",required:!0,positional:!0,help:"Weibo text content (max 2000 chars)"},{name:"images",type:"string",required:!1,help:`Image paths, comma-separated, max ${w} (jpg/png/gif/webp)`}],columns:["status","message","text"],func:async(t,o)=>{if(!t)throw new n("Browser session required for weibo publish");const a=k(o.text),s=v(o.images);await t.goto("https://weibo.com",{waitUntil:"load",settleMs:2000});await t.wait({time:2});try{await T(t)}catch(e){if(e instanceof M)throw e;throw new n("Not logged into Weibo. Please login at weibo.com in your Chrome browser.")}let r=null;for(let e=0;e<Math.ceil(b/l);e++){r=await t.evaluate(`
|
|
2
2
|
() => {
|
|
3
3
|
const visible = el => !!el && el.offsetParent !== null && !el.disabled;
|
|
4
4
|
const buttons = document.querySelectorAll('button[title="发微博"], button[title="写微博"]');
|
|
@@ -10,7 +10,7 @@ import*as U from"node:fs";import*as j from"node:path";import{cli as f,Strategy a
|
|
|
10
10
|
}
|
|
11
11
|
return { ok: false, message: 'Could not find 发微博 button' };
|
|
12
12
|
}
|
|
13
|
-
`);if(
|
|
13
|
+
`);if(r?.ok)break;await t.wait({time:l/1000})}if(!r?.ok)throw new n(r?.message??"Could not open compose editor.");let c=!1;for(let e=0;e<Math.ceil(b/l);e++){const i=await t.evaluate(`
|
|
14
14
|
(selectors => {
|
|
15
15
|
// Pick the LAST visible match across all selectors so
|
|
16
16
|
// the modal (rendered on top of the home-feed strip)
|
|
@@ -23,13 +23,13 @@ import*as U from"node:fs";import*as j from"node:path";import{cli as f,Strategy a
|
|
|
23
23
|
}
|
|
24
24
|
if (!last) return { found: false };
|
|
25
25
|
return { found: true, visible: true, rectTop: last.getBoundingClientRect().top };
|
|
26
|
-
})(${JSON.stringify(
|
|
27
|
-
`);if(
|
|
26
|
+
})(${JSON.stringify(S)})
|
|
27
|
+
`);if(i?.found&&i.visible&&i.rectTop>=0){c=!0;break}await t.wait({time:l/1000})}if(!c)throw new n("Weibo compose editor did not appear");if(s.length>0){let e=!1;for(let f=0;f<Math.ceil(b/l);f++){e=await t.evaluate(`
|
|
28
28
|
() => {
|
|
29
29
|
const input = document.querySelector('input[type="file"][class*="_file_"]');
|
|
30
30
|
return !!input;
|
|
31
31
|
}
|
|
32
|
-
`);if(
|
|
32
|
+
`);if(e)break;await t.wait({time:l/1000})}if(!e)throw new n("Could not find image file input on Weibo compose page. UI may have changed.");await P(t,I,s);let i=null;for(let f=0;f<Math.ceil(C/g);f++){await t.wait({time:g/1000});i=await t.evaluateWithArgs(`
|
|
33
33
|
(() => {
|
|
34
34
|
const expectedCount = expected;
|
|
35
35
|
const uploading = document.querySelector('[class*="upload"], [class*="progress"]');
|
|
@@ -38,7 +38,7 @@ import*as U from"node:fs";import*as j from"node:path";import{cli as f,Strategy a
|
|
|
38
38
|
if (pics.length >= expectedCount) return { ok: true, count: pics.length };
|
|
39
39
|
return null;
|
|
40
40
|
})()
|
|
41
|
-
`,{expected:
|
|
41
|
+
`,{expected:s.length});if(i!==null)break}if(!i?.ok)throw new n(i?.message??"Image upload did not complete before timeout")}const h=await t.evaluateWithArgs(`
|
|
42
42
|
((selectors) => {
|
|
43
43
|
let ta = null;
|
|
44
44
|
for (const sel of selectors) {
|
|
@@ -57,8 +57,8 @@ import*as U from"node:fs";import*as j from"node:path";import{cli as f,Strategy a
|
|
|
57
57
|
ta.dispatchEvent(new Event('input', { bubbles: true }));
|
|
58
58
|
ta.dispatchEvent(new Event('change', { bubbles: true }));
|
|
59
59
|
return { ok: true, valueLength: ta.value.length };
|
|
60
|
-
})(${JSON.stringify(
|
|
61
|
-
`,{textContent:
|
|
60
|
+
})(${JSON.stringify(S)})
|
|
61
|
+
`,{textContent:a});if(!h?.ok)throw new n(h?.message??"Could not insert text.");await t.wait({time:0.5});let d=null;for(let e=0;e<Math.ceil(b/l);e++){d=await t.evaluate(`
|
|
62
62
|
() => {
|
|
63
63
|
const visible = el => !!el && el.offsetParent !== null && !el.disabled;
|
|
64
64
|
const labels = ['发送', '发布'];
|
|
@@ -74,7 +74,7 @@ import*as U from"node:fs";import*as j from"node:path";import{cli as f,Strategy a
|
|
|
74
74
|
}
|
|
75
75
|
return { ok: false, message: 'Could not find send button' };
|
|
76
76
|
}
|
|
77
|
-
`);if(
|
|
77
|
+
`);if(d?.ok)break;await t.wait({time:l/1000})}if(!d?.ok)throw new n(d?.message??"Could not click publish.");let u=null;for(let e=0;e<Math.ceil(O/x);e++){await t.wait({time:x/1000});u=await t.evaluate(`
|
|
78
78
|
(() => {
|
|
79
79
|
const successMarkers = ['发布成功', '已发布', '发送成功'];
|
|
80
80
|
const errorMarkers = ['发布失败', '发送失败', '内容违规', '请稍后再试', '频繁'];
|
|
@@ -95,4 +95,4 @@ import*as U from"node:fs";import*as j from"node:path";import{cli as f,Strategy a
|
|
|
95
95
|
}
|
|
96
96
|
return null;
|
|
97
97
|
})()
|
|
98
|
-
`);if(
|
|
98
|
+
`);if(u!==null)break}if(!u)throw new n("Publish button clicked but result was unclear. Check Weibo manually.");if(!u.ok)throw new n(u.message||"Weibo publish failed");return[{status:"success",message:u.message||"Published successfully",text:a}]}});export const __test__={validateText:k,validateImagePaths:v};
|
package/clis/weibo/search.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as c}from"@jackwener/opencli/registry";import{CliError as s}from"@jackwener/opencli/errors";import{requireArrayEvaluateResult as u,unwrapEvaluateResult as h}from"./utils.js";l({site:"weibo",name:"search",access:"read",description:"搜索微博",domain:"weibo.com",browser:!0,strategy:c.COOKIE,args:[{name:"keyword",required:!0,positional:!0,help:"Search keyword"},{name:"limit",type:"int",default:10,help:"Number of results (max 50)"}],columns:["rank","id","title","author","time","url"],func:async(t,e)=>{const o=Math.max(1,Math.min(Number(e.limit)||10,50)),a=encodeURIComponent(String(e.keyword??"").trim());await t.goto(`https://s.weibo.com/weibo?q=${a}`);await t.wait(2);const r=u(h(await t.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
const clean = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
4
4
|
const absoluteUrl = (href) => {
|
|
@@ -44,4 +44,4 @@ import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{CliError
|
|
|
44
44
|
|
|
45
45
|
return rows;
|
|
46
46
|
})()
|
|
47
|
-
`)),"weibo search");if(r.length===0)throw new s("NOT_FOUND","No Weibo search results found","Try a different keyword or ensure you are logged into weibo.com");return r.slice(0,o).map((i
|
|
47
|
+
`)),"weibo search");if(r.length===0)throw new s("NOT_FOUND","No Weibo search results found","Try a different keyword or ensure you are logged into weibo.com");return r.slice(0,o).map((n,i)=>({rank:i+1,...n}))}});
|
package/clis/weibo/user-posts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as x,Strategy as D}from"@jackwener/opencli/registry";import{ArgumentError as a,AuthRequiredError as q,CommandExecutionError as u,EmptyResultError as v}from"@jackwener/opencli/errors";import{unwrapEvaluateResult as E}from"./utils.js";const m=100,w=20,R=/^\d{4}-\d{2}-\d{2}$/;function h(e){const t=String(e??"").trim();if(!t)throw new a("weibo user-posts id cannot be empty");return t}function b(e){const t=e===void 0||e===null||e===""?w:Number(e);if(!Number.isInteger(t)||t<1||t>m)throw new a(`weibo user-posts limit must be an integer between 1 and ${m}`);return t}function p(e,t){if(e===void 0||e===null||e==="")return null;const r=String(e).trim();if(!R.test(r))throw new a(`weibo user-posts ${t} must use YYYY-MM-DD`);const n=new Date(`${r}T00:00:00+08:00`);if(!Number.isFinite(n.getTime())||r!==Y(n))throw new a(`weibo user-posts ${t} must be a valid calendar date`);return r}function Y(e){const t=new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Shanghai",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=(n)=>t.find((o)=>o.type===n)?.value;return`${r("year")}-${r("month")}-${r("day")}`}function d(e){return Math.floor(new Date(`${e}T00:00:00+08:00`).getTime()/1000)}function M(e,t){if(e&&t&&d(e)>d(t))throw new a("weibo user-posts start must be <= end")}function k(e){const t=String(e??"").trim();if(!t)throw new u("weibo user-posts failed without an error message");if(/login|cookie|登录|auth|forbidden|permission|权限|unauthorized/i.test(t))throw new q("weibo.com",t);throw new u(t)}export const testInternals={readRequiredId:h,readLimit:b,readDate:p,dateToTimestamp:d};x({site:"weibo",name:"user-posts",access:"read",description:"List Weibo posts from a user, optionally filtered by date range",domain:"weibo.com",strategy:D.COOKIE,args:[{name:"id",positional:!0,required:!0,help:"User ID (numeric uid) or screen name"},{name:"start",help:"Start date in Asia/Shanghai (YYYY-MM-DD)"},{name:"end",help:"End date in Asia/Shanghai (YYYY-MM-DD)"},{name:"limit",type:"int",default:w,help:`Number of posts (1-${m})`},{name:"include-retweets",type:"boolean",default:!1,help:"Include retweets"}],columns:["rank","id","mblogid","author","uid","text","time","reposts","comments","likes","pic_count","url"],func:async(e,t)=>{const r=h(t.id),n=b(t.limit),o=p(t.start,"start"),c=p(t.end,"end");M(o,c);const y=Boolean(t["include-retweets"]),f=o?d(o):null,g=c?d(c)+86400-1:null;await e.goto("https://weibo.com");await e.wait(2);const I=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const rawId = ${JSON.stringify(r)};
|
|
4
|
-
const limit = ${
|
|
4
|
+
const limit = ${n};
|
|
5
5
|
const includeRetweets = ${y};
|
|
6
6
|
const starttime = ${f===null?"null":f};
|
|
7
7
|
const endtime = ${g===null?"null":g};
|
|
@@ -89,4 +89,4 @@ import{cli as $,Strategy as x}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
89
89
|
|
|
90
90
|
return [uid, rows, sawList, sawPostCandidates];
|
|
91
91
|
})()
|
|
92
|
-
`),i=
|
|
92
|
+
`),i=E(I);if(i&&!Array.isArray(i)&&typeof i==="object"&&"error"in i)k(i.error);if(!Array.isArray(i)||i.length!==4||!Array.isArray(i[1]))throw new u("weibo user-posts returned malformed extraction payload");const[S,l,A,T]=i;if(!A&&l.length===0)throw new u("weibo user-posts did not observe a valid posts list");if(T&&l.length===0)throw new u("weibo user-posts found post candidates but could not extract valid rows");if(l.length===0)throw new v("weibo user-posts","No Weibo posts found for this user/date range");return l.slice(0,n).map((s,_)=>({rank:_+1,id:String(s.id),mblogid:s.mblogid||"",author:s.author||"",uid:String(s.uid||S||""),text:s.text||"",time:s.time||"",reposts:s.reposts??0,comments:s.comments??0,likes:s.likes??0,pic_count:s.pic_count??0,url:s.url||""}))}});
|
package/clis/weibo/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{cli as a,Strategy as o}from"@jackwener/opencli/registry";import{CommandExecutionError as n}from"@jackwener/opencli/errors";import{requireObjectEvaluateResult as s,unwrapEvaluateResult as d}from"./utils.js";a({site:"weibo",name:"user",access:"read",description:"Get Weibo user profile",domain:"weibo.com",strategy:o.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"User ID (numeric uid) or screen name"}],columns:["screen_name","uid","followers","following","statuses","verified","description","location","url"],func:async(e,
|
|
1
|
+
import{cli as a,Strategy as o}from"@jackwener/opencli/registry";import{CommandExecutionError as n}from"@jackwener/opencli/errors";import{requireObjectEvaluateResult as s,unwrapEvaluateResult as d}from"./utils.js";a({site:"weibo",name:"user",access:"read",description:"Get Weibo user profile",domain:"weibo.com",strategy:o.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"User ID (numeric uid) or screen name"}],columns:["screen_name","uid","followers","following","statuses","verified","description","location","url"],func:async(e,i)=>{await e.goto("https://weibo.com");await e.wait(2);const r=String(i.id),t=s(d(await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const id = ${JSON.stringify(
|
|
3
|
+
const id = ${JSON.stringify(r)};
|
|
4
4
|
const isUid = /^\\d+$/.test(id);
|
|
5
5
|
const query = isUid ? 'uid=' + id : 'screen_name=' + encodeURIComponent(id);
|
|
6
6
|
|
package/clis/weibo/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as i,CommandExecutionError as e}from"@jackwener/opencli/errors";export function unwrapEvaluateResult(r){if(r&&!Array.isArray(r)&&typeof r==="object"&&"session"in r&&"data"in r)return r.data;return r}export function requireArrayEvaluateResult(r,t){if(!Array.isArray(r)){if(r&&typeof r==="object"&&"error"in r)throw new e(`${t}: ${String(r.error)}`);throw new e(`${t} returned malformed extraction payload`)}return r}export function requireObjectEvaluateResult(r,t){if(!r||Array.isArray(r)||typeof r!=="object")throw new e(`${t} returned malformed extraction payload`);return r}export async function getSelfUid(r){const t=unwrapEvaluateResult(await r.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
const app = document.querySelector('#app')?.__vue_app__;
|
|
4
4
|
const store = app?.config?.globalProperties?.$store;
|
|
@@ -6,11 +6,11 @@ import{AuthRequiredError as J,CommandExecutionError as D}from"@jackwener/opencli
|
|
|
6
6
|
if (uid) return String(uid);
|
|
7
7
|
return null;
|
|
8
8
|
})()
|
|
9
|
-
`));if(
|
|
9
|
+
`));if(t)return t;const n=unwrapEvaluateResult(await r.evaluate(`
|
|
10
10
|
(async () => {
|
|
11
11
|
const resp = await fetch('/ajax/config/get_config', {credentials: 'include'});
|
|
12
12
|
if (!resp.ok) return null;
|
|
13
13
|
const data = await resp.json();
|
|
14
14
|
return data.ok && data.data?.uid ? String(data.data.uid) : null;
|
|
15
15
|
})()
|
|
16
|
-
`));if(
|
|
16
|
+
`));if(n)return n;throw new i("weibo.com")}
|
package/clis/weixin/article.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as m,CommandExecutionError as x}from"@jackwener/opencli/errors";import{cli as k,Strategy as N}from"@jackwener/opencli/registry";import{publishArticle as b}from"../_shared/article/publish.js";import{readFile as q,stat as M}from"node:fs/promises";function T(t){if(!t.execute)throw new m("INVALID_INPUT","微信公众号写操作需要 --execute 确认,避免误发。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function v(t){const i=typeof t.text==="string"?t.text:void 0,e=typeof t.file==="string"?t.file:void 0;if(i&&e)throw new m("INVALID_INPUT","请只提供 <text> 或 --file 中的一种,不能同时使用。");let n=i??"";if(e){let a;try{a=await M(e)}catch{throw new m("INVALID_INPUT",`文件不存在:${e}`)}if(!a.isFile())throw new m("INVALID_INPUT",`路径不是可读文本文件:${e}`);let o;try{o=await q(e)}catch{throw new m("INVALID_INPUT",`文件无法读取:${e}`)}try{n=new TextDecoder("utf-8",{fatal:!0}).decode(o)}catch{throw new m("INVALID_INPUT",`文件无法解码为 UTF-8:${e}`)}}if(!n.trim())throw new m("INVALID_INPUT","正文不能为空。");return n}function P(t,i,e,n,a={}){return[{status:"success",outcome:n,message:t,target_type:i,target:e,...a}]}export const weixinProfile={home:"https://mp.weixin.qq.com",outputFormat:"html",preprocessConfig:{removeLinks:!0,keepLinkDomains:["mp.weixin.qq.com","weixin.qq.com"],compactHtml:!0},image:{skip:["mmbiz.qpic.cn","mmbiz.qlogo.cn"],uploadFn:async(t,i)=>{const e=document.documentElement.innerHTML,n=e.match(/data:\s*\{[\s\S]*?t:\s*["']([^"']+)["']/),a=e.match(/ticket:\s*["']([^"']+)["']/),o=e.match(/user_name:\s*["']([^"']+)["']/),c=e.match(/time:\s*["'](\d+)["']/);if(!n)throw Error("微信图片上传:页面中未找到 token,请确认已登录 mp.weixin.qq.com。");const r=n[1],l=a?a[1]:"",s=o?o[1]:"",p=c?Number(c[1]):Math.floor(Date.now()/1000),u=await fetch(t,{credentials:"omit"});if(!u.ok)throw Error("图片下载失败:"+t+"(HTTP "+u.status+")");const h=await u.blob(),_=Date.now(),w=_+".jpg",d=new FormData;d.append("type",h.type||"image/jpeg");d.append("id",String(_));d.append("name",w);d.append("lastModifiedDate",new Date().toString());d.append("size",String(h.size));d.append("file",h,w);const y=Date.now(),I="https://mp.weixin.qq.com/cgi-bin/filetransfer?action=upload_material&f=json&scene=8&writetype=doublewrite&groupid=1&ticket_id="+encodeURIComponent(s)+"&ticket="+encodeURIComponent(l)+"&svr_time="+p+"&token="+encodeURIComponent(r)+"&lang=zh_CN&seq="+y+"&t="+Math.random(),g=await fetch(I,{method:"POST",credentials:"include",body:d}),f=await g.json().catch(()=>({}));if(!g.ok||f.base_resp?.err_msg!=="ok"||!f.cdn_url)throw Error("微信图片上传失败:"+t+"("+(f.base_resp?.err_msg||"HTTP "+g.status)+")");return{url:f.cdn_url}}},checkAuth:async(t)=>{const e=await(await fetch("https://mp.weixin.qq.com/",{method:"GET",credentials:"include"})).text(),n=e.match(/user_name:\s*["']([^"']+)["']/),a=e.match(/nick_name:\s*["']([^"']+)["']/);if(!n&&!a)return{isAuthenticated:!1};const o=e.match(/class="weui-desktop-account__thumb"[^>]*src="([^"]+)"/),c=e.match(/head_img:\s*['"]([^'"]+)['"]/);let r=o?o[1]:c?c[1]:"";if(r.startsWith("http://"))r=r.replace("http://","https://");return{isAuthenticated:!0,userId:n?n[1]:"",username:a?a[1]:"",avatar:r}},publish:async(t,i)=>{const n=document.documentElement.innerHTML.match(/data:\s*\{[\s\S]*?t:\s*["']([^"']+)["']/);if(!n)return{ok:!1,stage:"auth",message:"页面中未找到 token,请确认已登录 mp.weixin.qq.com。"};const a=n[1],o=t.content,c=new URLSearchParams({token:a,lang:"zh_CN",f:"json",ajax:"1",random:String(Math.random()),AppMsgId:"",count:"1",data_seq:"0",operate_from:"Chrome",isnew:"0",ad_video_transition0:"",can_reward0:"0",related_video0:"",is_video_recommend0:"-1",title0:t.title,author0:"",writerid0:"0",fileid0:"",digest0:"",auto_gen_digest0:"1",content0:o,sourceurl0:"",need_open_comment0:"1",only_fans_can_comment0:"0",cdn_url0:"",cdn_235_1_url0:"",cdn_1_1_url0:"",cdn_url_back0:"",crop_list0:"",music_id0:"",video_id0:"",voteid0:"",voteismlt0:"",supervoteid0:"",cardid0:"",cardquantity0:"",cardlimit0:"",vid_type0:"",show_cover_pic0:"0",shortvideofileid0:"",copyright_type0:"0",releasefirst0:"",platform0:"",reprint_permit_type0:"",allow_reprint0:"",allow_reprint_modify0:"",original_article_type0:"",ori_white_list0:"",free_content0:"",fee0:"0",ad_id0:"",guide_words0:"",is_share_copyright0:"0",share_copyright_url0:"",source_article_type0:"",reprint_recommend_title0:"",reprint_recommend_content0:"",share_page_type0:"0",share_imageinfo0:'{"list":[]}',share_video_id0:"",dot0:"{}",share_voice_id0:"",insert_ad_mode0:"",categories_list0:"[]"}),r=await fetch("https://mp.weixin.qq.com/cgi-bin/operate_appmsg?t=ajax-response&sub=create&type=77&token="+encodeURIComponent(a)+"&lang=zh_CN",{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:c});var l=await r.text(),s=null;try{s=JSON.parse(l)}catch(w){}if(!r.ok||!s||!s.appMsgId){var p=s&&(s.ret!=null?s.ret:s.base_resp&&s.base_resp.ret),u={"-6":"请输入验证码","-8":"请输入验证码","-1":"系统错误,请注意备份内容后重试","-2":"参数错误,请注意备份内容后重试","-99":"内容超出字数,请调整","200003":"登录态超时,请重新登录","64507":"内容不能包含外部链接","64702":"标题超出 64 字长度限制","64705":"内容超出字数,请调整"},h=p!=null&&u[String(p)]||"发布失败(错误码:"+p+"):"+l.slice(0,200);return{ok:!1,stage:"publish",status:r.status,message:h}}const _="https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&type=77&appmsgid="+s.appMsgId+"&token="+encodeURIComponent(a)+"&lang=zh_CN";return{ok:!0,id:String(s.appMsgId),url:_,draft:!0}}},weixinAuthProfile={home:weixinProfile.home,checkAuth:weixinProfile.checkAuth};k({site:"weixin",name:"article",access:"write",description:"通过 API 把文章发布到微信公众号草稿箱。正文默认 Markdown,外链图片自动转存到微信 CDN。",domain:"mp.weixin.qq.com",strategy:N.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题(最长 64 字)"},{name:"text",positional:!0,help:"文章正文(默认 Markdown;加 --html 则当 HTML 处理)"},{name:"file",help:"正文文件路径(UTF-8,默认 Markdown)"},{name:"html",type:"boolean",help:"把正文当 HTML 处理而不是 Markdown"},{name:"draft",type:"boolean",help:"仅保存草稿(微信公众号目前只支持草稿,此参数保留兼容性)"},{name:"execute",type:"boolean",help:"实际执行发布。不加此参数时命令拒绝写入。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(t,i)=>{if(!t)throw new x("微信公众号 article 命令需要浏览器会话。");T(i);const e=String(i.title??"").trim();if(!e)throw new m("INVALID_INPUT","文章标题不能为空。");const n=await v(i),a=!0,o=await b(t,{title:e,body:n,format:i.html?"html":"markdown",draftOnly:a,profile:weixinProfile}),c=o.images.uploaded.length|0,r=o.images.failed.length|0;let l="已保存微信公众号草稿";if(c||r)l+="·图片:"+c+" 张已转存"+(r?","+r+" 张失败":"");return P(l,"article","","draft",{created_target:"article:"+o.id,created_url:o.url})}});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{cli as
|
|
2
|
-
var el = document.querySelector(${JSON.stringify(
|
|
3
|
-
if (!el) return { ok: false, reason: 'not found: ' + ${JSON.stringify(
|
|
1
|
+
import{cli as d,Strategy as m}from"@jackwener/opencli/registry";import{CommandExecutionError as r}from"@jackwener/opencli/errors";import{setInputFiles as f}from"../_shared/file-inject.js";const w="mp.weixin.qq.com",v="https://mp.weixin.qq.com/";async function b(t){return t.evaluate("(window.location.href.match(/token=(\\d+)/)||[])[1]")}async function h(t){await t.goto(v);await t.wait(3);const e=await b(t);if(!e)throw new r("Could not extract session token. Please log in to mp.weixin.qq.com");await t.goto(`https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit_v2&action=edit&isNew=1&type=77&token=${e}&lang=zh_CN`);for(let n=0;n<15;n++){if(await t.evaluate("!!document.querySelector('.ProseMirror')"))break;await t.wait(1)}await t.wait(2)}async function o(t,e,n){return t.evaluate(`(() => {
|
|
2
|
+
var el = document.querySelector(${JSON.stringify(e)});
|
|
3
|
+
if (!el) return { ok: false, reason: 'not found: ' + ${JSON.stringify(e)} };
|
|
4
4
|
el.focus();
|
|
5
5
|
var proto = el.tagName === 'TEXTAREA' ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype;
|
|
6
6
|
var setter = Object.getOwnPropertyDescriptor(proto, 'value');
|
|
7
|
-
if (setter && setter.set) setter.set.call(el, ${JSON.stringify(
|
|
8
|
-
else el.value = ${JSON.stringify(
|
|
7
|
+
if (setter && setter.set) setter.set.call(el, ${JSON.stringify(n)});
|
|
8
|
+
else el.value = ${JSON.stringify(n)};
|
|
9
9
|
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
10
10
|
return { ok: true };
|
|
11
|
-
})()`)}async function
|
|
12
|
-
var el = document.querySelector(${JSON.stringify(
|
|
13
|
-
if (!el) return { ok: false, reason: 'not found: ' + ${JSON.stringify(
|
|
11
|
+
})()`)}async function s(t,e,n){const a=await t.evaluate(`(async () => {
|
|
12
|
+
var el = document.querySelector(${JSON.stringify(e)});
|
|
13
|
+
if (!el) return { ok: false, reason: 'not found: ' + ${JSON.stringify(e)} };
|
|
14
14
|
el.scrollIntoView({ block: 'center' });
|
|
15
15
|
el.focus();
|
|
16
16
|
|
|
@@ -48,64 +48,64 @@ import{cli as Y,Strategy as Z}from"@jackwener/opencli/registry";import{CommandEx
|
|
|
48
48
|
var beforeInput = new InputEvent('beforeinput', {
|
|
49
49
|
bubbles: true, cancelable: true,
|
|
50
50
|
inputType: 'insertText',
|
|
51
|
-
data: ${JSON.stringify(
|
|
51
|
+
data: ${JSON.stringify(n)},
|
|
52
52
|
});
|
|
53
53
|
el.dispatchEvent(beforeInput);
|
|
54
54
|
el.dispatchEvent(new InputEvent('input', {
|
|
55
55
|
bubbles: true,
|
|
56
|
-
data: ${JSON.stringify(
|
|
56
|
+
data: ${JSON.stringify(n)},
|
|
57
57
|
}));
|
|
58
58
|
// 兜底:execCommand insertText(老版 UEditor 仍可能用)
|
|
59
|
-
if ((el.innerText || '').length < ${JSON.stringify(
|
|
59
|
+
if ((el.innerText || '').length < ${JSON.stringify(n)}.length / 2) {
|
|
60
60
|
try {
|
|
61
|
-
document.execCommand('insertText', false, ${JSON.stringify(
|
|
61
|
+
document.execCommand('insertText', false, ${JSON.stringify(n)});
|
|
62
62
|
} catch (e) {}
|
|
63
63
|
}
|
|
64
64
|
return { ok: true, textLen: (el.innerText || '').length };
|
|
65
|
-
})()`);await
|
|
65
|
+
})()`);await t.wait(1);return a}async function y(t,e){const n=await import("node:fs"),i=(await import("node:path")).default.resolve(e);if(!n.default.existsSync(i))throw new r(`Image not found: ${i}`);await t.evaluate(`(() => {
|
|
66
66
|
var li = document.querySelector('#js_editor_insertimage')
|
|
67
67
|
|| document.querySelector('.jsInsertIcon.img');
|
|
68
68
|
if (li) li.click();
|
|
69
|
-
})()`);await
|
|
69
|
+
})()`);await t.wait(1);await t.evaluate(`(() => {
|
|
70
70
|
var items = document.querySelectorAll('.js_img_dropdown_menu .tpl_dropdown_menu_item, .js_img_dropdown_menu li');
|
|
71
71
|
for (var i = 0; i < items.length; i++) {
|
|
72
72
|
var t = (items[i].textContent || '').trim();
|
|
73
73
|
if (t.includes('本地上传') || t.includes('上传')) { items[i].click(); return; }
|
|
74
74
|
}
|
|
75
75
|
if (items[0]) items[0].click();
|
|
76
|
-
})()`);await
|
|
76
|
+
})()`);await t.wait(1);await f(t,'input[type="file"][name="file"]',[i]);await t.wait(8);if(await t.evaluate(`(() => {
|
|
77
77
|
var editor = document.querySelector('.rich_media_content')
|
|
78
78
|
|| document.querySelector('#ueditor_0');
|
|
79
79
|
return editor ? editor.querySelectorAll('img[src*="mmbiz"]').length : 0;
|
|
80
|
-
})()`)===0)throw new
|
|
80
|
+
})()`)===0)throw new r("Image did not upload to WeChat CDN")}async function p(t){await t.evaluate('document.querySelector("#js_cover_area")?.scrollIntoView()');await t.wait(1);await t.evaluate('document.querySelector(".js_cover_btn_area")?.click()');await t.wait(1);await t.evaluate(`(() => {
|
|
81
81
|
var links = document.querySelectorAll('a.pop-opr__button, button.pop-opr__button');
|
|
82
82
|
for (var i = 0; i < links.length; i++) {
|
|
83
83
|
var t = (links[i].textContent || '').trim();
|
|
84
84
|
if (t.includes('从正文选择')) { links[i].click(); return; }
|
|
85
85
|
}
|
|
86
|
-
})()`);await
|
|
86
|
+
})()`);await t.wait(2);await t.evaluate(`(() => {
|
|
87
87
|
// 新版可能没有 .weui-desktop-dialog_img-picker 包裹,用更通用的选择器
|
|
88
88
|
var img = document.querySelector('.appmsg_content_img')
|
|
89
89
|
|| document.querySelector('.weui-desktop-dialog img[src*="mmbiz"]')
|
|
90
90
|
|| document.querySelector('.weui-desktop-dialog_img-picker .appmsg_content_img');
|
|
91
91
|
if (img) img.click();
|
|
92
|
-
})()`);await
|
|
92
|
+
})()`);await t.wait(1);await t.evaluate(`(() => {
|
|
93
93
|
var btns = document.querySelectorAll('button');
|
|
94
94
|
for (var i = 0; i < btns.length; i++) {
|
|
95
95
|
if ((btns[i].textContent || '').trim() === '下一步' && !btns[i].disabled) { btns[i].click(); return; }
|
|
96
96
|
}
|
|
97
|
-
})()`);for(let
|
|
97
|
+
})()`);for(let n=0;n<8;n++){await t.wait(2);if(await t.evaluate(`(() => {
|
|
98
98
|
var btns = document.querySelectorAll('button');
|
|
99
99
|
for (var i = 0; i < btns.length; i++) {
|
|
100
100
|
if ((btns[i].textContent || '').trim() === '确认' && btns[i].offsetHeight > 0 && !btns[i].disabled) return true;
|
|
101
101
|
}
|
|
102
102
|
return false;
|
|
103
|
-
})()`))break}await
|
|
103
|
+
})()`))break}await t.evaluate(`(() => {
|
|
104
104
|
var btns = document.querySelectorAll('button');
|
|
105
105
|
for (var i = 0; i < btns.length; i++) {
|
|
106
106
|
if ((btns[i].textContent || '').trim() === '确认' && btns[i].offsetHeight > 0 && !btns[i].disabled) { btns[i].click(); return; }
|
|
107
107
|
}
|
|
108
|
-
})()`);await
|
|
108
|
+
})()`);await t.wait(2);return await t.evaluate(`(() => {
|
|
109
109
|
var area = document.querySelector('#js_cover_area');
|
|
110
110
|
if (!area) return false;
|
|
111
111
|
var found = false;
|
|
@@ -114,17 +114,17 @@ import{cli as Y,Strategy as Z}from"@jackwener/opencli/registry";import{CommandEx
|
|
|
114
114
|
if (bg && bg.includes('mmbiz')) found = true;
|
|
115
115
|
});
|
|
116
116
|
return found;
|
|
117
|
-
})()`)}async function
|
|
117
|
+
})()`)}async function _(t){if(!(await t.evaluate(`(() => {
|
|
118
118
|
var btns = document.querySelectorAll('span, button, a');
|
|
119
119
|
for (var i = 0; i < btns.length; i++) {
|
|
120
120
|
if ((btns[i].textContent || '').trim() === '保存为草稿') { btns[i].click(); return { ok: true }; }
|
|
121
121
|
}
|
|
122
122
|
return { ok: false };
|
|
123
|
-
})()`))?.ok)throw new
|
|
123
|
+
})()`))?.ok)throw new r("Save draft button not found");for(let n=0;n<5;n++){await t.wait(2);if(await t.evaluate(`(() => {
|
|
124
124
|
var el = document.querySelector('#js_save_success');
|
|
125
125
|
if (el && window.getComputedStyle(el).display !== 'none') return true;
|
|
126
126
|
return document.body.innerText.includes('已保存');
|
|
127
|
-
})()`))return!0}return!1}export const createDraftCommand=
|
|
127
|
+
})()`))return!0}return!1}export const createDraftCommand=d({site:"weixin",name:"create-draft",access:"write",description:"创建微信公众号图文草稿",domain:w,strategy:m.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"title",required:!0,help:"文章标题 (最长64字)"},{name:"content",fromFile:!0,required:!0,positional:!0,help:"文章正文"},{name:"author",help:"作者名 (最长8字)"},{name:"cover-image",help:"封面图片路径 (会先上传到正文再设为封面)"},{name:"summary",help:"文章摘要"},{name:"timeout",type:"int",required:!1,default:180,help:"Max seconds for the overall command (default: 180)"}],columns:["status","detail"],func:async(t,e)=>{await h(t);if(!(await s(t,".title-editor__input .ProseMirror",e.title))?.ok){if(!(await o(t,"textarea#title",e.title))?.ok)throw new r("Failed to fill title")}if(e.author){if(!(await o(t,"input#author",e.author))?.ok)throw new r("Failed to fill author")}if(!(await s(t,".rich_media_content.ProseMirror, .rich_media_content .ProseMirror",e.content))?.ok)throw new r("Failed to fill content");if(e["cover-image"]){await y(t,e["cover-image"]);const c=await p(t)}if(e.summary)await o(t,"textarea#js_description",e.summary);const i=await t.evaluate(`(() => {
|
|
128
128
|
var t = document.querySelector('.title-editor__input .ProseMirror');
|
|
129
129
|
var c = document.querySelector('.rich_media_content.ProseMirror, .rich_media_content .ProseMirror');
|
|
130
130
|
var tt = document.querySelector('textarea#title');
|
|
@@ -135,7 +135,7 @@ import{cli as Y,Strategy as Z}from"@jackwener/opencli/registry";import{CommandEx
|
|
|
135
135
|
contentText: c ? (c.innerText || '').slice(0, 40) : '',
|
|
136
136
|
textareaTitleValue: tt ? (tt.value || '').slice(0, 40) : '(no textarea#title)',
|
|
137
137
|
};
|
|
138
|
-
})()`);if(
|
|
138
|
+
})()`);if(i.titleLen===0||i.contentLen===0)throw new r(`ProseMirror state not synced: title_len=${i.titleLen}, content_len=${i.contentLen}. title="${i.titleText}" content="${i.contentText}"`);await o(t,"textarea#title",e.title);await t.wait(3);const u=await _(t);await t.wait(3);const l=await t.evaluate(`(() => {
|
|
139
139
|
var t = document.querySelector('.title-editor__input .ProseMirror');
|
|
140
140
|
var c = document.querySelector('.rich_media_content.ProseMirror, .rich_media_content .ProseMirror');
|
|
141
141
|
var tt = document.querySelector('textarea#title');
|
|
@@ -149,4 +149,4 @@ import{cli as Y,Strategy as Z}from"@jackwener/opencli/registry";import{CommandEx
|
|
|
149
149
|
url: url,
|
|
150
150
|
appmsgid: appmsgidMatch ? appmsgidMatch[1] : null,
|
|
151
151
|
};
|
|
152
|
-
})()`);return[{status:
|
|
152
|
+
})()`);return[{status:u?"draft saved":"save attempted, check browser to confirm",detail:`"${e.title}"${e.author?` by ${e.author}`:""}${e["cover-image"]?" (with cover)":""} appmsgid=${l.appmsgid||"?"} title_len=${i.titleLen} content_len=${i.contentLen} pm_title_len_after_save=${l.titleLen} content_len_after_save=${l.contentLen}`}]}});
|
package/clis/weixin/download.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as f,Strategy as g}from"@jackwener/opencli/registry";import{downloadArticle as x}from"@jackwener/opencli/download/article-download";const d=[['"','"'],["'","'"],["“","”"],["‘","’"],["「","」"],["『","』"],["„","‟"],["‹","›"],["«","»"]],T=new Set(d.map(([r])=>r).concat("<")),_=new Set(d.map(([,r])=>r).concat(">"));function b(r){let e=r;for(let t=0;t<4;t+=1){const i=e;for(const[n,c]of d)if(e.length>=2&&e.startsWith(n)&&e.endsWith(c)){e=e.slice(n.length,e.length-c.length).trim();break}while(e&&T.has(e[0]))e=e.slice(1).trimStart();while(e&&_.has(e[e.length-1]))e=e.slice(0,-1).trimEnd();if(e===i)break}return e}export function normalizeWechatUrl(r){let e=(r||"").trim();if(!e)return e;e=b(e);e=e.replace(/\\+([:/&?=#%])/g,"$1");e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');if(e.startsWith("mp.weixin.qq.com/")||e.startsWith("//mp.weixin.qq.com/"))e="https://"+e.replace(/^\/+/,"");try{const t=new URL(e);if(["http:","https:"].includes(t.protocol)&&t.hostname.toLowerCase()==="mp.weixin.qq.com"){t.protocol="https:";e=t.toString()}}catch{}return e}export function formatWechatTimestamp(r){const e=Number.parseInt(r,10);if(!Number.isFinite(e)||e<=0)return"";const t=r.length===13?e:e*1000,i=new Date(t),n=(s)=>String(s).padStart(2,"0"),c=new Date(i.getTime()+28800000);return`${c.getUTCFullYear()}-${n(c.getUTCMonth()+1)}-${n(c.getUTCDate())} ${n(c.getUTCHours())}:${n(c.getUTCMinutes())}:${n(c.getUTCSeconds())}`}export function extractWechatCreateTimeValue(r){const e=r.match(/create_time\s*:\s*JsDecode\('([^']+)'\)(?=[\s,;}]|$)/);if(e)return e[1];const t=r.match(/create_time\s*[:=]\s*(?:"([^"]+)"|'([^']+)'|([0-9A-Za-z]+))(?=[\s,;}]|$)/);if(!t)return"";return t[1]||t[2]||t[3]||""}export function extractWechatPublishTime(r,e){const t=(r||"").trim();if(t)return t;const i=extractWechatCreateTimeValue(e);if(!/^\d{10}$|^\d{13}$/.test(i))return"";return formatWechatTimestamp(i)}export function detectWechatAccessIssue(r,e){const t=(r||"").replace(/\s+/g," ").trim();if(/环境异常/.test(t)&&/(完成验证后即可继续访问|去验证)/.test(t))return"environment verification required";if(/secitptpage\/verify\.html/.test(e)||/id=["']js_verify["']/.test(e))return"environment verification required";return""}export function pickFirstWechatMetaText(...r){for(const e of r){const t=(e||"").replace(/\s+/g," ").trim();if(t&&t!=="Name cleared")return t}return""}export function buildExtractWechatPublishTimeJs(){return`(${function r(e,t){function i(u){const o=Number.parseInt(u,10);if(!Number.isFinite(o)||o<=0)return"";const a=u.length===13?o:o*1000,h=new Date(a),m=(p)=>String(p).padStart(2,"0"),l=new Date(h.getTime()+28800000);return`${l.getUTCFullYear()}-${m(l.getUTCMonth()+1)}-${m(l.getUTCDate())} ${m(l.getUTCHours())}:${m(l.getUTCMinutes())}:${m(l.getUTCSeconds())}`}function n(u){const o=u.match(/create_time\s*:\s*JsDecode\('([^']+)'\)(?=[\s,;}]|$)/);if(o)return o[1];const a=u.match(/create_time\s*[:=]\s*(?:"([^"]+)"|'([^']+)'|([0-9A-Za-z]+))(?=[\s,;}]|$)/);if(!a)return"";return a[1]||a[2]||a[3]||""}const c=(e||"").trim();if(c)return c;const s=n(t);if(!/^\d{10}$|^\d{13}$/.test(s))return"";return i(s)}.toString()})`}export function buildDetectWechatAccessIssueJs(){return`(${function r(e,t){const i=(e||"").replace(/\s+/g," ").trim();if(/环境异常/.test(i)&&/(完成验证后即可继续访问|去验证)/.test(i))return"environment verification required";if(/secitptpage\/verify\.html/.test(t)||/id=["']js_verify["']/.test(t))return"environment verification required";return""}.toString()})`}f({site:"weixin",name:"download",access:"read",description:"下载微信公众号文章为 Markdown 格式",domain:"mp.weixin.qq.com",strategy:g.COOKIE,args:[{name:"url",required:!0,help:"WeChat article URL (mp.weixin.qq.com/s/xxx)"},{name:"output",default:"./weixin-articles",help:"Output directory"},{name:"download-images",type:"boolean",default:!0,help:"Download images locally"}],columns:["title","author","publish_time","status","size","saved"],func:async(r,e)=>{const t=e.url,i=normalizeWechatUrl(t);if(!i.startsWith("https://mp.weixin.qq.com/"))return[{title:"Error",author:"-",publish_time:"-",status:"invalid URL",size:"-",saved:"-"}];await r.goto(i);await r.wait(5);const n=await r.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
const result = {
|
|
4
4
|
title: '',
|
|
@@ -97,4 +97,4 @@ import{cli as Q,Strategy as j}from"@jackwener/opencli/registry";import{downloadA
|
|
|
97
97
|
result.contentHtml = contentEl.innerHTML;
|
|
98
98
|
return result;
|
|
99
99
|
})()
|
|
100
|
-
`);if(
|
|
100
|
+
`);if(n?.errorHint==="environment verification required")return[{title:"Error",author:"-",publish_time:"-",status:"failed — verification required in WeChat browser page",size:"-",saved:"-"}];return x({title:n?.title||"",author:n?.author,publishTime:n?.publishTime,sourceUrl:i,contentHtml:n?.contentHtml||"",codeBlocks:n?.codeBlocks,imageUrls:n?.imageUrls},{output:e.output,downloadImages:e["download-images"],imageHeaders:{Referer:"https://mp.weixin.qq.com/"},frontmatterLabels:{author:"公众号"},detectImageExt:(c)=>{const s=c.match(/wx_fmt=(\w+)/)||c.match(/\.(\w{3,4})(?:\?|$)/);return s?s[1]:"png"}})}});
|
package/clis/weixin/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerArticleLogin as
|
|
1
|
+
import{registerArticleLogin as e}from"../_shared/article/login.js";import{weixinAuthProfile as i}from"./article.js";e({site:"weixin",domain:"mp.weixin.qq.com",profile:{home:i.home,checkAuth:i.checkAuth},loginDescription:"打开微信公众平台首页并等待浏览器完成扫码登录(供桌面客户端引导登录)。"});
|
package/clis/weixin/search.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as m,CommandExecutionError as s,EmptyResultError as f}from"@jackwener/opencli/errors";import{cli as b,Strategy as x}from"@jackwener/opencli/registry";const E="weixin.sogou.com",S=1,_=10,d=10;function h(e,t,r,n){if(e===void 0||e===null)return r;const l=String(e).trim();if(!/^\d+$/.test(l))throw new m(`weixin search --${t} must be a positive integer`,`Pass --${t} as a whole number${n?` from 1 to ${n}`:" greater than 0"}.`);const a=Number(l);if(!Number.isSafeInteger(a)||a<1||n&&a>n)throw new m(`weixin search --${t} is out of range`,`Pass --${t} as a whole number${n?` from 1 to ${n}`:" greater than 0"}.`);return a}function w(e){return h(e,"page",S)}function g(e){return h(e,"limit",_,d)}function y(e,t){const r=new URL("https://weixin.sogou.com/weixin");r.searchParams.set("query",e);r.searchParams.set("type","2");r.searchParams.set("page",String(t));r.searchParams.set("ie","utf8");return r.toString()}function p(){return String.raw`(() => {
|
|
2
2
|
const clean = (value) => {
|
|
3
3
|
return (value || '')
|
|
4
4
|
.replace(/\s+/g, ' ')
|
|
@@ -41,4 +41,4 @@ import{ArgumentError as $,CommandExecutionError as W,EmptyResultError as L}from"
|
|
|
41
41
|
invalidCount: extracted.length - rows.length,
|
|
42
42
|
rows,
|
|
43
43
|
};
|
|
44
|
-
})()`}
|
|
44
|
+
})()`}b({site:"weixin",name:"search",access:"read",description:"使用搜狗微信搜索公众号文章;如需导出正文 Markdown,请使用 weixin download 处理公众号文章链接",domain:E,strategy:x.PUBLIC,browser:!0,args:[{name:"query",positional:!0,required:!0,help:"搜索关键词;如需正文 Markdown,请使用 weixin download 处理公众号文章链接"},{name:"page",type:"int",default:1,help:"结果页码,从 1 开始"},{name:"limit",type:"int",default:10,help:"返回条数,最大 10"}],columns:["rank","page","title","url","summary","publish_time"],func:async(e,t)=>{const r=String(t.query??"").trim();if(!r)throw new m("A search query is required.","Pass a non-empty keyword to search Weixin articles via Sogou.");const n=w(t.page),l=g(t.limit),a=y(r,n);let i;try{await e.goto(a);await e.wait(2);i=await e.evaluate(p())}catch(o){const u=o instanceof Error?o.message:String(o);throw new s("weixin search failed while loading Sogou results",u)}if(!i||typeof i!=="object"||!Array.isArray(i.rows))throw new s("weixin search returned an unreadable browser payload","Sogou Weixin may have changed its result page structure.");if(i.blocked)throw new s("Sogou Weixin blocked this search request","Open weixin.sogou.com in Chrome and complete any verification before retrying.");if(i.invalidCount>0)throw new s("Sogou Weixin returned article cards without required title or URL","The result page structure may have changed; refusing to return a partial result set.");const c=i.rows;if(c.length===0&&i.empty)throw new f("weixin search","Try a different keyword or a different page number.");if(c.length===0)throw new s("weixin search did not expose article result cards","Sogou Weixin may have changed its selectors or returned a transient shell page.");return c.slice(0,l).map((o,u)=>({rank:(n-1)*10+u+1,page:n,title:o.title,url:o.url,summary:o.summary,publish_time:o.publish_time}))}});export const __test__={MAX_LIMIT:d,normalizePage:w,normalizeLimit:g,buildSearchUrl:y,buildExtractSearchResultsEvaluate:p};
|
package/clis/weixin/stats.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as f,EmptyResultError as g}from"@jackwener/opencli/errors";import{cli as w,Strategy as y}from"@jackwener/opencli/registry";const c="mp.weixin.qq.com",_=10;function h(t){if(!t)return"";const i=new Date(t*1000),n=(r)=>String(r).padStart(2,"0");return`${i.getFullYear()}-${n(i.getMonth()+1)}-${n(i.getDate())} ${n(i.getHours())}:${n(i.getMinutes())}`}function k(t){if(t===1)return"发表";if(t===2)return"群发";return t===void 0||t===null?"":`类型${t}`}async function b(t){await t.goto("https://mp.weixin.qq.com/");await t.wait(3);const i=await t.evaluate("(window.location.href.match(/token=(\\d+)/)||[])[1]");if(!i)throw new f(c,"未检测到登录态:请先在 Chrome 登录 mp.weixin.qq.com(微信公众平台)再重试");return i}async function x(t,i,n){await t.goto(`https://mp.weixin.qq.com/cgi-bin/appmsgpublish?sub=list&begin=${n}&count=${_}&token=${i}&lang=zh_CN`);await t.wait(4);const r=await t.evaluate(`(() => {
|
|
2
2
|
const d = window.wx && window.wx.cgiData;
|
|
3
3
|
if (!d || !Array.isArray(d.publish_list)) return JSON.stringify({ error: 'no_cgi_data' });
|
|
4
4
|
const items = [];
|
|
@@ -27,7 +27,7 @@ import{AuthRequiredError as G,EmptyResultError as O}from"@jackwener/opencli/erro
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
return JSON.stringify({ total: d.total_count ?? 0, items });
|
|
30
|
-
})()`),
|
|
30
|
+
})()`),s=typeof r==="string"?JSON.parse(r):r;if(!s||s.error)throw Error("发表记录页未读到数据(window.wx.cgiData.publish_list 缺失):页面可能改版或登录态失效,请重新登录 mp.weixin.qq.com 后重试");return s}async function v(t,i){const n=new Map;try{await t.goto(`https://mp.weixin.qq.com/misc/appmsganalysis?action=report&type=daily_v2&token=${i}&lang=zh_CN`);await t.wait(5);const r=await t.evaluate(`(async () => {
|
|
31
31
|
// 重放页面自己发出的 get_article_list 请求(含 fingerprint),不自行构造参数
|
|
32
32
|
const listUrl = performance.getEntriesByType('resource').map(r => r.name)
|
|
33
33
|
.find(u => u.includes('action=get_article_list'));
|
|
@@ -40,4 +40,4 @@ import{AuthRequiredError as G,EmptyResultError as O}from"@jackwener/opencli/erro
|
|
|
40
40
|
total_read_uv: a.total_read_uv, read_uv_ratio: a.read_uv_ratio,
|
|
41
41
|
}));
|
|
42
42
|
return JSON.stringify({ list });
|
|
43
|
-
})()`),
|
|
43
|
+
})()`),s=typeof r==="string"?JSON.parse(r):r;for(const a of s&&s.list||[])if(a&&a.msg_id)n.set(`${a.msg_id}_${a.item_idx||1}`,a)}catch{}return n}w({site:"weixin",name:"stats",access:"read",description:"微信公众号内容数据(每篇阅读/赞/在看/分享/留言/转载等全量运营指标)",domain:c,strategy:y.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"int",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","views","likes","looking","comments","collects","shares","reprints","extra"],func:async(t,i)=>{const n=i.limit||20,r=await b(t),s=[];let a=1/0;for(let e=0;e<a&&s.length<n;e+=_){const o=await x(t,r,e);a=o.total;if(!o.items.length)break;s.push(...o.items)}if(s.length===0)throw new g("weixin stats","该公众号暂无已发表/已群发内容(发表记录为空)——先发布内容后再查数据");const d=s.slice(0,n),p=await v(t,r);return d.map((e)=>{const o=`${e.msgid}_${e.itemidx}`,l=p.get(o),m={摘要:e.digest||void 0,原创:e.copyright_type===1?!0:void 0,朋友圈点赞:e.moment_like_num||void 0,近30天阅读人数:l?l.total_read_uv:void 0,近30天阅读人数占比:l?l.read_uv_ratio:void 0};for(const u of Object.keys(m))if(m[u]===void 0)delete m[u];return{id:o,type:k(e.publish_type),title:e.title,url:e.url,published_at:h(e.send_time),views:e.read_num,likes:e.old_like_num,looking:e.like_num,comments:e.comment_num,collects:"",shares:e.share_num,reprints:e.reprint_num,extra:Object.keys(m).length?JSON.stringify(m):""}})}});
|
package/clis/weixin/whoami.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as r,Strategy as s}from"@jackwener/opencli/registry";import{checkLogin as t,cookieQuickCheck as o}from"../_shared/article/auth.js";import{weixinAuthProfile as n}from"./article.js";r({site:"weixin",name:"whoami",access:"read",description:"查询当前登录的微信公众号账户信息。",domain:"mp.weixin.qq.com",strategy:s.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:o("https://mp.weixin.qq.com",["slave_sid","slave_user"])},func:async(i)=>{const e=await t(i,n);return[{logged_in:e.isAuthenticated,user_id:e.userId||"",username:e.username||""}]}});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cli as
|
|
2
|
-
`)})}return
|
|
1
|
+
import{cli as N,Strategy as C}from"@jackwener/opencli/registry";import{CliError as n}from"@jackwener/opencli/errors";import{WEREAD_UA as I,WEREAD_WEB_ORIGIN as k,WEREAD_DOMAIN as T}from"./utils.js";const O=`${k}/web`;function D(o){return o.map((t)=>`${t.name}=${t.value}`).join("; ")}async function v(o,t,s){const a=`${O}${t}`,[A,l]=await Promise.all([o.getCookies({url:a}),o.getCookies({domain:T})]),d=new Map;for(const i of l)d.set(i.name,i);for(const i of A)d.set(i.name,i);const p=D(Array.from(d.values())),f=await fetch(a,{method:"POST",headers:{"User-Agent":I,"Content-Type":"application/json",Origin:k,Referer:`${k}/`,...p?{Cookie:p}:{}},body:JSON.stringify(s)});if(f.status===401)throw new n("AUTH_REQUIRED","Not logged in to WeRead","Please log in to weread.qq.com in Chrome first");let c;try{c=await f.json()}catch{throw new n("PARSE_ERROR",`Invalid JSON response for ${t}`,"WeRead may have returned an HTML error page")}if(c?.errcode===-2010||c?.errcode===-2012)throw new n("AUTH_REQUIRED","Not logged in to WeRead","Please log in to weread.qq.com in Chrome first");if(!f.ok)throw new n("FETCH_ERROR",`HTTP ${f.status} for ${t}`,"WeRead API may be temporarily unavailable");return c}async function x(o,t){const s=`${O}${o}`,a=await fetch(s,{method:"POST",headers:{"User-Agent":I,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new n("FETCH_ERROR",`HTTP ${a.status} for ${o}`,"WeRead API may be temporarily unavailable");try{return await a.json()}catch{throw new n("PARSE_ERROR",`Invalid JSON response for ${o}`,"WeRead may have returned an HTML error page")}}N({site:"weread",name:"ai-outline",access:"read",description:"Get AI-generated outline for a book",domain:"weread.qq.com",strategy:C.COOKIE,defaultFormat:"plain",args:[{name:"book-id",positional:!0,required:!0,help:"Book ID (from shelf or search results)"},{name:"limit",type:"int",default:200,help:"Max outline items to return"},{name:"depth",type:"int",default:4,help:"Max outline depth (2=topics, 3=key points, 4=details)"},{name:"raw",type:"boolean",default:!1,help:"Output structured rows (chapter/idx/level/text) for programmatic use"}],columns:void 0,func:async(o,t)=>{const s=String(t["book-id"]||"").trim(),a=Boolean(t.raw),l=(await v(o,"/book/chapterInfos",{bookIds:[s],sinces:[0]}))?.data?.[0]?.updated??[];if(l.length===0)throw new n("NOT_FOUND","No chapters found for this book","Check that the book ID is correct");const d=l.map((e)=>e.chapterUid),p=new Map;for(const e of l)p.set(e.chapterUid,e.title??"");const c=(await x("/book/outline",{bookId:s,chapterUids:d}))?.itemsArray??[],i=Number(t.depth),R=[];for(const e of c){const u=e.items;if(!Array.isArray(u)||u.length===0)continue;const g=p.get(e.chapterUid)??`Chapter ${e.chapterUid}`;let r="",h=0;for(const m of u){const w=m.level??1;if(w<=1)continue;if(w>i)continue;let y=m.uiIdx??"";if(w===3&&y){r=y;h=0}if(w===4&&!y&&r){h++;y=`${r}.${h}`}R.push({chapter:g,idx:y,level:w,text:m.text??""})}}if(R.length===0)throw new n("NOT_FOUND","No AI outline available for this book","AI outlines may not be generated for all books");if(a)return R.slice(0,Number(t.limit));const b=new Map;for(const e of R){if(!b.has(e.chapter))b.set(e.chapter,[]);b.get(e.chapter).push(e)}const E=[];for(const[e,u]of b){const g=[`\uD83D\uDCD6 ${e}`];for(const r of u){const h=" ".repeat(r.level-2),m=r.level===2?`${r.idx}. `:`${r.idx} `;g.push(`${h}${m}${r.text}`)}E.push({outline:g.join(`
|
|
2
|
+
`)})}return E.slice(0,Number(t.limit))}});
|