publishport-opencli 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-manifest.json +35 -0
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +16 -16
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/clis/36kr/article.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as i}from"@jackwener/opencli/registry";import{CliError as o}from"@jackwener/opencli/errors";function c(t){const r=t.match(/\/p\/(\d+)/);return r?r[1]:t.replace(/\D/g,"")}l({site:"36kr",name:"article",access:"read",description:"获取36氪文章正文内容",domain:"www.36kr.com",strategy:i.INTERCEPT,args:[{name:"id",positional:!0,required:!0,help:"Article ID or full 36kr article URL"}],columns:["field","value"],func:async(t,r)=>{const a=c(String(r.id??""));if(!a)throw new o("INVALID_ARGUMENT","Invalid article ID or URL");await t.installInterceptor("36kr.com/api");await t.goto(`https://www.36kr.com/p/${a}`);await t.wait(5);const e=await t.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
// Title: 36kr uses class "article-title" on h1
|
|
4
4
|
const title = document.querySelector('.article-title, h1')?.textContent?.trim() || '';
|
|
@@ -17,4 +17,4 @@ import{cli as F,Strategy as G}from"@jackwener/opencli/registry";import{CliError
|
|
|
17
17
|
.slice(0, 800);
|
|
18
18
|
return { title, author, date, body };
|
|
19
19
|
})()
|
|
20
|
-
`);if(!
|
|
20
|
+
`);if(!e?.title)throw new o("NOT_FOUND","Article not found or failed to load","Check the article ID");if(!e.body)throw new o("PARSE_ERROR","Article body not found","36kr page loaded but no article body paragraphs were extracted");return[{field:"title",value:e.title},{field:"author",value:e.author||""},{field:"date",value:e.date||""},{field:"url",value:`https://36kr.com/p/${a}`},{field:"body",value:e.body||""}]}});
|
package/clis/36kr/hot.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as w}from"@jackwener/opencli/registry";import{CliError as a}from"@jackwener/opencli/errors";const s={renqi:"人气榜",zonghe:"综合榜",shoucang:"收藏榜",catalog:"热门资讯"};function getShanghaiDate(t=new Date){return new Date(t.getTime()+28800000).toISOString().slice(0,10)}function buildHotListUrl(t,e=new Date){if(t==="catalog")return"https://www.36kr.com/hot-list/catalog";return`https://www.36kr.com/hot-list/${t}/${getShanghaiDate(e)}/1`}m({site:"36kr",name:"hot",access:"read",description:"36氪热榜 — trending articles (renqi/zonghe/shoucang/catalog)",domain:"www.36kr.com",strategy:w.PUBLIC,browser:!0,args:[{name:"limit",type:"int",default:20,help:"Number of items (max 50)"},{name:"type",type:"string",default:"catalog",help:"List type: renqi (人气), zonghe (综合), shoucang (收藏), catalog (热门资讯)"}],columns:["rank","title","url"],func:async(t,e)=>{const l=Math.min(Number(e.limit)||20,50),r=String(e.type??"catalog");if(!s[r])throw new a("INVALID_ARGUMENT",`Unknown type "${r}". Valid types: ${Object.keys(s).join(", ")}`);const c=buildHotListUrl(r);await t.goto(c);const h=Date.now()+5000;while(Date.now()<h){if(await t.evaluate('document.querySelectorAll("a[href*=\\"/p/\\"]").length'))break;await new Promise((n)=>setTimeout(n,300))}const o=await t.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
const seen = new Set();
|
|
4
4
|
const results = [];
|
|
@@ -13,4 +13,4 @@ import{cli as V,Strategy as W}from"@jackwener/opencli/registry";import{CliError
|
|
|
13
13
|
}
|
|
14
14
|
return results;
|
|
15
15
|
})()
|
|
16
|
-
`),
|
|
16
|
+
`),i=Array.isArray(o)?o:[];if(i.length===0)throw new a("NO_DATA","Could not retrieve 36kr hot list","36kr may have changed its DOM structure");return i.slice(0,l).map((n,u)=>({rank:u+1,title:n.title,url:n.url}))}});export{buildHotListUrl,getShanghaiDate};
|
package/clis/36kr/news.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as h}from"@jackwener/opencli/registry";u({site:"36kr",name:"news",access:"read",description:"Latest tech/startup news from 36kr (36氪)",domain:"www.36kr.com",strategy:h.PUBLIC,args:[{name:"limit",type:"int",default:20,help:"Number of articles (max 50)"}],columns:["rank","title","summary","date","url"],func:async(r)=>{const i=Math.min(r.limit||20,50),a=await fetch("https://www.36kr.com/feed",{headers:{"User-Agent":"Mozilla/5.0 (compatible; ppcli/1.0)"}});if(!a.ok)return[];const l=await a.text(),e=[],n=/<item>([\s\S]*?)<\/item>/g;let c;while((c=n.exec(l))&&e.length<i){const t=c[1],s=t.match(/<title>([\s\S]*?)<\/title>/)?.[1]?.trim()??"",m=t.match(/<link><!\[CDATA\[(.*?)\]\]>/)?.[1]??t.match(/<link>(.*?)<\/link>/)?.[1]??"",o=(t.match(/<pubDate>(.*?)<\/pubDate>/)?.[1]?.trim()??"").slice(0,10),p=(t.match(/<description><!\[CDATA\[([\s\S]*?)\]\]>/)?.[1]??"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\s+/g," ").trim().slice(0,120);if(s)e.push({rank:e.length+1,title:s,summary:p,date:o,url:m.trim()})}return e}});
|
package/clis/36kr/search.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as c,Strategy as u}from"@jackwener/opencli/registry";import{CliError as h}from"@jackwener/opencli/errors";c({site:"36kr",name:"search",access:"read",description:"搜索36氪文章",domain:"www.36kr.com",strategy:u.PUBLIC,browser:!0,args:[{name:"query",positional:!0,required:!0,help:'Search keyword (e.g. "AI", "OpenAI")'},{name:"limit",type:"int",default:20,help:"Number of results (max 50)"}],columns:["rank","title","date","url"],func:async(t,r)=>{const n=Math.min(Number(r.limit)||20,50),s=encodeURIComponent(String(r.query??""));await t.goto(`https://www.36kr.com/search/articles/${s}`);const a=Date.now()+5000;while(Date.now()<a){if(await t.evaluate('document.querySelectorAll("a[href*=\\"/p/\\"]").length'))break;await new Promise((e)=>setTimeout(e,300))}const l=await t.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
const seen = new Set();
|
|
4
4
|
const results = [];
|
|
@@ -33,4 +33,4 @@ import{cli as G,Strategy as H}from"@jackwener/opencli/registry";import{CliError
|
|
|
33
33
|
}
|
|
34
34
|
return results;
|
|
35
35
|
})()
|
|
36
|
-
`),
|
|
36
|
+
`),i=Array.isArray(l)?l:[];if(i.length===0)throw new h("NO_DATA","No results found","Try a different query or check your keyword");return i.slice(0,n).map((e,o)=>({rank:o+1,title:e.title,date:e.date,url:e.url}))}});
|
package/clis/51job/company.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as I,Strategy as b}from"@jackwener/opencli/registry";import{CliError as r}from"@jackwener/opencli/errors";import{JOBS_ORIGIN as h,requirePage as T,navigateTo as N,parseCompanyJobCard as C}from"./utils.js";I({site:"51job",name:"company",access:"read",description:"51job 公司简介 + 在招职位(按 encCoId)",domain:"jobs.51job.com",strategy:b.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"encCoId",type:"string",required:!0,positional:!0,help:"加密公司 ID(search 返回的 encCoId)"},{name:"limit",type:"int",default:20,help:"返回职位数(1-50)"}],columns:["rank","jobId","title","salary","city","workYear","degree","funcType","issueDate","url","companyName","companyType","companySize","companyIndustry","companyIntro","companyUrl"],func:async(a,c)=>{T(a);const n=String(c.encCoId??"").trim();if(!n)throw new r("INVALID_ARGUMENT","encCoId is required");if(!/^[A-Za-z0-9_]+$/.test(n))throw new r("INVALID_ARGUMENT",`encCoId must be alphanumeric/underscore, got "${n}"`);const d=Math.max(1,Math.min(Number(c.limit)||20,50)),i=`${h}/all/co${n}.html`;await N(a,i,2);const u=`(() => {
|
|
2
2
|
const sel = s => document.querySelector(s)?.innerText?.trim() || '';
|
|
3
3
|
const bodyText = (document.body.innerText || '').slice(0, 400);
|
|
4
4
|
if (/公司不存在|页面不存在|账号状态异常/.test(bodyText)) {
|
|
@@ -33,4 +33,4 @@ import{cli as v,Strategy as B}from"@jackwener/opencli/registry";import{CliError
|
|
|
33
33
|
cInfoParts,
|
|
34
34
|
sidebarText: sidebarText.slice(0, 400),
|
|
35
35
|
};
|
|
36
|
-
})()`,
|
|
36
|
+
})()`,e=await a.evaluate(u);if(e.error==="NOT_FOUND")throw new r("NO_DATA",`Company ${n} not found`);if(!e.companyName)throw new r("NO_DATA",`Could not parse company page ${n}; layout may have changed`);const s=i,[m="",l="",y=""]=e.cInfoParts||[],p=new Set,o=[];for(const f of e.links||[]){const t=C(f);if(!t)continue;if(p.has(t.jobId))continue;p.add(t.jobId);o.push({rank:o.length+1,...t,companyName:e.companyName,companyType:m,companySize:l,companyIndustry:y,companyIntro:e.companyIntro||"",companyUrl:s});if(o.length>=d)break}if(o.length===0)return[{rank:0,jobId:"",title:"(no active jobs)",salary:"",city:"",workYear:"",degree:"",funcType:"",issueDate:"",url:"",companyName:e.companyName,companyType:m,companySize:l,companyIndustry:y,companyIntro:e.companyIntro||"",companyUrl:s}];return o}});
|
package/clis/51job/detail.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as d,Strategy as y}from"@jackwener/opencli/registry";import{CliError as t}from"@jackwener/opencli/errors";import{JOBS_ORIGIN as u,requirePage as f,navigateTo as g}from"./utils.js";d({site:"51job",name:"detail",access:"read",description:"51job 职位详情(按 jobId)",domain:"jobs.51job.com",strategy:y.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"jobId",type:"string",required:!0,positional:!0,help:"职位 ID(search 返回的 jobId)"}],columns:["jobId","title","salary","location","workYear","degree","category","address","ageRequirement","description","welfare","company","companyType","companySize","companyIndustry","companyUrl","url"],func:async(o,c)=>{f(o);const r=String(c.jobId??"").trim();if(!r)throw new t("INVALID_ARGUMENT","jobId is required");if(!/^\d{6,12}$/.test(r))throw new t("INVALID_ARGUMENT",`jobId must be a 6-12 digit number, got "${r}"`);const i=`${u}/x/${r}.html`;await g(o,i,2);const s=`(() => {
|
|
2
2
|
const sel = s => document.querySelector(s)?.innerText?.trim() || '';
|
|
3
3
|
const all = s => [...document.querySelectorAll(s)].map(e => e.innerText.trim()).filter(Boolean);
|
|
4
4
|
const finalUrl = window.location.href;
|
|
@@ -32,4 +32,4 @@ import{cli as U,Strategy as V}from"@jackwener/opencli/registry";import{CliError
|
|
|
32
32
|
companyUrl: companyA?.href || '',
|
|
33
33
|
companyTag: sel('.com_tag'),
|
|
34
34
|
};
|
|
35
|
-
})()`,
|
|
35
|
+
})()`,e=await o.evaluate(s);if(e.error==="EXPIRED")throw new t("NO_DATA",`Job ${r} is offline or removed`);if(!e.title)throw new t("NO_DATA",`Could not parse job detail for ${r}; page may have changed layout`);const[l,m,p]=(e.meta||"").split("|").map((a)=>a.trim()),n=(e.companyTag||"").split(/\n+/).map((a)=>a.trim()).filter(Boolean);return[{jobId:r,title:e.title,salary:e.salary||"",location:l||"",workYear:m||"",degree:p||"",category:e.category||"",address:e.address||"",ageRequirement:e.ageRequirement||"",description:e.description||"",welfare:(e.welfare||[]).join(","),company:e.company||"",companyType:n[0]||"",companySize:n[1]||"",companyIndustry:n.slice(2).join(" / "),companyUrl:e.companyUrl||"",url:e.finalUrl||i}]}});
|
package/clis/51job/hot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as d,Strategy as f}from"@jackwener/opencli/registry";import{CliError as n}from"@jackwener/opencli/errors";import{WE_ORIGIN as s,SEARCH_COLUMNS as b,SORT_CODES as y,requirePage as g,navigateTo as w,pageFetchJson as O,buildSearchUrl as S,mapJobItem as j,resolveCity as C,resolveCode as N}from"./utils.js";d({site:"51job",name:"hot",access:"read",description:"51job 推荐职位(按城市/行业/排序浏览)",domain:"we.51job.com",strategy:f.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"area",type:"string",default:"全国",help:'城市名或 6 位城市码(默认 "全国")'},{name:"sort",type:"string",default:"综合",help:"排序:综合 / 最新 / 薪资 / 距离"},{name:"page",type:"int",default:1,help:"页码(1-based)"},{name:"limit",type:"int",default:20,help:"返回条数(1-50)"}],columns:b,func:async(e,t)=>{g(e);const o=Math.max(1,Math.min(Number(t.limit)||20,50)),r=Math.max(1,Number(t.page)||1),m=C(t.area),l=N(t.sort,y,"0"),c=await e.evaluate("(() => window.location.href)()");if(!String(c).startsWith(s))await w(e,`${s}/pc/search?searchType=2`,2);const u=S({keyword:"",jobArea:m,sortType:l,pageNum:r,pageSize:Math.min(o,50)}),a=await O(e,u);if(a.status!=="1"&&a.status!==1)throw new n("API_ERROR",`51job hot failed: ${a.message??"unknown"}`);const i=a?.resultbody?.job?.items??[];if(i.length===0)throw new n("NO_DATA","No recommended jobs returned");return i.slice(0,o).map((h,p)=>j(h,(r-1)*o+p+1))}});
|
package/clis/51job/search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as b,Strategy as
|
|
1
|
+
import{cli as b,Strategy as g}from"@jackwener/opencli/registry";import{CliError as i}from"@jackwener/opencli/errors";import{WE_ORIGIN as p,SEARCH_COLUMNS as _,SALARY_CODES as A,WORKYEAR_CODES as R,DEGREE_CODES as w,COMPANY_TYPE_CODES as N,COMPANY_SIZE_CODES as T,SORT_CODES as D,requirePage as I,navigateTo as M,pageFetchJson as j,buildSearchUrl as Y,mapJobItem as v,resolveCity as P,resolveCode as t}from"./utils.js";b({site:"51job",name:"search",access:"read",description:"51job 前程无忧关键词职位搜索",domain:"we.51job.com",strategy:g.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"keyword",type:"string",required:!0,positional:!0,help:"搜索关键词(岗位名 / 技能 / 公司)"},{name:"area",type:"string",default:"全国",help:'城市名或 6 位城市码(如 "杭州" / "080200" / "全国")'},{name:"salary",type:"string",default:"",help:'薪资区间(如 "10-15k" / "1-1.5万" / "20-30k")'},{name:"experience",type:"string",default:"",help:'工作年限(如 "应届" / "1-3年" / "3-5年" / "5-7年")'},{name:"degree",type:"string",default:"",help:'学历要求(如 "本科" / "大专" / "硕士")'},{name:"companyType",type:"string",default:"",help:'公司性质(如 "外资" / "国企" / "民营")'},{name:"companySize",type:"string",default:"",help:'公司规模(如 "50-150" / "1000-5000")'},{name:"sort",type:"string",default:"综合",help:"排序:综合 / 最新 / 薪资 / 距离"},{name:"page",type:"int",default:1,help:"页码(1-based)"},{name:"limit",type:"int",default:20,help:"返回条数(1-50)"}],columns:_,func:async(a,e)=>{I(a);const r=String(e.keyword??"").trim();if(!r)throw new i("INVALID_ARGUMENT","keyword is required");const o=Math.max(1,Math.min(Number(e.limit)||20,50)),s=Math.max(1,Number(e.page)||1),c=P(e.area),l=t(e.salary,A),y=t(e.experience,R),d=t(e.degree,w),u=t(e.companyType,N),h=t(e.companySize,T),f=t(e.sort,D,"0"),S=await a.evaluate("(() => window.location.href)()");if(!String(S).startsWith(p))await M(a,`${p}/pc/search?keyword=${encodeURIComponent(r)}&searchType=2`,2);const E=Y({keyword:r,jobArea:c,salary:l,workYear:y,degree:d,companyType:u,companySize:h,sortType:f,pageNum:s,pageSize:Math.min(o,50)}),n=await j(a,E);if(n.status!=="1"&&n.status!==1)throw new i("API_ERROR",`51job search failed: ${n.message??"unknown"}`);const m=n?.resultbody?.job?.items??[];if(m.length===0)throw new i("NO_DATA",`No jobs matched "${r}"`);return m.slice(0,o).map((O,C)=>v(O,(s-1)*o+C+1))}});
|
package/clis/51job/utils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as a}from"@jackwener/opencli/errors";export const WE_ORIGIN="https://we.51job.com",JOBS_ORIGIN="https://jobs.51job.com",CITY_CODES={"全国":"000000",all:"000000","北京":"010000",beijing:"010000","上海":"020000",shanghai:"020000","广州":"030200",guangzhou:"030200","深圳":"040000",shenzhen:"040000","武汉":"180200",wuhan:"180200","西安":"200200","xi'an":"200200",xian:"200200","杭州":"080200",hangzhou:"080200","南京":"070200",nanjing:"070200","成都":"090200",chengdu:"090200","苏州":"070300",suzhou:"070300","重庆":"060000",chongqing:"060000","天津":"050000",tianjin:"050000","长沙":"190200",changsha:"190200","郑州":"170200",zhengzhou:"170200","青岛":"120300",qingdao:"120300","合肥":"150200",hefei:"150200","厦门":"110300",xiamen:"110300","无锡":"070400",wuxi:"070400","济南":"120200",jinan:"120200","佛山":"030700",foshan:"030700","东莞":"030800",dongguan:"030800","宁波":"080300",ningbo:"080300","福州":"110200",fuzhou:"110200","昆明":"250200",kunming:"250200","大连":"230300",dalian:"230300","沈阳":"230200",shenyang:"230200","哈尔滨":"220200",haerbin:"220200",harbin:"220200","石家庄":"160200",shijiazhuang:"160200","贵阳":"260200",guiyang:"260200","南宁":"100200",nanning:"100200","南昌":"130200",nanchang:"130200","长春":"240200",changchun:"240200","太原":"210200",taiyuan:"210200","兰州":"280200",lanzhou:"280200","乌鲁木齐":"310200",urumqi:"310200","海口":"270200",haikou:"270200","香港":"330000",hongkong:"330000",hk:"330000"},SALARY_CODES={"不限":"","2千以下":"01","2-3千":"02","3-4.5千":"03","4.5-6千":"04","6-8千":"05","8k-1万":"06","8-10k":"06","1-1.5万":"07","10-15k":"07","1.5-2万":"08","15-20k":"08","2-3万":"09","20-30k":"09","3-5万":"10","30-50k":"10","5万以上":"11","50k以上":"11"},WORKYEAR_CODES={"不限":"","在校生":"01","应届":"02","1年以下":"03","1-3年":"04","3-5年":"05","5-7年":"06","7-10年":"07","10年以上":"08"},DEGREE_CODES={"不限":"","初中及以下":"01","高中/中技/中专":"02","高中":"02","大专":"03","本科":"04","硕士":"05","博士":"06"},COMPANY_TYPE_CODES={"不限":"","外资":"01","欧美":"0101","日韩":"0102","合资":"02","国企":"03","民营":"04","上市公司":"05","创业公司":"06","事业单位":"07","非营利":"08","政府":"09"},COMPANY_SIZE_CODES={"不限":"","少于50":"01","50以下":"01","50-150":"02","150-500":"03","500-1000":"04","1000-5000":"05","5000-10000":"06","10000以上":"07"},SORT_CODES={"综合":"0",relevance:"0",default:"0","最新":"1",new:"1",newest:"1","薪资":"2",salary:"2",pay:"2","距离":"9",distance:"9"};export function resolveCity(e){if(!e)return"000000";const t=String(e).trim();if(!t||t==="全国"||t.toLowerCase()==="all")return"000000";if(/^\d{6}$/.test(t))return t;const r=t.toLowerCase();if(CITY_CODES[t]!==void 0)return CITY_CODES[t];if(CITY_CODES[r]!==void 0)return CITY_CODES[r];for(const[n,o]of Object.entries(CITY_CODES))if(typeof n==="string"&&n.includes(t))return o;throw new a("INVALID_ARGUMENT",`Unknown city/area "${t}"`,'Use a supported city name like "杭州" or a 6-digit city code')}export function resolveCode(e,t,r=""){if(e===void 0||e===null||e==="")return r;const n=String(e).trim();if(t[n]!==void 0)return t[n];const o=n.toLowerCase();if(t[o]!==void 0)return t[o];if(Object.values(t).includes(n))return n;for(const[i,c]of Object.entries(t))if(typeof i==="string"&&i.includes(n))return c;return r}export function requirePage(e){if(!e)throw new a("INTERNAL_ERROR","Browser page required (adapter must set browser: true)")}export async function navigateTo(e,t,r=2){await e.goto(t);await e.wait({time:r})}export async function pageFetchJson(e,t,r={}){const n=r.method??"GET",o=r.body??null,i=r.timeout??15000,c=r.headers??{},u=`
|
|
2
2
|
async () => {
|
|
3
3
|
const ctrl = new AbortController();
|
|
4
|
-
const timer = setTimeout(() => ctrl.abort(), ${
|
|
4
|
+
const timer = setTimeout(() => ctrl.abort(), ${i});
|
|
5
5
|
try {
|
|
6
|
-
const resp = await fetch(${JSON.stringify(
|
|
7
|
-
method: ${JSON.stringify(
|
|
6
|
+
const resp = await fetch(${JSON.stringify(t)}, {
|
|
7
|
+
method: ${JSON.stringify(n)},
|
|
8
8
|
credentials: 'include',
|
|
9
|
-
headers: ${JSON.stringify({Accept:"application/json",...
|
|
10
|
-
${
|
|
9
|
+
headers: ${JSON.stringify({Accept:"application/json",...c})},
|
|
10
|
+
${o!==null?`body: ${JSON.stringify(o)},`:""}
|
|
11
11
|
signal: ctrl.signal,
|
|
12
12
|
});
|
|
13
13
|
const text = await resp.text();
|
|
@@ -18,4 +18,4 @@ import{CliError as J}from"@jackwener/opencli/errors";export const WE_ORIGIN="htt
|
|
|
18
18
|
clearTimeout(timer);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,s=await e.evaluate(u);if(s.error)throw new a("HTTP_ERROR",`51job fetch failed: ${s.error}`);if(!s.ok)throw new a("HTTP_ERROR",`51job HTTP ${s.status}`);if(s.text.trim().startsWith("<"))throw new a("ANTI_BOT","51job returned HTML (likely Aliyun WAF slider). Refresh browser session.");try{return JSON.parse(s.text)}catch(y){throw new a("API_ERROR",`51job invalid JSON: ${s.text.slice(0,200)}`)}}export function buildSearchUrl(e){const t=new URLSearchParams;t.set("api_key","51job");t.set("timestamp",String(Date.now()));t.set("keyword",e.keyword??"");t.set("searchType","2");t.set("function",e.function??"");t.set("industry",e.industry??"");t.set("jobArea",e.jobArea??"000000");t.set("jobArea2",e.jobArea2??"");t.set("landmark",e.landmark??"");t.set("metro",e.metro??"");t.set("salary",e.salary??"");t.set("workYear",e.workYear??"");t.set("degree",e.degree??"");t.set("companyType",e.companyType??"");t.set("companySize",e.companySize??"");t.set("jobType",e.jobType??"");t.set("issueDate",e.issueDate??"");t.set("sortType",e.sortType??"0");t.set("pageNum",String(e.pageNum??1));t.set("pageSize",String(e.pageSize??20));t.set("source","1");t.set("scene","7");return`${WE_ORIGIN}/api/job/search-pc?${t.toString()}`}export function mapJobItem(e,t){const r=e.jobAreaLevelDetail||{};return{rank:t,jobId:String(e.jobId??""),title:e.jobName??"",salary:e.provideSalaryString??"",salaryMin:Number(e.jobSalaryMin??0)||0,salaryMax:Number(e.jobSalaryMax??0)||0,city:r.cityString??e.jobAreaString??"",district:r.districtString??"",workYear:e.workYearString??"",degree:e.degreeString??"",tags:Array.isArray(e.jobTags)?e.jobTags.join(","):"",company:e.companyName??"",companyFull:e.fullCompanyName??"",companyType:e.companyTypeString??"",companySize:e.companySizeString??"",industry:e.industryType1Str??"",hr:e.hrName?`${e.hrName}·${e.hrPosition??""}`:"",issueDate:e.issueDateString??"",url:e.jobHref??"",companyUrl:e.companyHref??"",encCoId:e.encCoId??""}}export const SEARCH_COLUMNS=["rank","jobId","title","salary","salaryMin","salaryMax","city","district","workYear","degree","tags","company","companyFull","companyType","companySize","industry","hr","issueDate","url","companyUrl","encCoId"];export function parseCompanyJobCard(e){if(!e||typeof e!=="object")return null;const t=typeof e.href==="string"?e.href:"",r=typeof e.sensorsdata==="string"?e.sensorsdata:"";if(!t||!r)return null;let n;try{n=JSON.parse(r)}catch{return null}if(!n||!n.jobId)return null;return{jobId:String(n.jobId),title:n.jobTitle||"",salary:n.jobSalary||"",city:n.jobArea||"",workYear:n.jobYear||"",degree:n.jobDegree||"",funcType:n.funcType||"",issueDate:n.jobTime||"",url:t}}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{readFile as
|
|
1
|
+
import{readFile as j,stat as M}from"node:fs/promises";import{htmlToMarkdown as B}from"@jackwener/opencli/utils";import{ArgumentError as d,AuthRequiredError as L,CommandExecutionError as f,ConfigError as m,EmptyResultError as x}from"@jackwener/opencli/errors";const P="opencli-atlassian-adapter (+https://github.com/jackwener/OpenCLI)",q=new Set(["cloud","datacenter","auto"]);function w(t){for(const r of t){const e=process.env[r]?.trim();if(e)return e}return""}function N(t,r){const e=String(t??"").trim();if(!e)throw new m(`Missing ${r}`,`Set ${r}, for example https://example.atlassian.net`);let n;try{n=new URL(e)}catch{throw new m(`Invalid ${r}: ${e}`,"Use an absolute http(s) URL.")}if(n.protocol!=="https:"&&n.protocol!=="http:")throw new m(`Invalid ${r}: ${e}`,"Use an http(s) URL.");n.hash="";n.search="";return n.toString().replace(/\/+$/,"")}function _(t,r){const e=String(t||"auto").trim().toLowerCase();if(!q.has(e))throw new m("Invalid ATLASSIAN_DEPLOYMENT","Expected one of: cloud, datacenter, auto.");if(e!=="auto")return e;const n=new URL(r).hostname;return n==="atlassian.net"||n.endsWith(".atlassian.net")?"cloud":"datacenter"}function H(t,r){const e=new URL(t),n=e.pathname.replace(/\/+$/,"");e.pathname=`${n}${r}`;return e.toString().replace(/\/+$/,"")}function D(t,r){if(r!=="cloud")return t;const n=new URL(t).pathname.replace(/\/+$/,"");if(n==="/wiki"||n.endsWith("/wiki"))return t;return H(t,"/wiki")}function F(t,r){return`Basic ${Buffer.from(`${t}:${r}`,"utf8").toString("base64")}`}function R(t,r){const e=w(["ATLASSIAN_BEARER_TOKEN","ATLASSIAN_OAUTH_TOKEN"]);if(e)return{Authorization:`Bearer ${e}`};const n=w(["ATLASSIAN_PAT",`${r.toUpperCase()}_PAT`]);if(t==="datacenter"&&n)return{Authorization:`Bearer ${n}`};const o=r.toUpperCase(),s=w(["ATLASSIAN_EMAIL","ATLASSIAN_USERNAME",`${o}_EMAIL`,`${o}_USERNAME`]),a=w(["ATLASSIAN_API_TOKEN","ATLASSIAN_PASSWORD",`${o}_API_TOKEN`,`${o}_PASSWORD`]);if(s&&a)return{Authorization:F(s,a)};if(t==="cloud")throw new m("Missing Atlassian Cloud credentials","Set ATLASSIAN_EMAIL and ATLASSIAN_API_TOKEN, or set ATLASSIAN_BEARER_TOKEN for OAuth.");throw new m("Missing Atlassian Data Center credentials","Set ATLASSIAN_PAT, ATLASSIAN_BEARER_TOKEN, or ATLASSIAN_USERNAME plus ATLASSIAN_PASSWORD.")}export function getJiraConfig(){const t=N(w(["ATLASSIAN_JIRA_BASE_URL","JIRA_BASE_URL"]),"ATLASSIAN_JIRA_BASE_URL"),r=_(process.env.ATLASSIAN_DEPLOYMENT,t);return{product:"jira",baseUrl:t,deployment:r,authHeaders:R(r,"jira")}}export function getConfluenceConfig(){const t=N(w(["ATLASSIAN_CONFLUENCE_BASE_URL","CONFLUENCE_BASE_URL"]),"ATLASSIAN_CONFLUENCE_BASE_URL"),r=_(process.env.ATLASSIAN_DEPLOYMENT,t);return{product:"confluence",baseUrl:D(t,r),deployment:r,authHeaders:R(r,"confluence")}}function J(t,r){if(/^https?:\/\//i.test(r))return r;const e=r.startsWith("/")?r:`/${r}`;return`${t}${e}`}function E(t,r){if(t&&typeof t==="object"){const e=[];if(Array.isArray(t.errorMessages))e.push(...t.errorMessages.filter(Boolean));if(typeof t.message==="string")e.push(t.message);if(typeof t.error==="string")e.push(t.error);if(typeof t.reason==="string")e.push(t.reason);if(t.errors&&typeof t.errors==="object")for(const[n,o]of Object.entries(t.errors))e.push(`${n}: ${String(o)}`);if(e.length)return e.join(" · ")}if(typeof t==="string"&&t.trim())return t.trim().slice(0,300);return r}async function v(t,r){let e;try{e=await t.text()}catch(n){throw new f(`${r} response body could not be read: ${n?.message??n}`,"Check whether the Atlassian instance, proxy, or network interrupted the response.")}if(!e)return null;try{return JSON.parse(e)}catch{return e}}export async function atlassianRequest(t,r,e={}){const n=(e.method??"GET").toUpperCase(),o=e.label??`${t.product} ${n} ${r}`,s={"user-agent":P,accept:"application/json",...t.authHeaders,...e.headers??{}};let a;if(e.body!==void 0){s["content-type"]=s["content-type"]??"application/json";a=typeof e.body==="string"?e.body:JSON.stringify(e.body)}let i;const p=J(t.baseUrl,r);try{i=await fetch(p,{method:n,headers:s,body:a})}catch(y){throw new f(`${o} request failed: ${y?.message??y}`,"Check the Atlassian base URL, VPN/network access, and proxy settings.")}const l=await v(i,o);if(i.status===401)throw new L(t.baseUrl,`${o} returned HTTP 401`,"Check Atlassian credentials and whether this instance accepts the configured auth method.");if(i.status===403)throw new L(t.baseUrl,`${o} returned HTTP 403: ${E(l,"forbidden")}`,"The authenticated user lacks permission for this Jira issue, Confluence page, or space.");if(i.status===404)throw new x(o,`Atlassian returned 404 for ${p}.`);if(i.status===409)throw new f(`${o} returned HTTP 409: ${E(l,"version conflict")}`,"Reload the current Confluence page version and retry the update.");if(i.status===429)throw new f(`${o} returned HTTP 429 (rate limited)`,"Wait and retry with a smaller limit.");if(!i.ok)throw new f(`${o} returned HTTP ${i.status}: ${E(l,i.statusText)}`);if(typeof l==="string")throw new f(`${o} returned a non-JSON response`,"Expected Atlassian REST API JSON. Check the base URL and whether an HTML login, SSO, or proxy page was returned.");return l}export function queryString(t){const r=new URLSearchParams;for(const[n,o]of Object.entries(t)){if(o===void 0||o===null||o==="")continue;if(Array.isArray(o))for(const s of o)r.append(n,String(s));else r.set(n,String(o))}const e=r.toString();return e?`?${e}`:""}export function requireString(t,r){const e=String(t??"").trim();if(!e)throw new d(`${r} is required`);return e}export function requirePayloadObject(t,r){if(!t||typeof t!=="object"||Array.isArray(t))throw new f(`${r} returned an unexpected payload shape; expected an object.`);return t}export function requirePayloadArray(t,r){if(!Array.isArray(t))throw new f(`${r} returned an unexpected payload shape; expected an array.`);return t}export function requirePayloadString(t,r,e){if(typeof t!=="string"&&typeof t!=="number")throw new f(`${e} did not include a stable ${r}.`);const n=String(t).trim();if(!n)throw new f(`${e} did not include a stable ${r}.`);return n}export function requireNonEmptyRows(t,r,e){if(!t.length)throw new x(r,e);return t}export function parseLimit(t,r=20,e=100,n="limit"){const o=t??r,s=typeof o==="number"?o:Number(o);if(!Number.isInteger(s)||s<=0)throw new d(`${n} must be a positive integer`);if(s>e)throw new d(`${n} must be <= ${e}`);return s}export function requireExecute(t,r){if(t.execute!==!0)throw new d(`${r} requires --execute to perform a remote write`)}export async function readUtf8File(t){const r=requireString(t,"--file");let e;try{e=await M(r)}catch{throw new d(`File not found: ${r}`)}if(!e.isFile())throw new d(`File must be a readable text file: ${r}`);let n;try{n=await j(r)}catch{throw new d(`File could not be read: ${r}`)}try{return new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new d(`File could not be decoded as UTF-8 text: ${r}`)}}export function htmlEscape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}export function htmlToMarkdown(t){return B(String(t??""))}function z(t,r=[]){let e=t;for(const n of r){const o=n?.type;if(o==="link"&&n.attrs?.href)e=`[${e}](${n.attrs.href})`;else if(o==="strong")e=`**${e}**`;else if(o==="em")e=`_${e}_`;else if(o==="code")e=`\`${e}\``;else if(o==="strike")e=`~~${e}~~`}return e}function S(t,r=0){if(!t||typeof t!=="object")return"";const e=Array.isArray(t.content)?t.content:[],n=(o="")=>e.map((s)=>S(s,r)).filter(Boolean).join(o);switch(t.type){case"doc":return e.map((o)=>S(o,r)).filter(Boolean).join(`
|
|
2
2
|
|
|
3
|
-
`).trim();case"paragraph":return n("");case"text":return
|
|
4
|
-
`;case"heading":return`${"#".repeat(Math.max(1,Math.min(6,Number(t.attrs?.level??2))))} ${n("")}`;case"bulletList":return e.map((o)=>
|
|
5
|
-
`);case"orderedList":return e.map((o,s)=>
|
|
3
|
+
`).trim();case"paragraph":return n("");case"text":return z(String(t.text??""),Array.isArray(t.marks)?t.marks:[]);case"hardBreak":return`
|
|
4
|
+
`;case"heading":return`${"#".repeat(Math.max(1,Math.min(6,Number(t.attrs?.level??2))))} ${n("")}`;case"bulletList":return e.map((o)=>I(o,r,"-")).join(`
|
|
5
|
+
`);case"orderedList":return e.map((o,s)=>I(o,r,`${s+1}.`)).join(`
|
|
6
6
|
`);case"listItem":return n(`
|
|
7
7
|
`);case"codeBlock":return`\`\`\`
|
|
8
8
|
${n("")}
|
|
9
9
|
\`\`\``;case"blockquote":return n(`
|
|
10
10
|
`).split(`
|
|
11
11
|
`).map((o)=>`> ${o}`).join(`
|
|
12
|
-
`);case"rule":return"---";case"table":return
|
|
12
|
+
`);case"rule":return"---";case"table":return K(e);case"tableRow":return e.map((o)=>U(S(o,r))).join(" | ");case"tableHeader":case"tableCell":return n(" ").replace(/\s+/g," ").trim();case"mention":return t.attrs?.text?String(t.attrs.text):"";case"emoji":return String(t.attrs?.shortName??t.attrs?.text??"");case"inlineCard":return t.attrs?.url?String(t.attrs.url):"";default:return n("")}}function I(t,r,e){const n=" ".repeat(r),s=S(t,r+1).trim().split(`
|
|
13
13
|
`),[a,...i]=s;return`${n}${e} ${a??""}${i.length?`
|
|
14
14
|
${i.map((p)=>`${n} ${p}`).join(`
|
|
15
|
-
`)}`:""}`}function
|
|
16
|
-
`)}export function adfToMarkdown(t){if(!t)return"";if(typeof t==="string")return t.trim();return
|
|
15
|
+
`)}`:""}`}function U(t){return String(t??"").replace(/\|/g,"\\|").replace(/\n+/g,"<br>").trim()}function K(t){const r=t.map((o)=>{return(Array.isArray(o?.content)?o.content:[]).map((a)=>U(S(a)))}).filter((o)=>o.length>0);if(!r.length)return"";const e=Math.max(...r.map((o)=>o.length)),n=(o)=>Array.from({length:e},(s,a)=>o[a]??"").join(" | ");return[n(r[0]),Array.from({length:e},()=>"---").join(" | "),...r.slice(1).map(n)].join(`
|
|
16
|
+
`)}export function adfToMarkdown(t){if(!t)return"";if(typeof t==="string")return t.trim();return S(t).trim()}function T(t){const r=String(t??""),e=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;let n="",o=0;for(const s of r.matchAll(e)){n+=htmlEscape(r.slice(o,s.index));n+=`<a href="${htmlEscape(s[2])}">${htmlEscape(s[1])}</a>`;o=s.index+s[0].length}n+=htmlEscape(r.slice(o));return n.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function W(t,r){return t[r]?.includes("|")&&/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(t[r+1]??"")}function k(t){return t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map((r)=>r.trim())}function Y(t,r){const e=[];let n=r;e.push(k(t[n]));n+=2;while(n<t.length&&t[n].includes("|")&&t[n].trim()){e.push(k(t[n]));n+=1}return{html:`<table><tbody>${e.map((s,a)=>{const i=a===0?"th":"td";return`<tr>${s.map((p)=>`<${i}>${T(p)}</${i}>`).join("")}</tr>`}).join("")}</tbody></table>`,next:n}}export function markdownToConfluenceStorage(t){const r=String(t??"").replace(/\r\n/g,`
|
|
17
17
|
`).split(`
|
|
18
|
-
`),e=[];let n=0,o=!1,s=[];const a=[],i=()=>{const c=a.pop();if(!c)return;if(c.liOpen)e.push("</li>");e.push(`</${c.tag}>`)},p=(c)=>{while(a.length&&a[a.length-1].indent>c)i()},l=()=>{while(a.length)i()},
|
|
19
|
-
`)}]]></ac:plain-text-body></ac:structured-macro>`);s=[];o=!1}else{l();o=!0}n+=1;continue}if(o){s.push(c);n+=1;continue}if(!c.trim()){l();n+=1;continue}if(
|
|
18
|
+
`),e=[];let n=0,o=!1,s=[];const a=[],i=()=>{const c=a.pop();if(!c)return;if(c.liOpen)e.push("</li>");e.push(`</${c.tag}>`)},p=(c)=>{while(a.length&&a[a.length-1].indent>c)i()},l=()=>{while(a.length)i()},y=(c,h)=>{e.push(`<${c}>`);a.push({tag:c,indent:h,liOpen:!1})},C=(c,h,A)=>{p(h);let u=a[a.length-1];if(u&&u.indent===h&&u.tag!==c){i();u=a[a.length-1]}if(!u||u.indent<h){y(c,h);u=a[a.length-1]}if(u.indent===h&&u.liOpen){e.push("</li>");u.liOpen=!1}e.push(`<li>${T(A)}`);u.liOpen=!0};while(n<r.length){const c=r[n];if(c.match(/^```/)){if(o){e.push(`<ac:structured-macro ac:name="code"><ac:plain-text-body><![CDATA[${s.join(`
|
|
19
|
+
`)}]]></ac:plain-text-body></ac:structured-macro>`);s=[];o=!1}else{l();o=!0}n+=1;continue}if(o){s.push(c);n+=1;continue}if(!c.trim()){l();n+=1;continue}if(W(r,n)){l();const g=Y(r,n);e.push(g.html);n=g.next;continue}const A=c.match(/^(#{1,6})\s+(.+)$/);if(A){l();e.push(`<h${A[1].length}>${T(A[2])}</h${A[1].length}>`);n+=1;continue}const u=c.match(/^(\s*)[-*]\s+(.+)$/),b=c.match(/^(\s*)\d+\.\s+(.+)$/);if(u||b){const g=u||b,O=g[1].replace(/\t/g," ").length;C(u?"ul":"ol",O,g[2]);n+=1;continue}l();e.push(`<p>${T(c)}</p>`);n+=1}l();if(o)e.push(`<ac:structured-macro ac:name="code"><ac:plain-text-body><![CDATA[${s.join(`
|
|
20
20
|
`)}]]></ac:plain-text-body></ac:structured-macro>`);return e.join(`
|
|
21
21
|
`)}export const __test__={adfToMarkdown,atlassianRequest,getConfluenceConfig,getJiraConfig,htmlToMarkdown,markdownToConfluenceStorage,parseLimit,queryString};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{CommandExecutionError as
|
|
2
|
-
`+
|
|
3
|
-
const __checkAuth = (`+
|
|
1
|
+
import{CommandExecutionError as i}from"@jackwener/opencli/errors";import{PAGE_RUNTIME as s}from"./page-runtime.js";import{gotoWritePage as u}from"./publish.js";export function buildCheckAuthJs(t){return`(async () => {
|
|
2
|
+
`+s+`
|
|
3
|
+
const __checkAuth = (`+t+`);
|
|
4
4
|
try {
|
|
5
5
|
const r = await __checkAuth(PP);
|
|
6
6
|
return {
|
|
@@ -13,4 +13,4 @@ try {
|
|
|
13
13
|
} catch (e) {
|
|
14
14
|
return { isAuthenticated: false, probeFailed: true, userId: "", username: "", avatar: "", error: String((e && e.message) || e) };
|
|
15
15
|
}
|
|
16
|
-
})()`}export async function checkLogin(
|
|
16
|
+
})()`}export async function checkLogin(t,e){if(!e||!e.home)throw Error("checkLogin: profile.home is required");if(typeof e.checkAuth!=="function")throw Error("checkLogin: profile.checkAuth must be a function");try{await u(t,e.home,e.originRe)}catch(n){if(!n||!n.landedOffSite)throw n;return{isAuthenticated:!1,userId:"",username:"",avatar:"",error:"未登录(访问需登录的页面时被重定向到 "+(n.lastHref||"其它页面")+")"}}const o=buildCheckAuthJs(e.checkAuth.toString()),r=await t.evaluate(o);if(!r)throw new i("登录检测未返回结果(页面内脚本没有执行成功),无法判定登录状态。");if(r.probeFailed)throw new i("登录检测失败(页面内请求异常:"+(r.error||"未知错误")+")。这不代表未登录,请稍后重试。");return r}export async function requireLogin(t,e,o){const r=await checkLogin(t,e);if(!r.isAuthenticated)throw new i(`未登录${o||""}。请先在已连接 ppcli 浏览器桥的 Chrome 里登录该平台。`+(r.error?`(${r.error})`:""));return r}export function cookieQuickCheck(t,e,o=[]){const r=new Set(e);return async(n)=>{return{logged_in:(await n.getCookies({url:t})).some((a)=>a.value&&(r.has(a.name)||o.some((c)=>a.name.startsWith(c))))}}}export const __test__={buildCheckAuthJs,checkLogin,requireLogin,cookieQuickCheck};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{markdownToDraft as
|
|
2
|
-
`).map((
|
|
3
|
-
![]`):
|
|
4
|
-
`);let
|
|
1
|
+
import{markdownToDraft as m}from"markdown-draft-js";import{Remarkable as d}from"remarkable";const g=/^!\[([^\]]*)]\s*\(([^)"]+)( "([^)"]+)")?\)/,k=(s)=>{s.block.ruler.before("paragraph","image",(n,i,u,a)=>{const l=n.bMarks[i]+n.tShift[i],c=n.eMarks[i];if(l>=c)return!1;if(!n.src)return!1;if(n.src[l]!=="!")return!1;const e=g.exec(n.src.slice(l));if(!e)return!1;if(!a){n.tokens.push({type:"image_open",src:e[2],alt:e[1],lines:[i,n.line],level:n.level});n.tokens.push({type:"image_close",level:n.level})}n.line=i+1;return!0})};export function markdownToDraftState(s,n=new Map){const i=s.split(`
|
|
2
|
+
`).map((e)=>{const r=e.split("![]");return r.length>1?r.join(`
|
|
3
|
+
![]`):e}).join(`
|
|
4
|
+
`);let u=0;const a=()=>u++,l=(e)=>{const r=e.src?e.src.split("?#"):["",""],o=r[0],f=r[1]||"",t=n.get(e.src)||n.get(o);if(t)return{id:t.id,src:t.url,thumb:t.thumb,url:t.url,width:t.width,height:t.height,file_name:t.file_name,file_size:t.file_size};return{id:f,src:o,thumb:o,url:o}},c=m(i,{remarkablePlugins:[k],blockTypes:{image_open:function(e){const r=a(),o={};o[r]={type:"IMAGE",mutability:"IMMUTABLE",data:l(e)};return{type:"atomic",blockEntities:o,inlineStyleRanges:[],entityRanges:[{offset:0,length:1,key:r}],text:" "}}},blockEntities:{image:function(e){return{type:"IMAGE",mutability:"IMMUTABLE",data:l(e)}}}});if(c.blocks){for(const e of c.blocks)if(e.blockEntities){Object.assign(c.entityMap,e.blockEntities);delete e.blockEntities}}return c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from"markdown-it";const i=new n({html:!0,linkify:!0,breaks:!1});export function markdownToHtml(t){if(typeof t!=="string"||!t.trim())return"";return i.render(t).trim()}const l=/<\/(?:p|div|h[1-6]|ul|ol|li|table|tr|td|figure|section|article|span|strong|em|pre|code|blockquote)\s*>|<(?:p|div|h[1-6]|ul|ol|li|table|figure|section|article|img|br|hr)\b[^>]*>/i;export function looksLikeHtml(t){if(typeof t!=="string")return!1;return l.test(t)}export function normalizeContent(t,e={}){const r=typeof t==="string"?t:"",o=e.format||"auto";if(o==="html"||o==="auto"&&looksLikeHtml(r))return{format:"html",markdown:r,html:r};return{format:"markdown",markdown:r,html:markdownToHtml(r)}}export const __test__={markdownToHtml,looksLikeHtml,normalizeContent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{resolveContentPath as k}from"@jackwener/opencli/utils";import{readFile as h}from"node:fs/promises";import{fileURLToPath as v}from"node:url";const p=/<img\b[^>]*?\ssrc=("|')(.*?)\1[^>]*>/gi,d=/!\[[^\]]*\]\(\s*<?([^)\s>]+)>?[^)]*\)/g;export function extractImageRefs(e){const t=[];if(typeof e!=="string"||!e)return t;let s;p.lastIndex=0;while((s=p.exec(e))!==null)t.push({full:s[0],src:s[2]});d.lastIndex=0;while((s=d.exec(e))!==null)t.push({full:s[0],src:s[1]});return t}export function pickPath(e,t){if(e==null)return;const s=String(t||"").split(".").filter(Boolean);let r=e;for(const n of s){if(r==null)return;r=r[n]}return r}const S=`
|
|
2
2
|
const htmlRe = /<img\\b[^>]*?\\ssrc=("|')(.*?)\\1[^>]*>/gi;
|
|
3
3
|
const mdRe = /!\\[[^\\]]*\\]\\(\\s*<?([^)\\s>]+)>?[^)]*\\)/g;
|
|
4
4
|
const refs = [];
|
|
@@ -87,9 +87,9 @@ import{readFile as S}from"node:fs/promises";import{resolve as j}from"node:path";
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
return { content: out, uploaded: uploaded, failed: failed };
|
|
90
|
-
`;export function buildTransferImagesJs(
|
|
91
|
-
const content = `+JSON.stringify(
|
|
92
|
-
const spec = `+JSON.stringify(
|
|
93
|
-
const skip = `+JSON.stringify(
|
|
94
|
-
`+
|
|
95
|
-
})()`}const
|
|
90
|
+
`;export function buildTransferImagesJs(e,t,s){return`(async () => {
|
|
91
|
+
const content = `+JSON.stringify(e)+`;
|
|
92
|
+
const spec = `+JSON.stringify(t||{})+`;
|
|
93
|
+
const skip = `+JSON.stringify(s||[])+`;
|
|
94
|
+
`+S+`
|
|
95
|
+
})()`}const b={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",tif:"image/tiff",tiff:"image/tiff"};export function isLocalImagePath(e){if(typeof e!=="string"||!e)return!1;if(e.startsWith("file://"))return!0;if(/^[a-zA-Z]:[\\/]/.test(e))return!0;if(e.startsWith("//"))return!1;if(/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e))return!1;return!0}function y(e){if(e.startsWith("file://"))try{return v(e)}catch{return e.slice(7)}return k(e)}export async function localImageToDataUri(e,t={}){const s=t.readFile||h,r=y(e),n=await s(r),l=n.byteLength!=null?n.byteLength:n.length,i=(r.split(/[\\/]/).pop().split(".").pop()||"").toLowerCase().split("?")[0],c=b[i]||"image/png";return{dataUri:`data:${c};base64,${Buffer.from(n).toString("base64")}`,bytes:l,mime:c}}export async function inlineLocalImages(e,t={}){const s=t.readFile||h,r=[],n=[];if(typeof e!=="string"||!e)return{content:e||"",inlined:r,missing:n};const l=extractImageRefs(e),i={};let c=e;for(const u of l){const o=u.src;if(!isLocalImagePath(o))continue;if(!(o in i))try{const a=y(o),f=await s(a),x=f.byteLength!=null?f.byteLength:f.length,w=(a.split(/[\\/]/).pop().split(".").pop()||"").toLowerCase().split("?")[0],g=b[w]||"image/png",j=Buffer.from(f).toString("base64");i[o]=`data:${g};base64,${j}`;r.push({src:o,bytes:x,mime:g})}catch(a){i[o]=null;n.push({src:o,error:String(a&&a.message||a)})}const m=i[o];if(m)c=c.split(u.full).join(u.full.replace(o,m))}return{content:c,inlined:r,missing:n}}export async function transferImages(e,t,s={}){const{spec:r,skip:n=[]}=s;if(!r||!r.url)return{content:t,uploaded:[],failed:[]};if(extractImageRefs(t).length===0)return{content:t,uploaded:[],failed:[]};return await e.evaluate(buildTransferImagesJs(t,r,n))||{content:t,uploaded:[],failed:[]}}export const __test__={extractImageRefs,pickPath,buildTransferImagesJs,isLocalImagePath,inlineLocalImages,localImageToDataUri,HTML_IMG_RE:p,MD_IMG_RE:d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as w,Strategy as h}from"@jackwener/opencli/registry";import{TimeoutError as f}from"@jackwener/opencli/errors";import{checkLogin as a}from"./auth.js";const u=300,_=3000;async function l(e){if(typeof e?.closeWindow==="function")try{await e.closeWindow()}catch{}}export function registerArticleLogin(e){if(!e?.site||!e?.domain||!e?.profile||typeof e.profile.checkAuth!=="function")throw Error("registerArticleLogin 需要 site、domain 和 profile.checkAuth");const d=e.loginUrl??e.profile.home;w({site:e.site,name:"login",access:"write",description:e.loginDescription??`打开${e.site}登录页并等待浏览器会话完成登录`,domain:e.domain,strategy:h.COOKIE,browser:!0,navigateBefore:!1,defaultWindowMode:"foreground",siteSession:"persistent",args:[{name:"timeout",type:"int",default:u,help:"等待用户完成登录的最长秒数"}],columns:["status","logged_in","user_id","username"],func:async(t,m)=>{const i=await a(t,e.profile);if(i.isAuthenticated){const o={status:"already_logged_in",logged_in:!0,user_id:i.userId||"",username:i.username||""};await l(t);return o}await t.goto(d);const s=Number(m.timeout??u),n=Date.now()+s*1000;while(Date.now()<n){const o=n-Date.now();await t.wait(Math.min(_/1000,Math.max(0.2,o/1000)));const r=await a(t,e.profile);if(r.isAuthenticated){const c={status:"login_complete",logged_in:!0,user_id:r.userId||"",username:r.username||""};await l(t);return c}}throw new f(`${e.site} login`,s,`请在打开的窗口里完成${e.site}登录后重试。`)}})}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{CommandExecutionError as
|
|
1
|
+
import{CommandExecutionError as _}from"@jackwener/opencli/errors";import{normalizeContent as I}from"./format.js";import{assertLiteralContent as x}from"../content-guard.js";import{inlineLocalImages as P,isLocalImagePath as C,localImageToDataUri as U}from"./images.js";import{PAGE_RUNTIME as A}from"./page-runtime.js";export function selectContent(n,o,r="auto"){const l=I(n,{format:r});return o.outputFormat==="markdown"?l.markdown:l.html}export function originReFromHome(n){let o="";try{o=new URL(n).host}catch(l){o=""}return"^https?://([^/]*\\.)?"+o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"(/|$)"}export async function gotoWritePage(n,o,r){const l=r||originReFromHome(o);let p=null;for(let m=0;m<8;m++){await n.goto(o);await n.wait({time:1});const s=await n.evaluate(`(() => {
|
|
2
2
|
var href = ''; try { href = location.href; } catch (e) {}
|
|
3
|
-
var onSite = new RegExp(${JSON.stringify(
|
|
3
|
+
var onSite = new RegExp(${JSON.stringify(l)}).test(href);
|
|
4
4
|
var cookieOk = true; try { void document.cookie; } catch (e) { cookieOk = false; }
|
|
5
5
|
return { href: href, onSite: onSite, cookieOk: cookieOk };
|
|
6
|
-
})()`);if(
|
|
7
|
-
`+
|
|
8
|
-
const I = `+JSON.stringify(
|
|
9
|
-
const __publish = (`+
|
|
10
|
-
`+(
|
|
6
|
+
})()`);if(s&&s.onSite&&s.cookieOk)return;if(s)p=s;await n.wait({time:1})}const c=p&&p.href||"",t=new _(`无法在浏览器中打开已登录的写作页(未落到 ${o}${c?`,当前停留在 ${c}`:",页面停留在空白页"})。`+"请确认登录该平台的 Chrome 已连接 ppcli 浏览器桥。");t.lastHref=c;t.landedOffSite=/^https?:/i.test(c);throw t}export function buildPublishJs(n,o,r){return`(async () => {
|
|
7
|
+
`+A+`
|
|
8
|
+
const I = `+JSON.stringify(n)+`;
|
|
9
|
+
const __publish = (`+o+`);
|
|
10
|
+
`+(r?"const __upload = ("+r+`);
|
|
11
11
|
`:"")+`const __content0 = I.content;
|
|
12
12
|
let content = I.content;
|
|
13
13
|
if (I.outputFormat === "html" && I.preprocessConfig) content = PP.preprocess(content, I.preprocessConfig);
|
|
14
|
-
`+(
|
|
14
|
+
`+(r?`const __t = await PP.processImagesWith(content, (src) => __upload(src, PP), { skip: I.imageSkip, allowRelative: I.imageAllowRelative });
|
|
15
15
|
`:`const __t = await PP.transferImages(content, I.imageSpec, I.imageSkip);
|
|
16
16
|
`)+`content = __t.content;
|
|
17
17
|
if (I.publishParams && typeof I.publishParams.cover === "string" && I.publishParams.cover) {
|
|
18
18
|
var __cvWrap = '<img src="' + I.publishParams.cover + '">';
|
|
19
|
-
`+(
|
|
19
|
+
`+(r?` var __cv = await PP.processImagesWith(__cvWrap, (src) => __upload(src, PP), { skip: I.imageSkip, allowRelative: I.imageAllowRelative });
|
|
20
20
|
`:` var __cv = await PP.transferImages(__cvWrap, I.imageSpec, I.imageSkip);
|
|
21
21
|
`)+` if (__cv.failed.length) {
|
|
22
22
|
`+` return { ok: false, stage: "cover", message: "封面图转存失败:" + __cv.failed[0].error, uploaded: __t.uploaded, failed: __t.failed.concat(__cv.failed) };
|
|
@@ -36,6 +36,6 @@ if (!__pub || __pub.ok === false) {
|
|
|
36
36
|
return { ok: false, stage: (__pub && __pub.stage) || "publish", status: __pub && __pub.status, message: (__pub && __pub.message) || "publish failed", detail: __pub && __pub.detail, unknownOutcome: !!(__pub && __pub.unknownOutcome), uploaded: __upN, failed: __failN };
|
|
37
37
|
}
|
|
38
38
|
return { ok: true, id: String(__pub.id == null ? "" : __pub.id), url: __pub.url || "", publicUrl: __pub.publicUrl || "", draft: !!__pub.draft, uploaded: __upN, failed: __failN };
|
|
39
|
-
})()`}export async function publishArticle(
|
|
39
|
+
})()`}export async function publishArticle(n,o){const{title:r,body:l,format:p="auto",draftOnly:c=!1,profile:t,publishParams:m=null}=o;if(!t)throw Error("publishArticle: profile is required");if(!t.home)throw Error("publishArticle: profile.home is required");if(typeof t.publish!=="function")throw Error("publishArticle: profile.publish must be a function");x(l,{fileFlag:"--file"});const s=I(l,{format:p}),y=t.outputFormat==="markdown"||t.needsMarkdown===!0,S=t.outputFormat==="html"||t.needsHtml===!0,d=y?await P(s.markdown):{content:null,missing:[]},f=S?await P(s.html):{content:null,missing:[]},h=d.content,g=f.content,O=t.outputFormat==="markdown"?h:g,w=[],b=new Set;for(const a of[...d.missing,...f.missing]){if(b.has(a.src))continue;b.add(a.src);w.push(a)}let i=m;if(i&&typeof i.cover==="string"&&i.cover){const a=i.cover.trim();if(/["<>\s]/.test(a))throw new _("封面图路径/URL 含非法字符(引号/尖括号/空白):"+a.slice(0,120));if(C(a))try{const{dataUri:u}=await U(a);i={...i,cover:u}}catch(u){throw new _("封面图读取失败:"+a+"("+String(u&&u.message||u)+")")}else i={...i,cover:a}}await gotoWritePage(n,t.home,t.originRe);const F={title:r,content:O,markdown:t.needsMarkdown===!0&&t.outputFormat!=="markdown"?h:null,html:t.needsHtml===!0&&t.outputFormat!=="html"?g:null,draftOnly:!!c,outputFormat:t.outputFormat,preprocessConfig:t.preprocessConfig||null,imageSpec:t.image?.spec||null,imageSkip:t.image?.skip||[],imageAllowRelative:t.image?.allowRelative===!0,publishParams:i},R=typeof t.image?.uploadFn==="function"?t.image.uploadFn.toString():null,N=buildPublishJs(F,t.publish.toString(),R),e=await n.evaluate(N);if(!e||e.ok===!1){const a=e?.stage||"publish",u=e?.status!=null?` (HTTP ${e.status})`:"",k=e?.detail!=null?`;接口原始响应:${typeof e.detail==="string"?e.detail:JSON.stringify(e.detail)}`:"";if(e?.unknownOutcome){const v=new _(`[${a}] 提交请求已发出但未收到平台响应,本次发布结果未知:${e?.message||"网络异常"}${u}${k}`+`
|
|
40
40
|
⚠️ 禁止直接重试本命令——文章可能已经创建成功,重试会发出重复内容。`+`
|
|
41
|
-
正确做法:先用该平台的列表/统计命令(如 stats / lists / articles)按标题回查最近内容,`+"确认未创建后再重发;已创建则直接以该条为准。");
|
|
41
|
+
正确做法:先用该平台的列表/统计命令(如 stats / lists / articles)按标题回查最近内容,`+"确认未创建后再重发;已创建则直接以该条为准。");v.unknownOutcome=!0;throw v}throw new _(`[${a}] ${e?.message||"发布失败"}${u}${k}`)}return{id:e.id,url:e.url,publicUrl:e.publicUrl||"",draft:e.draft,images:{uploaded:e.uploaded||[],failed:(e.failed||[]).concat(w)}}}export const __test__={selectContent,originReFromHome,buildPublishJs,publishArticle};
|
package/clis/_shared/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as i}from"@jackwener/opencli/errors";export function clamp(n,r,t){return Math.max(r,Math.min(n,t))}export function clampInt(n,r,t,e){const o=Number(n);if(!Number.isFinite(o))return r;return clamp(Math.floor(o),t,e)}export function normalizeNumericId(n,r,t){const e=String(n??"").trim();if(!/^\d+$/.test(e))throw new i(`${r} must be a numeric ID`,`Pass a numeric ${r}, for example: ${t}`);return e}export function requireNonEmptyQuery(n,r="query"){const t=String(n??"").trim();if(!t)throw new i(`${r} cannot be empty`);return t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as e}from"@jackwener/opencli/errors";import*as c from"node:fs";import*as f from"node:os";const m=/^@(?:\/|~\/|\.{1,2}\/)\S+$/,u=/^(?:\/|~\/)\S+$/;function h(i){return i.startsWith("~/")?`${f.homedir()}/${i.slice(2)}`:i}export function assertLiteralContent(i,{fileFlag:o=null,label:r="正文"}={}){const t=String(i??"").trim();if(!t)return t;const s=o?(n)=>`请改用 ${o} ${n},或把文件内容读出来作为${r}传入`:()=>`本命令没有文件参数,请把文件内容读出来作为${r}传入`;if(m.test(t))throw new e(`${r} "${t}" 看起来是文件引用——命令不会展开 @路径,照发会把这串字面量当${r}。${s(t.slice(1))}`);if(u.test(t)){let n=!1;try{n=c.statSync(h(t)).isFile()}catch{}if(n)throw new e(`${r} "${t}" 是一个本机已存在的文件路径——照发会把这串路径当${r}发出去。${s(t)}`)}return t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as c from"node:fs";import{cli as i,Strategy as l}from"@jackwener/opencli/registry";export function makeScreenshotCommand(t,e,n={}){return i({...n,site:t,name:"screenshot",access:"read",description:`Capture a snapshot of the current ${e??t} window (DOM + Accessibility tree)`,domain:"localhost",strategy:l.UI,browser:!0,args:[{name:"output",required:!1,help:`Output file path (default: /tmp/${t}-snapshot.txt)`}],columns:["Status","File"],func:async(a,o)=>{const r=o.output||`/tmp/${t}-snapshot.txt`,u=await a.snapshot({compact:!0}),d=await a.evaluate("document.documentElement.outerHTML"),m=r.replace(/\.\w+$/,"")+"-dom.html",p=r.replace(/\.\w+$/,"")+"-a11y.txt";c.writeFileSync(m,d);c.writeFileSync(p,typeof u==="string"?u:JSON.stringify(u,null,2));return[{Status:"Success",File:m},{Status:"Success",File:p}]}})}export function makeStatusCommand(t,e,n={}){return i({...n,site:t,name:"status",access:"read",description:`Check active CDP connection to ${e??t}`,domain:"localhost",strategy:l.UI,browser:!0,columns:["Status","Url","Title"],func:async(a)=>{const o=await a.evaluate("window.location.href"),r=await a.evaluate("document.title");return[{Status:"Connected",Url:o,Title:r}]}})}export function makeNewCommand(t,e,n={}){return i({...n,site:t,name:"new",access:"write",description:`Start a new ${e??t} session`,domain:"localhost",strategy:l.UI,browser:!0,columns:["Status"],func:async(a)=>{const o=process.platform==="darwin";await a.pressKey(o?"Meta+N":"Control+N");await a.wait(1);return[{Status:"Success"}]}})}export function makeDumpCommand(t){return i({site:t,name:"dump",access:"read",description:`Dump the DOM and Accessibility tree of ${t} for reverse-engineering`,domain:"localhost",strategy:l.UI,browser:!0,columns:["action","files"],func:async(e)=>{const n=await e.evaluate("document.body.innerHTML");c.writeFileSync(`/tmp/${t}-dom.html`,n);const s=await e.snapshot({interactive:!1});c.writeFileSync(`/tmp/${t}-snapshot.json`,JSON.stringify(s,null,2));return[{action:"Dom extraction finished",files:`/tmp/${t}-dom.html, /tmp/${t}-snapshot.json`}]}})}
|