@jackwener/opencli 1.7.10 → 1.7.12
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/README.md +3 -3
- package/README.zh-CN.md +5 -4
- package/cli-manifest.json +1443 -24
- package/clis/1688/assets.js +1 -0
- package/clis/1688/download.js +1 -0
- package/clis/1688/item.js +1 -0
- package/clis/1688/search.js +2 -1
- package/clis/1688/store.js +1 -0
- package/clis/36kr/article.js +1 -0
- package/clis/36kr/hot.js +1 -0
- package/clis/36kr/news.js +1 -0
- package/clis/36kr/search.js +1 -0
- package/clis/51job/company.js +1 -0
- package/clis/51job/detail.js +1 -0
- package/clis/51job/hot.js +1 -0
- package/clis/51job/search.js +1 -0
- package/clis/amazon/bestsellers.js +1 -0
- package/clis/amazon/discussion.js +1 -0
- package/clis/amazon/movers-shakers.js +1 -0
- package/clis/amazon/new-releases.js +1 -0
- package/clis/amazon/offer.js +1 -0
- package/clis/amazon/product.js +1 -0
- package/clis/amazon/rankings.js +1 -0
- package/clis/amazon/search.js +1 -0
- package/clis/antigravity/dump.js +1 -0
- package/clis/antigravity/extract-code.js +1 -0
- package/clis/antigravity/model.js +1 -0
- package/clis/antigravity/new.js +1 -0
- package/clis/antigravity/read.js +1 -0
- package/clis/antigravity/send.js +1 -0
- package/clis/antigravity/status.js +1 -0
- package/clis/antigravity/watch.js +1 -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/arxiv/arxiv.test.js +112 -0
- package/clis/arxiv/paper.js +4 -3
- package/clis/arxiv/recent.js +33 -0
- package/clis/arxiv/search.js +19 -7
- package/clis/arxiv/utils.js +68 -5
- package/clis/baidu-scholar/search.js +1 -0
- package/clis/band/bands.js +1 -0
- package/clis/band/mentions.js +1 -0
- package/clis/band/post.js +1 -0
- package/clis/band/posts.js +1 -0
- package/clis/barchart/flow.js +1 -0
- package/clis/barchart/greeks.js +1 -0
- package/clis/barchart/options.js +1 -0
- package/clis/barchart/quote.js +1 -0
- package/clis/bbc/news.js +1 -0
- package/clis/bilibili/comments.js +1 -0
- package/clis/bilibili/download.js +1 -0
- package/clis/bilibili/dynamic.js +1 -0
- package/clis/bilibili/favorite.js +1 -0
- package/clis/bilibili/feed.js +2 -0
- package/clis/bilibili/following.js +1 -0
- package/clis/bilibili/history.js +1 -0
- package/clis/bilibili/hot.js +6 -1
- package/clis/bilibili/hot.test.js +17 -0
- package/clis/bilibili/me.js +1 -1
- package/clis/bilibili/ranking.js +1 -0
- package/clis/bilibili/search.js +1 -1
- package/clis/bilibili/subtitle.js +1 -0
- package/clis/bilibili/user-videos.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 +1 -0
- package/clis/bloomberg/economics.js +1 -0
- package/clis/bloomberg/feeds.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 +1 -0
- package/clis/bloomberg/opinions.js +1 -0
- package/clis/bloomberg/politics.js +1 -0
- package/clis/bloomberg/tech.js +1 -0
- package/clis/bluesky/feeds.js +1 -0
- package/clis/bluesky/followers.js +1 -0
- package/clis/bluesky/following.js +1 -0
- package/clis/bluesky/profile.js +1 -0
- package/clis/bluesky/search.js +1 -0
- package/clis/bluesky/starter-packs.js +1 -0
- package/clis/bluesky/thread.js +1 -0
- package/clis/bluesky/trending.js +1 -0
- package/clis/bluesky/user.js +3 -1
- 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 +1 -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 +1 -0
- package/clis/boss/search.js +1 -0
- package/clis/boss/send.js +1 -0
- package/clis/boss/stats.js +1 -0
- package/clis/chaoxing/assignments.js +1 -0
- package/clis/chaoxing/exams.js +1 -0
- package/clis/chatgpt/image.js +1 -0
- package/clis/chatgpt-app/ask.js +1 -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 +1 -0
- package/clis/chatwise/history.js +1 -0
- package/clis/chatwise/model.js +1 -0
- package/clis/chatwise/read.js +1 -0
- package/clis/chatwise/send.js +1 -0
- package/clis/claude/ask.js +1 -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/cnki/search.js +1 -0
- package/clis/codex/ask.js +1 -0
- package/clis/codex/export.js +1 -0
- package/clis/codex/extract-diff.js +1 -0
- package/clis/codex/history.js +1 -0
- package/clis/codex/model.js +1 -0
- package/clis/codex/read.js +1 -0
- package/clis/codex/send.js +1 -0
- package/clis/coupang/add-to-cart.js +1 -0
- package/clis/coupang/search.js +1 -0
- package/clis/ctrip/search.js +1 -0
- package/clis/cursor/ask.js +1 -0
- package/clis/cursor/composer.js +1 -0
- package/clis/cursor/export.js +1 -0
- package/clis/cursor/extract-code.js +1 -0
- package/clis/cursor/history.js +1 -0
- package/clis/cursor/model.js +1 -0
- package/clis/cursor/read.js +1 -0
- package/clis/cursor/send.js +1 -0
- package/clis/dblp/dblp.test.js +397 -0
- package/clis/dblp/paper.js +40 -0
- package/clis/dblp/search.js +45 -0
- package/clis/dblp/utils.js +290 -0
- package/clis/deepseek/ask.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/status.js +1 -0
- package/clis/devto/devto.test.js +236 -0
- package/clis/devto/read.js +103 -0
- package/clis/devto/tag.js +5 -1
- package/clis/devto/top.js +5 -1
- package/clis/devto/user.js +5 -1
- package/clis/dianping/__fixtures__/search.html +168 -0
- package/clis/dianping/__fixtures__/shop.html +6 -0
- package/clis/dianping/dianping.test.js +424 -0
- package/clis/dianping/search.js +154 -0
- package/clis/dianping/shop.js +173 -0
- package/clis/dianping/utils.js +157 -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 +1 -0
- package/clis/discord-app/members.js +1 -0
- package/clis/discord-app/read.js +1 -0
- package/clis/discord-app/search.js +1 -0
- package/clis/discord-app/send.js +1 -0
- package/clis/discord-app/servers.js +1 -0
- package/clis/discord-app/status.js +1 -0
- package/clis/douban/book-hot.js +1 -0
- package/clis/douban/download.js +1 -0
- package/clis/douban/marks.js +1 -0
- package/clis/douban/movie-hot.js +2 -1
- package/clis/douban/movie-hot.test.js +14 -0
- package/clis/douban/photos.js +2 -1
- package/clis/douban/reviews.js +1 -0
- package/clis/douban/search.js +1 -0
- package/clis/douban/subject.js +1 -0
- package/clis/douban/top250.js +1 -0
- package/clis/douban/utils.js +11 -13
- package/clis/douban/utils.test.js +79 -0
- package/clis/doubao/ask.js +1 -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-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/douyin/activities.js +1 -0
- package/clis/douyin/collections.js +1 -0
- package/clis/douyin/delete.js +1 -0
- package/clis/douyin/draft.js +1 -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.js +1 -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/eastmoney/announcement.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 +1 -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/facebook/add-friend.js +1 -0
- package/clis/facebook/events.js +1 -0
- package/clis/facebook/feed.js +1 -0
- package/clis/facebook/friends.js +1 -0
- package/clis/facebook/groups.js +1 -0
- package/clis/facebook/join-group.js +1 -0
- package/clis/facebook/marketplace-inbox.js +1 -0
- package/clis/facebook/marketplace-listings.js +1 -0
- package/clis/facebook/memories.js +1 -0
- package/clis/facebook/notifications.js +1 -0
- package/clis/facebook/profile.js +1 -0
- package/clis/facebook/search.js +1 -0
- package/clis/gemini/ask.js +1 -0
- package/clis/gemini/deep-research-result.js +1 -0
- package/clis/gemini/deep-research.js +1 -0
- package/clis/gemini/image.js +1 -0
- package/clis/gemini/new.js +1 -0
- package/clis/gitee/search.js +1 -0
- package/clis/gitee/trending.js +1 -0
- package/clis/gitee/user.js +1 -0
- package/clis/google/news.js +1 -0
- package/clis/google/search.js +1 -0
- package/clis/google/suggest.js +1 -0
- package/clis/google/trends.js +1 -0
- package/clis/google-scholar/cite.js +1 -0
- package/clis/google-scholar/profile.js +1 -0
- package/clis/google-scholar/search.js +1 -0
- package/clis/gov-law/recent.js +1 -0
- package/clis/gov-law/search.js +1 -0
- package/clis/gov-policy/recent.js +1 -0
- package/clis/gov-policy/search.js +1 -0
- package/clis/grok/ask.js +1 -0
- package/clis/grok/image.ts +1 -0
- package/clis/hackernews/ask.js +3 -1
- package/clis/hackernews/best.js +3 -1
- package/clis/hackernews/hackernews.test.js +132 -0
- package/clis/hackernews/jobs.js +3 -1
- package/clis/hackernews/new.js +3 -1
- package/clis/hackernews/read.js +188 -0
- package/clis/hackernews/search.js +3 -1
- package/clis/hackernews/show.js +3 -1
- package/clis/hackernews/top.js +3 -1
- package/clis/hackernews/user.js +1 -0
- package/clis/hf/top.js +1 -0
- package/clis/hupu/detail.js +1 -0
- package/clis/hupu/hot.js +3 -1
- package/clis/hupu/like.js +1 -0
- package/clis/hupu/mentions.js +2 -1
- package/clis/hupu/reply.js +1 -0
- package/clis/hupu/search.js +3 -1
- package/clis/hupu/unlike.js +1 -0
- package/clis/imdb/person.js +1 -0
- package/clis/imdb/reviews.js +1 -0
- package/clis/imdb/search.js +1 -0
- package/clis/imdb/title.js +1 -0
- package/clis/imdb/top.js +1 -0
- package/clis/imdb/trending.js +1 -0
- package/clis/indeed/indeed.test.js +375 -0
- package/clis/indeed/job.js +86 -0
- package/clis/indeed/search.js +110 -0
- package/clis/indeed/utils.js +152 -0
- package/clis/instagram/collection-create.js +1 -0
- package/clis/instagram/collection-delete.js +92 -0
- package/clis/instagram/comment.js +1 -0
- package/clis/instagram/download.js +1 -0
- package/clis/instagram/explore.js +1 -0
- package/clis/instagram/follow.js +1 -0
- package/clis/instagram/followers.js +1 -0
- package/clis/instagram/following.js +1 -0
- package/clis/instagram/like.js +1 -0
- package/clis/instagram/note.js +1 -0
- package/clis/instagram/post.js +1 -0
- package/clis/instagram/profile.js +1 -0
- package/clis/instagram/reel.js +1 -0
- package/clis/instagram/save.js +1 -0
- package/clis/instagram/saved.js +1 -0
- package/clis/instagram/search.js +1 -0
- package/clis/instagram/story.js +1 -0
- package/clis/instagram/unfollow.js +1 -0
- package/clis/instagram/unlike.js +1 -0
- package/clis/instagram/unsave.js +1 -0
- package/clis/instagram/user.js +1 -0
- package/clis/jd/add-cart.js +1 -0
- package/clis/jd/cart.js +1 -0
- package/clis/jd/detail.js +1 -0
- package/clis/jd/item.js +1 -0
- package/clis/jd/reviews.js +1 -0
- package/clis/jd/search.js +1 -0
- package/clis/jianyu/detail.js +1 -0
- package/clis/jianyu/search.js +1 -0
- package/clis/jike/comment.js +1 -0
- package/clis/jike/create.js +1 -0
- package/clis/jike/feed.js +3 -1
- package/clis/jike/like.js +1 -0
- package/clis/jike/notifications.js +1 -0
- package/clis/jike/post.js +1 -0
- package/clis/jike/repost.js +1 -0
- package/clis/jike/search.js +3 -1
- package/clis/jike/topic.js +1 -0
- package/clis/jike/user.js +3 -1
- package/clis/jimeng/generate.js +1 -0
- package/clis/jimeng/history.js +1 -0
- package/clis/jimeng/new.js +1 -0
- package/clis/jimeng/workspaces.js +1 -0
- package/clis/ke/chengjiao.js +1 -0
- package/clis/ke/ershoufang.js +1 -0
- package/clis/ke/xiaoqu.js +1 -0
- package/clis/ke/zufang.js +1 -0
- package/clis/lesswrong/comments.js +1 -0
- package/clis/lesswrong/curated.js +1 -0
- package/clis/lesswrong/frontpage.js +1 -0
- package/clis/lesswrong/new.js +1 -0
- package/clis/lesswrong/read.js +1 -0
- package/clis/lesswrong/sequences.js +1 -0
- package/clis/lesswrong/shortform.js +1 -0
- package/clis/lesswrong/tag.js +1 -0
- package/clis/lesswrong/tags.js +1 -0
- package/clis/lesswrong/top-month.js +1 -0
- package/clis/lesswrong/top-week.js +1 -0
- package/clis/lesswrong/top-year.js +1 -0
- package/clis/lesswrong/top.js +1 -0
- package/clis/lesswrong/user-posts.js +1 -0
- package/clis/lesswrong/user.js +1 -0
- package/clis/linkedin/search.js +1 -0
- package/clis/linkedin/timeline.js +1 -0
- package/clis/linux-do/categories.js +1 -0
- package/clis/linux-do/category.js +1 -0
- package/clis/linux-do/feed.js +1 -0
- package/clis/linux-do/hot.js +1 -0
- package/clis/linux-do/latest.js +1 -0
- package/clis/linux-do/search.js +1 -0
- package/clis/linux-do/tags.js +2 -1
- package/clis/linux-do/topic-content.js +1 -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 +4 -1
- package/clis/lobsters/hot.js +4 -1
- package/clis/lobsters/lobsters.test.js +169 -0
- package/clis/lobsters/newest.js +4 -1
- package/clis/lobsters/read.js +196 -0
- package/clis/lobsters/tag.js +4 -1
- package/clis/maimai/search-talents.js +1 -0
- package/clis/medium/feed.js +1 -0
- package/clis/medium/search.js +1 -0
- package/clis/medium/user.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/notebooklm/current.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/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/notion/export.js +1 -0
- package/clis/notion/favorites.js +1 -0
- package/clis/notion/new.js +1 -0
- package/clis/notion/read.js +1 -0
- package/clis/notion/search.js +1 -0
- package/clis/notion/sidebar.js +1 -0
- package/clis/notion/status.js +1 -0
- package/clis/notion/write.js +1 -0
- package/clis/nowcoder/companies.js +1 -0
- package/clis/nowcoder/creators.js +1 -0
- package/clis/nowcoder/detail.js +1 -0
- package/clis/nowcoder/experience.js +1 -0
- package/clis/nowcoder/hot.js +1 -0
- package/clis/nowcoder/jobs.js +1 -0
- package/clis/nowcoder/notifications.js +1 -0
- package/clis/nowcoder/papers.js +1 -0
- package/clis/nowcoder/practice.js +1 -0
- package/clis/nowcoder/recommend.js +1 -0
- package/clis/nowcoder/referral.js +1 -0
- package/clis/nowcoder/salary.js +1 -0
- package/clis/nowcoder/search.js +1 -0
- package/clis/nowcoder/suggest.js +1 -0
- package/clis/nowcoder/topics.js +1 -0
- package/clis/nowcoder/trending.js +1 -0
- package/clis/ones/login.js +1 -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/task.js +1 -0
- package/clis/ones/tasks.js +1 -0
- package/clis/ones/token-info.js +1 -0
- package/clis/ones/worklog.js +1 -0
- package/clis/openreview/openreview.test.js +345 -0
- package/clis/openreview/paper.js +43 -0
- package/clis/openreview/reviews.js +131 -0
- package/clis/openreview/search.js +46 -0
- package/clis/openreview/utils.js +158 -0
- package/clis/openreview/venue.js +63 -0
- package/clis/paperreview/feedback.js +1 -0
- package/clis/paperreview/review.js +1 -0
- package/clis/paperreview/submit.js +1 -0
- package/clis/pixiv/detail.js +1 -0
- package/clis/pixiv/download.js +1 -0
- package/clis/pixiv/illusts.js +2 -1
- package/clis/pixiv/ranking.js +2 -1
- package/clis/pixiv/search.js +2 -1
- package/clis/pixiv/user.js +2 -0
- package/clis/powerchina/search.js +1 -0
- package/clis/producthunt/browse.js +1 -0
- package/clis/producthunt/hot.js +1 -0
- package/clis/producthunt/posts.js +1 -0
- package/clis/producthunt/today.js +1 -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/reddit/comment.js +1 -0
- package/clis/reddit/frontpage.js +1 -0
- package/clis/reddit/hot.js +6 -1
- package/clis/reddit/hot.test.js +18 -0
- package/clis/reddit/popular.js +1 -0
- package/clis/reddit/read.js +1 -0
- package/clis/reddit/save.js +1 -0
- package/clis/reddit/saved.js +1 -0
- package/clis/reddit/search.js +1 -0
- package/clis/reddit/subreddit.js +1 -0
- package/clis/reddit/subscribe.js +1 -0
- package/clis/reddit/upvote.js +1 -0
- package/clis/reddit/upvoted.js +1 -0
- package/clis/reddit/user-comments.js +1 -0
- package/clis/reddit/user-posts.js +1 -0
- package/clis/reddit/user.js +1 -0
- package/clis/reuters/search.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/sinafinance/news.js +1 -0
- package/clis/sinafinance/rolling-news.js +1 -0
- package/clis/sinafinance/stock-rank.js +1 -0
- package/clis/sinafinance/stock.js +1 -0
- package/clis/smzdm/search.js +1 -0
- package/clis/spotify/spotify.js +11 -0
- package/clis/stackoverflow/bounties.js +11 -3
- package/clis/stackoverflow/hot.js +10 -2
- package/clis/stackoverflow/read.js +314 -0
- package/clis/stackoverflow/search.js +10 -2
- package/clis/stackoverflow/stackoverflow.test.js +346 -0
- package/clis/stackoverflow/unanswered.js +9 -2
- package/clis/steam/top-sellers.js +1 -0
- package/clis/substack/feed.js +1 -0
- package/clis/substack/publication.js +1 -0
- package/clis/substack/search.js +1 -0
- package/clis/taobao/add-cart.js +1 -0
- package/clis/taobao/cart.js +1 -0
- package/clis/taobao/detail.js +1 -0
- package/clis/taobao/reviews.js +1 -0
- package/clis/taobao/search.js +1 -0
- package/clis/tdx/hot-rank.js +1 -0
- package/clis/ths/hot-rank.js +1 -0
- package/clis/tieba/hot.js +2 -1
- package/clis/tieba/posts.js +1 -0
- package/clis/tieba/read.js +1 -0
- package/clis/tieba/search.js +2 -1
- package/clis/tiktok/comment.js +1 -0
- package/clis/tiktok/explore.js +1 -0
- package/clis/tiktok/follow.js +1 -0
- package/clis/tiktok/following.js +1 -0
- package/clis/tiktok/friends.js +1 -0
- package/clis/tiktok/like.js +1 -0
- package/clis/tiktok/live.js +1 -0
- package/clis/tiktok/notifications.js +1 -0
- package/clis/tiktok/profile.js +1 -0
- package/clis/tiktok/save.js +1 -0
- package/clis/tiktok/search.js +1 -0
- package/clis/tiktok/unfollow.js +1 -0
- package/clis/tiktok/unlike.js +1 -0
- package/clis/tiktok/unsave.js +1 -0
- package/clis/tiktok/user.js +1 -0
- package/clis/toutiao/articles.js +1 -0
- package/clis/twitter/accept.js +1 -0
- package/clis/twitter/article.js +1 -0
- package/clis/twitter/block.js +1 -0
- package/clis/twitter/bookmark.js +1 -0
- package/clis/twitter/bookmarks.js +2 -1
- package/clis/twitter/delete.js +1 -0
- package/clis/twitter/download.js +1 -0
- package/clis/twitter/follow.js +1 -0
- package/clis/twitter/followers.js +1 -0
- package/clis/twitter/following.js +1 -0
- package/clis/twitter/hide-reply.js +1 -0
- package/clis/twitter/like.js +1 -0
- package/clis/twitter/likes.js +2 -1
- package/clis/twitter/list-add.js +1 -0
- package/clis/twitter/list-remove.js +1 -0
- package/clis/twitter/list-tweets.js +1 -0
- package/clis/twitter/lists.js +1 -0
- package/clis/twitter/notifications.js +1 -0
- package/clis/twitter/post.js +1 -0
- package/clis/twitter/profile.js +1 -0
- package/clis/twitter/reply-dm.js +1 -0
- package/clis/twitter/reply.js +1 -0
- package/clis/twitter/search.js +1 -0
- package/clis/twitter/thread.js +1 -0
- package/clis/twitter/timeline.js +1 -0
- package/clis/twitter/trending.js +11 -12
- package/clis/twitter/trending.test.js +15 -0
- package/clis/twitter/tweets.js +2 -1
- package/clis/twitter/tweets.test.js +2 -2
- package/clis/twitter/unblock.js +1 -0
- package/clis/twitter/unbookmark.js +1 -0
- package/clis/twitter/unfollow.js +1 -0
- package/clis/uiverse/code.js +1 -0
- package/clis/uiverse/preview.js +1 -0
- package/clis/v2ex/daily.js +1 -0
- package/clis/v2ex/hot.js +1 -0
- package/clis/v2ex/latest.js +1 -0
- package/clis/v2ex/me.js +1 -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 +1 -0
- package/clis/v2ex/replies.js +1 -0
- package/clis/v2ex/topic.js +1 -0
- package/clis/v2ex/user.js +1 -0
- package/clis/wanfang/search.js +1 -0
- package/clis/web/read.js +1 -0
- package/clis/weibo/comments.js +1 -0
- package/clis/weibo/favorites.js +1 -0
- package/clis/weibo/feed.js +3 -1
- package/clis/weibo/hot.js +1 -0
- package/clis/weibo/me.js +1 -0
- package/clis/weibo/post.js +1 -0
- package/clis/weibo/publish.js +1 -0
- package/clis/weibo/search.js +8 -2
- package/clis/weibo/user.js +1 -0
- package/clis/weixin/create-draft.js +1 -0
- package/clis/weixin/download.js +1 -0
- package/clis/weixin/drafts.js +1 -0
- package/clis/weread/ai-outline.js +1 -0
- package/clis/weread/book.js +1 -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/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/xianyu/chat.js +1 -0
- package/clis/xianyu/item.js +1 -0
- package/clis/xianyu/search.js +1 -0
- package/clis/xiaoe/catalog.js +2 -1
- package/clis/xiaoe/content.js +1 -0
- package/clis/xiaoe/courses.js +1 -0
- package/clis/xiaoe/detail.js +1 -0
- package/clis/xiaoe/play-url.js +1 -0
- package/clis/xiaohongshu/comments.js +1 -0
- package/clis/xiaohongshu/creator-note-detail.js +1 -0
- package/clis/xiaohongshu/creator-notes-summary.js +1 -0
- package/clis/xiaohongshu/creator-notes.js +1 -0
- package/clis/xiaohongshu/creator-profile.js +1 -0
- package/clis/xiaohongshu/creator-stats.js +1 -0
- package/clis/xiaohongshu/download.js +1 -0
- package/clis/xiaohongshu/feed.js +2 -1
- package/clis/xiaohongshu/note.js +1 -0
- package/clis/xiaohongshu/notifications.js +1 -0
- package/clis/xiaohongshu/publish.js +1 -0
- package/clis/xiaohongshu/search.js +1 -0
- package/clis/xiaohongshu/user.js +1 -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/xueqiu/comments.js +1 -0
- package/clis/xueqiu/earnings-date.js +1 -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/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/watchlist.js +1 -0
- package/clis/yahoo-finance/quote.js +1 -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 +1 -0
- package/clis/yollomi/upscale.js +1 -0
- package/clis/yollomi/video.js +1 -0
- package/clis/youtube/channel.js +1 -0
- package/clis/youtube/comments.js +1 -0
- package/clis/youtube/feed.js +8 -7
- package/clis/youtube/feed.test.js +131 -0
- package/clis/youtube/history.js +1 -0
- package/clis/youtube/like.js +1 -0
- package/clis/youtube/playlist.js +1 -0
- package/clis/youtube/search.js +1 -0
- package/clis/youtube/subscribe.js +1 -0
- package/clis/youtube/subscriptions.js +1 -0
- package/clis/youtube/transcript.js +1 -0
- package/clis/youtube/unlike.js +1 -0
- package/clis/youtube/unsubscribe.js +1 -0
- package/clis/youtube/video.js +1 -0
- package/clis/youtube/watch-later.js +1 -0
- package/clis/yuanbao/ask.js +1 -0
- package/clis/yuanbao/new.js +1 -0
- package/clis/zhihu/answer.js +1 -0
- package/clis/zhihu/collection.js +1 -0
- package/clis/zhihu/collections.js +1 -0
- package/clis/zhihu/comment.js +1 -0
- package/clis/zhihu/download.js +1 -0
- package/clis/zhihu/favorite.js +1 -0
- package/clis/zhihu/follow.js +1 -0
- package/clis/zhihu/hot.js +1 -0
- package/clis/zhihu/like.js +1 -0
- package/clis/zhihu/question.js +1 -0
- package/clis/zhihu/search.js +1 -0
- package/clis/zlibrary/info.js +1 -0
- package/clis/zlibrary/search.js +1 -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/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +72 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-shadow.test.js +49 -0
- package/dist/src/adapter-source.test.js +1 -1
- package/dist/src/browser/analyze.test.js +2 -0
- package/dist/src/browser/base-page.d.ts +15 -2
- package/dist/src/browser/base-page.js +159 -8
- package/dist/src/browser/base-page.test.js +103 -1
- package/dist/src/browser/cdp.js +54 -0
- package/dist/src/browser/cdp.test.js +26 -0
- package/dist/src/browser/dom-helpers.d.ts +1 -1
- package/dist/src/browser/dom-helpers.js +15 -3
- package/dist/src/browser/page.d.ts +1 -0
- package/dist/src/browser/page.js +7 -1
- package/dist/src/browser/page.test.js +17 -0
- package/dist/src/browser/target-resolver.d.ts +17 -2
- package/dist/src/browser/target-resolver.js +85 -4
- package/dist/src/browser/verify-fixture.d.ts +7 -1
- package/dist/src/browser/verify-fixture.js +105 -0
- package/dist/src/browser/verify-fixture.test.js +59 -1
- package/dist/src/build-manifest.d.ts +68 -33
- package/dist/src/build-manifest.js +178 -29
- package/dist/src/build-manifest.test.js +85 -5
- package/dist/src/capabilityRouting.test.js +1 -1
- package/dist/src/cli.js +150 -11
- package/dist/src/cli.test.js +237 -0
- package/dist/src/commanderAdapter.d.ts +1 -1
- package/dist/src/commanderAdapter.js +17 -7
- package/dist/src/commanderAdapter.test.js +7 -6
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +546 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/convention-audit.test.js +226 -0
- package/dist/src/discovery.js +2 -0
- package/dist/src/doctor.d.ts +2 -0
- package/dist/src/doctor.js +6 -0
- package/dist/src/doctor.test.js +36 -1
- package/dist/src/engine.test.js +10 -10
- package/dist/src/execution.js +1 -1
- package/dist/src/execution.test.js +9 -9
- package/dist/src/help.d.ts +15 -0
- package/dist/src/help.js +149 -0
- package/dist/src/main.js +13 -7
- package/dist/src/manifest-types.d.ts +41 -0
- package/dist/src/manifest-types.js +9 -0
- package/dist/src/plugin.test.js +26 -26
- package/dist/src/registry.d.ts +5 -0
- package/dist/src/registry.js +8 -0
- package/dist/src/registry.test.js +27 -20
- package/dist/src/serialization.d.ts +4 -0
- package/dist/src/serialization.js +27 -1
- package/dist/src/serialization.test.js +24 -2
- package/dist/src/types.d.ts +2 -0
- package/package.json +5 -2
- 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/silent-column-drop-baseline.json +962 -0
- package/scripts/typed-error-lint-baseline.json +1586 -0
package/clis/1688/assets.js
CHANGED
package/clis/1688/download.js
CHANGED
package/clis/1688/item.js
CHANGED
package/clis/1688/search.js
CHANGED
|
@@ -275,6 +275,7 @@ async function collectSearchRows(page, query, limit) {
|
|
|
275
275
|
cli({
|
|
276
276
|
site: '1688',
|
|
277
277
|
name: 'search',
|
|
278
|
+
access: 'read',
|
|
278
279
|
description: '1688 商品搜索(结果候选、卖家链接、价格/MOQ/销量文本)',
|
|
279
280
|
domain: 'www.1688.com',
|
|
280
281
|
strategy: Strategy.COOKIE,
|
|
@@ -293,7 +294,7 @@ cli({
|
|
|
293
294
|
help: `结果数量上限(默认 ${SEARCH_LIMIT_DEFAULT},最大 ${SEARCH_LIMIT_MAX})`,
|
|
294
295
|
},
|
|
295
296
|
],
|
|
296
|
-
columns: ['rank', 'title', 'price_text', 'moq_text', 'seller_name', 'location'],
|
|
297
|
+
columns: ['rank', 'offer_id', 'title', 'item_url', 'price_text', 'moq_text', 'seller_name', 'member_id', 'location'],
|
|
297
298
|
func: async (page, kwargs) => {
|
|
298
299
|
const query = String(kwargs.query ?? '');
|
|
299
300
|
const limit = parseSearchLimit(kwargs.limit);
|
package/clis/1688/store.js
CHANGED
package/clis/36kr/article.js
CHANGED
package/clis/36kr/hot.js
CHANGED
package/clis/36kr/news.js
CHANGED
package/clis/36kr/search.js
CHANGED
package/clis/51job/company.js
CHANGED
package/clis/51job/detail.js
CHANGED
package/clis/51job/hot.js
CHANGED
package/clis/51job/search.js
CHANGED
|
@@ -2,6 +2,7 @@ import { cli } from '@jackwener/opencli/registry';
|
|
|
2
2
|
import { createRankingCliOptions } from './rankings.js';
|
|
3
3
|
cli(createRankingCliOptions({
|
|
4
4
|
commandName: 'bestsellers',
|
|
5
|
+
access: 'read',
|
|
5
6
|
listType: 'bestsellers',
|
|
6
7
|
description: 'Amazon Best Sellers pages for category candidate discovery',
|
|
7
8
|
}));
|
|
@@ -85,6 +85,7 @@ async function readDiscussionPayload(page, input, limit) {
|
|
|
85
85
|
cli({
|
|
86
86
|
site: 'amazon',
|
|
87
87
|
name: 'discussion',
|
|
88
|
+
access: 'read',
|
|
88
89
|
description: 'Amazon review summary and sample customer discussion from product review pages',
|
|
89
90
|
domain: 'amazon.com',
|
|
90
91
|
strategy: Strategy.COOKIE,
|
|
@@ -2,6 +2,7 @@ import { cli } from '@jackwener/opencli/registry';
|
|
|
2
2
|
import { createRankingCliOptions } from './rankings.js';
|
|
3
3
|
cli(createRankingCliOptions({
|
|
4
4
|
commandName: 'movers-shakers',
|
|
5
|
+
access: 'read',
|
|
5
6
|
listType: 'movers_shakers',
|
|
6
7
|
description: 'Amazon Movers & Shakers pages for short-term growth signals',
|
|
7
8
|
}));
|
|
@@ -2,6 +2,7 @@ import { cli } from '@jackwener/opencli/registry';
|
|
|
2
2
|
import { createRankingCliOptions } from './rankings.js';
|
|
3
3
|
cli(createRankingCliOptions({
|
|
4
4
|
commandName: 'new-releases',
|
|
5
|
+
access: 'read',
|
|
5
6
|
listType: 'new_releases',
|
|
6
7
|
description: 'Amazon New Releases pages for early momentum discovery',
|
|
7
8
|
}));
|
package/clis/amazon/offer.js
CHANGED
|
@@ -106,6 +106,7 @@ async function readOfferPayload(page, input) {
|
|
|
106
106
|
cli({
|
|
107
107
|
site: 'amazon',
|
|
108
108
|
name: 'offer',
|
|
109
|
+
access: 'read',
|
|
109
110
|
description: 'Amazon seller, buy box, and fulfillment facts from the product page',
|
|
110
111
|
domain: 'amazon.com',
|
|
111
112
|
strategy: Strategy.COOKIE,
|
package/clis/amazon/product.js
CHANGED
package/clis/amazon/rankings.js
CHANGED
|
@@ -142,6 +142,7 @@ export function createRankingCliOptions(definition) {
|
|
|
142
142
|
return {
|
|
143
143
|
site: 'amazon',
|
|
144
144
|
name: definition.commandName,
|
|
145
|
+
access: definition.access ?? 'read',
|
|
145
146
|
description: definition.description,
|
|
146
147
|
domain: 'amazon.com',
|
|
147
148
|
strategy: Strategy.COOKIE,
|
package/clis/amazon/search.js
CHANGED
package/clis/antigravity/dump.js
CHANGED
|
@@ -2,6 +2,7 @@ import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
|
2
2
|
export const extractCodeCommand = cli({
|
|
3
3
|
site: 'antigravity',
|
|
4
4
|
name: 'extract-code',
|
|
5
|
+
access: 'read',
|
|
5
6
|
description: 'Extract multi-line code blocks from the current Antigravity conversation',
|
|
6
7
|
domain: 'localhost',
|
|
7
8
|
strategy: Strategy.UI,
|
package/clis/antigravity/new.js
CHANGED
|
@@ -2,6 +2,7 @@ import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
|
2
2
|
export const newCommand = cli({
|
|
3
3
|
site: 'antigravity',
|
|
4
4
|
name: 'new',
|
|
5
|
+
access: 'read',
|
|
5
6
|
description: 'Start a new conversation / clear context in Antigravity',
|
|
6
7
|
domain: 'localhost',
|
|
7
8
|
strategy: Strategy.UI,
|
package/clis/antigravity/read.js
CHANGED
package/clis/antigravity/send.js
CHANGED
|
@@ -2,6 +2,7 @@ import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
|
2
2
|
export const sendCommand = cli({
|
|
3
3
|
site: 'antigravity',
|
|
4
4
|
name: 'send',
|
|
5
|
+
access: 'write',
|
|
5
6
|
description: 'Send a message to Antigravity AI via the internal Lexical editor',
|
|
6
7
|
domain: 'localhost',
|
|
7
8
|
strategy: Strategy.UI,
|
|
@@ -2,6 +2,7 @@ import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
|
2
2
|
export const statusCommand = cli({
|
|
3
3
|
site: 'antigravity',
|
|
4
4
|
name: 'status',
|
|
5
|
+
access: 'read',
|
|
5
6
|
description: 'Check Antigravity CDP connection and get current page state',
|
|
6
7
|
domain: 'localhost',
|
|
7
8
|
strategy: Strategy.UI,
|
|
@@ -2,6 +2,7 @@ import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
|
2
2
|
export const watchCommand = cli({
|
|
3
3
|
site: 'antigravity',
|
|
4
4
|
name: 'watch',
|
|
5
|
+
access: 'read',
|
|
5
6
|
description: 'Stream new chat messages from Antigravity in real-time',
|
|
6
7
|
domain: 'localhost',
|
|
7
8
|
strategy: Strategy.UI,
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { getRegistry } from '@jackwener/opencli/registry';
|
|
3
|
+
import { normalizeArxivCategory, normalizeArxivLimit, parseEntries } from './utils.js';
|
|
4
|
+
import './paper.js';
|
|
5
|
+
import './search.js';
|
|
6
|
+
import './recent.js';
|
|
7
|
+
|
|
8
|
+
const SAMPLE_ENTRY_XML = `<?xml version='1.0' encoding='UTF-8'?>
|
|
9
|
+
<feed xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
|
|
10
|
+
xmlns:arxiv="http://arxiv.org/schemas/atom"
|
|
11
|
+
xmlns="http://www.w3.org/2005/Atom">
|
|
12
|
+
<entry>
|
|
13
|
+
<id>http://arxiv.org/abs/1706.03762v7</id>
|
|
14
|
+
<title>Attention Is All You Need & Friends</title>
|
|
15
|
+
<updated>2023-08-02T00:41:18Z</updated>
|
|
16
|
+
<link href="https://arxiv.org/abs/1706.03762v7" rel="alternate" type="text/html"/>
|
|
17
|
+
<link href="https://arxiv.org/pdf/1706.03762v7" rel="related" type="application/pdf" title="pdf"/>
|
|
18
|
+
<summary>The dominant sequence transduction models are based on complex recurrent or convolutional neural networks. We propose a new simple network architecture, the Transformer, based solely on attention.</summary>
|
|
19
|
+
<category term="cs.CL" scheme="http://arxiv.org/schemas/atom"/>
|
|
20
|
+
<category term="cs.LG" scheme="http://arxiv.org/schemas/atom"/>
|
|
21
|
+
<published>2017-06-12T17:57:34Z</published>
|
|
22
|
+
<arxiv:comment>15 pages, 5 figures</arxiv:comment>
|
|
23
|
+
<arxiv:primary_category term="cs.CL"/>
|
|
24
|
+
<author><name>Ashish Vaswani</name></author>
|
|
25
|
+
<author><name>Noam Shazeer</name></author>
|
|
26
|
+
<author><name>Niki Parmar</name></author>
|
|
27
|
+
<author><name>Jakob Uszkoreit</name></author>
|
|
28
|
+
<author><name>Llion Jones</name></author>
|
|
29
|
+
<author><name>Aidan N. Gomez</name></author>
|
|
30
|
+
<author><name>Lukasz Kaiser</name></author>
|
|
31
|
+
<author><name>Illia Polosukhin</name></author>
|
|
32
|
+
</entry>
|
|
33
|
+
</feed>`;
|
|
34
|
+
|
|
35
|
+
describe('arxiv adapter', () => {
|
|
36
|
+
it('registers paper, search and recent commands with the expected columns', () => {
|
|
37
|
+
const paper = getRegistry().get('arxiv/paper');
|
|
38
|
+
const search = getRegistry().get('arxiv/search');
|
|
39
|
+
const recent = getRegistry().get('arxiv/recent');
|
|
40
|
+
|
|
41
|
+
expect(paper).toBeDefined();
|
|
42
|
+
expect(search).toBeDefined();
|
|
43
|
+
expect(recent).toBeDefined();
|
|
44
|
+
|
|
45
|
+
expect(paper.columns).toEqual([
|
|
46
|
+
'id', 'title', 'authors', 'published', 'updated',
|
|
47
|
+
'primary_category', 'categories', 'abstract', 'comment', 'pdf', 'url',
|
|
48
|
+
]);
|
|
49
|
+
expect(search.columns).toEqual([
|
|
50
|
+
'id', 'title', 'authors', 'published', 'primary_category', 'url',
|
|
51
|
+
]);
|
|
52
|
+
expect(recent.columns).toEqual([
|
|
53
|
+
'id', 'title', 'authors', 'published', 'primary_category', 'url',
|
|
54
|
+
]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('parseEntries returns full abstract, all authors, pdf, primary category and comment', () => {
|
|
58
|
+
const [entry] = parseEntries(SAMPLE_ENTRY_XML);
|
|
59
|
+
|
|
60
|
+
expect(entry.id).toBe('1706.03762');
|
|
61
|
+
expect(entry.title).toBe('Attention Is All You Need & Friends');
|
|
62
|
+
// All 8 authors must be present — earlier impl truncated to 3.
|
|
63
|
+
expect(entry.authors.split(', ')).toHaveLength(8);
|
|
64
|
+
expect(entry.authors).toContain('Ashish Vaswani');
|
|
65
|
+
expect(entry.authors).toContain('Illia Polosukhin');
|
|
66
|
+
// Full abstract — earlier impl truncated at 200 chars.
|
|
67
|
+
expect(entry.abstract.length).toBeGreaterThan(140);
|
|
68
|
+
expect(entry.abstract.endsWith('...')).toBe(false);
|
|
69
|
+
expect(entry.abstract).toContain('attention');
|
|
70
|
+
expect(entry.published).toBe('2017-06-12');
|
|
71
|
+
expect(entry.updated).toBe('2023-08-02');
|
|
72
|
+
expect(entry.primary_category).toBe('cs.CL');
|
|
73
|
+
expect(entry.categories).toBe('cs.CL, cs.LG');
|
|
74
|
+
expect(entry.comment).toBe('15 pages, 5 figures');
|
|
75
|
+
expect(entry.pdf).toBe('https://arxiv.org/pdf/1706.03762v7');
|
|
76
|
+
expect(entry.url).toBe('https://arxiv.org/abs/1706.03762');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('parseEntries returns an empty list for feeds with no entries', () => {
|
|
80
|
+
expect(parseEntries('<feed></feed>')).toEqual([]);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('recent rejects malformed category strings', async () => {
|
|
84
|
+
const recent = getRegistry().get('arxiv/recent');
|
|
85
|
+
await expect(recent.func({ category: 'not a category', limit: 5 })).rejects.toMatchObject({
|
|
86
|
+
code: 'ARGUMENT',
|
|
87
|
+
});
|
|
88
|
+
await expect(recent.func({ category: '', limit: 5 })).rejects.toMatchObject({
|
|
89
|
+
code: 'ARGUMENT',
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('category validation accepts real arXiv archive and subcategory forms', () => {
|
|
94
|
+
expect(normalizeArxivCategory('cs.CL')).toBe('cs.CL');
|
|
95
|
+
expect(normalizeArxivCategory('math')).toBe('math');
|
|
96
|
+
expect(normalizeArxivCategory('physics.comp-ph')).toBe('physics.comp-ph');
|
|
97
|
+
expect(normalizeArxivCategory('physics.data-an')).toBe('physics.data-an');
|
|
98
|
+
expect(normalizeArxivCategory('cond-mat.soft')).toBe('cond-mat.soft');
|
|
99
|
+
expect(normalizeArxivCategory('q-bio.NC')).toBe('q-bio.NC');
|
|
100
|
+
expect(() => normalizeArxivCategory('not a category')).toThrow('Invalid arXiv category');
|
|
101
|
+
expect(() => normalizeArxivCategory('cs/CL')).toThrow('Invalid arXiv category');
|
|
102
|
+
expect(() => normalizeArxivCategory('')).toThrow('Invalid arXiv category');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('limit validation rejects non-positive, non-integer and over-cap values', () => {
|
|
106
|
+
expect(normalizeArxivLimit(10, 5, 25)).toBe(10);
|
|
107
|
+
expect(normalizeArxivLimit(undefined, 5, 25)).toBe(5);
|
|
108
|
+
expect(() => normalizeArxivLimit(0, 5, 25)).toThrow('positive integer');
|
|
109
|
+
expect(() => normalizeArxivLimit(1.5, 5, 25)).toThrow('positive integer');
|
|
110
|
+
expect(() => normalizeArxivLimit(26, 5, 25)).toThrow('<= 25');
|
|
111
|
+
});
|
|
112
|
+
});
|
package/clis/arxiv/paper.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
-
import {
|
|
2
|
+
import { EmptyResultError } from '@jackwener/opencli/errors';
|
|
3
3
|
import { arxivFetch, parseEntries } from './utils.js';
|
|
4
4
|
cli({
|
|
5
5
|
site: 'arxiv',
|
|
6
6
|
name: 'paper',
|
|
7
|
+
access: 'read',
|
|
7
8
|
description: 'Get arXiv paper details by ID',
|
|
8
9
|
strategy: Strategy.PUBLIC,
|
|
9
10
|
browser: false,
|
|
10
11
|
args: [
|
|
11
12
|
{ name: 'id', positional: true, required: true, help: 'arXiv paper ID (e.g. 1706.03762)' },
|
|
12
13
|
],
|
|
13
|
-
columns: ['id', 'title', 'authors', 'published', 'abstract', 'url'],
|
|
14
|
+
columns: ['id', 'title', 'authors', 'published', 'updated', 'primary_category', 'categories', 'abstract', 'comment', 'pdf', 'url'],
|
|
14
15
|
func: async (args) => {
|
|
15
16
|
const xml = await arxivFetch(`id_list=${encodeURIComponent(args.id)}`);
|
|
16
17
|
const entries = parseEntries(xml);
|
|
17
18
|
if (!entries.length)
|
|
18
|
-
throw new
|
|
19
|
+
throw new EmptyResultError('arxiv paper', `Paper ${args.id} was not found. Check the arXiv ID format, e.g. 1706.03762`);
|
|
19
20
|
return entries;
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
import { EmptyResultError } from '@jackwener/opencli/errors';
|
|
3
|
+
import { arxivFetch, normalizeArxivCategory, normalizeArxivLimit, parseEntries } from './utils.js';
|
|
4
|
+
cli({
|
|
5
|
+
site: 'arxiv',
|
|
6
|
+
name: 'recent',
|
|
7
|
+
access: 'read',
|
|
8
|
+
description: 'List recent arXiv submissions in a category',
|
|
9
|
+
strategy: Strategy.PUBLIC,
|
|
10
|
+
browser: false,
|
|
11
|
+
args: [
|
|
12
|
+
{ name: 'category', positional: true, required: true, help: 'arXiv category (e.g. cs.CL, cs.LG, math.PR, q-bio.NC)' },
|
|
13
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Max results (max 50)' },
|
|
14
|
+
],
|
|
15
|
+
columns: ['id', 'title', 'authors', 'published', 'primary_category', 'url'],
|
|
16
|
+
func: async (args) => {
|
|
17
|
+
const category = normalizeArxivCategory(args.category);
|
|
18
|
+
const limit = normalizeArxivLimit(args.limit, 10, 50);
|
|
19
|
+
const query = encodeURIComponent(`cat:${category}`);
|
|
20
|
+
const xml = await arxivFetch(`search_query=${query}&max_results=${limit}&sortBy=submittedDate&sortOrder=descending`);
|
|
21
|
+
const entries = parseEntries(xml);
|
|
22
|
+
if (!entries.length)
|
|
23
|
+
throw new EmptyResultError('arxiv', `No recent papers in ${category}. Check the category name.`);
|
|
24
|
+
return entries.map(e => ({
|
|
25
|
+
id: e.id,
|
|
26
|
+
title: e.title,
|
|
27
|
+
authors: e.authors,
|
|
28
|
+
published: e.published,
|
|
29
|
+
primary_category: e.primary_category,
|
|
30
|
+
url: e.url,
|
|
31
|
+
}));
|
|
32
|
+
},
|
|
33
|
+
});
|
package/clis/arxiv/search.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
-
import {
|
|
3
|
-
import { arxivFetch, parseEntries } from './utils.js';
|
|
2
|
+
import { ArgumentError, EmptyResultError } from '@jackwener/opencli/errors';
|
|
3
|
+
import { arxivFetch, normalizeArxivLimit, parseEntries } from './utils.js';
|
|
4
4
|
cli({
|
|
5
5
|
site: 'arxiv',
|
|
6
6
|
name: 'search',
|
|
7
|
+
access: 'read',
|
|
7
8
|
description: 'Search arXiv papers',
|
|
8
9
|
strategy: Strategy.PUBLIC,
|
|
9
10
|
browser: false,
|
|
@@ -11,14 +12,25 @@ cli({
|
|
|
11
12
|
{ name: 'query', positional: true, required: true, help: 'Search keyword (e.g. "attention is all you need")' },
|
|
12
13
|
{ name: 'limit', type: 'int', default: 10, help: 'Max results (max 25)' },
|
|
13
14
|
],
|
|
14
|
-
columns: ['id', 'title', 'authors', 'published', 'url'],
|
|
15
|
+
columns: ['id', 'title', 'authors', 'published', 'primary_category', 'url'],
|
|
15
16
|
func: async (args) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
17
|
+
const queryText = String(args.query || '').trim();
|
|
18
|
+
if (!queryText) {
|
|
19
|
+
throw new ArgumentError('arxiv search query cannot be empty');
|
|
20
|
+
}
|
|
21
|
+
const limit = normalizeArxivLimit(args.limit, 10, 25);
|
|
22
|
+
const query = encodeURIComponent(`all:${queryText}`);
|
|
18
23
|
const xml = await arxivFetch(`search_query=${query}&max_results=${limit}&sortBy=relevance`);
|
|
19
24
|
const entries = parseEntries(xml);
|
|
20
25
|
if (!entries.length)
|
|
21
|
-
throw new
|
|
22
|
-
return entries.map(e => ({
|
|
26
|
+
throw new EmptyResultError('arxiv', 'No papers found. Try a different keyword.');
|
|
27
|
+
return entries.map(e => ({
|
|
28
|
+
id: e.id,
|
|
29
|
+
title: e.title,
|
|
30
|
+
authors: e.authors,
|
|
31
|
+
published: e.published,
|
|
32
|
+
primary_category: e.primary_category,
|
|
33
|
+
url: e.url,
|
|
34
|
+
}));
|
|
23
35
|
},
|
|
24
36
|
});
|
package/clis/arxiv/utils.js
CHANGED
|
@@ -4,15 +4,44 @@
|
|
|
4
4
|
* arXiv exposes a public Atom/XML API — no key required.
|
|
5
5
|
* https://info.arxiv.org/help/api/index.html
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { ArgumentError, CommandExecutionError } from '@jackwener/opencli/errors';
|
|
8
8
|
export const ARXIV_BASE = 'https://export.arxiv.org/api/query';
|
|
9
|
+
const ARXIV_CATEGORY_PATTERN = /^[a-z]+(?:-[a-z]+)*(?:\.[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)?$/;
|
|
9
10
|
export async function arxivFetch(params) {
|
|
10
11
|
const resp = await fetch(`${ARXIV_BASE}?${params}`);
|
|
11
12
|
if (!resp.ok) {
|
|
12
|
-
throw new
|
|
13
|
+
throw new CommandExecutionError(`arXiv API HTTP ${resp.status}`, 'Check your search term or paper ID');
|
|
13
14
|
}
|
|
14
15
|
return resp.text();
|
|
15
16
|
}
|
|
17
|
+
export function normalizeArxivLimit(value, defaultValue, maxValue, label = 'limit') {
|
|
18
|
+
const raw = value ?? defaultValue;
|
|
19
|
+
const limit = Number(raw);
|
|
20
|
+
if (!Number.isInteger(limit) || limit <= 0) {
|
|
21
|
+
throw new ArgumentError(`arxiv ${label} must be a positive integer`);
|
|
22
|
+
}
|
|
23
|
+
if (limit > maxValue) {
|
|
24
|
+
throw new ArgumentError(`arxiv ${label} must be <= ${maxValue}`);
|
|
25
|
+
}
|
|
26
|
+
return limit;
|
|
27
|
+
}
|
|
28
|
+
export function normalizeArxivCategory(value) {
|
|
29
|
+
const category = String(value || '').trim();
|
|
30
|
+
if (!ARXIV_CATEGORY_PATTERN.test(category)) {
|
|
31
|
+
throw new ArgumentError(`Invalid arXiv category "${value}". Examples: cs.CL, cs.LG, math.PR, q-bio.NC, physics.comp-ph`);
|
|
32
|
+
}
|
|
33
|
+
return category;
|
|
34
|
+
}
|
|
35
|
+
/** Decode the small set of XML entities arXiv emits in text fields. */
|
|
36
|
+
function decodeEntities(s) {
|
|
37
|
+
return s
|
|
38
|
+
.replace(/&/g, '&')
|
|
39
|
+
.replace(/</g, '<')
|
|
40
|
+
.replace(/>/g, '>')
|
|
41
|
+
.replace(/"/g, '"')
|
|
42
|
+
.replace(/'/g, "'")
|
|
43
|
+
.replace(/'/g, "'");
|
|
44
|
+
}
|
|
16
45
|
/** Extract the text content of the first matching XML tag. */
|
|
17
46
|
function extract(xml, tag) {
|
|
18
47
|
const m = xml.match(new RegExp(`<${tag}[^>]*>([\\s\\S]*?)<\\/${tag}>`));
|
|
@@ -27,6 +56,34 @@ function extractAll(xml, tag) {
|
|
|
27
56
|
results.push(m[1].trim());
|
|
28
57
|
return results;
|
|
29
58
|
}
|
|
59
|
+
/** Extract the value of a named attribute from the first matching tag (open or self-closing). */
|
|
60
|
+
function extractAttr(xml, tag, attr) {
|
|
61
|
+
const m = xml.match(new RegExp(`<${tag}\\b[^>]*?\\b${attr}="([^"]*)"`));
|
|
62
|
+
return m ? m[1] : '';
|
|
63
|
+
}
|
|
64
|
+
/** Extract all values of a named attribute across repeated tags. */
|
|
65
|
+
function extractAllAttr(xml, tag, attr) {
|
|
66
|
+
const re = new RegExp(`<${tag}\\b[^>]*?\\b${attr}="([^"]*)"`, 'g');
|
|
67
|
+
const out = [];
|
|
68
|
+
let m;
|
|
69
|
+
while ((m = re.exec(xml)) !== null)
|
|
70
|
+
out.push(m[1]);
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
/** Find the href of the first <link> tag matching a given rel. */
|
|
74
|
+
function findLinkHref(xml, rel) {
|
|
75
|
+
const re = /<link\b([^>]*)\/?>/g;
|
|
76
|
+
let m;
|
|
77
|
+
while ((m = re.exec(xml)) !== null) {
|
|
78
|
+
const attrs = m[1];
|
|
79
|
+
if (new RegExp(`\\brel="${rel}"`).test(attrs)) {
|
|
80
|
+
const h = attrs.match(/\bhref="([^"]*)"/);
|
|
81
|
+
if (h)
|
|
82
|
+
return h[1];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
30
87
|
/** Parse Atom XML feed into structured entries. */
|
|
31
88
|
export function parseEntries(xml) {
|
|
32
89
|
const entryRe = /<entry>([\s\S]*?)<\/entry>/g;
|
|
@@ -36,12 +93,18 @@ export function parseEntries(xml) {
|
|
|
36
93
|
const e = m[1];
|
|
37
94
|
const rawId = extract(e, 'id');
|
|
38
95
|
const arxivId = rawId.replace(/^https?:\/\/arxiv\.org\/abs\//, '').replace(/v\d+$/, '');
|
|
96
|
+
const pdf = findLinkHref(e, 'related') || `https://arxiv.org/pdf/${arxivId}`;
|
|
39
97
|
entries.push({
|
|
40
98
|
id: arxivId,
|
|
41
|
-
title: extract(e, 'title').replace(/\s+/g, ' '),
|
|
42
|
-
authors: extractAll(e, 'name').
|
|
43
|
-
abstract: (
|
|
99
|
+
title: decodeEntities(extract(e, 'title').replace(/\s+/g, ' ')),
|
|
100
|
+
authors: decodeEntities(extractAll(e, 'name').join(', ')),
|
|
101
|
+
abstract: decodeEntities(extract(e, 'summary').replace(/\s+/g, ' ')),
|
|
44
102
|
published: extract(e, 'published').slice(0, 10),
|
|
103
|
+
updated: extract(e, 'updated').slice(0, 10),
|
|
104
|
+
primary_category: extractAttr(e, 'arxiv:primary_category', 'term'),
|
|
105
|
+
categories: extractAllAttr(e, 'category', 'term').join(', '),
|
|
106
|
+
comment: decodeEntities(extract(e, 'arxiv:comment').replace(/\s+/g, ' ')),
|
|
107
|
+
pdf,
|
|
45
108
|
url: `https://arxiv.org/abs/${arxivId}`,
|
|
46
109
|
});
|
|
47
110
|
}
|
package/clis/band/bands.js
CHANGED