publishport-opencli 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +17 -17
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as b from"node:fs";import*as w from"node:path";import{cli as q,Strategy as C}from"@jackwener/opencli/registry";import{ArgumentError as s,CommandExecutionError as a}from"@jackwener/opencli/errors";import{assertLiteralContent as R}from"../_shared/content-guard.js";import{setInputFiles as L}from"../_shared/file-inject.js";const D="https://creator.xiaohongshu.com/publish/publish?from=homepage&target=video",v=20,y=1000,x=10,S=[".mp4",".mov",".flv",".f4v",".mkv",".rm",".rmvb",".m4v",".mpg",".mpeg",".ts"],E='input.upload-input, input[type="file"][accept*=".mp4"]',I='input[placeholder*="标题"]',T=['input[placeholder*="标题"]','input.d-text[placeholder*="标题"]'],f=".tiptap.ProseMirror",N="#creator-editor-topic-container",k=["_onPublish","onPublish","_onSubmit","_handlePublish"],B=["_onSave","_onSaveDraft","_onDraft"];function F(t){const e=w.resolve(t);if(!b.existsSync(e))throw new s(`视频文件不存在: ${e}`);const i=w.extname(e).toLowerCase();if(!S.includes(i))throw new s(`不支持的视频格式 "${i}",支持: ${S.join(" ")}`);return e}async function J(t,e=15000){const i=500,n=Math.max(1,Math.ceil(e/i));for(let o=0;o<n;o++){if(await t.evaluate(`(() => !!document.querySelector(${JSON.stringify(E)}))()`))return!0;if(o<n-1)await t.wait({time:i/1000})}return!1}async function U(t,e){if(!await J(t))return{ok:!1,error:"视频发布页未渲染出上传输入框(等待 15s 超时)"};try{await L(t,E,[e]);return{ok:!0}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async function V(t,e=600000){const i=2000,n=Math.ceil(e/i);for(let o=0;o<n;o++){if((await t.evaluate(`(() => {
|
|
2
2
|
const b = document.querySelector('xhs-publish-btn');
|
|
3
3
|
if (!b) return { ready: false, reason: 'no_button' };
|
|
4
4
|
return {
|
|
@@ -6,7 +6,7 @@ import*as F from"node:fs";import*as X from"node:path";import{cli as A,Strategy a
|
|
|
6
6
|
submitDisabled: b.getAttribute('submit-disabled'),
|
|
7
7
|
isPublish: b.getAttribute('is-publish'),
|
|
8
8
|
};
|
|
9
|
-
})()`))?.ready)return!0;await
|
|
9
|
+
})()`))?.ready)return!0;await t.wait({time:i/1000})}return!1}async function j(t,e=20000){const i=500,n=Math.ceil(e/i);for(let o=0;o<n;o++){if(await t.evaluate(`(() => ${JSON.stringify(T)}.some((s) => !!document.querySelector(s)) && !!document.querySelector(${JSON.stringify(f)}))()`))return!0;await t.wait({time:i/1000})}return!1}async function H(t,e){await t.typeText(I,e);await t.wait({time:0.3});const i=await t.evaluate(`((sels) => { const el = sels.map((s) => document.querySelector(s)).find(Boolean); return el ? (el.value || '') : ''; })(${JSON.stringify(T)})`);if(i.trim()!==e){await t.screenshot({path:"/tmp/xhs_video_title_debug.png"});throw new a(`填写标题失败,期望 "${e}",实际 "${i}"。截图: /tmp/xhs_video_title_debug.png`)}}async function X(t,e){await t.typeText(f,e);await t.wait({time:0.5});const i=await t.evaluate(`((s) => { const el = document.querySelector(s); return el ? (el.innerText || el.textContent || '').replace(/\\u200b/g, '').trim() : ''; })(${JSON.stringify(f)})`),n=e.replace(/\s+/g,"").slice(0,20);if(n&&!i.replace(/\s+/g,"").includes(n)){await t.screenshot({path:"/tmp/xhs_video_body_debug.png"});throw new a(`正文写入校验失败,实际读到 "${i.slice(0,80)}"。截图: /tmp/xhs_video_body_debug.png`)}}async function Y(t){await t.evaluate(`((s) => {
|
|
10
10
|
const el = document.querySelector(s);
|
|
11
11
|
if (!el) return false;
|
|
12
12
|
el.focus();
|
|
@@ -17,7 +17,7 @@ import*as F from"node:fs";import*as X from"node:path";import{cli as A,Strategy a
|
|
|
17
17
|
sel?.removeAllRanges();
|
|
18
18
|
sel?.addRange(range);
|
|
19
19
|
return true;
|
|
20
|
-
})(${JSON.stringify(
|
|
20
|
+
})(${JSON.stringify(f)})`)}async function K(t,e){const i=[];for(const n of e){await Y(t);await t.typeText(f,` #${n}`);let o=!1;for(let c=0;c<12;c++){await t.wait({time:0.5});o=await t.evaluate(`(() => { const c = document.querySelector(${JSON.stringify(N)}); if (!c || c.offsetParent === null) return false; return !!c.querySelector('.item'); })()`);if(o)break}if(!o)continue;if(await t.evaluate(`((cfg) => {
|
|
21
21
|
const c = document.querySelector(cfg.dropdown);
|
|
22
22
|
if (!c) return false;
|
|
23
23
|
const items = Array.from(c.querySelectorAll('.item')).filter((el) => el.offsetParent !== null);
|
|
@@ -27,7 +27,7 @@ import*as F from"node:fs";import*as X from"node:path";import{cli as A,Strategy a
|
|
|
27
27
|
const exact = items.find((el) => norm(el.innerText || el.textContent).includes(norm(cfg.topic)));
|
|
28
28
|
(exact || items[0]).click();
|
|
29
29
|
return true;
|
|
30
|
-
})(${JSON.stringify({dropdown:
|
|
30
|
+
})(${JSON.stringify({dropdown:N,topic:n})})`)){i.push(n);await t.wait({time:0.5})}}return i}async function W(t,e){const i=e?["暂存离开","存草稿"]:["发布","发布笔记"];return t.evaluate(`
|
|
31
31
|
((cfg) => {
|
|
32
32
|
const { isDraftMode, publishNames, draftNames, labels } = cfg;
|
|
33
33
|
const isVisible = (el) => {
|
|
@@ -54,9 +54,9 @@ import*as F from"node:fs";import*as X from"node:path";import{cli as A,Strategy a
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return { ok: false, via: 'none', hosts: hosts.length, lastMethodError };
|
|
57
|
-
})(${JSON.stringify({isDraftMode:
|
|
58
|
-
`)}
|
|
59
|
-
`);if(!await
|
|
57
|
+
})(${JSON.stringify({isDraftMode:e,publishNames:k,draftNames:B,labels:i})})
|
|
58
|
+
`)}q({site:"xiaohongshu",name:"publish-video",access:"write",description:"小红书发布视频笔记(creator center UI 自动化)",domain:"creator.xiaohongshu.com",strategy:C.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"content",required:!1,positional:!0,help:"笔记正文(字面文本,不展开 @文件 引用;长正文用 --file)"},{name:"file",required:!1,help:"从本机文件读取正文(UTF-8),与位置参数 <content> 二选一"},{name:"title",required:!0,help:"笔记标题(≤20字)"},{name:"video",required:!0,help:"视频文件路径 (mp4/mov/mkv/...)"},{name:"topics",required:!1,help:"话题标签,逗号分隔,不含 # 号,最多10个"},{name:"draft",type:"bool",default:!1,help:"暂存为草稿,不直接发布"}],columns:["status","detail"],func:async(t,e)=>{if(!t)throw Error("Browser page required");const i=String(e.title??"").trim(),n=e.file?String(e.file).trim():"";let o=String(e.content??"").trim();if(n){if(o)throw new s("正文位置参数和 --file 只能二选一");const r=w.resolve(n);if(!b.existsSync(r))throw new s(`--file 指向的文件不存在: ${r}`);o=b.readFileSync(r,"utf-8").trim();if(!o)throw new s(`--file 指向的文件内容为空: ${r}`)}const l=e.topics?String(e.topics).split(",").map((r)=>r.trim().replace(/^#/,"")).filter(Boolean):[],c=Boolean(e.draft);if(!i)throw new s("--title 必填");if(i.length>v)throw new s(`标题 ${i.length} 字,需 ≤ ${v} 字`);if(!o)throw new s("缺少正文:给位置参数 <content>,或用 --file <本机文件路径>");R(o,{fileFlag:"--file"});if(o.length>y)throw new s(`正文 ${o.length} 字,需 ≤ ${y} 字`);if(!e.video)throw new s("--video 必填");if(l.length>x)throw new s(`话题过多: ${l.length}(最多 ${x} 个)`);const _=F(String(e.video));await t.goto(D);let d="";for(let r=0;r<30;r++){await t.wait({time:0.5});d=await t.evaluate("() => location.href");if(d.includes("creator.xiaohongshu.com"))break}if(!d.includes("creator.xiaohongshu.com")){await t.screenshot({path:"/tmp/xhs_video_redirect_debug.png"});throw new a(`被重定向离开创作者中心(当前 ${d})——登录态可能已过期。`+"用 ppcli xiaohongshu creator-profile 重新登录。截图: /tmp/xhs_video_redirect_debug.png")}const g=await U(t,_);if(!g.ok){await t.screenshot({path:"/tmp/xhs_video_upload_debug.png"});throw new a(`视频上传失败: ${g.error??"unknown"}。截图: /tmp/xhs_video_upload_debug.png`)}if(!await j(t)){await t.screenshot({path:"/tmp/xhs_video_form_debug.png"});throw new a("上传后编辑表单未就绪(标题/正文未出现)。截图: /tmp/xhs_video_form_debug.png")}process.stderr.write(` 等待视频转码(可发布状态)...
|
|
59
|
+
`);if(!await V(t)){await t.screenshot({path:"/tmp/xhs_video_transcode_debug.png"});throw new a("视频转码超时(10min),发布按钮未解禁。截图: /tmp/xhs_video_transcode_debug.png")}await H(t,i);await t.wait({time:0.4});await X(t,o);await t.wait({time:0.5});let h=[];if(l.length){h=await K(t,l);const r=l.filter((P)=>!h.includes(P));if(r.length){await t.screenshot({path:"/tmp/xhs_video_topic_debug.png"});throw new a(`话题未能生成实体: ${r.join(", ")}(联想下拉未出现或无匹配项)。截图: /tmp/xhs_video_topic_debug.png`)}}const O=await t.evaluate("(() => { const b = document.querySelector('xhs-publish-btn'); return !!b && b.getAttribute('submit-disabled') === 'false'; })()");if(!c&&!O){await t.screenshot({path:"/tmp/xhs_video_prepublish_debug.png"});throw new a("发布前复查:发布按钮不可用(submit-disabled≠false)。截图: /tmp/xhs_video_prepublish_debug.png")}const m=await W(t,c);if(!m?.ok){await t.screenshot({path:"/tmp/xhs_video_submit_debug.png"});throw new a(`找不到「${c?"暂存离开":"发布"}」触发方式(hosts=${m?.hosts??0}${m?.lastMethodError?`, lastMethodError=${m.lastMethodError}`:""})。截图: /tmp/xhs_video_submit_debug.png`)}await t.wait({time:4});let u=await t.evaluate("() => location.href");const M=c?["草稿已保存","暂存成功","保存成功","保存于"]:["发布成功","上传成功"],p=await t.evaluate(`
|
|
60
60
|
((markers) => {
|
|
61
61
|
for (const el of document.querySelectorAll('*')) {
|
|
62
62
|
if (el.tagName === 'STYLE' || el.tagName === 'SCRIPT') continue;
|
|
@@ -66,4 +66,4 @@ import*as F from"node:fs";import*as X from"node:path";import{cli as A,Strategy a
|
|
|
66
66
|
}
|
|
67
67
|
return '';
|
|
68
68
|
})(${JSON.stringify(M)})
|
|
69
|
-
`),
|
|
69
|
+
`),A=!u.includes("/publish/publish");if(!p&&!A){await t.wait({time:3});u=await t.evaluate("() => location.href")}if(!(p.length>0||!u.includes("/publish/publish"))){await t.screenshot({path:"/tmp/xhs_video_verify_debug.png"});throw new a(`${c?"暂存":"发布"}结果无法确认:未见成功提示、也未跳离发布页。当前 URL: ${u}。截图: /tmp/xhs_video_verify_debug.png`)}return[{status:`✅ ${c?"暂存成功":"发布成功"}`,detail:[`"${i}"`,w.basename(_),h.length?`话题: ${h.map((r)=>`#${r}`).join(" ")}`:"",p||u].filter(Boolean).join(" · ")}]}});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as D from"node:fs";import*as M from"node:path";import{CommandExecutionError as u,ArgumentError as w}from"@jackwener/opencli/errors";import{cli as mt,Strategy as pt}from"@jackwener/opencli/registry";import{assertLiteralContent as bt}from"../_shared/content-guard.js";import{setInputFiles as wt}from"../_shared/file-inject.js";import{humanType as L,humanWait as v,humanMoveTo as gt,elementViewportCenter as xt}from"./human.js";const yt="https://creator.xiaohongshu.com/publish/publish?from=menu_left&target=image",V=9,z=20,K=3000,G="|||",S="基础",X=[["基础","默认兜底,万能"],["边框","金句/要点卡"],["备忘","提醒/随手记"],["清新","日常/清单贴士"],["涂写","随笔/碎碎念"],["便签","笔记/提醒"],["光影","情绪/文艺"],["涂鸦","趣味/童话"],["简约","干货/观点"],["手写","日记/情感"],["插图","生活方式/轻松话题"],["美漫","活力/趣味/故事感"],["弥散","弥散光氛围"],["柔和","柔和/温柔金句"],["印刷","印刷海报/排版"],["科技","科技/产品"],["贺卡","节日祝福"],["札记","艺术/水彩氛围"],["书摘","书摘/引用"],["手帐","手帐拼贴"],["几何","醒目/有力主张"]],Qt=X.map(([t])=>t),B="文字配图",H="再写一张",Y="生成图片",W="下一步",J=".tiptap.ProseMirror",_t=["_onPublish","onPublish","_onSubmit","_handlePublish"],vt=["_onSave","_onSaveDraft","_onDraft"],F=['[contenteditable="true"][placeholder*="标题"]','[contenteditable="true"][placeholder*="赞"]','input[placeholder*="标题"]','input[placeholder*="title" i]','[contenteditable="true"][class*="title"]','input[maxlength="20"]','input[class*="title"]',".title-input input",".note-title input","input[maxlength]"],Q=['[contenteditable="true"][class*="content"]','[contenteditable="true"][class*="editor"]','[contenteditable="true"][placeholder*="描述"]','[contenteditable="true"][placeholder*="正文"]','[contenteditable="true"][placeholder*="内容"]','.note-content [contenteditable="true"]','.editor-content [contenteditable="true"]','[contenteditable="true"]:not([placeholder*="标题"]):not([placeholder*="赞"]):not([placeholder*="title" i])'],St={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp"};function h(t){if(t&&typeof t==="object"&&typeof t.session==="string"&&Object.prototype.hasOwnProperty.call(t,"data"))return t.data;return t}function Tt(t){return t.map((e)=>{const n=M.resolve(e);if(!D.existsSync(n))throw new w(`Image file not found: ${n}`);const o=M.extname(n).toLowerCase();if(!St[o])throw new w(`Unsupported image format "${o}". Supported: jpg, png, gif, webp`);return n})}const Z='input[type="file"][accept*="image"],input[type="file"][accept*=".jpg"],input[type="file"][accept*=".jpeg"],input[type="file"][accept*=".png"],input[type="file"][accept*=".gif"],input[type="file"][accept*=".webp"]';async function kt(t,e=15000){const n=500,o=Math.max(1,Math.ceil(e/n));for(let r=0;r<o;r++){if(await t.evaluate(`
|
|
2
2
|
(() => {
|
|
3
|
-
const sels = ${JSON.stringify(
|
|
3
|
+
const sels = ${JSON.stringify(Z)};
|
|
4
4
|
return !!document.querySelector(sels);
|
|
5
5
|
})()
|
|
6
|
-
`))return!0;if(
|
|
6
|
+
`))return!0;if(r<o-1)await t.wait({time:n/1000})}return!1}async function tt(t,e){if(!await kt(t))return{ok:!1,count:0,error:"No file input found on page (waited 15s; publish surface did not finish rendering)"};try{return{ok:!0,count:(await wt(t,Z,e)).count??e.length}}catch(o){return{ok:!1,count:0,error:o instanceof Error?o.message:String(o)}}}async function et(t,e=30000){const n=2000,o=Math.ceil(e/n);for(let r=0;r<o;r++){if(!await t.evaluate(`
|
|
7
7
|
() => !!document.querySelector(
|
|
8
8
|
'[class*="upload"][class*="progress"], [class*="uploading"], [class*="loading"][class*="image"]'
|
|
9
9
|
)
|
|
10
|
-
`))return;await
|
|
10
|
+
`))return;await t.wait({time:n/1000})}}export function describeTextMismatch(t,e){const n=String(t??""),o=String(e??""),r=(m)=>m.split(/\n\s*\n/).filter((b)=>b.trim()).length;let i=0;while(i<n.length&&i<o.length&&n[i]===o[i])i++;const a=(m)=>JSON.stringify(m.slice(Math.max(0,i-15),i+25)),s=`内容校验不一致:期望 ${n.length} 字符 / ${r(n)} 段,实际 ${o.length} 字符 / ${r(o)} 段。`,d=i>=n.length&&i>=o.length?"":` 首个差异在第 ${i+1} 个字符:期望 ${a(n)},实际 ${a(o)}。`,c=r(n)>1&&r(o)<=1?" 段落数塌成 1 段,通常是编辑器把换行吃掉了。":"";return s+d+c}async function nt(t,e,n,o){const r=await t.evaluate(`
|
|
11
11
|
(function(selectors) {
|
|
12
12
|
const __opencli_xhs_fill_phase = "locate";
|
|
13
13
|
for (const sel of selectors) {
|
|
@@ -21,8 +21,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
return { ok: false };
|
|
24
|
-
})(${JSON.stringify(
|
|
25
|
-
`);if(!
|
|
24
|
+
})(${JSON.stringify(e)})
|
|
25
|
+
`);if(!r.ok){await t.screenshot({path:`/tmp/xhs_publish_${o}_debug.png`});throw Error(`Could not find ${o} input. Debug screenshot: /tmp/xhs_publish_${o}_debug.png`)}const i=()=>t.evaluate(`
|
|
26
26
|
((selector, expectedText) => {
|
|
27
27
|
const __opencli_xhs_fill_phase = "apply";
|
|
28
28
|
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
@@ -78,8 +78,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
78
78
|
el.blur();
|
|
79
79
|
const actual = normalize(el.innerText || el.textContent || '');
|
|
80
80
|
return { ok: actual === normalize(expectedText), actual };
|
|
81
|
-
})(${JSON.stringify(
|
|
82
|
-
`);let
|
|
81
|
+
})(${JSON.stringify(r.sel)}, ${JSON.stringify(n)})
|
|
82
|
+
`);let a;if(r.kind==="contenteditable"&&t.insertText){if(!(await t.evaluate(`
|
|
83
83
|
((selector) => {
|
|
84
84
|
const __opencli_xhs_fill_phase = "prepare";
|
|
85
85
|
const el = Array.from(document.querySelectorAll(selector)).find(node => node && node.offsetParent !== null);
|
|
@@ -99,10 +99,10 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
99
99
|
selection?.removeAllRanges();
|
|
100
100
|
selection?.addRange(range);
|
|
101
101
|
return { ok: true };
|
|
102
|
-
})(${JSON.stringify(
|
|
103
|
-
`))?.ok){await
|
|
104
|
-
`);for(let
|
|
105
|
-
`);if(
|
|
102
|
+
})(${JSON.stringify(r.sel)})
|
|
103
|
+
`))?.ok){await t.screenshot({path:`/tmp/xhs_publish_${o}_debug.png`});throw Error(`Could not prepare ${o} input. Debug screenshot: /tmp/xhs_publish_${o}_debug.png`)}await t.wait({time:0.35});try{const d=String(n).split(`
|
|
104
|
+
`);for(let c=0;c<d.length;c++){if(c>0)if(typeof t.pressKey==="function"){await t.pressKey("Enter");await t.wait({time:0.15})}else await t.insertText(`
|
|
105
|
+
`);if(d[c])await L(t,d[c])}a=await t.evaluate(`
|
|
106
106
|
((selector, expectedText) => {
|
|
107
107
|
const __opencli_xhs_fill_phase = "verify";
|
|
108
108
|
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
@@ -124,8 +124,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
124
124
|
el.blur();
|
|
125
125
|
const actual = normalize(el.innerText || el.textContent || '');
|
|
126
126
|
return { ok: actual === normalize(expectedText), actual };
|
|
127
|
-
})(${JSON.stringify(
|
|
128
|
-
`)}catch{
|
|
127
|
+
})(${JSON.stringify(r.sel)}, ${JSON.stringify(n)})
|
|
128
|
+
`)}catch{a=await i()}}else a=await i();if(!a?.ok){await t.screenshot({path:`/tmp/xhs_publish_${o}_debug.png`});const s=typeof a?.actual==="string"?a.actual:"";throw Error(`Failed to set ${o}. ${describeTextMismatch(n,s)}`+" ⚠️ 编辑器可能已自动保存草稿:请勿直接重试,先用 `ppcli xiaohongshu drafts` 查看,"+"已存在则改为在该草稿上继续操作或先删除,避免建出重复草稿。"+` Debug screenshot: /tmp/xhs_publish_${o}_debug.png`)}}async function Et(t,e){return h(await t.evaluate(`
|
|
129
129
|
(selectors => {
|
|
130
130
|
const el = selectors
|
|
131
131
|
.map(sel => Array.from(document.querySelectorAll(sel)))
|
|
@@ -140,8 +140,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
140
140
|
selection?.removeAllRanges();
|
|
141
141
|
selection?.addRange(range);
|
|
142
142
|
return true;
|
|
143
|
-
})(${JSON.stringify(
|
|
144
|
-
`))}function
|
|
143
|
+
})(${JSON.stringify(e)})
|
|
144
|
+
`))}function Zt(t,{click:e=!1}={}){return`
|
|
145
145
|
(topicName => {
|
|
146
146
|
const norm = (value) => (value || '').replace(/^#/, '').replace(/\\s+/g, '').trim();
|
|
147
147
|
const want = norm(topicName);
|
|
@@ -172,7 +172,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
172
172
|
if (!target) target = items.find(node => norm(node.innerText || node.textContent).includes(want));
|
|
173
173
|
if (!target) target = items[0];
|
|
174
174
|
const rect = target.getBoundingClientRect();
|
|
175
|
-
${
|
|
175
|
+
${e?"try { target.click(); } catch (e) { return { ok: false, count: items.length, message: String(e) }; }":""}
|
|
176
176
|
return {
|
|
177
177
|
ok: true,
|
|
178
178
|
count: items.length,
|
|
@@ -180,8 +180,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
180
180
|
y: Math.round(rect.top + rect.height / 2),
|
|
181
181
|
text: (target.innerText || target.textContent || '').trim().slice(0, 40),
|
|
182
182
|
};
|
|
183
|
-
})(${JSON.stringify(
|
|
184
|
-
`}function
|
|
183
|
+
})(${JSON.stringify(t)})
|
|
184
|
+
`}function te(t,e){return`
|
|
185
185
|
((topicName, selectors) => {
|
|
186
186
|
const norm = (value) => (value || '').replace(/^#/, '').replace(/\\s+/g, '').trim();
|
|
187
187
|
const want = norm(topicName);
|
|
@@ -211,8 +211,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
211
211
|
if (text === want || text === '#' + want) count += 1;
|
|
212
212
|
}
|
|
213
213
|
return count;
|
|
214
|
-
})(${JSON.stringify(
|
|
215
|
-
`}function
|
|
214
|
+
})(${JSON.stringify(t)}, ${JSON.stringify(e)})
|
|
215
|
+
`}function ot(t,e){return`
|
|
216
216
|
((topicName, selectors) => {
|
|
217
217
|
const __opencli_xhs_topic_marker_count = true;
|
|
218
218
|
const marker = '#' + topicName + '[话题]';
|
|
@@ -229,15 +229,15 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
229
229
|
index = text.indexOf(marker, index + marker.length);
|
|
230
230
|
}
|
|
231
231
|
return count;
|
|
232
|
-
})(${JSON.stringify(
|
|
233
|
-
`}async function
|
|
232
|
+
})(${JSON.stringify(t)}, ${JSON.stringify(e)})
|
|
233
|
+
`}async function ee(t,e){const n=`#${e}`;if(typeof t.insertText==="function")try{await t.insertText(n);return!0}catch{}return h(await t.evaluate(`
|
|
234
234
|
(text => {
|
|
235
235
|
const ok = document.execCommand('insertText', false, text);
|
|
236
236
|
const active = document.activeElement;
|
|
237
237
|
if (active) active.dispatchEvent(new Event('input', { bubbles: true }));
|
|
238
238
|
return ok;
|
|
239
|
-
})(${JSON.stringify(
|
|
240
|
-
`))}function
|
|
239
|
+
})(${JSON.stringify(n)})
|
|
240
|
+
`))}function rt(t){return`
|
|
241
241
|
(selectors => {
|
|
242
242
|
let editor = null;
|
|
243
243
|
for (const sel of selectors) {
|
|
@@ -246,8 +246,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
246
246
|
}
|
|
247
247
|
if (!editor) return -1;
|
|
248
248
|
return (editor.innerText || editor.textContent || '').length;
|
|
249
|
-
})(${JSON.stringify(
|
|
250
|
-
`}async function
|
|
249
|
+
})(${JSON.stringify(t)})
|
|
250
|
+
`}async function At(t,e,n){if(!await Et(t,e))throw new u(`Could not attach topic "${n}": body editor not found`);const r=Number(h(await t.evaluate(ot(n,e))))||0;if(typeof t.pressKey==="function")try{await t.pressKey("Enter")}catch{}if(typeof t.insertText!=="function")throw new u(`Could not attach topic "${n}": page.insertText is unavailable`);try{await L(t,`#${n}`)}catch{throw new u(`Could not attach topic "${n}": failed to type inline topic query`)}await v(t,1.2);if(typeof t.pressKey!=="function")throw new u(`Could not attach topic "${n}": page.pressKey is unavailable`);try{await t.pressKey("Enter")}catch(a){throw new u(`Could not attach topic "${n}": failed to accept suggestion (${a&&a.message||a})`)}await t.wait({time:0.8});if((Number(h(await t.evaluate(ot(n,e))))||0)<=r)throw new u(`Could not attach topic "${n}": no real topic entity appeared after selection`)}async function $t(t,e,n){const o=[],r=[];for(const i of n){let a=-1;try{const s=Number(h(await t.evaluate(rt(e))));a=Number.isFinite(s)?s:-1}catch{}try{await At(t,e,i);o.push(i);await t.wait({time:0.4})}catch(s){r.push({topic:i,reason:s&&s.message||String(s)});if(a>=0&&typeof t.pressKey==="function")try{const d=i.length+6;for(let c=0;c<d;c++){const m=Number(h(await t.evaluate(rt(e))));if(!Number.isFinite(m)||m<0||m<=a)break;await t.pressKey("Backspace");await t.wait({time:0.15})}}catch{}}}return{added:o,failed:r}}async function Ct(t){const e=await t.evaluate(`
|
|
251
251
|
() => {
|
|
252
252
|
const isVisible = (el) => {
|
|
253
253
|
if (!el || el.offsetParent === null) return false;
|
|
@@ -296,10 +296,10 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
296
296
|
}
|
|
297
297
|
return { ok: false, visibleTexts };
|
|
298
298
|
}
|
|
299
|
-
`);if(
|
|
299
|
+
`);if(e?.ok)await t.wait({time:1});return e}async function T(t,e,n=7000){const o=500,r=Math.max(1,Math.ceil(n/o));let i={ok:!1};for(let a=0;a<r;a++){i=h(await t.evaluate(`
|
|
300
300
|
((cfg) => {
|
|
301
|
-
const __opencli_xhs_click_label = { wantLabel: ${JSON.stringify(
|
|
302
|
-
const wantLabel = ${JSON.stringify(
|
|
301
|
+
const __opencli_xhs_click_label = { wantLabel: ${JSON.stringify(e)} };
|
|
302
|
+
const wantLabel = ${JSON.stringify(e)};
|
|
303
303
|
const isVisible = (el) => {
|
|
304
304
|
if (!el || el.offsetParent === null) return false;
|
|
305
305
|
const r = el.getBoundingClientRect();
|
|
@@ -331,10 +331,10 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
331
331
|
}
|
|
332
332
|
return { ok: false };
|
|
333
333
|
})()
|
|
334
|
-
`));if(
|
|
334
|
+
`));if(i?.ok)return i;await t.wait({time:o/1000})}return i}async function Nt(t){const e=await t.evaluate(`
|
|
335
335
|
(() => {
|
|
336
336
|
const __opencli_xhs_focus_card = true;
|
|
337
|
-
const sel = ${JSON.stringify(
|
|
337
|
+
const sel = ${JSON.stringify(J)};
|
|
338
338
|
const editors = Array.from(document.querySelectorAll(sel)).filter((el) => el.offsetParent !== null);
|
|
339
339
|
// Prefer the editor inside the active swiper slide if present.
|
|
340
340
|
const active = editors.find((el) => el.closest('.swiper-slide-active')) || editors[editors.length - 1];
|
|
@@ -348,37 +348,37 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
348
348
|
selection?.addRange(range);
|
|
349
349
|
return { ok: true };
|
|
350
350
|
})()
|
|
351
|
-
`);return
|
|
351
|
+
`);return h(e)}async function Mt(t){const e=await t.evaluate(`
|
|
352
352
|
(() => {
|
|
353
353
|
const __opencli_xhs_card_text = true;
|
|
354
|
-
const sel = ${JSON.stringify(
|
|
354
|
+
const sel = ${JSON.stringify(J)};
|
|
355
355
|
const editors = Array.from(document.querySelectorAll(sel)).filter((el) => el.offsetParent !== null);
|
|
356
356
|
const active = editors.find((el) => el.closest('.swiper-slide-active')) || editors[editors.length - 1];
|
|
357
357
|
const text = active ? (active.innerText || active.textContent || '').trim() : '';
|
|
358
358
|
return { ok: !!text, text };
|
|
359
359
|
})()
|
|
360
|
-
`);return
|
|
360
|
+
`);return h(e)}async function it(t){const e=await t.evaluate(`
|
|
361
361
|
(() => {
|
|
362
362
|
const __opencli_xhs_card_count = true;
|
|
363
|
-
const sel = ${JSON.stringify(
|
|
363
|
+
const sel = ${JSON.stringify(J)};
|
|
364
364
|
const editors = Array.from(document.querySelectorAll(sel)).filter((el) => el.offsetParent !== null);
|
|
365
365
|
const active = editors.find((el) => el.closest('.swiper-slide-active')) || editors[editors.length - 1];
|
|
366
366
|
const activeText = active ? (active.innerText || active.textContent || '').trim() : '';
|
|
367
367
|
return { ok: true, count: editors.length, activeEmpty: !activeText };
|
|
368
368
|
})()
|
|
369
|
-
`);return
|
|
369
|
+
`);return h(e)}async function Rt(t,e=8000){const n=300,o=Math.ceil(e/n);for(let r=0;r<o;r++){if((await it(t))?.count>=1)return!0;await t.wait({time:n/1000})}return!1}async function It(t,e,n=6000){const o=300,r=Math.ceil(n/o);for(let i=0;i<r;i++){const a=await it(t);if(a?.count>=e&&a?.activeEmpty)return!0;await t.wait({time:o/1000})}return!1}async function Ot(t,e,n=4){for(let o=0;o<n;o++){if(!(await T(t,H))?.ok)return!1;if(await It(t,e,2500))return!0}return!1}async function qt(t){const e=await t.evaluate(`
|
|
370
370
|
(() => {
|
|
371
371
|
const __opencli_xhs_preview_ready = true;
|
|
372
372
|
const ready = Array.from(document.querySelectorAll('button'))
|
|
373
373
|
.some((b) => b.offsetParent !== null && (b.innerText || '').replace(/\\s+/g, '') === '下一步');
|
|
374
374
|
return { ok: ready };
|
|
375
375
|
})()
|
|
376
|
-
`);return
|
|
377
|
-
`);if(!(await
|
|
378
|
-
`);for(let
|
|
376
|
+
`);return h(e)}async function Pt(t,e=6){const n=400,o=Math.ceil(3000/n);for(let r=0;r<e;r++){if(!(await T(t,Y))?.ok&&r===0)return!1;for(let a=0;a<o;a++){if((await qt(t))?.ok)return!0;await t.wait({time:n/1000})}}return!1}async function Dt(t,e,n){e=String(e).replace(/\\n/g,`
|
|
377
|
+
`);if(!(await Nt(t))?.ok)throw new u(`文字配图: could not focus card editor #${n+1}`);if(typeof t.insertText==="function"){const i=e.split(`
|
|
378
|
+
`);for(let a=0;a<i.length;a++){if(a>0&&typeof t.pressKey==="function")await t.pressKey("Enter");if(i[a])await L(t,i[a])}}else await t.evaluate(`(t => document.execCommand('insertText', false, t))(${JSON.stringify(e)})`);await t.wait({time:0.4});if(!(await Mt(t))?.ok)throw new u(`文字配图: card editor #${n+1} is empty after typing`)}async function Lt(t,e){if(!e||e===S)return S;const n=h(await t.evaluate(`
|
|
379
379
|
(async () => {
|
|
380
380
|
const __opencli_xhs_card_styles = true;
|
|
381
|
-
const want = ${JSON.stringify(
|
|
381
|
+
const want = ${JSON.stringify(e)};
|
|
382
382
|
const norm = (el) => ((el && (el.innerText || el.textContent)) || '').trim();
|
|
383
383
|
const names = () => Array.from(document.querySelectorAll('.cover-list-container .cover-name'));
|
|
384
384
|
const seen = [];
|
|
@@ -404,7 +404,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
404
404
|
}
|
|
405
405
|
return { ok: seen.length > 0, styles: seen, found: false };
|
|
406
406
|
})()
|
|
407
|
-
`));if(!
|
|
407
|
+
`));if(!n?.found)throw new u(`文字配图: requested style "${e}" is not available for this content (options: ${(n?.styles||[]).join(" / ")||"none"}). Choose an available style or omit --card-style to use ${S}.`);if(!(await T(t,e))?.ok)throw new u(`文字配图: could not click requested style "${e}".`);await t.wait({time:0.6});return e}async function at(t){const e=await t.evaluate(`
|
|
408
408
|
(() => {
|
|
409
409
|
const __opencli_xhs_composer_media_count = true;
|
|
410
410
|
const visibleBox = (el) => {
|
|
@@ -417,7 +417,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
417
417
|
const r = el.getBoundingClientRect();
|
|
418
418
|
return r.width >= 48 && r.height >= 48;
|
|
419
419
|
};
|
|
420
|
-
const titleSelectors = ${JSON.stringify(
|
|
420
|
+
const titleSelectors = ${JSON.stringify(F)};
|
|
421
421
|
const titleEl = titleSelectors
|
|
422
422
|
.map((sel) => Array.from(document.querySelectorAll(sel)))
|
|
423
423
|
.flat()
|
|
@@ -436,7 +436,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
436
436
|
}
|
|
437
437
|
return { ok: true, count };
|
|
438
438
|
})()
|
|
439
|
-
`);return
|
|
439
|
+
`);return h(e)}async function st(t,e,n){const o=await at(t);if(!o||typeof o.count!=="number")throw new u(`${n}: could not verify current composer media count`);if(o.count<e){await t.screenshot({path:"/tmp/xhs_publish_media_debug.png"});throw new u(`${n}: expected at least ${e} visible media item(s), got ${o.count}. Debug screenshot: /tmp/xhs_publish_media_debug.png`)}}async function Bt(t,e,n){if(!(await T(t,B))?.ok){await t.screenshot({path:"/tmp/xhs_publish_textimage_debug.png"});throw new u(`文字配图: could not click "${B}" entry. Debug: /tmp/xhs_publish_textimage_debug.png`)}if(!await Rt(t)){await t.screenshot({path:"/tmp/xhs_publish_textimage_debug.png"});throw new u(`文字配图: 写文字 card editor did not appear after clicking "${B}". Debug: /tmp/xhs_publish_textimage_debug.png`)}for(let s=0;s<e.length;s++){if(s>0){if(!await Ot(t,s+1)){await t.screenshot({path:"/tmp/xhs_publish_addcard_debug.png"});throw new u(`文字配图: new card editor #${s+1} did not render after "${H}". Debug: /tmp/xhs_publish_addcard_debug.png`)}}await Dt(t,e[s],s)}if(!await Pt(t)){await t.screenshot({path:"/tmp/xhs_publish_generate_debug.png"});throw new u(`文字配图: "${Y}" did not advance to the 预览图片 step. `+"Debug: /tmp/xhs_publish_generate_debug.png")}const i=await Lt(t,n);if(!(await T(t,W))?.ok){await t.screenshot({path:"/tmp/xhs_publish_next_debug.png"});throw new u(`文字配图: could not click "${W}". Debug: /tmp/xhs_publish_next_debug.png`)}await t.wait({time:2});return i}async function lt(t){return t.evaluate(`
|
|
440
440
|
() => {
|
|
441
441
|
const text = (document.body?.innerText || '').replace(/s+/g, ' ').trim();
|
|
442
442
|
const hasTitleInput = !!Array.from(document.querySelectorAll('input, textarea')).find((el) => {
|
|
@@ -466,22 +466,22 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
466
466
|
const state = hasTitleInput ? 'editor_ready' : hasImageInput || !hasVideoSurface ? 'image_surface' : 'video_surface';
|
|
467
467
|
return { state, hasTitleInput, hasImageInput, hasVideoSurface };
|
|
468
468
|
}
|
|
469
|
-
`)}async function
|
|
469
|
+
`)}async function Jt(t,e=5000){const n=500,o=Math.max(1,Math.ceil(e/n));let r=await lt(t);for(let i=0;i<o;i++){if(r.state!=="video_surface")return r;if(i<o-1){await t.wait({time:n/1000});r=await lt(t)}}return r}async function Ft(t,e=1e4){const n=1000,o=Math.ceil(e/n);for(let r=0;r<o;r++){if(await t.evaluate(`
|
|
470
470
|
(() => {
|
|
471
|
-
const sels = ${JSON.stringify(
|
|
471
|
+
const sels = ${JSON.stringify(F)};
|
|
472
472
|
for (const sel of sels) {
|
|
473
473
|
const el = document.querySelector(sel);
|
|
474
474
|
if (el && el.offsetParent !== null) return true;
|
|
475
475
|
}
|
|
476
476
|
return false;
|
|
477
|
-
})()`))return!0;if(
|
|
477
|
+
})()`))return!0;if(r<o-1)await t.wait({time:n/1000})}return!1}async function Ut(t){const e=h(await t.evaluate(`
|
|
478
478
|
(() => {
|
|
479
479
|
const __opencli_xhs_restore_srcs = true;
|
|
480
480
|
return Array.from(document.querySelectorAll('.img-container img'))
|
|
481
481
|
.map((img) => img.currentSrc || img.src || '')
|
|
482
482
|
.filter(Boolean);
|
|
483
483
|
})()
|
|
484
|
-
`));return Array.isArray(
|
|
484
|
+
`));return Array.isArray(e)?e:[]}async function ct(t,e){if(!Array.isArray(e)||e.length===0)return 0;const n=h(await t.evaluate(`
|
|
485
485
|
(async (wanted) => {
|
|
486
486
|
const __opencli_xhs_delete_by_src = true;
|
|
487
487
|
const want = new Set(wanted);
|
|
@@ -511,8 +511,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
511
511
|
await sleep(350);
|
|
512
512
|
}
|
|
513
513
|
return removed;
|
|
514
|
-
})(${JSON.stringify(
|
|
515
|
-
`));return Number(
|
|
514
|
+
})(${JSON.stringify(e)})
|
|
515
|
+
`));return Number(n)||0}function jt(t){const e=String(t&&(t.url||t.key)||""),n=String(t&&t.method||"").toUpperCase(),o=Number(t&&t.status||0);if(n!=="PUT")return null;if(!/ros-upload[^/]*\/spectrum\//.test(e))return null;if(o<200||o>=300)return null;const r=e.match(/\/spectrum\/([^?#]+)/);return r?r[1]:e}function ut(t){return Math.min(45,6+t*4)}async function dt(t,e,n,o=90000){if(e<=0)return{ok:!0,completed:0};if(!n||typeof t.readNetworkCapture!=="function"){await t.wait({time:ut(e)});return{ok:!0,completed:null,viaFallback:!0}}const r=1500,a=Math.ceil(9000/r),s=Math.ceil(o/r),d=new Set;for(let c=0;c<s;c++){const m=await t.readNetworkCapture().catch(()=>[]);for(const b of Array.isArray(m)?m:[]){const f=jt(b);if(f)d.add(f)}if(d.size>=e)return{ok:!0,completed:d.size};if(c>=a&&d.size===0){await t.wait({time:ut(e)});return{ok:!0,completed:null,viaFallback:!0}}await t.wait({time:r/1000})}return{ok:!1,completed:d.size}}async function Vt(t,e,n){try{await t.goto("https://creator.xiaohongshu.com/new/note-manager")}catch{return null}const o=e.trim();for(let r=0;r<n;r++){await t.wait({time:1.5});let i;try{i=h(await t.evaluate(`(() => {
|
|
516
516
|
const noteIdRe = /"noteId":"([0-9a-f]{24})"/;
|
|
517
517
|
return Array.from(document.querySelectorAll('div.note[data-impression], div.note')).slice(0, 3).map((card) => {
|
|
518
518
|
const impression = card.getAttribute('data-impression') || '';
|
|
@@ -521,7 +521,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
521
521
|
const dateText = (card.querySelector('.time_status, .time')?.innerText || '').trim();
|
|
522
522
|
return { id, title, dateText };
|
|
523
523
|
}).filter((entry) => entry.title);
|
|
524
|
-
})()`))}catch{return null}if(Array.isArray(
|
|
524
|
+
})()`))}catch{return null}if(Array.isArray(i)){const a=i.find((s)=>{const d=String(s.title||"").trim();if(!(d===o||d.startsWith(o)||o.startsWith(d)))return!1;const c=String(s.dateText||"").match(/(\d{4})年(\d{2})月(\d{2})日 (\d{2}):(\d{2})/);if(!c)return!0;const m=Date.UTC(Number(c[1]),Number(c[2])-1,Number(c[3]),Number(c[4]),Number(c[5]))-28800000;return Math.abs(Date.now()-m)<=93600000});if(a)return a}}return null}mt({site:"xiaohongshu",name:"publish",access:"write",description:"小红书发布图文笔记 (creator center UI automation)",domain:"creator.xiaohongshu.com",strategy:pt.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"content",required:!1,positional:!0,help:"笔记正文(字面文本,不会展开 @文件 引用;长正文建议用 --file)"},{name:"file",required:!1,help:"从本机文件读取笔记正文(UTF-8),与位置参数 <content> 二选一"},{name:"title",required:!0,help:"笔记标题 (最多20字)"},{name:"images",required:!1,help:"图片路径,逗号分隔,最多9张 (jpg/png/gif/webp)"},{name:"card-text",required:!1,help:`文字配图卡片文字,多张卡片用 ${G} 分隔,卡内换行用 \\n`},{name:"card-style",required:!1,help:`文字配图卡片样式,运行时按页面实际选项匹配;找不到会失败。省略时使用${S}。可选: ${X.map(([t,e])=>`${t}(${e})`).join(" ")}`},{name:"topics",required:!1,help:"话题标签,逗号分隔,不含 # 号。平台话题库匹配不上的会自动跳过并在结果中提示,不影响发布"},{name:"draft",type:"bool",default:!1,help:"保存为草稿,不直接发布"}],columns:["status","detail","url"],func:async(t,e)=>{if(!t)throw Error("Browser page required");const n=String(e.title??"").trim(),o=e.file?String(e.file).trim():"";let r=String(e.content??"").trim();if(o){if(r)throw new w("正文位置参数和 --file 只能二选一,不能同时给");const l=M.resolve(o);if(!D.existsSync(l))throw new w(`--file 指向的文件不存在: ${l}`);r=D.readFileSync(l,"utf-8").trim();if(!r)throw new w(`--file 指向的文件内容为空: ${l}`)}const i=e.images?String(e.images).split(",").map((l)=>l.trim()).filter(Boolean):[],a=e.topics?String(e.topics).split(",").map((l)=>l.trim()).filter(Boolean):[],s=Boolean(e.draft),d=e["card-text"]?String(e["card-text"]):"",c=d?d.split(G).map((l)=>l.trim()).filter(Boolean):[],m=e["card-style"]?String(e["card-style"]).trim():"",b=c.length>0;if(!n)throw new w("--title is required");if(n.length>z)throw new w(`Title is ${n.length} chars — must be ≤ ${z}`);if(!r)throw new w("缺少笔记正文:给位置参数 <content>(字面文本),或用 --file <本机文件路径>");bt(r,{fileFlag:"--file"});if(!b&&i.length===0)throw new w("Provide --card-text (text-image mode) or --images (upload mode); neither was given.");if(i.length>V)throw new w(`Too many images: ${i.length} (max ${V})`);if(b&&i.some((l)=>M.extname(l).toLowerCase()===".gif"))throw new w("文字配图模式追加的图片不支持 .gif(编辑器图片入口只接受 jpg/jpeg/png/webp)");const f=Tt(i);await t.goto(yt);await t.wait({time:1});await t.evaluate("() => { try { window.onbeforeunload = null; } catch (e) {} location.reload(); }").catch(()=>{return});let k="";for(let l=0;l<30;l++){await t.wait({time:0.5});k=await t.evaluate("() => location.href");if(k.includes("creator.xiaohongshu.com"))break}if(!k.includes("creator.xiaohongshu.com")){await t.screenshot({path:"/tmp/xhs_publish_redirect_debug.png"});throw Error(`Redirected away from creator center (landed on ${k}) — session may have expired. `+"Re-capture browser login via: ppcli xiaohongshu creator-profile. Debug screenshot: /tmp/xhs_publish_redirect_debug.png")}const E=await Ct(t);if((await Jt(t,E?.ok?5000:2000)).state==="video_surface"){await t.screenshot({path:"/tmp/xhs_publish_tab_debug.png"});const l=E?.ok?`clicked "${E.text}"`:`visible candidates: ${(E?.visibleTexts||[]).join(" | ")||"none"}`;throw Error("Still on the video publish page after trying to select 图文. "+`Details: ${l}. Debug screenshot: /tmp/xhs_publish_tab_debug.png`)}const A=await Ut(t);let C=m;if(b)C=await Bt(t,c,m);else{const l=typeof t.startNetworkCapture==="function"?await t.startNetworkCapture("").catch(()=>!1):!1,g=await tt(t,f);if(!g.ok){await t.screenshot({path:"/tmp/xhs_publish_upload_debug.png"});throw new u(`图片注入失败:${g.error??"unknown"}。`+"直接重新运行本 publish 命令即可(会自动重置发布页重传);请勿手动修改当前页面。"+"Debug: /tmp/xhs_publish_upload_debug.png")}await t.wait({time:K/1000});const x=await dt(t,f.length,l);if(!x.ok){await t.screenshot({path:"/tmp/xhs_publish_upload_debug.png"});throw new u(`图片上传未全部完成:只确认 ${x.completed}/${f.length} 张传到小红书 CDN,`+"继续发布会丢图(通常只剩封面)。直接重新运行本 publish 命令即可(会自动重置发布页重传);"+"请勿手动修改当前页面。Debug: /tmp/xhs_publish_upload_debug.png")}await et(t);if(A.length){await ct(t,A);await t.wait({time:0.5})}const N=await at(t);if(N&&typeof N.count==="number"&&N.count>f.length){await t.screenshot({path:"/tmp/xhs_publish_dup_debug.png"});throw new u(`清掉恢复态旧图后编辑器内仍有 ${N.count} 张图,超过本次注入的 ${f.length} 张。`+"直接重新运行本 publish 命令即可(会自动重置发布页);请勿手动修改当前页面。Debug: /tmp/xhs_publish_dup_debug.png")}}if(!await Ft(t)){await t.screenshot({path:"/tmp/xhs_publish_form_debug.png"});throw new u("Editing form did not appear after image acquisition. The page layout may have changed. Debug screenshot: /tmp/xhs_publish_form_debug.png")}if(b)await st(t,c.length,"文字配图 generated images");if(b&&f.length>0){const l=typeof t.startNetworkCapture==="function"?await t.startNetworkCapture("").catch(()=>!1):!1,g=await tt(t,f);if(!g.ok){await t.screenshot({path:"/tmp/xhs_publish_append_debug.png"});throw new u(`追加图片失败:${g.error??"unknown"}。`+"直接重新运行本 publish 命令即可(会自动重置发布页重传);请勿手动修改当前页面。"+"Debug: /tmp/xhs_publish_append_debug.png")}await t.wait({time:K/1000});const x=await dt(t,f.length,l);if(!x.ok){await t.screenshot({path:"/tmp/xhs_publish_append_debug.png"});throw new u(`追加图片上传未全部完成:只确认 ${x.completed}/${f.length} 张传到小红书 CDN。`+"直接重新运行本 publish 命令即可(会自动重置发布页重传);请勿手动修改当前页面。"+"Debug: /tmp/xhs_publish_append_debug.png")}await et(t);await st(t,c.length+f.length,"文字配图 appended images")}if(b&&A.length){await ct(t,A);await t.wait({time:0.5})}await nt(t,F,n,"title");await v(t,0.6);await nt(t,Q,r,"content");await v(t,0.6);let R=[],I=[];if(a.length){const l=await $t(t,Q,a);R=l.added;I=l.failed}await v(t,1,0.6);const O=await xt(t,["xhs-publish-btn"]);if(O){await gt(t,O.x,O.y);await v(t,0.4)}const U=s?["暂存离开","存草稿"]:["发布","发布笔记"],p=await t.evaluate(`
|
|
525
525
|
(cfg => {
|
|
526
526
|
const { isDraftMode, publishNames, draftNames, labels } = cfg;
|
|
527
527
|
const isVisible = (el) => {
|
|
@@ -560,8 +560,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
return { ok: false, via: 'none', hosts: hosts.length, lastMethodError };
|
|
563
|
-
})(${JSON.stringify({isDraftMode:
|
|
564
|
-
`);if(!
|
|
563
|
+
})(${JSON.stringify({isDraftMode:s,publishNames:_t,draftNames:vt,labels:U})})
|
|
564
|
+
`);if(!p?.ok){if(s){if(await t.evaluate(`
|
|
565
565
|
(() => {
|
|
566
566
|
const labels = ['返回', '关闭', '取消', '离开'];
|
|
567
567
|
const buttons = document.querySelectorAll('button, [role="button"], div, span');
|
|
@@ -574,7 +574,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
574
574
|
}
|
|
575
575
|
return false;
|
|
576
576
|
})()
|
|
577
|
-
`)){await
|
|
577
|
+
`)){await t.wait({time:1});const g=["暂存离开","存草稿","保存草稿"];if(await t.evaluate(`
|
|
578
578
|
(labels => {
|
|
579
579
|
const buttons = document.querySelectorAll('button, [role="button"]');
|
|
580
580
|
for (const btn of buttons) {
|
|
@@ -589,8 +589,8 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
return false;
|
|
592
|
-
})(${JSON.stringify(
|
|
593
|
-
`)){
|
|
592
|
+
})(${JSON.stringify(g)})
|
|
593
|
+
`)){p.ok=!0;p.via="leave-save-fallback"}}if(!p?.ok){await t.wait({time:2});if(await t.evaluate(`
|
|
594
594
|
() => {
|
|
595
595
|
const markers = ['草稿箱(', '保存于', '编辑于'];
|
|
596
596
|
for (const el of document.querySelectorAll('*')) {
|
|
@@ -599,7 +599,7 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
599
599
|
}
|
|
600
600
|
return false;
|
|
601
601
|
}
|
|
602
|
-
`)){
|
|
602
|
+
`)){p.ok=!0;p.via="auto-save"}}}}if(!p?.ok){await t.screenshot({path:"/tmp/xhs_publish_submit_debug.png"});const l=p?.via?` (via=${p.via})`:"",g=p?.error?`, error=${p.error}`:"",x=p?.lastMethodError?`, lastMethodError=${p.lastMethodError}`:"";throw Error(`未能触发「${U[0]}」按钮${l}${g}${x}。`+"直接重新运行本 publish 命令即可(会自动重置发布页);请勿手动修改当前页面。"+"Debug: /tmp/xhs_publish_submit_debug.png")}await t.wait({time:4});const _=await t.evaluate("() => location.href"),ft=s?["草稿已保存","暂存成功","保存成功","保存于","图文笔记("]:["发布成功","上传成功"],j=await t.evaluate(`
|
|
603
603
|
(markers => {
|
|
604
604
|
for (const el of document.querySelectorAll('*')) {
|
|
605
605
|
if (el.tagName === 'STYLE' || el.tagName === 'SCRIPT') continue;
|
|
@@ -608,5 +608,5 @@ import*as S from"node:fs";import*as R from"node:path";import{CommandExecutionErr
|
|
|
608
608
|
if (el.children.length === 0 && markers.some(marker => text.includes(marker))) return text;
|
|
609
609
|
}
|
|
610
610
|
return '';
|
|
611
|
-
})(${JSON.stringify(
|
|
612
|
-
`),
|
|
611
|
+
})(${JSON.stringify(ft)})
|
|
612
|
+
`),ht=!_.includes("/publish/publish");let q=j.length>0||ht;const P=s?"暂存成功":"发布成功";let y=null;if(!s){y=await Vt(t,n,q?4:8);if(y)q=!0}if(!q){if(s)throw new u(`${P}无法确认:未观察到成功提示或提交后跳转。`+(_?`当前 URL: ${_}。`:"当前 URL 为空。")+"先用 `xiaohongshu drafts` 查草稿箱确认是否已存上;确认没有再重新运行本命令,避免堆出重复草稿。");throw new u(`${P}无法确认:未观察到成功提示或提交后跳转,创作者后台也暂未查到同标题笔记。`+(_?`当前 URL: ${_}。`:"")+"注意:发布按钮已被触发,笔记仍可能延迟入库。禁止立即重发——请等 1-2 分钟后用 `xiaohongshu creator-notes` 回查本篇标题是否已出现;确认不存在后才重新运行本 publish 命令,否则会重复发布。")}return[{status:`✅ ${P}`,detail:[`"${n}"`,b?`${c.length}张文字配图${f.length?` + ${f.length}张图片`:""}${C&&C!==S?` (${C})`:""}`:`${f.length}张图片`,R.length?`话题: ${R.join(" ")}`:"",I.length?`⚠️ 话题未附上(已自动跳过,不影响发布): ${I.map((l)=>l.topic).join(" ")}`:"",y?.id?`笔记ID: ${y.id}`:"",j||(y?"已在创作者后台确认":"")||_||""].filter(Boolean).join(" · "),url:y?.id?`https://www.xiaohongshu.com/explore/${y.id}`:""}]}});
|