publishport-opencli 1.0.0
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/LICENSE +214 -0
- package/README.md +299 -0
- package/README.zh-CN.md +341 -0
- package/cli-manifest.json +51513 -0
- package/clis/12306/auth.js +25 -0
- package/clis/12306/me.js +9 -0
- package/clis/12306/orders.js +13 -0
- package/clis/12306/passengers.js +14 -0
- package/clis/12306/price.js +1 -0
- package/clis/12306/stations.js +1 -0
- package/clis/12306/train.js +1 -0
- package/clis/12306/trains.js +1 -0
- package/clis/12306/utils.js +1 -0
- package/clis/1688/assets.js +127 -0
- package/clis/1688/auth.js +1 -0
- package/clis/1688/download.js +1 -0
- package/clis/1688/item.js +21 -0
- package/clis/1688/search.js +129 -0
- package/clis/1688/shared.js +11 -0
- package/clis/1688/store.js +26 -0
- package/clis/1point3acres/auth.js +18 -0
- package/clis/1point3acres/digest.js +1 -0
- package/clis/1point3acres/forum.js +1 -0
- package/clis/1point3acres/forums.js +1 -0
- package/clis/1point3acres/hot.js +1 -0
- package/clis/1point3acres/latest.js +1 -0
- package/clis/1point3acres/notifications.js +1 -0
- package/clis/1point3acres/search.js +1 -0
- package/clis/1point3acres/thread.js +2 -0
- package/clis/1point3acres/user.js +1 -0
- package/clis/1point3acres/utils.js +6 -0
- package/clis/36kr/article.js +20 -0
- package/clis/36kr/hot.js +16 -0
- package/clis/36kr/news.js +1 -0
- package/clis/36kr/search.js +36 -0
- package/clis/51job/company.js +36 -0
- package/clis/51job/detail.js +35 -0
- package/clis/51job/hot.js +1 -0
- package/clis/51job/search.js +1 -0
- package/clis/51job/utils.js +21 -0
- package/clis/_atlassian/shared.js +21 -0
- package/clis/_shared/article/auth.js +16 -0
- package/clis/_shared/article/douban-md2draft.js +4 -0
- package/clis/_shared/article/format.js +1 -0
- package/clis/_shared/article/images.js +95 -0
- package/clis/_shared/article/login.js +1 -0
- package/clis/_shared/article/page-runtime.js +745 -0
- package/clis/_shared/article/publish.js +34 -0
- package/clis/_shared/common.js +1 -0
- package/clis/_shared/content-guard.js +1 -0
- package/clis/_shared/desktop-commands.js +1 -0
- package/clis/_shared/search-adapter.js +1 -0
- package/clis/_shared/site-auth.js +1 -0
- package/clis/_shared/token-auth.js +2 -0
- package/clis/_shared/video-publish.js +62 -0
- package/clis/aibase/news.js +31 -0
- package/clis/amazon/auth.js +19 -0
- package/clis/amazon/bestsellers.js +1 -0
- package/clis/amazon/discussion.js +20 -0
- package/clis/amazon/movers-shakers.js +1 -0
- package/clis/amazon/new-releases.js +1 -0
- package/clis/amazon/offer.js +29 -0
- package/clis/amazon/product.js +25 -0
- package/clis/amazon/rankings.js +68 -0
- package/clis/amazon/search.js +16 -0
- package/clis/amazon/shared.js +11 -0
- package/clis/antigravity/SKILL.md +38 -0
- package/clis/antigravity/_actions.js +201 -0
- package/clis/antigravity/audit-extras.js +78 -0
- package/clis/antigravity/delete.js +1 -0
- package/clis/antigravity/dump.js +1 -0
- package/clis/antigravity/extract-code.js +18 -0
- package/clis/antigravity/history.js +1 -0
- package/clis/antigravity/mark-read.js +1 -0
- package/clis/antigravity/model.js +90 -0
- package/clis/antigravity/new.js +9 -0
- package/clis/antigravity/read.js +10 -0
- package/clis/antigravity/rename.js +1 -0
- package/clis/antigravity/send.js +11 -0
- package/clis/antigravity/serve.js +97 -0
- package/clis/antigravity/status.js +1 -0
- package/clis/antigravity/storage.js +12 -0
- package/clis/antigravity/watch.js +6 -0
- package/clis/apple-podcasts/episodes.js +1 -0
- package/clis/apple-podcasts/search.js +1 -0
- package/clis/apple-podcasts/top.js +1 -0
- package/clis/apple-podcasts/utils.js +1 -0
- package/clis/archive/item.js +1 -0
- package/clis/archive/search.js +1 -0
- package/clis/archive/snapshots.js +1 -0
- package/clis/archive/wayback.js +1 -0
- package/clis/arxiv/author.js +1 -0
- package/clis/arxiv/paper.js +1 -0
- package/clis/arxiv/recent.js +1 -0
- package/clis/arxiv/search.js +1 -0
- package/clis/arxiv/utils.js +1 -0
- package/clis/autohome/__fixtures__/catalog.html +11 -0
- package/clis/autohome/__fixtures__/koubei.json +116 -0
- package/clis/autohome/brand.js +1 -0
- package/clis/autohome/score.js +1 -0
- package/clis/autohome/utils.js +1 -0
- package/clis/baidu-scholar/search.js +63 -0
- package/clis/baijiahao/article.js +1 -0
- package/clis/baijiahao/lists.js +1 -0
- package/clis/baijiahao/login.js +1 -0
- package/clis/baijiahao/publish.js +57 -0
- package/clis/baijiahao/stats.js +1 -0
- package/clis/baijiahao/whoami.js +1 -0
- package/clis/band/auth.js +29 -0
- package/clis/band/bands.js +37 -0
- package/clis/band/mentions.js +6 -0
- package/clis/band/post.js +76 -0
- package/clis/band/posts.js +50 -0
- package/clis/barchart/flow.js +70 -0
- package/clis/barchart/greeks.js +88 -0
- package/clis/barchart/options.js +61 -0
- package/clis/barchart/quote.js +87 -0
- package/clis/bbc/news.js +1 -0
- package/clis/bbc/topic.js +1 -0
- package/clis/bbc/utils.js +1 -0
- package/clis/bilibili/article.js +1 -0
- package/clis/bilibili/auth.js +1 -0
- package/clis/bilibili/categories.js +1 -0
- package/clis/bilibili/coin.js +1 -0
- package/clis/bilibili/comment-del.js +1 -0
- package/clis/bilibili/comment-like.js +1 -0
- package/clis/bilibili/comment.js +1 -0
- package/clis/bilibili/comments.js +1 -0
- package/clis/bilibili/dm-list.js +1 -0
- package/clis/bilibili/dm-read.js +1 -0
- package/clis/bilibili/dm-send.js +1 -0
- package/clis/bilibili/download.js +7 -0
- package/clis/bilibili/drafts.js +1 -0
- package/clis/bilibili/dynamic-post.js +24 -0
- package/clis/bilibili/dynamic.js +1 -0
- package/clis/bilibili/favorite-add.js +1 -0
- package/clis/bilibili/favorite.js +1 -0
- package/clis/bilibili/feed.js +2 -0
- package/clis/bilibili/follow.js +1 -0
- package/clis/bilibili/following.js +1 -0
- package/clis/bilibili/history.js +1 -0
- package/clis/bilibili/hot.js +15 -0
- package/clis/bilibili/like.js +1 -0
- package/clis/bilibili/me.js +1 -0
- package/clis/bilibili/partitions.js +1 -0
- package/clis/bilibili/ranking.js +1 -0
- package/clis/bilibili/search.js +1 -0
- package/clis/bilibili/stats.js +1 -0
- package/clis/bilibili/subtitle.js +21 -0
- package/clis/bilibili/summary.js +1 -0
- package/clis/bilibili/topics.js +1 -0
- package/clis/bilibili/unfollow.js +1 -0
- package/clis/bilibili/upload.js +1 -0
- package/clis/bilibili/user-videos.js +1 -0
- package/clis/bilibili/utils.js +50 -0
- package/clis/bilibili/video-drafts.js +1 -0
- package/clis/bilibili/video.js +1 -0
- package/clis/binance/asks.js +1 -0
- package/clis/binance/depth.js +1 -0
- package/clis/binance/gainers.js +1 -0
- package/clis/binance/klines.js +1 -0
- package/clis/binance/losers.js +1 -0
- package/clis/binance/pairs.js +1 -0
- package/clis/binance/price.js +1 -0
- package/clis/binance/prices.js +1 -0
- package/clis/binance/ticker.js +1 -0
- package/clis/binance/top.js +1 -0
- package/clis/binance/trades.js +1 -0
- package/clis/bloomberg/businessweek.js +12 -0
- package/clis/bloomberg/crypto.js +1 -0
- package/clis/bloomberg/economics.js +1 -0
- package/clis/bloomberg/feeds.js +1 -0
- package/clis/bloomberg/green.js +1 -0
- package/clis/bloomberg/industries.js +1 -0
- package/clis/bloomberg/main.js +1 -0
- package/clis/bloomberg/markets.js +1 -0
- package/clis/bloomberg/news.js +57 -0
- package/clis/bloomberg/opinions.js +1 -0
- package/clis/bloomberg/politics.js +1 -0
- package/clis/bloomberg/pursuits.js +1 -0
- package/clis/bloomberg/tech.js +1 -0
- package/clis/bloomberg/utils.js +17 -0
- package/clis/bluesky/post.js +1 -0
- package/clis/bluesky/shared.js +56 -0
- package/clis/bluesky/whoami.js +1 -0
- package/clis/booking/search.js +93 -0
- package/clis/boss/auth.js +13 -0
- package/clis/boss/batchgreet.js +1 -0
- package/clis/boss/chatlist.js +1 -0
- package/clis/boss/chatmsg.js +1 -0
- package/clis/boss/detail.js +1 -0
- package/clis/boss/exchange.js +1 -0
- package/clis/boss/greet.js +1 -0
- package/clis/boss/invite.js +4 -0
- package/clis/boss/joblist.js +1 -0
- package/clis/boss/mark.js +1 -0
- package/clis/boss/recommend.js +1 -0
- package/clis/boss/resume.js +90 -0
- package/clis/boss/search.js +1 -0
- package/clis/boss/send.js +1 -0
- package/clis/boss/stats.js +1 -0
- package/clis/boss/utils.js +161 -0
- package/clis/brave/search.js +23 -0
- package/clis/chaoxing/assignments.js +1 -0
- package/clis/chaoxing/auth.js +21 -0
- package/clis/chaoxing/exams.js +1 -0
- package/clis/chaoxing/utils.js +58 -0
- package/clis/chatgpt/ask.js +1 -0
- package/clis/chatgpt/auth.js +17 -0
- package/clis/chatgpt/detail.js +1 -0
- package/clis/chatgpt/history.js +1 -0
- package/clis/chatgpt/image.js +1 -0
- package/clis/chatgpt/model.js +1 -0
- package/clis/chatgpt/new.js +1 -0
- package/clis/chatgpt/project-file-add.js +1 -0
- package/clis/chatgpt/project-list.js +1 -0
- package/clis/chatgpt/read.js +1 -0
- package/clis/chatgpt/send.js +1 -0
- package/clis/chatgpt/status.js +1 -0
- package/clis/chatgpt/utils.js +1092 -0
- package/clis/chatgpt-app/ask.js +1 -0
- package/clis/chatgpt-app/ax.js +512 -0
- package/clis/chatgpt-app/model.js +1 -0
- package/clis/chatgpt-app/new.js +1 -0
- package/clis/chatgpt-app/read.js +1 -0
- package/clis/chatgpt-app/send.js +1 -0
- package/clis/chatgpt-app/status.js +1 -0
- package/clis/chatwise/ask.js +1 -0
- package/clis/chatwise/export.js +21 -0
- package/clis/chatwise/history.js +26 -0
- package/clis/chatwise/model.js +48 -0
- package/clis/chatwise/new.js +1 -0
- package/clis/chatwise/read.js +25 -0
- package/clis/chatwise/screenshot.js +1 -0
- package/clis/chatwise/send.js +1 -0
- package/clis/chatwise/status.js +1 -0
- package/clis/chatwise/utils.js +75 -0
- package/clis/chess/analyze.js +1 -0
- package/clis/chess/game.js +1 -0
- package/clis/chess/games.js +1 -0
- package/clis/chess/stats.js +1 -0
- package/clis/chess/utils.js +1 -0
- package/clis/claude/ask.js +4 -0
- package/clis/claude/auth.js +19 -0
- package/clis/claude/detail.js +1 -0
- package/clis/claude/history.js +1 -0
- package/clis/claude/new.js +1 -0
- package/clis/claude/read.js +1 -0
- package/clis/claude/send.js +1 -0
- package/clis/claude/status.js +1 -0
- package/clis/claude/utils.js +179 -0
- package/clis/cnblogs/article.js +1 -0
- package/clis/cnblogs/login.js +1 -0
- package/clis/cnblogs/stats.js +37 -0
- package/clis/cnblogs/whoami.js +1 -0
- package/clis/cnki/search.js +38 -0
- package/clis/codex/_actions.js +72 -0
- package/clis/codex/archive.js +1 -0
- package/clis/codex/ask.js +23 -0
- package/clis/codex/dump.js +1 -0
- package/clis/codex/export.js +12 -0
- package/clis/codex/extract-diff.js +28 -0
- package/clis/codex/history.js +1 -0
- package/clis/codex/model.js +118 -0
- package/clis/codex/new.js +1 -0
- package/clis/codex/pin.js +1 -0
- package/clis/codex/projects.js +1 -0
- package/clis/codex/read.js +16 -0
- package/clis/codex/rename.js +34 -0
- package/clis/codex/screenshot.js +1 -0
- package/clis/codex/send.js +16 -0
- package/clis/codex/sidebar.js +1 -0
- package/clis/codex/status.js +1 -0
- package/clis/coingecko/categories.js +1 -0
- package/clis/coingecko/coin.js +1 -0
- package/clis/coingecko/derivatives.js +1 -0
- package/clis/coingecko/exchanges.js +1 -0
- package/clis/coingecko/global.js +1 -0
- package/clis/coingecko/top.js +1 -0
- package/clis/coingecko/trending.js +1 -0
- package/clis/confluence/create.js +1 -0
- package/clis/confluence/page.js +1 -0
- package/clis/confluence/search.js +1 -0
- package/clis/confluence/shared.js +1 -0
- package/clis/confluence/update.js +1 -0
- package/clis/coupang/add-to-cart.js +86 -0
- package/clis/coupang/auth.js +16 -0
- package/clis/coupang/product.js +161 -0
- package/clis/coupang/search.js +385 -0
- package/clis/coupang/utils.js +1 -0
- package/clis/crates/crate.js +1 -0
- package/clis/crates/search.js +1 -0
- package/clis/crates/utils.js +1 -0
- package/clis/csdn/article.js +29 -0
- package/clis/csdn/columns.js +1 -0
- package/clis/csdn/login.js +1 -0
- package/clis/csdn/stats.js +71 -0
- package/clis/csdn/whoami.js +1 -0
- package/clis/cto51/article.js +1 -0
- package/clis/cto51/whoami.js +1 -0
- package/clis/ctrip/auth.js +1 -0
- package/clis/ctrip/flight.js +17 -0
- package/clis/ctrip/hotel-search.js +24 -0
- package/clis/ctrip/hotel-suggest.js +1 -0
- package/clis/ctrip/search.js +1 -0
- package/clis/ctrip/utils.js +119 -0
- package/clis/cursor/ask.js +22 -0
- package/clis/cursor/composer.js +12 -0
- package/clis/cursor/dump.js +1 -0
- package/clis/cursor/export.js +23 -0
- package/clis/cursor/extract-code.js +18 -0
- package/clis/cursor/history.js +26 -0
- package/clis/cursor/model.js +18 -0
- package/clis/cursor/new.js +1 -0
- package/clis/cursor/read.js +27 -0
- package/clis/cursor/screenshot.js +1 -0
- package/clis/cursor/send.js +12 -0
- package/clis/cursor/status.js +1 -0
- package/clis/dblp/author.js +1 -0
- package/clis/dblp/paper.js +1 -0
- package/clis/dblp/search.js +1 -0
- package/clis/dblp/utils.js +1 -0
- package/clis/dblp/venue.js +1 -0
- package/clis/deepseek/ask.js +1 -0
- package/clis/deepseek/auth.js +22 -0
- package/clis/deepseek/detail.js +1 -0
- package/clis/deepseek/history.js +1 -0
- package/clis/deepseek/new.js +1 -0
- package/clis/deepseek/read.js +1 -0
- package/clis/deepseek/send.js +50 -0
- package/clis/deepseek/status.js +1 -0
- package/clis/deepseek/utils.js +202 -0
- package/clis/defillama/protocol.js +1 -0
- package/clis/defillama/protocols.js +1 -0
- package/clis/defillama/utils.js +1 -0
- package/clis/devto/auth.js +9 -0
- package/clis/devto/latest.js +1 -0
- package/clis/devto/publish.js +17 -0
- package/clis/devto/read.js +3 -0
- package/clis/devto/stats.js +27 -0
- package/clis/devto/tag.js +1 -0
- package/clis/devto/top.js +1 -0
- package/clis/devto/user.js +1 -0
- package/clis/dianping/__fixtures__/search.html +168 -0
- package/clis/dianping/__fixtures__/shop.html +6 -0
- package/clis/dianping/auth.js +10 -0
- package/clis/dianping/cityResolver.js +4 -0
- package/clis/dianping/search.js +1 -0
- package/clis/dianping/shop.js +1 -0
- package/clis/dianping/utils.js +1 -0
- package/clis/dictionary/examples.js +1 -0
- package/clis/dictionary/search.js +1 -0
- package/clis/dictionary/synonyms.js +1 -0
- package/clis/discord-app/channels.js +1 -0
- package/clis/discord-app/delete.js +66 -0
- package/clis/discord-app/goto.js +1 -0
- package/clis/discord-app/members.js +21 -0
- package/clis/discord-app/read.js +1 -0
- package/clis/discord-app/search.js +29 -0
- package/clis/discord-app/send.js +10 -0
- package/clis/discord-app/servers.js +1 -0
- package/clis/discord-app/status.js +1 -0
- package/clis/discord-app/thread-read.js +1 -0
- package/clis/discord-app/threads.js +1 -0
- package/clis/discord-app/utils.js +226 -0
- package/clis/discord-web/auth.js +10 -0
- package/clis/discord-web/send.js +13 -0
- package/clis/dockerhub/image.js +1 -0
- package/clis/dockerhub/search.js +1 -0
- package/clis/dockerhub/utils.js +1 -0
- package/clis/dongchedi/__fixtures__/search.json +60 -0
- package/clis/dongchedi/__fixtures__/series-detail.json +911 -0
- package/clis/dongchedi/__fixtures__/series-score.json +1396 -0
- package/clis/dongchedi/koubei.js +1 -0
- package/clis/dongchedi/models.js +1 -0
- package/clis/dongchedi/score.js +1 -0
- package/clis/dongchedi/search.js +1 -0
- package/clis/dongchedi/series.js +1 -0
- package/clis/dongchedi/specs.js +1 -0
- package/clis/dongchedi/utils.js +1 -0
- package/clis/douban/article.js +53 -0
- package/clis/douban/auth.js +21 -0
- package/clis/douban/book-hot.js +1 -0
- package/clis/douban/download.js +1 -0
- package/clis/douban/marks.js +59 -0
- package/clis/douban/movie-hot.js +1 -0
- package/clis/douban/photos.js +1 -0
- package/clis/douban/reviews.js +53 -0
- package/clis/douban/search.js +1 -0
- package/clis/douban/subject.js +1 -0
- package/clis/douban/top250.js +50 -0
- package/clis/douban/utils.js +344 -0
- package/clis/doubao/ask.js +1 -0
- package/clis/doubao/auth.js +28 -0
- package/clis/doubao/detail.js +1 -0
- package/clis/doubao/history.js +1 -0
- package/clis/doubao/meeting-summary.js +1 -0
- package/clis/doubao/meeting-transcript.js +1 -0
- package/clis/doubao/new.js +1 -0
- package/clis/doubao/read.js +1 -0
- package/clis/doubao/send.js +1 -0
- package/clis/doubao/status.js +1 -0
- package/clis/doubao/utils.js +704 -0
- package/clis/doubao-app/ask.js +1 -0
- package/clis/doubao-app/dump.js +1 -0
- package/clis/doubao-app/new.js +1 -0
- package/clis/doubao-app/read.js +1 -0
- package/clis/doubao-app/screenshot.js +1 -0
- package/clis/doubao-app/send.js +1 -0
- package/clis/doubao-app/status.js +1 -0
- package/clis/doubao-app/utils.js +64 -0
- package/clis/douyin/_shared/browser-fetch.js +28 -0
- package/clis/douyin/_shared/creation-id.js +1 -0
- package/clis/douyin/_shared/evaluate-result.js +1 -0
- package/clis/douyin/_shared/imagex-upload.js +1 -0
- package/clis/douyin/_shared/public-api.js +1 -0
- package/clis/douyin/_shared/sts2.js +1 -0
- package/clis/douyin/_shared/text-extra.js +1 -0
- package/clis/douyin/_shared/timing.js +1 -0
- package/clis/douyin/_shared/tos-upload.js +5 -0
- package/clis/douyin/_shared/transcode.js +1 -0
- package/clis/douyin/_shared/types.js +1 -0
- package/clis/douyin/_shared/vod-upload.js +5 -0
- package/clis/douyin/activities.js +1 -0
- package/clis/douyin/auth.js +1 -0
- package/clis/douyin/collections.js +1 -0
- package/clis/douyin/delete.js +76 -0
- package/clis/douyin/draft.js +166 -0
- package/clis/douyin/drafts.js +1 -0
- package/clis/douyin/hashtag.js +1 -0
- package/clis/douyin/location.js +1 -0
- package/clis/douyin/profile.js +1 -0
- package/clis/douyin/publish-image.js +64 -0
- package/clis/douyin/publish.js +14 -0
- package/clis/douyin/search.js +51 -0
- package/clis/douyin/stats.js +1 -0
- package/clis/douyin/update.js +1 -0
- package/clis/douyin/user-videos.js +1 -0
- package/clis/douyin/videos.js +1 -0
- package/clis/duckduckgo/search.js +1 -0
- package/clis/duckduckgo/suggest.js +1 -0
- package/clis/eastmoney/_secid.js +1 -0
- package/clis/eastmoney/announcement.js +1 -0
- package/clis/eastmoney/article.js +1 -0
- package/clis/eastmoney/convertible.js +1 -0
- package/clis/eastmoney/etf.js +1 -0
- package/clis/eastmoney/holders.js +1 -0
- package/clis/eastmoney/hot-rank.js +30 -0
- package/clis/eastmoney/index-board.js +1 -0
- package/clis/eastmoney/kline.js +1 -0
- package/clis/eastmoney/kuaixun.js +1 -0
- package/clis/eastmoney/longhu.js +1 -0
- package/clis/eastmoney/money-flow.js +1 -0
- package/clis/eastmoney/northbound.js +1 -0
- package/clis/eastmoney/quote.js +1 -0
- package/clis/eastmoney/rank.js +1 -0
- package/clis/eastmoney/sectors.js +1 -0
- package/clis/eastmoney/whoami.js +1 -0
- package/clis/endoflife/product.js +1 -0
- package/clis/endoflife/utils.js +1 -0
- package/clis/facebook/__fixtures__/notifications-page.html +13 -0
- package/clis/facebook/add-friend.js +24 -0
- package/clis/facebook/auth.js +1 -0
- package/clis/facebook/comment.js +18 -0
- package/clis/facebook/events.js +26 -0
- package/clis/facebook/feed.js +209 -0
- package/clis/facebook/friends.js +24 -0
- package/clis/facebook/groups.js +32 -0
- package/clis/facebook/join-group.js +25 -0
- package/clis/facebook/like.js +29 -0
- package/clis/facebook/marketplace-inbox.js +34 -0
- package/clis/facebook/marketplace-listings.js +33 -0
- package/clis/facebook/memories.js +21 -0
- package/clis/facebook/notifications.js +31 -0
- package/clis/facebook/post.js +88 -0
- package/clis/facebook/profile.js +18 -0
- package/clis/facebook/search.js +22 -0
- package/clis/flathub/app.js +1 -0
- package/clis/flathub/search.js +1 -0
- package/clis/flathub/utils.js +1 -0
- package/clis/flomo/auth.js +22 -0
- package/clis/flomo/memos.js +13 -0
- package/clis/gemini/ask.js +1 -0
- package/clis/gemini/auth.js +14 -0
- package/clis/gemini/deep-research-result.js +4 -0
- package/clis/gemini/deep-research.js +1 -0
- package/clis/gemini/detail.js +1 -0
- package/clis/gemini/history.js +1 -0
- package/clis/gemini/image.js +3 -0
- package/clis/gemini/new.js +1 -0
- package/clis/gemini/read.js +1 -0
- package/clis/gemini/status.js +1 -0
- package/clis/gemini/utils.js +1234 -0
- package/clis/geogebra/add-circle.js +1 -0
- package/clis/geogebra/add-line.js +1 -0
- package/clis/geogebra/add-point.js +1 -0
- package/clis/geogebra/add-polygon.js +1 -0
- package/clis/geogebra/eval.js +1 -0
- package/clis/geogebra/hexagon.js +1 -0
- package/clis/geogebra/info.js +13 -0
- package/clis/geogebra/list.js +1 -0
- package/clis/geogebra/triangle.js +1 -0
- package/clis/geogebra/utils.js +99 -0
- package/clis/ghost/publish.js +1 -0
- package/clis/ghost/shared.js +1 -0
- package/clis/ghost/whoami.js +1 -0
- package/clis/gitee/auth.js +12 -0
- package/clis/gitee/index.js +1 -0
- package/clis/gitee/search.js +1 -0
- package/clis/gitee/trending.js +240 -0
- package/clis/gitee/user.js +71 -0
- package/clis/github/auth.js +7 -0
- package/clis/github-trending/repos.js +1 -0
- package/clis/google/news.js +1 -0
- package/clis/google/search.js +90 -0
- package/clis/google/suggest.js +1 -0
- package/clis/google/trends.js +1 -0
- package/clis/google/utils.js +1 -0
- package/clis/google-scholar/cite.js +20 -0
- package/clis/google-scholar/profile.js +36 -0
- package/clis/google-scholar/search.js +35 -0
- package/clis/goproxy/module.js +1 -0
- package/clis/goproxy/utils.js +1 -0
- package/clis/goproxy/versions.js +1 -0
- package/clis/gov-law/recent.js +1 -0
- package/clis/gov-law/search.js +14 -0
- package/clis/gov-law/shared.js +29 -0
- package/clis/gov-policy/__fixtures__/recent.html +16 -0
- package/clis/gov-policy/__fixtures__/search.html +41 -0
- package/clis/gov-policy/recent.js +8 -0
- package/clis/gov-policy/search.js +8 -0
- package/clis/gov-policy/utils.js +1 -0
- package/clis/grok/ask.js +1 -0
- package/clis/grok/auth.js +17 -0
- package/clis/grok/delete.js +1 -0
- package/clis/grok/detail.js +1 -0
- package/clis/grok/export-all.js +170 -0
- package/clis/grok/export-utils.js +1 -0
- package/clis/grok/export.js +106 -0
- package/clis/grok/history.js +1 -0
- package/clis/grok/image.js +119 -0
- package/clis/grok/image.test.ts +127 -0
- package/clis/grok/new.js +1 -0
- package/clis/grok/pin.js +1 -0
- package/clis/grok/read.js +1 -0
- package/clis/grok/send.js +1 -0
- package/clis/grok/status.js +1 -0
- package/clis/grok/utils.js +337 -0
- package/clis/guazi/__fixtures__/detail.html +7 -0
- package/clis/guazi/__fixtures__/list.html +5 -0
- package/clis/guazi/browse.js +1 -0
- package/clis/guazi/car.js +1 -0
- package/clis/guazi/utils.js +1 -0
- package/clis/hackernews/ask.js +1 -0
- package/clis/hackernews/auth.js +9 -0
- package/clis/hackernews/best.js +1 -0
- package/clis/hackernews/comment.js +61 -0
- package/clis/hackernews/jobs.js +1 -0
- package/clis/hackernews/new.js +1 -0
- package/clis/hackernews/read.js +11 -0
- package/clis/hackernews/search.js +1 -0
- package/clis/hackernews/show.js +1 -0
- package/clis/hackernews/submit.js +65 -0
- package/clis/hackernews/top.js +1 -0
- package/clis/hackernews/user.js +1 -0
- package/clis/hashnode/auth.js +11 -0
- package/clis/hashnode/publish.js +92 -0
- package/clis/hf/auth.js +12 -0
- package/clis/hf/datasets.js +1 -0
- package/clis/hf/models.js +1 -0
- package/clis/hf/paper.js +1 -0
- package/clis/hf/spaces.js +1 -0
- package/clis/hf/top.js +1 -0
- package/clis/homebrew/cask.js +1 -0
- package/clis/homebrew/formula.js +1 -0
- package/clis/homebrew/popular.js +1 -0
- package/clis/homebrew/utils.js +1 -0
- package/clis/huodongxing/events.js +1 -0
- package/clis/hupu/__fixtures__/hot-home.html +64 -0
- package/clis/hupu/auth.js +14 -0
- package/clis/hupu/detail.js +7 -0
- package/clis/hupu/hot.js +14 -0
- package/clis/hupu/like.js +1 -0
- package/clis/hupu/mentions.js +91 -0
- package/clis/hupu/reply.js +1 -0
- package/clis/hupu/search.js +1 -0
- package/clis/hupu/unlike.js +1 -0
- package/clis/hupu/utils.js +243 -0
- package/clis/imdb/person.js +140 -0
- package/clis/imdb/reviews.js +40 -0
- package/clis/imdb/search.js +113 -0
- package/clis/imdb/title.js +1 -0
- package/clis/imdb/top.js +1 -0
- package/clis/imdb/trending.js +1 -0
- package/clis/imdb/utils.js +162 -0
- package/clis/imooc/article.js +59 -0
- package/clis/imooc/login.js +1 -0
- package/clis/imooc/whoami.js +1 -0
- package/clis/indeed/job.js +20 -0
- package/clis/indeed/search.js +37 -0
- package/clis/indeed/utils.js +1 -0
- package/clis/infoq/article.js +19 -0
- package/clis/infoq/login.js +1 -0
- package/clis/infoq/whoami.js +1 -0
- package/clis/instagram/_shared/private-publish.js +75 -0
- package/clis/instagram/_shared/protocol-capture.js +180 -0
- package/clis/instagram/_shared/runtime-info.js +33 -0
- package/clis/instagram/auth.js +22 -0
- package/clis/instagram/collection-create.js +38 -0
- package/clis/instagram/collection-delete.js +72 -0
- package/clis/instagram/comment.js +26 -0
- package/clis/instagram/detail.js +2 -0
- package/clis/instagram/download.js +83 -0
- package/clis/instagram/explore.js +27 -0
- package/clis/instagram/follow.js +24 -0
- package/clis/instagram/followers.js +30 -0
- package/clis/instagram/following.js +74 -0
- package/clis/instagram/like.js +25 -0
- package/clis/instagram/note.js +162 -0
- package/clis/instagram/post.js +718 -0
- package/clis/instagram/profile.js +25 -0
- package/clis/instagram/reel.js +452 -0
- package/clis/instagram/save.js +25 -0
- package/clis/instagram/saved.js +37 -0
- package/clis/instagram/search.js +23 -0
- package/clis/instagram/story.js +21 -0
- package/clis/instagram/unfollow.js +21 -0
- package/clis/instagram/unlike.js +25 -0
- package/clis/instagram/unsave.js +25 -0
- package/clis/instagram/user.js +1 -0
- package/clis/jd/add-cart.js +22 -0
- package/clis/jd/auth.js +12 -0
- package/clis/jd/cart.js +59 -0
- package/clis/jd/detail.js +42 -0
- package/clis/jd/item.js +98 -0
- package/clis/jd/item.test.ts +517 -0
- package/clis/jd/reviews.js +31 -0
- package/clis/jd/search.js +42 -0
- package/clis/jianshu/article.js +1 -0
- package/clis/jianshu/login.js +1 -0
- package/clis/jianshu/notebooks.js +1 -0
- package/clis/jianshu/whoami.js +1 -0
- package/clis/jianyu/auth.js +28 -0
- package/clis/jianyu/detail.js +1 -0
- package/clis/jianyu/search.js +73 -0
- package/clis/jianyu/shared/china-bid-search.js +86 -0
- package/clis/jianyu/shared/procurement-contract.js +1 -0
- package/clis/jianyu/shared/procurement-detail.js +18 -0
- package/clis/jike/auth.js +19 -0
- package/clis/jike/comment.js +82 -0
- package/clis/jike/create.js +83 -0
- package/clis/jike/feed.js +32 -0
- package/clis/jike/like.js +38 -0
- package/clis/jike/notifications.js +115 -0
- package/clis/jike/post.js +33 -0
- package/clis/jike/repost.js +67 -0
- package/clis/jike/search.js +29 -0
- package/clis/jike/topic.js +20 -0
- package/clis/jike/user.js +19 -0
- package/clis/jike/utils.js +15 -0
- package/clis/jimeng/auth.js +13 -0
- package/clis/jimeng/generate.js +60 -0
- package/clis/jimeng/history.js +32 -0
- package/clis/jimeng/new.js +26 -0
- package/clis/jimeng/workspaces.js +22 -0
- package/clis/jira/attachments.js +1 -0
- package/clis/jira/comments.js +1 -0
- package/clis/jira/issue.js +1 -0
- package/clis/jira/links.js +1 -0
- package/clis/jira/search.js +1 -0
- package/clis/jira/shared.js +1 -0
- package/clis/juejin/article.js +5 -0
- package/clis/juejin/categories.js +1 -0
- package/clis/juejin/hot.js +1 -0
- package/clis/juejin/login.js +1 -0
- package/clis/juejin/recommend.js +1 -0
- package/clis/juejin/stats.js +53 -0
- package/clis/juejin/tags.js +1 -0
- package/clis/juejin/utils.js +1 -0
- package/clis/juejin/whoami.js +1 -0
- package/clis/ke/auth.js +14 -0
- package/clis/ke/chengjiao.js +45 -0
- package/clis/ke/ershoufang.js +50 -0
- package/clis/ke/utils.js +21 -0
- package/clis/ke/xiaoqu.js +45 -0
- package/clis/ke/zufang.js +50 -0
- package/clis/kimi/_utils.js +38 -0
- package/clis/kimi/audit-extras.js +64 -0
- package/clis/kimi/auth.js +17 -0
- package/clis/kimi/chat.js +77 -0
- package/clis/kimi/storage.js +14 -0
- package/clis/kimi/ui.js +89 -0
- package/clis/kimi/usage.js +51 -0
- package/clis/kuaishou/auth.js +1 -0
- package/clis/kuaishou/publish.js +53 -0
- package/clis/lesswrong/_helpers.js +9 -0
- package/clis/lesswrong/comments.js +9 -0
- package/clis/lesswrong/curated.js +5 -0
- package/clis/lesswrong/frontpage.js +5 -0
- package/clis/lesswrong/new.js +5 -0
- package/clis/lesswrong/read.js +5 -0
- package/clis/lesswrong/sequences.js +5 -0
- package/clis/lesswrong/shortform.js +5 -0
- package/clis/lesswrong/tag.js +5 -0
- package/clis/lesswrong/tags.js +5 -0
- package/clis/lesswrong/top-month.js +5 -0
- package/clis/lesswrong/top-week.js +5 -0
- package/clis/lesswrong/top-year.js +5 -0
- package/clis/lesswrong/top.js +5 -0
- package/clis/lesswrong/user-posts.js +5 -0
- package/clis/lesswrong/user.js +5 -0
- package/clis/lichess/top.js +1 -0
- package/clis/lichess/user.js +1 -0
- package/clis/lichess/utils.js +1 -0
- package/clis/linkedin/auth.js +27 -0
- package/clis/linkedin/comment.js +1 -0
- package/clis/linkedin/connect.js +244 -0
- package/clis/linkedin/create.js +113 -0
- package/clis/linkedin/follow.js +1 -0
- package/clis/linkedin/inbox.js +1 -0
- package/clis/linkedin/job-detail.js +40 -0
- package/clis/linkedin/jobs-preferences.js +34 -0
- package/clis/linkedin/like.js +1 -0
- package/clis/linkedin/notifications.js +1 -0
- package/clis/linkedin/people-search.js +1 -0
- package/clis/linkedin/post-analytics.js +1 -0
- package/clis/linkedin/post-comments.js +1 -0
- package/clis/linkedin/post-detail.js +1 -0
- package/clis/linkedin/posts-core.js +138 -0
- package/clis/linkedin/posts.js +1 -0
- package/clis/linkedin/profile-analytics.js +1 -0
- package/clis/linkedin/profile-api.js +218 -0
- package/clis/linkedin/profile-experience.js +1 -0
- package/clis/linkedin/profile-projects.js +1 -0
- package/clis/linkedin/profile-read.js +3 -0
- package/clis/linkedin/reply.js +1 -0
- package/clis/linkedin/repost.js +1 -0
- package/clis/linkedin/safe-send.js +155 -0
- package/clis/linkedin/salesnav-inbox.js +21 -0
- package/clis/linkedin/salesnav-message.js +33 -0
- package/clis/linkedin/salesnav-search.js +15 -0
- package/clis/linkedin/salesnav-thread.js +1 -0
- package/clis/linkedin/search-api.js +42 -0
- package/clis/linkedin/search.js +50 -0
- package/clis/linkedin/sent-invitations.js +46 -0
- package/clis/linkedin/services-read.js +57 -0
- package/clis/linkedin/shared.js +10 -0
- package/clis/linkedin/social-api.js +260 -0
- package/clis/linkedin/thread-snapshot.js +81 -0
- package/clis/linkedin/timeline.js +37 -0
- package/clis/linkedin-learning/auth.js +27 -0
- package/clis/linkedin-learning/course.js +17 -0
- package/clis/linkedin-learning/search.js +17 -0
- package/clis/linkedin-learning/trending.js +17 -0
- package/clis/linux-do/auth.js +20 -0
- package/clis/linux-do/categories.js +1 -0
- package/clis/linux-do/feed.js +19 -0
- package/clis/linux-do/search.js +1 -0
- package/clis/linux-do/tags.js +1 -0
- package/clis/linux-do/topic-content.js +28 -0
- package/clis/linux-do/topic.js +1 -0
- package/clis/linux-do/user-posts.js +1 -0
- package/clis/linux-do/user-topics.js +1 -0
- package/clis/lobsters/active.js +1 -0
- package/clis/lobsters/domain.js +1 -0
- package/clis/lobsters/hot.js +1 -0
- package/clis/lobsters/newest.js +1 -0
- package/clis/lobsters/read.js +11 -0
- package/clis/lobsters/tag.js +1 -0
- package/clis/maimai/auth.js +19 -0
- package/clis/maimai/search-talents.js +37 -0
- package/clis/manus/_utils.js +28 -0
- package/clis/manus/auth.js +20 -0
- package/clis/manus/connectors.js +4 -0
- package/clis/manus/credits.js +4 -0
- package/clis/manus/list.js +7 -0
- package/clis/manus/read.js +7 -0
- package/clis/manus/skills.js +4 -0
- package/clis/manus/status.js +8 -0
- package/clis/mastodon/post.js +1 -0
- package/clis/mastodon/shared.js +48 -0
- package/clis/mastodon/whoami.js +1 -0
- package/clis/maven/artifact.js +1 -0
- package/clis/maven/search.js +1 -0
- package/clis/maven/utils.js +1 -0
- package/clis/mdn/search.js +1 -0
- package/clis/medium/article.js +12 -0
- package/clis/medium/feed.js +1 -0
- package/clis/medium/login.js +1 -0
- package/clis/medium/search.js +1 -0
- package/clis/medium/stats.js +56 -0
- package/clis/medium/tag.js +1 -0
- package/clis/medium/user.js +1 -0
- package/clis/medium/utils.js +62 -0
- package/clis/medium/whoami.js +1 -0
- package/clis/mubu/doc.js +1 -0
- package/clis/mubu/docs.js +1 -0
- package/clis/mubu/notes.js +1 -0
- package/clis/mubu/recent.js +1 -0
- package/clis/mubu/search.js +1 -0
- package/clis/mubu/utils.js +31 -0
- package/clis/note/auth.js +12 -0
- package/clis/note/note-utils.js +2 -0
- package/clis/note/publish.js +17 -0
- package/clis/notebooklm/add-source.js +46 -0
- package/clis/notebooklm/auth.js +21 -0
- package/clis/notebooklm/create.js +1 -0
- package/clis/notebooklm/current.js +1 -0
- package/clis/notebooklm/generate-audio.js +1 -0
- package/clis/notebooklm/generate-slides.js +1 -0
- package/clis/notebooklm/get.js +1 -0
- package/clis/notebooklm/history.js +1 -0
- package/clis/notebooklm/list.js +1 -0
- package/clis/notebooklm/note-list.js +1 -0
- package/clis/notebooklm/notes-get.js +1 -0
- package/clis/notebooklm/open.js +1 -0
- package/clis/notebooklm/rpc.js +36 -0
- package/clis/notebooklm/shared.js +1 -0
- package/clis/notebooklm/source-fulltext.js +1 -0
- package/clis/notebooklm/source-get.js +1 -0
- package/clis/notebooklm/source-guide.js +1 -0
- package/clis/notebooklm/source-list.js +1 -0
- package/clis/notebooklm/status.js +1 -0
- package/clis/notebooklm/summary.js +1 -0
- package/clis/notebooklm/utils.js +172 -0
- package/clis/notebooklm/write-note.js +1 -0
- package/clis/nowcoder/auth.js +24 -0
- package/clis/nowcoder/comment.js +1 -0
- package/clis/nowcoder/comments.js +1 -0
- package/clis/nowcoder/companies.js +1 -0
- package/clis/nowcoder/creators.js +1 -0
- package/clis/nowcoder/delete.js +1 -0
- package/clis/nowcoder/detail.js +46 -0
- package/clis/nowcoder/dm-list.js +1 -0
- package/clis/nowcoder/dm-read.js +1 -0
- package/clis/nowcoder/dm-send.js +1 -0
- package/clis/nowcoder/drafts.js +1 -0
- package/clis/nowcoder/experience.js +20 -0
- package/clis/nowcoder/hot.js +1 -0
- package/clis/nowcoder/inbox.js +1 -0
- package/clis/nowcoder/jobs.js +1 -0
- package/clis/nowcoder/like.js +1 -0
- package/clis/nowcoder/my.js +1 -0
- package/clis/nowcoder/notifications.js +16 -0
- package/clis/nowcoder/papers.js +22 -0
- package/clis/nowcoder/post.js +1 -0
- package/clis/nowcoder/practice.js +21 -0
- package/clis/nowcoder/recommend.js +1 -0
- package/clis/nowcoder/referral.js +21 -0
- package/clis/nowcoder/salary.js +22 -0
- package/clis/nowcoder/search.js +31 -0
- package/clis/nowcoder/suggest.js +17 -0
- package/clis/nowcoder/topics.js +1 -0
- package/clis/nowcoder/trending.js +1 -0
- package/clis/nowcoder/utils.js +68 -0
- package/clis/npm/downloads.js +1 -0
- package/clis/npm/package.js +1 -0
- package/clis/npm/search.js +1 -0
- package/clis/npm/utils.js +1 -0
- package/clis/nuget/package.js +1 -0
- package/clis/nuget/search.js +1 -0
- package/clis/nuget/utils.js +1 -0
- package/clis/nvd/cve.js +1 -0
- package/clis/oeis/search.js +1 -0
- package/clis/oeis/sequence.js +1 -0
- package/clis/oeis/utils.js +1 -0
- package/clis/ones/common.js +23 -0
- package/clis/ones/enrich-tasks.js +1 -0
- package/clis/ones/login.js +2 -0
- package/clis/ones/logout.js +1 -0
- package/clis/ones/me.js +1 -0
- package/clis/ones/my-tasks.js +1 -0
- package/clis/ones/resolve-labels.js +1 -0
- package/clis/ones/task-helpers.js +1 -0
- package/clis/ones/task.js +1 -0
- package/clis/ones/tasks.js +1 -0
- package/clis/ones/token-info.js +1 -0
- package/clis/ones/worklog.js +14 -0
- package/clis/openalex/search.js +1 -0
- package/clis/openalex/utils.js +1 -0
- package/clis/openalex/work.js +1 -0
- package/clis/openfda/drug-label.js +1 -0
- package/clis/openfda/food-recall.js +1 -0
- package/clis/openfda/utils.js +1 -0
- package/clis/openreview/author.js +1 -0
- package/clis/openreview/paper.js +1 -0
- package/clis/openreview/reviews.js +4 -0
- package/clis/openreview/search.js +1 -0
- package/clis/openreview/utils.js +1 -0
- package/clis/openreview/venue.js +1 -0
- package/clis/oschina/article.js +1 -0
- package/clis/oschina/catalogs.js +1 -0
- package/clis/oschina/login.js +1 -0
- package/clis/oschina/stats.js +54 -0
- package/clis/oschina/whoami.js +1 -0
- package/clis/osv/query.js +1 -0
- package/clis/osv/utils.js +1 -0
- package/clis/osv/vulnerability.js +1 -0
- package/clis/packagist/package.js +1 -0
- package/clis/packagist/search.js +1 -0
- package/clis/packagist/utils.js +1 -0
- package/clis/paperreview/feedback.js +1 -0
- package/clis/paperreview/review.js +1 -0
- package/clis/paperreview/submit.js +1 -0
- package/clis/paperreview/utils.js +1 -0
- package/clis/pinterest/api.js +1 -0
- package/clis/pinterest/auth.js +1 -0
- package/clis/pinterest/boards.js +1 -0
- package/clis/pinterest/client.js +20 -0
- package/clis/pinterest/publish.js +13 -0
- package/clis/pixiv/auth.js +17 -0
- package/clis/pixiv/detail.js +1 -0
- package/clis/pixiv/download.js +1 -0
- package/clis/pixiv/illusts.js +1 -0
- package/clis/pixiv/ranking.js +26 -0
- package/clis/pixiv/search.js +1 -0
- package/clis/pixiv/user.js +1 -0
- package/clis/pixiv/utils.js +18 -0
- package/clis/powerchina/auth.js +17 -0
- package/clis/powerchina/search.js +1 -0
- package/clis/producthunt/browse.js +54 -0
- package/clis/producthunt/hot.js +64 -0
- package/clis/producthunt/posts.js +1 -0
- package/clis/producthunt/today.js +1 -0
- package/clis/producthunt/utils.js +1 -0
- package/clis/pubmed/article.js +1 -0
- package/clis/pubmed/author.js +1 -0
- package/clis/pubmed/citations.js +1 -0
- package/clis/pubmed/clinical-trial.js +1 -0
- package/clis/pubmed/journal.js +1 -0
- package/clis/pubmed/mesh.js +1 -0
- package/clis/pubmed/related.js +1 -0
- package/clis/pubmed/review.js +1 -0
- package/clis/pubmed/search.js +1 -0
- package/clis/pubmed/utils.js +1 -0
- package/clis/pypi/downloads.js +1 -0
- package/clis/pypi/package.js +1 -0
- package/clis/pypi/utils.js +1 -0
- package/clis/qiita/auth.js +1 -0
- package/clis/qiita/gql.js +32 -0
- package/clis/qiita/publish.js +7 -0
- package/clis/qiita/stats.js +37 -0
- package/clis/qoder/_utils.js +113 -0
- package/clis/qoder/composer.js +1 -0
- package/clis/qoder/history.js +25 -0
- package/clis/qoder/quest.js +1 -0
- package/clis/qoder/read.js +1 -0
- package/clis/qoder/status.js +1 -0
- package/clis/qoder/ui.js +59 -0
- package/clis/quark/auth.js +16 -0
- package/clis/quark/ls.js +1 -0
- package/clis/quark/mkdir.js +1 -0
- package/clis/quark/mv.js +1 -0
- package/clis/quark/rename.js +1 -0
- package/clis/quark/rm.js +1 -0
- package/clis/quark/save.js +1 -0
- package/clis/quark/share-tree.js +1 -0
- package/clis/quark/utils.js +13 -0
- package/clis/quora/create-answer.js +22 -0
- package/clis/quora/create-question.js +24 -0
- package/clis/quora/shared.js +43 -0
- package/clis/quora/whoami.js +1 -0
- package/clis/qwen/ask.js +1 -0
- package/clis/qwen/auth.js +17 -0
- package/clis/qwen/detail.js +1 -0
- package/clis/qwen/history.js +1 -0
- package/clis/qwen/image.js +31 -0
- package/clis/qwen/new.js +1 -0
- package/clis/qwen/read.js +1 -0
- package/clis/qwen/send.js +1 -0
- package/clis/qwen/status.js +1 -0
- package/clis/qwen/utils.js +185 -0
- package/clis/reddit/auth.js +17 -0
- package/clis/reddit/comment.js +36 -0
- package/clis/reddit/frontpage.js +40 -0
- package/clis/reddit/home.js +32 -0
- package/clis/reddit/hot.js +46 -0
- package/clis/reddit/popular.js +46 -0
- package/clis/reddit/read.js +398 -0
- package/clis/reddit/reply.js +56 -0
- package/clis/reddit/save.js +30 -0
- package/clis/reddit/saved.js +24 -0
- package/clis/reddit/search.js +51 -0
- package/clis/reddit/submit.js +42 -0
- package/clis/reddit/subreddit-info.js +29 -0
- package/clis/reddit/subreddit.js +52 -0
- package/clis/reddit/subscribe.js +29 -0
- package/clis/reddit/subscribed.js +68 -0
- package/clis/reddit/upvote.js +43 -0
- package/clis/reddit/upvoted.js +24 -0
- package/clis/reddit/user-comments.js +20 -0
- package/clis/reddit/user-posts.js +17 -0
- package/clis/reddit/user.js +20 -0
- package/clis/reddit/whoami.js +19 -0
- package/clis/rednote/auth.js +19 -0
- package/clis/rednote/comments.js +1 -0
- package/clis/rednote/download.js +1 -0
- package/clis/rednote/feed.js +1 -0
- package/clis/rednote/note.js +1 -0
- package/clis/rednote/notifications.js +67 -0
- package/clis/rednote/search.js +32 -0
- package/clis/rednote/user.js +1 -0
- package/clis/rest-countries/country.js +1 -0
- package/clis/rest-countries/region.js +1 -0
- package/clis/rest-countries/utils.js +1 -0
- package/clis/reuters/article-detail.js +1 -0
- package/clis/reuters/auth.js +39 -0
- package/clis/reuters/search.js +1 -0
- package/clis/reuters/utils.js +50 -0
- package/clis/rfc/rfc.js +1 -0
- package/clis/rfc/utils.js +1 -0
- package/clis/rubygems/gem.js +1 -0
- package/clis/rubygems/search.js +1 -0
- package/clis/rubygems/utils.js +1 -0
- package/clis/segmentfault/_signed-request.js +43 -0
- package/clis/segmentfault/article.js +3 -0
- package/clis/segmentfault/channels.js +1 -0
- package/clis/segmentfault/login.js +1 -0
- package/clis/segmentfault/stats.js +82 -0
- package/clis/segmentfault/tags.js +1 -0
- package/clis/segmentfault/whoami.js +1 -0
- package/clis/semanticscholar/citations.js +1 -0
- package/clis/semanticscholar/paper.js +1 -0
- package/clis/semanticscholar/recommendations.js +1 -0
- package/clis/semanticscholar/search.js +1 -0
- package/clis/semanticscholar/utils.js +1 -0
- package/clis/sinablog/article.js +1 -0
- package/clis/sinablog/hot.js +1 -0
- package/clis/sinablog/search.js +1 -0
- package/clis/sinablog/user.js +1 -0
- package/clis/sinablog/utils.js +153 -0
- package/clis/sinafinance/news.js +1 -0
- package/clis/sinafinance/rolling-news.js +20 -0
- package/clis/sinafinance/stock-rank.js +41 -0
- package/clis/sinafinance/stock.js +1 -0
- package/clis/slock/attachment-download.js +1 -0
- package/clis/slock/attachment-upload.js +34 -0
- package/clis/slock/attachment-url.js +1 -0
- package/clis/slock/auth-verify.js +1 -0
- package/clis/slock/bookmark-add.js +11 -0
- package/clis/slock/bookmark-list.js +10 -0
- package/clis/slock/bookmark-remove.js +7 -0
- package/clis/slock/channel-action.js +1 -0
- package/clis/slock/channel-archive.js +1 -0
- package/clis/slock/channel-create.js +1 -0
- package/clis/slock/channel-files.js +1 -0
- package/clis/slock/channel-info.js +1 -0
- package/clis/slock/channel-join.js +1 -0
- package/clis/slock/channel-leave.js +1 -0
- package/clis/slock/channel-list.js +1 -0
- package/clis/slock/channel-mark.js +1 -0
- package/clis/slock/channel-members.js +1 -0
- package/clis/slock/channel-unarchive.js +1 -0
- package/clis/slock/dm-list.js +1 -0
- package/clis/slock/errors.js +1 -0
- package/clis/slock/in-page.js +113 -0
- package/clis/slock/inbox-done.js +9 -0
- package/clis/slock/inbox-read-all.js +1 -0
- package/clis/slock/inbox.js +1 -0
- package/clis/slock/login.js +1 -0
- package/clis/slock/message-read.js +61 -0
- package/clis/slock/message-search.js +24 -0
- package/clis/slock/message-send.js +55 -0
- package/clis/slock/reaction-add.js +1 -0
- package/clis/slock/reaction-remove.js +1 -0
- package/clis/slock/resolve.js +1 -0
- package/clis/slock/server-list.js +9 -0
- package/clis/slock/server-use.js +18 -0
- package/clis/slock/shared.js +1 -0
- package/clis/slock/task-claim.js +14 -0
- package/clis/slock/task-convert.js +35 -0
- package/clis/slock/task-create.js +24 -0
- package/clis/slock/task-delete.js +9 -0
- package/clis/slock/task-get.js +11 -0
- package/clis/slock/task-list-server.js +12 -0
- package/clis/slock/task-list.js +14 -0
- package/clis/slock/task-status.js +19 -0
- package/clis/slock/task-unclaim.js +13 -0
- package/clis/slock/thread-done.js +1 -0
- package/clis/slock/thread-follow.js +1 -0
- package/clis/slock/thread-list.js +1 -0
- package/clis/slock/thread-state.js +1 -0
- package/clis/slock/thread-undone.js +1 -0
- package/clis/slock/thread-unfollow.js +1 -0
- package/clis/slock/unread-summary.js +18 -0
- package/clis/slock/whoami.js +1 -0
- package/clis/smzdm/search.js +71 -0
- package/clis/sohu/article.js +1 -0
- package/clis/sohu/attributes.js +1 -0
- package/clis/sohu/categories.js +1 -0
- package/clis/sohu/channels.js +1 -0
- package/clis/sohu/columns.js +1 -0
- package/clis/sohu/login.js +1 -0
- package/clis/sohu/mpbp.js +1 -0
- package/clis/sohu/stats.js +95 -0
- package/clis/sohu/topics.js +1 -0
- package/clis/sohu/whoami.js +1 -0
- package/clis/spotify/spotify.js +1 -0
- package/clis/spotify/utils.js +8 -0
- package/clis/stackoverflow/bounties.js +1 -0
- package/clis/stackoverflow/hot.js +1 -0
- package/clis/stackoverflow/read.js +13 -0
- package/clis/stackoverflow/related.js +1 -0
- package/clis/stackoverflow/search.js +1 -0
- package/clis/stackoverflow/tag.js +1 -0
- package/clis/stackoverflow/unanswered.js +1 -0
- package/clis/stackoverflow/user.js +1 -0
- package/clis/stackoverflow/utils.js +1 -0
- package/clis/steam/app.js +1 -0
- package/clis/steam/search.js +1 -0
- package/clis/steam/top-sellers.js +1 -0
- package/clis/steam/utils.js +1 -0
- package/clis/substack/auth.js +11 -0
- package/clis/substack/feed.js +1 -0
- package/clis/substack/post-utils.js +2 -0
- package/clis/substack/publication.js +1 -0
- package/clis/substack/publish.js +10 -0
- package/clis/substack/search.js +1 -0
- package/clis/substack/utils.js +108 -0
- package/clis/suno/auth.js +21 -0
- package/clis/suno/download.js +17 -0
- package/clis/suno/generate.js +4 -0
- package/clis/suno/list.js +14 -0
- package/clis/suno/status.js +1 -0
- package/clis/suno/utils.js +102 -0
- package/clis/taobao/add-cart.js +93 -0
- package/clis/taobao/auth.js +8 -0
- package/clis/taobao/cart.js +68 -0
- package/clis/taobao/detail.js +48 -0
- package/clis/taobao/reviews.js +52 -0
- package/clis/taobao/search.js +64 -0
- package/clis/tdx/hot-rank.js +25 -0
- package/clis/telegram/send.js +18 -0
- package/clis/telegram/shared.js +21 -0
- package/clis/telegram/whoami.js +1 -0
- package/clis/test-utils.js +1 -0
- package/clis/threads/post.js +152 -0
- package/clis/threads/shared.js +27 -0
- package/clis/threads/whoami.js +1 -0
- package/clis/ths/hot-rank.js +27 -0
- package/clis/tieba/hot.js +16 -0
- package/clis/tieba/posts.js +1 -0
- package/clis/tieba/read.js +84 -0
- package/clis/tieba/search.js +54 -0
- package/clis/tieba/utils.js +1 -0
- package/clis/tiktok/auth.js +30 -0
- package/clis/tiktok/comment.js +69 -0
- package/clis/tiktok/creator-videos.js +45 -0
- package/clis/tiktok/explore.js +76 -0
- package/clis/tiktok/follow.js +49 -0
- package/clis/tiktok/following.js +103 -0
- package/clis/tiktok/friends.js +79 -0
- package/clis/tiktok/like.js +19 -0
- package/clis/tiktok/live.js +79 -0
- package/clis/tiktok/notifications.js +77 -0
- package/clis/tiktok/profile.js +26 -0
- package/clis/tiktok/publish.js +82 -0
- package/clis/tiktok/save.js +15 -0
- package/clis/tiktok/search.js +24 -0
- package/clis/tiktok/unfollow.js +59 -0
- package/clis/tiktok/unlike.js +19 -0
- package/clis/tiktok/unsave.js +17 -0
- package/clis/tiktok/user.js +143 -0
- package/clis/tiktok/utils.js +272 -0
- package/clis/toutiao/article.js +1 -0
- package/clis/toutiao/articles.js +6 -0
- package/clis/toutiao/auth.js +50 -0
- package/clis/toutiao/hot.js +1 -0
- package/clis/toutiao/utils.js +2 -0
- package/clis/trae-cn/activity.js +1 -0
- package/clis/trae-cn/approve.js +1 -0
- package/clis/trae-cn/ask.js +1 -0
- package/clis/trae-cn/dump.js +1 -0
- package/clis/trae-cn/export.js +3 -0
- package/clis/trae-cn/model.js +1 -0
- package/clis/trae-cn/new.js +1 -0
- package/clis/trae-cn/read.js +1 -0
- package/clis/trae-cn/screenshot.js +1 -0
- package/clis/trae-cn/select-model.js +1 -0
- package/clis/trae-cn/send.js +1 -0
- package/clis/trae-cn/setup.js +1 -0
- package/clis/trae-cn/status.js +1 -0
- package/clis/trae-cn/targets.js +1 -0
- package/clis/trae-cn/utils.js +456 -0
- package/clis/trae-cn/watch.js +3 -0
- package/clis/trae-solo/_actions.js +41 -0
- package/clis/trae-solo/_fs.js +6 -0
- package/clis/trae-solo/_state.js +2 -0
- package/clis/trae-solo/automation.js +43 -0
- package/clis/trae-solo/history.js +15 -0
- package/clis/trae-solo/mode.js +31 -0
- package/clis/trae-solo/model.js +50 -0
- package/clis/trae-solo/renderer-storage.js +11 -0
- package/clis/trae-solo/settings.js +1 -0
- package/clis/trae-solo/skill-fs.js +1 -0
- package/clis/trae-solo/skill.js +81 -0
- package/clis/trae-solo/state-fs.js +2 -0
- package/clis/trae-solo/status.js +1 -0
- package/clis/trae-solo/task-fs.js +5 -0
- package/clis/trae-solo/user-rules.js +1 -0
- package/clis/trae-solo/workspaces-fs.js +1 -0
- package/clis/tumblr/auth.js +24 -0
- package/clis/tumblr/publish.js +14 -0
- package/clis/tvmaze/search.js +1 -0
- package/clis/tvmaze/show.js +1 -0
- package/clis/tvmaze/utils.js +1 -0
- package/clis/twitter/accept.js +116 -0
- package/clis/twitter/article.js +116 -0
- package/clis/twitter/auth.js +4 -0
- package/clis/twitter/block.js +62 -0
- package/clis/twitter/bookmark-folder.js +4 -0
- package/clis/twitter/bookmark-folders.js +4 -0
- package/clis/twitter/bookmark.js +44 -0
- package/clis/twitter/bookmarks.js +27 -0
- package/clis/twitter/delete.js +36 -0
- package/clis/twitter/device-follow.js +13 -0
- package/clis/twitter/dm-list.js +1 -0
- package/clis/twitter/dm-read.js +1 -0
- package/clis/twitter/dm-send.js +13 -0
- package/clis/twitter/dm-shared.js +6 -0
- package/clis/twitter/download.js +38 -0
- package/clis/twitter/follow-batch.js +43 -0
- package/clis/twitter/follow.js +39 -0
- package/clis/twitter/followers.js +59 -0
- package/clis/twitter/following.js +4 -0
- package/clis/twitter/hide-reply.js +57 -0
- package/clis/twitter/like.js +48 -0
- package/clis/twitter/likes.js +14 -0
- package/clis/twitter/list-add-batch.js +1 -0
- package/clis/twitter/list-add-core.js +35 -0
- package/clis/twitter/list-add.js +1 -0
- package/clis/twitter/list-batch-utils.js +1 -0
- package/clis/twitter/list-create.js +12 -0
- package/clis/twitter/list-delete.js +36 -0
- package/clis/twitter/list-remove-batch.js +1 -0
- package/clis/twitter/list-remove-core.js +127 -0
- package/clis/twitter/list-remove.js +1 -0
- package/clis/twitter/list-tweets.js +27 -0
- package/clis/twitter/lists.js +27 -0
- package/clis/twitter/notifications.js +4 -0
- package/clis/twitter/post.js +158 -0
- package/clis/twitter/profile.js +66 -0
- package/clis/twitter/quote.js +123 -0
- package/clis/twitter/reply-dm.js +112 -0
- package/clis/twitter/reply.js +97 -0
- package/clis/twitter/retweet.js +62 -0
- package/clis/twitter/schedule.js +96 -0
- package/clis/twitter/scheduled-delete.js +60 -0
- package/clis/twitter/scheduled-list.js +15 -0
- package/clis/twitter/scheduled-utils.js +18 -0
- package/clis/twitter/search.js +12 -0
- package/clis/twitter/shared.js +76 -0
- package/clis/twitter/thread.js +4 -0
- package/clis/twitter/timeline.js +4 -0
- package/clis/twitter/trending.js +18 -0
- package/clis/twitter/tweets.js +12 -0
- package/clis/twitter/unblock.js +45 -0
- package/clis/twitter/unbookmark.js +41 -0
- package/clis/twitter/unfollow.js +45 -0
- package/clis/twitter/unlike.js +48 -0
- package/clis/twitter/unretweet.js +62 -0
- package/clis/twitter/utils.js +55 -0
- package/clis/uisdc/news.js +25 -0
- package/clis/uiverse/_shared.js +257 -0
- package/clis/uiverse/code.js +1 -0
- package/clis/uiverse/preview.js +1 -0
- package/clis/upwork/auth.js +19 -0
- package/clis/upwork/detail.js +22 -0
- package/clis/upwork/feed.js +21 -0
- package/clis/upwork/search.js +21 -0
- package/clis/upwork/utils.js +1 -0
- package/clis/v2ex/auth.js +10 -0
- package/clis/v2ex/daily.js +41 -0
- package/clis/v2ex/hot.js +1 -0
- package/clis/v2ex/latest.js +1 -0
- package/clis/v2ex/me.js +58 -0
- package/clis/v2ex/member.js +1 -0
- package/clis/v2ex/node.js +1 -0
- package/clis/v2ex/nodes.js +1 -0
- package/clis/v2ex/notifications.js +40 -0
- package/clis/v2ex/replies.js +1 -0
- package/clis/v2ex/topic.js +1 -0
- package/clis/v2ex/user.js +1 -0
- package/clis/vk/post.js +1 -0
- package/clis/vk/shared.js +8 -0
- package/clis/vk/whoami.js +1 -0
- package/clis/wanfang/search.js +42 -0
- package/clis/web/read.js +260 -0
- package/clis/wechat-channels/auth.js +31 -0
- package/clis/wechat-channels/publish.js +298 -0
- package/clis/weibo/article.js +1 -0
- package/clis/weibo/auth.js +17 -0
- package/clis/weibo/comments.js +28 -0
- package/clis/weibo/delete.js +84 -0
- package/clis/weibo/favorites.js +27 -0
- package/clis/weibo/feed.js +33 -0
- package/clis/weibo/hot.js +17 -0
- package/clis/weibo/me.js +51 -0
- package/clis/weibo/post.js +46 -0
- package/clis/weibo/publish.js +98 -0
- package/clis/weibo/search.js +47 -0
- package/clis/weibo/user-posts.js +92 -0
- package/clis/weibo/user.js +37 -0
- package/clis/weibo/utils.js +16 -0
- package/clis/weixin/article.js +1 -0
- package/clis/weixin/create-draft.js +152 -0
- package/clis/weixin/download.js +100 -0
- package/clis/weixin/drafts.js +27 -0
- package/clis/weixin/login.js +1 -0
- package/clis/weixin/search.js +44 -0
- package/clis/weixin/stats.js +43 -0
- package/clis/weixin/whoami.js +1 -0
- package/clis/weread/ai-outline.js +2 -0
- package/clis/weread/auth.js +24 -0
- package/clis/weread/book-search.js +2 -0
- package/clis/weread/book.js +3 -0
- package/clis/weread/highlights.js +1 -0
- package/clis/weread/notebooks.js +1 -0
- package/clis/weread/notes.js +1 -0
- package/clis/weread/ranking.js +1 -0
- package/clis/weread/search.js +1 -0
- package/clis/weread/shelf.js +1 -0
- package/clis/weread/utils.js +67 -0
- package/clis/weread-official/book.js +1 -0
- package/clis/weread-official/discover.js +1 -0
- package/clis/weread-official/list-apis.js +1 -0
- package/clis/weread-official/notes.js +1 -0
- package/clis/weread-official/readdata.js +1 -0
- package/clis/weread-official/review.js +1 -0
- package/clis/weread-official/search.js +1 -0
- package/clis/weread-official/shelf.js +1 -0
- package/clis/weread-official/utils.js +1 -0
- package/clis/wikidata/entity.js +1 -0
- package/clis/wikidata/search.js +1 -0
- package/clis/wikidata/utils.js +1 -0
- package/clis/wikipedia/page.js +3 -0
- package/clis/wikipedia/random.js +1 -0
- package/clis/wikipedia/search.js +1 -0
- package/clis/wikipedia/summary.js +1 -0
- package/clis/wikipedia/trending.js +1 -0
- package/clis/wikipedia/utils.js +1 -0
- package/clis/wordpress/login.js +1 -0
- package/clis/wordpress/publish.js +1 -0
- package/clis/wordpress/shared.js +54 -0
- package/clis/wordpress/whoami.js +1 -0
- package/clis/woshipm/article.js +1 -0
- package/clis/woshipm/login.js +1 -0
- package/clis/woshipm/stats.js +52 -0
- package/clis/woshipm/whoami.js +1 -0
- package/clis/wttr/current.js +1 -0
- package/clis/wttr/forecast.js +1 -0
- package/clis/wttr/utils.js +1 -0
- package/clis/xianyu/auth.js +11 -0
- package/clis/xianyu/chat.js +1 -0
- package/clis/xianyu/im.js +240 -0
- package/clis/xianyu/inbox.js +1 -0
- package/clis/xianyu/item.js +97 -0
- package/clis/xianyu/messages.js +1 -0
- package/clis/xianyu/publish.js +245 -0
- package/clis/xianyu/reply.js +1 -0
- package/clis/xianyu/search.js +141 -0
- package/clis/xianyu/utils.js +1 -0
- package/clis/xiaoe/auth.js +10 -0
- package/clis/xiaoe/catalog.js +134 -0
- package/clis/xiaoe/content.js +16 -0
- package/clis/xiaoe/courses.js +43 -0
- package/clis/xiaoe/detail.js +19 -0
- package/clis/xiaoe/play-url.js +97 -0
- package/clis/xiaohongshu/ask.js +130 -0
- package/clis/xiaohongshu/auth.js +13 -0
- package/clis/xiaohongshu/collection-helpers.js +64 -0
- package/clis/xiaohongshu/comments.js +89 -0
- package/clis/xiaohongshu/creator-note-detail.js +80 -0
- package/clis/xiaohongshu/creator-notes-summary.js +1 -0
- package/clis/xiaohongshu/creator-notes.js +107 -0
- package/clis/xiaohongshu/creator-profile.js +13 -0
- package/clis/xiaohongshu/creator-stats.js +13 -0
- package/clis/xiaohongshu/delete-note.js +69 -0
- package/clis/xiaohongshu/download.js +200 -0
- package/clis/xiaohongshu/draft-clear.js +44 -0
- package/clis/xiaohongshu/draft-delete.js +37 -0
- package/clis/xiaohongshu/draft-open.js +1 -0
- package/clis/xiaohongshu/draft-utils.js +36 -0
- package/clis/xiaohongshu/drafts.js +1 -0
- package/clis/xiaohongshu/feed.js +38 -0
- package/clis/xiaohongshu/follow.js +75 -0
- package/clis/xiaohongshu/liked.js +1 -0
- package/clis/xiaohongshu/note-helpers.js +1 -0
- package/clis/xiaohongshu/note.js +32 -0
- package/clis/xiaohongshu/notifications.js +1 -0
- package/clis/xiaohongshu/publish-video.js +87 -0
- package/clis/xiaohongshu/publish.js +637 -0
- package/clis/xiaohongshu/saved.js +1 -0
- package/clis/xiaohongshu/search.js +194 -0
- package/clis/xiaohongshu/unfollow.js +98 -0
- package/clis/xiaohongshu/user-helpers.js +1 -0
- package/clis/xiaohongshu/user.js +30 -0
- package/clis/xiaoyuzhou/auth.js +3 -0
- package/clis/xiaoyuzhou/download.js +1 -0
- package/clis/xiaoyuzhou/episode.js +1 -0
- package/clis/xiaoyuzhou/podcast-episodes.js +1 -0
- package/clis/xiaoyuzhou/podcast.js +1 -0
- package/clis/xiaoyuzhou/transcript.js +1 -0
- package/clis/xiaoyuzhou/utils.js +1 -0
- package/clis/xueqiu/article.js +4 -0
- package/clis/xueqiu/auth.js +27 -0
- package/clis/xueqiu/comments.js +38 -0
- package/clis/xueqiu/danjuan-utils.js +84 -0
- package/clis/xueqiu/earnings-date.js +1 -0
- package/clis/xueqiu/events.js +17 -0
- package/clis/xueqiu/feed.js +1 -0
- package/clis/xueqiu/fund-holdings.js +1 -0
- package/clis/xueqiu/fund-snapshot.js +1 -0
- package/clis/xueqiu/groups.js +1 -0
- package/clis/xueqiu/hashtags.js +26 -0
- package/clis/xueqiu/hot-stock.js +1 -0
- package/clis/xueqiu/hot.js +1 -0
- package/clis/xueqiu/kline.js +1 -0
- package/clis/xueqiu/search.js +1 -0
- package/clis/xueqiu/stock.js +1 -0
- package/clis/xueqiu/stocks.js +13 -0
- package/clis/xueqiu/users.js +12 -0
- package/clis/xueqiu/utils.js +9 -0
- package/clis/xueqiu/watchlist.js +1 -0
- package/clis/yahoo/search.js +21 -0
- package/clis/yahoo-finance/quote.js +50 -0
- package/clis/yollomi/background.js +1 -0
- package/clis/yollomi/edit.js +1 -0
- package/clis/yollomi/face-swap.js +1 -0
- package/clis/yollomi/generate.js +1 -0
- package/clis/yollomi/models.js +1 -0
- package/clis/yollomi/object-remover.js +1 -0
- package/clis/yollomi/remove-bg.js +1 -0
- package/clis/yollomi/restore.js +1 -0
- package/clis/yollomi/try-on.js +1 -0
- package/clis/yollomi/upload.js +17 -0
- package/clis/yollomi/upscale.js +1 -0
- package/clis/yollomi/utils.js +16 -0
- package/clis/yollomi/video.js +1 -0
- package/clis/youdao/note.js +113 -0
- package/clis/youtube/auth.js +20 -0
- package/clis/youtube/channel.js +118 -0
- package/clis/youtube/comments.js +64 -0
- package/clis/youtube/feed.js +89 -0
- package/clis/youtube/history.js +87 -0
- package/clis/youtube/like.js +33 -0
- package/clis/youtube/playlist.js +47 -0
- package/clis/youtube/publish.js +56 -0
- package/clis/youtube/search.js +39 -0
- package/clis/youtube/subscribe.js +42 -0
- package/clis/youtube/subscriptions.js +26 -0
- package/clis/youtube/transcript-group.js +2 -0
- package/clis/youtube/transcript.js +417 -0
- package/clis/youtube/unlike.js +33 -0
- package/clis/youtube/unsubscribe.js +42 -0
- package/clis/youtube/utils.js +34 -0
- package/clis/youtube/video.js +96 -0
- package/clis/youtube/watch-later.js +41 -0
- package/clis/yuanbao/ask.js +145 -0
- package/clis/yuanbao/auth.js +23 -0
- package/clis/yuanbao/detail.js +1 -0
- package/clis/yuanbao/history.js +1 -0
- package/clis/yuanbao/new.js +16 -0
- package/clis/yuanbao/read.js +1 -0
- package/clis/yuanbao/send.js +1 -0
- package/clis/yuanbao/shared.js +127 -0
- package/clis/yuanbao/status.js +1 -0
- package/clis/yuque/article.js +1 -0
- package/clis/yuque/whoami.js +1 -0
- package/clis/zhihu/answer-comments.js +11 -0
- package/clis/zhihu/answer-detail.js +11 -0
- package/clis/zhihu/answer.js +15 -0
- package/clis/zhihu/article-transform.js +1 -0
- package/clis/zhihu/article.js +7 -0
- package/clis/zhihu/auth.js +11 -0
- package/clis/zhihu/collection.js +7 -0
- package/clis/zhihu/collections.js +7 -0
- package/clis/zhihu/comment.js +17 -0
- package/clis/zhihu/download.js +39 -0
- package/clis/zhihu/favorite.js +39 -0
- package/clis/zhihu/follow.js +19 -0
- package/clis/zhihu/followers.js +1 -0
- package/clis/zhihu/following.js +1 -0
- package/clis/zhihu/hot.js +21 -0
- package/clis/zhihu/like.js +16 -0
- package/clis/zhihu/paginate.js +11 -0
- package/clis/zhihu/pin.js +24 -0
- package/clis/zhihu/pins.js +1 -0
- package/clis/zhihu/question.js +7 -0
- package/clis/zhihu/recommend.js +7 -0
- package/clis/zhihu/search.js +11 -0
- package/clis/zhihu/stats.js +41 -0
- package/clis/zhihu/target.js +1 -0
- package/clis/zhihu/text.js +6 -0
- package/clis/zhihu/user-answers.js +1 -0
- package/clis/zhihu/user-arg.js +1 -0
- package/clis/zhihu/user-articles.js +1 -0
- package/clis/zhihu/user.js +11 -0
- package/clis/zhihu/write-shared.js +71 -0
- package/clis/zlibrary/info.js +1 -0
- package/clis/zlibrary/search.js +1 -0
- package/clis/zlibrary/utils.js +48 -0
- package/clis/zsxq/auth.js +33 -0
- package/clis/zsxq/dynamics.js +1 -0
- package/clis/zsxq/groups.js +1 -0
- package/clis/zsxq/search.js +1 -0
- package/clis/zsxq/topic.js +1 -0
- package/clis/zsxq/topics.js +1 -0
- package/clis/zsxq/utils.js +72 -0
- package/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +2 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +1 -0
- package/dist/src/adapter-source.test.d.ts +1 -0
- package/dist/src/browser/analyze.d.ts +118 -0
- package/dist/src/browser/analyze.js +1 -0
- package/dist/src/browser/analyze.test.d.ts +1 -0
- package/dist/src/browser/article-extract.d.ts +57 -0
- package/dist/src/browser/article-extract.e2e.test.d.ts +1 -0
- package/dist/src/browser/article-extract.js +2 -0
- package/dist/src/browser/article-extract.test.d.ts +1 -0
- package/dist/src/browser/ax-snapshot.d.ts +37 -0
- package/dist/src/browser/ax-snapshot.js +2 -0
- package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
- package/dist/src/browser/base-page.d.ts +151 -0
- package/dist/src/browser/base-page.js +225 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/bridge-readiness.d.ts +14 -0
- package/dist/src/browser/bridge-readiness.js +1 -0
- package/dist/src/browser/bridge-readiness.test.d.ts +1 -0
- package/dist/src/browser/bridge.d.ts +26 -0
- package/dist/src/browser/bridge.js +1 -0
- package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
- package/dist/src/browser/cdp.d.ts +51 -0
- package/dist/src/browser/cdp.js +1 -0
- package/dist/src/browser/cdp.test.d.ts +1 -0
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +82 -0
- package/dist/src/browser/compound.test.d.ts +1 -0
- package/dist/src/browser/config.d.ts +2 -0
- package/dist/src/browser/config.js +1 -0
- package/dist/src/browser/daemon-client.d.ts +79 -0
- package/dist/src/browser/daemon-client.js +1 -0
- package/dist/src/browser/daemon-client.test.d.ts +1 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +37 -0
- package/dist/src/browser/daemon-lifecycle.js +12 -0
- package/dist/src/browser/daemon-transport.d.ts +55 -0
- package/dist/src/browser/daemon-transport.js +1 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +2 -0
- package/dist/src/browser/dom-helpers.d.ts +41 -0
- package/dist/src/browser/dom-helpers.js +166 -0
- package/dist/src/browser/dom-helpers.test.d.ts +1 -0
- package/dist/src/browser/dom-snapshot.d.ts +93 -0
- package/dist/src/browser/dom-snapshot.js +809 -0
- package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/src/browser/errors.d.ts +38 -0
- package/dist/src/browser/errors.js +5 -0
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +42 -0
- package/dist/src/browser/extract.test.d.ts +1 -0
- package/dist/src/browser/find.d.ts +84 -0
- package/dist/src/browser/find.js +328 -0
- package/dist/src/browser/find.test.d.ts +1 -0
- package/dist/src/browser/fingerprint.d.ts +44 -0
- package/dist/src/browser/fingerprint.js +82 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +61 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/index.d.ts +14 -0
- package/dist/src/browser/index.js +1 -0
- package/dist/src/browser/managed-chrome.d.ts +89 -0
- package/dist/src/browser/managed-chrome.js +1 -0
- package/dist/src/browser/network-cache.d.ts +49 -0
- package/dist/src/browser/network-cache.js +1 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +1 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/page.d.ts +83 -0
- package/dist/src/browser/page.js +15 -0
- package/dist/src/browser/page.test.d.ts +1 -0
- package/dist/src/browser/profile.d.ts +96 -0
- package/dist/src/browser/profile.js +2 -0
- package/dist/src/browser/proxy-test.d.ts +28 -0
- package/dist/src/browser/proxy-test.js +12 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +1 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +1 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/stealth.d.ts +18 -0
- package/dist/src/browser/stealth.js +391 -0
- package/dist/src/browser/stealth.test.d.ts +1 -0
- package/dist/src/browser/tabs.d.ts +13 -0
- package/dist/src/browser/tabs.js +2 -0
- package/dist/src/browser/target-errors.d.ts +39 -0
- package/dist/src/browser/target-errors.js +1 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.d.ts +158 -0
- package/dist/src/browser/target-resolver.js +423 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/trace.d.ts +21 -0
- package/dist/src/browser/trace.js +2 -0
- package/dist/src/browser/utils.d.ts +20 -0
- package/dist/src/browser/utils.js +1 -0
- package/dist/src/browser/utils.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.d.ts +65 -0
- package/dist/src/browser/verify-fixture.js +2 -0
- package/dist/src/browser/verify-fixture.test.d.ts +1 -0
- package/dist/src/browser/visual-refs.d.ts +11 -0
- package/dist/src/browser/visual-refs.js +94 -0
- package/dist/src/browser-session-lock.d.ts +13 -0
- package/dist/src/browser-session-lock.js +1 -0
- package/dist/src/browser-session-lock.test.d.ts +1 -0
- package/dist/src/browser.test.d.ts +1 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +16 -0
- package/dist/src/build-manifest.test.d.ts +1 -0
- package/dist/src/capabilityRouting.d.ts +19 -0
- package/dist/src/capabilityRouting.js +1 -0
- package/dist/src/capabilityRouting.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.d.ts +63 -0
- package/dist/src/cli-argv-preprocess.js +1 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli.d.ts +79 -0
- package/dist/src/cli.js +132 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/commanderAdapter.d.ts +21 -0
- package/dist/src/commanderAdapter.js +3 -0
- package/dist/src/commanderAdapter.test.d.ts +1 -0
- package/dist/src/commands/auth.d.ts +40 -0
- package/dist/src/commands/auth.js +2 -0
- package/dist/src/commands/auth.test.d.ts +1 -0
- package/dist/src/commands/daemon.d.ts +25 -0
- package/dist/src/commands/daemon.js +1 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/completion-fast.d.ts +22 -0
- package/dist/src/completion-fast.js +1 -0
- package/dist/src/completion-shared.d.ts +13 -0
- package/dist/src/completion-shared.js +30 -0
- package/dist/src/completion.d.ts +21 -0
- package/dist/src/completion.js +1 -0
- package/dist/src/completion.test.d.ts +1 -0
- package/dist/src/constants.d.ts +22 -0
- package/dist/src/constants.js +1 -0
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +2 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/daemon-utils.d.ts +18 -0
- package/dist/src/daemon-utils.js +1 -0
- package/dist/src/daemon.d.ts +22 -0
- package/dist/src/daemon.js +1 -0
- package/dist/src/daemon.test.d.ts +1 -0
- package/dist/src/discovery.d.ts +43 -0
- package/dist/src/discovery.js +2 -0
- package/dist/src/doctor.d.ts +38 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/doctor.test.d.ts +1 -0
- package/dist/src/download/article-download.d.ts +72 -0
- package/dist/src/download/article-download.js +21 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/index.d.ts +71 -0
- package/dist/src/download/index.js +7 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/media-download.d.ts +49 -0
- package/dist/src/download/media-download.js +1 -0
- package/dist/src/download/media-download.test.d.ts +1 -0
- package/dist/src/download/progress.d.ts +36 -0
- package/dist/src/download/progress.js +5 -0
- package/dist/src/download/progress.test.d.ts +1 -0
- package/dist/src/electron-apps.d.ts +31 -0
- package/dist/src/electron-apps.js +1 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/engine.test.d.ts +1 -0
- package/dist/src/errors.d.ts +117 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/errors.test.d.ts +1 -0
- package/dist/src/execution.d.ts +24 -0
- package/dist/src/execution.js +2 -0
- package/dist/src/execution.test.d.ts +1 -0
- package/dist/src/extension-manifest-regression.test.d.ts +1 -0
- package/dist/src/external-clis.yaml +109 -0
- package/dist/src/external.d.ts +49 -0
- package/dist/src/external.js +1 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +8 -0
- package/dist/src/help.test.d.ts +1 -0
- package/dist/src/hooks.d.ts +46 -0
- package/dist/src/hooks.js +1 -0
- package/dist/src/hooks.test.d.ts +4 -0
- package/dist/src/interceptor.d.ts +44 -0
- package/dist/src/interceptor.js +123 -0
- package/dist/src/interceptor.test.d.ts +4 -0
- package/dist/src/launcher.d.ts +41 -0
- package/dist/src/launcher.js +7 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.js +9 -0
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.js +10 -0
- package/dist/src/manifest-types.d.ts +43 -0
- package/dist/src/manifest-types.js +1 -0
- package/dist/src/node-network.d.ts +10 -0
- package/dist/src/node-network.js +1 -0
- package/dist/src/node-network.test.d.ts +1 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +8 -0
- package/dist/src/observation/artifact.test.d.ts +1 -0
- package/dist/src/observation/events.d.ts +89 -0
- package/dist/src/observation/events.js +1 -0
- package/dist/src/observation/index.d.ts +7 -0
- package/dist/src/observation/index.js +1 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +1 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +2 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +1 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +1 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +1 -0
- package/dist/src/output.d.ts +14 -0
- package/dist/src/output.js +2 -0
- package/dist/src/output.test.d.ts +1 -0
- package/dist/src/package-exports.test.d.ts +1 -0
- package/dist/src/package-paths.d.ts +8 -0
- package/dist/src/package-paths.js +1 -0
- package/dist/src/pipeline/executor.d.ts +11 -0
- package/dist/src/pipeline/executor.js +1 -0
- package/dist/src/pipeline/executor.test.d.ts +4 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +1 -0
- package/dist/src/pipeline/registry.d.ts +28 -0
- package/dist/src/pipeline/registry.js +1 -0
- package/dist/src/pipeline/steps/browser.d.ts +13 -0
- package/dist/src/pipeline/steps/browser.js +1 -0
- package/dist/src/pipeline/steps/download.d.ts +18 -0
- package/dist/src/pipeline/steps/download.js +1 -0
- package/dist/src/pipeline/steps/download.test.d.ts +1 -0
- package/dist/src/pipeline/steps/fetch.d.ts +5 -0
- package/dist/src/pipeline/steps/fetch.js +31 -0
- package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/src/pipeline/steps/intercept.d.ts +5 -0
- package/dist/src/pipeline/steps/intercept.js +1 -0
- package/dist/src/pipeline/steps/tap.d.ts +12 -0
- package/dist/src/pipeline/steps/tap.js +53 -0
- package/dist/src/pipeline/steps/transform.d.ts +9 -0
- package/dist/src/pipeline/steps/transform.js +1 -0
- package/dist/src/pipeline/template.d.ts +17 -0
- package/dist/src/pipeline/template.js +1 -0
- package/dist/src/pipeline/template.test.d.ts +4 -0
- package/dist/src/pipeline/transform.test.d.ts +4 -0
- package/dist/src/plugin-manifest.d.ts +70 -0
- package/dist/src/plugin-manifest.js +1 -0
- package/dist/src/plugin-manifest.test.d.ts +4 -0
- package/dist/src/plugin-scaffold.d.ts +28 -0
- package/dist/src/plugin-scaffold.js +75 -0
- package/dist/src/plugin-scaffold.test.d.ts +4 -0
- package/dist/src/plugin.d.ts +145 -0
- package/dist/src/plugin.js +20 -0
- package/dist/src/plugin.test.d.ts +4 -0
- package/dist/src/rate-limit.d.ts +15 -0
- package/dist/src/rate-limit.js +2 -0
- package/dist/src/rate-limit.test.d.ts +1 -0
- package/dist/src/registry-api.d.ts +13 -0
- package/dist/src/registry-api.js +1 -0
- package/dist/src/registry.d.ts +130 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/registry.test.d.ts +4 -0
- package/dist/src/runtime-detect.d.ts +31 -0
- package/dist/src/runtime-detect.js +1 -0
- package/dist/src/runtime-detect.test.d.ts +1 -0
- package/dist/src/runtime.d.ts +57 -0
- package/dist/src/runtime.js +1 -0
- package/dist/src/scripts/framework.d.ts +7 -0
- package/dist/src/scripts/framework.js +1 -0
- package/dist/src/scripts/interact.d.ts +4 -0
- package/dist/src/scripts/interact.js +1 -0
- package/dist/src/scripts/store.d.ts +13 -0
- package/dist/src/scripts/store.js +1 -0
- package/dist/src/serialization.d.ts +42 -0
- package/dist/src/serialization.js +4 -0
- package/dist/src/serialization.test.d.ts +1 -0
- package/dist/src/skills.d.ts +14 -0
- package/dist/src/skills.js +6 -0
- package/dist/src/skills.test.d.ts +1 -0
- package/dist/src/snapshotFormatter.d.ts +11 -0
- package/dist/src/snapshotFormatter.js +3 -0
- package/dist/src/snapshotFormatter.test.d.ts +7 -0
- package/dist/src/tui.d.ts +28 -0
- package/dist/src/tui.js +16 -0
- package/dist/src/tui.test.d.ts +1 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +57 -0
- package/dist/src/utils.js +38 -0
- package/dist/src/utils.test.d.ts +1 -0
- package/dist/src/validate.d.ts +21 -0
- package/dist/src/validate.js +3 -0
- package/dist/src/validate.test.d.ts +9 -0
- package/dist/src/verify.d.ts +27 -0
- package/dist/src/verify.js +2 -0
- package/dist/src/verify.test.d.ts +8 -0
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.js +1 -0
- package/dist/src/weixin-download.test.d.ts +1 -0
- package/docs/guide/browser-bridge.md +94 -0
- package/docs/guide/electron-app-cli.md +199 -0
- package/docs/guide/exit-codes.md +24 -0
- package/docs/guide/extending-opencli.md +134 -0
- package/docs/guide/getting-started.md +81 -0
- package/docs/guide/installation.md +52 -0
- package/docs/guide/plugins.md +226 -0
- package/docs/guide/remote-orchestration.md +116 -0
- package/docs/guide/troubleshooting.md +69 -0
- package/package.json +116 -0
- package/scripts/check-doc-coverage.sh +81 -0
- package/scripts/check-listing-id-pairing.mjs +193 -0
- package/scripts/check-silent-column-drop.mjs +105 -0
- package/scripts/check-typed-error-lint.mjs +118 -0
- package/scripts/clean-dist.cjs +13 -0
- package/scripts/copy-yaml.cjs +12 -0
- package/scripts/fetch-adapters.js +293 -0
- package/scripts/minify-release.mjs +115 -0
- package/scripts/postinstall.js +174 -0
- package/scripts/silent-column-drop-baseline.json +910 -0
- package/scripts/typed-error-lint-baseline.json +1098 -0
- package/skills/opencli-adapter-author/SKILL.md +256 -0
- package/skills/opencli-adapter-author/references/adapter-template.md +471 -0
- package/skills/opencli-adapter-author/references/api-discovery.md +295 -0
- package/skills/opencli-adapter-author/references/coverage-matrix.md +81 -0
- package/skills/opencli-adapter-author/references/field-conventions.md +172 -0
- package/skills/opencli-adapter-author/references/field-decode-playbook.md +181 -0
- package/skills/opencli-adapter-author/references/jsdom-fixture-pattern.md +196 -0
- package/skills/opencli-adapter-author/references/output-design.md +149 -0
- package/skills/opencli-adapter-author/references/site-memory/bilibili.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/eastmoney.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/tonghuashun.md +51 -0
- package/skills/opencli-adapter-author/references/site-memory/xueqiu.md +58 -0
- package/skills/opencli-adapter-author/references/site-memory.md +231 -0
- package/skills/opencli-adapter-author/references/site-recon.md +134 -0
- package/skills/opencli-adapter-author/references/strategy-selection.md +169 -0
- package/skills/opencli-adapter-author/references/success-rate-pitfalls.md +162 -0
- package/skills/opencli-adapter-author/references/typed-errors.md +234 -0
- package/skills/opencli-autofix/SKILL.md +297 -0
- package/skills/opencli-browser/SKILL.md +468 -0
- package/skills/opencli-browser-sitemap/SKILL.md +96 -0
- package/skills/opencli-sitemap-author/SKILL.md +161 -0
- package/skills/opencli-sitemap-author/references/sitemap-schema.md +660 -0
- package/skills/opencli-usage/SKILL.md +168 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CommandExecutionError as G}from"@jackwener/opencli/errors";export function pinUrlEncode(q){return encodeURIComponent(String(q))}export function encodeResourceBody({options:q,context:A=null,sourceUrl:z},B=Date.now()){const D=JSON.stringify({options:q??{},context:A});return`source_url=${pinUrlEncode(z)}&data=${pinUrlEncode(D)}&_=${B}`}export function csrfTokenFromCookies(q){const A=(q||[]).find((z)=>z&&z.name==="csrftoken");return A?A.value:""}export function writeHeaders(q){return{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",...q?{"X-CSRFToken":q}:{}}}export function parseResourceData(q,A="resource"){const z=q&&q.resource_response,B=z&&z.data;if(B===void 0||B===null){const D=z&&(z.error||z.message);throw new G(`Pinterest ${A} returned no data${D?": "+JSON.stringify(D):""}`)}return B}export function buildBoardsOptions(q){return{page_size:50,privacy_filter:"all",sort:"custom",username:q,isPrefetch:!1,include_archived:!0,field_set_key:"profile_grid_item",group_by:"visibility"}}export function buildCreateBoardOptions(q,{description:A="",privacy:z="public"}={}){return{name:String(q),description:String(A||""),category:"other",privacy:z==="secret"||z==="private"?"secret":"public",layout:"default"}}export function selectBoardByName(q,A){const z=String(A??"").trim().toLowerCase();return(q||[]).find((B)=>B&&String(B.name??"").toLowerCase()===z)||null}export function buildPinOptions({boardId:q,imageUrl:A,title:z="",description:B="",link:D="",altText:F=""}){return{board_id:String(q),image_url:A,title:String(z||""),description:String(B||""),link:D?String(D):A,alt_text:String(F||""),method:"uploaded",scrape_metric:{source:"www_url_scrape"},section:null}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AuthRequiredError as s}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as n}from"../_shared/site-auth.js";import{resolvePinterestUser as a}from"./client.js";async function i(e){return(await e.getCookies({url:"https://www.pinterest.com"})).some((o)=>o.name==="_pinterest_sess")}async function r(e){if(!await i(e))throw new s("www.pinterest.com","Pinterest _pinterest_sess cookie missing");const t=await a(e);return{username:t,url:`https://www.pinterest.com/${t}/`}}n({site:"pinterest",domain:"www.pinterest.com",loginUrl:"https://www.pinterest.com/login/",columns:["username","url"],quickCheck:i,verify:r,poll:async(e)=>{if(!await i(e))throw new s("www.pinterest.com","Waiting for Pinterest session cookie");return r(e)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as s,Strategy as i}from"@jackwener/opencli/registry";import{ArgumentError as u,CommandExecutionError as a}from"@jackwener/opencli/errors";import{buildBoardsOptions as p,buildCreateBoardOptions as w,csrfTokenFromCookies as l}from"./api.js";import{pinGet as b,pinCreate as f,resolvePinterestUser as n}from"./client.js";function d(r,e){return{id:String(r?.id??""),name:r?.name??e??"",url:r?.url?`https://www.pinterest.com${r.url}`:""}}s({site:"pinterest",name:"boards",access:"read",description:"List your Pinterest boards",domain:"www.pinterest.com",strategy:i.COOKIE,browser:!0,args:[],columns:["id","name","url"],func:async(r)=>{if(!r)throw new a("Browser session required for pinterest boards");const e=await n(r),t=await b(r,{resource:"BoardsResource",sourceUrl:`/${e}/boards/`,options:p(e),label:"boards"});return(Array.isArray(t)?t:[]).map((o)=>d(o))}});s({site:"pinterest",name:"board-create",access:"write",description:"Create a new Pinterest board",domain:"www.pinterest.com",strategy:i.COOKIE,browser:!0,args:[{name:"name",type:"string",required:!0,positional:!0,help:"Board name"},{name:"description",type:"string",help:"Board description"},{name:"privacy",type:"string",default:"public",help:"public | secret"}],columns:["id","name","url"],func:async(r,e)=>{if(!r)throw new a("Browser session required for pinterest board-create");const t=String(e.name??"").trim();if(!t)throw new u("board name is required");const o=await n(r),c=l(await r.getCookies({url:"https://www.pinterest.com"})),m=await f(r,{resource:"BoardResource",sourceUrl:`/${o}/boards/`,options:w(t,{description:e.description,privacy:e.privacy}),csrf:c,label:"board-create"});return d(m,t)}});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{AuthRequiredError as Y,CommandExecutionError as $}from"@jackwener/opencli/errors";import{encodeResourceBody as k,writeHeaders as L,parseResourceData as H}from"./api.js";const Z="https://www.pinterest.com";export function unwrap(z){if(z&&typeof z==="object"&&!Array.isArray(z)&&"session"in z&&"data"in z)return z.data;return z}export async function pageFetch(z,{url:G,method:V="GET",headers:X={},body:K=null}){const M=`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
const opts = { method: ${JSON.stringify(V)}, credentials: 'include', headers: ${JSON.stringify(X)} };
|
|
4
|
+
${K!=null?`opts.body = ${JSON.stringify(K)};`:""}
|
|
5
|
+
const res = await fetch(${JSON.stringify(G)}, opts);
|
|
6
|
+
const text = await res.text();
|
|
7
|
+
let data = null; try { data = JSON.parse(text); } catch {}
|
|
8
|
+
return { ok: res.ok, status: res.status, data, text: text.slice(0, 300) };
|
|
9
|
+
} catch (e) { return { ok: false, status: 0, data: null, text: String(e && e.message || e) }; }
|
|
10
|
+
})()`;return unwrap(await z.evaluate(M))}export async function pinGet(z,{resource:G,sourceUrl:V,options:X,label:K}){const M=k({options:X,sourceUrl:V}),J=await pageFetch(z,{url:`${Z}/resource/${G}/get/?${M}`,headers:{Accept:"application/json"}});if(J.status===401||J.status===403)throw new Y("www.pinterest.com",`${K||G} HTTP ${J.status}`);if(!J.ok)throw new $(`Pinterest ${K||G} failed: HTTP ${J.status} ${J.text}`);return H(J.data,K||G)}export async function pinCreate(z,{resource:G,sourceUrl:V,options:X,csrf:K,label:M}){const J=k({options:X,sourceUrl:V}),Q=await pageFetch(z,{url:`${Z}/resource/${G}/create/`,method:"POST",headers:{Accept:"application/json",...L(K)},body:J});if(Q.status===401||Q.status===403)throw new Y("www.pinterest.com",`${M||G} HTTP ${Q.status}`);if(!Q.ok)throw new $(`Pinterest ${M||G} failed: HTTP ${Q.status} ${Q.text}`);return H(Q.data,M||G)}export async function resolvePinterestUser(z){await z.goto(`${Z}/`);const G=unwrap(await z.evaluate(`(() => {
|
|
11
|
+
try {
|
|
12
|
+
const p = window.__PWS_INITIAL_PROPS__ || window.__PWS_DATA__ || {};
|
|
13
|
+
const rs = p.initialReduxState || p.reduxState || {};
|
|
14
|
+
const sess = rs.session || {};
|
|
15
|
+
const viewer = rs.viewer || (p.context && p.context.viewer) || sess;
|
|
16
|
+
let u = (viewer && viewer.username) || null;
|
|
17
|
+
if (!u && sess.userId && rs.users && rs.users[sess.userId]) u = rs.users[sess.userId].username;
|
|
18
|
+
return u || null;
|
|
19
|
+
} catch (e) { return null; }
|
|
20
|
+
})()`));if(!G)throw new Y("www.pinterest.com","Could not resolve Pinterest username — not logged in?");return String(G)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import*as g from"node:fs";import*as u from"node:path";import{cli as U,Strategy as O}from"@jackwener/opencli/registry";import{ArgumentError as o,CommandExecutionError as b}from"@jackwener/opencli/errors";import{buildBoardsOptions as R,buildCreateBoardOptions as C,buildPinOptions as I,selectBoardByName as $,csrfTokenFromCookies as T}from"./api.js";import{pinGet as N,pinCreate as h,resolvePinterestUser as _,pageFetch}from"./client.js";const v=new Set([".jpg",".jpeg",".png",".gif",".webp"]);async function w(r,t,s){const i=u.resolve(t);if(!v.has(u.extname(i).toLowerCase()))throw new o(`Unsupported image (jpg/png/gif/webp): ${t}`);const l=g.statSync(i,{throwIfNoEntry:!1});if(!l||!l.isFile())throw new o(`Not a file: ${i}`);const c=g.readFileSync(i).toString("base64"),p=u.basename(i),d={"X-Requested-With":"XMLHttpRequest","X-UPLOAD-SOURCE":"pinner_uploader",...s?{"X-CSRFToken":s}:{}},a=await r.evaluate(`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
const bin = atob(${JSON.stringify(c)});
|
|
4
|
+
const arr = new Uint8Array(bin.length);
|
|
5
|
+
for (let i = 0; i < bin.length; i++) arr[i] = bin.charCodeAt(i);
|
|
6
|
+
const fd = new FormData();
|
|
7
|
+
fd.append('img', new Blob([arr]), ${JSON.stringify(p)});
|
|
8
|
+
const res = await fetch('https://www.pinterest.com/upload-image/', { method: 'POST', credentials: 'include', headers: ${JSON.stringify(d)}, body: fd });
|
|
9
|
+
const text = await res.text();
|
|
10
|
+
let data = null; try { data = JSON.parse(text); } catch {}
|
|
11
|
+
return { ok: res.ok, status: res.status, data, text: text.slice(0, 300) };
|
|
12
|
+
} catch (e) { return { ok: false, status: 0, data: null, text: String(e && e.message || e) }; }
|
|
13
|
+
})()`),e=a&&typeof a==="object"&&"session"in a&&"data"in a?a.data:a,n=e&&e.data&&(e.data.image_url||e.data.url||e.data.success&&e.data.success.image_url);if(!e||!e.ok||!n)throw new b(`Pinterest image upload failed (best-effort): HTTP ${e?e.status:"?"} ${e?e.text:""}. Prefer --image-url.`);return n}U({site:"pinterest",name:"pin",access:"write",description:"Create a pin on a board with an optional destination link",domain:"www.pinterest.com",strategy:O.COOKIE,browser:!0,args:[{name:"title",type:"string",required:!0,positional:!0,help:"Pin title"},{name:"image-url",type:"string",help:"Image URL to pin (required unless --image)"},{name:"image",type:"string",help:"(best-effort) local image file to upload"},{name:"board",type:"string",required:!0,help:"Target board name"},{name:"description",type:"string",help:"Pin description"},{name:"link",type:"string",help:"Destination/landing URL (defaults to the image URL)"},{name:"create-board",type:"boolean",default:!1,help:"Create the board if it does not exist"}],columns:["status","pin_id","url"],func:async(r,t)=>{if(!r)throw new b("Browser session required for pinterest pin");const s=String(t.title??"").trim();if(!s)throw new o("pin title is required");const i=String(t.board??"").trim();if(!i)throw new o("--board is required");const l=t["image-url"]?String(t["image-url"]):"",c=t.image?String(t.image):"";if(!l&&!c)throw new o("provide --image-url (or --image local file)");const p=await _(r),d=T(await r.getCookies({url:"https://www.pinterest.com"})),a=await N(r,{resource:"BoardsResource",sourceUrl:`/${p}/boards/`,options:R(p),label:"boards"}),e=Array.isArray(a)?a:[];let n=$(e,i);if(!n){if(!t["create-board"]){const P=e.map((x)=>x.name).join(", ")||"(none)";throw new o(`Board "${i}" not found. Available: ${P} (use --create-board to create it)`)}n=await h(r,{resource:"BoardResource",sourceUrl:`/${p}/boards/`,options:C(i,{}),csrf:d,label:"board-create"})}const f=l||await w(r,c,d),y=I({boardId:String(n.id),imageUrl:f,title:s,description:t.description,link:t.link}),S=await h(r,{resource:"PinResource",sourceUrl:`/pin/find/?url=${encodeURIComponent(f)}`,options:y,csrf:d,label:"pin"}),m=String(S.id??"");return{status:"published",pin_id:m,url:m?`https://www.pinterest.com/pin/${m}/`:""}}});export const __test__={uploadLocalImage:w};export{pageFetch};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{AuthRequiredError as D,CommandExecutionError as F}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as K}from"../_shared/site-auth.js";async function G(B){return(await B.getCookies({url:"https://www.pixiv.net"})).some((H)=>H.name==="PHPSESSID"&&/^\d+_/.test(H.value||""))}async function J(B){if(!await G(B))throw new D("pixiv.net","Pixiv PHPSESSID cookie missing");await B.goto("https://www.pixiv.net/");await B.wait(2);const z=await B.evaluate(`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
const r = await fetch('/touch/ajax/user/self/status', { credentials: 'include', headers: { Accept: 'application/json' } });
|
|
4
|
+
if (r.status === 401 || r.status === 403) {
|
|
5
|
+
return { kind: 'auth', detail: 'Pixiv self/status HTTP ' + r.status };
|
|
6
|
+
}
|
|
7
|
+
if (!r.ok) return { kind: 'http', httpStatus: r.status };
|
|
8
|
+
const d = await r.json().catch(() => null);
|
|
9
|
+
const u = d?.body?.user_status;
|
|
10
|
+
if (d?.error || !u || u.is_loggedin === false || !u.user_id) {
|
|
11
|
+
return { kind: 'auth', detail: 'Pixiv self/status reports anonymous' };
|
|
12
|
+
}
|
|
13
|
+
return { ok: true, user_id: String(u.user_id), name: String(u.user_name || u.user_account || '') };
|
|
14
|
+
} catch (e) {
|
|
15
|
+
return { kind: 'exception', detail: String(e && e.message || e) };
|
|
16
|
+
}
|
|
17
|
+
})()`);if(z?.kind==="auth")throw new D("pixiv.net",z.detail);if(z?.kind==="http")throw new F(`HTTP ${z.httpStatus} from Pixiv ajax`);if(z?.kind==="exception")throw new F(`Pixiv whoami failed: ${z.detail}`);if(!z?.ok)throw new F(`Unexpected Pixiv probe: ${JSON.stringify(z)}`);return{user_id:z.user_id,name:z.name}}K({site:"pixiv",domain:"pixiv.net",loginUrl:"https://accounts.pixiv.net/login",columns:["user_id","name"],quickCheck:G,verify:J,poll:async(B)=>{if(!await G(B))throw new D("pixiv.net","Waiting for Pixiv PHPSESSID cookie");return J(B)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as n,Strategy as o}from"@jackwener/opencli/registry";import{ArgumentError as u,CommandExecutionError as a}from"@jackwener/opencli/errors";import{pixivFetch as d}from"./utils.js";function m(i,r){if(!i||Array.isArray(i)||typeof i!=="object")throw new a(`Pixiv illustration ${r} returned malformed detail payload`);const e=String(i.illustId??"").trim(),l=String(i.illustTitle??"").trim(),t=String(i.userName??"").trim(),s=String(i.userId??"").trim();if(!/^\d+$/.test(e)||e!==r||!l||!t||!/^\d+$/.test(s))throw new a(`Pixiv illustration ${r} returned malformed detail payload`);return{...i,illustId:e,illustTitle:l,userName:t,userId:s}}n({site:"pixiv",name:"detail",access:"read",description:"View illustration details (tags, stats, URLs)",domain:"www.pixiv.net",strategy:o.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Illustration ID"}],columns:["illust_id","title","author","type","pages","bookmarks","likes","views","tags","created","url"],func:async(i,r)=>{const e=String(r.id??"");if(!/^\d+$/.test(e))throw new u(`Invalid illustration ID: ${e}`,"Example: opencli pixiv detail 123456");const l=await d(i,`/ajax/illust/${e}`,{notFoundMsg:`Illustration not found: ${e}`}),t=m(l,e);return[{illust_id:t.illustId,title:t.illustTitle,author:t.userName,user_id:t.userId,type:t.illustType===0?"illust":t.illustType===1?"manga":t.illustType===2?"ugoira":String(t.illustType),pages:t.pageCount,bookmarks:t.bookmarkCount,likes:t.likeCount,views:t.viewCount,tags:(t.tags?.tags||[]).map((s)=>s.tag).join(", "),created:t.createDate?.split("T")[0]||"",url:`https://www.pixiv.net/artworks/${t.illustId}`}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as Z from"node:fs";import*as L from"node:path";import{cli as _,Strategy as $}from"@jackwener/opencli/registry";import{formatCookieHeader as v,httpDownload as B}from"@jackwener/opencli/download";import{formatBytes as F}from"@jackwener/opencli/download/progress";import{CommandExecutionError as U,EmptyResultError as H,getErrorMessage as M}from"@jackwener/opencli/errors";import{pixivFetch as P}from"./utils.js";_({site:"pixiv",name:"download",access:"read",description:"Download illustration images from Pixiv",domain:"www.pixiv.net",strategy:$.COOKIE,args:[{name:"illust-id",positional:!0,required:!0,help:"Illustration ID"},{name:"output",default:"./pixiv-downloads",help:"Output directory"}],columns:["index","type","status","size"],func:async(N,O)=>{const b=String(O["illust-id"]??""),V=String(O.output??"./pixiv-downloads");if(!/^\d+$/.test(b))throw new U(`Invalid illustration ID: ${b}`);const z=await P(N,`/ajax/illust/${b}/pages`,{notFoundMsg:`Illustration not found: ${b}`});if(!Array.isArray(z))throw new U("Pixiv pages API returned malformed payload");if(z.length===0)throw new H("pixiv download",`No images found for illustration ${b}.`);const W=v(await N.getCookies({domain:"pixiv.net"})),Q=L.join(V,b);Z.mkdirSync(Q,{recursive:!0});const A=[];for(let q=0;q<z.length;q++){const T=z[q],J=T.urls?.original||T.urls?.regular||"";if(!J){A.push({index:q+1,type:"image",status:"failed",size:"No URL"});continue}try{const K=L.extname(new URL(J).pathname)||".jpg",X=`${b}_p${q}${K}`,Y=L.join(Q,X),G=await B(J,Y,{cookies:W,headers:{Referer:"https://www.pixiv.net/"},timeout:60000});A.push({index:q+1,type:"image",status:G.success?"success":"failed",size:G.success?F(G.size):G.error||"unknown error"})}catch(K){A.push({index:q+1,type:"image",status:"failed",size:M(K)})}}return A}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as X,Strategy as Y}from"@jackwener/opencli/registry";import{CommandExecutionError as $}from"@jackwener/opencli/errors";import{pixivFetch as N,BATCH_SIZE as O}from"./utils.js";X({site:"pixiv",name:"illusts",access:"read",description:"List a Pixiv artist's illustrations",domain:"www.pixiv.net",strategy:Y.COOKIE,args:[{name:"user-id",positional:!0,required:!0,help:"Pixiv user ID"},{name:"limit",type:"int",default:20,help:"Number of results"}],columns:["rank","title","illust_id","pages","bookmarks","tags","created","url"],func:async(K,L)=>{const D=String(L["user-id"]??""),Q=Number(L.limit)||20;if(!/^\d+$/.test(D))throw new $(`Invalid user ID: ${D}`);const R=await N(K,`/ajax/user/${D}/profile/all`,{notFoundMsg:`User not found: ${D}`}),G=Object.keys(R?.illusts||{}).sort((z,J)=>Number(J)-Number(z)).slice(0,Q);if(G.length===0)return[];const M={};for(let z=0;z<G.length;z+=O){const q=G.slice(z,z+O).map((V)=>`ids[]=${V}`).join("&"),U=await N(K,`/ajax/user/${D}/profile/illusts?${q}&work_category=illustManga&is_first_page=${z===0?1:0}`);Object.assign(M,U?.works||{})}return G.map((z,J)=>{const q=M[z];if(!q)return null;return{rank:J+1,title:q.title||"",illust_id:q.id,pages:q.pageCount||1,bookmarks:q.bookmarkCount||0,tags:(q.tags||[]).slice(0,5).join(", "),created:(q.createDate||"").split("T")[0],url:"https://www.pixiv.net/artworks/"+q.id}}).filter(Boolean)}});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{cli as e,Strategy as t}from"@jackwener/opencli/registry";e({site:"pixiv",name:"ranking",access:"read",description:"Pixiv illustration rankings (daily/weekly/monthly)",domain:"www.pixiv.net",strategy:t.COOKIE,browser:!0,args:[{name:"mode",default:"daily",help:"Ranking mode",choices:["daily","weekly","monthly","rookie","original","male","female","daily_r18","weekly_r18"]},{name:"page",type:"int",default:1,help:"Page number"},{name:"limit",type:"int",default:20,help:"Number of results"}],columns:["rank","title","author","user_id","illust_id","pages","bookmarks","url"],pipeline:[{navigate:"https://www.pixiv.net"},{evaluate:`(async () => {
|
|
2
|
+
const mode = \${{ args.mode | json }};
|
|
3
|
+
const page = \${{ args.page | json }};
|
|
4
|
+
const limit = \${{ args.limit | json }};
|
|
5
|
+
const res = await fetch(
|
|
6
|
+
'https://www.pixiv.net/ranking.php?mode=' + mode + '&p=' + page + '&format=json',
|
|
7
|
+
{ credentials: 'include' }
|
|
8
|
+
);
|
|
9
|
+
if (!res.ok) {
|
|
10
|
+
if (res.status === 401 || res.status === 403) throw new Error('Authentication required — please log in to Pixiv in Chrome');
|
|
11
|
+
throw new Error('Pixiv request failed (HTTP ' + res.status + ')');
|
|
12
|
+
}
|
|
13
|
+
const data = await res.json();
|
|
14
|
+
const items = (data?.contents || []).slice(0, limit);
|
|
15
|
+
return items.map((item, i) => ({
|
|
16
|
+
rank: item.rank,
|
|
17
|
+
title: item.title,
|
|
18
|
+
author: item.user_name,
|
|
19
|
+
user_id: item.user_id,
|
|
20
|
+
illust_id: item.illust_id,
|
|
21
|
+
pages: item.illust_page_count,
|
|
22
|
+
bookmarks: item.illust_bookmark_count,
|
|
23
|
+
url: 'https://www.pixiv.net/artworks/' + item.illust_id
|
|
24
|
+
}));
|
|
25
|
+
})()
|
|
26
|
+
`}]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as Q,Strategy as V}from"@jackwener/opencli/registry";import{pixivFetch as W}from"./utils.js";Q({site:"pixiv",name:"search",access:"read",description:"Search Pixiv illustrations by keyword",domain:"www.pixiv.net",strategy:V.COOKIE,args:[{name:"query",positional:!0,required:!0,help:"Search keyword or tag"},{name:"limit",type:"int",default:20,help:"Number of results"},{name:"order",type:"str",default:"date_d",help:"Sort order",choices:["date_d","date","popular_d","popular_male_d","popular_female_d"]},{name:"mode",type:"str",default:"all",help:"Search mode",choices:["all","safe","r18"]},{name:"page",type:"int",default:1,help:"Page number"}],columns:["rank","title","author","user_id","illust_id","pages","bookmarks","tags","url"],func:async(z,C)=>{const{query:f,limit:D=20,order:E="date_d",mode:G="all",page:J=1}=C,K=encodeURIComponent(f);return((await W(z,`/ajax/search/illustrations/${K}`,{params:{word:f,order:E,mode:G,p:J,s_mode:"s_tag_full",type:"illust_and_ugoira"}}))?.illust?.data||[]).filter((b)=>b.id).slice(0,Number(D)).map((b,M)=>({rank:M+1,title:b.title||"",author:b.userName||"",user_id:b.userId||"",illust_id:b.id,pages:b.pageCount||1,bookmarks:b.bookmarkCount||0,tags:(b.tags||[]).slice(0,5).join(", "),url:"https://www.pixiv.net/artworks/"+b.id}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as s,Strategy as a}from"@jackwener/opencli/registry";import{ArgumentError as l,CommandExecutionError as n}from"@jackwener/opencli/errors";import{pixivFetch as m}from"./utils.js";function u(i,t){if(!i||Array.isArray(i)||typeof i!=="object")throw new n(`Pixiv user ${t} returned malformed profile payload`);const r=String(i.name??"").trim();if(!r)throw new n(`Pixiv user ${t} returned malformed profile payload`);return{...i,name:r}}s({site:"pixiv",name:"user",access:"read",description:"View Pixiv artist profile",domain:"www.pixiv.net",strategy:a.COOKIE,args:[{name:"uid",required:!0,positional:!0,help:"Pixiv user ID"}],columns:["user_id","name","premium","following","illusts","manga","novels","comment","url"],func:async(i,t)=>{const r=String(t.uid??"");if(!/^\d+$/.test(r))throw new l(`Invalid user ID: ${r}`,"Example: opencli pixiv user 123456");const o=await m(i,`/ajax/user/${r}`,{params:{full:1},notFoundMsg:`User not found: ${r}`}),e=u(o,r);return[{user_id:r,name:e.name,premium:e.premium?"Yes":"No",following:e.following,illusts:typeof e.illusts==="object"?Object.keys(e.illusts).length:e.illusts||0,manga:typeof e.manga==="object"?Object.keys(e.manga).length:e.manga||0,novels:typeof e.novels==="object"?Object.keys(e.novels).length:e.novels||0,comment:(e.comment||"").slice(0,80),url:`https://www.pixiv.net/users/${r}`}]}});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{AuthRequiredError as U,CommandExecutionError as G}from"@jackwener/opencli/errors";const L="www.pixiv.net";function W(z){if(z&&!Array.isArray(z)&&typeof z==="object"&&"session"in z&&"data"in z)return z.data;return z}function S(z){if(!z||typeof z!=="object")return"";const H=[z.message,z.errorMessage,z.error?.message,z.error].find((K)=>typeof K==="string"&&K.trim());return H?H.trim():""}export async function pixivFetch(z,Q,H={}){try{await z.goto(`https://${L}`)}catch(B){throw new G(`Pixiv navigation failed: ${B instanceof Error?B.message:String(B)}`)}const K=H.params?"?"+Object.entries(H.params).map(([B,J])=>`${B}=${encodeURIComponent(J)}`).join("&"):"",T=`https://${L}${Q}${K}`;let F;try{F=W(await z.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
const res = await fetch(${JSON.stringify(T)}, { credentials: 'include' });
|
|
4
|
+
const text = await res.text();
|
|
5
|
+
let json = null;
|
|
6
|
+
if (text) {
|
|
7
|
+
try { json = JSON.parse(text); } catch {}
|
|
8
|
+
}
|
|
9
|
+
if (!res.ok) {
|
|
10
|
+
return {
|
|
11
|
+
__httpError: res.status,
|
|
12
|
+
message: json?.message || json?.errorMessage || json?.error?.message || (typeof json?.error === 'string' ? json.error : '') || text.slice(0, 200),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
if (!json) return { __malformed: true, message: 'invalid JSON' };
|
|
16
|
+
return json;
|
|
17
|
+
})()
|
|
18
|
+
`))}catch(B){throw new G(`Pixiv request failed: ${B instanceof Error?B.message:String(B)}`)}if(F?.__httpError){const B=F.__httpError;if(B===401||B===403)throw new U(L,"Authentication required — please log in to Pixiv in Chrome");const J=S(F);if(B===404)throw new G(J||H.notFoundMsg||"Pixiv resource not found (HTTP 404)");throw new G(J?`Pixiv request failed (HTTP ${B}): ${J}`:`Pixiv request failed (HTTP ${B})`)}if(!F||Array.isArray(F)||typeof F!=="object"||F.__malformed)throw new G("Pixiv request returned malformed JSON payload");if(F.error===!0)throw new G(S(F)||"Pixiv API returned an error");if(!("body"in F))throw new G("Pixiv request returned malformed API payload");return F?.body}export const BATCH_SIZE=48;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{AuthRequiredError as D,CommandExecutionError as J}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as K}from"../_shared/site-auth.js";async function F(z){return(await z.getCookies({url:"https://zhaopin.powerchina.cn"})).some((G)=>/^(Admin-Token|access_token)$/i.test(G.name)&&G.value)}async function H(z){if(!await F(z))throw new D("powerchina.cn","Powerchina session cookies missing — anonymous");await z.goto("https://zhaopin.powerchina.cn/index");await z.wait(3);const B=await z.evaluate(`
|
|
2
|
+
(() => {
|
|
3
|
+
if (/\\/login(\\b|$|\\?)/.test(location.pathname)) {
|
|
4
|
+
return { kind: 'auth', detail: 'Powerchina redirected to /login — anonymous' };
|
|
5
|
+
}
|
|
6
|
+
const bodyText = document.body?.innerText || '';
|
|
7
|
+
if (/欢迎登录.*【登录】|请登录|您未登录/.test(bodyText)) {
|
|
8
|
+
return { kind: 'auth', detail: 'Powerchina shows 欢迎登录 prompt — anonymous' };
|
|
9
|
+
}
|
|
10
|
+
const el = document.querySelector('.user-info, .userName, .personalCenter [class*=name]');
|
|
11
|
+
const userName = (el?.innerText || '').trim();
|
|
12
|
+
if (!userName) {
|
|
13
|
+
return { kind: 'auth', detail: 'Powerchina no user name DOM — anonymous or layout changed' };
|
|
14
|
+
}
|
|
15
|
+
return { ok: true, name: userName };
|
|
16
|
+
})()
|
|
17
|
+
`);if(B?.kind==="auth")throw new D("powerchina.cn",B.detail);if(!B?.ok)throw new J(`Unexpected Powerchina probe: ${JSON.stringify(B)}`);return{name:B.name}}K({site:"powerchina",domain:"powerchina.cn",loginUrl:"https://zhaopin.powerchina.cn/login",columns:["name"],quickCheck:F,verify:H,poll:async(z)=>{if(!await F(z))throw new D("powerchina.cn","Waiting for Powerchina session cookies");return H(z)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as P,Strategy as q}from"@jackwener/opencli/registry";import{AuthRequiredError as D,EmptyResultError as Y}from"@jackwener/opencli/errors";import{cleanText as X,normalizeDate as j,toProcurementSearchRecords as U}from"../jianyu/shared/procurement-contract.js";import{searchRowsFromEntries as z}from"../jianyu/shared/china-bid-search.js";const b=["https://bid.powerchina.cn/search","https://bid.powerchina.cn/"],L="https://bid.powerchina.cn/newcbs/recpro-newmember/BidAnnouncementSummary/list",C="https://bid.powerchina.cn/newcbs/recpro-newmember/BidAnnouncementSummary/getInfo",S="招采公告",k=/(公告|招标|采购|中标|成交|项目|notice|tender|bidding)/i,_=/^(english|中文|chinese|language|home|首页|搜索|search)$/i,g=/(detached while handling command|execution context was destroyed|target closed|cannot find context with specified id)/i;export function buildSearchCandidates(K){const Q=K.trim();if(!Q)return[...b];const J=encodeURIComponent(Q);return[`https://bid.powerchina.cn/search?keyword=${J}`,`https://bid.powerchina.cn/search?keywords=${J}`,`https://bid.powerchina.cn/search?q=${J}`,...b]}function M(K){const Q=[],J=new Set;for(const W of K){const $=`${W.title} ${W.url}`;if(J.has($))continue;J.add($);Q.push(W)}return Q}function v(K){const Q=X(K);if(!Q)return!0;try{const J=new URL(Q),W=J.pathname.toLowerCase().replace(/\/+$/,"")||"/",$=X(J.hash).toLowerCase();if(W==="/"||W==="/index")return!0;if(W==="/search")return!0;if(W==="/old"||W.startsWith("/old/"))return!0;if(W==="/en"||W.startsWith("/en/"))return!0;if(W==="/zh"||W.startsWith("/zh/"))return!0;if($==="#/"||$==="#/index"||$.startsWith("#/search"))return!0;return!1}catch{return!0}}function F(K){const Q=X(K);if(!Q)return!0;const J=Q.toLowerCase();if(_.test(J))return!0;if(J.length<=10&&(J==="en"||J==="zh"||J.includes("english")))return!0;return!1}function H(K){return K.filter((Q)=>{const J=X(Q.title),W=X(Q.url);if(!W||!J)return!1;if(v(W))return!1;if(F(J)&&!k.test(J))return!1;return!0})}export function buildApiDetailUrl(K){const Q=X(K);if(!Q)return"";return`${C}/${encodeURIComponent(Q)}`}function O(K){const Q=X(K.id),J=X(K.title);if(!Q||!J)return null;const W=buildApiDetailUrl(Q);if(!W)return null;const $=X([K.announcementType,K.titleTypeName,K.source,K.publishTime,K.registrationDeadline,K.submissionDeadline,K.bidOpenTime].filter(Boolean).join(" | ")),B=j(X(K.publishTime||K.bidOpenTime||K.submissionDeadline||""));return{title:J,url:W,date:B,contextText:$}}async function A(K,Q){const J=X(K),$={pageNum:1,pageSize:Math.max(20,Math.min(100,Math.max(Q*3,Q))),announcementType:S,companyType:"3",time:Date.now()};if(J)$.keyWords=J;const B=await fetch(L,{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify($)});if(!B.ok)throw Error(`[taxonomy=relay_unavailable] site=powerchina command=search api HTTP ${B.status}`);const G=await B.json();if((G.code??200)!==200)throw Error(`[taxonomy=relay_unavailable] site=powerchina command=search api code=${G.code??"unknown"} msg=${X(G.msg)}`);const Z=(Array.isArray(G.rows)?G.rows:[]).map((f)=>O(f)).filter(Boolean);return M(Z).slice(0,Q)}P({site:"powerchina",name:"search",access:"read",description:"搜索中国电建阳光采购公告",domain:"bid.powerchina.cn",strategy:q.COOKIE,browser:!0,args:[{name:"query",required:!0,positional:!0,help:'Search keyword, e.g. "procurement"'},{name:"limit",type:"int",default:20,help:"Number of results (max 50)"}],columns:["rank","content_type","title","publish_time","project_code","budget_or_limit","url"],func:async(K,Q)=>{const J=X(Q.query),W=Math.max(1,Math.min(Number(Q.limit)||20,50));let $=[],B=null,G=!1;try{$=await A(J,W);G=!0}catch(Z){B=X(Z instanceof Error?Z.message:String(Z||""))}if(G&&$.length===0)return[];if(!G)try{$=await z(K,{query:J,candidateUrls:buildSearchCandidates(J),allowedHostFragments:["bid.powerchina.cn","powerchina.cn"],limit:W})}catch(Z){const f=X(Z instanceof Error?Z.message:String(Z||""));if(g.test(f))throw Error(`[taxonomy=relay_unavailable] site=powerchina command=search detached browser context: ${f}`);throw Z}const V=H(M($).map((Z)=>({title:X(Z.title),url:X(Z.url),date:j(X(Z.date)),contextText:X(Z.contextText)})));if(V.length===0&&$.length>0)throw new Y("powerchina search","extracted only navigation/portal rows, no bid entries matched");if(V.length===0){const Z=X(await K.evaluate('document.body ? document.body.innerText : ""'));if(/(请先登录|未登录|登录后|验证码|人机验证)/.test(Z))throw new D("bid.powerchina.cn","[taxonomy=selector_drift] site=powerchina command=search login required or human verification");if(B)throw new Y("powerchina search",`api/dom yielded no result: ${B}`)}return U(V,{site:"powerchina",query:J,limit:W})}});export const __test__={buildSearchCandidates,normalizeDate:j,dedupeCandidates:M,filterNavigationRows:H,isLikelyNavigationUrl:v,isLikelyNavigationTitle:F,buildApiDetailUrl,toApiCandidate:O};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{CliError as u}from"@jackwener/opencli/errors";import{PRODUCTHUNT_CATEGORY_SLUGS as d}from"./utils.js";c({site:"producthunt",name:"browse",access:"read",description:"Best products in a Product Hunt category",domain:"www.producthunt.com",strategy:l.INTERCEPT,args:[{name:"category",type:"string",positional:!0,required:!0,help:"Category slug, e.g. vibe-coding, ai-agents, developer-tools"},{name:"limit",type:"int",default:20,help:"Number of results (max 50)"}],columns:["rank","name","tagline","reviews","url"],func:async(e,r)=>{const s=Math.min(Number(r.limit)||20,50),n=String(r.category||"").trim().toLowerCase();await e.installInterceptor("producthunt.com");await e.goto(`https://www.producthunt.com/categories/${n}`);await e.waitForCapture(5);const a=await e.evaluate(`
|
|
2
|
+
(() => {
|
|
3
|
+
const seen = new Set();
|
|
4
|
+
const results = [];
|
|
5
|
+
|
|
6
|
+
// Card links: <a class="...flex-col" href="/products/<slug>"> (not review links)
|
|
7
|
+
const cardLinks = Array.from(document.querySelectorAll('a[href^="/products/"]')).filter(a => {
|
|
8
|
+
const href = a.getAttribute('href') || '';
|
|
9
|
+
const cls = a.className || '';
|
|
10
|
+
return cls.includes('flex-col') && !href.includes('/reviews');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
for (const cardLink of cardLinks) {
|
|
14
|
+
const href = cardLink.getAttribute('href');
|
|
15
|
+
if (!href || seen.has(href)) continue;
|
|
16
|
+
|
|
17
|
+
// Child 0: div with name (strip "Launched this month/week/year" noise)
|
|
18
|
+
const nameDiv = cardLink.querySelector('div');
|
|
19
|
+
const rawName = nameDiv?.textContent?.trim() || '';
|
|
20
|
+
const name = rawName
|
|
21
|
+
.replace(/\\s*Launched\\s+this\\s+(month|week|year|day)\\s*/gi, '')
|
|
22
|
+
.replace(/\\s*Featured\\s*/gi, '')
|
|
23
|
+
.trim();
|
|
24
|
+
|
|
25
|
+
// Child 1: span.text-secondary — tagline
|
|
26
|
+
const taglineEl = cardLink.querySelector('span.text-secondary, span[class*="text-secondary"]');
|
|
27
|
+
const tagline = taglineEl?.textContent?.trim() || '';
|
|
28
|
+
|
|
29
|
+
if (!name) continue;
|
|
30
|
+
|
|
31
|
+
// Find reviews count from sibling /reviews link
|
|
32
|
+
let reviews = '';
|
|
33
|
+
let container = cardLink.parentElement;
|
|
34
|
+
for (let i = 0; i < 5 && container; i++) {
|
|
35
|
+
const reviewLink = container.querySelector('a[href="' + href + '/reviews"]');
|
|
36
|
+
if (reviewLink) {
|
|
37
|
+
reviews = (reviewLink.textContent?.trim() || '').replace(/\\s*reviews?\\s*/i, '').trim();
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
container = container.parentElement;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
seen.add(href);
|
|
44
|
+
results.push({
|
|
45
|
+
name,
|
|
46
|
+
tagline: tagline.slice(0, 120),
|
|
47
|
+
reviews: reviews || '0',
|
|
48
|
+
url: 'https://www.producthunt.com' + href,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return results;
|
|
53
|
+
})()
|
|
54
|
+
`),i=Array.isArray(a)?a:[];if(i.length===0)throw new u("NO_DATA",`No products found for category "${n}"`,"Check the category slug or try: "+d.slice(0,5).join(", "));return i.slice(0,s).map((t,o)=>({rank:o+1,name:t.name,tagline:t.tagline,reviews:t.reviews,url:t.url}))}});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{cli as u,Strategy as l}from"@jackwener/opencli/registry";import{CliError as s}from"@jackwener/opencli/errors";import{pickVoteCount as d}from"./utils.js";u({site:"producthunt",name:"hot",access:"read",description:"Today's top Product Hunt launches with vote counts",domain:"www.producthunt.com",strategy:l.INTERCEPT,args:[{name:"limit",type:"int",default:20,help:"Number of results (max 50)"}],columns:["rank","name","votes","url"],func:async(e,i)=>{const c=Math.min(Number(i.limit)||20,50);await e.installInterceptor("producthunt.com");await e.goto("https://www.producthunt.com");await e.waitForCapture(5);const o=await e.evaluate(`
|
|
2
|
+
(() => {
|
|
3
|
+
const seen = new Set();
|
|
4
|
+
const results = [];
|
|
5
|
+
|
|
6
|
+
const cardLinks = Array.from(document.querySelectorAll('a[href^="/products/"]')).filter((el) => {
|
|
7
|
+
const href = el.getAttribute('href') || '';
|
|
8
|
+
const text = el.textContent?.trim() || '';
|
|
9
|
+
return href && !href.includes('/reviews') && text.length > 0 && text.length < 120;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const normalizeName = (text) => text
|
|
13
|
+
.replace(/^\\d+\\.\\s*/, '')
|
|
14
|
+
.replace(/\\s*Launched\\s+this\\s+(month|week|year|day)\\s*/gi, '')
|
|
15
|
+
.replace(/\\s*Featured\\s*/gi, '')
|
|
16
|
+
.trim();
|
|
17
|
+
|
|
18
|
+
for (const cardLink of cardLinks) {
|
|
19
|
+
const href = cardLink.getAttribute('href') || '';
|
|
20
|
+
if (!href || seen.has(href)) continue;
|
|
21
|
+
|
|
22
|
+
let card = cardLink;
|
|
23
|
+
let node = cardLink.parentElement;
|
|
24
|
+
for (let i = 0; i < 6 && node; i++) {
|
|
25
|
+
const hasReviewLink = !!node.querySelector('a[href="' + href + '/reviews"]');
|
|
26
|
+
const hasNumericNode = Array.from(node.querySelectorAll('button, [role="button"], p, span, div'))
|
|
27
|
+
.some((el) => /^\\d+$/.test(el.textContent?.trim() || ''));
|
|
28
|
+
if (hasReviewLink || hasNumericNode) {
|
|
29
|
+
card = node;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
node = node.parentElement;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const name = normalizeName(cardLink.textContent?.trim() || '');
|
|
36
|
+
if (!name) continue;
|
|
37
|
+
|
|
38
|
+
const voteCandidates = Array.from(card.querySelectorAll('button, [role="button"], a, p, span, div'))
|
|
39
|
+
.map((el) => {
|
|
40
|
+
const reviewLink = el.closest('a[href="' + href + '/reviews"]');
|
|
41
|
+
return {
|
|
42
|
+
text: el.textContent?.trim() || '',
|
|
43
|
+
tagName: el.tagName,
|
|
44
|
+
className: el.className || '',
|
|
45
|
+
role: el.getAttribute('role') || '',
|
|
46
|
+
inButton: !!el.closest('button, [role="button"]'),
|
|
47
|
+
inReviewLink: !!reviewLink,
|
|
48
|
+
};
|
|
49
|
+
})
|
|
50
|
+
.filter((candidate) => /^\\d+$/.test(candidate.text));
|
|
51
|
+
|
|
52
|
+
if (voteCandidates.length === 0) continue;
|
|
53
|
+
|
|
54
|
+
seen.add(href);
|
|
55
|
+
results.push({
|
|
56
|
+
name,
|
|
57
|
+
voteCandidates,
|
|
58
|
+
url: 'https://www.producthunt.com' + href,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return results;
|
|
63
|
+
})()
|
|
64
|
+
`),a=Array.isArray(o)?o:[];if(a.length===0)throw new s("NO_DATA","Could not retrieve Product Hunt top posts","Product Hunt may have changed its layout");const r=a.map((t)=>({name:t.name,url:t.url,votes:d(Array.isArray(t.voteCandidates)?t.voteCandidates:[])})).filter((t)=>t.name&&t.url&&t.votes);if(r.length===0)throw new s("NO_DATA","Could not retrieve Product Hunt vote counts","Product Hunt may have changed its vote button structure");r.sort((t,n)=>parseInt(n.votes,10)-parseInt(t.votes,10));return r.slice(0,c).map((t,n)=>({rank:n+1,name:t.name,votes:t.votes,url:t.url}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as r,Strategy as n}from"@jackwener/opencli/registry";import{fetchFeed as a,PRODUCTHUNT_CATEGORY_SLUGS as s}from"./utils.js";r({site:"producthunt",name:"posts",access:"read",description:"Latest Product Hunt launches (optional category filter)",domain:"www.producthunt.com",strategy:n.PUBLIC,args:[{name:"limit",type:"int",default:20,help:"Number of results (max 50)"},{name:"category",type:"string",default:"",help:`Category filter: ${s.join(", ")}`}],columns:["rank","name","tagline","author","date","url"],func:async(t)=>{const e=Math.min(Number(t.limit)||20,50),o=String(t.category??"").trim()||void 0;return(await a(o)).slice(0,e)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as B,Strategy as C}from"@jackwener/opencli/registry";import{fetchFeed as E}from"./utils.js";B({site:"producthunt",name:"today",access:"read",description:"Today's Product Hunt launches (most recent day in feed)",domain:"www.producthunt.com",strategy:C.PUBLIC,args:[{name:"limit",type:"int",default:20,help:"Max results"}],columns:["rank","name","tagline","author","url"],func:async(v)=>{const x=Math.min(Number(v.limit)||20,50),q=await E();if(q.length===0)return[];const z=q.map((m)=>m.date).sort().reverse()[0];return q.filter((m)=>m.date===z).slice(0,x).map((m,A)=>({rank:A+1,name:m.name,tagline:m.tagline,author:m.author,url:m.url}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PRODUCTHUNT_CATEGORY_SLUGS=["ai-agents","ai-coding-agents","ai-code-editors","ai-chatbots","ai-workflow-automation","vibe-coding","developer-tools","productivity","design-creative","marketing-sales","no-code-platforms","llms","finance","social-community","engineering-development"];const K="Mozilla/5.0 (compatible; opencli/1.0)";export async function fetchFeed(w){const B=w?`https://www.producthunt.com/feed?category=${encodeURIComponent(w)}`:"https://www.producthunt.com/feed",f=await fetch(B,{headers:{"User-Agent":K}});if(!f.ok)return[];const j=await f.text();return parseFeed(j)}export function parseFeed(w){const B=[],f=/<entry>([\s\S]*?)<\/entry>/g;let j,C=1;while(j=f.exec(w)){const q=j[1],z=q.match(/<title>([\s\S]*?)<\/title>/)?.[1]?.trim()??"",E=q.match(/<name>([\s\S]*?)<\/name>/)?.[1]?.trim()??"",G=(q.match(/<published>(.*?)<\/published>/)?.[1]?.trim()??"").slice(0,10),H=q.match(/<link[^>]*href="([^"]+)"/)?.[1]?.trim()??"",J=(q.match(/<content[^>]*>([\s\S]*?)<\/content>/)?.[1]??"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/<[^>]+>/g," ").replace(/\s+/g," ").replace(/\s*Discussion\s*\|?\s*/gi,"").replace(/\s*\|?\s*Link\s*$/gi,"").trim().slice(0,120);if(z)B.push({rank:C++,name:z,tagline:J,author:E,date:G,url:H})}return B}export function pickVoteCount(w){return w.map((f)=>{const j=String(f.text??"").trim();if(!/^\d+$/.test(j))return null;if(f.inReviewLink)return null;const C=parseInt(j,10);if(!Number.isFinite(C)||C<=0)return null;const q=`${f.tagName??""} ${f.className??""} ${f.role??""}`.toLowerCase();let z=0;if(f.inButton)z+=4;if(q.includes("vote")||q.includes("upvote"))z+=3;if(q.includes("button"))z+=1;return{text:j,score:z,value:C}}).filter((f)=>Boolean(f)).sort((f,j)=>{if(j.score!==f.score)return j.score-f.score;if(j.value!==f.value)return j.value-f.value;return f.text.localeCompare(j.text)})[0]?.text??""}export function toDate(w){return w.slice(0,10)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as i,Strategy as n}from"@jackwener/opencli/registry";import{CommandExecutionError as o,EmptyResultError as s}from"@jackwener/opencli/errors";import{eutilsFetch as u,parseArticleXml as c,requirePmid as m,truncateText as d}from"./utils.js";i({site:"pubmed",name:"article",aliases:["paper","read"],access:"read",description:"Get detailed information for a PubMed article by PMID",domain:"pubmed.ncbi.nlm.nih.gov",strategy:n.PUBLIC,browser:!1,defaultFormat:"plain",args:[{name:"pmid",positional:!0,required:!0,help:"PubMed ID, e.g. 37780221"},{name:"full-abstract",type:"boolean",default:!1,help:"Do not truncate the abstract in table output"}],columns:["pmid","title","authors","journal","year","date","article_type","language","doi","pmc","affiliations","grants","mesh_terms","keywords","abstract","url"],func:async(a)=>{const e=m(a.pmid),r=await u("efetch",{id:e,rettype:"abstract"},{retmode:"xml",label:"pubmed article"}),t=c(r,e);if(!t)throw new s("pubmed article",`No article found for PMID ${e}.`);if(!t.title)throw new o(`pubmed article ${e} did not include a title`,"PubMed EFetch response shape may have changed.");const l=a["full-abstract"]?t.abstract:d(t.abstract,500);return[{pmid:t.pmid,title:t.title,authors:t.authors.join(", "),journal:t.journal,year:t.year,date:t.date||null,article_type:t.article_type,language:t.language||null,doi:t.doi||null,pmc:t.pmc||null,affiliations:t.affiliations||null,grants:t.grants||null,mesh_terms:t.mesh_terms||null,keywords:t.keywords||null,abstract:l||null,url:t.url}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as p,Strategy as d}from"@jackwener/opencli/registry";import{ArgumentError as y,CommandExecutionError as b,EmptyResultError as w}from"@jackwener/opencli/errors";import{LINK_COLUMNS as A,eutilsFetch as S,fetchSummaryRows as E,requireBoundedInt as F,requireChoice as m,requireText as l,requireYear as h}from"./utils.js";p({site:"pubmed",name:"author",access:"read",description:"Search PubMed articles by author name and optional affiliation",domain:"pubmed.ncbi.nlm.nih.gov",strategy:d.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,help:'Author name, e.g. "Smith J"'},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"affiliation",help:"Filter by author affiliation"},{name:"position",default:"any",choices:["any","first","last"],help:"Author position: any, first, or last"},{name:"year-from",type:"int",help:"Filter publication year from"},{name:"year-to",type:"int",help:"Filter publication year to"},{name:"sort",default:"date",choices:["date","relevance"],help:"Sort by date or relevance"}],columns:A,func:async(e)=>{const r=l(e.name,"author"),c=F(e.limit,20,100),o=m(e.position,["any","first","last"],"position","any"),f=m(e.sort,["date","relevance"],"sort","date"),i=h(e["year-from"],"year-from"),n=h(e["year-to"],"year-to"),t=[`${r}[${o==="first"?"1au":o==="last"?"lastau":"au"}]`];if(e.affiliation)t.push(`${l(e.affiliation,"affiliation")}[ad]`);if(i||n){const s=i||1800,u=n||new Date().getFullYear();if(s>u)throw new y("pubmed year-from must be <= year-to");t.push(`${s}:${u}[PDAT]`)}const a=(await S("esearch",{term:t.join(" AND "),retmax:c,usehistory:"y",sort:f==="date"?"pub_date":""},{label:"pubmed author"}))?.esearchresult?.idlist;if(!Array.isArray(a))throw new b("pubmed author did not return an id list","PubMed ESearch response shape may have changed.");if(a.length===0)throw new w("pubmed author",`No articles found for author "${r}".`);return E(a,"pubmed author summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as s,Strategy as o}from"@jackwener/opencli/registry";import{EmptyResultError as c}from"@jackwener/opencli/errors";import{LINK_COLUMNS as d,eutilsFetch as m,fetchSummaryRows as a,requireBoundedInt as l,requireChoice as u,requirePmid as p}from"./utils.js";s({site:"pubmed",name:"citations",access:"read",description:"Get PubMed citation relationships for an article",domain:"pubmed.ncbi.nlm.nih.gov",strategy:o.PUBLIC,browser:!1,args:[{name:"pmid",positional:!0,required:!0,help:"PubMed ID, e.g. 37780221"},{name:"direction",default:"citedby",choices:["citedby","references"],help:"citedby or references"},{name:"limit",type:"int",default:20,help:"Max results (1-100)"}],columns:d,func:async(e)=>{const t=p(e.pmid),r=u(e.direction,["citedby","references"],"direction","citedby"),n=l(e.limit,20,100),i=(await m("elink",{id:t,dbfrom:"pubmed",cmd:"neighbor",linkname:r==="citedby"?"pubmed_pubmed_citedin":"pubmed_pubmed_refs"},{label:"pubmed citations"}))?.linksets?.[0]?.linksetdbs?.[0]?.links;if(!Array.isArray(i)||i.length===0)throw new c("pubmed citations",`No ${r} links found for PMID ${t}.`);return a(i.slice(0,n).map(String),"pubmed citations summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as u,Strategy as s}from"@jackwener/opencli/registry";import{CommandExecutionError as m,EmptyResultError as y}from"@jackwener/opencli/errors";import{SEARCH_COLUMNS as d,buildSearchQuery as p,eutilsFetch as h,fetchSummaryRows as f,requireBoundedInt as b,requireChoice as q,requireText as w,requireYear as a}from"./utils.js";u({site:"pubmed",name:"clinical-trial",access:"read",description:"Search PubMed clinical trials with a trial-study preset",domain:"pubmed.ncbi.nlm.nih.gov",strategy:s.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Clinical topic query, e.g. "breast cancer"'},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"year-from",type:"int",help:"Filter publication year from"},{name:"year-to",type:"int",help:"Filter publication year to"},{name:"free-full-text",type:"boolean",default:!1,help:"Only include free full text articles"},{name:"sort",default:"date",choices:["date","relevance"],help:"Sort by date or relevance"}],columns:d,func:async(e)=>{const t=w(e.query,"query"),i=b(e.limit,20,100),l=a(e["year-from"],"year-from"),c=a(e["year-to"],"year-to"),n=q(e.sort,["date","relevance"],"sort","date"),o=p(t,{yearFrom:l,yearTo:c,articleType:"Clinical Trial",hasFullText:e["free-full-text"],humanOnly:!0}),r=(await h("esearch",{term:o,retmax:i,usehistory:"y",sort:n==="date"?"pub_date":""},{label:"pubmed clinical-trial"}))?.esearchresult?.idlist;if(!Array.isArray(r))throw new m("pubmed clinical-trial did not return an id list","PubMed ESearch response shape may have changed.");if(r.length===0)throw new y("pubmed clinical-trial",`No clinical trial articles matched "${t}".`);return f(r,"pubmed clinical-trial summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as c,Strategy as d}from"@jackwener/opencli/registry";import{ArgumentError as p,CommandExecutionError as y,EmptyResultError as h}from"@jackwener/opencli/errors";import{SEARCH_COLUMNS as f,eutilsFetch as b,fetchSummaryRows as j,requireBoundedInt as w,requireChoice as v,requireText as E,requireYear as l}from"./utils.js";c({site:"pubmed",name:"journal",access:"read",description:"Search PubMed articles by journal name",domain:"pubmed.ncbi.nlm.nih.gov",strategy:d.PUBLIC,browser:!1,args:[{name:"journal",positional:!0,required:!0,help:'Journal name, e.g. "Nature" or "The Lancet"'},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"year-from",type:"int",help:"Filter publication year from"},{name:"year-to",type:"int",help:"Filter publication year to"},{name:"sort",default:"relevance",choices:["relevance","date"],help:"Sort by relevance or date"}],columns:f,func:async(e)=>{const t=E(e.journal,"journal"),m=w(e.limit,20,100),a=l(e["year-from"],"year-from"),o=l(e["year-to"],"year-to"),s=v(e.sort,["relevance","date"],"sort","relevance"),n=[`${t}[Journal]`];if(a||o){const u=a||1800,i=o||new Date().getFullYear();if(u>i)throw new p("pubmed year-from must be <= year-to");n.push(`${u}:${i}[PDAT]`)}const r=(await b("esearch",{term:n.join(" AND "),retmax:m,usehistory:"y",sort:s==="date"?"pub_date":""},{label:"pubmed journal"}))?.esearchresult?.idlist;if(!Array.isArray(r))throw new y("pubmed journal did not return an id list","PubMed ESearch response shape may have changed.");if(r.length===0)throw new h("pubmed journal",`No articles found for journal "${t}".`);return j(r,"pubmed journal summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as o,Strategy as i}from"@jackwener/opencli/registry";import{CommandExecutionError as n,EmptyResultError as c}from"@jackwener/opencli/errors";import{SEARCH_COLUMNS as l,eutilsFetch as u,fetchSummaryRows as d,requireBoundedInt as h,requireChoice as p,requireText as y}from"./utils.js";o({site:"pubmed",name:"mesh",access:"read",description:"Search PubMed articles by MeSH term",domain:"pubmed.ncbi.nlm.nih.gov",strategy:i.PUBLIC,browser:!1,args:[{name:"term",positional:!0,required:!0,help:'MeSH term, e.g. "Neoplasms" or "Machine Learning"'},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"major",type:"boolean",default:!1,help:"Only include articles where this is a major MeSH topic"},{name:"sort",default:"relevance",choices:["relevance","date"],help:"Sort by relevance or date"}],columns:l,func:async(e)=>{const t=y(e.term,"term"),a=h(e.limit,20,100),s=p(e.sort,["relevance","date"],"sort","relevance"),m=e.major?"Majr":"MeSH Terms",r=(await u("esearch",{term:`${t}[${m}]`,retmax:a,usehistory:"y",sort:s==="date"?"pub_date":""},{label:"pubmed mesh"}))?.esearchresult?.idlist;if(!Array.isArray(r))throw new n("pubmed mesh did not return an id list","PubMed ESearch response shape may have changed.");if(r.length===0)throw new c("pubmed mesh",`No articles found for MeSH term "${t}".`);return d(r,"pubmed mesh summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as d,Strategy as m}from"@jackwener/opencli/registry";import{EmptyResultError as o}from"@jackwener/opencli/errors";import{RELATED_COLUMNS as n,eutilsFetch as u,fetchSummaryRows as c,requireBoundedInt as p,requirePmid as b}from"./utils.js";d({site:"pubmed",name:"related",access:"read",description:"Find articles related to a PubMed article",domain:"pubmed.ncbi.nlm.nih.gov",strategy:m.PUBLIC,browser:!1,args:[{name:"pmid",positional:!0,required:!0,help:"PubMed ID, e.g. 37780221"},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"score",type:"boolean",default:!1,help:"Show similarity scores when available"}],columns:n,func:async(t)=>{const r=b(t.pmid),l=p(t.limit,20,100),i=(await u("elink",{id:r,dbfrom:"pubmed",cmd:"neighbor_score",linkname:"pubmed_pubmed"},{label:"pubmed related"}))?.linksets?.[0]?.linksetdbs?.[0]?.links;if(!Array.isArray(i)||i.length===0)throw new o("pubmed related",`No related articles found for PMID ${r}.`);const s=i.map((e)=>typeof e==="string"?{id:e,score:null}:{id:String(e?.id??""),score:Number.isFinite(Number(e?.score))?Number(e.score):null}).filter((e)=>e.id&&e.id!==r).slice(0,l);if(s.length===0)throw new o("pubmed related",`No related articles found for PMID ${r}.`);return(await c(s.map((e)=>e.id),"pubmed related summary")).map((e,a)=>({...e,score:t.score?s[a].score:null}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as m,Strategy as u}from"@jackwener/opencli/registry";import{CommandExecutionError as l,EmptyResultError as y}from"@jackwener/opencli/errors";import{SEARCH_COLUMNS as d,buildSearchQuery as h,eutilsFetch as p,fetchSummaryRows as b,requireBoundedInt as w,requireChoice as f,requireText as v,requireYear as a}from"./utils.js";m({site:"pubmed",name:"review",access:"read",description:"Search PubMed review articles with a review preset",domain:"pubmed.ncbi.nlm.nih.gov",strategy:u.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Review topic query, e.g. "immunotherapy"'},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"year-from",type:"int",help:"Filter publication year from"},{name:"year-to",type:"int",help:"Filter publication year to"},{name:"has-abstract",type:"boolean",default:!1,help:"Only include articles with abstracts"},{name:"sort",default:"date",choices:["date","relevance"],help:"Sort by date or relevance"}],columns:d,func:async(e)=>{const t=v(e.query,"query"),i=w(e.limit,20,100),o=a(e["year-from"],"year-from"),s=a(e["year-to"],"year-to"),n=f(e.sort,["date","relevance"],"sort","date"),c=h(t,{yearFrom:o,yearTo:s,articleType:"Review",hasAbstract:e["has-abstract"]}),r=(await p("esearch",{term:c,retmax:i,usehistory:"y",sort:n==="date"?"pub_date":""},{label:"pubmed review"}))?.esearchresult?.idlist;if(!Array.isArray(r))throw new l("pubmed review did not return an id list","PubMed ESearch response shape may have changed.");if(r.length===0)throw new y("pubmed review",`No review articles matched "${t}".`);return b(r,"pubmed review summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as s,Strategy as h}from"@jackwener/opencli/registry";import{CommandExecutionError as m,EmptyResultError as y}from"@jackwener/opencli/errors";import{SEARCH_COLUMNS as p,buildSearchQuery as d,eutilsFetch as f,fetchSummaryRows as b,requireBoundedInt as q,requireChoice as v,requireText as w,requireYear as t}from"./utils.js";s({site:"pubmed",name:"search",access:"read",description:"Search PubMed articles with advanced filters",domain:"pubmed.ncbi.nlm.nih.gov",strategy:h.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Search query, e.g. "machine learning cancer"'},{name:"limit",type:"int",default:20,help:"Max results (1-100)"},{name:"author",help:"Filter by author name"},{name:"journal",help:"Filter by journal name"},{name:"year-from",type:"int",help:"Filter publication year from"},{name:"year-to",type:"int",help:"Filter publication year to"},{name:"article-type",help:"Filter by publication type, e.g. Review or Clinical Trial"},{name:"has-abstract",type:"boolean",default:!1,help:"Only include articles with abstracts"},{name:"free-full-text",type:"boolean",default:!1,help:"Only include free full text articles"},{name:"humans-only",type:"boolean",default:!1,help:"Only include human studies"},{name:"english-only",type:"boolean",default:!1,help:"Only include English articles"},{name:"sort",default:"relevance",choices:["relevance","date","author","journal"],help:"Sort by relevance, date, author, or journal"}],columns:p,func:async(e)=>{const a=w(e.query,"query"),l=q(e.limit,20,100),n=t(e["year-from"],"year-from"),o=t(e["year-to"],"year-to"),i=v(e.sort,["relevance","date","author","journal"],"sort","relevance"),u={relevance:"",date:"pub_date",author:"Author",journal:"JournalName"},c=d(a,{author:e.author,journal:e.journal,yearFrom:n,yearTo:o,articleType:e["article-type"],hasAbstract:e["has-abstract"],hasFullText:e["free-full-text"],humanOnly:e["humans-only"],englishOnly:e["english-only"]}),r=(await f("esearch",{term:c,retmax:l,usehistory:"y",sort:u[i]},{label:"pubmed search"}))?.esearchresult?.idlist;if(!Array.isArray(r))throw new m("pubmed search did not return an id list","PubMed ESearch response shape may have changed.");if(r.length===0)throw new y("pubmed search",`No articles matched "${a}".`);return b(r,"pubmed search summary")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ArgumentError as l,CommandExecutionError as u}from"@jackwener/opencli/errors";export const EUTILS_BASE="https://eutils.ncbi.nlm.nih.gov/entrez/eutils",SEARCH_COLUMNS=["rank","pmid","title","authors","journal","year","article_type","doi","url"],LINK_COLUMNS=["rank","pmid","title","authors","journal","year","article_type","doi","url"],RELATED_COLUMNS=["rank","pmid","title","authors","journal","year","article_type","score","doi","url"];let m=0;export function requireText(r,t){const e=String(r??"").trim();if(!e)throw new l(`pubmed ${t} cannot be empty`);return e}export function requirePmid(r,t="pmid"){const e=requireText(r,t);if(!/^\d+$/.test(e))throw new l(`pubmed ${t} must be a numeric PMID`,"Example: 37780221");return e}export function requireBoundedInt(r,t,e,n="limit"){const a=String(r??t).trim();if(!/^\d+$/.test(a))throw new l(`pubmed ${n} must be a positive integer`);const i=Number(a);if(!Number.isSafeInteger(i)||i<1)throw new l(`pubmed ${n} must be a positive integer`);if(i>e)throw new l(`pubmed ${n} must be <= ${e}`);return i}export function requireYear(r,t){if(r===void 0||r===null||r==="")return;const e=requireBoundedInt(r,1900,3000,t);if(e<1800)throw new l(`pubmed ${t} must be >= 1800`);return e}export function requireChoice(r,t,e,n){const o=String(r??n).trim();if(!t.includes(o))throw new l(`pubmed ${e} must be one of: ${t.join(", ")}`);return o}export function buildEutilsUrl(r,t={}){const e=new URLSearchParams;e.set("db","pubmed");if(!t.retmode)e.set("retmode","json");if(process.env.NCBI_API_KEY)e.set("api_key",process.env.NCBI_API_KEY);if(process.env.NCBI_EMAIL)e.set("email",process.env.NCBI_EMAIL);for(const[n,o]of Object.entries(t))if(o!==void 0&&o!==null&&o!=="")e.set(n,String(o));return`${EUTILS_BASE}/${r}.fcgi?${e.toString()}`}async function I(){const r=process.env.NCBI_API_KEY?110:360,t=Date.now(),e=Math.max(0,m+r-t);if(e>0)await new Promise((n)=>setTimeout(n,e));m=Date.now()}export async function eutilsFetch(r,t={},{retmode:e="json",label:n="PubMed E-utilities"}={}){const o=buildEutilsUrl(r,{...t,retmode:e});await I();let a;try{a=await fetch(o)}catch(i){const c=i instanceof Error?i.message:String(i);throw new u(`${n} request failed`,c)}if(!a.ok)throw new u(`${n} HTTP ${a.status}`,"Check NCBI availability, request parameters, and optional NCBI_API_KEY.");if(e==="xml")return a.text();try{const i=await a.json();assertNoEutilsError(i,n);return i}catch(i){if(i instanceof u)throw i;const c=i instanceof Error?i.message:String(i);throw new u(`${n} returned invalid JSON`,c)}}export function assertNoEutilsError(r,t="PubMed E-utilities"){const e=r?.error||r?.esearchresult?.errorlist?.phrasesnotfound?.join(", ")||r?.esearchresult?.errorlist?.fieldsnotfound?.join(", ");if(e)throw new u(`${t} returned an error`,String(e))}export function buildPubMedUrl(r){return`https://pubmed.ncbi.nlm.nih.gov/${r}/`}export function decodeXmlEntities(r){return String(r??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&#x([0-9a-f]+);/gi,(t,e)=>String.fromCodePoint(Number.parseInt(e,16))).replace(/&#(\d+);/g,(t,e)=>String.fromCodePoint(Number.parseInt(e,10)))}export function cleanText(r){return decodeXmlEntities(r).replace(/\s+/g," ").trim()}export function truncateText(r,t){const e=cleanText(r);if(!e||e.length<=t)return e;return`${e.slice(0,t-3)}...`}export function extractFirst(r,t){const e=String(r??"").match(new RegExp(`<${t}\\b[^>]*>([\\s\\S]*?)<\\/${t}>`,"i"));return e?cleanText(e[1].replace(/<[^>]+>/g," ")):""}export function extractAll(r,t){const e=new RegExp(`<${t}\\b[^>]*>([\\s\\S]*?)<\\/${t}>`,"gi"),n=[];let o;while((o=e.exec(String(r??"")))!==null)n.push(cleanText(o[1].replace(/<[^>]+>/g," ")));return n}export function extractAttribute(r,t,e){const n=String(r??"").match(new RegExp(`<${t}\\b[^>]*\\b${e}="([^"]*)"`,"i"));return n?decodeXmlEntities(n[1]):""}export function extractAuthors(r,t=3){if(!Array.isArray(r)||r.length===0)return"";const e=r.map((o)=>o?.name||o?.collectivename||[o?.lastname,o?.initials].filter(Boolean).join(" ")).filter(Boolean),n=e.slice(0,t);if(e.length>t)n.push("et al.");return n.join(", ")}export function extractDoi(r){if(!Array.isArray(r))return"";const t=r.find((e)=>String(e?.idtype??"").toLowerCase()==="doi");return String(t?.value??"").trim()}export function articleTypeFromList(r){const t=Array.isArray(r)?r.map((n)=>typeof n==="string"?n:n?.value).filter(Boolean):[],e=["Systematic Review","Meta-Analysis","Review","Randomized Controlled Trial","Clinical Trial","Case Reports","Journal Article"];for(const n of e){const o=t.find((a)=>a.toLowerCase()===n.toLowerCase());if(o)return o}return t[0]||"Journal Article"}export function summaryToRow(r,t,e=r?.uid){const n=String(e??r?.uid??"").trim();return{rank:t,pmid:n,title:truncateText(String(r?.title??"").replace(/\.$/,""),120),authors:extractAuthors(r?.authors,3),journal:truncateText(r?.fulljournalname||r?.source||"",60),year:String(r?.pubdate??"").split(" ")[0]||"",article_type:articleTypeFromList(r?.pubtype),doi:extractDoi(r?.articleids),url:buildPubMedUrl(n)}}export function ensureCompleteSummaryRows(r,t,e){if(!t||typeof t!=="object"||!t.result||typeof t.result!=="object")throw new u(`${e} returned an unreadable summary payload`);const n=r.map((o,a)=>{const i=t.result[o];if(!i)return null;return summaryToRow(i,a+1,o)});if(n.some((o)=>o===null))throw new u(`${e} omitted summaries for one or more PMIDs`,"Refusing to return a partial result set.");return n}export function buildSearchQuery(r,t={}){const e=[requireText(r,"query")];if(t.author)e.push(`${requireText(t.author,"author")}[Author]`);if(t.journal)e.push(`${requireText(t.journal,"journal")}[Journal]`);if(t.yearFrom||t.yearTo){const n=t.yearFrom||1800,o=t.yearTo||new Date().getFullYear();if(n>o)throw new l("pubmed year-from must be <= year-to");e.push(`${n}:${o}[PDAT]`)}if(t.articleType)e.push(`${requireText(t.articleType,"article-type")}[PT]`);if(t.hasAbstract)e.push("hasabstract[text]");if(t.hasFullText)e.push("free full text[sb]");if(t.humanOnly)e.push("humans[mesh]");if(t.englishOnly)e.push("english[lang]");return e.join(" AND ")}export function parseArticleXml(r,t){const e=String(r??"");if(!e||/<ERROR\b/i.test(e)||!/<PubmedArticle\b/i.test(e))return null;const n=extractFirst(e,"PMID");if(!n)throw new u("pubmed article response did not include a PMID","PubMed EFetch response shape may have changed.");if(n!==t)throw new u(`pubmed article response PMID ${n} did not match requested PMID ${t}`,"Refusing to return metadata for a different article.");const o=e.match(/<Article\b[^>]*>([\s\S]*?)<\/Article>/i)?.[1]||e,a=o.match(/<Journal\b[^>]*>([\s\S]*?)<\/Journal>/i)?.[1]||"",c=(a.match(/<JournalIssue\b[^>]*>([\s\S]*?)<\/JournalIssue>/i)?.[1]||"").match(/<PubDate\b[^>]*>([\s\S]*?)<\/PubDate>/i)?.[1]||"",f=[...e.matchAll(/<Author\b[^>]*>([\s\S]*?)<\/Author>/gi)].map((s)=>s[1]).map((s)=>{return extractFirst(s,"CollectiveName")||[extractFirst(s,"LastName"),extractFirst(s,"ForeName")||extractFirst(s,"Initials")].filter(Boolean).join(" ")}).filter(Boolean),d=extractAll(o,"AbstractText").join(" "),h=extractAll(o,"PublicationType"),g=extractAll(e,"DescriptorName"),w=extractAll(e,"Keyword"),y=extractAll(e,"Affiliation"),b=[...e.matchAll(/<Grant\b[^>]*>([\s\S]*?)<\/Grant>/gi)].map((s)=>s[1]).map((s)=>{const p=extractFirst(s,"GrantID"),A=extractFirst(s,"Agency");return[p,A].filter(Boolean).join(": ")}).filter(Boolean),x=e.match(/<ArticleId\b[^>]*IdType="doi"[^>]*>([\s\S]*?)<\/ArticleId>/i)?.[1]||"",S=e.match(/<ArticleId\b[^>]*IdType="pmc"[^>]*>([\s\S]*?)<\/ArticleId>/i)?.[1]||"";return{pmid:t,title:extractFirst(o,"ArticleTitle"),abstract:d,authors:f,journal:extractFirst(a,"Title")||extractFirst(a,"ISOAbbreviation"),year:extractFirst(c,"Year")||extractFirst(e,"MedlineDate").slice(0,4),date:[extractFirst(c,"Year"),extractFirst(c,"Month"),extractFirst(c,"Day")].filter(Boolean).join(" "),doi:cleanText(x),pmc:cleanText(S),article_type:articleTypeFromList(h),language:extractFirst(o,"Language"),affiliations:y.slice(0,10).join(" | "),grants:b.slice(0,10).join(" | "),mesh_terms:g.slice(0,10).join(", "),keywords:w.slice(0,10).join(", "),url:buildPubMedUrl(t)}}export async function fetchSummaryRows(r,t){const e=await eutilsFetch("esummary",{id:r.join(",")},{label:t});return ensureCompleteSummaryRows(r,e,t)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as i,Strategy as p}from"@jackwener/opencli/registry";import{ArgumentError as c,EmptyResultError as l}from"@jackwener/opencli/errors";import{PYPISTATS_BASE as s,pypiFetch as d,requirePackageName as y}from"./utils.js";const w=new Set(["recent","overall"]);function u(t){const a=String(t??"recent").trim().toLowerCase();if(!w.has(a))throw new c(`pypi downloads period "${t}" is invalid`,"Allowed values: recent (default — last day/week/month totals) or overall (full daily history).");return a}i({site:"pypi",name:"downloads",access:"read",description:"PyPI download stats for a package (recent totals or full daily history)",domain:"pypistats.org",strategy:p.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,help:'PyPI package name (e.g. "requests", "pandas")'},{name:"period",default:"recent",help:"recent (default — 1 row, last day/week/month) or overall (1 row per day)"}],columns:["rank","package","period","date","downloads"],func:async(t)=>{const a=y(t.name);if(u(t.period)==="recent"){const o=await d(`${s}/api/packages/${encodeURIComponent(a)}/recent`,`pypi downloads ${a}`),e=o?.data;if(!e||e.last_day==null&&e.last_week==null&&e.last_month==null)throw new l("pypi downloads",`pypistats has no recent download data for "${a}".`);return[{rank:1,package:String(o.package??a),period:"last_day",date:"",downloads:e.last_day!=null?Number(e.last_day):null},{rank:2,package:String(o.package??a),period:"last_week",date:"",downloads:e.last_week!=null?Number(e.last_week):null},{rank:3,package:String(o.package??a),period:"last_month",date:"",downloads:e.last_month!=null?Number(e.last_month):null}]}const r=await d(`${s}/api/packages/${encodeURIComponent(a)}/overall?mirrors=false`,`pypi downloads ${a}`),n=Array.isArray(r?.data)?r.data:[];if(!n.length)throw new l("pypi downloads",`pypistats has no overall download history for "${a}".`);return n.map((o,e)=>({rank:e+1,package:String(r.package??a),period:"daily",date:String(o.date??""),downloads:o.downloads!=null?Number(o.downloads):null}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as U,Strategy as W}from"@jackwener/opencli/registry";import{EmptyResultError as X}from"@jackwener/opencli/errors";import{PYPI_BASE as Q,pypiFetch as Z,requirePackageName as $}from"./utils.js";function q(C){if(C.home_page)return String(C.home_page);const x=C.project_urls;if(x&&typeof x==="object")return String(x.Homepage||x.homepage||x.Documentation||x.Source||x["Source Code"]||"");return""}function F(C){const x=C.project_urls;if(x&&typeof x==="object")return String(x.Source||x["Source Code"]||x.Repository||x.repository||"");return""}U({site:"pypi",name:"package",access:"read",description:"Single PyPI package metadata (latest version, license, homepage, classifiers)",domain:"pypi.org",strategy:W.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,help:'PyPI package name (e.g. "requests", "pandas")'}],columns:["name","latestVersion","summary","author","license","homepage","repository","requiresPython","keywords","releases","firstReleased","lastReleased","url"],func:async(C)=>{const x=$(C.name),M=await Z(`${Q}/pypi/${encodeURIComponent(x)}/json`,`pypi package ${x}`),z=M?.info;if(!z||!z.name)throw new X("pypi package",`PyPI returned no metadata for "${x}".`);const G=M?.releases??{},O=Object.keys(G).filter((L)=>Array.isArray(G[L])&&G[L].length>0);let J="",K="";for(const L of O)for(const T of G[L]){const D=String(T?.upload_time??"").slice(0,10);if(!D)continue;if(!J||D<J)J=D;if(!K||D>K)K=D}return[{name:String(z.name),latestVersion:String(z.version??""),summary:String(z.summary??""),author:String(z.author??z.author_email??""),license:String(z.license_expression??z.license??""),homepage:q(z),repository:F(z),requiresPython:String(z.requires_python??""),keywords:String(z.keywords??""),releases:O.length,firstReleased:J,lastReleased:K,url:String(z.package_url??`${Q}/project/${z.name}/`)}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ArgumentError as J,CommandExecutionError as F,EmptyResultError as L}from"@jackwener/opencli/errors";export const PYPI_BASE="https://pypi.org",PYPISTATS_BASE="https://pypistats.org";const O="opencli-pypi-adapter (+https://github.com/jackwener/opencli)",Q=/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/;export function requirePackageName(B){const f=String(B??"").trim();if(!f)throw new J('pypi package name is required (e.g. "requests", "pandas")');if(!Q.test(f))throw new J(`pypi package name "${B}" is not a valid distribution name`,'PyPI accepts ASCII letters / digits / "._-" with no leading or trailing separator.');return f}export async function pypiFetch(B,f){let q;try{q=await fetch(B,{headers:{"user-agent":O,accept:"application/json"}})}catch(D){throw new F(`${f} request failed: ${D?.message??D}`,"Check that pypi.org / pypistats.org are reachable from this network.")}if(q.status===404)throw new L(f,`PyPI returned 404 for ${B}.`);if(q.status===429)throw new F(`${f} returned HTTP 429 (rate limited)`,"PyPI throttles unauthenticated bursts; wait a few seconds and retry.");if(!q.ok)throw new F(`${f} returned HTTP ${q.status}`);let H;try{H=await q.json()}catch(D){throw new F(`${f} returned malformed JSON: ${D?.message??D}`)}return H}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AuthRequiredError as D}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as F}from"../_shared/site-auth.js";import{qiitaViewer as I}from"./gql.js";const y="https://qiita.com";async function z(b){return(await b.getCookies({url:y})).some((x)=>x.name==="_qiita_login_session"&&x.value)}async function B(b){await b.goto(`${y}/`);const f=await I(b);return{url_name:f.urlName,name:f.name||"",user_id:String(f.originalId??"")}}F({site:"qiita",domain:"qiita.com",loginUrl:"https://qiita.com/login",columns:["url_name","name","user_id"],loginDescription:"打开 Qiita 登录页并等待浏览器完成登录(供桌面客户端引导登录)。",quickCheck:z,verify:B,poll:async(b)=>{if(!await z(b))throw new D("qiita.com","Waiting for Qiita session cookie");return B(b)}});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{AuthRequiredError as K,CommandExecutionError as H}from"@jackwener/opencli/errors";const Q="https://qiita.com/graphql";export async function qiitaGql(F,z,B={}){const f=await F.evaluate(`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
var csrf = (document.querySelector('meta[name="csrf-token"]') || {}).content;
|
|
4
|
+
if (!csrf) return { kind: 'auth', detail: 'no csrf-token meta — not logged in?' };
|
|
5
|
+
var r = await fetch(${JSON.stringify(Q)}, {
|
|
6
|
+
method: 'POST',
|
|
7
|
+
credentials: 'include',
|
|
8
|
+
headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': csrf, 'X-Requested-With': 'XMLHttpRequest' },
|
|
9
|
+
body: JSON.stringify({ query: ${JSON.stringify(z)}, variables: ${JSON.stringify(B)} }),
|
|
10
|
+
});
|
|
11
|
+
var text = await r.text();
|
|
12
|
+
var data = null; try { data = JSON.parse(text); } catch (e) {}
|
|
13
|
+
if (r.status === 401 || r.status === 403) return { kind: 'auth', detail: 'HTTP ' + r.status };
|
|
14
|
+
if (!r.ok) return { kind: 'http', status: r.status, detail: text.slice(0, 300) };
|
|
15
|
+
return { kind: 'ok', body: data };
|
|
16
|
+
} catch (e) { return { kind: 'exception', detail: String(e && e.message || e) }; }
|
|
17
|
+
})()`);if(f?.kind==="auth")throw new K("qiita.com",`Not logged in (${f.detail}). Run \`opencli qiita login\`.`);if(f?.kind==="http")throw new H(`Qiita GraphQL failed: HTTP ${f.status} ${f.detail}`);if(f?.kind==="exception")throw new H(`Qiita GraphQL error: ${f.detail}`);if(f?.kind!=="ok"||!f.body)throw new H(`Unexpected Qiita response: ${JSON.stringify(f)}`);const J=f.body;if(Array.isArray(J.errors)&&J.errors.length){const L=J.errors.map((M)=>M.message).join("; ");if(/login required|unauthor|not authenticated/i.test(L))throw new K("qiita.com",`Qiita auth error: ${L}`);throw new H(`Qiita GraphQL error: ${L}`)}return J.data||{}}export async function qiitaDeleteByForm(F,z){const B=await F.evaluate(`(async () => {
|
|
18
|
+
try {
|
|
19
|
+
var meta = document.querySelector('meta[name="csrf-token"]');
|
|
20
|
+
var token = meta && meta.content;
|
|
21
|
+
if (!token) return { kind: 'auth' };
|
|
22
|
+
var r = await fetch(${JSON.stringify(z)}, {
|
|
23
|
+
method: 'POST', credentials: 'include',
|
|
24
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
25
|
+
body: '_method=delete&authenticity_token=' + encodeURIComponent(token),
|
|
26
|
+
redirect: 'manual',
|
|
27
|
+
});
|
|
28
|
+
// 302 跳转 = 删除成功;opaqueredirect(status 0)/2xx/3xx 都视为成功,4xx/5xx 视为失败。
|
|
29
|
+
var ok = r.type === 'opaqueredirect' || r.status === 0 || (r.status >= 200 && r.status < 400);
|
|
30
|
+
return { kind: 'done', ok: ok, status: r.status };
|
|
31
|
+
} catch (e) { return { kind: 'exception', detail: String(e && e.message || e) }; }
|
|
32
|
+
})()`);if(B?.kind==="auth")throw new K("qiita.com","Not logged in. Run `opencli qiita login`.");if(B?.kind==="exception")throw new H(`Qiita delete error: ${B.detail}`);return{ok:!!B?.ok,status:B?.status??-1}}export async function qiitaViewer(F){const z=await qiitaGql(F,"{ viewer { urlName name originalId } }");if(!z.viewer||!z.viewer.urlName)throw new K("qiita.com","Qiita viewer empty — not logged in");return z.viewer}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import*as V from"node:fs";import{cli as v,Strategy as F}from"@jackwener/opencli/registry";import{ArgumentError as X,CommandExecutionError as Y}from"@jackwener/opencli/errors";import{qiitaGql as Z,qiitaDeleteByForm as R}from"./gql.js";import{assertLiteralContent as h}from"../_shared/content-guard.js";export function resolveBody(z){if(z["body-file"]){const J=String(z["body-file"]);if(!V.statSync(J,{throwIfNoEntry:!1})?.isFile())throw new X(`--body-file not found: ${J}`);return V.readFileSync(J,"utf8")}if(z.body!==void 0&&z.body!==null){h(String(z.body),{fileFlag:"--body-file"});return String(z.body)}return}export function assertNoLocalImages(z){const J=[],M=(K)=>{const O=String(K??"").trim();if(!O)return;if(/^(https?:)?\/\//i.test(O))return;J.push(O.length>80?O.slice(0,80)+"…":O)};for(const K of z.matchAll(/!\[[^\]]*\]\(\s*<?([^)\s>]+)/g))M(K[1]);for(const K of z.matchAll(/<img\b[^>]*\bsrc\s*=\s*["']([^"']+)["']/gi))M(K[1]);if(J.length)throw new X(`正文里有 ${J.length} 张非公网 URL 的图片(${J.slice(0,3).join("、")})。`+"Qiita 不转存本机图片,发出去会是裂图——请改用公网可直接访问的 http(s) 图片 URL,或移除这些图。")}export function resolveTagNames(z){return String(z??"").split(",").map((J)=>J.trim()).filter(Boolean)}const G=`mutation($input: SaveCreatingArticleInput!) {
|
|
2
|
+
saveCreatingArticle(input: $input) { draftItem { uuid } }
|
|
3
|
+
}`,P=`mutation($input: PublishPublicArticleInput!) {
|
|
4
|
+
publishPublicArticle(input: $input) { article { uuid linkUrl encryptedId isSecret } }
|
|
5
|
+
}`,T=`mutation($input: PublishSecretArticleInput!) {
|
|
6
|
+
publishSecretArticle(input: $input) { article { uuid linkUrl encryptedId isSecret } }
|
|
7
|
+
}`;v({site:"qiita",name:"publish",access:"write",description:"Publish a Qiita article (markdown). Tags required. Public by default; --draft or --secret to change.",domain:"qiita.com",strategy:F.COOKIE,browser:!0,args:[{name:"title",type:"string",required:!1,help:"Article title (required)"},{name:"body",type:"string",required:!1,help:"Article body in Markdown (or use --body-file)"},{name:"body-file",type:"string",required:!1,help:"Path to a Markdown file for the body"},{name:"tags",type:"string",required:!1,help:"Comma-separated tags (REQUIRED, at least 1)"},{name:"draft",type:"boolean",required:!1,default:!1,help:"Save as draft only (do not publish)"},{name:"secret",type:"boolean",required:!1,default:!1,help:"Publish as limited-public (secret) instead of public"},{name:"tweet-share",type:"boolean",required:!1,default:!1,help:"Also share to X/Twitter on publish (public only)"}],columns:["status","uuid","url"],func:async(z,J)=>{if(!z)throw new Y("Browser session required for qiita publish");const M=String(J.title??"").trim(),K=resolveBody(J),O=resolveTagNames(J.tags);if(!M)throw new X("--title is required");if(K===void 0)throw new X("--body or --body-file is required");if(O.length===0)throw new X("--tags is required (Qiita articles need at least one tag)");assertNoLocalImages(K);await z.goto("https://qiita.com/drafts/new");await z.wait({time:2});const $=await Z(z,G,{input:{uuid:"",title:M,rawBody:K,tagNames:O,slide:!1,organizationId:null}}),W=$?.saveCreatingArticle?.draftItem?.uuid;if(!W)throw new Y(`Qiita saveCreatingArticle returned no uuid: ${JSON.stringify($)}`);if(J.draft)return[{status:"draft",uuid:W,url:`https://qiita.com/drafts/${W}/edit`}];let Q;if(J.secret)Q=(await Z(z,T,{input:{uuid:W,title:M,rawBody:K,tagNames:O,slide:!1}}))?.publishSecretArticle?.article;else Q=(await Z(z,P,{input:{uuid:W,title:M,rawBody:K,tagNames:O,slide:!1,tweetShare:!!J["tweet-share"],adventCalendarItems:[]}}))?.publishPublicArticle?.article;if(!Q||!Q.linkUrl)throw new Y(`Qiita publish returned no article: ${JSON.stringify(Q)}`);return[{status:J.secret?"published-secret":"published",uuid:Q.uuid||W,url:Q.linkUrl}]}});v({site:"qiita",name:"delete",access:"write",description:"Delete a Qiita article or draft by its URL (article linkUrl, or https://qiita.com/drafts/<uuid>).",domain:"qiita.com",strategy:F.COOKIE,browser:!0,args:[{name:"url",type:"string",required:!1,help:"Article URL (e.g. https://qiita.com/<urlName>/items/<uuid>) or draft URL (https://qiita.com/drafts/<uuid>)"}],columns:["status","url"],func:async(z,J)=>{if(!z)throw new Y("Browser session required for qiita delete");const M=String(J.url??"").trim();if(!/^https:\/\/qiita\.com\/.+/.test(M))throw new X("--url is required (a https://qiita.com/... article or draft URL)");await z.goto("https://qiita.com/");await z.wait({time:1});const K=await R(z,M);if(!K.ok)throw new Y(`Qiita delete failed (HTTP ${K.status}) for ${M}`);return[{status:"deleted",url:M}]}});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{cli as F,Strategy as G}from"@jackwener/opencli/registry";import{EmptyResultError as I,AuthRequiredError as J}from"@jackwener/opencli/errors";import{qiitaViewer as K}from"./gql.js";const L="https://qiita.com/";F({site:"qiita",name:"stats",access:"read",description:"Qiita 文章数据(每篇浏览/点赞/收藏/评论等运营指标)。逐篇补浏览数、篇数多时偏慢,客户端超时属正常,重试一次即可",domain:"qiita.com",strategy:G.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","tags","extra"],func:async(v,B)=>{const C=Math.max(1,Number(B.limit)||20);await v.goto(L);const x=(await K(v))?.urlName;if(!x)throw new J("qiita.com","未登录 Qiita:请先在 Chrome 里登录 qiita.com 再运行 qiita stats");const f=await v.evaluate(`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
const limit = ${JSON.stringify(C)};
|
|
4
|
+
const urlName = ${JSON.stringify(x)};
|
|
5
|
+
const items = [];
|
|
6
|
+
for (let pageNo = 1; items.length < limit && pageNo <= 100; pageNo++) {
|
|
7
|
+
const resp = await fetch('/api/v2/users/' + encodeURIComponent(urlName) + '/items?per_page=100&page=' + pageNo, {
|
|
8
|
+
headers: { accept: 'application/json' },
|
|
9
|
+
});
|
|
10
|
+
if (!resp.ok) return { error: 'Qiita 接口 HTTP ' + resp.status + '(/api/v2/users/' + urlName + '/items 第 ' + pageNo + ' 页)' };
|
|
11
|
+
const batch = await resp.json();
|
|
12
|
+
if (!Array.isArray(batch) || batch.length === 0) break;
|
|
13
|
+
for (const it of batch) { delete it.body; delete it.rendered_body; delete it.user; }
|
|
14
|
+
items.push(...batch);
|
|
15
|
+
if (batch.length < 100) break;
|
|
16
|
+
}
|
|
17
|
+
const picked = items.slice(0, limit);
|
|
18
|
+
// 逐篇带 cookie 拉文章页 HTML,抠作者可见的「N views」(SSR 渲染,含千分位/k 缩写)
|
|
19
|
+
for (const it of picked) {
|
|
20
|
+
try {
|
|
21
|
+
const r = await fetch(it.url, { credentials: 'include' });
|
|
22
|
+
if (!r.ok) { it.__views = null; continue; }
|
|
23
|
+
const html = await r.text();
|
|
24
|
+
const m = html.match(/aria-hidden="true">([0-9.,]+[kKmM]?)\\s*views</);
|
|
25
|
+
if (!m) { it.__views = null; continue; }
|
|
26
|
+
let v = m[1].replace(/,/g, '');
|
|
27
|
+
let mul = 1;
|
|
28
|
+
if (/k$/i.test(v)) { mul = 1000; v = v.slice(0, -1); }
|
|
29
|
+
else if (/m$/i.test(v)) { mul = 1000000; v = v.slice(0, -1); }
|
|
30
|
+
it.__views = Math.round(parseFloat(v) * mul);
|
|
31
|
+
} catch (e) { it.__views = null; }
|
|
32
|
+
}
|
|
33
|
+
return { items: picked };
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return { error: String((e && e.message) || e) };
|
|
36
|
+
}
|
|
37
|
+
})()`);if(!f||f.error)throw Error(f?.error||"qiita stats:evaluate 无返回(浏览器会话异常)");const z=Array.isArray(f.items)?f.items:[];if(z.length===0)throw new I("qiita stats","该 Qiita 账号没有任何公开文章。");return z.map((b)=>({id:b.id||"",type:"article",title:b.title||"",url:b.url||"",published_at:b.created_at||"",views:b.__views??"",likes:b.likes_count??0,comments:b.comments_count??0,collects:b.stocks_count??0,shares:"",tags:Array.isArray(b.tags)?b.tags.map((D)=>D.name||"").filter(Boolean).join("|"):"",extra:JSON.stringify({reactions:b.reactions_count??null,private:b.private??null,updated_at:b.updated_at||"",organization:b.organization_url_name||""})}))}});
|