publishport-opencli 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-manifest.json +35 -0
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +16 -16
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/clis/rednote/download.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as s,Strategy as m}from"@jackwener/opencli/registry";import{formatCookieHeader as l}from"@jackwener/opencli/download";import{downloadMedia as c}from"@jackwener/opencli/download/media-download";import{CommandExecutionError as u,EmptyResultError as f}from"@jackwener/opencli/errors";import{buildDownloadExtractJs as w}from"../xiaohongshu/download.js";import{buildNoteUrl as p,parseNoteId as h}from"../xiaohongshu/note-helpers.js";const y="Pass a full rednote.com note URL with xsec_token from search results or user/profile context.";s({site:"rednote",name:"download",access:"read",description:"Download images and videos from a rednote note",domain:"www.rednote.com",strategy:m.COOKIE,navigateBefore:!1,args:[{name:"note-id",positional:!0,required:!0,help:"Full rednote note URL with xsec_token"},{name:"output",default:"./rednote-downloads",help:"Output directory"}],columns:["index","type","status","size"],func:async(o,r)=>{const t=String(r["note-id"]),i=r.output,n=h(t);await o.goto(p(t,{commandName:"rednote download",cookieRoot:"rednote.com",signedUrlHint:y}));await o.wait({time:1+Math.random()*2});const e=await o.evaluate(w(n));if(e?.securityBlock)throw new u("Rednote security block: the note detail page was blocked by risk control.",/^https?:\/\//.test(t)?"The page may be temporarily restricted. Try again later or from a different session.":"Try using a full URL from search results (with xsec_token) instead of a bare note ID.");if(!e||!e.media||e.media.length===0)throw new f("rednote/download","No downloadable media found on this rednote note.");const d=l(await o.getCookies({url:"https://www.rednote.com"})),a=typeof e.noteId==="string"&&e.noteId.trim()?e.noteId.trim():n;return c(e.media,{output:i,subdir:a,cookies:d,filenamePrefix:a,timeout:60000})}});
|
package/clis/rednote/feed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as r,Strategy as o}from"@jackwener/opencli/registry";import{runFeed as a}from"../xiaohongshu/feed.js";export const command=r({site:"rednote",name:"feed",access:"read",description:"Rednote home feed (reads hydrated Pinia store)",domain:"www.rednote.com",strategy:o.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"int",default:20,help:"Number of items to return"}],columns:["id","title","author","likes","type","url"],func:async(e,t)=>a(e,t,"www.rednote.com")});
|
package/clis/rednote/note.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as u,Strategy as m}from"@jackwener/opencli/registry";import{AuthRequiredError as f,CommandExecutionError as
|
|
1
|
+
import{cli as u,Strategy as m}from"@jackwener/opencli/registry";import{AuthRequiredError as f,CommandExecutionError as w,EmptyResultError as a}from"@jackwener/opencli/errors";import{NOTE_EXTRACT_JS as h}from"../xiaohongshu/note.js";import{buildNoteUrl as g,parseNoteId as p}from"../xiaohongshu/note-helpers.js";const y="Pass a full rednote.com note URL with xsec_token from search results or user/profile context.";u({site:"rednote",name:"note",access:"read",description:"Read note body and engagement counts from a rednote note",domain:"www.rednote.com",strategy:m.COOKIE,navigateBefore:!1,args:[{name:"note-id",required:!0,positional:!0,help:"Full rednote note URL with xsec_token"}],columns:["field","value"],func:async(o,l)=>{const r=String(l["note-id"]),d=p(r),c=g(r,{commandName:"rednote note",cookieRoot:"rednote.com",signedUrlHint:y});await o.goto(c);await o.wait({time:2+Math.random()*3});const t=await o.evaluate(h);if(!t||typeof t!=="object")throw new a("rednote/note","Unexpected evaluate response");if(t.securityBlock)throw new w("Rednote security block: the note detail page was blocked by risk control.",/^https?:\/\//.test(r)?"The page may be temporarily restricted. Try again later or from a different session.":"Try using a full URL from search results (with xsec_token) instead of a bare note ID.");if(t.loginWall)throw new f("www.rednote.com","Note content requires login");if(t.notFound)throw new a("rednote/note",`Note ${d} not found or unavailable — it may have been deleted or restricted`);const e=t,n=(s)=>/^\d+/.test(s)?s:"0";if(!e.title&&!e.author)throw new a("rednote/note","The note page loaded without visible content. The note may be deleted or restricted.");const i=[{field:"title",value:e.title||""},{field:"author",value:e.author||""},{field:"content",value:e.desc||""},{field:"likes",value:n(e.likes||"")},{field:"collects",value:n(e.collects||"")},{field:"comments",value:n(e.comments||"")}];if(e.tags?.length)i.push({field:"tags",value:e.tags.join(", ")});return i}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as f}from"@jackwener/opencli/registry";import{ArgumentError as n,CommandExecutionError as a}from"@jackwener/opencli/errors";const p=new Set(["mentions","likes","connections"]);function u(t){const e=String(t??"mentions");if(!p.has(e))throw new n(`--type must be one of mentions, likes, or connections, got ${JSON.stringify(t)}`);return e}function d(t){const e=Number(t??20);if(!Number.isFinite(e)||!Number.isInteger(e))throw new n(`--limit must be a positive integer, got ${JSON.stringify(t)}`);if(e<1)throw new n(`--limit must be a positive integer, got ${e}`);return e}const g=`
|
|
2
2
|
(async (type) => {
|
|
3
3
|
let pinia = null;
|
|
4
4
|
const probe = (el) => el?.__vue_app__?.config?.globalProperties?.$pinia ?? null;
|
|
@@ -64,4 +64,4 @@ import{cli as f,Strategy as l}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
64
64
|
})),
|
|
65
65
|
};
|
|
66
66
|
})(${JSON.stringify("PLACEHOLDER_TYPE")})
|
|
67
|
-
`;export const command=
|
|
67
|
+
`;export const command=l({site:"rednote",name:"notifications",access:"read",description:"Rednote notifications (mentions/likes/connections)",domain:"www.rednote.com",strategy:f.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"type",default:"mentions",help:"Notification type: mentions, likes, or connections"},{name:"limit",type:"int",default:20,help:"Number of notifications to return"}],columns:["rank","user","action","content","note","time"],func:async(t,e)=>{const o=u(e.type),r=d(e.limit);await t.goto("https://www.rednote.com/notification");await t.wait({time:2});const s=g.replace(JSON.stringify("PLACEHOLDER_TYPE"),JSON.stringify(o)),i=await t.evaluate(s);if(!i||typeof i!=="object")throw new a("rednote notifications: unexpected evaluate response");if(i.error)throw new a(`rednote notifications: ${i.error}${i.detail?" ("+i.detail+")":""}`,"The rednote SPA may still be hydrating; reload www.rednote.com/notification and retry.");return(i.items||[]).slice(0,r).map((c,m)=>({rank:m+1,...c}))}});
|
package/clis/rednote/search.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as c}from"@jackwener/opencli/registry";import{ArgumentError as n,AuthRequiredError as u,CommandExecutionError as d}from"@jackwener/opencli/errors";import{buildScrollUntilJs as m,buildSearchExtractJs as w,noteIdToDate as f,unwrapEvaluateResult as i}from"../xiaohongshu/search.js";function h(t){const e=Number(t);if(!Number.isFinite(e)||!Number.isInteger(e))throw new n(`--limit must be an integer between 1 and 100, got ${JSON.stringify(t)}`);if(e<1||e>100)throw new n(`--limit must be between 1 and 100, got ${e}`);return e}function b(t){const e=i(t);if(!Array.isArray(e))throw new d("Unexpected Rednote search extraction payload shape; expected an array of rows.");return e}const y=`
|
|
2
2
|
new Promise((resolve) => {
|
|
3
3
|
const hasLoginModal = () => {
|
|
4
4
|
const candidates = document.querySelectorAll(
|
|
@@ -29,4 +29,4 @@ import{cli as V,Strategy as X}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
29
29
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
30
30
|
setTimeout(() => { observer.disconnect(); resolve('timeout'); }, 5000);
|
|
31
31
|
})
|
|
32
|
-
`;
|
|
32
|
+
`;l({site:"rednote",name:"search",access:"read",description:"Search rednote notes",domain:"www.rednote.com",strategy:c.COOKIE,navigateBefore:!1,args:[{name:"query",required:!0,positional:!0,help:"Search keyword"},{name:"limit",type:"int",default:20,help:"Number of results"}],columns:["rank","title","author","likes","published_at","url","author_url"],func:async(t,e)=>{const o=h(e.limit??20),s=encodeURIComponent(e.query);await t.goto(`https://www.rednote.com/search_result?keyword=${s}&source=web_search_result_notes`);if(i(await t.evaluate(y))==="login_wall")throw new u("www.rednote.com","Rednote search results are blocked behind a login wall");await t.evaluate(m(o));return b(await t.evaluate(w("www.rednote.com"))).filter((r)=>r.title).slice(0,o).map((r,a)=>({rank:a+1,...r,published_at:f(r.url)}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as s,Strategy as u}from"@jackwener/opencli/registry";import{EmptyResultError as m}from"@jackwener/opencli/errors";import{COUNTRY_FIELDS as l,REST_COUNTRIES_BASE as p,projectCountry as d,requireBoundedInt as y,requireString as f,restCountriesFetch as g}from"./utils.js";s({site:"rest-countries",name:"country",access:"read",description:"Look up countries by name (common / official, substring match)",domain:"restcountries.com",strategy:u.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,help:'Country name (e.g. "japan", "united kingdom")'},{name:"limit",type:"int",default:25,help:"Max rows (1-250)"}],columns:["rank","commonName","officialName","cca2","cca3","ccn3","capital","region","subregion","population","area","languages","currencies","latitude","longitude","timezones","independent","unMember","landlocked","flag","url"],func:async(n)=>{const o=f(n.name,"name"),a=y(n.limit,25,250),c=`${p}/name/${encodeURIComponent(o)}?fields=${l}`,r=await g(c,"rest-countries country"),i=Array.isArray(r)?r:[];if(!i.length)throw new m("rest-countries country",`No countries matched "${o}".`);return[...i].sort((e,t)=>(t?.population??0)-(e?.population??0)).slice(0,a).map((e,t)=>({rank:t+1,...d(e)}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as c,Strategy as u}from"@jackwener/opencli/registry";import{EmptyResultError as l}from"@jackwener/opencli/errors";import{COUNTRY_FIELDS as m,REST_COUNTRIES_BASE as
|
|
1
|
+
import{cli as c,Strategy as u}from"@jackwener/opencli/registry";import{EmptyResultError as l}from"@jackwener/opencli/errors";import{COUNTRY_FIELDS as m,REST_COUNTRIES_BASE as p,projectCountry as g,requireBoundedInt as d,requireRegion as f,restCountriesFetch as y}from"./utils.js";c({site:"rest-countries",name:"region",access:"read",description:"List countries in a region (africa / americas / asia / europe / oceania / antarctic)",domain:"restcountries.com",strategy:u.PUBLIC,browser:!1,args:[{name:"region",positional:!0,required:!0,help:"Region name (case-insensitive)"},{name:"limit",type:"int",default:250,help:"Max rows (1-250)"}],columns:["rank","commonName","officialName","cca2","cca3","ccn3","capital","region","subregion","population","area","languages","currencies","latitude","longitude","timezones","independent","unMember","landlocked","flag","url"],func:async(n)=>{const o=f(n.region),a=d(n.limit,250,250),s=`${p}/region/${encodeURIComponent(o)}?fields=${m}`,i=await y(s,"rest-countries region"),t=Array.isArray(i)?i:[];if(!t.length)throw new l("rest-countries region",`No countries returned for region "${o}".`);return[...t].sort((e,r)=>(r?.population??0)-(e?.population??0)).slice(0,a).map((e,r)=>({rank:r+1,...g(e)}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as i,CommandExecutionError as s,EmptyResultError as u}from"@jackwener/opencli/errors";export const REST_COUNTRIES_BASE="https://restcountries.com/v3.1";const l="opencli-rest-countries-adapter/1.0 (+https://github.com/jackwener/OpenCLI; mailto:ppcli@example.com)";export const REST_COUNTRIES_REGIONS=new Set(["africa","americas","asia","europe","oceania","antarctic"]),COUNTRY_FIELDS=["name","cca2","cca3","ccn3","capital","region","subregion","population","area","languages","currencies","flag","latlng","timezones","independent","unMember","landlocked"].join(",");export function requireString(e,t){const n=String(e??"").trim();if(!n)throw new i(`rest-countries ${t} cannot be empty`);return n}export function requireBoundedInt(e,t,n,r="limit"){const o=e??t,a=typeof o==="number"?o:Number(o);if(!Number.isInteger(a)||a<=0)throw new i(`rest-countries ${r} must be a positive integer`);if(a>n)throw new i(`rest-countries ${r} must be <= ${n}`);return a}export function requireRegion(e){const t=String(e??"").trim().toLowerCase();if(!t)throw new i('rest-countries region is required (e.g. "europe", "asia")');if(!REST_COUNTRIES_REGIONS.has(t))throw new i(`rest-countries region "${e}" is not recognised`,`Allowed regions: ${[...REST_COUNTRIES_REGIONS].join(", ")}.`);return t}export async function restCountriesFetch(e,t){let n;try{n=await fetch(e,{headers:{"user-agent":l,accept:"application/json"}})}catch(o){throw new s(`${t} request failed: ${o?.message??o}`,"Check that restcountries.com is reachable from this network.")}if(n.status===404)throw new u(t,`REST Countries returned 404 for ${e}.`);if(n.status===429)throw new s(`${t} returned HTTP 429 (rate limited)`);if(!n.ok)throw new s(`${t} returned HTTP ${n.status}`);let r;try{r=await n.json()}catch(o){throw new s(`${t} returned malformed JSON: ${o?.message??o}`)}return r}export function joinCurrencies(e){if(!e||typeof e!=="object")return"";return Object.entries(e).map(([t,n])=>{const r=n&&typeof n.name==="string"?n.name:"";return r?`${t} (${r})`:t}).join(", ")}export function joinLanguages(e){if(!e||typeof e!=="object")return"";return Object.values(e).filter((t)=>typeof t==="string"&&t.trim()).join(", ")}export function projectCountry(e){const t=e?.name?.common??null,n=e?.name?.official??null,r=typeof e?.cca3==="string"?e.cca3:null;return{commonName:typeof t==="string"?t:null,officialName:typeof n==="string"?n:null,cca2:typeof e?.cca2==="string"?e.cca2:null,cca3:r,ccn3:typeof e?.ccn3==="string"?e.ccn3:null,capital:Array.isArray(e?.capital)?e.capital.join(", "):null,region:typeof e?.region==="string"?e.region:null,subregion:typeof e?.subregion==="string"?e.subregion:null,population:typeof e?.population==="number"?e.population:null,area:typeof e?.area==="number"?e.area:null,languages:joinLanguages(e?.languages),currencies:joinCurrencies(e?.currencies),latitude:Array.isArray(e?.latlng)&&typeof e.latlng[0]==="number"?e.latlng[0]:null,longitude:Array.isArray(e?.latlng)&&typeof e.latlng[1]==="number"?e.latlng[1]:null,timezones:Array.isArray(e?.timezones)?e.timezones.join(", "):null,independent:typeof e?.independent==="boolean"?e.independent:null,unMember:typeof e?.unMember==="boolean"?e.unMember:null,landlocked:typeof e?.landlocked==="boolean"?e.landlocked:null,flag:typeof e?.flag==="string"?e.flag:null,url:r?`https://restcountries.com/v3.1/alpha/${r.toLowerCase()}`:""}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as o,AuthRequiredError as l,CommandExecutionError as a,EmptyResultError as s}from"@jackwener/opencli/errors";import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{buildArticleDetailScript as d,mapArticleDetail as w}from"./utils.js";const m=/^https?:\/\/(?:www\.)?reuters\.com\//i;u({site:"reuters",name:"article-detail",access:"read",description:"Reuters 路透社文章详情:标题/作者/正文文本",domain:"www.reuters.com",strategy:c.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"Reuters article URL (must be on reuters.com)"}],columns:["title","date","section","section_path","authors","description","word_count","url","body"],func:async(i,n)=>{const t=String(n.url||"").trim();if(!t)throw new o("Article URL cannot be empty");if(!m.test(t))throw new o(`URL must be on reuters.com, got ${t}`);await i.goto(t);await i.wait(2);const e=await i.evaluate(d());if(e?.error)throw new a(`Reuters article-detail failed inside the page: ${e.error}`);if(e?.authRequired)throw new l("www.reuters.com","Reuters article-detail is gated by login, subscription, or human verification");if(!e||e.ok!==!0)throw new a("Reuters article-detail returned no payload","Check that the URL points to a Reuters article and that the page loaded");const r=w(e.body?.article,e.body?.bodyText,t);if(!r||!r.title&&!r.body)throw new s("reuters article-detail","Page rendered no article body — likely paywalled or a non-article URL");return[r]}});
|
package/clis/reuters/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as r,CommandExecutionError as i}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as o}from"../_shared/site-auth.js";async function s(t){await t.goto("https://www.reuters.com/");await t.wait(2);const e=await t.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
try {
|
|
4
4
|
const subStateRaw = localStorage.getItem('rcom-subscription-state');
|
|
@@ -31,9 +31,9 @@ import{AuthRequiredError as D,CommandExecutionError as F}from"@jackwener/opencli
|
|
|
31
31
|
return { kind: 'exception', detail: String(e && e.message || e) };
|
|
32
32
|
}
|
|
33
33
|
})()
|
|
34
|
-
`);if(
|
|
34
|
+
`);if(e?.kind==="auth")throw new r("reuters.com",e.detail);if(e?.kind==="exception")throw new i(`Reuters whoami failed: ${e.detail}`);if(!e?.ok)throw new i(`Unexpected Reuters probe: ${JSON.stringify(e)}`);return{user_id:e.user_id,subscribed:e.subscribed}}o({site:"reuters",domain:"reuters.com",loginUrl:"https://www.reuters.com/account/sign-in/",columns:["user_id","subscribed"],verify:s,poll:async(t)=>{if(!await t.evaluate(`(() => {
|
|
35
35
|
try {
|
|
36
36
|
const raw = localStorage.getItem('rcom-subscription-state');
|
|
37
37
|
return raw ? JSON.parse(raw).isLoggedIn === true : false;
|
|
38
38
|
} catch { return false; }
|
|
39
|
-
})()`))throw new
|
|
39
|
+
})()`))throw new r("reuters.com","Waiting for Reuters login");return s(t)}});
|
package/clis/reuters/search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as u,AuthRequiredError as c,CommandExecutionError as r,EmptyResultError as
|
|
1
|
+
import{ArgumentError as u,AuthRequiredError as c,CommandExecutionError as r,EmptyResultError as w}from"@jackwener/opencli/errors";import{cli as m,Strategy as h}from"@jackwener/opencli/registry";import{buildSearchScript as l,isAuthStatus as d,looksAuthWallText as p,mapSearchArticles as y,parseLimit as f}from"./utils.js";m({site:"reuters",name:"search",access:"read",description:"Reuters 路透社新闻搜索",domain:"www.reuters.com",strategy:h.COOKIE,args:[{name:"query",required:!0,positional:!0,help:"Search query"},{name:"limit",type:"int",default:10,help:"Number of results (1-40)"}],columns:["rank","title","date","section","section_path","authors","url"],func:async(t,o)=>{const i=f(o.limit),s=String(o.query||"").trim();if(!s)throw new u("Search query cannot be empty","Provide a non-empty keyword");await t.goto("https://www.reuters.com");await t.wait(2);const e=await t.evaluate(l(s,i));if(e?.error)throw new r(`Reuters search failed inside the page: ${e.error}`);if(!e||typeof e!=="object")throw new r("Reuters search API returned an unreadable response");if(d(e.status)||p(e.textPreview))throw new c("www.reuters.com",`Reuters search requires an accessible Reuters browser session or completed human verification${e.status?` (HTTP ${e.status})`:""}`);if(e.ok!==!0){const a=Number.isFinite(e.status)&&e.status>0?`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`:"no upstream response";throw new r(`Reuters search API failed (${a})`)}if(!e.body){const a=e.parseError?`: ${e.parseError}`:"";throw new r(`Reuters search returned a non-JSON body${a}`,"Open www.reuters.com in your browser and clear any challenge before retrying.")}const n=y(e.body,i);if(!n.length)throw new w("reuters search",`No articles matched "${s}". Try broadening the query.`);return n}});
|
package/clis/reuters/utils.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as a}from"@jackwener/opencli/errors";const o=1,s=40;export function parseLimit(t,e=10){if(t===void 0||t===null||t==="")return e;const r=Number(t);if(!Number.isFinite(r)||!Number.isInteger(r))throw new a(`--limit must be an integer between ${o} and ${s}, got ${JSON.stringify(t)}`);if(r<o||r>s)throw new a(`--limit must be between ${o} and ${s}, got ${r}`);return r}export function buildSearchScript(t,e){return`
|
|
2
2
|
(async () => {
|
|
3
3
|
const apiQuery = JSON.stringify({
|
|
4
|
-
keyword: ${JSON.stringify(
|
|
4
|
+
keyword: ${JSON.stringify(t)},
|
|
5
5
|
offset: 0,
|
|
6
6
|
orderby: 'display_date:desc',
|
|
7
|
-
size: ${
|
|
7
|
+
size: ${e},
|
|
8
8
|
website: 'reuters'
|
|
9
9
|
});
|
|
10
10
|
const apiUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-search-v2?query=' + encodeURIComponent(apiQuery);
|
|
@@ -47,4 +47,4 @@ import{ArgumentError as P}from"@jackwener/opencli/errors";const J=1,K=40;export
|
|
|
47
47
|
return { ok: false, error: String((e && e.message) || e) };
|
|
48
48
|
}
|
|
49
49
|
})()
|
|
50
|
-
`}export function isAuthStatus(
|
|
50
|
+
`}export function isAuthStatus(t){return Number(t)===401||Number(t)===403}export function looksAuthWallText(t){const e=String(t??"").toLowerCase();return/datadome|captcha|verify you are human|human verification|access to this page has been denied|unusual traffic|subscribe to continue|subscription required|sign in to (continue|read|access)|log in to (continue|read|access)/.test(e)}function u(t){if(!Array.isArray(t))return null;const e=t.map((r)=>typeof r==="string"?r:r?.name||r?.byline||"").map((r)=>String(r).trim()).filter(Boolean);return e.length?e.join(", "):null}function i(t){const e=String(t??"").trim();return e?e:null}function c(t){const e=String(t??"").trim();if(!e)return null;return e.split("T")[0]}function l(t){if(!t)return null;const e=String(t);if(/^https?:\/\//i.test(e))return e;return"https://www.reuters.com"+e}export function mapSearchArticles(t,e){const r=t?.result?.articles||t?.articles||[];if(!Array.isArray(r))return[];return r.filter((n)=>n&&typeof n==="object").slice(0,e).map((n,p)=>({rank:p+1,title:i(n.title||n.headlines?.basic),date:c(n.display_date||n.published_time),section:i(n.taxonomy?.section?.name),section_path:i(n.taxonomy?.section?.path),authors:u(n.authors),url:l(n.canonical_url)})).filter((n)=>n.title&&n.url)}export function mapArticleDetail(t,e,r=null){if(!t&&!e)return null;return{title:i(t?.title||t?.headlines?.basic),date:c(t?.display_date||t?.published_time),section:i(t?.taxonomy?.section?.name),section_path:i(t?.taxonomy?.section?.path),authors:u(t?.authors),description:i(t?.description?.basic||t?.subheadlines?.basic),word_count:Number.isFinite(t?.word_count)?t.word_count:null,url:l(t?.canonical_url)||i(r),body:i(e)}}export const __test__={MIN_LIMIT:o,MAX_LIMIT:s};
|
package/clis/rfc/rfc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as u}from"@jackwener/opencli/registry";import{EmptyResultError as l}from"@jackwener/opencli/errors";import{RFC_BASE as a,requireRfcNumber as g,rfcFetch as p,trimDate as f}from"./utils.js";m({site:"rfc",name:"rfc",access:"read",description:"Single IETF RFC metadata (title, abstract, working group, authors, std level)",domain:"datatracker.ietf.org",strategy:u.PUBLIC,browser:!1,args:[{name:"number",positional:!0,type:"int",required:!0,help:"RFC number (e.g. 9000, 791, 2616)"}],columns:["rfc","title","state","stdLevel","group","groupType","pages","published","authors","abstract","rfcEditorUrl","url"],func:async(o)=>{const t=g(o.number),e=`rfc${t}`,r=await p(`${a}/doc/${e}/doc.json`,`rfc ${t}`);if(!r||!r.name)throw new l("rfc rfc",`IETF datatracker returned no metadata for RFC ${t}.`);const i=Array.isArray(r.authors)?r.authors.map((c)=>String(c?.name??"").trim()).filter(Boolean).join(", "):"",s=String(r.group?.name??"").trim(),n=String(r.group?.type??"").trim();return[{rfc:t,title:String(r.title??"").trim(),state:String(r.state??"").trim(),stdLevel:String(r.std_level??"").trim(),group:s,groupType:n,pages:r.pages==null?null:Number(r.pages),published:f(r.time),authors:i,abstract:String(r.abstract??"").trim(),rfcEditorUrl:`https://www.rfc-editor.org/rfc/rfc${t}`,url:`${a}/doc/${e}/`}]}});
|
package/clis/rfc/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as s,CommandExecutionError as o,EmptyResultError as a}from"@jackwener/opencli/errors";export const RFC_BASE="https://datatracker.ietf.org";const c="opencli-rfc-adapter (+https://github.com/jackwener/OpenCLI)";export function requireRfcNumber(n){const r=n;if(r==null||String(r).trim()==="")throw new s("rfc number is required (e.g. 9000, 791, 2616)",'Pass the integer RFC number; do not include the "rfc" prefix.');const t=String(r).trim().toLowerCase().replace(/^rfc/,""),e=Number.parseInt(t,10);if(!Number.isInteger(e)||e<=0||String(e)!==t)throw new s(`rfc number "${n}" is not a valid RFC number`,"Pass a positive integer (e.g. 9000, 791, 2616).");if(e>999999)throw new s("rfc number must be <= 999999");return e}export async function rfcFetch(n,r){let t;try{t=await fetch(n,{headers:{"user-agent":c,accept:"application/json"}})}catch(i){throw new o(`${r} request failed: ${i?.message??i}`,"Check that datatracker.ietf.org is reachable from this network.")}if(t.status===404)throw new a(r,`IETF datatracker returned 404 for ${n}.`);if(t.status===429)throw new o(`${r} returned HTTP 429 (rate limited)`);if(!t.ok)throw new o(`${r} returned HTTP ${t.status}`);let e;try{e=await t.json()}catch(i){throw new o(`${r} returned malformed JSON: ${i?.message??i}`)}return e}export function trimDate(n){const r=String(n??"").trim();if(!r)return null;if(/^\d{4}-\d{2}-\d{2}/.test(r))return r.slice(0,10);return null}
|
package/clis/rubygems/gem.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as t,Strategy as a}from"@jackwener/opencli/registry";import{GEMS_BASE as m,gemsFetch as u,requireGemName as l,trimDate as g}from"./utils.js";t({site:"rubygems",name:"gem",access:"read",description:"Fetch a RubyGems.org gem's metadata (version, downloads, license, links)",domain:"rubygems.org",strategy:a.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,help:'Gem name (e.g. "rails", "sidekiq")'}],columns:["gem","version","releasedAt","downloads","versionDownloads","license","authors","homepage","source","bugs","info","url"],func:async(s)=>{const r=l(s.name),n=`${m}/gems/${encodeURIComponent(r)}.json`,e=await u(n,"rubygems gem"),i=Array.isArray(e?.licenses)?e.licenses.filter(Boolean).join(", "):"",o=e?.metadata??{};return[{gem:String(e?.name??r).trim(),version:String(e?.version??"").trim(),releasedAt:g(e?.version_created_at),downloads:e?.downloads!=null?Number(e.downloads):null,versionDownloads:e?.version_downloads!=null?Number(e.version_downloads):null,license:i,authors:String(e?.authors??"").trim(),homepage:String(e?.homepage_uri??"").trim(),source:String(e?.source_code_uri??o.source_code_uri??"").trim(),bugs:String(e?.bug_tracker_uri??o.bug_tracker_uri??"").trim(),info:String(e?.info??"").trim(),url:String(e?.project_uri??`https://rubygems.org/gems/${r}`).trim()}]}});
|
package/clis/rubygems/search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{EmptyResultError as y}from"@jackwener/opencli/errors";import{GEMS_BASE as d,gemsFetch as g,requireBoundedInt as h,requireString as p}from"./utils.js";u({site:"rubygems",name:"search",access:"read",description:"Search RubyGems.org gems by keyword",domain:"rubygems.org",strategy:c.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Search keyword (e.g. "rails", "redis")'},{name:"limit",type:"int",default:30,help:"Max gems (1-100, single RubyGems page)"}],columns:["rank","gem","version","downloads","license","authors","info","url"],func:async(s)=>{const n=p(s.query,"query"),i=h(s.limit,30,100),a=`${d}/search.json?query=${encodeURIComponent(n)}&page=1`,o=await g(a,"rubygems search"),t=Array.isArray(o)?o:[];if(!t.length)throw new y("rubygems search",`No gems matched "${n}".`);return t.slice(0,i).map((e,m)=>{const r=String(e.name??"").trim(),l=Array.isArray(e.licenses)?e.licenses.filter(Boolean).join(", "):"";return{rank:m+1,gem:r,version:String(e.version??"").trim(),downloads:e.downloads!=null?Number(e.downloads):null,license:l,authors:String(e.authors??"").trim(),info:String(e.info??"").trim(),url:r?`https://rubygems.org/gems/${r}`:""}})}});
|
package/clis/rubygems/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as i,CommandExecutionError as u,EmptyResultError as m}from"@jackwener/opencli/errors";export const GEMS_BASE="https://rubygems.org/api/v1";const a="opencli-rubygems-adapter (+https://github.com/jackwener/OpenCLI)",c=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;export function requireString(r,t){const e=String(r??"").trim();if(!e)throw new i(`rubygems ${t} cannot be empty`);return e}export function requireBoundedInt(r,t,e,s="limit"){const n=r??t,o=typeof n==="number"?n:Number(n);if(!Number.isInteger(o)||o<=0)throw new i(`rubygems ${s} must be a positive integer`);if(o>e)throw new i(`rubygems ${s} must be <= ${e}`);return o}export function requireGemName(r){const t=String(r??"").trim();if(!t)throw new i('rubygems gem name is required (e.g. "rails", "sidekiq")');if(t.length>100||!c.test(t))throw new i(`rubygems gem "${r}" is not a valid gem name`,'Use letters / digits / "._-", starting with a letter or digit (max 100 chars).');return t}export async function gemsFetch(r,t){let e;try{e=await fetch(r,{headers:{"user-agent":a,accept:"application/json"}})}catch(n){throw new u(`${t} request failed: ${n?.message??n}`,"Check that rubygems.org is reachable from this network.")}if(e.status===404)throw new m(t,`RubyGems returned 404 for ${r}.`);if(e.status===429)throw new u(`${t} returned HTTP 429 (rate limited)`,"RubyGems throttles bursts; wait a few seconds and retry.");if(!e.ok)throw new u(`${t} returned HTTP ${e.status}`);let s;try{s=await e.json()}catch(n){throw new u(`${t} returned malformed JSON: ${n?.message??n}`)}return s}export function trimDate(r){const t=String(r??"").trim();if(!t)return null;const e=t.replace(/\.\d+/,"");return e.endsWith("Z")?e:`${e}Z`}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{CliError as
|
|
2
|
-
</script>`,
|
|
3
|
-
</script>`,
|
|
1
|
+
import{CliError as x,CommandExecutionError as v}from"@jackwener/opencli/errors";import{cli as U,Strategy as R}from"@jackwener/opencli/registry";import{publishArticle as D}from"../_shared/article/publish.js";import{readFile as L,stat as H}from"node:fs/promises";function M(n){if(!n.execute)throw new x("INVALID_INPUT","本命令需要 --execute 才会真正发布,请确认后加上 --execute。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function F(n){const f=typeof n.text==="string"?n.text:void 0,r=typeof n.file==="string"?n.file:void 0;if(f&&r)throw new x("INVALID_INPUT","请只传 <text> 或 --file 之一,不能同时使用");let p=f??"";if(r){let u;try{u=await H(r)}catch{throw new x("INVALID_INPUT",`文件不存在:${r}`)}if(!u.isFile())throw new x("INVALID_INPUT",`路径必须是可读文本文件:${r}`);let g;try{g=await L(r)}catch{throw new x("INVALID_INPUT",`无法读取文件:${r}`)}try{p=new TextDecoder("utf-8",{fatal:!0}).decode(g)}catch{throw new x("INVALID_INPUT",`文件编码不是 UTF-8:${r}`)}}if(!p.trim())throw new x("INVALID_INPUT","正文不能为空");return p}function q(n,f,r,p,u={}){return[{status:"success",outcome:p,message:n,target_type:f,target:r,...u}]}export const segmentfaultProfile={home:"https://segmentfault.com/write",outputFormat:"markdown",image:{skip:["image-static.segmentfault.com","avatar-static.segmentfault.com"],allowRelative:!0,uploadFn:async(n,f)=>{const p=await(await fetch("https://segmentfault.com/write",{credentials:"include"})).text();let u=null;const g=p.match(/serverData"\s*:\s*\{\s*"Token"\s*:\s*"([^"]+)"/);if(g)u=g[1];else{const k="window.g_initialProps = ",S=p.indexOf(k);if(S!==-1){const I=p.indexOf(`;
|
|
2
|
+
</script>`,S);if(I!==-1)try{const d=JSON.parse(p.substring(S+k.length,I));u=d&&d.global&&d.global.sessionInfo&&d.global.sessionInfo.key}catch(d){}}}if(!u)throw Error("获取思否 session token 失败");const b=await fetch(n,{credentials:"omit"});if(!b.ok)throw Error("下载图片失败:"+b.status);const N=await b.blob(),A=new FormData;A.append("image",N);const w=await(await fetch("https://segmentfault.com/gateway/image",{method:"POST",credentials:"include",headers:{token:u},body:A})).text();if(w==="Unauthorized"||w.includes("禁言")||w.includes("锁定"))throw Error(w==="Unauthorized"?"未授权,请检查登录态":w);let i;try{i=JSON.parse(w)}catch(k){throw Error("图片上传失败:"+w)}let y=null;if(i&&i.url)y=i.url;else if(i&&i.result)y=i.result;else if(Array.isArray(i)){if(i[0]===1)throw Error(i[1]||"图片上传失败");y=i[1]||(i[2]?"https://image-static.segmentfault.com/"+i[2]:null)}if(!y)throw Error("图片上传失败,服务端未返回 URL");return{url:y}}},publish:async(n,f)=>{const r=n.params||{},u=await(await fetch("https://segmentfault.com/write",{credentials:"include"})).text();let g=null;const b=u.match(/serverData"\s*:\s*\{\s*"Token"\s*:\s*"([^"]+)"/);if(b)g=b[1];else{const a="window.g_initialProps = ",t=u.indexOf(a);if(t!==-1){const e=u.indexOf(`;
|
|
3
|
+
</script>`,t);if(e!==-1)try{const s=JSON.parse(u.substring(t+a.length,e));g=s&&s.global&&s.global.sessionInfo&&s.global.sessionInfo.key}catch(s){}}}if(!g)return{ok:!1,stage:"token",status:0,message:"获取思否 session token 失败:请确认已登录;账号首次发文会被新手确认页(/howtowrite)拦住,需先在网页端进一次写作页点「我已知晓,继续撰写」"};async function N(a){let t=null;try{const T=(await fetch("/",{method:"HEAD"})).headers.get("date");if(T){const O=new Date(T).getTime();if(!isNaN(O))t=Math.floor(O/1000)}}catch(c){}const e=Object.keys(window).find((c)=>c.startsWith("webpackChunk"));if(!e)return{__sfErr:"页面未就绪:未找到 webpack 运行时,无法复用思否请求签名"};let s;try{window[e].push([[Symbol("pp_sf_"+Math.random())],{},(c)=>{s=c}])}catch(c){return{__sfErr:"注入 webpack 探针失败:"+String(c)}}if(!s||!s.m)return{__sfErr:"无法取得 webpack require(思否前端结构可能已变)"};let o=null;for(const c of Object.keys(s.m)){let T="";try{T=String(s.m[c])}catch(O){continue}if(/function getUrl/.test(T)&&T.indexOf("/gateway")!==-1){o=c;break}}if(!o)return{__sfErr:"未定位到思否请求签名模块(getUrl/gateway),站点前端结构可能已变,需更新 adapter"};let h;try{h=s(o).default}catch(c){return{__sfErr:"加载思否请求模块失败:"+String(c)}}if(typeof h!=="function")return{__sfErr:"思否请求模块导出异常(default 非构造器)"};let l=null;const E=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(c,T){try{if(String(T).indexOf(a)!==-1)l=this}catch(O){}return E.apply(this,arguments)};try{const c=new h({Token:g,userAgent:navigator.userAgent});if(t)c.setServerTime(t);await c.send(a,{method:"GET"}).catch(function(){})}catch(c){XMLHttpRequest.prototype.open=E;return{__sfErr:"签名请求执行失败:"+String(c)}}XMLHttpRequest.prototype.open=E;if(!l)return{__sfErr:"签名请求未发出(Request.send 未触发 XHR)"};return{status:l.status,raw:String(l.responseText||"")}}if(n.draftOnly){const a={title:n.title,tags:[],text:n.content,object_id:"",type:"article"},t=await fetch("https://segmentfault.com/gateway/draft",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",token:g,accept:"*/*"},body:JSON.stringify(a)}),e=await t.text();if(e==="Unauthorized"||e.includes("禁言")||e.includes("锁定"))return{ok:!1,stage:"publish",status:t.status,message:e==="Unauthorized"?"未授权":e};let s;try{s=JSON.parse(e)}catch(o){return{ok:!1,stage:"publish",status:t.status,message:"解析响应失败:"+e.slice(0,200)}}if(Array.isArray(s)){if(s[0]===1)return{ok:!1,stage:"publish",status:t.status,message:s[1]||"发布失败"};const o=s[1];if(o&&o.id)return{ok:!0,draft:!0,id:String(o.id),url:"https://segmentfault.com/write?draftId="+o.id}}if(!s||!s.id){const o=s&&(s.message||s.msg||s.error||s.errMsg)||e.slice(0,200);return{ok:!1,stage:"publish",status:t.status,message:o}}return{ok:!0,draft:!0,id:String(s.id),url:"https://segmentfault.com/write?draftId="+s.id}}const A={"Content-Type":"application/json",token:g,accept:"*/*"},_=Array.isArray(r.tags)?r.tags.map((a)=>String(a).trim()).filter(Boolean):[];if(_.length===0)return{ok:!1,stage:"tags",message:"思否发文必须至少指定 1 个标签(--tags),合法标签可用 `segmentfault tags <名称>` 校验"};const w=[];for(const a of _){const t=await N("/tag/"+encodeURIComponent(a));if(t&&t.__sfErr)return{ok:!1,stage:"tags",message:"标签「"+a+"」校验失败:"+t.__sfErr};let e;try{e=JSON.parse(t.raw)}catch(o){return{ok:!1,stage:"tags",status:t.status,message:"解析标签「"+a+"」响应失败(HTTP "+t.status+"):"+String(t.raw).slice(0,200)}}if(t.status!==200||typeof e==="string")return{ok:!1,stage:"tags",status:t.status,message:"思否标签接口请求被拒(HTTP "+t.status+"):"+(typeof e==="string"?e:String(t.raw).slice(0,120))};const s=e&&e.tag;if(!s||s.id==null)return{ok:!1,stage:"tags",message:"思否上找不到标签「"+a+"」,请用 `segmentfault tags <名称>` 确认存在再发布"};w.push(s.id)}const i=Array.isArray(r.channels)?r.channels.map((a)=>String(a).trim()).filter(Boolean):[],y=[];if(i.length>0){let a=[];const t=await N("/channels");if(t&&t.__sfErr)return{ok:!1,stage:"channels",message:"获取思否频道列表失败:"+t.__sfErr};let e;try{e=JSON.parse(t.raw)}catch(s){return{ok:!1,stage:"channels",status:t.status,message:"解析频道列表失败(HTTP "+t.status+"):"+String(t.raw).slice(0,200)}}if(t.status!==200||typeof e==="string")return{ok:!1,stage:"channels",status:t.status,message:"思否频道接口请求被拒(HTTP "+t.status+"):"+(typeof e==="string"?e:String(t.raw).slice(0,120))};if(Array.isArray(e))a=e;else if(e&&Array.isArray(e.data))a=e.data;else if(e&&Array.isArray(e.rows))a=e.rows;else if(e&&Array.isArray(e.channels))a=e.channels;else a=[];for(const s of i){const o=a.find((h)=>h&&(String(h.name||h.title||h.text)===s||String(h.slug)===s));if(!o||!o.slug){const h=a.map((l)=>l&&(l.name||l.title||l.text)||"").filter(Boolean).join(" / ");return{ok:!1,stage:"channels",message:"思否上找不到频道「"+s+"」,可选:"+(h||"(频道列表为空)")}}y.push(o.slug)}}let k="";if(r.cover){const a=String(r.cover);if(a.indexOf("/img/")===0)k=a;else{let t;try{const l=await fetch(a,{credentials:"omit"});if(!l.ok)return{ok:!1,stage:"cover",status:l.status,message:"封面图下载失败(HTTP "+l.status+"):"+a.slice(0,120)};t=await l.blob()}catch(l){return{ok:!1,stage:"cover",message:"封面图下载失败("+String(l&&l.message||l)+")。思否封面只收自家图床 /img/ 路径;建议 --cover 直接传本机图片路径,由命令自动转存"}}const e=new FormData;e.append("image",t);const s=await fetch("https://segmentfault.com/gateway/image",{method:"POST",credentials:"include",headers:{token:g},body:e}),o=await s.text();let h;try{h=JSON.parse(o)}catch(l){return{ok:!1,stage:"cover",status:s.status,message:"封面图上传思否图床失败:"+o.slice(0,120)}}k=h&&h.url||"";if(!k)return{ok:!1,stage:"cover",status:s.status,message:"封面图上传后未拿到 /img/ 路径:"+o.slice(0,120)}}}const S={title:n.title,text:n.content,tags:w,blog_id:0,type:1};if(y.length>0)S.channel=y;if(k)S.cover=k;const I=await fetch("https://segmentfault.com/gateway/article",{method:"POST",credentials:"include",headers:A,body:JSON.stringify(S)}),d=await I.text();if(d==="Unauthorized"||d.includes("禁言")||d.includes("锁定"))return{ok:!1,stage:"publish",status:I.status,message:d==="Unauthorized"?"未授权,请检查登录态":d};let m;try{m=JSON.parse(d)}catch(a){return{ok:!1,stage:"publish",status:I.status,message:"解析发布响应失败:"+d.slice(0,200)}}if(m&&(m.isError||m.error||m.errno||m.scene_id)){let a=m.message||m.msg||m.error||"";if(m.scene_id)a=(a?a+";":"")+"思否要求人机验证(geetest),无法在自动化环境完成";return{ok:!1,stage:"publish",status:I.status,message:a||"发布失败:"+d.slice(0,200)}}const P=m&&m.data&&m.data.id;if(P==null)return{ok:!1,stage:"publish",status:I.status,message:m&&(m.message||m.msg)||"发布响应缺少文章 id:"+d.slice(0,200)};return{ok:!0,draft:!1,id:String(P),url:"https://segmentfault.com/a/"+P}}};U({site:"segmentfault",name:"article",access:"write",description:"发布文章到思否(SegmentFault)。默认正式发布,加 --draft 仅存草稿。正文默认 Markdown;外链图片自动转存到思否图床。正式发布必须指定标签(--tags),合法标签用 `segmentfault tags <名称>` 校验、频道用 `segmentfault channels` 列举。",domain:"segmentfault.com",strategy:R.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(默认 Markdown;传 --html 则视为 HTML)"},{name:"file",help:"正文文件路径(UTF-8,默认 Markdown)"},{name:"html",type:"boolean",help:"将正文视为原始 HTML 而非 Markdown"},{name:"tags",help:"标签名,逗号分隔(正式发布必填,至少 1 个)。合法标签用 `segmentfault tags <名称>` 校验;草稿可省略。"},{name:"cover",help:"封面图(选填):本机图片路径或图片 URL,自动转存到思否图床。"},{name:"channels",help:"频道名,逗号分隔(选填)。合法值用 `segmentfault channels` 列举。"},{name:"draft",type:"boolean",help:"仅保存草稿,不正式发布"},{name:"execute",type:"boolean",help:"实际执行发布。不加此参数时命令拒绝写操作。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(n,f)=>{if(!n)throw new v("思否发布需要浏览器会话");M(f);const r=String(f.title??"").trim();if(!r)throw new x("INVALID_INPUT","文章标题不能为空");const p=await F(f),u=Boolean(f.draft),g=(k)=>typeof k==="string"?k.split(",").map((S)=>S.trim()).filter(Boolean):[],b=g(f.tags),N=g(f.channels),A=typeof f.cover==="string"?f.cover.trim():"";if(!u&&b.length===0)throw new x("INVALID_INPUT","思否正式发布必须指定 --tags(至少 1 个标签);合法标签用 `segmentfault tags <名称>` 校验,或加 --draft 只存草稿");const _=await D(n,{title:r,body:p,format:f.html?"html":"markdown",draftOnly:u,profile:segmentfaultProfile,publishParams:{tags:b,channels:N,cover:A}}),w=_.images.uploaded.length|0,i=_.images.failed.length|0;let y=_.draft?"已保存到思否草稿箱(需在网页上手动发布)":"已正式发布到思否";if(w||i)y+=`;图片:${w} 张转存成功${i?`,${i} 张失败`:""}`;return q(y,"article","",_.draft?"draft":"created",{created_target:(_.draft?"draft:":"article:")+_.id,created_url:_.url})}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as a,Strategy as n}from"@jackwener/opencli/registry";import{CommandExecutionError as t}from"@jackwener/opencli/errors";import{gotoWritePage as i}from"../_shared/article/publish.js";import{segmentfaultProfile as l}from"./article.js";import{SF_SIGNED_GET_JS as o}from"./_signed-request.js";a({site:"segmentfault",name:"channels",access:"read",description:"列出思否文章频道(名称 + slug),供 `segmentfault article --channels` 取合法频道名。",domain:"segmentfault.com",strategy:n.COOKIE,browser:!0,columns:["channel_slug","channel_name"],func:async(e)=>{if(!e)throw new t("思否频道列举需要浏览器会话");await i(e,l.home);const s="(async () => {"+o+'const res = await __sfSignedGet("/channels");if (res && res.__sfErr) return { __error: res.__sfErr };'+'let d; try { d = JSON.parse(res.raw); } catch (e) { return { __error: "解析频道响应失败(HTTP " + res.status + "):" + String(res.raw).slice(0, 200) }; }'+'if (res.status !== 200 || typeof d === "string") return { __error: "思否频道接口请求被拒(HTTP " + res.status + "):" + (typeof d === "string" ? d : String(res.raw).slice(0, 120)) };'+'let list = [];if (Array.isArray(d)) list = d;else if (d && Array.isArray(d.rows)) list = d.rows;else if (d && Array.isArray(d.data)) list = d.data;else if (d && Array.isArray(d.channels)) list = d.channels;return list.map((c) => ({ channel_slug: String((c && c.slug) || ""), channel_name: String((c && (c.name || c.title || c.text)) || "") }));})()',r=await e.evaluate(s);if(r&&r.__error)throw new t(r.__error);return Array.isArray(r)?r:[]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerArticleLogin as
|
|
1
|
+
import{registerArticleLogin as t}from"../_shared/article/login.js";import{authProfile as e}from"./whoami.js";t({site:"segmentfault",domain:"segmentfault.com",profile:{home:e.home,checkAuth:e.checkAuth},loginDescription:"打开思否(SegmentFault)登录页并等待浏览器完成登录(供桌面客户端引导登录)。"});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as d,Strategy as _}from"@jackwener/opencli/registry";d({site:"segmentfault",name:"stats",access:"read",description:"思否文章数据(每篇阅读/独立访客/得票/评论/收藏/预计阅读时长等全量运营指标)",domain:"segmentfault.com",strategy:_.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"number",default:20,help:"返回条数"},{name:"user",help:"指定思否用户名(/u/<name> 里的 name),默认当前登录账号"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","unique_views","read_time","status","tags","extra"],func:async(n,a)=>{const m=Math.max(1,Number(a.limit)||20),c=typeof a.user==="string"?a.user.trim():"";await n.goto("https://segmentfault.com/");const s=await n.evaluate(`(async () => {
|
|
2
2
|
try {
|
|
3
3
|
if (!location.host.includes('segmentfault.com')) {
|
|
4
4
|
return { error: '当前标签不在思否域名(' + location.host + '),浏览器会话异常,请重试' };
|
|
5
5
|
}
|
|
6
|
-
const limit = ${JSON.stringify(
|
|
7
|
-
let user = ${JSON.stringify(
|
|
6
|
+
const limit = ${JSON.stringify(m)};
|
|
7
|
+
let user = ${JSON.stringify(c)};
|
|
8
8
|
|
|
9
9
|
// ── 解析当前登录用户名(与 segmentfault whoami 同源:/user/settings HTML)──
|
|
10
10
|
if (!user) {
|
|
@@ -79,4 +79,4 @@ import{cli as J,Strategy as K}from"@jackwener/opencli/registry";J({site:"segment
|
|
|
79
79
|
} catch (e) {
|
|
80
80
|
return { error: String((e && e.message) || e) };
|
|
81
81
|
}
|
|
82
|
-
})()`);if(!
|
|
82
|
+
})()`);if(!s||s.error)throw Error(s?.error||"segmentfault stats:evaluate 无返回(浏览器会话异常)");const l=Array.isArray(s.items)?s.items:[];if(l.length===0)throw Error("segmentfault stats:未取到任何文章数据(浏览器会话异常,请重试)");const o=(e)=>{const t=Number(e);if(!Number.isFinite(t)||t<=0)return"";const r=new Date(t*1000+28800000),i=(u)=>String(u).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())} ${i(r.getUTCHours())}:${i(r.getUTCMinutes())}`};return l.map((e)=>{const t=e.art;if(!t)return{id:e.id,type:"article",title:"",url:`https://segmentfault.com/a/${e.id}`,published_at:"",views:"",likes:"",comments:"",collects:"",shares:"",unique_views:"",read_time:"",status:"",tags:"",extra:JSON.stringify({detail_error:e.detail_error||"未知错误"})};return{id:e.id,type:"article",title:t.title||"",url:`https://segmentfault.com/a/${e.id}`,published_at:o(t.created),views:t.real_views??0,likes:t.votes??0,comments:t.comments??0,collects:t.bookmarks??0,shares:"",unique_views:t.real_unique_views??0,read_time:t.read_time??"",status:t.status_key||"",tags:(t.tags||[]).join("|"),extra:JSON.stringify({updated_at:o(t.modified),is_sticky:t.is_sticky,is_edited:t.is_edited,ip_address:t.ip_address||"",article_type:t.article_type,origin_url:t.origin_url||""})}})}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as i,Strategy as o}from"@jackwener/opencli/registry";import{CliError as m,CommandExecutionError as a}from"@jackwener/opencli/errors";import{gotoWritePage as g}from"../_shared/article/publish.js";import{segmentfaultProfile as _}from"./article.js";import{SF_SIGNED_GET_JS as f}from"./_signed-request.js";i({site:"segmentfault",name:"tags",access:"read",description:"按名称校验思否标签是否存在并返回其真实 id,供 `segmentfault article --tags` 取合法标签。思否发文强制选标签,禁止臆造标签名/id。",domain:"segmentfault.com",strategy:o.COOKIE,browser:!0,args:[{name:"name",positional:!0,required:!0,help:"要校验的标签名(精确匹配,如 JavaScript / Vue.js)"}],columns:["exists","tag_id","tag_name"],func:async(t,s)=>{if(!t)throw new a("思否标签校验需要浏览器会话");const e=String(s.name??"").trim();if(!e)throw new m("INVALID_INPUT","标签名不能为空");await g(t,_.home);const n="(async () => {"+f+"const name = "+JSON.stringify(e)+';const res = await __sfSignedGet("/tag/" + encodeURIComponent(name));if (res && res.__sfErr) return { __error: res.__sfErr };'+'let d; try { d = JSON.parse(res.raw); } catch (e) { return { __error: "解析标签响应失败(HTTP " + res.status + "):" + String(res.raw).slice(0, 200) }; }'+'if (res.status !== 200 || typeof d === "string") return { __error: "思否标签接口请求被拒(HTTP " + res.status + "):" + (typeof d === "string" ? d : String(res.raw).slice(0, 120)) };'+'const tag = d && d.tag;if (!tag || tag.id == null) return [{ exists: false, tag_id: "", tag_name: name }];return [{ exists: true, tag_id: String(tag.id), tag_name: String(tag.name || name) }];})()',r=await t.evaluate(n);if(r&&r.__error)throw new a(r.__error);return Array.isArray(r)?r:[]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as i}from"@jackwener/opencli/registry";import{checkLogin as o,cookieQuickCheck as m}from"../_shared/article/auth.js";import{segmentfaultProfile as h}from"./article.js";const authProfile={home:h.home,checkAuth:async(e)=>{const a=await(await fetch("https://segmentfault.com/user/settings",{credentials:"include"})).text(),s=a.match(/href="\/u\/([^"]+)"/);if(!s)return{isAuthenticated:!1,error:"未登录或无法解析用户信息"};const r=s[1],c=a.match(/src="(https:\/\/avatar-static\.segmentfault\.com\/[^"]+)"/),n=c?c[1]:"";return{isAuthenticated:!0,userId:r,username:r,avatar:n}}};export{authProfile};u({site:"segmentfault",name:"whoami",access:"read",description:"检查思否(SegmentFault)的登录状态并获取当前账号信息",domain:"segmentfault.com",strategy:i.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:m("https://segmentfault.com",["PHPSESSID"])},func:async(e)=>{const t=await o(e,authProfile);return[{logged_in:t.isAuthenticated,user_id:t.userId,username:t.username}]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as f,Strategy as d}from"@jackwener/opencli/registry";import{ArgumentError as s,CommandExecutionError as c,EmptyResultError as u}from"@jackwener/opencli/errors";import{S2_GRAPH_BASE as h,normalizePaperRow as g,requireBoundedInt as w,requirePaperRef as y,s2Fetch as I}from"./utils.js";const S=["paperId","title","year","authors","citationCount","externalIds"].join(",");f({site:"semanticscholar",name:"citations",access:"read",description:"List papers that cite a Semantic Scholar paper (paginated)",domain:"api.semanticscholar.org",strategy:d.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,help:"paperId (40-char hex), DOI, arXiv id, or prefixed id"},{name:"limit",type:"int",default:20,help:"Max citing papers (1-1000, single Semantic Scholar page)"},{name:"offset",type:"int",default:0,help:"Page offset (0-based)"}],columns:["rank","paperId","doi","title","year","firstAuthor","citationCount","url"],func:async(e)=>{const p=y(e.id),o=w(e.limit,20,1000),a=e.offset??0,t=typeof a==="number"?a:Number(a);if(!Number.isInteger(t)||t<0)throw new s("semanticscholar citations offset must be a non-negative integer");if(t>9999)throw new s("semanticscholar citations offset must be <= 9999");const l=`${h}/paper/${encodeURIComponent(p)}/citations?fields=${S}&limit=${o}&offset=${t}`,n=await I(l,"semanticscholar citations"),r=Array.isArray(n?.data)?n.data:null;if(r===null)throw new c("semanticscholar citations returned an unexpected payload shape");if(!r.length)throw new u("semanticscholar citations",`No Semantic Scholar citations for "${e.id}" at offset ${t}.`);return r.slice(0,o).map((i,m)=>{if(!i||typeof i!=="object"||!("citingPaper"in i))throw new c("semanticscholar citations row is missing citingPaper");return g(i.citingPaper,"citations",{rank:t+m+1})})}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as o,Strategy as i}from"@jackwener/opencli/registry";import{CommandExecutionError as p}from"@jackwener/opencli/errors";import{S2_GRAPH_BASE as l,normalizePaperRow as c,optionalNumber as r,requirePaperRef as u,s2Fetch as d,tldrText as s}from"./utils.js";const f=["paperId","title","year","authors","citationCount","influentialCitationCount","referenceCount","tldr","externalIds","url"].join(",");o({site:"semanticscholar",name:"paper",access:"read",description:"Semantic Scholar paper detail (citation graph + AI tldr) by paperId, DOI, or arXiv id",domain:"api.semanticscholar.org",strategy:i.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,help:'paperId (40-char hex), DOI, arXiv id, or prefixed id (e.g. "ARXIV:1706.03762", "PMID:12345")'}],columns:["paperId","doi","title","year","firstAuthor","citationCount","influentialCitationCount","referenceCount","tldr","url"],func:async(t)=>{const a=u(t.id),n=`${l}/paper/${encodeURIComponent(a)}?fields=${f}`,e=await d(n,"semanticscholar paper");if(!e||typeof e!=="object")throw new p("semanticscholar paper returned an unexpected payload shape");return[{...c(e,"paper"),influentialCitationCount:r(e.influentialCitationCount,"paper influentialCitationCount"),referenceCount:r(e.referenceCount,"paper referenceCount"),tldr:s(e.tldr)}]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as c,Strategy as
|
|
1
|
+
import{cli as c,Strategy as s}from"@jackwener/opencli/registry";import{CommandExecutionError as d,EmptyResultError as l}from"@jackwener/opencli/errors";import{S2_REC_BASE as p,normalizePaperRow as u,requireBoundedInt as h,requirePaperRef as f,s2Fetch as I}from"./utils.js";const y=["paperId","title","year","authors","citationCount","externalIds"].join(",");c({site:"semanticscholar",name:"recommendations",access:"read",description:"Semantic Scholar AI-curated related papers for a paperId, DOI, or arXiv id",domain:"api.semanticscholar.org",strategy:s.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,help:"paperId (40-char hex), DOI, arXiv id, or prefixed id"},{name:"limit",type:"int",default:10,help:"Max recommendations (1-500)"}],columns:["rank","paperId","doi","title","year","firstAuthor","citationCount","url"],func:async(e)=>{const t=f(e.id),o=h(e.limit,10,500),n=`${p}/papers/forpaper/${encodeURIComponent(t)}?fields=${y}&limit=${o}`,a=await I(n,"semanticscholar recommendations"),r=Array.isArray(a?.recommendedPapers)?a.recommendedPapers:null;if(r===null)throw new d("semanticscholar recommendations returned an unexpected payload shape");if(!r.length)throw new l("semanticscholar recommendations",`No Semantic Scholar recommendations for "${e.id}".`);return r.slice(0,o).map((i,m)=>u(i,"recommendations",{rank:m+1}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{CommandExecutionError as
|
|
1
|
+
import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{CommandExecutionError as m,EmptyResultError as p}from"@jackwener/opencli/errors";import{S2_GRAPH_BASE as u,normalizePaperRow as h,requireBoundedInt as d,requireString as y,s2Fetch as f}from"./utils.js";const S=["paperId","title","year","authors","citationCount","externalIds"].join(",");c({site:"semanticscholar",name:"search",access:"read",description:"Search Semantic Scholar papers by free text",domain:"api.semanticscholar.org",strategy:l.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Search text (e.g. "attention is all you need", "diffusion model")'},{name:"limit",type:"int",default:20,help:"Max papers (1-100, single Semantic Scholar page)"}],columns:["rank","paperId","doi","title","year","firstAuthor","citationCount","url"],func:async(r)=>{const a=y(r.query,"query"),t=d(r.limit,20,100),i=`${u}/paper/search?query=${encodeURIComponent(a)}&limit=${t}&fields=${S}`,n=await f(i,"semanticscholar search"),e=Array.isArray(n?.data)?n.data:null;if(e===null)throw new m("semanticscholar search returned an unexpected payload shape");if(!e.length)throw new p("semanticscholar search",`No Semantic Scholar papers matched "${a}".`);return e.slice(0,t).map((o,s)=>h(o,"search",{rank:s+1}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as m,CommandExecutionError as n,EmptyResultError as f}from"@jackwener/opencli/errors";export const S2_GRAPH_BASE="https://api.semanticscholar.org/graph/v1",S2_REC_BASE="https://api.semanticscholar.org/recommendations/v1";const h="opencli-semanticscholar-adapter (+https://github.com/jackwener/OpenCLI)",w=/^[0-9a-f]{40}$/i,u=/^10\.\S+$/,p=/^\d{4}\.\d{4,5}(?:v\d+)?$/,d=/^[a-z-]+\/\d{7}(?:v\d+)?$/i,y=/^(ARXIV|MAG|ACL|PMID|PMCID|URL|CorpusId|DBLP):/i;export function requireString(t,r){const e=String(t??"").trim();if(!e)throw new m(`semanticscholar ${r} cannot be empty`);return e}export function requireBoundedInt(t,r,e,i="limit"){const o=t??r,s=typeof o==="number"?o:Number(o);if(!Number.isInteger(s)||s<=0)throw new m(`semanticscholar ${i} must be a positive integer`);if(s>e)throw new m(`semanticscholar ${i} must be <= ${e}`);return s}export function requirePaperRef(t){const r=String(t??"").trim();if(!r)throw new m("semanticscholar paper id cannot be empty","Example: ppcli semanticscholar paper 10.18653/v1/N19-1423");const e=r.match(/^https?:\/\/(?:www\.)?semanticscholar\.org\/paper\/(?:[^/]+\/)?([0-9a-f]{40})/i);if(e)return e[1].toLowerCase();if(w.test(r))return r.toLowerCase();if(y.test(r))return r;if(/^doi:/i.test(r)){const o=r.replace(/^doi:/i,"").trim();if(u.test(o))return`DOI:${o}`}const i=r.match(/^https?:\/\/(?:dx\.)?doi\.org\/(.+)$/i);if(i&&u.test(i[1]))return`DOI:${i[1]}`;if(u.test(r))return`DOI:${r}`;if(p.test(r)||d.test(r))return`ARXIV:${r}`;throw new m(`semanticscholar paper id "${t}" is not recognised`,'Use a Semantic Scholar paperId, a DOI, an arXiv id, or a prefixed id (e.g. "ARXIV:1706.03762", "PMID:12345").')}export async function s2Fetch(t,r){const e={"user-agent":h,accept:"application/json"},i=process.env.SEMANTIC_SCHOLAR_API_KEY;if(i)e["x-api-key"]=i;let o,s=0;while(!0){try{o=await fetch(t,{headers:e})}catch(c){throw new n(`${r} request failed: ${c?.message??c}`,"Check that api.semanticscholar.org is reachable from this network.")}if(o.status===429&&s===0&&!i){s+=1;await new Promise((c)=>setTimeout(c,1500));continue}break}if(o.status===404)throw new f(r,`Semantic Scholar returned 404 for ${t}.`);if(o.status===429)throw new n(`${r} returned HTTP 429 (rate limited)`,"Semantic Scholar throttles anonymous traffic; set SEMANTIC_SCHOLAR_API_KEY (free at https://www.semanticscholar.org/product/api) or wait a minute and retry.");if(!o.ok)throw new n(`${r} returned HTTP ${o.status}`);let a;try{a=await o.json()}catch(c){throw new n(`${r} returned malformed JSON: ${c?.message??c}`)}if(a&&typeof a==="object"&&a.error)throw new n(`${r} returned an error: ${a.error}`);return a}export function tldrText(t){if(t&&typeof t==="object"&&typeof t.text==="string")return t.text.trim();return""}export function firstAuthorName(t){if(!Array.isArray(t)||!t.length)return"";const r=t[0];if(r&&typeof r==="object"&&typeof r.name==="string")return r.name.trim();return""}export function optionalNumber(t,r){if(t==null)return null;if(typeof t!=="number"||!Number.isFinite(t))throw new n(`semanticscholar ${r} must be a number when present`);return t}export function normalizePaperRow(t,r,{rank:e}={}){if(!t||typeof t!=="object")throw new n(`semanticscholar ${r} row is not an object`);if(typeof t.paperId!=="string"||!t.paperId.trim())throw new n(`semanticscholar ${r} row is missing paperId`);if(typeof t.title!=="string"||!t.title.trim())throw new n(`semanticscholar ${r} row is missing title`);if(t.authors!=null&&!Array.isArray(t.authors))throw new n(`semanticscholar ${r} row has malformed authors`);const i={paperId:t.paperId.trim(),doi:pickDoi(t.externalIds),title:t.title.trim(),year:optionalNumber(t.year,`${r} year`),firstAuthor:firstAuthorName(t.authors),citationCount:optionalNumber(t.citationCount,`${r} citationCount`),url:typeof t.url==="string"&&t.url.trim()?t.url.trim():`https://www.semanticscholar.org/paper/${t.paperId.trim()}`};if(e!=null)return{rank:e,...i};return i}export function pickDoi(t){if(t&&typeof t==="object"&&typeof t.DOI==="string")return t.DOI;return""}
|
package/clis/sinafinance/news.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as o,Strategy as m}from"@jackwener/opencli/registry";import{CliError as a}from"@jackwener/opencli/errors";const p=[0,10,1,3,4,5,102,6,6,8];function l(t){return t.replace(/<[^>]+>/g,"").trim()}o({site:"sinafinance",name:"news",access:"read",description:"新浪财经 7x24 小时实时快讯",domain:"app.cj.sina.com.cn",strategy:m.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"Max results (max 50)"},{name:"type",type:"int",default:0,help:"News type: 0=全部 1=A股 2=宏观 3=公司 4=数据 5=市场 6=国际 7=观点 8=央行 9=其它"}],columns:["id","time","content","views"],func:async(t)=>{const s=Math.max(1,Math.min(Number(t.limit),50)),r=p[t.type]??0,c=new URLSearchParams({page:"1",size:String(s),tag:String(r)}),n=await fetch(`https://app.cj.sina.com.cn/api/news/pc?${c}`);if(!n.ok)throw new a("FETCH_ERROR",`Sina Finance API HTTP ${n.status}`,"Check your network connection");const i=(await n.json())?.result?.data?.feed?.list??[];if(!i.length)throw new a("NOT_FOUND","No news found","Try a different type or increase limit");return i.map((e)=>({id:e.id??"",time:e.create_time??"",content:l(e.rich_text??""),views:e.view_num??0}))}});
|