publishport-opencli 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +17 -17
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/clis/gemini/detail.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as d,Strategy as m}from"@jackwener/opencli/registry";import{ArgumentError as l,EmptyResultError as s}from"@jackwener/opencli/errors";import{GEMINI_APP_URL as c,GEMINI_DOMAIN as u,ensureGeminiPage as p,getGeminiConversationList as g,getGeminiVisibleTurns as w,resolveGeminiConversationForQuery as f}from"./utils.js";import{extractGeminiId as h}from"./history.js";async function v(e,n){const t=String(n||"").trim();if(!t)throw new l("id","must be a conversation id, /app/<id> URL, or sidebar title");const i=h(t),r=t.startsWith("http")||t.startsWith("/app/")||/^[a-f0-9]{16,}$/i.test(t);if(i&&r)return`${c}/${i}`;const o=await g(e),a=f(o,t,"contains");if(!a||!a.Url)throw new s("gemini detail",`No sidebar conversation matched "${t}". Try the exact id from \`ppcli gemini history\` instead.`);return a.Url}export const detailCommand=d({site:"gemini",name:"detail",access:"read",description:"Open a Gemini web conversation by id, URL, or sidebar title and read its turns",domain:u,strategy:m.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[{name:"id",positional:!0,required:!0,help:"Conversation id, /app/<id> URL, or sidebar title"}],columns:["Index","Role","Text"],func:async(e,n)=>{await p(e);const t=await v(e,n?.id);await e.goto(t,{waitUntil:"load",settleMs:2500});const i=await w(e);if(!Array.isArray(i)||i.length===0)throw new s("gemini detail",`No turns were visible after navigating to ${t}.`);return i.map((r,o)=>({Index:o+1,Role:r.Role||"System",Text:r.Text||""}))}});
|
package/clis/gemini/history.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as a,Strategy as m}from"@jackwener/opencli/registry";import{ArgumentError as c,EmptyResultError as l}from"@jackwener/opencli/errors";import{GEMINI_DOMAIN as p,ensureGeminiPage as d,getGeminiConversationList as u}from"./utils.js";function extractGeminiId(r){const i=String(r||"").trim();if(!i)return"";try{const s=new URL(i,"https://gemini.google.com").pathname.match(/^\/app\/([A-Za-z0-9_-]+)/);if(s)return s[1]}catch{}const t=i.replace(/^.*\/app\//,"").replace(/\/.*$/,"");return/^[A-Za-z0-9_-]+$/.test(t)?t:""}export const historyCommand=a({site:"gemini",name:"history",access:"read",description:"List visible Gemini web conversation history from the sidebar",domain:p,strategy:m.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[{name:"limit",type:"int",default:20,help:"Max conversations to show"}],columns:["Index","Id","Title","Url"],func:async(r,i)=>{const t=Number(i?.limit??20);if(!Number.isInteger(t)||t<1||t>200)throw new c("limit","must be a positive integer ≤ 200");await d(r);const n=await u(r);if(!n.length)throw new l("gemini history","No Gemini conversation links were visible in the sidebar. Open the sidebar and confirm at least one chat is listed under Recents.");return n.map((e)=>({id:extractGeminiId(e.Url),title:e.Title||"",url:e.Url||""})).filter((e)=>e.id).slice(0,t).map((e,o)=>({Index:o+1,Id:e.id,Title:e.title,Url:e.url}))}});export{extractGeminiId};
|
package/clis/gemini/image.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import*as f from"node:os";import*as p from"node:path";import{cli as
|
|
1
|
+
import*as f from"node:os";import*as p from"node:path";import{cli as F,Strategy as k}from"@jackwener/opencli/registry";import{saveBase64ToFile as v}from"@jackwener/opencli/utils";import{ArgumentError as D}from"@jackwener/opencli/errors";import{GEMINI_DOMAIN as M,exportGeminiImages as j,getGeminiVisibleImageUrls as z,sendGeminiMessage as C,startNewGeminiChat as N,waitForGeminiImages as O}from"./utils.js";function q(e){if(e.includes("png"))return".png";if(e.includes("webp"))return".webp";if(e.includes("gif"))return".gif";return".jpg"}function B(e){if(typeof e==="boolean")return e;const t=String(e??"").trim().toLowerCase();return t==="true"||t==="1"||t==="yes"||t==="on"}function E(e){const t=f.homedir();return e.startsWith(t)?`~${e.slice(t.length)}`:e}function R(e,t){const i=[];if(t.ratio)i.push(`aspect ratio ${t.ratio}`);if(t.style)i.push(`style ${t.style}`);if(i.length===0)return e;return`${e}
|
|
2
2
|
|
|
3
|
-
Image requirements: ${i.join(", ")}.`}function
|
|
3
|
+
Image requirements: ${i.join(", ")}.`}function U(e){const t=e.trim();return new Set(["1:1","16:9","9:16","4:3","3:4","3:2","2:3"]).has(t)?t:"1:1"}async function _(e){const t=await e.evaluate("window.location.href").catch(()=>"");return typeof t==="string"&&t?t:"https://gemini.google.com/app"}export const imageCommand=F({site:"gemini",name:"image",access:"write",description:"Generate images with Gemini web and save them locally",domain:M,strategy:k.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,defaultFormat:"plain",args:[{name:"prompt",fromFile:!0,positional:!0,required:!0,help:"Image prompt to send to Gemini"},{name:"rt",default:"1:1",help:"Ratio shorthand for aspect ratio (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3)"},{name:"st",default:"",help:"Style shorthand, e.g. anime, icon, watercolor"},{name:"op",default:"~/tmp/gemini-images",help:"Output directory shorthand"},{name:"sd",type:"boolean",default:!1,help:"Skip download shorthand; only show Gemini page link"},{name:"timeout",type:"int",required:!1,default:240,help:"Max seconds for the overall command (default: 240)"}],columns:["status","file","link"],func:async(e,t)=>{const i=t.prompt,d=U(String(t.rt??"1:1")),h=String(t.st??"").trim(),g=t.op||p.join(f.homedir(),"tmp","gemini-images"),s=t.timeout;if(!Number.isInteger(s)||s<1)throw new D("--timeout must be a positive integer (seconds)");const w=!0,a=t.sd,y=a===""||a===!0||B(a),b=R(i,{ratio:d,style:h||void 0});if(w)await N(e);const G=await z(e);await C(e,b);const l=await O(e,G,s),n=await _(e);if(!l.length)return[{status:"⚠️ no-images",file:"\uD83D\uDCC1 -",link:`\uD83D\uDD17 ${n}`}];if(y)return[{status:"\uD83C\uDFA8 generated",file:"\uD83D\uDCC1 -",link:`\uD83D\uDD17 ${n}`}];const o=await j(e,l);if(!o.length)return[{status:"⚠️ export-failed",file:"\uD83D\uDCC1 -",link:`\uD83D\uDD17 ${n}`}];const I=Date.now(),m=[];for(let r=0;r<o.length;r+=1){const u=o[r],x=u.dataUrl.replace(/^data:[^;]+;base64,/,""),S=o.length>1?`_${r+1}`:"",c=p.join(g,`gemini_${I}${S}${q(u.mimeType)}`);await v(x,c);m.push({status:"✅ saved",file:`\uD83D\uDCC1 ${E(c)}`,link:`\uD83D\uDD17 ${n}`})}return m}});
|
package/clis/gemini/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as n,Strategy as s}from"@jackwener/opencli/registry";import{GEMINI_DOMAIN as i,ensureGeminiPage as o,getGeminiPageState as r}from"./utils.js";export const statusCommand=n({site:"gemini",name:"status",access:"read",description:"Check Gemini web page availability and login state",domain:i,strategy:s.COOKIE,browser:!0,siteSession:"persistent",navigateBefore:!1,args:[],columns:["Status","Login","Url"],func:async(t)=>{await o(t);const e=await r(t),a=e.isSignedIn===!1?"No":"Yes";return[{Status:e.canSend?"Connected":"Page not ready",Login:a,Url:e.url||""}]}});
|
package/clis/gemini/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CommandExecutionError as
|
|
1
|
+
import{CommandExecutionError as g}from"@jackwener/opencli/errors";export const GEMINI_DOMAIN="gemini.google.com",GEMINI_APP_URL="https://gemini.google.com/app",GEMINI_DEEP_RESEARCH_DEFAULT_TOOL_LABELS=["Deep Research","Deep research","深度研究"],GEMINI_DEEP_RESEARCH_DEFAULT_CONFIRM_LABELS=["Start research","Start Research","Start deep research","Start Deep Research","Generate research plan","Generate Research Plan","Generate deep research plan","Generate Deep Research Plan","开始研究","开始深度研究","开始调研","生成研究计划","生成调研计划"];const F=[/Gemini can make mistakes\.?/gi,/Google Terms/gi,/Google Privacy Policy/gi,/Opens in a new window/gi],W=["gemini","我的内容","对话","google terms","google privacy policy"],v=['.ql-editor[contenteditable="true"]','.ql-editor[role="textbox"]','.ql-editor[aria-label*="Gemini"]','[contenteditable="true"][aria-label*="Gemini"]','[aria-label="Enter a prompt for Gemini"]','[aria-label*="prompt for Gemini"]'],C="data-opencli-gemini-composer",L=4,j=1;function y(e){return!!e&&typeof e==="object"&&!Array.isArray(e)}function x(e,t){if(y(e)&&Object.prototype.hasOwnProperty.call(e,"session")){if(Object.prototype.hasOwnProperty.call(e,"data"))return e.data;throw new g(`${t} returned a malformed Browser Bridge envelope`)}return e}function T(e,t){const n=x(e,t);if(!Array.isArray(n))throw new g(`${t} returned a malformed result`);return n}function E(e,t){const n=x(e,t);if(!y(n))throw new g(`${t} returned a malformed result`);return n}function w(){const e=JSON.stringify(v);return`
|
|
2
2
|
const isVisible = (el) => {
|
|
3
3
|
if (!(el instanceof HTMLElement)) return false;
|
|
4
4
|
const style = window.getComputedStyle(el);
|
|
@@ -7,7 +7,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
7
7
|
return rect.width > 0 && rect.height > 0;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
const markerAttr = ${JSON.stringify(
|
|
10
|
+
const markerAttr = ${JSON.stringify(C)};
|
|
11
11
|
const clearComposerMarkers = (active) => {
|
|
12
12
|
document.querySelectorAll('[' + markerAttr + ']').forEach((node) => {
|
|
13
13
|
if (node !== active) node.removeAttribute(markerAttr);
|
|
@@ -25,23 +25,23 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
25
25
|
const marked = document.querySelector('[' + markerAttr + '="1"]');
|
|
26
26
|
if (marked instanceof HTMLElement && isVisible(marked)) return marked;
|
|
27
27
|
|
|
28
|
-
const selectors = ${
|
|
28
|
+
const selectors = ${e};
|
|
29
29
|
for (const selector of selectors) {
|
|
30
30
|
const node = Array.from(document.querySelectorAll(selector)).find((candidate) => candidate instanceof HTMLElement && isVisible(candidate));
|
|
31
31
|
if (node instanceof HTMLElement) return markComposer(node);
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
34
34
|
};
|
|
35
|
-
`}export function resolveGeminiLabels(
|
|
35
|
+
`}export function resolveGeminiLabels(e,t){const n=String(e??"").trim();return n?[n]:t}export function parseGeminiTitleMatchMode(e,t="contains"){const n=String(e??t).trim().toLowerCase();if(n==="contains"||n==="exact")return n;return null}export function parseGeminiConversationUrl(e){const t=String(e??"").trim();if(!t)return null;try{const n=new URL(t);if(n.hostname!==GEMINI_DOMAIN&&!n.hostname.endsWith(`.${GEMINI_DOMAIN}`))return null;if(!n.pathname.startsWith("/app/"))return null;return n.href}catch{return null}}export function normalizeGeminiTitle(e){return e.replace(/\s+/g," ").trim().toLowerCase()}export function pickGeminiConversationByTitle(e,t,n="contains"){const r=normalizeGeminiTitle(t);if(!r)return null;for(const i of e){const o=normalizeGeminiTitle(i.Title);if(!o)continue;if(n==="exact"){if(o===r)return i;continue}if(o.includes(r))return i}return null}export function resolveGeminiConversationForQuery(e,t,n){const r=String(t??"").trim();if(!r)return e[0]??null;const i=pickGeminiConversationByTitle(e,r,"exact");if(i)return i;if(n==="contains")return pickGeminiConversationByTitle(e,r,"contains");return null}export function sanitizeGeminiResponseText(e,t){let n=e;for(const i of F)n=n.replace(i,"");n=n.trim();const r=t.trim();if(!r)return n;if(n===r)return"";for(const i of[`
|
|
36
36
|
|
|
37
37
|
`,`
|
|
38
38
|
`,`\r
|
|
39
39
|
\r
|
|
40
40
|
`,`\r
|
|
41
|
-
`]){const
|
|
42
|
-
`).trim()}export function collapseAdjacentGeminiTurns(
|
|
41
|
+
`]){const o=`${r}${i}`;if(n.startsWith(o))return n.slice(o.length).trim()}return n}export function collectGeminiTranscriptAdditions(e,t,n){const r=new Set(e);return t.filter((o)=>!r.has(o)).map((o)=>M(o,n)).filter((o)=>o&&o!==n).join(`
|
|
42
|
+
`).trim()}export function collapseAdjacentGeminiTurns(e){const t=[];for(const n of e){if(!n||typeof n.Role!=="string"||typeof n.Text!=="string")continue;const r=t.at(-1);if(r?.Role===n.Role&&r.Text===n.Text)continue;t.push(n)}return t}function A(e,t){if(e.length>t.length)return!1;return e.every((n,r)=>n.Role===t[r]?.Role&&n.Text===t[r]?.Text)}function K(e,t){if(!t)return null;for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r?.Role===t.Role&&r.Text===t.Text)return n}return null}function R(e,t){if(!e.structuredTurnsTrusted||!t.structuredTurnsTrusted)return{appendedTurns:[],hasTrustedAppend:!1,hasNewUserTurn:!1,hasNewAssistantTurn:!1};if(!A(e.turns,t.turns))return{appendedTurns:[],hasTrustedAppend:!1,hasNewUserTurn:!1,hasNewAssistantTurn:!1};const n=t.turns.slice(e.turns.length);return{appendedTurns:n,hasTrustedAppend:n.length>0,hasNewUserTurn:n.some((r)=>r.Role==="User"),hasNewAssistantTurn:n.some((r)=>r.Role==="Assistant")}}function k(e,t){const n=new Set(e.transcriptLines);return t.transcriptLines.filter((r)=>!n.has(r))}function J(e){const t=e.toLowerCase();return W.filter((r)=>t.includes(r)).length>=2}function M(e,t){const n=e.trim();if(!n)return"";const r=t.trim(),i=sanitizeGeminiResponseText(n,t);if(!r)return i;if(!n.includes(r))return i;if(i&&i!==r&&i!==n)return i;if(J(n))return"";if(n.startsWith(r)){const o=n.slice(r.length).replace(/^[\s::,,-]+/,"").trim();return o?sanitizeGeminiResponseText(o,""):""}return i}function Q(){return`
|
|
43
43
|
(() => {
|
|
44
|
-
${
|
|
44
|
+
${w()}
|
|
45
45
|
|
|
46
46
|
const signInNode = Array.from(document.querySelectorAll('a, button')).find((node) => {
|
|
47
47
|
const text = (node.textContent || '').trim().toLowerCase();
|
|
@@ -66,7 +66,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
66
66
|
})()
|
|
67
67
|
`}function G(){return`
|
|
68
68
|
(() => {
|
|
69
|
-
${
|
|
69
|
+
${w()}
|
|
70
70
|
const composer = findComposer();
|
|
71
71
|
const composerText = composer?.textContent?.replace(/\\u00a0/g, ' ').trim() || '';
|
|
72
72
|
const isGenerating = !!Array.from(document.querySelectorAll('button, [role="button"]')).find((node) => {
|
|
@@ -77,8 +77,8 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
77
77
|
|| text === '停止回答'
|
|
78
78
|
|| aria === '停止回答';
|
|
79
79
|
});
|
|
80
|
-
const turns = ${
|
|
81
|
-
const transcriptLines = ${
|
|
80
|
+
const turns = ${I().trim()};
|
|
81
|
+
const transcriptLines = ${D().trim()};
|
|
82
82
|
|
|
83
83
|
return {
|
|
84
84
|
url: window.location.href,
|
|
@@ -89,7 +89,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
89
89
|
structuredTurnsTrusted: turns.length > 0 || transcriptLines.length === 0,
|
|
90
90
|
};
|
|
91
91
|
})()
|
|
92
|
-
`}function
|
|
92
|
+
`}function U(e){try{const t=new URL(e);if(t.hostname!==GEMINI_DOMAIN&&!t.hostname.endsWith(`.${GEMINI_DOMAIN}`))return!1;const n=t.pathname.replace(/\/+$/,"");return n.startsWith("/app/")&&n!=="/app"}catch{return!1}}function D(){return`
|
|
93
93
|
(() => {
|
|
94
94
|
const clean = (value) => (value || '')
|
|
95
95
|
.replace(/\\u00a0/g, ' ')
|
|
@@ -161,7 +161,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
161
161
|
&& !stopLines.has(line)
|
|
162
162
|
&& !noisyPatterns.some((pattern) => pattern.test(line)));
|
|
163
163
|
})()
|
|
164
|
-
`}function
|
|
164
|
+
`}function I(){return`
|
|
165
165
|
(() => {
|
|
166
166
|
const clean = (value) => (value || '')
|
|
167
167
|
.replace(/\\u00a0/g, ' ')
|
|
@@ -217,9 +217,9 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
217
217
|
|
|
218
218
|
return turns;
|
|
219
219
|
})()
|
|
220
|
-
`}function
|
|
220
|
+
`}function X(){return`
|
|
221
221
|
(() => {
|
|
222
|
-
${
|
|
222
|
+
${w()}
|
|
223
223
|
const composer = findComposer();
|
|
224
224
|
|
|
225
225
|
if (!(composer instanceof HTMLElement)) {
|
|
@@ -248,18 +248,18 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
248
248
|
label: composer.getAttribute('aria-label') || '',
|
|
249
249
|
};
|
|
250
250
|
})()
|
|
251
|
-
`}function
|
|
251
|
+
`}function Z(){return`
|
|
252
252
|
(() => {
|
|
253
|
-
${
|
|
253
|
+
${w()}
|
|
254
254
|
const composer = findComposer();
|
|
255
255
|
|
|
256
256
|
return {
|
|
257
257
|
hasText: !!(composer && ((composer.textContent || '').trim() || (composer.innerText || '').trim())),
|
|
258
258
|
};
|
|
259
259
|
})()
|
|
260
|
-
`}function
|
|
260
|
+
`}function H(e){return`
|
|
261
261
|
((inputText) => {
|
|
262
|
-
${
|
|
262
|
+
${w()}
|
|
263
263
|
const composer = findComposer();
|
|
264
264
|
|
|
265
265
|
if (!(composer instanceof HTMLElement)) {
|
|
@@ -296,10 +296,10 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
296
296
|
return {
|
|
297
297
|
hasText: !!((composer.textContent || '').trim() || (composer.innerText || '').trim()),
|
|
298
298
|
};
|
|
299
|
-
})(${JSON.stringify(
|
|
300
|
-
`}function
|
|
299
|
+
})(${JSON.stringify(e)})
|
|
300
|
+
`}function q(){return`
|
|
301
301
|
(() => {
|
|
302
|
-
${
|
|
302
|
+
${w()}
|
|
303
303
|
const composer = findComposer();
|
|
304
304
|
|
|
305
305
|
if (!(composer instanceof HTMLElement)) {
|
|
@@ -364,9 +364,9 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
364
364
|
|
|
365
365
|
return 'enter';
|
|
366
366
|
})()
|
|
367
|
-
`}function
|
|
367
|
+
`}function N(){return`
|
|
368
368
|
(() => {
|
|
369
|
-
${
|
|
369
|
+
${w()}
|
|
370
370
|
const composer = findComposer();
|
|
371
371
|
|
|
372
372
|
if (!(composer instanceof HTMLElement)) {
|
|
@@ -378,7 +378,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
378
378
|
composer.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true }));
|
|
379
379
|
return 'enter';
|
|
380
380
|
})()
|
|
381
|
-
`}function
|
|
381
|
+
`}function z(){return`
|
|
382
382
|
(() => {
|
|
383
383
|
const isVisible = (el) => {
|
|
384
384
|
if (!(el instanceof HTMLElement)) return false;
|
|
@@ -408,7 +408,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
408
408
|
}
|
|
409
409
|
return 'navigate';
|
|
410
410
|
})()
|
|
411
|
-
`}function
|
|
411
|
+
`}function Y(){return`
|
|
412
412
|
(() => {
|
|
413
413
|
const labels = ['tools', 'tool', 'mode', '研究', 'deep research', 'deep-research', '工具'];
|
|
414
414
|
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim().toLowerCase();
|
|
@@ -500,7 +500,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
500
500
|
}
|
|
501
501
|
return false;
|
|
502
502
|
})()
|
|
503
|
-
`}function
|
|
503
|
+
`}function ee(e){return`
|
|
504
504
|
((targetLabels) => {
|
|
505
505
|
const isDisabled = (el) => {
|
|
506
506
|
if (!(el instanceof HTMLElement)) return true;
|
|
@@ -564,8 +564,8 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
return '';
|
|
567
|
-
})(${JSON.stringify(
|
|
568
|
-
`}function
|
|
567
|
+
})(${JSON.stringify(e)})
|
|
568
|
+
`}function te(e){return`
|
|
569
569
|
((targetLabels) => {
|
|
570
570
|
const isDisabled = (el) => {
|
|
571
571
|
if (!(el instanceof HTMLElement)) return true;
|
|
@@ -626,8 +626,8 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
626
626
|
}
|
|
627
627
|
|
|
628
628
|
return '';
|
|
629
|
-
})(${JSON.stringify(
|
|
630
|
-
`}function
|
|
629
|
+
})(${JSON.stringify(e)})
|
|
630
|
+
`}function ne(){return`
|
|
631
631
|
(() => {
|
|
632
632
|
const normalizeText = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
633
633
|
const clampText = (value, maxLength) => {
|
|
@@ -685,7 +685,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
685
685
|
|
|
686
686
|
return results;
|
|
687
687
|
})()
|
|
688
|
-
`}function
|
|
688
|
+
`}function P(){return`
|
|
689
689
|
(() => {
|
|
690
690
|
const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
691
691
|
const isVisible = (el) => {
|
|
@@ -731,7 +731,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
731
731
|
|
|
732
732
|
return changed;
|
|
733
733
|
})()
|
|
734
|
-
`}function
|
|
734
|
+
`}function re(e){const t=normalizeGeminiTitle(e);return`
|
|
735
735
|
((targetQuery) => {
|
|
736
736
|
const normalizeText = (value) => String(value || '').replace(/\\s+/g, ' ').trim().toLowerCase();
|
|
737
737
|
const isDisabled = (el) => {
|
|
@@ -766,9 +766,9 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
766
766
|
return true;
|
|
767
767
|
}
|
|
768
768
|
return false;
|
|
769
|
-
})(${JSON.stringify(
|
|
770
|
-
`}function
|
|
771
|
-
`).trim()}export async function readGeminiSnapshot(
|
|
769
|
+
})(${JSON.stringify(t)})
|
|
770
|
+
`}function O(){return"window.location.href"}export async function isOnGemini(e){const t=await e.evaluate(O()).catch(()=>"");if(typeof t!=="string"||!t)return!1;try{const n=new URL(t).hostname;return n===GEMINI_DOMAIN||n.endsWith(`.${GEMINI_DOMAIN}`)}catch{return!1}}export async function ensureGeminiPage(e){if(!await isOnGemini(e)){await e.goto(GEMINI_APP_URL,{waitUntil:"load",settleMs:2500});await e.wait(1)}}export async function getCurrentGeminiUrl(e){await ensureGeminiPage(e);const t=await e.evaluate(O()).catch(()=>"");if(typeof t==="string"&&t.trim())return t;return GEMINI_APP_URL}export async function openGeminiToolsMenu(e){await ensureGeminiPage(e);if(await e.evaluate(Y())){await e.wait(0.5);return!0}return!1}export async function selectGeminiTool(e,t){await ensureGeminiPage(e);await openGeminiToolsMenu(e);const n=await e.evaluate(ee(t));return typeof n==="string"?n:""}export async function waitForGeminiConfirmButton(e,t,n){await ensureGeminiPage(e);const r=1,i=Math.max(1,Math.ceil(n/r));for(let o=0;o<i;o+=1){await e.wait(o===0?0.5:r);const s=await e.evaluate(te(t));if(typeof s==="string"&&s)return s}return""}export async function getGeminiPageState(e){await ensureGeminiPage(e);return E(await e.evaluate(Q()),"Gemini status")}export async function startNewGeminiChat(e){await ensureGeminiPage(e);const t=await e.evaluate(z());if(t==="navigate")await e.goto(GEMINI_APP_URL,{waitUntil:"load",settleMs:2500});await e.wait(1);return t}export async function getGeminiConversationList(e){await ensureGeminiPage(e);let t=[];for(let n=0;n<3;n+=1){t=T(await e.evaluate(ne()),"Gemini conversation list").flatMap((s)=>{if(!y(s)||typeof s.title!=="string"||typeof s.url!=="string")throw new g("Gemini conversation list returned a malformed row");if(!U(s.url))return[];return{Title:s.title,Url:s.url}});if(t.length>0)break;const o=x(await e.evaluate(P()),"Gemini sidebar expand")===!0;await e.wait(n===0?1.2:0.6);if(!o&&n>0)break}return t}export async function clickGeminiConversationByTitle(e,t){await ensureGeminiPage(e);const n=normalizeGeminiTitle(t);if(!n)return!1;const r=await e.evaluate(re(n));if(r)await e.wait(1);return!!r}export async function getGeminiVisibleTurns(e){const t=await oe(e);if(Array.isArray(t)&&t.length>0)return t;return(await getGeminiTranscriptLines(e)).map((r)=>({Role:"System",Text:r}))}async function oe(e){await ensureGeminiPage(e);const t=T(await e.evaluate(I()),"Gemini visible turns");for(const r of t)if(!y(r)||typeof r.Role!=="string"||typeof r.Text!=="string")throw new g("Gemini visible turns returned a malformed row");const n=collapseAdjacentGeminiTurns(t);return Array.isArray(n)?n:[]}export async function getGeminiTranscriptLines(e){await ensureGeminiPage(e);const t=T(await e.evaluate(D()),"Gemini transcript lines");if(!t.every((n)=>typeof n==="string"))throw new g("Gemini transcript lines returned a malformed row");return t}export async function waitForGeminiTranscript(e,t=5){let n=[];for(let r=0;r<t;r+=1){n=await getGeminiTranscriptLines(e);if(n.length>0)return n;if(r<t-1)await e.wait(1)}return n}export async function getLatestGeminiAssistantResponse(e){await ensureGeminiPage(e);const n=[...await getGeminiVisibleTurns(e)].reverse().find((i)=>i.Role==="Assistant");if(n?.Text)return sanitizeGeminiResponseText(n.Text,"");return(await getGeminiTranscriptLines(e)).join(`
|
|
771
|
+
`).trim()}export async function readGeminiSnapshot(e){await ensureGeminiPage(e);const t=E(await e.evaluate(G()),"Gemini page snapshot");if(!Array.isArray(t.turns)||!Array.isArray(t.transcriptLines)||typeof t.composerHasText!=="boolean"||typeof t.isGenerating!=="boolean"||typeof t.structuredTurnsTrusted!=="boolean")throw new g("Gemini page snapshot returned a malformed result");return t}function ie(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]?.Role==="User")return t;return null}function S(e){const t=ie(e);return t===null?null:e[t]??null}export async function waitForGeminiSubmission(e,t,n){const r=t.turns.filter((o)=>o.Role==="Assistant").length,i=Math.max(1,Math.ceil(n));for(let o=0;o<i;o+=1){await e.wait(o===0?0.5:1);const s=await readGeminiSnapshot(e),u=R(t,s),l=k(t,s);if(u.hasTrustedAppend&&u.hasNewUserTurn)return{snapshot:s,preSendAssistantCount:r,userAnchorTurn:S(s.turns),reason:"user_turn"};if(!s.composerHasText&&s.isGenerating)return{snapshot:s,preSendAssistantCount:r,userAnchorTurn:S(s.turns),reason:"composer_generating"};const d=!s.url||U(String(s.url));if(!s.composerHasText&&l.length>0&&d)return{snapshot:s,preSendAssistantCount:r,userAnchorTurn:S(s.turns),reason:"composer_transcript"}}return null}export async function sendGeminiMessage(e,t){await ensureGeminiPage(e);let n;for(let o=0;o<L;o+=1){n=await e.evaluate(X());if(n?.ok)break;if(o<L-1)await e.wait(j)}if(!n?.ok)throw new g(n?.reason||"Could not find Gemini composer");let r=!1;if(e.nativeType)try{await e.nativeType(t);await e.wait(0.2);r=!!(await e.evaluate(Z()))?.hasText}catch{}if(!r)r=!!(await e.evaluate(H(t)))?.hasText;if(!r)throw new g("Failed to insert text into Gemini composer");if(await e.evaluate(q())==="button"){await e.wait(1);return"button"}if(e.nativeKeyPress)try{await e.nativeKeyPress("Enter")}catch{await e.evaluate(N())}else await e.evaluate(N());await e.wait(1);return"enter"}function se(e){if(!Array.isArray(e))return[];const t=new Set,n=[];for(const r of e){const i=String(r??"").trim();if(!i||t.has(i))continue;t.add(i);n.push(i)}return n}export function pickGeminiDeepResearchExportUrl(e,t){let n=-1/0,r="",i="none";const o={fetch:50,xhr:45,"fetch-body":72,"xhr-body":72,"fetch-body-docs-id":95,"xhr-body-docs-id":95,open:55,anchor:55,performance:35};for(const s of e){const u=s.match(/^([a-z-]+)::(.+)$/i),l=(u?.[1]??"performance").toLowerCase(),d=(u?.[2]??s).trim();if(!d)continue;let a=d,h=!1;if(d.startsWith("blob:"))h=!0;else try{a=new URL(d,t).href}catch{continue}if(!h)try{const V=new URL(a);if(!["http:","https:"].includes(V.protocol))continue}catch{continue}const c=/\.md(?:$|[?#])/i.test(a)||/markdown/i.test(a),f=/export|download|attachment|file|save-report/i.test(a),m=/docs\.google\.com\/document\//i.test(a),b=/docs\.google\.com\/spreadsheets\//i.test(a),_=/cspreport|allowlist|gen_204|telemetry|metrics|analytics|doubleclick|logging|collect|favicon/i.test(a);let p=o[l]??20;if(c)p+=45;if(f)p+=25;if(m)p+=100;if(b)p-=160;if(/gemini\.google\.com\/app\//i.test(a))p-=60;if(/googleapis\.com|gstatic\.com|doubleclick\.net|google-analytics/i.test(a))p-=40;if(!c&&!f&&!h)p-=40;if(_)p-=120;if(a===t)p-=80;if(h)p+=25;if(p>n){n=p;r=a;if(h)i="blob";else if(l==="open")i="window-open";else if(l==="anchor")i="anchor";else if(l==="performance")i="performance";else i="network"}}if(!r||n<60)return{url:"",source:"none"};return{url:r,source:i}}function ae(e){return`
|
|
772
772
|
(async () => {
|
|
773
773
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
774
774
|
const labels = {
|
|
@@ -1120,7 +1120,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
1120
1120
|
return { ok: false, step: 'export-docs', currentUrl: window.location.href, share, trace, urls: collectUrls() };
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
|
-
const deadline = Date.now() + ${Math.max(5000,Math.min(
|
|
1123
|
+
const deadline = Date.now() + ${Math.max(5000,Math.min(e,180000))};
|
|
1124
1124
|
while (Date.now() < deadline) {
|
|
1125
1125
|
const urls = collectUrls();
|
|
1126
1126
|
const hasDocsSignal = urls.some((value) => /docs\\.google\\.com\\/document\\//i.test(String(value || '')));
|
|
@@ -1137,7 +1137,7 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
1137
1137
|
|
|
1138
1138
|
return { ok: true, step: 'timeout', currentUrl: window.location.href, share, exportDocs: exportDocsBtn, trace, urls: collectUrls() };
|
|
1139
1139
|
})()
|
|
1140
|
-
`}function
|
|
1140
|
+
`}function B(e){if(!Array.isArray(e))return"";for(const t of e){if(!t||typeof t!=="object")continue;const n=String(t.url??"").trim();if(/^https:\/\/docs\.google\.com\/document\//i.test(n))return n}return""}export async function exportGeminiDeepResearchReport(e,t=120){await ensureGeminiPage(e);const n=Math.max(1,t)*1000,r=await e.tabs().catch(()=>[]),i=ae(n),o=await e.evaluate(i).catch(()=>null),s=await e.tabs().catch(()=>[]),u=B(s)||B(r);if(u)return{url:u,source:"tab"};const l=typeof o?.currentUrl==="string"&&/^https:\/\/docs\.google\.com\/document\//i.test(o.currentUrl)?o.currentUrl:"";if(l)return{url:l,source:"window-open"};const d=se(o?.urls),a=typeof o?.currentUrl==="string"&&o.currentUrl?o.currentUrl:await getCurrentGeminiUrl(e);return pickGeminiDeepResearchExportUrl(d,a)}export const __test__={GEMINI_COMPOSER_SELECTORS:v,GEMINI_COMPOSER_MARKER_ATTR:C,collapseAdjacentGeminiTurns,clickNewChatScript:z,diffTranscriptLines:k,diffTrustedStructuredTurns:R,hasGeminiTurnPrefix:A,readGeminiSnapshot,readGeminiSnapshotScript:G,expandGeminiRecentScript:P,submitComposerScript:q,insertComposerTextFallbackScript:H};export async function getGeminiVisibleImageUrls(e){await ensureGeminiPage(e);return await e.evaluate(`
|
|
1141
1141
|
(() => {
|
|
1142
1142
|
const isVisible = (el) => {
|
|
1143
1143
|
if (!(el instanceof HTMLElement)) return false;
|
|
@@ -1165,9 +1165,9 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
1165
1165
|
}
|
|
1166
1166
|
return urls;
|
|
1167
1167
|
})()
|
|
1168
|
-
`)}export async function waitForGeminiImages(
|
|
1169
|
-
`),
|
|
1170
|
-
`);if(
|
|
1168
|
+
`)}export async function waitForGeminiImages(e,t,n){const r=new Set(t),i=3,o=Math.max(1,Math.ceil(n/i));let s=[],u=0;for(let l=0;l<o;l+=1){await e.wait(l===0?2:i);const d=(await getGeminiVisibleImageUrls(e)).filter((c)=>!r.has(c));if(d.length===0)continue;const a=d.join(`
|
|
1169
|
+
`),h=s.join(`
|
|
1170
|
+
`);if(a==h)u+=1;else{s=d;u=1}if(u>=2||l===o-1)return s}return s}export async function exportGeminiImages(e,t){await ensureGeminiPage(e);const n=JSON.stringify(t);return await e.evaluate(`
|
|
1171
1171
|
(async (targetUrls) => {
|
|
1172
1172
|
const blobToDataUrl = (blob) => new Promise((resolve, reject) => {
|
|
1173
1173
|
const reader = new FileReader();
|
|
@@ -1229,6 +1229,6 @@ import{CommandExecutionError as P}from"@jackwener/opencli/errors";export const G
|
|
|
1229
1229
|
}
|
|
1230
1230
|
|
|
1231
1231
|
return results;
|
|
1232
|
-
})(${
|
|
1233
|
-
`)}export async function waitForGeminiResponse(
|
|
1234
|
-
`).trim(),
|
|
1232
|
+
})(${n})
|
|
1233
|
+
`)}export async function waitForGeminiResponse(e,t,n,r){if(r<=0)return"";const i=(c)=>{if(!c.structuredTurnsTrusted)return"";const f=K(c.turns,t.userAnchorTurn);if(f!==null){const m=c.turns.slice(f+1).filter((b)=>b.Role==="Assistant").at(-1);return m?sanitizeGeminiResponseText(m.Text,n):""}if(A(t.snapshot.turns,c.turns)){const m=c.turns.slice(t.snapshot.turns.length).filter((b)=>b.Role==="Assistant").at(-1);if(m)return sanitizeGeminiResponseText(m.Text,n)}return""},o=(c)=>c.transcriptLines.filter((f)=>!t.snapshot.transcriptLines.includes(f)).map((f)=>M(f,n)).filter(Boolean).join(`
|
|
1234
|
+
`).trim(),s=Math.max(1,Math.ceil(r/2));let u="",l=0,d="",a=0,h=0;for(let c=0;c<s;c+=1){await e.wait(c===0?1:2);const f=await readGeminiSnapshot(e),m=i(f);if(m){if(m===u)l+=1;else{u=m;l=1}if(!f.isGenerating&&l>=2)return m;continue}h+=1;if(h<2)continue;const b=o(f);if(!b)continue;if(b===d)a+=1;else{d=b;a=1}if(!f.isGenerating&&a>=2)return b}return""}
|
package/clis/geogebra/hexagon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as V}from"@jackwener/opencli/registry";import{CommandExecutionError as b}from"@jackwener/opencli/errors";import f from"node:os";import d from"node:path";import{ensureApplet as w,ggbEval as n,ggbListObjects as x,ggbWaitForObjectCount as y,normalizeNumber as j,requireGgbSuccess as c}from"./utils.js";m({site:"geogebra",name:"hexagon",access:"write",description:"Draw a regular hexagon centered at the origin",domain:"www.geogebra.org",strategy:V.PUBLIC,browser:!0,navigateBefore:!1,example:"ppcli geogebra hexagon --size 3",args:[{name:"size",required:!1,default:"2",help:"Radius of the hexagon (default: 2)"}],columns:["step","result"],func:async(o,p)=>{const e=j(p.size,"size",{defaultValue:2,positive:!0});await w(o);const s=[],l=[["V1",`(${e},0)`],["V2",`(${e}*cos(pi/3),${e}*sin(pi/3))`],["V3",`(${e}*cos(2*pi/3),${e}*sin(2*pi/3))`],["V4",`(-${e},0)`],["V5",`(${e}*cos(4*pi/3),${e}*sin(4*pi/3))`],["V6",`(${e}*cos(5*pi/3),${e}*sin(5*pi/3))`]];for(const[t,i]of l){const h=c(await n(o,`${t}=${i}`),`Failed to create point ${t}`);s.push({step:`${t}=${i}`,result:`ok (${h.label||t})`})}const g=c(await n(o,"Hexagon=Polygon(V1,V2,V3,V4,V5,V6)"),"Failed to create hexagon polygon");s.push({step:"Hexagon=Polygon(V1,V2,V3,V4,V5,V6)",result:`ok (${g.label||"hexagon created"})`});const u=await y(o,7),r=await x(o),a=d.join(f.tmpdir(),"opencli-geogebra-hexagon.png");try{await o.screenshot({path:a})}catch(t){throw new b(`Failed to capture GeoGebra screenshot: ${t?.message||t}`)}if(Array.isArray(r)&&r.length>0)s.push({step:`canvas has ${u} objects`,result:r.map((t)=>`${t.name}(${t.type})`).join(", ")});s.push({step:"screenshot",result:a});return s}});
|
package/clis/geogebra/info.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as b}from"@jackwener/opencli/registry";import{CommandExecutionError as n,EmptyResultError as u}from"@jackwener/opencli/errors";import{ensureApplet as f,ggbGetProperty as i,normalizeLabel as m,unwrapBridgeEnvelope as g}from"./utils.js";l({site:"geogebra",name:"info",access:"read",description:"Get detailed properties of a GeoGebra object",domain:"www.geogebra.org",strategy:b.PUBLIC,browser:!0,navigateBefore:!1,example:"ppcli geogebra info --name A",args:[{name:"name",required:!0,help:"Object label (e.g. A, c1, poly1)"}],columns:["property","value"],func:async(o,s)=>{const r=m(s.name,"name");await f(o);let e;try{e=g(await o.evaluate(`
|
|
2
2
|
(name => {
|
|
3
3
|
try {
|
|
4
4
|
if (typeof ggbApplet === 'undefined' || typeof ggbApplet.getObjectType !== 'function') {
|
|
@@ -9,5 +9,5 @@ import{cli as Q,Strategy as T}from"@jackwener/opencli/registry";import{CommandEx
|
|
|
9
9
|
return { error: err?.message || String(err) };
|
|
10
10
|
}
|
|
11
11
|
})
|
|
12
|
-
(${JSON.stringify(
|
|
13
|
-
`))}catch(
|
|
12
|
+
(${JSON.stringify(r)})
|
|
13
|
+
`))}catch(t){throw new n(`Failed to inspect GeoGebra object: ${t?.message||t}`)}if(!e||typeof e!=="object"||Array.isArray(e))throw new n("GeoGebra object existence probe returned malformed result");if(e.error)throw new n(`Failed to inspect GeoGebra object: ${e.error}`);if(e.ok!==!0||typeof e.exists!=="boolean")throw new n("GeoGebra object existence probe returned malformed result");if(e.exists===!1)throw new u(`geogebra info ${r}`,`Object "${r}" not found on the canvas.`);const c=["type","value","definition","command","caption","visible","color"],a=[];for(const t of c){const p=await i(o,r,t);a.push({property:t,value:String(p??"")})}if(await i(o,r,"type")==="point"){const t=await i(o,r,"xcoord"),p=await i(o,r,"ycoord");a.push({property:"x",value:String(t??"")});a.push({property:"y",value:String(p??"")})}return a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as h,Strategy as w}from"@jackwener/opencli/registry";import{CommandExecutionError as f}from"@jackwener/opencli/errors";import C from"node:os";import B from"node:path";import{ensureApplet as
|
|
1
|
+
import{cli as h,Strategy as w}from"@jackwener/opencli/registry";import{CommandExecutionError as f}from"@jackwener/opencli/errors";import C from"node:os";import B from"node:path";import{ensureApplet as A,ggbEval as r,ggbListObjects as y,ggbWaitForObjectCount as F,normalizeNumber as z,requireGgbSuccess as a}from"./utils.js";h({site:"geogebra",name:"triangle",access:"write",description:"Draw an equilateral triangle from a horizontal base segment",domain:"www.geogebra.org",strategy:w.PUBLIC,browser:!0,navigateBefore:!1,example:"ppcli geogebra triangle --size 4",args:[{name:"size",required:!1,default:"2",help:"Side length of the triangle (default: 2)"}],columns:["step","result"],func:async(e,l)=>{const o=z(l.size,"size",{defaultValue:2,positive:!0});await A(e);const t=[],c=a(await r(e,"A=(0,0)"),"Failed to create point A");t.push({step:"base point A=(0,0)",result:`ok (${c.label||"A"})`});const n=a(await r(e,`B=(${o},0)`),"Failed to create point B");t.push({step:`base point B=(${o},0)`,result:`ok (${n.label||"B"})`});const u=a(await r(e,"c=Circle(A,B)"),"Failed to create circle c");t.push({step:"c=Circle(A,B)",result:`ok (${u.label||"c"})`});const p=a(await r(e,"d=Circle(B,A)"),"Failed to create circle d");t.push({step:"d=Circle(B,A)",result:`ok (${p.label||"d"})`});const g=a(await r(e,"C=Intersect(c,d,1)"),"Failed to create point C");t.push({step:"C=Intersect(c,d,1)",result:`ok (${g.label||"C"})`});const m=a(await r(e,"Polygon(A,B,C)"),"Failed to create triangle polygon");t.push({step:"Polygon(A,B,C)",result:`ok (${m.label||"triangle created"})`});const b=await F(e,5),d=await y(e),i=B.join(C.tmpdir(),"opencli-geogebra-triangle.png");try{await e.screenshot({path:i})}catch(s){throw new f(`Failed to capture GeoGebra screenshot: ${s?.message||s}`)}t.push({step:`canvas has ${b} objects`,result:d.map((s)=>`${s.name}(${s.type})`).join(", ")});t.push({step:"screenshot",result:i});return t}});
|
package/clis/geogebra/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as l,CommandExecutionError as n}from"@jackwener/opencli/errors";const c="https://www.geogebra.org/geometry",p=15000;export function unwrapBridgeEnvelope(e){if(e&&typeof e==="object"&&"data"in e&&"session"in e)return e.data;return e}function m(e){return e&&typeof e==="object"&&!Array.isArray(e)}export function normalizeLabel(e,o="label"){const r=String(e??"").trim();if(!/^[A-Za-z][A-Za-z0-9_]*$/.test(r))throw new l(`${o} must be an ASCII GeoGebra label like A, B1, or poly_1`);return r}export function normalizeLabelList(e,o,r,t=1/0){const a=String(e??"").split(",").map((i)=>i.trim()).filter(Boolean);if(a.length<r||a.length>t)throw new l(`${o} must contain ${r===t?r:`${r}-${t}`} comma-separated labels`);return a.map((i,s)=>normalizeLabel(i,`${o}[${s+1}]`))}export function normalizeNumber(e,o,{defaultValue:r,positive:t=!1}={}){const a=e==null||e===""?r:e,i=Number(a);if(!Number.isFinite(i)||t&&i<=0)throw new l(`${o} must be a ${t?"positive ":""}finite number`);return i}export function normalizeCoords(e){const o=String(e??"").split(",").map((r)=>r.trim());if(o.length!==2)throw new l('coords must be in "x,y" format (e.g. "1,2")');return o.map((r,t)=>normalizeNumber(r,t===0?"x":"y"))}export function requireGgbSuccess(e,o){if(!m(e))throw new n(`${o}: malformed GeoGebra result`);if(!e.ok)throw new n(e.error||o);return e}export async function ensureApplet(e){let o="";try{o=await e.getCurrentUrl()}catch{o=""}if(o?.includes("geogebra.org/geometry"))try{if(unwrapBridgeEnvelope(await e.evaluate("typeof ggbApplet !== 'undefined' && typeof ggbApplet.evalCommand === 'function'")))return}catch(t){throw new n(`Failed to detect GeoGebra applet: ${t?.message||t}`)}try{await e.goto(c)}catch(t){throw new n(`Failed to load GeoGebra Geometry: ${t?.message||t}`)}let r;try{r=unwrapBridgeEnvelope(await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const deadline = Date.now() + ${
|
|
3
|
+
const deadline = Date.now() + ${p};
|
|
4
4
|
while (Date.now() < deadline) {
|
|
5
5
|
if (typeof ggbApplet !== 'undefined' && typeof ggbApplet.evalCommand === 'function') {
|
|
6
6
|
return true;
|
|
@@ -9,7 +9,7 @@ import{ArgumentError as Y,CommandExecutionError as J}from"@jackwener/opencli/err
|
|
|
9
9
|
}
|
|
10
10
|
return false;
|
|
11
11
|
})()
|
|
12
|
-
`))}catch(
|
|
12
|
+
`))}catch(t){throw new n(`Failed to detect GeoGebra applet: ${t?.message||t}`)}if(r!==!0)throw new n("ggbApplet not available after waiting. Make sure the GeoGebra Geometry page is fully loaded.")}export async function ggbEval(e,o){let r;try{r=unwrapBridgeEnvelope(await e.evaluate(`
|
|
13
13
|
(cmd => {
|
|
14
14
|
if (typeof ggbApplet === 'undefined' || typeof ggbApplet.evalCommandGetLabels !== 'function') {
|
|
15
15
|
return { ok: false, label: '', beforeCount: 0, afterCount: 0, error: 'ggbApplet is not ready' };
|
|
@@ -34,8 +34,8 @@ import{ArgumentError as Y,CommandExecutionError as J}from"@jackwener/opencli/err
|
|
|
34
34
|
afterCount,
|
|
35
35
|
error: dialogText || null,
|
|
36
36
|
};
|
|
37
|
-
})(${JSON.stringify(
|
|
38
|
-
`))}catch(
|
|
37
|
+
})(${JSON.stringify(o)})
|
|
38
|
+
`))}catch(t){throw new n(`Failed to execute GeoGebra command: ${t?.message||t}`)}if(!m(r)||typeof r.ok!=="boolean")throw new n("GeoGebra command returned malformed result");return r}export async function ggbListObjects(e,o){const r=o?String(o).toLowerCase():"";let t;try{t=unwrapBridgeEnvelope(await e.evaluate(`
|
|
39
39
|
(filterType => {
|
|
40
40
|
const api = ggbApplet;
|
|
41
41
|
let names = api.getAllObjectNames();
|
|
@@ -60,16 +60,16 @@ import{ArgumentError as Y,CommandExecutionError as J}from"@jackwener/opencli/err
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
return result;
|
|
63
|
-
})(${JSON.stringify(
|
|
64
|
-
`))}catch(
|
|
63
|
+
})(${JSON.stringify(r)})
|
|
64
|
+
`))}catch(a){throw new n(`Failed to list GeoGebra objects: ${a?.message||a}`)}if(t&&typeof t==="object"&&!Array.isArray(t)&&t.error){const a=t.name?` for ${t.name}`:"";throw new n(`Failed to list GeoGebra objects${a}: ${t.error}`)}if(!Array.isArray(t))throw new n("GeoGebra object list returned malformed result");return t}export async function ggbWaitForObjectCount(e,o,r=4000){const t=normalizeNumber(o,"minCount",{positive:!0}),a=normalizeNumber(r,"timeoutMs",{positive:!0});let i;try{i=unwrapBridgeEnvelope(await e.evaluate(`
|
|
65
65
|
(async () => {
|
|
66
|
-
const deadline = Date.now() + ${
|
|
66
|
+
const deadline = Date.now() + ${a};
|
|
67
67
|
while (Date.now() < deadline) {
|
|
68
68
|
let names = ggbApplet.getAllObjectNames();
|
|
69
69
|
if (typeof names === 'string') {
|
|
70
70
|
names = names.split(',').map(s => s.trim()).filter(Boolean);
|
|
71
71
|
}
|
|
72
|
-
if (Array.isArray(names) && names.length >= ${
|
|
72
|
+
if (Array.isArray(names) && names.length >= ${t}) {
|
|
73
73
|
return names.length;
|
|
74
74
|
}
|
|
75
75
|
await new Promise(resolve => setTimeout(resolve, 200));
|
|
@@ -80,7 +80,7 @@ import{ArgumentError as Y,CommandExecutionError as J}from"@jackwener/opencli/err
|
|
|
80
80
|
}
|
|
81
81
|
return Array.isArray(names) ? names.length : 0;
|
|
82
82
|
})()
|
|
83
|
-
`))}catch(
|
|
83
|
+
`))}catch(s){throw new n(`Failed waiting for GeoGebra object count: ${s?.message||s}`)}if(!Number.isFinite(Number(i)))throw new n("GeoGebra object count returned malformed result");return Number(i)}export async function ggbGetProperty(e,o,r){try{return unwrapBridgeEnvelope(await e.evaluate(`
|
|
84
84
|
(objName, property) => {
|
|
85
85
|
const api = ggbApplet;
|
|
86
86
|
switch (property) {
|
|
@@ -96,4 +96,4 @@ import{ArgumentError as Y,CommandExecutionError as J}from"@jackwener/opencli/err
|
|
|
96
96
|
default: return null;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
`,
|
|
99
|
+
`,o,r))}catch(t){throw new n(`Failed to read GeoGebra object property: ${t?.message||t}`)}}
|
package/clis/ghost/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as u}from"@jackwener/opencli/registry";import{TimeoutError as w}from"@jackwener/opencli/errors";import{gotoGhostAdmin as d,probeGhostSite as r,resolveGhostSite as m}from"./shared.js";const a=300;async function i(e){if(typeof e?.closeWindow!=="function")return;try{await e.closeWindow()}catch{}}l({site:"ghost",name:"login",access:"write",description:"打开指定 Ghost 自部署站点的后台登录页并等待登录完成。用 --site 选择连接名称或站点网址。",domain:"ghost.org",strategy:u.COOKIE,browser:!0,navigateBefore:!1,defaultWindowMode:"foreground",siteSession:"persistent",args:[{name:"site",help:"连接名称或站点网址;省略时使用默认站点"},{name:"site-url",help:"兼容旧版:Ghost 站点网址(推荐改用 --site)"},{name:"timeout",type:"int",default:a,help:"等待用户完成登录的最长秒数"}],columns:["status","logged_in","site","title","connection"],func:async(e,n)=>{const o=m(n);try{const t=await r(e,o);await i(e);return[{status:"already_logged_in",logged_in:!0,site:t.url??o.baseUrl,title:t.title,connection:o.name}]}catch(t){if(t?.code!=="AUTH_REQUIRED")throw t}await d(e,o.baseUrl);const s=Number(n.timeout??a),c=Date.now()+s*1000;while(Date.now()<c){await e.wait(2);try{const t=await r(e,o,{navigate:!1});await i(e);return[{status:"login_complete",logged_in:!0,site:t.url??o.baseUrl,title:t.title,connection:o.name}]}catch(t){if(t?.code!=="AUTH_REQUIRED")throw t}}await i(e);throw new w("ghost login",s,`请在打开的窗口里完成 ${o.baseUrl}/ghost/ 的登录后重试。`)}});
|
package/clis/ghost/shared.js
CHANGED
|
@@ -2,7 +2,7 @@ import{AuthRequiredError as f,CommandExecutionError as c}from"@jackwener/opencli
|
|
|
2
2
|
href: location.href,
|
|
3
3
|
onSignin: /\\/ghost\\/#\\/(?:signin|setup)/i.test(location.href)
|
|
4
4
|
|| !!document.querySelector('form[action*="signin"], input[type="email"]'),
|
|
5
|
-
}))()`)}export async function ghostPageRequest(t,e,s,o={}){const
|
|
5
|
+
}))()`)}export async function ghostPageRequest(t,e,s,o={}){const n=s.startsWith("/")?s:`/${s}`,u=`${e}/ghost/api/admin${n}`,a=o.method??"GET",r=await t.evaluate(`(async () => {
|
|
6
6
|
try {
|
|
7
7
|
const response = await fetch(${JSON.stringify(u)}, {
|
|
8
8
|
method: ${JSON.stringify(a)},
|
|
@@ -21,4 +21,4 @@ import{AuthRequiredError as f,CommandExecutionError as c}from"@jackwener/opencli
|
|
|
21
21
|
} catch (error) {
|
|
22
22
|
return { status: 0, ok: false, json: null, text: String(error && error.message || error) };
|
|
23
23
|
}
|
|
24
|
-
})()`),i=Number(
|
|
24
|
+
})()`),i=Number(r?.status??0);if(i===401||i===403)throw new f(e,`Ghost 登录态已失效(HTTP ${i});请重新登录该站点。`);if(!r?.ok){const l=(Array.isArray(r?.json?.errors)?r.json.errors[0]?.message:"")||r?.text?.slice(0,300)||"unknown error";throw new c(`Ghost ${a} ${n} 失败(HTTP ${i}):${l}`)}return r.json}export async function probeGhostSite(t,e,{navigate:s=!0}={}){if(s)await gotoGhostAdmin(t,e.baseUrl);const n=(await ghostPageRequest(t,e.baseUrl,"/site/"))?.site;if(!n?.title)throw new c("Ghost /site/ 响应缺少站点信息");return n}
|