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,12 +1,12 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as w,Strategy as x}from"@jackwener/opencli/registry";import{extractJsonAssignmentFromHtml as v,parseVideoId as T,prepareYoutubeApiPage as b}from"./utils.js";import{groupTranscriptSegments as S,formatGroupedTranscript as A}from"./transcript-group.js";import{CommandExecutionError as c,EmptyResultError as h}from"@jackwener/opencli/errors";function m(e){if(e&&typeof e==="object"&&"session"in e&&"data"in e)return e.data;return e}function k(e,s,{allowNull:i=!1}={}){const a=m(e);if(a==null&&i)return null;if(Array.isArray(a))return a;if(a&&typeof a==="object"&&a.error)throw new c(String(a.error));throw new c(`Malformed ${s} payload`)}function C(e){let s;try{s=JSON.parse(e)}catch(a){throw new c(`Malformed json3 timedtext response: ${a?.message||a}`)}if(!Array.isArray(s?.events))throw new c("Malformed json3 timedtext response: missing events array");const i=[];for(const a of s.events){const l=Number(a?.tStartMs||0),d=Number(a?.dDurationMs||0),u=(Array.isArray(a?.segs)?a.segs:[]).map((n)=>n?.utf8||"").join("").replace(/\s+/g," ").trim();if(!u)continue;i.push({start:l/1000,end:(l+d)/1000,text:u})}return i}function R(e,s){if(!s)return!0;try{return new URL(e).searchParams.get("v")===s}catch{return!1}}function P(e,s,i){const a=m(e);if(!Array.isArray(a)||a.length===0)return{segments:[]};const l=String(s||"").toLowerCase(),d=l.split("-")[0],p=a.filter((n)=>{const t=String(n?.url||"");if(!t.includes("/api/timedtext"))return!1;if(!t.includes("fmt=json3")||!t.includes("pot="))return!1;if(!R(t,i))return!1;if(!l)return!0;try{const o=new URL(t),f=String(o.searchParams.get("lang")||"").toLowerCase(),y=f.split("-")[0];return f===l||y===d||d===f}catch{return!1}}).reverse();let u="";for(const n of p){const t=typeof n?.responsePreview==="string"?n.responsePreview:"";if(!t)continue;try{const o=C(t);if(o.length>0)return{segments:o}}catch(o){u=o?.message||String(o)}}return u?{error:u}:{segments:[]}}w({site:"youtube",name:"transcript",access:"read",description:"Get YouTube video transcript/subtitles",domain:"www.youtube.com",strategy:x.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"},{name:"lang",required:!1,help:"Language code (e.g. en, zh-Hans). Omit to auto-select"},{name:"mode",required:!1,default:"grouped",help:"Output mode: grouped (readable paragraphs) or raw (every segment)"}],func:async(e,s)=>{const i=T(s.url),a=s.lang||"",l=s.mode||"grouped",d="https://www.youtube.com/watch?v="+encodeURIComponent(i),p=typeof e.startNetworkCapture==="function"&&typeof e.readNetworkCapture==="function";if(p)try{await e.startNetworkCapture("/api/timedtext")}catch{}await e.goto(d,{waitUntil:"none"});await e.wait(3);const u=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const langPref = ${JSON.stringify(
|
|
3
|
+
const langPref = ${JSON.stringify(a)};
|
|
4
4
|
// Scope all timedtext URL matching to the current video. YouTube is an
|
|
5
5
|
// SPA, so watch→watch navigations preserve performance.getEntriesByType
|
|
6
6
|
// entries from prior videos. Without this check a stale same-language
|
|
7
7
|
// URL can be picked up by the polling loop before the current video's
|
|
8
8
|
// fetch hook fires, leaking the predecessor's captions.
|
|
9
|
-
const targetVideoId = ${JSON.stringify(
|
|
9
|
+
const targetVideoId = ${JSON.stringify(i)};
|
|
10
10
|
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
11
11
|
|
|
12
12
|
function textFromJson3Event(event) {
|
|
@@ -221,11 +221,11 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
221
221
|
if (OriginalXHR) globalThis.XMLHttpRequest = OriginalXHR;
|
|
222
222
|
}
|
|
223
223
|
})()
|
|
224
|
-
`);let
|
|
224
|
+
`);let n=k(u,"player caption extraction",{allowNull:!0});if(!n&&p)try{const r=P(await e.readNetworkCapture(),a,i);if(r.error)throw new c(r.error);if(r.segments.length>0)n=r.segments}catch(r){if(r instanceof c)throw r}if(!n)await b(e);const t=n?null:m(await e.evaluate(`
|
|
225
225
|
(async () => {
|
|
226
|
-
const extractJsonAssignmentFromHtml = ${
|
|
226
|
+
const extractJsonAssignmentFromHtml = ${v.toString()};
|
|
227
227
|
|
|
228
|
-
const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(
|
|
228
|
+
const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(i)}), {
|
|
229
229
|
credentials: 'include',
|
|
230
230
|
});
|
|
231
231
|
if (!watchResp.ok) return { error: 'Watch HTML returned HTTP ' + watchResp.status };
|
|
@@ -242,7 +242,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
242
242
|
const tracks = renderer.captionTracks;
|
|
243
243
|
const available = tracks.map(t => t.languageCode + (t.kind === 'asr' ? ' (auto)' : ''));
|
|
244
244
|
|
|
245
|
-
const langPref = ${JSON.stringify(
|
|
245
|
+
const langPref = ${JSON.stringify(a)};
|
|
246
246
|
let track = null;
|
|
247
247
|
if (langPref) {
|
|
248
248
|
track = tracks.find(t => t.languageCode === langPref)
|
|
@@ -262,7 +262,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
262
262
|
langPrefixMatched: !!(langPref && track.languageCode !== langPref && track.languageCode.startsWith(langPref))
|
|
263
263
|
};
|
|
264
264
|
})()
|
|
265
|
-
`));if(!
|
|
265
|
+
`));if(!n&&(!t||typeof t!=="object"||Array.isArray(t)))throw new c(`Failed to get caption info: ${typeof t==="string"?t:"malformed response"}`);if(t?.error){const r=`${t.error}${t.available?" (available: "+t.available.join(", ")+")":""}`;if(t.error==="No captions available for this video")throw new h("youtube transcript","该视频没有字幕(作者未开启 + 无自动字幕)。");throw new c(r)}if(!n&&typeof t?.captionUrl!=="string")throw new c("Malformed caption info payload");if(t?.requestedLang&&!t.langMatched&&!t.langPrefixMatched)console.error(`Warning: --lang "${t.requestedLang}" not found. Using "${t.language}" instead. Available: ${t.available.join(", ")}`);if(!n){const r=t.captionUrl;let g=r;if(!/[&?]fmt=/.test(r))g=r+(r.includes("?")?"&":"?")+"fmt=srv3";n=k(await e.evaluate(`
|
|
266
266
|
(async () => {
|
|
267
267
|
async function fetchCaptionXml(url) {
|
|
268
268
|
const resp = await fetch(url);
|
|
@@ -270,8 +270,8 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
270
270
|
return { xml: await resp.text() || '' };
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
const primaryUrl = ${JSON.stringify(
|
|
274
|
-
const originalUrl = ${JSON.stringify(
|
|
273
|
+
const primaryUrl = ${JSON.stringify(g)};
|
|
274
|
+
const originalUrl = ${JSON.stringify(r)};
|
|
275
275
|
let result = await fetchCaptionXml(primaryUrl);
|
|
276
276
|
if (result.error) return result;
|
|
277
277
|
|
|
@@ -350,7 +350,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
350
350
|
|
|
351
351
|
return results;
|
|
352
352
|
})()
|
|
353
|
-
`),"caption XML extraction")}if(
|
|
353
|
+
`),"caption XML extraction")}if(n.length===0)throw new h("youtube transcript");let o=[];if(l==="grouped")try{const r=m(await e.evaluate(`
|
|
354
354
|
(async () => {
|
|
355
355
|
const cfg = window.ytcfg?.data_ || {};
|
|
356
356
|
const apiKey = cfg.INNERTUBE_API_KEY;
|
|
@@ -362,7 +362,7 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
362
362
|
headers: { 'Content-Type': 'application/json' },
|
|
363
363
|
body: JSON.stringify({
|
|
364
364
|
context: { client: { clientName: 'WEB', clientVersion: '2.20240101.00.00' } },
|
|
365
|
-
videoId: ${JSON.stringify(
|
|
365
|
+
videoId: ${JSON.stringify(i)}
|
|
366
366
|
})
|
|
367
367
|
});
|
|
368
368
|
if (!resp.ok) return [];
|
|
@@ -414,4 +414,4 @@ import{cli as T,Strategy as Y}from"@jackwener/opencli/registry";import{extractJs
|
|
|
414
414
|
}
|
|
415
415
|
return chapters;
|
|
416
416
|
})()
|
|
417
|
-
`));if(Array.isArray(
|
|
417
|
+
`));if(Array.isArray(r))o=r}catch{}if(l==="raw")return n.map((r,g)=>({index:g+1,start:Number(r.start).toFixed(2)+"s",end:Number(r.end).toFixed(2)+"s",text:r.text}));const f=S(n.map((r)=>({start:r.start,text:r.text}))),{rows:y}=A(f,o);return y}});
|
package/clis/youtube/unlike.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as a,Strategy as u}from"@jackwener/opencli/registry";import{parseVideoId as n,prepareYoutubeApiPage as c,readYoutubeSapisid as d,SAPISID_HASH_FN as g}from"./utils.js";import{CommandExecutionError as m,AuthRequiredError as s}from"@jackwener/opencli/errors";a({site:"youtube",name:"unlike",access:"write",description:"Remove like from a YouTube video",domain:"www.youtube.com",strategy:u.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"}],columns:["status","message"],func:async(e,i)=>{const r=n(String(i.url));await c(e);const o=await d(e);if(!o)throw new s("www.youtube.com","Not logged in (SAPISID cookie missing)");const t=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
${
|
|
3
|
+
${g}
|
|
4
4
|
|
|
5
5
|
const cfg = window.ytcfg?.data_ || {};
|
|
6
6
|
const apiKey = cfg.INNERTUBE_API_KEY;
|
|
7
7
|
const context = cfg.INNERTUBE_CONTEXT;
|
|
8
8
|
if (!apiKey || !context) return { error: 'config', message: 'YouTube config not found' };
|
|
9
9
|
|
|
10
|
-
const authHash = await getSapisidHash(${JSON.stringify(
|
|
10
|
+
const authHash = await getSapisidHash(${JSON.stringify(o)}, 'https://www.youtube.com');
|
|
11
11
|
if (!authHash) return { error: 'auth', message: 'Not logged in (SAPISID cookie missing)' };
|
|
12
12
|
|
|
13
13
|
const resp = await fetch('/youtubei/v1/like/removelike?key=' + apiKey + '&prettyPrint=false', {
|
|
@@ -18,7 +18,7 @@ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{parseVide
|
|
|
18
18
|
'Authorization': authHash,
|
|
19
19
|
'X-Origin': 'https://www.youtube.com',
|
|
20
20
|
},
|
|
21
|
-
body: JSON.stringify({ context, target: { videoId: ${JSON.stringify(
|
|
21
|
+
body: JSON.stringify({ context, target: { videoId: ${JSON.stringify(r)} } }),
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
if (resp.status === 401 || resp.status === 403) return { error: 'auth', message: 'Not logged in' };
|
|
@@ -30,4 +30,4 @@ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{parseVide
|
|
|
30
30
|
}
|
|
31
31
|
return { ok: true };
|
|
32
32
|
})()
|
|
33
|
-
`);if(
|
|
33
|
+
`);if(t?.error==="auth")throw new s("www.youtube.com");if(t?.error)throw new m(t.message||"Failed to remove like");return[{status:"success",message:"Unliked: "+r}]}});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as o,Strategy as i}from"@jackwener/opencli/registry";import{prepareYoutubeApiPage as u,readYoutubeSapisid as c,SAPISID_HASH_FN as h,RESOLVE_CHANNEL_HANDLE_FN as d}from"./utils.js";import{CommandExecutionError as l,AuthRequiredError as n}from"@jackwener/opencli/errors";o({site:"youtube",name:"unsubscribe",access:"write",description:"Unsubscribe from a YouTube channel",domain:"www.youtube.com",strategy:i.COOKIE,args:[{name:"channel",required:!0,positional:!0,help:"Channel ID (UCxxxx) or handle (@name)"}],columns:["status","message"],func:async(t,a)=>{const r=String(a.channel);await u(t);const s=await c(t);if(!s)throw new n("www.youtube.com","Not logged in (SAPISID cookie missing)");const e=await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
${
|
|
3
|
+
${h}
|
|
4
4
|
|
|
5
5
|
const cfg = window.ytcfg?.data_ || {};
|
|
6
6
|
const apiKey = cfg.INNERTUBE_API_KEY;
|
|
7
7
|
const context = cfg.INNERTUBE_CONTEXT;
|
|
8
8
|
if (!apiKey || !context) return { error: 'config', message: 'YouTube config not found' };
|
|
9
9
|
|
|
10
|
-
const authHash = await getSapisidHash(${JSON.stringify(
|
|
10
|
+
const authHash = await getSapisidHash(${JSON.stringify(s)}, 'https://www.youtube.com');
|
|
11
11
|
if (!authHash) return { error: 'auth', message: 'Not logged in (SAPISID cookie missing)' };
|
|
12
12
|
|
|
13
|
-
${
|
|
13
|
+
${d}
|
|
14
14
|
|
|
15
|
-
let channelId = ${JSON.stringify(
|
|
15
|
+
let channelId = ${JSON.stringify(r)};
|
|
16
16
|
channelId = await resolveChannelHandle(channelId, apiKey, context);
|
|
17
17
|
|
|
18
18
|
if (!channelId.startsWith('UC')) {
|
|
19
|
-
return { error: 'arg', message: 'Could not resolve channel ID from: ' + ${JSON.stringify(
|
|
19
|
+
return { error: 'arg', message: 'Could not resolve channel ID from: ' + ${JSON.stringify(r)} };
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const resp = await fetch('/youtubei/v1/subscription/unsubscribe?key=' + apiKey + '&prettyPrint=false', {
|
|
@@ -39,4 +39,4 @@ import{cli as T,Strategy as U}from"@jackwener/opencli/registry";import{prepareYo
|
|
|
39
39
|
}
|
|
40
40
|
return { ok: true, channelId };
|
|
41
41
|
})()
|
|
42
|
-
`);if(
|
|
42
|
+
`);if(e?.error==="auth")throw new n("www.youtube.com");if(e?.error)throw new l(e.message||"Failed to unsubscribe");return[{status:"success",message:"Unsubscribed from: "+(e.channelId||r)}]}});
|
package/clis/youtube/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function parseVideoId(
|
|
1
|
+
export function parseVideoId(n){if(!n.startsWith("http"))return n;try{const e=new URL(n);if(e.searchParams.has("v"))return e.searchParams.get("v");if(e.hostname==="youtu.be")return e.pathname.slice(1).split("/")[0];const t=e.pathname.match(/^\/(shorts|embed|live|v)\/([^/?]+)/);if(t)return t[2]}catch{}return n}export function extractJsonAssignmentFromHtml(n,e){const t=Array.isArray(e)?e:[e];for(const i of t){const c=[`var ${i} = `,`window["${i}"] = `,`window.${i} = `,`${i} = `];for(const u of c){const s=n.indexOf(u);if(s===-1)continue;const o=n.indexOf("{",s+u.length);if(o===-1)continue;let p=0,d=!1,l=!1;for(let r=o;r<n.length;r+=1){const a=n[r];if(d){if(l)l=!1;else if(a==="\\")l=!0;else if(a==='"')d=!1;continue}if(a==='"'){d=!0;continue}if(a==="{"){p+=1;continue}if(a==="}"){p-=1;if(p===0)try{return JSON.parse(n.slice(o,r+1))}catch{break}}}}}return null}export async function prepareYoutubeApiPage(n){await n.goto("https://www.youtube.com",{waitUntil:"none"});await n.wait(2)}export const FETCH_BROWSE_FN=`
|
|
2
2
|
async function fetchBrowse(apiKey, body) {
|
|
3
3
|
const resp = await fetch('/youtubei/v1/browse?key=' + apiKey + '&prettyPrint=false', {
|
|
4
4
|
method: 'POST',
|
|
@@ -9,7 +9,7 @@ async function fetchBrowse(apiKey, body) {
|
|
|
9
9
|
if (!resp.ok) return { error: 'InnerTube browse API returned HTTP ' + resp.status };
|
|
10
10
|
return resp.json();
|
|
11
11
|
}
|
|
12
|
-
`;export function extractPlaylistVideos(
|
|
12
|
+
`;export function extractPlaylistVideos(n){return n.filter((e)=>e.playlistVideoRenderer).map((e)=>{const t=e.playlistVideoRenderer,i=t.videoInfo?.runs||[];return{rank:parseInt(t.index?.simpleText||"0",10),title:t.title?.runs?.[0]?.text||"",channel:t.shortBylineText?.runs?.[0]?.text||"",duration:t.lengthText?.simpleText||"",views:i[0]?.text||"",published:i[2]?.text||"",url:"https://www.youtube.com/watch?v="+t.videoId}})}export function extractSubscriptionChannel(n){const e=(r)=>{if(!r)return"";if(typeof r.simpleText==="string")return r.simpleText.trim();if(Array.isArray(r.runs))return r.runs.map((a)=>a?.text||"").join("").trim();return""},t=n||{},i=e(t.title),c=t.navigationEndpoint?.browseEndpoint?.canonicalBaseUrl||"",u=t.channelId||t.navigationEndpoint?.browseEndpoint?.browseId||"",s=e(t.subscriberCountText),o=e(t.videoCountText),p=[e(t.channelHandleText),c.startsWith("/@")?c.slice(1):"",s.startsWith("@")?s:"",o.startsWith("@")?o:""].find(Boolean)||"",d=[!s.startsWith("@")?s:"",!o.startsWith("@")?o:""].find(Boolean)||"",l=c?"https://www.youtube.com"+c:u?"https://www.youtube.com/channel/"+u:"";return{name:i,handle:p,subscribers:d,url:l}}export const RESOLVE_CHANNEL_HANDLE_FN=`
|
|
13
13
|
async function resolveChannelHandle(input, apiKey, context) {
|
|
14
14
|
if (!input.startsWith('@')) return input;
|
|
15
15
|
const resp = await fetch('/youtubei/v1/navigation/resolve_url?key=' + apiKey + '&prettyPrint=false', {
|
|
@@ -31,4 +31,4 @@ async function getSapisidHash(sapisid, origin) {
|
|
|
31
31
|
const hashHex = Array.from(new Uint8Array(hashBuffer)).map(b => b.toString(16).padStart(2, '0')).join('');
|
|
32
32
|
return 'SAPISIDHASH ' + time + '_' + hashHex;
|
|
33
33
|
}
|
|
34
|
-
`;export async function readYoutubeSapisid(
|
|
34
|
+
`;export async function readYoutubeSapisid(n){const e=await n.getCookies({url:"https://www.youtube.com"});return e.find((t)=>t.name==="__Secure-3PAPISID")?.value||e.find((t)=>t.name==="SAPISID")?.value||null}
|
package/clis/youtube/video.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as c}from"@jackwener/opencli/registry";import{extractJsonAssignmentFromHtml as d,parseVideoId as u,prepareYoutubeApiPage as m}from"./utils.js";import{CommandExecutionError as o}from"@jackwener/opencli/errors";function y(t){if(t&&typeof t==="object"&&"session"in t&&"data"in t)return t.data;return t}function p(t){const e=y(t);if(!e||typeof e!=="object"||Array.isArray(e))throw new o("Failed to extract video metadata from page");if(e.error)throw new o(String(e.error));if(typeof e.playabilityStatus!=="string")throw new o("YouTube video metadata is missing playabilityStatus");if(typeof e.playabilityReason!=="string")throw new o("YouTube video metadata is missing playabilityReason");if(typeof e.membersOnly!=="boolean")throw new o("YouTube video metadata is missing membersOnly");return e}l({site:"youtube",name:"video",access:"read",description:"Get YouTube video metadata (title, views, description, etc.)",domain:"www.youtube.com",strategy:c.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"YouTube video URL or video ID"}],columns:["field","value"],func:async(t,e)=>{const i=u(e.url);await m(t);const n=await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const extractJsonAssignmentFromHtml = ${
|
|
3
|
+
const extractJsonAssignmentFromHtml = ${d.toString()};
|
|
4
4
|
|
|
5
|
-
const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(
|
|
5
|
+
const watchResp = await fetch('/watch?v=' + encodeURIComponent(${JSON.stringify(i)}), {
|
|
6
6
|
credentials: 'include',
|
|
7
7
|
});
|
|
8
8
|
if (!watchResp.ok) return { error: 'Watch HTML returned HTTP ' + watchResp.status };
|
|
@@ -93,4 +93,4 @@ import{cli as O,Strategy as Q}from"@jackwener/opencli/registry";import{extractJs
|
|
|
93
93
|
membersOnly,
|
|
94
94
|
};
|
|
95
95
|
})()
|
|
96
|
-
`),
|
|
96
|
+
`),s=p(n);return Object.entries(s).map(([a,r])=>({field:a,value:String(r)}))}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as a,Strategy as r}from"@jackwener/opencli/registry";import{FETCH_BROWSE_FN as c,extractPlaylistVideos as l}from"./utils.js";import{CommandExecutionError as n,EmptyResultError as d}from"@jackwener/opencli/errors";a({site:"youtube",name:"watch-later",access:"read",description:"Get your YouTube Watch Later queue",domain:"www.youtube.com",strategy:r.COOKIE,args:[{name:"limit",type:"int",default:50,help:"Max videos to return (default 50, max 200)"}],columns:["rank","title","channel","duration","views","published","url"],func:async(e,o)=>{const i=Math.min(o.limit||50,200);await e.goto("https://www.youtube.com/playlist?list=WL");await e.wait(3);const t=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const d = window.ytInitialData;
|
|
4
4
|
if (!d) return { error: 'YouTube data not found — are you logged in?' };
|
|
@@ -37,5 +37,5 @@ import{cli as s,Strategy as r}from"@jackwener/opencli/registry";import{FETCH_BRO
|
|
|
37
37
|
|
|
38
38
|
return { title, stats, videos: videos.slice(0, limit) };
|
|
39
39
|
})()
|
|
40
|
-
`);if(!t||typeof t!=="object")throw new n("Failed to fetch Watch Later — make sure you are logged into YouTube");if(t.error)throw new n(String(t.error));if(!t.videos?.length)throw new d("youtube watch-later");const
|
|
40
|
+
`);if(!t||typeof t!=="object")throw new n("Failed to fetch Watch Later — make sure you are logged into YouTube");if(t.error)throw new n(String(t.error));if(!t.videos?.length)throw new d("youtube watch-later");const s=(t.stats||[]).join(" | ");process.stderr.write(`${t.title} ${s}
|
|
41
41
|
`);return t.videos}});
|
package/clis/yuanbao/ask.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as w,Strategy as y}from"@jackwener/opencli/registry";import{htmlToMarkdown as S}from"@jackwener/opencli/utils";import{ArgumentError as A,CommandExecutionError as x,TimeoutError as T}from"@jackwener/opencli/errors";import{YUANBAO_DOMAIN as L,IS_VISIBLE_JS as u,authRequired as f,isOnYuanbao as E,ensureYuanbaoPage as Y,hasLoginGate as m,normalizeBooleanFlag as b,sendYuanbaoMessage as C}from"./shared.js";const v=2,k=8000,M=3;function q(e,n){const t=n?` Detail: ${n}`:"";return new x(`${e||"Unknown Yuanbao send failure."}${t}`,"Make sure the Yuanbao chat composer is visible and ready before retrying.")}function h(e){return typeof e==="string"?e.trim():""}export function convertYuanbaoHtmlToMarkdown(e){return S(e,(n)=>{n.addRule("table",{filter:"table",replacement:(t)=>`
|
|
2
2
|
|
|
3
|
-
${
|
|
3
|
+
${t}
|
|
4
4
|
|
|
5
|
-
`});
|
|
6
|
-
`;if(!
|
|
7
|
-
`;return`${
|
|
5
|
+
`});n.addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:(t)=>t});n.addRule("tableRow",{filter:"tr",replacement:(t,o)=>{const a=o,r=Array.from(a.children),l=a.parentElement?.tagName==="THEAD"||r.length>0&&r.every((c)=>c.tagName==="TH"),i=`${t}
|
|
6
|
+
`;if(!l)return i;const s=`| ${r.map(()=>"---").join(" | ")} |
|
|
7
|
+
`;return`${i}${s}`}});n.addRule("tableCell",{filter:["th","td"],replacement:(t,o)=>{const a=o;return`${(a.parentElement?Array.from(a.parentElement.children).indexOf(a):0)===0?"| ":" "}${t.trim()} |`}})})}export function sanitizeYuanbaoResponseText(e,n){let t=e.replace(/内容由AI生成,仅供参考/gi,"").replace(/重新回答/gi,"").trim();if(/^(正在搜索资料|搜索资料中|正在思考|思考中)[.。…]*$/u.test(t))return"";const o=n.trim();if(!o)return t;if(t===o)return"";for(const a of[`
|
|
8
8
|
|
|
9
9
|
`,`
|
|
10
10
|
`,`\r
|
|
11
11
|
\r
|
|
12
12
|
`,`\r
|
|
13
|
-
`," "]){const
|
|
14
|
-
`).trim()}export function pickLatestYuanbaoAssistantCandidate(
|
|
13
|
+
`," "]){const r=`${o}${a}`;if(t.startsWith(r)){t=t.slice(r.length).trim();break}}return t}export function collectYuanbaoTranscriptAdditions(e,n,t){const o=new Set(e);return n.filter((r)=>!o.has(r)).map((r)=>sanitizeYuanbaoResponseText(r,t)).filter((r)=>r&&r!==t).join(`
|
|
14
|
+
`).trim()}export function pickLatestYuanbaoAssistantCandidate(e,n,t){const o=e.slice(Math.max(0,n)).map((a)=>sanitizeYuanbaoResponseText(a,t)).filter(Boolean);for(let a=o.length-1;a>=0;a-=1)if(o[a]!==t.trim())return o[a];return""}export function updateStableState(e,n,t){if(!t)return{previousText:"",stableCount:0};if(t===e)return{previousText:e,stableCount:n+1};return{previousText:t,stableCount:0}}function N(){return`
|
|
15
15
|
(() => {
|
|
16
16
|
const clean = (value) => (value || '')
|
|
17
17
|
.replace(/\\u00a0/g, ' ')
|
|
@@ -82,8 +82,8 @@ ${q}
|
|
|
82
82
|
&& !stopLines.has(line)
|
|
83
83
|
&& !noisyPatterns.some((pattern) => pattern.test(line)));
|
|
84
84
|
})()
|
|
85
|
-
`}async function
|
|
86
|
-
${
|
|
85
|
+
`}async function _(e){const n=await e.evaluate(N());return Array.isArray(n)?n.map(h).filter(Boolean):[]}async function g(e){const n=await e.evaluate(`(() => {
|
|
86
|
+
${u}
|
|
87
87
|
|
|
88
88
|
const roots = Array.from(document.querySelectorAll('.agent-chat__list__item--ai'))
|
|
89
89
|
.filter((node) => isVisible(node));
|
|
@@ -101,8 +101,8 @@ ${q}
|
|
|
101
101
|
|
|
102
102
|
return root instanceof HTMLElement ? (root.innerHTML || root.textContent || '') : '';
|
|
103
103
|
}).filter(Boolean);
|
|
104
|
-
})()`);return Array.isArray(
|
|
105
|
-
${
|
|
104
|
+
})()`);return Array.isArray(n)?n.map((t)=>convertYuanbaoHtmlToMarkdown(typeof t==="string"?t:"")).map(h).filter(Boolean):[]}async function R(e){return await e.evaluate(`(() => {
|
|
105
|
+
${u}
|
|
106
106
|
|
|
107
107
|
const button = Array.from(document.querySelectorAll('[dt-button-id="internet_search"]'))
|
|
108
108
|
.find((node) => isVisible(node));
|
|
@@ -115,15 +115,15 @@ ${q}
|
|
|
115
115
|
found: true,
|
|
116
116
|
enabled: attr === 'openInternetSearch' || className.includes('index_v2_active__'),
|
|
117
117
|
};
|
|
118
|
-
})()`)}async function
|
|
119
|
-
${
|
|
118
|
+
})()`)}async function I(e,n){const t=await R(e);if(!t.found||t.enabled===n)return;await e.evaluate(`(() => {
|
|
119
|
+
${u}
|
|
120
120
|
|
|
121
121
|
const button = Array.from(document.querySelectorAll('[dt-button-id="internet_search"]'))
|
|
122
122
|
.find((node) => isVisible(node));
|
|
123
123
|
|
|
124
124
|
if (button instanceof HTMLElement) button.click();
|
|
125
|
-
})()`);await
|
|
126
|
-
${
|
|
125
|
+
})()`);await e.wait(0.5)}async function B(e){return await e.evaluate(`(() => {
|
|
126
|
+
${u}
|
|
127
127
|
|
|
128
128
|
const button = Array.from(document.querySelectorAll('[dt-button-id="deep_think"]'))
|
|
129
129
|
.find((node) => isVisible(node));
|
|
@@ -135,11 +135,11 @@ ${q}
|
|
|
135
135
|
found: true,
|
|
136
136
|
enabled: className.includes('ThinkSelector_selected__'),
|
|
137
137
|
};
|
|
138
|
-
})()`)}async function
|
|
139
|
-
${
|
|
138
|
+
})()`)}async function H(e,n){const t=await B(e);if(!t.found||t.enabled===n)return;await e.evaluate(`(() => {
|
|
139
|
+
${u}
|
|
140
140
|
|
|
141
141
|
const button = Array.from(document.querySelectorAll('[dt-button-id="deep_think"]'))
|
|
142
142
|
.find((node) => isVisible(node));
|
|
143
143
|
|
|
144
144
|
if (button instanceof HTMLElement) button.click();
|
|
145
|
-
})()`);await
|
|
145
|
+
})()`);await e.wait(0.5)}async function O(e,n,t,o,a){const r=Date.now();let l="",i=0,s="";while(Date.now()-r<a*1000){await e.wait(v);if(await m(e))return"blocked";const c=await g(e),d=pickLatestYuanbaoAssistantCandidate(c,n,o)||collectYuanbaoTranscriptAdditions(t,await _(e),o);if(!d)continue;s=d;const p=updateStableState(l,i,d);l=p.previousText;i=p.stableCount;if(Date.now()-r>=k&&i>=M)return d}return s||null}export const askCommand=w({site:"yuanbao",name:"ask",access:"write",description:"Send a prompt to Yuanbao web chat and wait for the assistant response",domain:L,strategy:y.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,defaultFormat:"plain",args:[{name:"prompt",fromFile:!0,required:!0,positional:!0,help:"Prompt to send"},{name:"timeout",type:"int",required:!1,help:"Max seconds to wait (default: 60)",default:60},{name:"search",type:"boolean",required:!1,help:"Enable Yuanbao internet search (default: true)",default:!0},{name:"think",type:"boolean",required:!1,help:"Enable Yuanbao deep thinking (default: false)",default:!1}],columns:["Role","Text"],func:async(e,n)=>{const{prompt:t,timeout:o}=n;if(!Number.isInteger(o)||o<1)throw new A("--timeout must be a positive integer (seconds)");const a=b(n.search,!0),r=b(n.think,!1);await Y(e);if(await m(e))throw f("Yuanbao opened a login gate before sending the prompt.");await I(e,a);await H(e,r);const l=await g(e),i=await _(e),s=await C(e,t);if(!s?.ok){if(await m(e))throw f("Yuanbao opened a login gate instead of accepting the prompt.");throw q(s?.reason,s?.detail)}const c=await O(e,l.length,i,t,o);if(c==="blocked")throw f("Yuanbao opened a login gate instead of returning a chat response.");if(!c)throw new T("yuanbao ask",o,"No Yuanbao response was observed before the timeout. Retry with --timeout, and verify the current browser session is still interactive.");return[{Role:"User",Text:t},{Role:"Assistant",Text:c}]}}),__test__={collectYuanbaoTranscriptAdditions,convertYuanbaoHtmlToMarkdown,isOnYuanbao:E,normalizeBooleanFlag:b,pickLatestYuanbaoAssistantCandidate,sanitizeYuanbaoResponseText,updateStableState};
|
package/clis/yuanbao/detail.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{EmptyResultError as d}from"@jackwener/opencli/errors";import{YUANBAO_DOMAIN as h,YUANBAO_URL as m,getYuanbaoMessageBubbles as g,parseYuanbaoSessionId as w,hasLoginGate as b,authRequired as I}from"./shared.js";import{convertYuanbaoHtmlToMarkdown as f}from"./ask.js";u({site:"yuanbao",name:"detail",access:"read",description:"Open a Yuanbao conversation by ID and read its messages",domain:h,strategy:c.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[{name:"id",positional:!0,required:!0,help:'Full https://yuanbao.tencent.com/chat/<agentId>/<convId> URL or "<agentId>/<convId>" pair (a UUID alone is not enough — Yuanbao requires the agent slug)'}],columns:["Role","Text"],func:async(e,s)=>{const{agentId:o,convId:n}=w(s.id);await e.goto(`${m}chat/${o}/${n}`,{waitUntil:"load",settleMs:2500});await e.wait(2);if(await b(e))throw I("Yuanbao opened a login gate when navigating to the conversation.");let a=[];const i=20000,r=1,l=Date.now();while(Date.now()-l<i){a=await g(e);if(a.length>0)break;await e.wait(r)}if(!a.length)throw new d("yuanbao detail",`No visible messages found for conversation ${o}/${n}. Verify the IDs are correct and that the session belongs to the current login.`);return a.map((t)=>({Role:t.role,Text:t.role==="Assistant"&&t.html?f(t.html).trim()||t.text:t.text}))}});
|
package/clis/yuanbao/read.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as s,Strategy as r}from"@jackwener/opencli/registry";import{YUANBAO_DOMAIN as o,ensureYuanbaoPage as n,getYuanbaoMessageBubbles as i}from"./shared.js";import{convertYuanbaoHtmlToMarkdown as m}from"./ask.js";s({site:"yuanbao",name:"read",access:"read",description:"Read messages in the current Yuanbao conversation",domain:o,strategy:r.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Role","Text"],func:async(t)=>{await n(t);await t.wait(1.5);const a=await i(t);if(!a.length)return[{Role:"system",Text:"No visible messages in the current Yuanbao conversation."}];return a.map((e)=>({Role:e.role,Text:e.role==="Assistant"&&e.html?m(e.html).trim()||e.text:e.text}))}});
|
package/clis/yuanbao/shared.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as i,AuthRequiredError as l}from"@jackwener/opencli/errors";export const YUANBAO_DOMAIN="yuanbao.tencent.com",YUANBAO_URL="https://yuanbao.tencent.com/";const d="Likely login/auth/challenge/session issue in the existing yuanbao.tencent.com browser session.",s=/^[A-Za-z0-9_-]{4,40}$/,c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;export const IS_VISIBLE_JS=`const isVisible = (node) => {
|
|
2
2
|
if (!(node instanceof HTMLElement)) return false;
|
|
3
3
|
const rect = node.getBoundingClientRect();
|
|
4
4
|
const style = window.getComputedStyle(node);
|
|
@@ -6,20 +6,20 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
|
|
|
6
6
|
&& rect.height > 0
|
|
7
7
|
&& style.display !== 'none'
|
|
8
8
|
&& style.visibility !== 'hidden';
|
|
9
|
-
};`;export function authRequired(
|
|
9
|
+
};`;export function authRequired(t){return new l(YUANBAO_DOMAIN,`${t} ${d}`)}export function normalizeBooleanFlag(t,e=!1){if(typeof t==="boolean")return t;if(t==null||t==="")return e;const n=String(t).trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"}export async function isOnYuanbao(t){const e=await t.evaluate("window.location.href").catch(()=>"");if(typeof e!=="string"||!e)return!1;try{const n=new URL(e).hostname;return n===YUANBAO_DOMAIN||n.endsWith(`.${YUANBAO_DOMAIN}`)}catch{return!1}}export async function ensureYuanbaoPage(t){if(!await isOnYuanbao(t)){await t.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await t.wait(1)}}export async function hasLoginGate(t){const e=await t.evaluate(`(() => {
|
|
10
10
|
const bodyText = document.body.innerText || '';
|
|
11
11
|
const hasWechatLoginText = bodyText.includes('微信扫码登录');
|
|
12
12
|
const hasWechatIframe = Array.from(document.querySelectorAll('iframe'))
|
|
13
13
|
.some((frame) => (frame.getAttribute('src') || '').includes('open.weixin.qq.com/connect/qrconnect'));
|
|
14
14
|
|
|
15
15
|
return hasWechatLoginText || hasWechatIframe;
|
|
16
|
-
})()`);return Boolean(
|
|
16
|
+
})()`);return Boolean(e)}export async function isLoggedIn(t){return!await hasLoginGate(t)}export function parseYuanbaoSessionId(t){const e=String(t??"").trim();if(!e)throw new i("id",'must be a non-empty Yuanbao chat URL or "<agentId>/<convId>" pair');const n=e.match(/yuanbao\.tencent\.com\/chat\/([A-Za-z0-9_-]+)\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[/?#]|$)/i);if(n){const[,o,r]=n;if(!s.test(o)||!c.test(r))throw new i("id",`not a valid Yuanbao chat URL (got "${t}"); expected https://yuanbao.tencent.com/chat/<agentId>/<convId>`);return{agentId:o,convId:r.toLowerCase()}}const a=e.match(/^([A-Za-z0-9_-]+)\/([0-9a-f-]{36})$/i);if(a){const[,o,r]=a;if(!s.test(o)||!c.test(r))throw new i("id",`not a valid Yuanbao "<agentId>/<convId>" pair (got "${t}"); agentId must be 4-40 word chars, convId must be a UUID`);return{agentId:o,convId:r.toLowerCase()}}throw new i("id",`not a valid Yuanbao session reference (got "${t}"); pass either a full https://yuanbao.tencent.com/chat/<agentId>/<convId> URL or a bare "<agentId>/<convId>" pair. A UUID alone is not enough — Yuanbao requires the agentId.`)}export async function getCurrentYuanbaoSessionId(t){const e=await t.evaluate("window.location.href").catch(()=>"");if(typeof e!=="string")return null;const n=e.match(/yuanbao\.tencent\.com\/chat\/([A-Za-z0-9_-]+)\/([0-9a-f-]{36})(?:[/?#]|$)/i);if(!n)return null;const[,a,o]=n;if(!s.test(a)||!c.test(o))return null;return{agentId:a,convId:o.toLowerCase()}}export async function getYuanbaoModelLabel(t){const e=await t.evaluate(`(() => {
|
|
17
17
|
const btn = document.querySelector('[dt-button-id="model_switch"]');
|
|
18
18
|
if (!(btn instanceof HTMLElement)) return null;
|
|
19
19
|
const label = (btn.querySelector('.t-button__text')?.textContent || btn.textContent || '').trim();
|
|
20
20
|
const modelId = btn.getAttribute('dt-model-id') || '';
|
|
21
21
|
return { label, modelId };
|
|
22
|
-
})()`);if(!
|
|
22
|
+
})()`);if(!e||typeof e!=="object")return{label:null,modelId:null};return{label:typeof e.label==="string"&&e.label?e.label:null,modelId:typeof e.modelId==="string"&&e.modelId?e.modelId:null}}export async function getYuanbaoMessageBubbles(t){const e=await t.evaluate(`(() => {
|
|
23
23
|
${IS_VISIBLE_JS}
|
|
24
24
|
const items = Array.from(document.querySelectorAll('.agent-chat__list__item--human, .agent-chat__list__item--ai'))
|
|
25
25
|
.filter((node) => isVisible(node));
|
|
@@ -48,7 +48,7 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
|
|
|
48
48
|
html,
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
|
-
})()`);if(!Array.isArray(
|
|
51
|
+
})()`);if(!Array.isArray(e))return[];return e.map((n)=>({id:String(n?.id||""),idx:Number.isInteger(n?.idx)?n.idx:0,role:n?.role==="Assistant"?"Assistant":"User",text:String(n?.text||"").trim(),html:String(n?.html||"")})).filter((n)=>n.id&&(n.text||n.html))}export async function getYuanbaoSessionList(t,e){const n=Number(e??20);if(!Number.isInteger(n)||n<=0)throw new i("limit","must be a positive integer");const a=await t.evaluate(`(() => {
|
|
52
52
|
${IS_VISIBLE_JS}
|
|
53
53
|
const nodes = Array.from(document.querySelectorAll('.yb-recent-conv-list__item'))
|
|
54
54
|
.filter((node) => isVisible(node));
|
|
@@ -59,7 +59,7 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
|
|
|
59
59
|
const title = (titleEl?.getAttribute('data-item-name') || titleEl?.textContent || '').trim();
|
|
60
60
|
return { cid, agentId, title };
|
|
61
61
|
});
|
|
62
|
-
})()`);if(!Array.isArray(
|
|
62
|
+
})()`);if(!Array.isArray(a))return[];return a.map((o)=>({cid:String(o?.cid||"").toLowerCase(),agentId:String(o?.agentId||""),title:String(o?.title||"").trim()})).filter((o)=>c.test(o.cid)&&s.test(o.agentId)).slice(0,n)}export async function startNewYuanbaoChat(t){await ensureYuanbaoPage(t);if(await hasLoginGate(t))return"blocked";const e=await t.evaluate("window.location.href").catch(()=>"");if(await t.evaluate(`(() => {
|
|
63
63
|
${IS_VISIBLE_JS}
|
|
64
64
|
const trigger = Array.from(document.querySelectorAll('.yb-common-nav__trigger[data-desc="new-chat"], [dt-button-id="new_temp_chat"]'))
|
|
65
65
|
.find((node) => isVisible(node));
|
|
@@ -68,7 +68,7 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
|
|
|
68
68
|
return 'clicked';
|
|
69
69
|
}
|
|
70
70
|
return 'navigate';
|
|
71
|
-
})()`)==="navigate"){await
|
|
71
|
+
})()`)==="navigate"){await t.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await t.wait(1);return await hasLoginGate(t)?"blocked":"navigate"}await t.wait(1);if(await hasLoginGate(t))return"blocked";const a=await t.evaluate("window.location.href").catch(()=>"");if(typeof a==="string"&&typeof e==="string"&&a!==e)return"clicked";await t.goto(YUANBAO_URL,{waitUntil:"load",settleMs:2500});await t.wait(1);return"navigate"}export async function sendYuanbaoMessage(t,e){return await t.evaluate(`(async () => {
|
|
72
72
|
const waitFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
73
73
|
${IS_VISIBLE_JS}
|
|
74
74
|
|
|
@@ -91,8 +91,8 @@ import{ArgumentError as j,AuthRequiredError as P}from"@jackwener/opencli/errors"
|
|
|
91
91
|
selection?.removeAllRanges();
|
|
92
92
|
selection?.addRange(range);
|
|
93
93
|
composer.textContent = '';
|
|
94
|
-
document.execCommand('insertText', false, ${JSON.stringify(
|
|
95
|
-
composer.dispatchEvent(new InputEvent('input', { bubbles: true, data: ${JSON.stringify(
|
|
94
|
+
document.execCommand('insertText', false, ${JSON.stringify(e)});
|
|
95
|
+
composer.dispatchEvent(new InputEvent('input', { bubbles: true, data: ${JSON.stringify(e)}, inputType: 'insertText' }));
|
|
96
96
|
} catch (error) {
|
|
97
97
|
return {
|
|
98
98
|
ok: false,
|
package/clis/yuanbao/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as s,Strategy as i}from"@jackwener/opencli/registry";import{YUANBAO_DOMAIN as l,ensureYuanbaoPage as r,isLoggedIn as d,getCurrentYuanbaoSessionId as u,getYuanbaoModelLabel as g}from"./shared.js";s({site:"yuanbao",name:"status",access:"read",description:"Check Yuanbao page availability, login state, current session and model",domain:l,strategy:i.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Status","Login","Model","ModelId","AgentId","SessionId","Url"],func:async(e)=>{await r(e);await e.wait(1.5);const[t,o,a,n]=await Promise.all([d(e),u(e),g(e),e.evaluate("window.location.href").catch(()=>"")]);return[{Status:"Connected",Login:t?"Yes":"No (login gate)",Model:a.label,ModelId:a.modelId,AgentId:o?.agentId??null,SessionId:o?.convId??null,Url:typeof n==="string"?n:""}]}});
|
package/clis/yuque/article.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as c,CommandExecutionError as R}from"@jackwener/opencli/errors";import{cli as V,Strategy as j}from"@jackwener/opencli/registry";import{publishArticle as C}from"../_shared/article/publish.js";export const yuqueProfile={home:"https://www.yuque.com/dashboard",outputFormat:"markdown",preprocessConfig:null,image:null,publish:async(l,o)=>{const f=o.cookie("yuque_ctoken");if(!f)return{ok:!1,stage:"auth",message:"未检测到语雀登录态,请先在 Chrome 中登录语雀(缺少 yuque_ctoken cookie)"};const s={"Content-Type":"application/json","x-csrf-token":f},m=await fetch("https://www.yuque.com/api/mine/common_used",{method:"GET",credentials:"include",headers:s});let e=null;try{e=await m.json()}catch(t){}if(!m.ok||!e?.data?.books?.length)return{ok:!1,stage:"auth",status:m.status,message:"无法获取语雀知识库列表,请确认已登录语雀"};const r=e.data.books[0].target_id,p=await fetch("https://www.yuque.com/api/docs",{method:"POST",credentials:"include",headers:s,body:JSON.stringify({title:l.title,type:"Doc",format:"lake",book_id:r,status:0})});let i=null;try{i=await p.json()}catch(t){}if(!p.ok||!i?.data?.id)return{ok:!1,stage:"create",status:p.status,message:i?.message||"创建语雀草稿文档失败"};const a=i.data.id,T="https://www.yuque.com/go/doc/"+a+"/edit";let h=l.content;const I=["yuque.com","cdn.nlark.com"],b=/!\[([^\]]*)\]\(\s*<?([^)\s>]+)>?\s*\)/g,w=[];let _;while((_=b.exec(h))!==null)w.push({full:_[0],alt:_[1],src:_[2]});const y=[],g=[],L="https://www.yuque.com/api/upload/attach?attachable_type=Doc&attachable_id="+a+"&type=image";for(let t=0;t<w.length;t++){const d=w[t],u=d.src;if(!u)continue;if(u.indexOf("data:")===0)continue;if(I.some(function(n){return u.indexOf(n)!==-1}))continue;try{const n=await fetch(u,{credentials:"omit"});if(!n.ok)throw Error("图片下载失败 HTTP "+n.status);const A=await n.blob(),O=new FormData;O.append("file",A,"image.jpg");const P=await fetch(L,{method:"POST",credentials:"include",headers:{"x-csrf-token":f},body:O});let k=null;try{k=await P.json()}catch(E){}if(!P.ok||!k?.data?.url)throw Error(k&&k.message||"图片上传失败 HTTP "+P.status);const v=k.data.url;h=h.split(d.full).join("");y.push({src:u.slice(0,120),url:v})}catch(n){g.push({src:u.slice(0,120),error:String(n&&n.message||n)})}}const N=await fetch("https://www.yuque.com/api/docs/convert",{method:"POST",credentials:"include",headers:s,body:JSON.stringify({from:"markdown",to:"lake",content:h})});let x=null;try{x=await N.json()}catch(t){}if(!N.ok||!x?.data?.content)return{ok:!1,stage:"convert",status:N.status,message:"内容格式转换失败(markdown→lake)",id:String(a),uploaded:y,failed:g};const S=x.data.content,U='<div class="lake-content" typography="traditional">'+S+"</div>",D=await fetch("https://www.yuque.com/api/docs/"+a+"/content",{method:"PUT",credentials:"include",headers:s,body:JSON.stringify({format:"lake",body_asl:S,body:U,body_html:U,draft_version:0,sync_dynamic_data:!1,save_type:"auto",edit_type:"Lake"})});if(!D.ok){let t="";try{t=await D.text()}catch(d){}return{ok:!1,stage:"save",status:D.status,message:"保存正文失败:"+t.slice(0,300),id:String(a),uploaded:y,failed:g}}if(!l.draftOnly){const t=await fetch("https://www.yuque.com/api/docs/"+a+"/publish",{method:"PUT",credentials:"include",headers:s,body:JSON.stringify({status:1})});if(!t.ok){let d="";try{d=await t.text()}catch(u){}return{ok:!1,stage:"publish",status:t.status,message:"发布失败:"+d.slice(0,300),id:String(a),url:T,uploaded:y,failed:g}}}return{ok:!0,id:String(a),url:T,draft:Boolean(l.draftOnly),uploaded:y,failed:g}}};V({site:"yuque",name:"article",access:"write",description:"发布语雀文章(知识库文档)。正文默认为 Markdown,外链图片自动转存到语雀图床。",domain:"www.yuque.com",strategy:j.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(Markdown 格式;或用 --file 读文件)"},{name:"file",help:"正文文件路径(UTF-8,Markdown 格式)"},{name:"html",type:"boolean",help:"把正文当 HTML 输入(语雀仍转 lake 发布)"},{name:"draft",type:"boolean",help:"仅保存草稿,不发布"},{name:"execute",type:"boolean",help:"实际执行写操作。不加此参数命令拒绝写入。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(l,o)=>{if(!l)throw new R("语雀文章发布需要浏览器会话");if(!o.execute)throw new c("INVALID_INPUT","此命令需要加 --execute 才会实际写入(防误操作)");const f=String(o.title??"").trim();if(!f)throw new c("INVALID_INPUT","文章标题不能为空");let s="";const m=typeof o.text==="string"?o.text:void 0,e=typeof o.file==="string"?o.file:void 0;if(m&&e)throw new c("INVALID_INPUT","正文和 --file 不能同时使用");if(e){const{readFile:h,stat:I}=await import("node:fs/promises");let b;try{b=await I(e)}catch{throw new c("INVALID_INPUT",`文件不存在:${e}`)}if(!b.isFile())throw new c("INVALID_INPUT",`路径不是文件:${e}`);let w;try{w=await h(e)}catch{throw new c("INVALID_INPUT",`文件无法读取:${e}`)}try{s=new TextDecoder("utf-8",{fatal:!0}).decode(w)}catch{throw new c("INVALID_INPUT",`文件无法以 UTF-8 解码:${e}`)}}else s=m??"";if(!s.trim())throw new c("INVALID_INPUT","正文不能为空");const q=Boolean(o.draft),r=await C(l,{title:f,body:s,format:o.html?"html":"markdown",draftOnly:q,profile:yuqueProfile}),p=r.images.uploaded.length|0,i=r.images.failed.length|0;let a=r.draft?"已保存语雀草稿":"语雀文章发布成功";if(p||i)a+=`(图片:${p} 张已转存${i?`,${i} 张失败`:""})`;return[{status:"success",outcome:r.draft?"draft":"created",message:a,target_type:"article",target:"",created_target:"article:"+r.id,created_url:r.url}]}});
|
package/clis/yuque/whoami.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as n}from"@jackwener/opencli/registry";import{checkLogin as o}from"../_shared/article/auth.js";const yuqueAuthProfile={home:"https://www.yuque.com/dashboard",checkAuth:async(r)=>{const t=r.cookie("yuque_ctoken");if(!t)return{isAuthenticated:!1,error:"未检测到 yuque_ctoken cookie,请先登录语雀"};try{const e=await fetch("https://www.yuque.com/api/mine/common_used",{method:"GET",credentials:"include",headers:{"x-csrf-token":t}});if(!e.ok)return{isAuthenticated:!1,error:"接口返回 HTTP "+e.status};let a=null;try{a=await e.json()}catch(i){}if(!a?.data?.books?.length)return{isAuthenticated:!1,error:"未获取到语雀知识库信息"};const s=a.data.books[0].user;return{isAuthenticated:!0,userId:String(s.id),username:s.name,avatar:s.avatar_url||""}}catch(e){return{isAuthenticated:!1,error:String(e&&e.message||e)}}}};u({site:"yuque",name:"whoami",access:"read",description:"查看当前语雀登录账号信息。",domain:"www.yuque.com",strategy:n.COOKIE,browser:!0,columns:["logged_in","user_id","username"],func:async(r)=>{const t=await o(r,yuqueAuthProfile);return[{logged_in:t.isAuthenticated,user_id:t.userId||"",username:t.username||""}]}});export{yuqueAuthProfile};
|