publishport-opencli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +214 -0
- package/README.md +299 -0
- package/README.zh-CN.md +341 -0
- package/cli-manifest.json +51513 -0
- package/clis/12306/auth.js +25 -0
- package/clis/12306/me.js +9 -0
- package/clis/12306/orders.js +13 -0
- package/clis/12306/passengers.js +14 -0
- package/clis/12306/price.js +1 -0
- package/clis/12306/stations.js +1 -0
- package/clis/12306/train.js +1 -0
- package/clis/12306/trains.js +1 -0
- package/clis/12306/utils.js +1 -0
- package/clis/1688/assets.js +127 -0
- package/clis/1688/auth.js +1 -0
- package/clis/1688/download.js +1 -0
- package/clis/1688/item.js +21 -0
- package/clis/1688/search.js +129 -0
- package/clis/1688/shared.js +11 -0
- package/clis/1688/store.js +26 -0
- package/clis/1point3acres/auth.js +18 -0
- package/clis/1point3acres/digest.js +1 -0
- package/clis/1point3acres/forum.js +1 -0
- package/clis/1point3acres/forums.js +1 -0
- package/clis/1point3acres/hot.js +1 -0
- package/clis/1point3acres/latest.js +1 -0
- package/clis/1point3acres/notifications.js +1 -0
- package/clis/1point3acres/search.js +1 -0
- package/clis/1point3acres/thread.js +2 -0
- package/clis/1point3acres/user.js +1 -0
- package/clis/1point3acres/utils.js +6 -0
- package/clis/36kr/article.js +20 -0
- package/clis/36kr/hot.js +16 -0
- package/clis/36kr/news.js +1 -0
- package/clis/36kr/search.js +36 -0
- package/clis/51job/company.js +36 -0
- package/clis/51job/detail.js +35 -0
- package/clis/51job/hot.js +1 -0
- package/clis/51job/search.js +1 -0
- package/clis/51job/utils.js +21 -0
- package/clis/_atlassian/shared.js +21 -0
- package/clis/_shared/article/auth.js +16 -0
- package/clis/_shared/article/douban-md2draft.js +4 -0
- package/clis/_shared/article/format.js +1 -0
- package/clis/_shared/article/images.js +95 -0
- package/clis/_shared/article/login.js +1 -0
- package/clis/_shared/article/page-runtime.js +745 -0
- package/clis/_shared/article/publish.js +34 -0
- package/clis/_shared/common.js +1 -0
- package/clis/_shared/content-guard.js +1 -0
- package/clis/_shared/desktop-commands.js +1 -0
- package/clis/_shared/search-adapter.js +1 -0
- package/clis/_shared/site-auth.js +1 -0
- package/clis/_shared/token-auth.js +2 -0
- package/clis/_shared/video-publish.js +62 -0
- package/clis/aibase/news.js +31 -0
- package/clis/amazon/auth.js +19 -0
- package/clis/amazon/bestsellers.js +1 -0
- package/clis/amazon/discussion.js +20 -0
- package/clis/amazon/movers-shakers.js +1 -0
- package/clis/amazon/new-releases.js +1 -0
- package/clis/amazon/offer.js +29 -0
- package/clis/amazon/product.js +25 -0
- package/clis/amazon/rankings.js +68 -0
- package/clis/amazon/search.js +16 -0
- package/clis/amazon/shared.js +11 -0
- package/clis/antigravity/SKILL.md +38 -0
- package/clis/antigravity/_actions.js +201 -0
- package/clis/antigravity/audit-extras.js +78 -0
- package/clis/antigravity/delete.js +1 -0
- package/clis/antigravity/dump.js +1 -0
- package/clis/antigravity/extract-code.js +18 -0
- package/clis/antigravity/history.js +1 -0
- package/clis/antigravity/mark-read.js +1 -0
- package/clis/antigravity/model.js +90 -0
- package/clis/antigravity/new.js +9 -0
- package/clis/antigravity/read.js +10 -0
- package/clis/antigravity/rename.js +1 -0
- package/clis/antigravity/send.js +11 -0
- package/clis/antigravity/serve.js +97 -0
- package/clis/antigravity/status.js +1 -0
- package/clis/antigravity/storage.js +12 -0
- package/clis/antigravity/watch.js +6 -0
- package/clis/apple-podcasts/episodes.js +1 -0
- package/clis/apple-podcasts/search.js +1 -0
- package/clis/apple-podcasts/top.js +1 -0
- package/clis/apple-podcasts/utils.js +1 -0
- package/clis/archive/item.js +1 -0
- package/clis/archive/search.js +1 -0
- package/clis/archive/snapshots.js +1 -0
- package/clis/archive/wayback.js +1 -0
- package/clis/arxiv/author.js +1 -0
- package/clis/arxiv/paper.js +1 -0
- package/clis/arxiv/recent.js +1 -0
- package/clis/arxiv/search.js +1 -0
- package/clis/arxiv/utils.js +1 -0
- package/clis/autohome/__fixtures__/catalog.html +11 -0
- package/clis/autohome/__fixtures__/koubei.json +116 -0
- package/clis/autohome/brand.js +1 -0
- package/clis/autohome/score.js +1 -0
- package/clis/autohome/utils.js +1 -0
- package/clis/baidu-scholar/search.js +63 -0
- package/clis/baijiahao/article.js +1 -0
- package/clis/baijiahao/lists.js +1 -0
- package/clis/baijiahao/login.js +1 -0
- package/clis/baijiahao/publish.js +57 -0
- package/clis/baijiahao/stats.js +1 -0
- package/clis/baijiahao/whoami.js +1 -0
- package/clis/band/auth.js +29 -0
- package/clis/band/bands.js +37 -0
- package/clis/band/mentions.js +6 -0
- package/clis/band/post.js +76 -0
- package/clis/band/posts.js +50 -0
- package/clis/barchart/flow.js +70 -0
- package/clis/barchart/greeks.js +88 -0
- package/clis/barchart/options.js +61 -0
- package/clis/barchart/quote.js +87 -0
- package/clis/bbc/news.js +1 -0
- package/clis/bbc/topic.js +1 -0
- package/clis/bbc/utils.js +1 -0
- package/clis/bilibili/article.js +1 -0
- package/clis/bilibili/auth.js +1 -0
- package/clis/bilibili/categories.js +1 -0
- package/clis/bilibili/coin.js +1 -0
- package/clis/bilibili/comment-del.js +1 -0
- package/clis/bilibili/comment-like.js +1 -0
- package/clis/bilibili/comment.js +1 -0
- package/clis/bilibili/comments.js +1 -0
- package/clis/bilibili/dm-list.js +1 -0
- package/clis/bilibili/dm-read.js +1 -0
- package/clis/bilibili/dm-send.js +1 -0
- package/clis/bilibili/download.js +7 -0
- package/clis/bilibili/drafts.js +1 -0
- package/clis/bilibili/dynamic-post.js +24 -0
- package/clis/bilibili/dynamic.js +1 -0
- package/clis/bilibili/favorite-add.js +1 -0
- package/clis/bilibili/favorite.js +1 -0
- package/clis/bilibili/feed.js +2 -0
- package/clis/bilibili/follow.js +1 -0
- package/clis/bilibili/following.js +1 -0
- package/clis/bilibili/history.js +1 -0
- package/clis/bilibili/hot.js +15 -0
- package/clis/bilibili/like.js +1 -0
- package/clis/bilibili/me.js +1 -0
- package/clis/bilibili/partitions.js +1 -0
- package/clis/bilibili/ranking.js +1 -0
- package/clis/bilibili/search.js +1 -0
- package/clis/bilibili/stats.js +1 -0
- package/clis/bilibili/subtitle.js +21 -0
- package/clis/bilibili/summary.js +1 -0
- package/clis/bilibili/topics.js +1 -0
- package/clis/bilibili/unfollow.js +1 -0
- package/clis/bilibili/upload.js +1 -0
- package/clis/bilibili/user-videos.js +1 -0
- package/clis/bilibili/utils.js +50 -0
- package/clis/bilibili/video-drafts.js +1 -0
- package/clis/bilibili/video.js +1 -0
- package/clis/binance/asks.js +1 -0
- package/clis/binance/depth.js +1 -0
- package/clis/binance/gainers.js +1 -0
- package/clis/binance/klines.js +1 -0
- package/clis/binance/losers.js +1 -0
- package/clis/binance/pairs.js +1 -0
- package/clis/binance/price.js +1 -0
- package/clis/binance/prices.js +1 -0
- package/clis/binance/ticker.js +1 -0
- package/clis/binance/top.js +1 -0
- package/clis/binance/trades.js +1 -0
- package/clis/bloomberg/businessweek.js +12 -0
- package/clis/bloomberg/crypto.js +1 -0
- package/clis/bloomberg/economics.js +1 -0
- package/clis/bloomberg/feeds.js +1 -0
- package/clis/bloomberg/green.js +1 -0
- package/clis/bloomberg/industries.js +1 -0
- package/clis/bloomberg/main.js +1 -0
- package/clis/bloomberg/markets.js +1 -0
- package/clis/bloomberg/news.js +57 -0
- package/clis/bloomberg/opinions.js +1 -0
- package/clis/bloomberg/politics.js +1 -0
- package/clis/bloomberg/pursuits.js +1 -0
- package/clis/bloomberg/tech.js +1 -0
- package/clis/bloomberg/utils.js +17 -0
- package/clis/bluesky/post.js +1 -0
- package/clis/bluesky/shared.js +56 -0
- package/clis/bluesky/whoami.js +1 -0
- package/clis/booking/search.js +93 -0
- package/clis/boss/auth.js +13 -0
- package/clis/boss/batchgreet.js +1 -0
- package/clis/boss/chatlist.js +1 -0
- package/clis/boss/chatmsg.js +1 -0
- package/clis/boss/detail.js +1 -0
- package/clis/boss/exchange.js +1 -0
- package/clis/boss/greet.js +1 -0
- package/clis/boss/invite.js +4 -0
- package/clis/boss/joblist.js +1 -0
- package/clis/boss/mark.js +1 -0
- package/clis/boss/recommend.js +1 -0
- package/clis/boss/resume.js +90 -0
- package/clis/boss/search.js +1 -0
- package/clis/boss/send.js +1 -0
- package/clis/boss/stats.js +1 -0
- package/clis/boss/utils.js +161 -0
- package/clis/brave/search.js +23 -0
- package/clis/chaoxing/assignments.js +1 -0
- package/clis/chaoxing/auth.js +21 -0
- package/clis/chaoxing/exams.js +1 -0
- package/clis/chaoxing/utils.js +58 -0
- package/clis/chatgpt/ask.js +1 -0
- package/clis/chatgpt/auth.js +17 -0
- package/clis/chatgpt/detail.js +1 -0
- package/clis/chatgpt/history.js +1 -0
- package/clis/chatgpt/image.js +1 -0
- package/clis/chatgpt/model.js +1 -0
- package/clis/chatgpt/new.js +1 -0
- package/clis/chatgpt/project-file-add.js +1 -0
- package/clis/chatgpt/project-list.js +1 -0
- package/clis/chatgpt/read.js +1 -0
- package/clis/chatgpt/send.js +1 -0
- package/clis/chatgpt/status.js +1 -0
- package/clis/chatgpt/utils.js +1092 -0
- package/clis/chatgpt-app/ask.js +1 -0
- package/clis/chatgpt-app/ax.js +512 -0
- package/clis/chatgpt-app/model.js +1 -0
- package/clis/chatgpt-app/new.js +1 -0
- package/clis/chatgpt-app/read.js +1 -0
- package/clis/chatgpt-app/send.js +1 -0
- package/clis/chatgpt-app/status.js +1 -0
- package/clis/chatwise/ask.js +1 -0
- package/clis/chatwise/export.js +21 -0
- package/clis/chatwise/history.js +26 -0
- package/clis/chatwise/model.js +48 -0
- package/clis/chatwise/new.js +1 -0
- package/clis/chatwise/read.js +25 -0
- package/clis/chatwise/screenshot.js +1 -0
- package/clis/chatwise/send.js +1 -0
- package/clis/chatwise/status.js +1 -0
- package/clis/chatwise/utils.js +75 -0
- package/clis/chess/analyze.js +1 -0
- package/clis/chess/game.js +1 -0
- package/clis/chess/games.js +1 -0
- package/clis/chess/stats.js +1 -0
- package/clis/chess/utils.js +1 -0
- package/clis/claude/ask.js +4 -0
- package/clis/claude/auth.js +19 -0
- package/clis/claude/detail.js +1 -0
- package/clis/claude/history.js +1 -0
- package/clis/claude/new.js +1 -0
- package/clis/claude/read.js +1 -0
- package/clis/claude/send.js +1 -0
- package/clis/claude/status.js +1 -0
- package/clis/claude/utils.js +179 -0
- package/clis/cnblogs/article.js +1 -0
- package/clis/cnblogs/login.js +1 -0
- package/clis/cnblogs/stats.js +37 -0
- package/clis/cnblogs/whoami.js +1 -0
- package/clis/cnki/search.js +38 -0
- package/clis/codex/_actions.js +72 -0
- package/clis/codex/archive.js +1 -0
- package/clis/codex/ask.js +23 -0
- package/clis/codex/dump.js +1 -0
- package/clis/codex/export.js +12 -0
- package/clis/codex/extract-diff.js +28 -0
- package/clis/codex/history.js +1 -0
- package/clis/codex/model.js +118 -0
- package/clis/codex/new.js +1 -0
- package/clis/codex/pin.js +1 -0
- package/clis/codex/projects.js +1 -0
- package/clis/codex/read.js +16 -0
- package/clis/codex/rename.js +34 -0
- package/clis/codex/screenshot.js +1 -0
- package/clis/codex/send.js +16 -0
- package/clis/codex/sidebar.js +1 -0
- package/clis/codex/status.js +1 -0
- package/clis/coingecko/categories.js +1 -0
- package/clis/coingecko/coin.js +1 -0
- package/clis/coingecko/derivatives.js +1 -0
- package/clis/coingecko/exchanges.js +1 -0
- package/clis/coingecko/global.js +1 -0
- package/clis/coingecko/top.js +1 -0
- package/clis/coingecko/trending.js +1 -0
- package/clis/confluence/create.js +1 -0
- package/clis/confluence/page.js +1 -0
- package/clis/confluence/search.js +1 -0
- package/clis/confluence/shared.js +1 -0
- package/clis/confluence/update.js +1 -0
- package/clis/coupang/add-to-cart.js +86 -0
- package/clis/coupang/auth.js +16 -0
- package/clis/coupang/product.js +161 -0
- package/clis/coupang/search.js +385 -0
- package/clis/coupang/utils.js +1 -0
- package/clis/crates/crate.js +1 -0
- package/clis/crates/search.js +1 -0
- package/clis/crates/utils.js +1 -0
- package/clis/csdn/article.js +29 -0
- package/clis/csdn/columns.js +1 -0
- package/clis/csdn/login.js +1 -0
- package/clis/csdn/stats.js +71 -0
- package/clis/csdn/whoami.js +1 -0
- package/clis/cto51/article.js +1 -0
- package/clis/cto51/whoami.js +1 -0
- package/clis/ctrip/auth.js +1 -0
- package/clis/ctrip/flight.js +17 -0
- package/clis/ctrip/hotel-search.js +24 -0
- package/clis/ctrip/hotel-suggest.js +1 -0
- package/clis/ctrip/search.js +1 -0
- package/clis/ctrip/utils.js +119 -0
- package/clis/cursor/ask.js +22 -0
- package/clis/cursor/composer.js +12 -0
- package/clis/cursor/dump.js +1 -0
- package/clis/cursor/export.js +23 -0
- package/clis/cursor/extract-code.js +18 -0
- package/clis/cursor/history.js +26 -0
- package/clis/cursor/model.js +18 -0
- package/clis/cursor/new.js +1 -0
- package/clis/cursor/read.js +27 -0
- package/clis/cursor/screenshot.js +1 -0
- package/clis/cursor/send.js +12 -0
- package/clis/cursor/status.js +1 -0
- package/clis/dblp/author.js +1 -0
- package/clis/dblp/paper.js +1 -0
- package/clis/dblp/search.js +1 -0
- package/clis/dblp/utils.js +1 -0
- package/clis/dblp/venue.js +1 -0
- package/clis/deepseek/ask.js +1 -0
- package/clis/deepseek/auth.js +22 -0
- package/clis/deepseek/detail.js +1 -0
- package/clis/deepseek/history.js +1 -0
- package/clis/deepseek/new.js +1 -0
- package/clis/deepseek/read.js +1 -0
- package/clis/deepseek/send.js +50 -0
- package/clis/deepseek/status.js +1 -0
- package/clis/deepseek/utils.js +202 -0
- package/clis/defillama/protocol.js +1 -0
- package/clis/defillama/protocols.js +1 -0
- package/clis/defillama/utils.js +1 -0
- package/clis/devto/auth.js +9 -0
- package/clis/devto/latest.js +1 -0
- package/clis/devto/publish.js +17 -0
- package/clis/devto/read.js +3 -0
- package/clis/devto/stats.js +27 -0
- package/clis/devto/tag.js +1 -0
- package/clis/devto/top.js +1 -0
- package/clis/devto/user.js +1 -0
- package/clis/dianping/__fixtures__/search.html +168 -0
- package/clis/dianping/__fixtures__/shop.html +6 -0
- package/clis/dianping/auth.js +10 -0
- package/clis/dianping/cityResolver.js +4 -0
- package/clis/dianping/search.js +1 -0
- package/clis/dianping/shop.js +1 -0
- package/clis/dianping/utils.js +1 -0
- package/clis/dictionary/examples.js +1 -0
- package/clis/dictionary/search.js +1 -0
- package/clis/dictionary/synonyms.js +1 -0
- package/clis/discord-app/channels.js +1 -0
- package/clis/discord-app/delete.js +66 -0
- package/clis/discord-app/goto.js +1 -0
- package/clis/discord-app/members.js +21 -0
- package/clis/discord-app/read.js +1 -0
- package/clis/discord-app/search.js +29 -0
- package/clis/discord-app/send.js +10 -0
- package/clis/discord-app/servers.js +1 -0
- package/clis/discord-app/status.js +1 -0
- package/clis/discord-app/thread-read.js +1 -0
- package/clis/discord-app/threads.js +1 -0
- package/clis/discord-app/utils.js +226 -0
- package/clis/discord-web/auth.js +10 -0
- package/clis/discord-web/send.js +13 -0
- package/clis/dockerhub/image.js +1 -0
- package/clis/dockerhub/search.js +1 -0
- package/clis/dockerhub/utils.js +1 -0
- package/clis/dongchedi/__fixtures__/search.json +60 -0
- package/clis/dongchedi/__fixtures__/series-detail.json +911 -0
- package/clis/dongchedi/__fixtures__/series-score.json +1396 -0
- package/clis/dongchedi/koubei.js +1 -0
- package/clis/dongchedi/models.js +1 -0
- package/clis/dongchedi/score.js +1 -0
- package/clis/dongchedi/search.js +1 -0
- package/clis/dongchedi/series.js +1 -0
- package/clis/dongchedi/specs.js +1 -0
- package/clis/dongchedi/utils.js +1 -0
- package/clis/douban/article.js +53 -0
- package/clis/douban/auth.js +21 -0
- package/clis/douban/book-hot.js +1 -0
- package/clis/douban/download.js +1 -0
- package/clis/douban/marks.js +59 -0
- package/clis/douban/movie-hot.js +1 -0
- package/clis/douban/photos.js +1 -0
- package/clis/douban/reviews.js +53 -0
- package/clis/douban/search.js +1 -0
- package/clis/douban/subject.js +1 -0
- package/clis/douban/top250.js +50 -0
- package/clis/douban/utils.js +344 -0
- package/clis/doubao/ask.js +1 -0
- package/clis/doubao/auth.js +28 -0
- package/clis/doubao/detail.js +1 -0
- package/clis/doubao/history.js +1 -0
- package/clis/doubao/meeting-summary.js +1 -0
- package/clis/doubao/meeting-transcript.js +1 -0
- package/clis/doubao/new.js +1 -0
- package/clis/doubao/read.js +1 -0
- package/clis/doubao/send.js +1 -0
- package/clis/doubao/status.js +1 -0
- package/clis/doubao/utils.js +704 -0
- package/clis/doubao-app/ask.js +1 -0
- package/clis/doubao-app/dump.js +1 -0
- package/clis/doubao-app/new.js +1 -0
- package/clis/doubao-app/read.js +1 -0
- package/clis/doubao-app/screenshot.js +1 -0
- package/clis/doubao-app/send.js +1 -0
- package/clis/doubao-app/status.js +1 -0
- package/clis/doubao-app/utils.js +64 -0
- package/clis/douyin/_shared/browser-fetch.js +28 -0
- package/clis/douyin/_shared/creation-id.js +1 -0
- package/clis/douyin/_shared/evaluate-result.js +1 -0
- package/clis/douyin/_shared/imagex-upload.js +1 -0
- package/clis/douyin/_shared/public-api.js +1 -0
- package/clis/douyin/_shared/sts2.js +1 -0
- package/clis/douyin/_shared/text-extra.js +1 -0
- package/clis/douyin/_shared/timing.js +1 -0
- package/clis/douyin/_shared/tos-upload.js +5 -0
- package/clis/douyin/_shared/transcode.js +1 -0
- package/clis/douyin/_shared/types.js +1 -0
- package/clis/douyin/_shared/vod-upload.js +5 -0
- package/clis/douyin/activities.js +1 -0
- package/clis/douyin/auth.js +1 -0
- package/clis/douyin/collections.js +1 -0
- package/clis/douyin/delete.js +76 -0
- package/clis/douyin/draft.js +166 -0
- package/clis/douyin/drafts.js +1 -0
- package/clis/douyin/hashtag.js +1 -0
- package/clis/douyin/location.js +1 -0
- package/clis/douyin/profile.js +1 -0
- package/clis/douyin/publish-image.js +64 -0
- package/clis/douyin/publish.js +14 -0
- package/clis/douyin/search.js +51 -0
- package/clis/douyin/stats.js +1 -0
- package/clis/douyin/update.js +1 -0
- package/clis/douyin/user-videos.js +1 -0
- package/clis/douyin/videos.js +1 -0
- package/clis/duckduckgo/search.js +1 -0
- package/clis/duckduckgo/suggest.js +1 -0
- package/clis/eastmoney/_secid.js +1 -0
- package/clis/eastmoney/announcement.js +1 -0
- package/clis/eastmoney/article.js +1 -0
- package/clis/eastmoney/convertible.js +1 -0
- package/clis/eastmoney/etf.js +1 -0
- package/clis/eastmoney/holders.js +1 -0
- package/clis/eastmoney/hot-rank.js +30 -0
- package/clis/eastmoney/index-board.js +1 -0
- package/clis/eastmoney/kline.js +1 -0
- package/clis/eastmoney/kuaixun.js +1 -0
- package/clis/eastmoney/longhu.js +1 -0
- package/clis/eastmoney/money-flow.js +1 -0
- package/clis/eastmoney/northbound.js +1 -0
- package/clis/eastmoney/quote.js +1 -0
- package/clis/eastmoney/rank.js +1 -0
- package/clis/eastmoney/sectors.js +1 -0
- package/clis/eastmoney/whoami.js +1 -0
- package/clis/endoflife/product.js +1 -0
- package/clis/endoflife/utils.js +1 -0
- package/clis/facebook/__fixtures__/notifications-page.html +13 -0
- package/clis/facebook/add-friend.js +24 -0
- package/clis/facebook/auth.js +1 -0
- package/clis/facebook/comment.js +18 -0
- package/clis/facebook/events.js +26 -0
- package/clis/facebook/feed.js +209 -0
- package/clis/facebook/friends.js +24 -0
- package/clis/facebook/groups.js +32 -0
- package/clis/facebook/join-group.js +25 -0
- package/clis/facebook/like.js +29 -0
- package/clis/facebook/marketplace-inbox.js +34 -0
- package/clis/facebook/marketplace-listings.js +33 -0
- package/clis/facebook/memories.js +21 -0
- package/clis/facebook/notifications.js +31 -0
- package/clis/facebook/post.js +88 -0
- package/clis/facebook/profile.js +18 -0
- package/clis/facebook/search.js +22 -0
- package/clis/flathub/app.js +1 -0
- package/clis/flathub/search.js +1 -0
- package/clis/flathub/utils.js +1 -0
- package/clis/flomo/auth.js +22 -0
- package/clis/flomo/memos.js +13 -0
- package/clis/gemini/ask.js +1 -0
- package/clis/gemini/auth.js +14 -0
- package/clis/gemini/deep-research-result.js +4 -0
- package/clis/gemini/deep-research.js +1 -0
- package/clis/gemini/detail.js +1 -0
- package/clis/gemini/history.js +1 -0
- package/clis/gemini/image.js +3 -0
- package/clis/gemini/new.js +1 -0
- package/clis/gemini/read.js +1 -0
- package/clis/gemini/status.js +1 -0
- package/clis/gemini/utils.js +1234 -0
- package/clis/geogebra/add-circle.js +1 -0
- package/clis/geogebra/add-line.js +1 -0
- package/clis/geogebra/add-point.js +1 -0
- package/clis/geogebra/add-polygon.js +1 -0
- package/clis/geogebra/eval.js +1 -0
- package/clis/geogebra/hexagon.js +1 -0
- package/clis/geogebra/info.js +13 -0
- package/clis/geogebra/list.js +1 -0
- package/clis/geogebra/triangle.js +1 -0
- package/clis/geogebra/utils.js +99 -0
- package/clis/ghost/publish.js +1 -0
- package/clis/ghost/shared.js +1 -0
- package/clis/ghost/whoami.js +1 -0
- package/clis/gitee/auth.js +12 -0
- package/clis/gitee/index.js +1 -0
- package/clis/gitee/search.js +1 -0
- package/clis/gitee/trending.js +240 -0
- package/clis/gitee/user.js +71 -0
- package/clis/github/auth.js +7 -0
- package/clis/github-trending/repos.js +1 -0
- package/clis/google/news.js +1 -0
- package/clis/google/search.js +90 -0
- package/clis/google/suggest.js +1 -0
- package/clis/google/trends.js +1 -0
- package/clis/google/utils.js +1 -0
- package/clis/google-scholar/cite.js +20 -0
- package/clis/google-scholar/profile.js +36 -0
- package/clis/google-scholar/search.js +35 -0
- package/clis/goproxy/module.js +1 -0
- package/clis/goproxy/utils.js +1 -0
- package/clis/goproxy/versions.js +1 -0
- package/clis/gov-law/recent.js +1 -0
- package/clis/gov-law/search.js +14 -0
- package/clis/gov-law/shared.js +29 -0
- package/clis/gov-policy/__fixtures__/recent.html +16 -0
- package/clis/gov-policy/__fixtures__/search.html +41 -0
- package/clis/gov-policy/recent.js +8 -0
- package/clis/gov-policy/search.js +8 -0
- package/clis/gov-policy/utils.js +1 -0
- package/clis/grok/ask.js +1 -0
- package/clis/grok/auth.js +17 -0
- package/clis/grok/delete.js +1 -0
- package/clis/grok/detail.js +1 -0
- package/clis/grok/export-all.js +170 -0
- package/clis/grok/export-utils.js +1 -0
- package/clis/grok/export.js +106 -0
- package/clis/grok/history.js +1 -0
- package/clis/grok/image.js +119 -0
- package/clis/grok/image.test.ts +127 -0
- package/clis/grok/new.js +1 -0
- package/clis/grok/pin.js +1 -0
- package/clis/grok/read.js +1 -0
- package/clis/grok/send.js +1 -0
- package/clis/grok/status.js +1 -0
- package/clis/grok/utils.js +337 -0
- package/clis/guazi/__fixtures__/detail.html +7 -0
- package/clis/guazi/__fixtures__/list.html +5 -0
- package/clis/guazi/browse.js +1 -0
- package/clis/guazi/car.js +1 -0
- package/clis/guazi/utils.js +1 -0
- package/clis/hackernews/ask.js +1 -0
- package/clis/hackernews/auth.js +9 -0
- package/clis/hackernews/best.js +1 -0
- package/clis/hackernews/comment.js +61 -0
- package/clis/hackernews/jobs.js +1 -0
- package/clis/hackernews/new.js +1 -0
- package/clis/hackernews/read.js +11 -0
- package/clis/hackernews/search.js +1 -0
- package/clis/hackernews/show.js +1 -0
- package/clis/hackernews/submit.js +65 -0
- package/clis/hackernews/top.js +1 -0
- package/clis/hackernews/user.js +1 -0
- package/clis/hashnode/auth.js +11 -0
- package/clis/hashnode/publish.js +92 -0
- package/clis/hf/auth.js +12 -0
- package/clis/hf/datasets.js +1 -0
- package/clis/hf/models.js +1 -0
- package/clis/hf/paper.js +1 -0
- package/clis/hf/spaces.js +1 -0
- package/clis/hf/top.js +1 -0
- package/clis/homebrew/cask.js +1 -0
- package/clis/homebrew/formula.js +1 -0
- package/clis/homebrew/popular.js +1 -0
- package/clis/homebrew/utils.js +1 -0
- package/clis/huodongxing/events.js +1 -0
- package/clis/hupu/__fixtures__/hot-home.html +64 -0
- package/clis/hupu/auth.js +14 -0
- package/clis/hupu/detail.js +7 -0
- package/clis/hupu/hot.js +14 -0
- package/clis/hupu/like.js +1 -0
- package/clis/hupu/mentions.js +91 -0
- package/clis/hupu/reply.js +1 -0
- package/clis/hupu/search.js +1 -0
- package/clis/hupu/unlike.js +1 -0
- package/clis/hupu/utils.js +243 -0
- package/clis/imdb/person.js +140 -0
- package/clis/imdb/reviews.js +40 -0
- package/clis/imdb/search.js +113 -0
- package/clis/imdb/title.js +1 -0
- package/clis/imdb/top.js +1 -0
- package/clis/imdb/trending.js +1 -0
- package/clis/imdb/utils.js +162 -0
- package/clis/imooc/article.js +59 -0
- package/clis/imooc/login.js +1 -0
- package/clis/imooc/whoami.js +1 -0
- package/clis/indeed/job.js +20 -0
- package/clis/indeed/search.js +37 -0
- package/clis/indeed/utils.js +1 -0
- package/clis/infoq/article.js +19 -0
- package/clis/infoq/login.js +1 -0
- package/clis/infoq/whoami.js +1 -0
- package/clis/instagram/_shared/private-publish.js +75 -0
- package/clis/instagram/_shared/protocol-capture.js +180 -0
- package/clis/instagram/_shared/runtime-info.js +33 -0
- package/clis/instagram/auth.js +22 -0
- package/clis/instagram/collection-create.js +38 -0
- package/clis/instagram/collection-delete.js +72 -0
- package/clis/instagram/comment.js +26 -0
- package/clis/instagram/detail.js +2 -0
- package/clis/instagram/download.js +83 -0
- package/clis/instagram/explore.js +27 -0
- package/clis/instagram/follow.js +24 -0
- package/clis/instagram/followers.js +30 -0
- package/clis/instagram/following.js +74 -0
- package/clis/instagram/like.js +25 -0
- package/clis/instagram/note.js +162 -0
- package/clis/instagram/post.js +718 -0
- package/clis/instagram/profile.js +25 -0
- package/clis/instagram/reel.js +452 -0
- package/clis/instagram/save.js +25 -0
- package/clis/instagram/saved.js +37 -0
- package/clis/instagram/search.js +23 -0
- package/clis/instagram/story.js +21 -0
- package/clis/instagram/unfollow.js +21 -0
- package/clis/instagram/unlike.js +25 -0
- package/clis/instagram/unsave.js +25 -0
- package/clis/instagram/user.js +1 -0
- package/clis/jd/add-cart.js +22 -0
- package/clis/jd/auth.js +12 -0
- package/clis/jd/cart.js +59 -0
- package/clis/jd/detail.js +42 -0
- package/clis/jd/item.js +98 -0
- package/clis/jd/item.test.ts +517 -0
- package/clis/jd/reviews.js +31 -0
- package/clis/jd/search.js +42 -0
- package/clis/jianshu/article.js +1 -0
- package/clis/jianshu/login.js +1 -0
- package/clis/jianshu/notebooks.js +1 -0
- package/clis/jianshu/whoami.js +1 -0
- package/clis/jianyu/auth.js +28 -0
- package/clis/jianyu/detail.js +1 -0
- package/clis/jianyu/search.js +73 -0
- package/clis/jianyu/shared/china-bid-search.js +86 -0
- package/clis/jianyu/shared/procurement-contract.js +1 -0
- package/clis/jianyu/shared/procurement-detail.js +18 -0
- package/clis/jike/auth.js +19 -0
- package/clis/jike/comment.js +82 -0
- package/clis/jike/create.js +83 -0
- package/clis/jike/feed.js +32 -0
- package/clis/jike/like.js +38 -0
- package/clis/jike/notifications.js +115 -0
- package/clis/jike/post.js +33 -0
- package/clis/jike/repost.js +67 -0
- package/clis/jike/search.js +29 -0
- package/clis/jike/topic.js +20 -0
- package/clis/jike/user.js +19 -0
- package/clis/jike/utils.js +15 -0
- package/clis/jimeng/auth.js +13 -0
- package/clis/jimeng/generate.js +60 -0
- package/clis/jimeng/history.js +32 -0
- package/clis/jimeng/new.js +26 -0
- package/clis/jimeng/workspaces.js +22 -0
- package/clis/jira/attachments.js +1 -0
- package/clis/jira/comments.js +1 -0
- package/clis/jira/issue.js +1 -0
- package/clis/jira/links.js +1 -0
- package/clis/jira/search.js +1 -0
- package/clis/jira/shared.js +1 -0
- package/clis/juejin/article.js +5 -0
- package/clis/juejin/categories.js +1 -0
- package/clis/juejin/hot.js +1 -0
- package/clis/juejin/login.js +1 -0
- package/clis/juejin/recommend.js +1 -0
- package/clis/juejin/stats.js +53 -0
- package/clis/juejin/tags.js +1 -0
- package/clis/juejin/utils.js +1 -0
- package/clis/juejin/whoami.js +1 -0
- package/clis/ke/auth.js +14 -0
- package/clis/ke/chengjiao.js +45 -0
- package/clis/ke/ershoufang.js +50 -0
- package/clis/ke/utils.js +21 -0
- package/clis/ke/xiaoqu.js +45 -0
- package/clis/ke/zufang.js +50 -0
- package/clis/kimi/_utils.js +38 -0
- package/clis/kimi/audit-extras.js +64 -0
- package/clis/kimi/auth.js +17 -0
- package/clis/kimi/chat.js +77 -0
- package/clis/kimi/storage.js +14 -0
- package/clis/kimi/ui.js +89 -0
- package/clis/kimi/usage.js +51 -0
- package/clis/kuaishou/auth.js +1 -0
- package/clis/kuaishou/publish.js +53 -0
- package/clis/lesswrong/_helpers.js +9 -0
- package/clis/lesswrong/comments.js +9 -0
- package/clis/lesswrong/curated.js +5 -0
- package/clis/lesswrong/frontpage.js +5 -0
- package/clis/lesswrong/new.js +5 -0
- package/clis/lesswrong/read.js +5 -0
- package/clis/lesswrong/sequences.js +5 -0
- package/clis/lesswrong/shortform.js +5 -0
- package/clis/lesswrong/tag.js +5 -0
- package/clis/lesswrong/tags.js +5 -0
- package/clis/lesswrong/top-month.js +5 -0
- package/clis/lesswrong/top-week.js +5 -0
- package/clis/lesswrong/top-year.js +5 -0
- package/clis/lesswrong/top.js +5 -0
- package/clis/lesswrong/user-posts.js +5 -0
- package/clis/lesswrong/user.js +5 -0
- package/clis/lichess/top.js +1 -0
- package/clis/lichess/user.js +1 -0
- package/clis/lichess/utils.js +1 -0
- package/clis/linkedin/auth.js +27 -0
- package/clis/linkedin/comment.js +1 -0
- package/clis/linkedin/connect.js +244 -0
- package/clis/linkedin/create.js +113 -0
- package/clis/linkedin/follow.js +1 -0
- package/clis/linkedin/inbox.js +1 -0
- package/clis/linkedin/job-detail.js +40 -0
- package/clis/linkedin/jobs-preferences.js +34 -0
- package/clis/linkedin/like.js +1 -0
- package/clis/linkedin/notifications.js +1 -0
- package/clis/linkedin/people-search.js +1 -0
- package/clis/linkedin/post-analytics.js +1 -0
- package/clis/linkedin/post-comments.js +1 -0
- package/clis/linkedin/post-detail.js +1 -0
- package/clis/linkedin/posts-core.js +138 -0
- package/clis/linkedin/posts.js +1 -0
- package/clis/linkedin/profile-analytics.js +1 -0
- package/clis/linkedin/profile-api.js +218 -0
- package/clis/linkedin/profile-experience.js +1 -0
- package/clis/linkedin/profile-projects.js +1 -0
- package/clis/linkedin/profile-read.js +3 -0
- package/clis/linkedin/reply.js +1 -0
- package/clis/linkedin/repost.js +1 -0
- package/clis/linkedin/safe-send.js +155 -0
- package/clis/linkedin/salesnav-inbox.js +21 -0
- package/clis/linkedin/salesnav-message.js +33 -0
- package/clis/linkedin/salesnav-search.js +15 -0
- package/clis/linkedin/salesnav-thread.js +1 -0
- package/clis/linkedin/search-api.js +42 -0
- package/clis/linkedin/search.js +50 -0
- package/clis/linkedin/sent-invitations.js +46 -0
- package/clis/linkedin/services-read.js +57 -0
- package/clis/linkedin/shared.js +10 -0
- package/clis/linkedin/social-api.js +260 -0
- package/clis/linkedin/thread-snapshot.js +81 -0
- package/clis/linkedin/timeline.js +37 -0
- package/clis/linkedin-learning/auth.js +27 -0
- package/clis/linkedin-learning/course.js +17 -0
- package/clis/linkedin-learning/search.js +17 -0
- package/clis/linkedin-learning/trending.js +17 -0
- package/clis/linux-do/auth.js +20 -0
- package/clis/linux-do/categories.js +1 -0
- package/clis/linux-do/feed.js +19 -0
- package/clis/linux-do/search.js +1 -0
- package/clis/linux-do/tags.js +1 -0
- package/clis/linux-do/topic-content.js +28 -0
- package/clis/linux-do/topic.js +1 -0
- package/clis/linux-do/user-posts.js +1 -0
- package/clis/linux-do/user-topics.js +1 -0
- package/clis/lobsters/active.js +1 -0
- package/clis/lobsters/domain.js +1 -0
- package/clis/lobsters/hot.js +1 -0
- package/clis/lobsters/newest.js +1 -0
- package/clis/lobsters/read.js +11 -0
- package/clis/lobsters/tag.js +1 -0
- package/clis/maimai/auth.js +19 -0
- package/clis/maimai/search-talents.js +37 -0
- package/clis/manus/_utils.js +28 -0
- package/clis/manus/auth.js +20 -0
- package/clis/manus/connectors.js +4 -0
- package/clis/manus/credits.js +4 -0
- package/clis/manus/list.js +7 -0
- package/clis/manus/read.js +7 -0
- package/clis/manus/skills.js +4 -0
- package/clis/manus/status.js +8 -0
- package/clis/mastodon/post.js +1 -0
- package/clis/mastodon/shared.js +48 -0
- package/clis/mastodon/whoami.js +1 -0
- package/clis/maven/artifact.js +1 -0
- package/clis/maven/search.js +1 -0
- package/clis/maven/utils.js +1 -0
- package/clis/mdn/search.js +1 -0
- package/clis/medium/article.js +12 -0
- package/clis/medium/feed.js +1 -0
- package/clis/medium/login.js +1 -0
- package/clis/medium/search.js +1 -0
- package/clis/medium/stats.js +56 -0
- package/clis/medium/tag.js +1 -0
- package/clis/medium/user.js +1 -0
- package/clis/medium/utils.js +62 -0
- package/clis/medium/whoami.js +1 -0
- package/clis/mubu/doc.js +1 -0
- package/clis/mubu/docs.js +1 -0
- package/clis/mubu/notes.js +1 -0
- package/clis/mubu/recent.js +1 -0
- package/clis/mubu/search.js +1 -0
- package/clis/mubu/utils.js +31 -0
- package/clis/note/auth.js +12 -0
- package/clis/note/note-utils.js +2 -0
- package/clis/note/publish.js +17 -0
- package/clis/notebooklm/add-source.js +46 -0
- package/clis/notebooklm/auth.js +21 -0
- package/clis/notebooklm/create.js +1 -0
- package/clis/notebooklm/current.js +1 -0
- package/clis/notebooklm/generate-audio.js +1 -0
- package/clis/notebooklm/generate-slides.js +1 -0
- package/clis/notebooklm/get.js +1 -0
- package/clis/notebooklm/history.js +1 -0
- package/clis/notebooklm/list.js +1 -0
- package/clis/notebooklm/note-list.js +1 -0
- package/clis/notebooklm/notes-get.js +1 -0
- package/clis/notebooklm/open.js +1 -0
- package/clis/notebooklm/rpc.js +36 -0
- package/clis/notebooklm/shared.js +1 -0
- package/clis/notebooklm/source-fulltext.js +1 -0
- package/clis/notebooklm/source-get.js +1 -0
- package/clis/notebooklm/source-guide.js +1 -0
- package/clis/notebooklm/source-list.js +1 -0
- package/clis/notebooklm/status.js +1 -0
- package/clis/notebooklm/summary.js +1 -0
- package/clis/notebooklm/utils.js +172 -0
- package/clis/notebooklm/write-note.js +1 -0
- package/clis/nowcoder/auth.js +24 -0
- package/clis/nowcoder/comment.js +1 -0
- package/clis/nowcoder/comments.js +1 -0
- package/clis/nowcoder/companies.js +1 -0
- package/clis/nowcoder/creators.js +1 -0
- package/clis/nowcoder/delete.js +1 -0
- package/clis/nowcoder/detail.js +46 -0
- package/clis/nowcoder/dm-list.js +1 -0
- package/clis/nowcoder/dm-read.js +1 -0
- package/clis/nowcoder/dm-send.js +1 -0
- package/clis/nowcoder/drafts.js +1 -0
- package/clis/nowcoder/experience.js +20 -0
- package/clis/nowcoder/hot.js +1 -0
- package/clis/nowcoder/inbox.js +1 -0
- package/clis/nowcoder/jobs.js +1 -0
- package/clis/nowcoder/like.js +1 -0
- package/clis/nowcoder/my.js +1 -0
- package/clis/nowcoder/notifications.js +16 -0
- package/clis/nowcoder/papers.js +22 -0
- package/clis/nowcoder/post.js +1 -0
- package/clis/nowcoder/practice.js +21 -0
- package/clis/nowcoder/recommend.js +1 -0
- package/clis/nowcoder/referral.js +21 -0
- package/clis/nowcoder/salary.js +22 -0
- package/clis/nowcoder/search.js +31 -0
- package/clis/nowcoder/suggest.js +17 -0
- package/clis/nowcoder/topics.js +1 -0
- package/clis/nowcoder/trending.js +1 -0
- package/clis/nowcoder/utils.js +68 -0
- package/clis/npm/downloads.js +1 -0
- package/clis/npm/package.js +1 -0
- package/clis/npm/search.js +1 -0
- package/clis/npm/utils.js +1 -0
- package/clis/nuget/package.js +1 -0
- package/clis/nuget/search.js +1 -0
- package/clis/nuget/utils.js +1 -0
- package/clis/nvd/cve.js +1 -0
- package/clis/oeis/search.js +1 -0
- package/clis/oeis/sequence.js +1 -0
- package/clis/oeis/utils.js +1 -0
- package/clis/ones/common.js +23 -0
- package/clis/ones/enrich-tasks.js +1 -0
- package/clis/ones/login.js +2 -0
- package/clis/ones/logout.js +1 -0
- package/clis/ones/me.js +1 -0
- package/clis/ones/my-tasks.js +1 -0
- package/clis/ones/resolve-labels.js +1 -0
- package/clis/ones/task-helpers.js +1 -0
- package/clis/ones/task.js +1 -0
- package/clis/ones/tasks.js +1 -0
- package/clis/ones/token-info.js +1 -0
- package/clis/ones/worklog.js +14 -0
- package/clis/openalex/search.js +1 -0
- package/clis/openalex/utils.js +1 -0
- package/clis/openalex/work.js +1 -0
- package/clis/openfda/drug-label.js +1 -0
- package/clis/openfda/food-recall.js +1 -0
- package/clis/openfda/utils.js +1 -0
- package/clis/openreview/author.js +1 -0
- package/clis/openreview/paper.js +1 -0
- package/clis/openreview/reviews.js +4 -0
- package/clis/openreview/search.js +1 -0
- package/clis/openreview/utils.js +1 -0
- package/clis/openreview/venue.js +1 -0
- package/clis/oschina/article.js +1 -0
- package/clis/oschina/catalogs.js +1 -0
- package/clis/oschina/login.js +1 -0
- package/clis/oschina/stats.js +54 -0
- package/clis/oschina/whoami.js +1 -0
- package/clis/osv/query.js +1 -0
- package/clis/osv/utils.js +1 -0
- package/clis/osv/vulnerability.js +1 -0
- package/clis/packagist/package.js +1 -0
- package/clis/packagist/search.js +1 -0
- package/clis/packagist/utils.js +1 -0
- package/clis/paperreview/feedback.js +1 -0
- package/clis/paperreview/review.js +1 -0
- package/clis/paperreview/submit.js +1 -0
- package/clis/paperreview/utils.js +1 -0
- package/clis/pinterest/api.js +1 -0
- package/clis/pinterest/auth.js +1 -0
- package/clis/pinterest/boards.js +1 -0
- package/clis/pinterest/client.js +20 -0
- package/clis/pinterest/publish.js +13 -0
- package/clis/pixiv/auth.js +17 -0
- package/clis/pixiv/detail.js +1 -0
- package/clis/pixiv/download.js +1 -0
- package/clis/pixiv/illusts.js +1 -0
- package/clis/pixiv/ranking.js +26 -0
- package/clis/pixiv/search.js +1 -0
- package/clis/pixiv/user.js +1 -0
- package/clis/pixiv/utils.js +18 -0
- package/clis/powerchina/auth.js +17 -0
- package/clis/powerchina/search.js +1 -0
- package/clis/producthunt/browse.js +54 -0
- package/clis/producthunt/hot.js +64 -0
- package/clis/producthunt/posts.js +1 -0
- package/clis/producthunt/today.js +1 -0
- package/clis/producthunt/utils.js +1 -0
- package/clis/pubmed/article.js +1 -0
- package/clis/pubmed/author.js +1 -0
- package/clis/pubmed/citations.js +1 -0
- package/clis/pubmed/clinical-trial.js +1 -0
- package/clis/pubmed/journal.js +1 -0
- package/clis/pubmed/mesh.js +1 -0
- package/clis/pubmed/related.js +1 -0
- package/clis/pubmed/review.js +1 -0
- package/clis/pubmed/search.js +1 -0
- package/clis/pubmed/utils.js +1 -0
- package/clis/pypi/downloads.js +1 -0
- package/clis/pypi/package.js +1 -0
- package/clis/pypi/utils.js +1 -0
- package/clis/qiita/auth.js +1 -0
- package/clis/qiita/gql.js +32 -0
- package/clis/qiita/publish.js +7 -0
- package/clis/qiita/stats.js +37 -0
- package/clis/qoder/_utils.js +113 -0
- package/clis/qoder/composer.js +1 -0
- package/clis/qoder/history.js +25 -0
- package/clis/qoder/quest.js +1 -0
- package/clis/qoder/read.js +1 -0
- package/clis/qoder/status.js +1 -0
- package/clis/qoder/ui.js +59 -0
- package/clis/quark/auth.js +16 -0
- package/clis/quark/ls.js +1 -0
- package/clis/quark/mkdir.js +1 -0
- package/clis/quark/mv.js +1 -0
- package/clis/quark/rename.js +1 -0
- package/clis/quark/rm.js +1 -0
- package/clis/quark/save.js +1 -0
- package/clis/quark/share-tree.js +1 -0
- package/clis/quark/utils.js +13 -0
- package/clis/quora/create-answer.js +22 -0
- package/clis/quora/create-question.js +24 -0
- package/clis/quora/shared.js +43 -0
- package/clis/quora/whoami.js +1 -0
- package/clis/qwen/ask.js +1 -0
- package/clis/qwen/auth.js +17 -0
- package/clis/qwen/detail.js +1 -0
- package/clis/qwen/history.js +1 -0
- package/clis/qwen/image.js +31 -0
- package/clis/qwen/new.js +1 -0
- package/clis/qwen/read.js +1 -0
- package/clis/qwen/send.js +1 -0
- package/clis/qwen/status.js +1 -0
- package/clis/qwen/utils.js +185 -0
- package/clis/reddit/auth.js +17 -0
- package/clis/reddit/comment.js +36 -0
- package/clis/reddit/frontpage.js +40 -0
- package/clis/reddit/home.js +32 -0
- package/clis/reddit/hot.js +46 -0
- package/clis/reddit/popular.js +46 -0
- package/clis/reddit/read.js +398 -0
- package/clis/reddit/reply.js +56 -0
- package/clis/reddit/save.js +30 -0
- package/clis/reddit/saved.js +24 -0
- package/clis/reddit/search.js +51 -0
- package/clis/reddit/submit.js +42 -0
- package/clis/reddit/subreddit-info.js +29 -0
- package/clis/reddit/subreddit.js +52 -0
- package/clis/reddit/subscribe.js +29 -0
- package/clis/reddit/subscribed.js +68 -0
- package/clis/reddit/upvote.js +43 -0
- package/clis/reddit/upvoted.js +24 -0
- package/clis/reddit/user-comments.js +20 -0
- package/clis/reddit/user-posts.js +17 -0
- package/clis/reddit/user.js +20 -0
- package/clis/reddit/whoami.js +19 -0
- package/clis/rednote/auth.js +19 -0
- package/clis/rednote/comments.js +1 -0
- package/clis/rednote/download.js +1 -0
- package/clis/rednote/feed.js +1 -0
- package/clis/rednote/note.js +1 -0
- package/clis/rednote/notifications.js +67 -0
- package/clis/rednote/search.js +32 -0
- package/clis/rednote/user.js +1 -0
- package/clis/rest-countries/country.js +1 -0
- package/clis/rest-countries/region.js +1 -0
- package/clis/rest-countries/utils.js +1 -0
- package/clis/reuters/article-detail.js +1 -0
- package/clis/reuters/auth.js +39 -0
- package/clis/reuters/search.js +1 -0
- package/clis/reuters/utils.js +50 -0
- package/clis/rfc/rfc.js +1 -0
- package/clis/rfc/utils.js +1 -0
- package/clis/rubygems/gem.js +1 -0
- package/clis/rubygems/search.js +1 -0
- package/clis/rubygems/utils.js +1 -0
- package/clis/segmentfault/_signed-request.js +43 -0
- package/clis/segmentfault/article.js +3 -0
- package/clis/segmentfault/channels.js +1 -0
- package/clis/segmentfault/login.js +1 -0
- package/clis/segmentfault/stats.js +82 -0
- package/clis/segmentfault/tags.js +1 -0
- package/clis/segmentfault/whoami.js +1 -0
- package/clis/semanticscholar/citations.js +1 -0
- package/clis/semanticscholar/paper.js +1 -0
- package/clis/semanticscholar/recommendations.js +1 -0
- package/clis/semanticscholar/search.js +1 -0
- package/clis/semanticscholar/utils.js +1 -0
- package/clis/sinablog/article.js +1 -0
- package/clis/sinablog/hot.js +1 -0
- package/clis/sinablog/search.js +1 -0
- package/clis/sinablog/user.js +1 -0
- package/clis/sinablog/utils.js +153 -0
- package/clis/sinafinance/news.js +1 -0
- package/clis/sinafinance/rolling-news.js +20 -0
- package/clis/sinafinance/stock-rank.js +41 -0
- package/clis/sinafinance/stock.js +1 -0
- package/clis/slock/attachment-download.js +1 -0
- package/clis/slock/attachment-upload.js +34 -0
- package/clis/slock/attachment-url.js +1 -0
- package/clis/slock/auth-verify.js +1 -0
- package/clis/slock/bookmark-add.js +11 -0
- package/clis/slock/bookmark-list.js +10 -0
- package/clis/slock/bookmark-remove.js +7 -0
- package/clis/slock/channel-action.js +1 -0
- package/clis/slock/channel-archive.js +1 -0
- package/clis/slock/channel-create.js +1 -0
- package/clis/slock/channel-files.js +1 -0
- package/clis/slock/channel-info.js +1 -0
- package/clis/slock/channel-join.js +1 -0
- package/clis/slock/channel-leave.js +1 -0
- package/clis/slock/channel-list.js +1 -0
- package/clis/slock/channel-mark.js +1 -0
- package/clis/slock/channel-members.js +1 -0
- package/clis/slock/channel-unarchive.js +1 -0
- package/clis/slock/dm-list.js +1 -0
- package/clis/slock/errors.js +1 -0
- package/clis/slock/in-page.js +113 -0
- package/clis/slock/inbox-done.js +9 -0
- package/clis/slock/inbox-read-all.js +1 -0
- package/clis/slock/inbox.js +1 -0
- package/clis/slock/login.js +1 -0
- package/clis/slock/message-read.js +61 -0
- package/clis/slock/message-search.js +24 -0
- package/clis/slock/message-send.js +55 -0
- package/clis/slock/reaction-add.js +1 -0
- package/clis/slock/reaction-remove.js +1 -0
- package/clis/slock/resolve.js +1 -0
- package/clis/slock/server-list.js +9 -0
- package/clis/slock/server-use.js +18 -0
- package/clis/slock/shared.js +1 -0
- package/clis/slock/task-claim.js +14 -0
- package/clis/slock/task-convert.js +35 -0
- package/clis/slock/task-create.js +24 -0
- package/clis/slock/task-delete.js +9 -0
- package/clis/slock/task-get.js +11 -0
- package/clis/slock/task-list-server.js +12 -0
- package/clis/slock/task-list.js +14 -0
- package/clis/slock/task-status.js +19 -0
- package/clis/slock/task-unclaim.js +13 -0
- package/clis/slock/thread-done.js +1 -0
- package/clis/slock/thread-follow.js +1 -0
- package/clis/slock/thread-list.js +1 -0
- package/clis/slock/thread-state.js +1 -0
- package/clis/slock/thread-undone.js +1 -0
- package/clis/slock/thread-unfollow.js +1 -0
- package/clis/slock/unread-summary.js +18 -0
- package/clis/slock/whoami.js +1 -0
- package/clis/smzdm/search.js +71 -0
- package/clis/sohu/article.js +1 -0
- package/clis/sohu/attributes.js +1 -0
- package/clis/sohu/categories.js +1 -0
- package/clis/sohu/channels.js +1 -0
- package/clis/sohu/columns.js +1 -0
- package/clis/sohu/login.js +1 -0
- package/clis/sohu/mpbp.js +1 -0
- package/clis/sohu/stats.js +95 -0
- package/clis/sohu/topics.js +1 -0
- package/clis/sohu/whoami.js +1 -0
- package/clis/spotify/spotify.js +1 -0
- package/clis/spotify/utils.js +8 -0
- package/clis/stackoverflow/bounties.js +1 -0
- package/clis/stackoverflow/hot.js +1 -0
- package/clis/stackoverflow/read.js +13 -0
- package/clis/stackoverflow/related.js +1 -0
- package/clis/stackoverflow/search.js +1 -0
- package/clis/stackoverflow/tag.js +1 -0
- package/clis/stackoverflow/unanswered.js +1 -0
- package/clis/stackoverflow/user.js +1 -0
- package/clis/stackoverflow/utils.js +1 -0
- package/clis/steam/app.js +1 -0
- package/clis/steam/search.js +1 -0
- package/clis/steam/top-sellers.js +1 -0
- package/clis/steam/utils.js +1 -0
- package/clis/substack/auth.js +11 -0
- package/clis/substack/feed.js +1 -0
- package/clis/substack/post-utils.js +2 -0
- package/clis/substack/publication.js +1 -0
- package/clis/substack/publish.js +10 -0
- package/clis/substack/search.js +1 -0
- package/clis/substack/utils.js +108 -0
- package/clis/suno/auth.js +21 -0
- package/clis/suno/download.js +17 -0
- package/clis/suno/generate.js +4 -0
- package/clis/suno/list.js +14 -0
- package/clis/suno/status.js +1 -0
- package/clis/suno/utils.js +102 -0
- package/clis/taobao/add-cart.js +93 -0
- package/clis/taobao/auth.js +8 -0
- package/clis/taobao/cart.js +68 -0
- package/clis/taobao/detail.js +48 -0
- package/clis/taobao/reviews.js +52 -0
- package/clis/taobao/search.js +64 -0
- package/clis/tdx/hot-rank.js +25 -0
- package/clis/telegram/send.js +18 -0
- package/clis/telegram/shared.js +21 -0
- package/clis/telegram/whoami.js +1 -0
- package/clis/test-utils.js +1 -0
- package/clis/threads/post.js +152 -0
- package/clis/threads/shared.js +27 -0
- package/clis/threads/whoami.js +1 -0
- package/clis/ths/hot-rank.js +27 -0
- package/clis/tieba/hot.js +16 -0
- package/clis/tieba/posts.js +1 -0
- package/clis/tieba/read.js +84 -0
- package/clis/tieba/search.js +54 -0
- package/clis/tieba/utils.js +1 -0
- package/clis/tiktok/auth.js +30 -0
- package/clis/tiktok/comment.js +69 -0
- package/clis/tiktok/creator-videos.js +45 -0
- package/clis/tiktok/explore.js +76 -0
- package/clis/tiktok/follow.js +49 -0
- package/clis/tiktok/following.js +103 -0
- package/clis/tiktok/friends.js +79 -0
- package/clis/tiktok/like.js +19 -0
- package/clis/tiktok/live.js +79 -0
- package/clis/tiktok/notifications.js +77 -0
- package/clis/tiktok/profile.js +26 -0
- package/clis/tiktok/publish.js +82 -0
- package/clis/tiktok/save.js +15 -0
- package/clis/tiktok/search.js +24 -0
- package/clis/tiktok/unfollow.js +59 -0
- package/clis/tiktok/unlike.js +19 -0
- package/clis/tiktok/unsave.js +17 -0
- package/clis/tiktok/user.js +143 -0
- package/clis/tiktok/utils.js +272 -0
- package/clis/toutiao/article.js +1 -0
- package/clis/toutiao/articles.js +6 -0
- package/clis/toutiao/auth.js +50 -0
- package/clis/toutiao/hot.js +1 -0
- package/clis/toutiao/utils.js +2 -0
- package/clis/trae-cn/activity.js +1 -0
- package/clis/trae-cn/approve.js +1 -0
- package/clis/trae-cn/ask.js +1 -0
- package/clis/trae-cn/dump.js +1 -0
- package/clis/trae-cn/export.js +3 -0
- package/clis/trae-cn/model.js +1 -0
- package/clis/trae-cn/new.js +1 -0
- package/clis/trae-cn/read.js +1 -0
- package/clis/trae-cn/screenshot.js +1 -0
- package/clis/trae-cn/select-model.js +1 -0
- package/clis/trae-cn/send.js +1 -0
- package/clis/trae-cn/setup.js +1 -0
- package/clis/trae-cn/status.js +1 -0
- package/clis/trae-cn/targets.js +1 -0
- package/clis/trae-cn/utils.js +456 -0
- package/clis/trae-cn/watch.js +3 -0
- package/clis/trae-solo/_actions.js +41 -0
- package/clis/trae-solo/_fs.js +6 -0
- package/clis/trae-solo/_state.js +2 -0
- package/clis/trae-solo/automation.js +43 -0
- package/clis/trae-solo/history.js +15 -0
- package/clis/trae-solo/mode.js +31 -0
- package/clis/trae-solo/model.js +50 -0
- package/clis/trae-solo/renderer-storage.js +11 -0
- package/clis/trae-solo/settings.js +1 -0
- package/clis/trae-solo/skill-fs.js +1 -0
- package/clis/trae-solo/skill.js +81 -0
- package/clis/trae-solo/state-fs.js +2 -0
- package/clis/trae-solo/status.js +1 -0
- package/clis/trae-solo/task-fs.js +5 -0
- package/clis/trae-solo/user-rules.js +1 -0
- package/clis/trae-solo/workspaces-fs.js +1 -0
- package/clis/tumblr/auth.js +24 -0
- package/clis/tumblr/publish.js +14 -0
- package/clis/tvmaze/search.js +1 -0
- package/clis/tvmaze/show.js +1 -0
- package/clis/tvmaze/utils.js +1 -0
- package/clis/twitter/accept.js +116 -0
- package/clis/twitter/article.js +116 -0
- package/clis/twitter/auth.js +4 -0
- package/clis/twitter/block.js +62 -0
- package/clis/twitter/bookmark-folder.js +4 -0
- package/clis/twitter/bookmark-folders.js +4 -0
- package/clis/twitter/bookmark.js +44 -0
- package/clis/twitter/bookmarks.js +27 -0
- package/clis/twitter/delete.js +36 -0
- package/clis/twitter/device-follow.js +13 -0
- package/clis/twitter/dm-list.js +1 -0
- package/clis/twitter/dm-read.js +1 -0
- package/clis/twitter/dm-send.js +13 -0
- package/clis/twitter/dm-shared.js +6 -0
- package/clis/twitter/download.js +38 -0
- package/clis/twitter/follow-batch.js +43 -0
- package/clis/twitter/follow.js +39 -0
- package/clis/twitter/followers.js +59 -0
- package/clis/twitter/following.js +4 -0
- package/clis/twitter/hide-reply.js +57 -0
- package/clis/twitter/like.js +48 -0
- package/clis/twitter/likes.js +14 -0
- package/clis/twitter/list-add-batch.js +1 -0
- package/clis/twitter/list-add-core.js +35 -0
- package/clis/twitter/list-add.js +1 -0
- package/clis/twitter/list-batch-utils.js +1 -0
- package/clis/twitter/list-create.js +12 -0
- package/clis/twitter/list-delete.js +36 -0
- package/clis/twitter/list-remove-batch.js +1 -0
- package/clis/twitter/list-remove-core.js +127 -0
- package/clis/twitter/list-remove.js +1 -0
- package/clis/twitter/list-tweets.js +27 -0
- package/clis/twitter/lists.js +27 -0
- package/clis/twitter/notifications.js +4 -0
- package/clis/twitter/post.js +158 -0
- package/clis/twitter/profile.js +66 -0
- package/clis/twitter/quote.js +123 -0
- package/clis/twitter/reply-dm.js +112 -0
- package/clis/twitter/reply.js +97 -0
- package/clis/twitter/retweet.js +62 -0
- package/clis/twitter/schedule.js +96 -0
- package/clis/twitter/scheduled-delete.js +60 -0
- package/clis/twitter/scheduled-list.js +15 -0
- package/clis/twitter/scheduled-utils.js +18 -0
- package/clis/twitter/search.js +12 -0
- package/clis/twitter/shared.js +76 -0
- package/clis/twitter/thread.js +4 -0
- package/clis/twitter/timeline.js +4 -0
- package/clis/twitter/trending.js +18 -0
- package/clis/twitter/tweets.js +12 -0
- package/clis/twitter/unblock.js +45 -0
- package/clis/twitter/unbookmark.js +41 -0
- package/clis/twitter/unfollow.js +45 -0
- package/clis/twitter/unlike.js +48 -0
- package/clis/twitter/unretweet.js +62 -0
- package/clis/twitter/utils.js +55 -0
- package/clis/uisdc/news.js +25 -0
- package/clis/uiverse/_shared.js +257 -0
- package/clis/uiverse/code.js +1 -0
- package/clis/uiverse/preview.js +1 -0
- package/clis/upwork/auth.js +19 -0
- package/clis/upwork/detail.js +22 -0
- package/clis/upwork/feed.js +21 -0
- package/clis/upwork/search.js +21 -0
- package/clis/upwork/utils.js +1 -0
- package/clis/v2ex/auth.js +10 -0
- package/clis/v2ex/daily.js +41 -0
- package/clis/v2ex/hot.js +1 -0
- package/clis/v2ex/latest.js +1 -0
- package/clis/v2ex/me.js +58 -0
- package/clis/v2ex/member.js +1 -0
- package/clis/v2ex/node.js +1 -0
- package/clis/v2ex/nodes.js +1 -0
- package/clis/v2ex/notifications.js +40 -0
- package/clis/v2ex/replies.js +1 -0
- package/clis/v2ex/topic.js +1 -0
- package/clis/v2ex/user.js +1 -0
- package/clis/vk/post.js +1 -0
- package/clis/vk/shared.js +8 -0
- package/clis/vk/whoami.js +1 -0
- package/clis/wanfang/search.js +42 -0
- package/clis/web/read.js +260 -0
- package/clis/wechat-channels/auth.js +31 -0
- package/clis/wechat-channels/publish.js +298 -0
- package/clis/weibo/article.js +1 -0
- package/clis/weibo/auth.js +17 -0
- package/clis/weibo/comments.js +28 -0
- package/clis/weibo/delete.js +84 -0
- package/clis/weibo/favorites.js +27 -0
- package/clis/weibo/feed.js +33 -0
- package/clis/weibo/hot.js +17 -0
- package/clis/weibo/me.js +51 -0
- package/clis/weibo/post.js +46 -0
- package/clis/weibo/publish.js +98 -0
- package/clis/weibo/search.js +47 -0
- package/clis/weibo/user-posts.js +92 -0
- package/clis/weibo/user.js +37 -0
- package/clis/weibo/utils.js +16 -0
- package/clis/weixin/article.js +1 -0
- package/clis/weixin/create-draft.js +152 -0
- package/clis/weixin/download.js +100 -0
- package/clis/weixin/drafts.js +27 -0
- package/clis/weixin/login.js +1 -0
- package/clis/weixin/search.js +44 -0
- package/clis/weixin/stats.js +43 -0
- package/clis/weixin/whoami.js +1 -0
- package/clis/weread/ai-outline.js +2 -0
- package/clis/weread/auth.js +24 -0
- package/clis/weread/book-search.js +2 -0
- package/clis/weread/book.js +3 -0
- package/clis/weread/highlights.js +1 -0
- package/clis/weread/notebooks.js +1 -0
- package/clis/weread/notes.js +1 -0
- package/clis/weread/ranking.js +1 -0
- package/clis/weread/search.js +1 -0
- package/clis/weread/shelf.js +1 -0
- package/clis/weread/utils.js +67 -0
- package/clis/weread-official/book.js +1 -0
- package/clis/weread-official/discover.js +1 -0
- package/clis/weread-official/list-apis.js +1 -0
- package/clis/weread-official/notes.js +1 -0
- package/clis/weread-official/readdata.js +1 -0
- package/clis/weread-official/review.js +1 -0
- package/clis/weread-official/search.js +1 -0
- package/clis/weread-official/shelf.js +1 -0
- package/clis/weread-official/utils.js +1 -0
- package/clis/wikidata/entity.js +1 -0
- package/clis/wikidata/search.js +1 -0
- package/clis/wikidata/utils.js +1 -0
- package/clis/wikipedia/page.js +3 -0
- package/clis/wikipedia/random.js +1 -0
- package/clis/wikipedia/search.js +1 -0
- package/clis/wikipedia/summary.js +1 -0
- package/clis/wikipedia/trending.js +1 -0
- package/clis/wikipedia/utils.js +1 -0
- package/clis/wordpress/login.js +1 -0
- package/clis/wordpress/publish.js +1 -0
- package/clis/wordpress/shared.js +54 -0
- package/clis/wordpress/whoami.js +1 -0
- package/clis/woshipm/article.js +1 -0
- package/clis/woshipm/login.js +1 -0
- package/clis/woshipm/stats.js +52 -0
- package/clis/woshipm/whoami.js +1 -0
- package/clis/wttr/current.js +1 -0
- package/clis/wttr/forecast.js +1 -0
- package/clis/wttr/utils.js +1 -0
- package/clis/xianyu/auth.js +11 -0
- package/clis/xianyu/chat.js +1 -0
- package/clis/xianyu/im.js +240 -0
- package/clis/xianyu/inbox.js +1 -0
- package/clis/xianyu/item.js +97 -0
- package/clis/xianyu/messages.js +1 -0
- package/clis/xianyu/publish.js +245 -0
- package/clis/xianyu/reply.js +1 -0
- package/clis/xianyu/search.js +141 -0
- package/clis/xianyu/utils.js +1 -0
- package/clis/xiaoe/auth.js +10 -0
- package/clis/xiaoe/catalog.js +134 -0
- package/clis/xiaoe/content.js +16 -0
- package/clis/xiaoe/courses.js +43 -0
- package/clis/xiaoe/detail.js +19 -0
- package/clis/xiaoe/play-url.js +97 -0
- package/clis/xiaohongshu/ask.js +130 -0
- package/clis/xiaohongshu/auth.js +13 -0
- package/clis/xiaohongshu/collection-helpers.js +64 -0
- package/clis/xiaohongshu/comments.js +89 -0
- package/clis/xiaohongshu/creator-note-detail.js +80 -0
- package/clis/xiaohongshu/creator-notes-summary.js +1 -0
- package/clis/xiaohongshu/creator-notes.js +107 -0
- package/clis/xiaohongshu/creator-profile.js +13 -0
- package/clis/xiaohongshu/creator-stats.js +13 -0
- package/clis/xiaohongshu/delete-note.js +69 -0
- package/clis/xiaohongshu/download.js +200 -0
- package/clis/xiaohongshu/draft-clear.js +44 -0
- package/clis/xiaohongshu/draft-delete.js +37 -0
- package/clis/xiaohongshu/draft-open.js +1 -0
- package/clis/xiaohongshu/draft-utils.js +36 -0
- package/clis/xiaohongshu/drafts.js +1 -0
- package/clis/xiaohongshu/feed.js +38 -0
- package/clis/xiaohongshu/follow.js +75 -0
- package/clis/xiaohongshu/liked.js +1 -0
- package/clis/xiaohongshu/note-helpers.js +1 -0
- package/clis/xiaohongshu/note.js +32 -0
- package/clis/xiaohongshu/notifications.js +1 -0
- package/clis/xiaohongshu/publish-video.js +87 -0
- package/clis/xiaohongshu/publish.js +637 -0
- package/clis/xiaohongshu/saved.js +1 -0
- package/clis/xiaohongshu/search.js +194 -0
- package/clis/xiaohongshu/unfollow.js +98 -0
- package/clis/xiaohongshu/user-helpers.js +1 -0
- package/clis/xiaohongshu/user.js +30 -0
- package/clis/xiaoyuzhou/auth.js +3 -0
- package/clis/xiaoyuzhou/download.js +1 -0
- package/clis/xiaoyuzhou/episode.js +1 -0
- package/clis/xiaoyuzhou/podcast-episodes.js +1 -0
- package/clis/xiaoyuzhou/podcast.js +1 -0
- package/clis/xiaoyuzhou/transcript.js +1 -0
- package/clis/xiaoyuzhou/utils.js +1 -0
- package/clis/xueqiu/article.js +4 -0
- package/clis/xueqiu/auth.js +27 -0
- package/clis/xueqiu/comments.js +38 -0
- package/clis/xueqiu/danjuan-utils.js +84 -0
- package/clis/xueqiu/earnings-date.js +1 -0
- package/clis/xueqiu/events.js +17 -0
- package/clis/xueqiu/feed.js +1 -0
- package/clis/xueqiu/fund-holdings.js +1 -0
- package/clis/xueqiu/fund-snapshot.js +1 -0
- package/clis/xueqiu/groups.js +1 -0
- package/clis/xueqiu/hashtags.js +26 -0
- package/clis/xueqiu/hot-stock.js +1 -0
- package/clis/xueqiu/hot.js +1 -0
- package/clis/xueqiu/kline.js +1 -0
- package/clis/xueqiu/search.js +1 -0
- package/clis/xueqiu/stock.js +1 -0
- package/clis/xueqiu/stocks.js +13 -0
- package/clis/xueqiu/users.js +12 -0
- package/clis/xueqiu/utils.js +9 -0
- package/clis/xueqiu/watchlist.js +1 -0
- package/clis/yahoo/search.js +21 -0
- package/clis/yahoo-finance/quote.js +50 -0
- package/clis/yollomi/background.js +1 -0
- package/clis/yollomi/edit.js +1 -0
- package/clis/yollomi/face-swap.js +1 -0
- package/clis/yollomi/generate.js +1 -0
- package/clis/yollomi/models.js +1 -0
- package/clis/yollomi/object-remover.js +1 -0
- package/clis/yollomi/remove-bg.js +1 -0
- package/clis/yollomi/restore.js +1 -0
- package/clis/yollomi/try-on.js +1 -0
- package/clis/yollomi/upload.js +17 -0
- package/clis/yollomi/upscale.js +1 -0
- package/clis/yollomi/utils.js +16 -0
- package/clis/yollomi/video.js +1 -0
- package/clis/youdao/note.js +113 -0
- package/clis/youtube/auth.js +20 -0
- package/clis/youtube/channel.js +118 -0
- package/clis/youtube/comments.js +64 -0
- package/clis/youtube/feed.js +89 -0
- package/clis/youtube/history.js +87 -0
- package/clis/youtube/like.js +33 -0
- package/clis/youtube/playlist.js +47 -0
- package/clis/youtube/publish.js +56 -0
- package/clis/youtube/search.js +39 -0
- package/clis/youtube/subscribe.js +42 -0
- package/clis/youtube/subscriptions.js +26 -0
- package/clis/youtube/transcript-group.js +2 -0
- package/clis/youtube/transcript.js +417 -0
- package/clis/youtube/unlike.js +33 -0
- package/clis/youtube/unsubscribe.js +42 -0
- package/clis/youtube/utils.js +34 -0
- package/clis/youtube/video.js +96 -0
- package/clis/youtube/watch-later.js +41 -0
- package/clis/yuanbao/ask.js +145 -0
- package/clis/yuanbao/auth.js +23 -0
- package/clis/yuanbao/detail.js +1 -0
- package/clis/yuanbao/history.js +1 -0
- package/clis/yuanbao/new.js +16 -0
- package/clis/yuanbao/read.js +1 -0
- package/clis/yuanbao/send.js +1 -0
- package/clis/yuanbao/shared.js +127 -0
- package/clis/yuanbao/status.js +1 -0
- package/clis/yuque/article.js +1 -0
- package/clis/yuque/whoami.js +1 -0
- package/clis/zhihu/answer-comments.js +11 -0
- package/clis/zhihu/answer-detail.js +11 -0
- package/clis/zhihu/answer.js +15 -0
- package/clis/zhihu/article-transform.js +1 -0
- package/clis/zhihu/article.js +7 -0
- package/clis/zhihu/auth.js +11 -0
- package/clis/zhihu/collection.js +7 -0
- package/clis/zhihu/collections.js +7 -0
- package/clis/zhihu/comment.js +17 -0
- package/clis/zhihu/download.js +39 -0
- package/clis/zhihu/favorite.js +39 -0
- package/clis/zhihu/follow.js +19 -0
- package/clis/zhihu/followers.js +1 -0
- package/clis/zhihu/following.js +1 -0
- package/clis/zhihu/hot.js +21 -0
- package/clis/zhihu/like.js +16 -0
- package/clis/zhihu/paginate.js +11 -0
- package/clis/zhihu/pin.js +24 -0
- package/clis/zhihu/pins.js +1 -0
- package/clis/zhihu/question.js +7 -0
- package/clis/zhihu/recommend.js +7 -0
- package/clis/zhihu/search.js +11 -0
- package/clis/zhihu/stats.js +41 -0
- package/clis/zhihu/target.js +1 -0
- package/clis/zhihu/text.js +6 -0
- package/clis/zhihu/user-answers.js +1 -0
- package/clis/zhihu/user-arg.js +1 -0
- package/clis/zhihu/user-articles.js +1 -0
- package/clis/zhihu/user.js +11 -0
- package/clis/zhihu/write-shared.js +71 -0
- package/clis/zlibrary/info.js +1 -0
- package/clis/zlibrary/search.js +1 -0
- package/clis/zlibrary/utils.js +48 -0
- package/clis/zsxq/auth.js +33 -0
- package/clis/zsxq/dynamics.js +1 -0
- package/clis/zsxq/groups.js +1 -0
- package/clis/zsxq/search.js +1 -0
- package/clis/zsxq/topic.js +1 -0
- package/clis/zsxq/topics.js +1 -0
- package/clis/zsxq/utils.js +72 -0
- package/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +2 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +1 -0
- package/dist/src/adapter-source.test.d.ts +1 -0
- package/dist/src/browser/analyze.d.ts +118 -0
- package/dist/src/browser/analyze.js +1 -0
- package/dist/src/browser/analyze.test.d.ts +1 -0
- package/dist/src/browser/article-extract.d.ts +57 -0
- package/dist/src/browser/article-extract.e2e.test.d.ts +1 -0
- package/dist/src/browser/article-extract.js +2 -0
- package/dist/src/browser/article-extract.test.d.ts +1 -0
- package/dist/src/browser/ax-snapshot.d.ts +37 -0
- package/dist/src/browser/ax-snapshot.js +2 -0
- package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
- package/dist/src/browser/base-page.d.ts +151 -0
- package/dist/src/browser/base-page.js +225 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/bridge-readiness.d.ts +14 -0
- package/dist/src/browser/bridge-readiness.js +1 -0
- package/dist/src/browser/bridge-readiness.test.d.ts +1 -0
- package/dist/src/browser/bridge.d.ts +26 -0
- package/dist/src/browser/bridge.js +1 -0
- package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
- package/dist/src/browser/cdp.d.ts +51 -0
- package/dist/src/browser/cdp.js +1 -0
- package/dist/src/browser/cdp.test.d.ts +1 -0
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +82 -0
- package/dist/src/browser/compound.test.d.ts +1 -0
- package/dist/src/browser/config.d.ts +2 -0
- package/dist/src/browser/config.js +1 -0
- package/dist/src/browser/daemon-client.d.ts +79 -0
- package/dist/src/browser/daemon-client.js +1 -0
- package/dist/src/browser/daemon-client.test.d.ts +1 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +37 -0
- package/dist/src/browser/daemon-lifecycle.js +12 -0
- package/dist/src/browser/daemon-transport.d.ts +55 -0
- package/dist/src/browser/daemon-transport.js +1 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +2 -0
- package/dist/src/browser/dom-helpers.d.ts +41 -0
- package/dist/src/browser/dom-helpers.js +166 -0
- package/dist/src/browser/dom-helpers.test.d.ts +1 -0
- package/dist/src/browser/dom-snapshot.d.ts +93 -0
- package/dist/src/browser/dom-snapshot.js +809 -0
- package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/src/browser/errors.d.ts +38 -0
- package/dist/src/browser/errors.js +5 -0
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +42 -0
- package/dist/src/browser/extract.test.d.ts +1 -0
- package/dist/src/browser/find.d.ts +84 -0
- package/dist/src/browser/find.js +328 -0
- package/dist/src/browser/find.test.d.ts +1 -0
- package/dist/src/browser/fingerprint.d.ts +44 -0
- package/dist/src/browser/fingerprint.js +82 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +61 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/index.d.ts +14 -0
- package/dist/src/browser/index.js +1 -0
- package/dist/src/browser/managed-chrome.d.ts +89 -0
- package/dist/src/browser/managed-chrome.js +1 -0
- package/dist/src/browser/network-cache.d.ts +49 -0
- package/dist/src/browser/network-cache.js +1 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +1 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/page.d.ts +83 -0
- package/dist/src/browser/page.js +15 -0
- package/dist/src/browser/page.test.d.ts +1 -0
- package/dist/src/browser/profile.d.ts +96 -0
- package/dist/src/browser/profile.js +2 -0
- package/dist/src/browser/proxy-test.d.ts +28 -0
- package/dist/src/browser/proxy-test.js +12 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +1 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +1 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/stealth.d.ts +18 -0
- package/dist/src/browser/stealth.js +391 -0
- package/dist/src/browser/stealth.test.d.ts +1 -0
- package/dist/src/browser/tabs.d.ts +13 -0
- package/dist/src/browser/tabs.js +2 -0
- package/dist/src/browser/target-errors.d.ts +39 -0
- package/dist/src/browser/target-errors.js +1 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.d.ts +158 -0
- package/dist/src/browser/target-resolver.js +423 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/trace.d.ts +21 -0
- package/dist/src/browser/trace.js +2 -0
- package/dist/src/browser/utils.d.ts +20 -0
- package/dist/src/browser/utils.js +1 -0
- package/dist/src/browser/utils.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.d.ts +65 -0
- package/dist/src/browser/verify-fixture.js +2 -0
- package/dist/src/browser/verify-fixture.test.d.ts +1 -0
- package/dist/src/browser/visual-refs.d.ts +11 -0
- package/dist/src/browser/visual-refs.js +94 -0
- package/dist/src/browser-session-lock.d.ts +13 -0
- package/dist/src/browser-session-lock.js +1 -0
- package/dist/src/browser-session-lock.test.d.ts +1 -0
- package/dist/src/browser.test.d.ts +1 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +16 -0
- package/dist/src/build-manifest.test.d.ts +1 -0
- package/dist/src/capabilityRouting.d.ts +19 -0
- package/dist/src/capabilityRouting.js +1 -0
- package/dist/src/capabilityRouting.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.d.ts +63 -0
- package/dist/src/cli-argv-preprocess.js +1 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli.d.ts +79 -0
- package/dist/src/cli.js +132 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/commanderAdapter.d.ts +21 -0
- package/dist/src/commanderAdapter.js +3 -0
- package/dist/src/commanderAdapter.test.d.ts +1 -0
- package/dist/src/commands/auth.d.ts +40 -0
- package/dist/src/commands/auth.js +2 -0
- package/dist/src/commands/auth.test.d.ts +1 -0
- package/dist/src/commands/daemon.d.ts +25 -0
- package/dist/src/commands/daemon.js +1 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/completion-fast.d.ts +22 -0
- package/dist/src/completion-fast.js +1 -0
- package/dist/src/completion-shared.d.ts +13 -0
- package/dist/src/completion-shared.js +30 -0
- package/dist/src/completion.d.ts +21 -0
- package/dist/src/completion.js +1 -0
- package/dist/src/completion.test.d.ts +1 -0
- package/dist/src/constants.d.ts +22 -0
- package/dist/src/constants.js +1 -0
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +2 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/daemon-utils.d.ts +18 -0
- package/dist/src/daemon-utils.js +1 -0
- package/dist/src/daemon.d.ts +22 -0
- package/dist/src/daemon.js +1 -0
- package/dist/src/daemon.test.d.ts +1 -0
- package/dist/src/discovery.d.ts +43 -0
- package/dist/src/discovery.js +2 -0
- package/dist/src/doctor.d.ts +38 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/doctor.test.d.ts +1 -0
- package/dist/src/download/article-download.d.ts +72 -0
- package/dist/src/download/article-download.js +21 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/index.d.ts +71 -0
- package/dist/src/download/index.js +7 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/media-download.d.ts +49 -0
- package/dist/src/download/media-download.js +1 -0
- package/dist/src/download/media-download.test.d.ts +1 -0
- package/dist/src/download/progress.d.ts +36 -0
- package/dist/src/download/progress.js +5 -0
- package/dist/src/download/progress.test.d.ts +1 -0
- package/dist/src/electron-apps.d.ts +31 -0
- package/dist/src/electron-apps.js +1 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/engine.test.d.ts +1 -0
- package/dist/src/errors.d.ts +117 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/errors.test.d.ts +1 -0
- package/dist/src/execution.d.ts +24 -0
- package/dist/src/execution.js +2 -0
- package/dist/src/execution.test.d.ts +1 -0
- package/dist/src/extension-manifest-regression.test.d.ts +1 -0
- package/dist/src/external-clis.yaml +109 -0
- package/dist/src/external.d.ts +49 -0
- package/dist/src/external.js +1 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +8 -0
- package/dist/src/help.test.d.ts +1 -0
- package/dist/src/hooks.d.ts +46 -0
- package/dist/src/hooks.js +1 -0
- package/dist/src/hooks.test.d.ts +4 -0
- package/dist/src/interceptor.d.ts +44 -0
- package/dist/src/interceptor.js +123 -0
- package/dist/src/interceptor.test.d.ts +4 -0
- package/dist/src/launcher.d.ts +41 -0
- package/dist/src/launcher.js +7 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.js +9 -0
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.js +10 -0
- package/dist/src/manifest-types.d.ts +43 -0
- package/dist/src/manifest-types.js +1 -0
- package/dist/src/node-network.d.ts +10 -0
- package/dist/src/node-network.js +1 -0
- package/dist/src/node-network.test.d.ts +1 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +8 -0
- package/dist/src/observation/artifact.test.d.ts +1 -0
- package/dist/src/observation/events.d.ts +89 -0
- package/dist/src/observation/events.js +1 -0
- package/dist/src/observation/index.d.ts +7 -0
- package/dist/src/observation/index.js +1 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +1 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +2 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +1 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +1 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +1 -0
- package/dist/src/output.d.ts +14 -0
- package/dist/src/output.js +2 -0
- package/dist/src/output.test.d.ts +1 -0
- package/dist/src/package-exports.test.d.ts +1 -0
- package/dist/src/package-paths.d.ts +8 -0
- package/dist/src/package-paths.js +1 -0
- package/dist/src/pipeline/executor.d.ts +11 -0
- package/dist/src/pipeline/executor.js +1 -0
- package/dist/src/pipeline/executor.test.d.ts +4 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +1 -0
- package/dist/src/pipeline/registry.d.ts +28 -0
- package/dist/src/pipeline/registry.js +1 -0
- package/dist/src/pipeline/steps/browser.d.ts +13 -0
- package/dist/src/pipeline/steps/browser.js +1 -0
- package/dist/src/pipeline/steps/download.d.ts +18 -0
- package/dist/src/pipeline/steps/download.js +1 -0
- package/dist/src/pipeline/steps/download.test.d.ts +1 -0
- package/dist/src/pipeline/steps/fetch.d.ts +5 -0
- package/dist/src/pipeline/steps/fetch.js +31 -0
- package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/src/pipeline/steps/intercept.d.ts +5 -0
- package/dist/src/pipeline/steps/intercept.js +1 -0
- package/dist/src/pipeline/steps/tap.d.ts +12 -0
- package/dist/src/pipeline/steps/tap.js +53 -0
- package/dist/src/pipeline/steps/transform.d.ts +9 -0
- package/dist/src/pipeline/steps/transform.js +1 -0
- package/dist/src/pipeline/template.d.ts +17 -0
- package/dist/src/pipeline/template.js +1 -0
- package/dist/src/pipeline/template.test.d.ts +4 -0
- package/dist/src/pipeline/transform.test.d.ts +4 -0
- package/dist/src/plugin-manifest.d.ts +70 -0
- package/dist/src/plugin-manifest.js +1 -0
- package/dist/src/plugin-manifest.test.d.ts +4 -0
- package/dist/src/plugin-scaffold.d.ts +28 -0
- package/dist/src/plugin-scaffold.js +75 -0
- package/dist/src/plugin-scaffold.test.d.ts +4 -0
- package/dist/src/plugin.d.ts +145 -0
- package/dist/src/plugin.js +20 -0
- package/dist/src/plugin.test.d.ts +4 -0
- package/dist/src/rate-limit.d.ts +15 -0
- package/dist/src/rate-limit.js +2 -0
- package/dist/src/rate-limit.test.d.ts +1 -0
- package/dist/src/registry-api.d.ts +13 -0
- package/dist/src/registry-api.js +1 -0
- package/dist/src/registry.d.ts +130 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/registry.test.d.ts +4 -0
- package/dist/src/runtime-detect.d.ts +31 -0
- package/dist/src/runtime-detect.js +1 -0
- package/dist/src/runtime-detect.test.d.ts +1 -0
- package/dist/src/runtime.d.ts +57 -0
- package/dist/src/runtime.js +1 -0
- package/dist/src/scripts/framework.d.ts +7 -0
- package/dist/src/scripts/framework.js +1 -0
- package/dist/src/scripts/interact.d.ts +4 -0
- package/dist/src/scripts/interact.js +1 -0
- package/dist/src/scripts/store.d.ts +13 -0
- package/dist/src/scripts/store.js +1 -0
- package/dist/src/serialization.d.ts +42 -0
- package/dist/src/serialization.js +4 -0
- package/dist/src/serialization.test.d.ts +1 -0
- package/dist/src/skills.d.ts +14 -0
- package/dist/src/skills.js +6 -0
- package/dist/src/skills.test.d.ts +1 -0
- package/dist/src/snapshotFormatter.d.ts +11 -0
- package/dist/src/snapshotFormatter.js +3 -0
- package/dist/src/snapshotFormatter.test.d.ts +7 -0
- package/dist/src/tui.d.ts +28 -0
- package/dist/src/tui.js +16 -0
- package/dist/src/tui.test.d.ts +1 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +57 -0
- package/dist/src/utils.js +38 -0
- package/dist/src/utils.test.d.ts +1 -0
- package/dist/src/validate.d.ts +21 -0
- package/dist/src/validate.js +3 -0
- package/dist/src/validate.test.d.ts +9 -0
- package/dist/src/verify.d.ts +27 -0
- package/dist/src/verify.js +2 -0
- package/dist/src/verify.test.d.ts +8 -0
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.js +1 -0
- package/dist/src/weixin-download.test.d.ts +1 -0
- package/docs/guide/browser-bridge.md +94 -0
- package/docs/guide/electron-app-cli.md +199 -0
- package/docs/guide/exit-codes.md +24 -0
- package/docs/guide/extending-opencli.md +134 -0
- package/docs/guide/getting-started.md +81 -0
- package/docs/guide/installation.md +52 -0
- package/docs/guide/plugins.md +226 -0
- package/docs/guide/remote-orchestration.md +116 -0
- package/docs/guide/troubleshooting.md +69 -0
- package/package.json +116 -0
- package/scripts/check-doc-coverage.sh +81 -0
- package/scripts/check-listing-id-pairing.mjs +193 -0
- package/scripts/check-silent-column-drop.mjs +105 -0
- package/scripts/check-typed-error-lint.mjs +118 -0
- package/scripts/clean-dist.cjs +13 -0
- package/scripts/copy-yaml.cjs +12 -0
- package/scripts/fetch-adapters.js +293 -0
- package/scripts/minify-release.mjs +115 -0
- package/scripts/postinstall.js +174 -0
- package/scripts/silent-column-drop-baseline.json +910 -0
- package/scripts/typed-error-lint-baseline.json +1098 -0
- package/skills/opencli-adapter-author/SKILL.md +256 -0
- package/skills/opencli-adapter-author/references/adapter-template.md +471 -0
- package/skills/opencli-adapter-author/references/api-discovery.md +295 -0
- package/skills/opencli-adapter-author/references/coverage-matrix.md +81 -0
- package/skills/opencli-adapter-author/references/field-conventions.md +172 -0
- package/skills/opencli-adapter-author/references/field-decode-playbook.md +181 -0
- package/skills/opencli-adapter-author/references/jsdom-fixture-pattern.md +196 -0
- package/skills/opencli-adapter-author/references/output-design.md +149 -0
- package/skills/opencli-adapter-author/references/site-memory/bilibili.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/eastmoney.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/tonghuashun.md +51 -0
- package/skills/opencli-adapter-author/references/site-memory/xueqiu.md +58 -0
- package/skills/opencli-adapter-author/references/site-memory.md +231 -0
- package/skills/opencli-adapter-author/references/site-recon.md +134 -0
- package/skills/opencli-adapter-author/references/strategy-selection.md +169 -0
- package/skills/opencli-adapter-author/references/success-rate-pitfalls.md +162 -0
- package/skills/opencli-adapter-author/references/typed-errors.md +234 -0
- package/skills/opencli-autofix/SKILL.md +297 -0
- package/skills/opencli-browser/SKILL.md +468 -0
- package/skills/opencli-browser-sitemap/SKILL.md +96 -0
- package/skills/opencli-sitemap-author/SKILL.md +161 -0
- package/skills/opencli-sitemap-author/references/sitemap-schema.md +660 -0
- package/skills/opencli-usage/SKILL.md +168 -0
|
@@ -0,0 +1,1234 @@
|
|
|
1
|
+
import{CommandExecutionError as P}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 s=[/Gemini can make mistakes\.?/gi,/Google Terms/gi,/Google Privacy Policy/gi,/Opens in a new window/gi],i=["gemini","我的内容","对话","google terms","google privacy policy"],Y=['.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"]'],Z="data-opencli-gemini-composer",_=4,u=1;function S(f){return!!f&&typeof f==="object"&&!Array.isArray(f)}function U(f,g){if(S(f)&&Object.prototype.hasOwnProperty.call(f,"session")){if(Object.prototype.hasOwnProperty.call(f,"data"))return f.data;throw new P(`${g} returned a malformed Browser Bridge envelope`)}return f}function V(f,g){const j=U(f,g);if(!Array.isArray(j))throw new P(`${g} returned a malformed result`);return j}function $(f,g){const j=U(f,g);if(!S(j))throw new P(`${g} returned a malformed result`);return j}function Q(){const f=JSON.stringify(Y);return`
|
|
2
|
+
const isVisible = (el) => {
|
|
3
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
4
|
+
const style = window.getComputedStyle(el);
|
|
5
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
6
|
+
const rect = el.getBoundingClientRect();
|
|
7
|
+
return rect.width > 0 && rect.height > 0;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const markerAttr = ${JSON.stringify(Z)};
|
|
11
|
+
const clearComposerMarkers = (active) => {
|
|
12
|
+
document.querySelectorAll('[' + markerAttr + ']').forEach((node) => {
|
|
13
|
+
if (node !== active) node.removeAttribute(markerAttr);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const markComposer = (node) => {
|
|
18
|
+
if (!(node instanceof HTMLElement)) return null;
|
|
19
|
+
clearComposerMarkers(node);
|
|
20
|
+
node.setAttribute(markerAttr, '1');
|
|
21
|
+
return node;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const findComposer = () => {
|
|
25
|
+
const marked = document.querySelector('[' + markerAttr + '="1"]');
|
|
26
|
+
if (marked instanceof HTMLElement && isVisible(marked)) return marked;
|
|
27
|
+
|
|
28
|
+
const selectors = ${f};
|
|
29
|
+
for (const selector of selectors) {
|
|
30
|
+
const node = Array.from(document.querySelectorAll(selector)).find((candidate) => candidate instanceof HTMLElement && isVisible(candidate));
|
|
31
|
+
if (node instanceof HTMLElement) return markComposer(node);
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
`}export function resolveGeminiLabels(f,g){const j=String(f??"").trim();return j?[j]:g}export function parseGeminiTitleMatchMode(f,g="contains"){const j=String(f??g).trim().toLowerCase();if(j==="contains"||j==="exact")return j;return null}export function parseGeminiConversationUrl(f){const g=String(f??"").trim();if(!g)return null;try{const j=new URL(g);if(j.hostname!==GEMINI_DOMAIN&&!j.hostname.endsWith(`.${GEMINI_DOMAIN}`))return null;if(!j.pathname.startsWith("/app/"))return null;return j.href}catch{return null}}export function normalizeGeminiTitle(f){return f.replace(/\s+/g," ").trim().toLowerCase()}export function pickGeminiConversationByTitle(f,g,j="contains"){const q=normalizeGeminiTitle(g);if(!q)return null;for(const w of f){const v=normalizeGeminiTitle(w.Title);if(!v)continue;if(j==="exact"){if(v===q)return w;continue}if(v.includes(q))return w}return null}export function resolveGeminiConversationForQuery(f,g,j){const q=String(g??"").trim();if(!q)return f[0]??null;const w=pickGeminiConversationByTitle(f,q,"exact");if(w)return w;if(j==="contains")return pickGeminiConversationByTitle(f,q,"contains");return null}export function sanitizeGeminiResponseText(f,g){let j=f;for(const w of s)j=j.replace(w,"");j=j.trim();const q=g.trim();if(!q)return j;if(j===q)return"";for(const w of[`
|
|
36
|
+
|
|
37
|
+
`,`
|
|
38
|
+
`,`\r
|
|
39
|
+
\r
|
|
40
|
+
`,`\r
|
|
41
|
+
`]){const v=`${q}${w}`;if(j.startsWith(v))return j.slice(v.length).trim()}return j}export function collectGeminiTranscriptAdditions(f,g,j){const q=new Set(f);return g.filter((v)=>!q.has(v)).map((v)=>F(v,j)).filter((v)=>v&&v!==j).join(`
|
|
42
|
+
`).trim()}export function collapseAdjacentGeminiTurns(f){const g=[];for(const j of f){if(!j||typeof j.Role!=="string"||typeof j.Text!=="string")continue;const q=g.at(-1);if(q?.Role===j.Role&&q.Text===j.Text)continue;g.push(j)}return g}function W(f,g){if(f.length>g.length)return!1;return f.every((j,q)=>j.Role===g[q]?.Role&&j.Text===g[q]?.Text)}function c(f,g){if(!g)return null;for(let j=f.length-1;j>=0;j-=1){const q=f[j];if(q?.Role===g.Role&&q.Text===g.Text)return j}return null}function b(f,g){if(!f.structuredTurnsTrusted||!g.structuredTurnsTrusted)return{appendedTurns:[],hasTrustedAppend:!1,hasNewUserTurn:!1,hasNewAssistantTurn:!1};if(!W(f.turns,g.turns))return{appendedTurns:[],hasTrustedAppend:!1,hasNewUserTurn:!1,hasNewAssistantTurn:!1};const j=g.turns.slice(f.turns.length);return{appendedTurns:j,hasTrustedAppend:j.length>0,hasNewUserTurn:j.some((q)=>q.Role==="User"),hasNewAssistantTurn:j.some((q)=>q.Role==="Assistant")}}function y(f,g){const j=new Set(f.transcriptLines);return g.transcriptLines.filter((q)=>!j.has(q))}function d(f){const g=f.toLowerCase();return i.filter((q)=>g.includes(q)).length>=2}function F(f,g){const j=f.trim();if(!j)return"";const q=g.trim(),w=sanitizeGeminiResponseText(j,g);if(!q)return w;if(!j.includes(q))return w;if(w&&w!==q&&w!==j)return w;if(d(j))return"";if(j.startsWith(q)){const v=j.slice(q.length).replace(/^[\s::,,-]+/,"").trim();return v?sanitizeGeminiResponseText(v,""):""}return w}function a(){return`
|
|
43
|
+
(() => {
|
|
44
|
+
${Q()}
|
|
45
|
+
|
|
46
|
+
const signInNode = Array.from(document.querySelectorAll('a, button')).find((node) => {
|
|
47
|
+
const text = (node.textContent || '').trim().toLowerCase();
|
|
48
|
+
const aria = (node.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
49
|
+
const href = node.getAttribute('href') || '';
|
|
50
|
+
return text === 'sign in'
|
|
51
|
+
|| aria === 'sign in'
|
|
52
|
+
|| text === '登录'
|
|
53
|
+
|| aria === '登录'
|
|
54
|
+
|| href.includes('accounts.google.com/ServiceLogin');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const composer = findComposer();
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
url: window.location.href,
|
|
61
|
+
title: document.title || '',
|
|
62
|
+
isSignedIn: signInNode ? false : (composer ? true : null),
|
|
63
|
+
composerLabel: composer?.getAttribute('aria-label') || '',
|
|
64
|
+
canSend: !!composer,
|
|
65
|
+
};
|
|
66
|
+
})()
|
|
67
|
+
`}function G(){return`
|
|
68
|
+
(() => {
|
|
69
|
+
${Q()}
|
|
70
|
+
const composer = findComposer();
|
|
71
|
+
const composerText = composer?.textContent?.replace(/\\u00a0/g, ' ').trim() || '';
|
|
72
|
+
const isGenerating = !!Array.from(document.querySelectorAll('button, [role="button"]')).find((node) => {
|
|
73
|
+
const text = (node.textContent || '').trim().toLowerCase();
|
|
74
|
+
const aria = (node.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
75
|
+
return text === 'stop response'
|
|
76
|
+
|| aria === 'stop response'
|
|
77
|
+
|| text === '停止回答'
|
|
78
|
+
|| aria === '停止回答';
|
|
79
|
+
});
|
|
80
|
+
const turns = ${k().trim()};
|
|
81
|
+
const transcriptLines = ${h().trim()};
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
url: window.location.href,
|
|
85
|
+
turns,
|
|
86
|
+
transcriptLines,
|
|
87
|
+
composerHasText: composerText.length > 0,
|
|
88
|
+
isGenerating,
|
|
89
|
+
structuredTurnsTrusted: turns.length > 0 || transcriptLines.length === 0,
|
|
90
|
+
};
|
|
91
|
+
})()
|
|
92
|
+
`}function R(f){try{const g=new URL(f);if(g.hostname!==GEMINI_DOMAIN&&!g.hostname.endsWith(`.${GEMINI_DOMAIN}`))return!1;const j=g.pathname.replace(/\/+$/,"");return j.startsWith("/app/")&&j!=="/app"}catch{return!1}}function h(){return`
|
|
93
|
+
(() => {
|
|
94
|
+
const clean = (value) => (value || '')
|
|
95
|
+
.replace(/\\u00a0/g, ' ')
|
|
96
|
+
.replace(/\\n{3,}/g, '\\n\\n')
|
|
97
|
+
.trim();
|
|
98
|
+
|
|
99
|
+
const main = document.querySelector('main') || document.body;
|
|
100
|
+
const root = main.cloneNode(true);
|
|
101
|
+
|
|
102
|
+
const removableSelectors = [
|
|
103
|
+
'button',
|
|
104
|
+
'nav',
|
|
105
|
+
'header',
|
|
106
|
+
'footer',
|
|
107
|
+
'[aria-label="Enter a prompt for Gemini"]',
|
|
108
|
+
'[aria-label*="prompt for Gemini"]',
|
|
109
|
+
'.input-area-container',
|
|
110
|
+
'.input-wrapper',
|
|
111
|
+
'.textbox-container',
|
|
112
|
+
'.ql-toolbar',
|
|
113
|
+
'.send-button',
|
|
114
|
+
'.main-menu-button',
|
|
115
|
+
'.sign-in-button',
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
for (const selector of removableSelectors) {
|
|
119
|
+
root.querySelectorAll(selector).forEach((node) => node.remove());
|
|
120
|
+
}
|
|
121
|
+
root.querySelectorAll('script, style, noscript').forEach((node) => node.remove());
|
|
122
|
+
|
|
123
|
+
const stopLines = new Set([
|
|
124
|
+
'Gemini',
|
|
125
|
+
'Google Terms',
|
|
126
|
+
'Google Privacy Policy',
|
|
127
|
+
'Meet Gemini, your personal AI assistant',
|
|
128
|
+
'Conversation with Gemini',
|
|
129
|
+
'Ask Gemini 3',
|
|
130
|
+
'Write',
|
|
131
|
+
'Plan',
|
|
132
|
+
'Research',
|
|
133
|
+
'Learn',
|
|
134
|
+
'Fast',
|
|
135
|
+
'send',
|
|
136
|
+
'Microphone',
|
|
137
|
+
'Main menu',
|
|
138
|
+
'New chat',
|
|
139
|
+
'Sign in',
|
|
140
|
+
'Google Terms Opens in a new window',
|
|
141
|
+
'Google Privacy Policy Opens in a new window',
|
|
142
|
+
]);
|
|
143
|
+
|
|
144
|
+
const noisyPatterns = [
|
|
145
|
+
/^Google Terms$/,
|
|
146
|
+
/^Google Privacy Policy$/,
|
|
147
|
+
/^Gemini is AI and can make mistakes.?$/,
|
|
148
|
+
/^and the$/,
|
|
149
|
+
/^apply.$/,
|
|
150
|
+
/^Opens in a new window$/,
|
|
151
|
+
/^Open mode picker$/,
|
|
152
|
+
/^Open upload file menu$/,
|
|
153
|
+
/^Tools$/,
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
return clean(root.innerText || root.textContent || '')
|
|
157
|
+
.split('\\n')
|
|
158
|
+
.map((line) => clean(line))
|
|
159
|
+
.filter((line) => line
|
|
160
|
+
&& line.length <= 4000
|
|
161
|
+
&& !stopLines.has(line)
|
|
162
|
+
&& !noisyPatterns.some((pattern) => pattern.test(line)));
|
|
163
|
+
})()
|
|
164
|
+
`}function k(){return`
|
|
165
|
+
(() => {
|
|
166
|
+
const clean = (value) => (value || '')
|
|
167
|
+
.replace(/\\u00a0/g, ' ')
|
|
168
|
+
.replace(/\\n{3,}/g, '\\n\\n')
|
|
169
|
+
.trim();
|
|
170
|
+
|
|
171
|
+
const isVisible = (el) => {
|
|
172
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
173
|
+
const style = window.getComputedStyle(el);
|
|
174
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
175
|
+
const rect = el.getBoundingClientRect();
|
|
176
|
+
return rect.width > 0 && rect.height > 0;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const selectors = [
|
|
180
|
+
'[data-testid*="message"]',
|
|
181
|
+
'[data-test-id*="message"]',
|
|
182
|
+
'[class*="message"]',
|
|
183
|
+
'[class*="conversation-turn"]',
|
|
184
|
+
'[class*="query-text"]',
|
|
185
|
+
'[class*="response-text"]',
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
const roots = selectors.flatMap((selector) => Array.from(document.querySelectorAll(selector)));
|
|
189
|
+
const unique = roots
|
|
190
|
+
.filter((el, index, all) => all.indexOf(el) === index)
|
|
191
|
+
.filter(isVisible)
|
|
192
|
+
.sort((left, right) => {
|
|
193
|
+
if (left === right) return 0;
|
|
194
|
+
const relation = left.compareDocumentPosition(right);
|
|
195
|
+
if (relation & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
196
|
+
if (relation & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
197
|
+
return 0;
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
const turns = unique.map((el) => {
|
|
201
|
+
const text = clean(el.innerText || el.textContent || '');
|
|
202
|
+
if (!text) return null;
|
|
203
|
+
|
|
204
|
+
const roleAttr = [
|
|
205
|
+
el.getAttribute('data-message-author-role'),
|
|
206
|
+
el.getAttribute('data-role'),
|
|
207
|
+
el.getAttribute('aria-label'),
|
|
208
|
+
el.getAttribute('class'),
|
|
209
|
+
].filter(Boolean).join(' ').toLowerCase();
|
|
210
|
+
|
|
211
|
+
let role = '';
|
|
212
|
+
if (roleAttr.includes('user') || roleAttr.includes('query')) role = 'User';
|
|
213
|
+
else if (roleAttr.includes('assistant') || roleAttr.includes('model') || roleAttr.includes('response') || roleAttr.includes('gemini')) role = 'Assistant';
|
|
214
|
+
|
|
215
|
+
return role ? { Role: role, Text: text } : null;
|
|
216
|
+
}).filter(Boolean);
|
|
217
|
+
|
|
218
|
+
return turns;
|
|
219
|
+
})()
|
|
220
|
+
`}function e(){return`
|
|
221
|
+
(() => {
|
|
222
|
+
${Q()}
|
|
223
|
+
const composer = findComposer();
|
|
224
|
+
|
|
225
|
+
if (!(composer instanceof HTMLElement)) {
|
|
226
|
+
return { ok: false, reason: 'Could not find Gemini composer' };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
try {
|
|
230
|
+
composer.focus();
|
|
231
|
+
const selection = window.getSelection();
|
|
232
|
+
const range = document.createRange();
|
|
233
|
+
range.selectNodeContents(composer);
|
|
234
|
+
range.collapse(false);
|
|
235
|
+
selection?.removeAllRanges();
|
|
236
|
+
selection?.addRange(range);
|
|
237
|
+
composer.textContent = '';
|
|
238
|
+
composer.dispatchEvent(new InputEvent('input', { bubbles: true, data: '', inputType: 'deleteContentBackward' }));
|
|
239
|
+
} catch (error) {
|
|
240
|
+
return {
|
|
241
|
+
ok: false,
|
|
242
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
ok: true,
|
|
248
|
+
label: composer.getAttribute('aria-label') || '',
|
|
249
|
+
};
|
|
250
|
+
})()
|
|
251
|
+
`}function n(){return`
|
|
252
|
+
(() => {
|
|
253
|
+
${Q()}
|
|
254
|
+
const composer = findComposer();
|
|
255
|
+
|
|
256
|
+
return {
|
|
257
|
+
hasText: !!(composer && ((composer.textContent || '').trim() || (composer.innerText || '').trim())),
|
|
258
|
+
};
|
|
259
|
+
})()
|
|
260
|
+
`}function I(f){return`
|
|
261
|
+
((inputText) => {
|
|
262
|
+
${Q()}
|
|
263
|
+
const composer = findComposer();
|
|
264
|
+
|
|
265
|
+
if (!(composer instanceof HTMLElement)) {
|
|
266
|
+
return { hasText: false, reason: 'Could not find Gemini composer' };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const selection = window.getSelection();
|
|
270
|
+
const range = document.createRange();
|
|
271
|
+
range.selectNodeContents(composer);
|
|
272
|
+
range.collapse(false);
|
|
273
|
+
selection?.removeAllRanges();
|
|
274
|
+
selection?.addRange(range);
|
|
275
|
+
|
|
276
|
+
composer.focus();
|
|
277
|
+
composer.textContent = '';
|
|
278
|
+
const execResult = typeof document.execCommand === 'function'
|
|
279
|
+
? document.execCommand('insertText', false, inputText)
|
|
280
|
+
: false;
|
|
281
|
+
|
|
282
|
+
if (!execResult) {
|
|
283
|
+
const paragraph = document.createElement('p');
|
|
284
|
+
const lines = String(inputText).split(/\\n/);
|
|
285
|
+
for (const [index, line] of lines.entries()) {
|
|
286
|
+
if (index > 0) paragraph.appendChild(document.createElement('br'));
|
|
287
|
+
paragraph.appendChild(document.createTextNode(line));
|
|
288
|
+
}
|
|
289
|
+
composer.replaceChildren(paragraph);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
composer.dispatchEvent(new InputEvent('beforeinput', { bubbles: true, data: inputText, inputType: 'insertText' }));
|
|
293
|
+
composer.dispatchEvent(new InputEvent('input', { bubbles: true, data: inputText, inputType: 'insertText' }));
|
|
294
|
+
composer.dispatchEvent(new Event('change', { bubbles: true }));
|
|
295
|
+
|
|
296
|
+
return {
|
|
297
|
+
hasText: !!((composer.textContent || '').trim() || (composer.innerText || '').trim()),
|
|
298
|
+
};
|
|
299
|
+
})(${JSON.stringify(f)})
|
|
300
|
+
`}function m(){return`
|
|
301
|
+
(() => {
|
|
302
|
+
${Q()}
|
|
303
|
+
const composer = findComposer();
|
|
304
|
+
|
|
305
|
+
if (!(composer instanceof HTMLElement)) {
|
|
306
|
+
throw new Error('Could not find Gemini composer');
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const composerRect = composer.getBoundingClientRect();
|
|
310
|
+
const rootCandidates = [
|
|
311
|
+
composer.closest('form'),
|
|
312
|
+
composer.closest('[role="form"]'),
|
|
313
|
+
composer.closest('.input-area-container'),
|
|
314
|
+
composer.closest('.textbox-container'),
|
|
315
|
+
composer.closest('.input-wrapper'),
|
|
316
|
+
composer.parentElement,
|
|
317
|
+
composer.parentElement?.parentElement,
|
|
318
|
+
].filter(Boolean);
|
|
319
|
+
|
|
320
|
+
const seen = new Set();
|
|
321
|
+
const buttons = [];
|
|
322
|
+
for (const root of rootCandidates) {
|
|
323
|
+
root.querySelectorAll('button, [role="button"]').forEach((node) => {
|
|
324
|
+
if (!(node instanceof HTMLElement)) return;
|
|
325
|
+
if (seen.has(node)) return;
|
|
326
|
+
seen.add(node);
|
|
327
|
+
buttons.push(node);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const excludedPattern = /main menu|主菜单|microphone|麦克风|upload|上传|mode|模式|tools|工具|settings|临时对话|new chat|新对话/i;
|
|
332
|
+
const submitPattern = /send|发送|傳送|submit|提交/i;
|
|
333
|
+
let bestButton = null;
|
|
334
|
+
let bestScore = -1;
|
|
335
|
+
|
|
336
|
+
for (const button of buttons) {
|
|
337
|
+
if (!isVisible(button)) continue;
|
|
338
|
+
if (button instanceof HTMLButtonElement && button.disabled) continue;
|
|
339
|
+
if (button.getAttribute('aria-disabled') === 'true') continue;
|
|
340
|
+
|
|
341
|
+
const label = ((button.getAttribute('aria-label') || '') + ' ' + ((button.textContent || '').trim())).trim();
|
|
342
|
+
if (excludedPattern.test(label)) continue;
|
|
343
|
+
|
|
344
|
+
const rect = button.getBoundingClientRect();
|
|
345
|
+
const verticalDistance = Math.abs((rect.top + rect.bottom) / 2 - (composerRect.top + composerRect.bottom) / 2);
|
|
346
|
+
if (verticalDistance > 160) continue;
|
|
347
|
+
|
|
348
|
+
let score = 0;
|
|
349
|
+
if (submitPattern.test(label)) score += 10;
|
|
350
|
+
if (rect.left >= composerRect.right - 160) score += 3;
|
|
351
|
+
if (rect.left >= composerRect.left) score += 1;
|
|
352
|
+
if (rect.width <= 96 && rect.height <= 96) score += 1;
|
|
353
|
+
|
|
354
|
+
if (score > bestScore) {
|
|
355
|
+
bestScore = score;
|
|
356
|
+
bestButton = button;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (bestButton instanceof HTMLElement && bestScore >= 3) {
|
|
361
|
+
bestButton.click();
|
|
362
|
+
return 'button';
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return 'enter';
|
|
366
|
+
})()
|
|
367
|
+
`}function A(){return`
|
|
368
|
+
(() => {
|
|
369
|
+
${Q()}
|
|
370
|
+
const composer = findComposer();
|
|
371
|
+
|
|
372
|
+
if (!(composer instanceof HTMLElement)) {
|
|
373
|
+
throw new Error('Could not find Gemini composer');
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
composer.focus();
|
|
377
|
+
composer.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true }));
|
|
378
|
+
composer.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true }));
|
|
379
|
+
return 'enter';
|
|
380
|
+
})()
|
|
381
|
+
`}function o(){return`
|
|
382
|
+
(() => {
|
|
383
|
+
const isVisible = (el) => {
|
|
384
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
385
|
+
const style = window.getComputedStyle(el);
|
|
386
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
387
|
+
const rect = el.getBoundingClientRect();
|
|
388
|
+
return rect.width > 0 && rect.height > 0;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
const candidates = Array.from(document.querySelectorAll('button, a')).filter((node) => {
|
|
392
|
+
const text = (node.textContent || '').trim().toLowerCase();
|
|
393
|
+
const aria = (node.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
394
|
+
return isVisible(node) && (
|
|
395
|
+
text === 'new chat'
|
|
396
|
+
|| aria === 'new chat'
|
|
397
|
+
|| text === '发起新对话'
|
|
398
|
+
|| aria === '发起新对话'
|
|
399
|
+
|| text === '新对话'
|
|
400
|
+
|| aria === '新对话'
|
|
401
|
+
);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
const target = candidates.find((node) => !node.hasAttribute('disabled')) || candidates[0];
|
|
405
|
+
if (target instanceof HTMLElement) {
|
|
406
|
+
target.click();
|
|
407
|
+
return 'clicked';
|
|
408
|
+
}
|
|
409
|
+
return 'navigate';
|
|
410
|
+
})()
|
|
411
|
+
`}function t(){return`
|
|
412
|
+
(() => {
|
|
413
|
+
const labels = ['tools', 'tool', 'mode', '研究', 'deep research', 'deep-research', '工具'];
|
|
414
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim().toLowerCase();
|
|
415
|
+
const matchesLabel = (value) => {
|
|
416
|
+
const text = normalize(value);
|
|
417
|
+
return labels.some((label) => text.includes(label));
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
const isDisabled = (el) => {
|
|
421
|
+
if (!(el instanceof HTMLElement)) return true;
|
|
422
|
+
if ('disabled' in el && el.disabled) return true;
|
|
423
|
+
if (el.hasAttribute('disabled')) return true;
|
|
424
|
+
const ariaDisabled = (el.getAttribute('aria-disabled') || '').toLowerCase();
|
|
425
|
+
return ariaDisabled === 'true';
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
const isVisible = (el) => {
|
|
429
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
430
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
431
|
+
const ariaHidden = el.getAttribute('aria-hidden');
|
|
432
|
+
if (ariaHidden && ariaHidden.toLowerCase() === 'true') return false;
|
|
433
|
+
if (el.closest('[aria-hidden="true"]')) return false;
|
|
434
|
+
const style = window.getComputedStyle(el);
|
|
435
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
436
|
+
if (Number(style.opacity) === 0) return false;
|
|
437
|
+
if (style.pointerEvents === 'none') return false;
|
|
438
|
+
const rect = el.getBoundingClientRect();
|
|
439
|
+
return rect.width > 0 && rect.height > 0;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
const isInteractable = (el) => isVisible(el) && !isDisabled(el);
|
|
443
|
+
|
|
444
|
+
const roots = [
|
|
445
|
+
document.querySelector('main'),
|
|
446
|
+
document.querySelector('[role="main"]'),
|
|
447
|
+
document.querySelector('header'),
|
|
448
|
+
document,
|
|
449
|
+
].filter(Boolean);
|
|
450
|
+
|
|
451
|
+
const isMenuTrigger = (node) => {
|
|
452
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
453
|
+
const popupValue = (node.getAttribute('aria-haspopup') || '').toLowerCase();
|
|
454
|
+
const hasPopup = popupValue === 'menu' || popupValue === 'listbox' || popupValue === 'true';
|
|
455
|
+
const controls = (node.getAttribute('aria-controls') || '').toLowerCase();
|
|
456
|
+
const hasControls = ['menu', 'listbox', 'popup'].some((token) => controls.includes(token));
|
|
457
|
+
return hasPopup || hasControls;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
const menuAlreadyOpen = () => {
|
|
461
|
+
const visibleMenus = Array.from(document.querySelectorAll('[role="menu"], [role="listbox"]')).filter(isVisible);
|
|
462
|
+
const labeledMenu = visibleMenus.some((menu) => {
|
|
463
|
+
const text = menu.textContent || '';
|
|
464
|
+
const aria = menu.getAttribute('aria-label') || '';
|
|
465
|
+
return matchesLabel(text) || matchesLabel(aria);
|
|
466
|
+
});
|
|
467
|
+
if (labeledMenu) return true;
|
|
468
|
+
const expanded = Array.from(document.querySelectorAll('[aria-expanded="true"]')).filter(isVisible);
|
|
469
|
+
return expanded.some((node) => {
|
|
470
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
471
|
+
const text = node.textContent || '';
|
|
472
|
+
const aria = node.getAttribute('aria-label') || '';
|
|
473
|
+
return isMenuTrigger(node) && (matchesLabel(text) || matchesLabel(aria));
|
|
474
|
+
});
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
if (menuAlreadyOpen()) return true;
|
|
478
|
+
|
|
479
|
+
const pickTarget = (root) => {
|
|
480
|
+
const nodes = Array.from(root.querySelectorAll('button, [role="button"]')).filter(isInteractable);
|
|
481
|
+
const matches = nodes.filter((node) => {
|
|
482
|
+
const text = (node.textContent || '').trim().toLowerCase();
|
|
483
|
+
const aria = (node.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
484
|
+
if (!text && !aria) return false;
|
|
485
|
+
return matchesLabel(text) || matchesLabel(aria);
|
|
486
|
+
});
|
|
487
|
+
if (matches.length === 0) return null;
|
|
488
|
+
const menuMatches = matches.filter((node) => isMenuTrigger(node));
|
|
489
|
+
return menuMatches[0] || matches[0];
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
let target = null;
|
|
493
|
+
for (const root of roots) {
|
|
494
|
+
target = pickTarget(root);
|
|
495
|
+
if (target) break;
|
|
496
|
+
}
|
|
497
|
+
if (target instanceof HTMLElement) {
|
|
498
|
+
target.click();
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
return false;
|
|
502
|
+
})()
|
|
503
|
+
`}function r(f){return`
|
|
504
|
+
((targetLabels) => {
|
|
505
|
+
const isDisabled = (el) => {
|
|
506
|
+
if (!(el instanceof HTMLElement)) return true;
|
|
507
|
+
if ('disabled' in el && el.disabled) return true;
|
|
508
|
+
if (el.hasAttribute('disabled')) return true;
|
|
509
|
+
const ariaDisabled = (el.getAttribute('aria-disabled') || '').toLowerCase();
|
|
510
|
+
return ariaDisabled === 'true';
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
const isVisible = (el) => {
|
|
514
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
515
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
516
|
+
const ariaHidden = el.getAttribute('aria-hidden');
|
|
517
|
+
if (ariaHidden && ariaHidden.toLowerCase() === 'true') return false;
|
|
518
|
+
if (el.closest('[aria-hidden="true"]')) return false;
|
|
519
|
+
const style = window.getComputedStyle(el);
|
|
520
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
521
|
+
if (Number(style.opacity) === 0) return false;
|
|
522
|
+
if (style.pointerEvents === 'none') return false;
|
|
523
|
+
const rect = el.getBoundingClientRect();
|
|
524
|
+
return rect.width > 0 && rect.height > 0;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
const isInteractable = (el) => isVisible(el) && !isDisabled(el);
|
|
528
|
+
|
|
529
|
+
const normalized = Array.isArray(targetLabels)
|
|
530
|
+
? targetLabels.map((label) => String(label || '').trim()).filter((label) => label)
|
|
531
|
+
: [];
|
|
532
|
+
const lowered = normalized.map((label) => label.toLowerCase());
|
|
533
|
+
if (lowered.length === 0) return '';
|
|
534
|
+
|
|
535
|
+
const menuSelectors = [
|
|
536
|
+
'[role="menu"]',
|
|
537
|
+
'[role="listbox"]',
|
|
538
|
+
'[aria-label*="tool" i]',
|
|
539
|
+
'[aria-label*="mode" i]',
|
|
540
|
+
'[aria-modal="true"]',
|
|
541
|
+
];
|
|
542
|
+
const menuRoots = Array.from(document.querySelectorAll(menuSelectors.join(','))).filter(isVisible);
|
|
543
|
+
if (menuRoots.length === 0) return '';
|
|
544
|
+
const seen = new Set();
|
|
545
|
+
|
|
546
|
+
for (const root of menuRoots) {
|
|
547
|
+
const candidates = Array.from(root.querySelectorAll('button, [role="menuitem"], [role="option"], [role="button"], a, li'));
|
|
548
|
+
for (const node of candidates) {
|
|
549
|
+
if (seen.has(node)) continue;
|
|
550
|
+
seen.add(node);
|
|
551
|
+
if (!isInteractable(node)) continue;
|
|
552
|
+
const text = (node.textContent || '').trim().toLowerCase();
|
|
553
|
+
const aria = (node.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
554
|
+
if (!text && !aria) continue;
|
|
555
|
+
const combined = \`\${text} \${aria}\`.trim();
|
|
556
|
+
for (let index = 0; index < lowered.length; index += 1) {
|
|
557
|
+
const label = lowered[index];
|
|
558
|
+
if (label && combined.includes(label)) {
|
|
559
|
+
if (node instanceof HTMLElement) node.click();
|
|
560
|
+
return normalized[index];
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
return '';
|
|
567
|
+
})(${JSON.stringify(f)})
|
|
568
|
+
`}function ff(f){return`
|
|
569
|
+
((targetLabels) => {
|
|
570
|
+
const isDisabled = (el) => {
|
|
571
|
+
if (!(el instanceof HTMLElement)) return true;
|
|
572
|
+
if ('disabled' in el && el.disabled) return true;
|
|
573
|
+
if (el.hasAttribute('disabled')) return true;
|
|
574
|
+
const ariaDisabled = (el.getAttribute('aria-disabled') || '').toLowerCase();
|
|
575
|
+
return ariaDisabled === 'true';
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const isVisible = (el) => {
|
|
579
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
580
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
581
|
+
const ariaHidden = el.getAttribute('aria-hidden');
|
|
582
|
+
if (ariaHidden && ariaHidden.toLowerCase() === 'true') return false;
|
|
583
|
+
if (el.closest('[aria-hidden="true"]')) return false;
|
|
584
|
+
const style = window.getComputedStyle(el);
|
|
585
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
586
|
+
if (Number(style.opacity) === 0) return false;
|
|
587
|
+
if (style.pointerEvents === 'none') return false;
|
|
588
|
+
const rect = el.getBoundingClientRect();
|
|
589
|
+
return rect.width > 0 && rect.height > 0;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
const isInteractable = (el) => isVisible(el) && !isDisabled(el);
|
|
593
|
+
|
|
594
|
+
const normalized = Array.isArray(targetLabels)
|
|
595
|
+
? targetLabels.map((label) => String(label || '').trim()).filter((label) => label)
|
|
596
|
+
: [];
|
|
597
|
+
const lowered = normalized.map((label) => label.toLowerCase());
|
|
598
|
+
if (lowered.length === 0) return '';
|
|
599
|
+
|
|
600
|
+
const dialogRoots = Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"]')).filter(isVisible);
|
|
601
|
+
const mainRoot = document.querySelector('main');
|
|
602
|
+
const primaryRoots = [...dialogRoots, mainRoot].filter(Boolean).filter(isVisible);
|
|
603
|
+
const rootGroups = primaryRoots.length > 0 ? [primaryRoots, [document]] : [[document]];
|
|
604
|
+
const seen = new Set();
|
|
605
|
+
|
|
606
|
+
for (const roots of rootGroups) {
|
|
607
|
+
for (const root of roots) {
|
|
608
|
+
const candidates = Array.from(root.querySelectorAll('button, [role="button"]'));
|
|
609
|
+
for (const node of candidates) {
|
|
610
|
+
if (seen.has(node)) continue;
|
|
611
|
+
seen.add(node);
|
|
612
|
+
if (!isInteractable(node)) continue;
|
|
613
|
+
const text = (node.textContent || '').trim().toLowerCase();
|
|
614
|
+
const aria = (node.getAttribute('aria-label') || '').trim().toLowerCase();
|
|
615
|
+
if (!text && !aria) continue;
|
|
616
|
+
const combined = \`\${text} \${aria}\`.trim();
|
|
617
|
+
for (let index = 0; index < lowered.length; index += 1) {
|
|
618
|
+
const label = lowered[index];
|
|
619
|
+
if (label && combined.includes(label)) {
|
|
620
|
+
if (node instanceof HTMLElement) node.click();
|
|
621
|
+
return normalized[index];
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
return '';
|
|
629
|
+
})(${JSON.stringify(f)})
|
|
630
|
+
`}function gf(){return`
|
|
631
|
+
(() => {
|
|
632
|
+
const normalizeText = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
633
|
+
const clampText = (value, maxLength) => {
|
|
634
|
+
const normalized = normalizeText(value);
|
|
635
|
+
if (!normalized) return '';
|
|
636
|
+
if (normalized.length <= maxLength) return normalized;
|
|
637
|
+
return normalized.slice(0, maxLength).trim();
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
const isVisible = (el) => {
|
|
641
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
642
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
643
|
+
const ariaHidden = el.getAttribute('aria-hidden');
|
|
644
|
+
if (ariaHidden && ariaHidden.toLowerCase() === 'true') return false;
|
|
645
|
+
if (el.closest('[aria-hidden="true"]')) return false;
|
|
646
|
+
const style = window.getComputedStyle(el);
|
|
647
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
648
|
+
if (Number(style.opacity) === 0) return false;
|
|
649
|
+
if (style.pointerEvents === 'none') return false;
|
|
650
|
+
const rect = el.getBoundingClientRect();
|
|
651
|
+
return rect.width > 0 && rect.height > 0;
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
const selector = 'a[href*="/app"]';
|
|
655
|
+
const navRoots = Array.from(document.querySelectorAll('nav, aside, [role="navigation"]'));
|
|
656
|
+
const rootsWithLinks = navRoots.filter((root) => root.querySelector(selector));
|
|
657
|
+
const roots = rootsWithLinks.length > 0 ? rootsWithLinks : [document];
|
|
658
|
+
|
|
659
|
+
const results = [];
|
|
660
|
+
const seen = new Set();
|
|
661
|
+
const maxLength = 200;
|
|
662
|
+
|
|
663
|
+
for (const root of roots) {
|
|
664
|
+
const anchors = Array.from(root.querySelectorAll(selector));
|
|
665
|
+
for (const anchor of anchors) {
|
|
666
|
+
if (!(anchor instanceof HTMLAnchorElement)) continue;
|
|
667
|
+
if (!isVisible(anchor)) continue;
|
|
668
|
+
const href = anchor.getAttribute('href') || '';
|
|
669
|
+
if (!href) continue;
|
|
670
|
+
let url = '';
|
|
671
|
+
try {
|
|
672
|
+
url = new URL(href, 'https://gemini.google.com').href;
|
|
673
|
+
} catch {
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
if (!url) continue;
|
|
677
|
+
const title = clampText(anchor.textContent || anchor.getAttribute('aria-label') || '', maxLength);
|
|
678
|
+
if (!title) continue;
|
|
679
|
+
const key = url + '::' + title;
|
|
680
|
+
if (seen.has(key)) continue;
|
|
681
|
+
seen.add(key);
|
|
682
|
+
results.push({ title, url });
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
return results;
|
|
687
|
+
})()
|
|
688
|
+
`}function x(){return`
|
|
689
|
+
(() => {
|
|
690
|
+
const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
691
|
+
const isVisible = (el) => {
|
|
692
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
693
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
694
|
+
const ariaHidden = (el.getAttribute('aria-hidden') || '').toLowerCase();
|
|
695
|
+
if (ariaHidden === 'true' || el.closest('[aria-hidden="true"]')) return false;
|
|
696
|
+
const style = window.getComputedStyle(el);
|
|
697
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
698
|
+
if (Number(style.opacity) === 0) return false;
|
|
699
|
+
const rect = el.getBoundingClientRect();
|
|
700
|
+
return rect.width > 0 && rect.height > 0;
|
|
701
|
+
};
|
|
702
|
+
let changed = false;
|
|
703
|
+
const buttons = Array.from(document.querySelectorAll('button')).filter(isVisible);
|
|
704
|
+
|
|
705
|
+
// 1. Open the sidebar if it is collapsed (button only renders when closed).
|
|
706
|
+
const openSidebar = buttons.find((b) => {
|
|
707
|
+
const label = normalize(b.getAttribute('aria-label') || '');
|
|
708
|
+
return /打开边栏|open sidebar|open navigation|展开边栏/i.test(label);
|
|
709
|
+
});
|
|
710
|
+
if (openSidebar) { openSidebar.click(); changed = true; }
|
|
711
|
+
|
|
712
|
+
// 2. Expand the "最近" / "Recents" toggle if it is currently collapsed.
|
|
713
|
+
const recentToggle = buttons.find((b) => {
|
|
714
|
+
const label = normalize(b.getAttribute('aria-label') || '');
|
|
715
|
+
const expanded = (b.getAttribute('aria-expanded') || '').toLowerCase();
|
|
716
|
+
return /最近|recent/i.test(label) && (
|
|
717
|
+
/展开|收起|expand|collapse|toggle|show|hide/i.test(label)
|
|
718
|
+
|| expanded === 'false'
|
|
719
|
+
|| expanded === 'true'
|
|
720
|
+
);
|
|
721
|
+
});
|
|
722
|
+
if (recentToggle) {
|
|
723
|
+
const label = normalize(recentToggle.getAttribute('aria-label') || '');
|
|
724
|
+
const expanded = (recentToggle.getAttribute('aria-expanded') || '').toLowerCase();
|
|
725
|
+
const explicitExpandLabel = /展开|显示|expand|show/i.test(label) && !/收起|collapse|hide/i.test(label);
|
|
726
|
+
if (expanded === 'false' || (expanded !== 'true' && explicitExpandLabel)) {
|
|
727
|
+
recentToggle.click();
|
|
728
|
+
changed = true;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return changed;
|
|
733
|
+
})()
|
|
734
|
+
`}function jf(f){const g=normalizeGeminiTitle(f);return`
|
|
735
|
+
((targetQuery) => {
|
|
736
|
+
const normalizeText = (value) => String(value || '').replace(/\\s+/g, ' ').trim().toLowerCase();
|
|
737
|
+
const isDisabled = (el) => {
|
|
738
|
+
if (!(el instanceof HTMLElement)) return true;
|
|
739
|
+
if ('disabled' in el && el.disabled) return true;
|
|
740
|
+
if (el.hasAttribute('disabled')) return true;
|
|
741
|
+
const ariaDisabled = (el.getAttribute('aria-disabled') || '').toLowerCase();
|
|
742
|
+
return ariaDisabled === 'true';
|
|
743
|
+
};
|
|
744
|
+
const isVisible = (el) => {
|
|
745
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
746
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
747
|
+
const ariaHidden = (el.getAttribute('aria-hidden') || '').toLowerCase();
|
|
748
|
+
if (ariaHidden === 'true' || el.closest('[aria-hidden="true"]')) return false;
|
|
749
|
+
const style = window.getComputedStyle(el);
|
|
750
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
751
|
+
if (Number(style.opacity) === 0 || style.pointerEvents === 'none') return false;
|
|
752
|
+
const rect = el.getBoundingClientRect();
|
|
753
|
+
return rect.width > 0 && rect.height > 0;
|
|
754
|
+
};
|
|
755
|
+
const selector = 'nav a[href*="/app"], aside a[href*="/app"], [role="navigation"] a[href*="/app"], a[href*="/app"]';
|
|
756
|
+
const anchors = Array.from(document.querySelectorAll(selector));
|
|
757
|
+
|
|
758
|
+
for (const anchor of anchors) {
|
|
759
|
+
if (!(anchor instanceof HTMLAnchorElement)) continue;
|
|
760
|
+
if (!isVisible(anchor)) continue;
|
|
761
|
+
if (isDisabled(anchor)) continue;
|
|
762
|
+
const title = normalizeText(anchor.textContent || anchor.getAttribute('aria-label') || '');
|
|
763
|
+
if (!title || !targetQuery) continue;
|
|
764
|
+
if (!title.includes(targetQuery)) continue;
|
|
765
|
+
anchor.click();
|
|
766
|
+
return true;
|
|
767
|
+
}
|
|
768
|
+
return false;
|
|
769
|
+
})(${JSON.stringify(g)})
|
|
770
|
+
`}function C(){return"window.location.href"}export async function isOnGemini(f){const g=await f.evaluate(C()).catch(()=>"");if(typeof g!=="string"||!g)return!1;try{const j=new URL(g).hostname;return j===GEMINI_DOMAIN||j.endsWith(`.${GEMINI_DOMAIN}`)}catch{return!1}}export async function ensureGeminiPage(f){if(!await isOnGemini(f)){await f.goto(GEMINI_APP_URL,{waitUntil:"load",settleMs:2500});await f.wait(1)}}export async function getCurrentGeminiUrl(f){await ensureGeminiPage(f);const g=await f.evaluate(C()).catch(()=>"");if(typeof g==="string"&&g.trim())return g;return GEMINI_APP_URL}export async function openGeminiToolsMenu(f){await ensureGeminiPage(f);if(await f.evaluate(t())){await f.wait(0.5);return!0}return!1}export async function selectGeminiTool(f,g){await ensureGeminiPage(f);await openGeminiToolsMenu(f);const j=await f.evaluate(r(g));return typeof j==="string"?j:""}export async function waitForGeminiConfirmButton(f,g,j){await ensureGeminiPage(f);const q=1,w=Math.max(1,Math.ceil(j/q));for(let v=0;v<w;v+=1){await f.wait(v===0?0.5:q);const z=await f.evaluate(ff(g));if(typeof z==="string"&&z)return z}return""}export async function getGeminiPageState(f){await ensureGeminiPage(f);return $(await f.evaluate(a()),"Gemini status")}export async function startNewGeminiChat(f){await ensureGeminiPage(f);const g=await f.evaluate(o());if(g==="navigate")await f.goto(GEMINI_APP_URL,{waitUntil:"load",settleMs:2500});await f.wait(1);return g}export async function getGeminiConversationList(f){await ensureGeminiPage(f);let g=[];for(let j=0;j<3;j+=1){g=V(await f.evaluate(gf()),"Gemini conversation list").flatMap((z)=>{if(!S(z)||typeof z.title!=="string"||typeof z.url!=="string")throw new P("Gemini conversation list returned a malformed row");if(!R(z.url))return[];return{Title:z.title,Url:z.url}});if(g.length>0)break;const v=U(await f.evaluate(x()),"Gemini sidebar expand")===!0;await f.wait(j===0?1.2:0.6);if(!v&&j>0)break}return g}export async function clickGeminiConversationByTitle(f,g){await ensureGeminiPage(f);const j=normalizeGeminiTitle(g);if(!j)return!1;const q=await f.evaluate(jf(j));if(q)await f.wait(1);return!!q}export async function getGeminiVisibleTurns(f){const g=await qf(f);if(Array.isArray(g)&&g.length>0)return g;return(await getGeminiTranscriptLines(f)).map((q)=>({Role:"System",Text:q}))}async function qf(f){await ensureGeminiPage(f);const g=V(await f.evaluate(k()),"Gemini visible turns");for(const q of g)if(!S(q)||typeof q.Role!=="string"||typeof q.Text!=="string")throw new P("Gemini visible turns returned a malformed row");const j=collapseAdjacentGeminiTurns(g);return Array.isArray(j)?j:[]}export async function getGeminiTranscriptLines(f){await ensureGeminiPage(f);const g=V(await f.evaluate(h()),"Gemini transcript lines");if(!g.every((j)=>typeof j==="string"))throw new P("Gemini transcript lines returned a malformed row");return g}export async function waitForGeminiTranscript(f,g=5){let j=[];for(let q=0;q<g;q+=1){j=await getGeminiTranscriptLines(f);if(j.length>0)return j;if(q<g-1)await f.wait(1)}return j}export async function getLatestGeminiAssistantResponse(f){await ensureGeminiPage(f);const j=[...await getGeminiVisibleTurns(f)].reverse().find((w)=>w.Role==="Assistant");if(j?.Text)return sanitizeGeminiResponseText(j.Text,"");return(await getGeminiTranscriptLines(f)).join(`
|
|
771
|
+
`).trim()}export async function readGeminiSnapshot(f){await ensureGeminiPage(f);const g=$(await f.evaluate(G()),"Gemini page snapshot");if(!Array.isArray(g.turns)||!Array.isArray(g.transcriptLines)||typeof g.composerHasText!=="boolean"||typeof g.isGenerating!=="boolean"||typeof g.structuredTurnsTrusted!=="boolean")throw new P("Gemini page snapshot returned a malformed result");return g}function vf(f){for(let g=f.length-1;g>=0;g-=1)if(f[g]?.Role==="User")return g;return null}function X(f){const g=vf(f);return g===null?null:f[g]??null}export async function waitForGeminiSubmission(f,g,j){const q=g.turns.filter((v)=>v.Role==="Assistant").length,w=Math.max(1,Math.ceil(j));for(let v=0;v<w;v+=1){await f.wait(v===0?0.5:1);const z=await readGeminiSnapshot(f),H=b(g,z),D=y(g,z);if(H.hasTrustedAppend&&H.hasNewUserTurn)return{snapshot:z,preSendAssistantCount:q,userAnchorTurn:X(z.turns),reason:"user_turn"};if(!z.composerHasText&&z.isGenerating)return{snapshot:z,preSendAssistantCount:q,userAnchorTurn:X(z.turns),reason:"composer_generating"};const J=!z.url||R(String(z.url));if(!z.composerHasText&&D.length>0&&J)return{snapshot:z,preSendAssistantCount:q,userAnchorTurn:X(z.turns),reason:"composer_transcript"}}return null}export async function sendGeminiMessage(f,g){await ensureGeminiPage(f);let j;for(let v=0;v<_;v+=1){j=await f.evaluate(e());if(j?.ok)break;if(v<_-1)await f.wait(u)}if(!j?.ok)throw new P(j?.reason||"Could not find Gemini composer");let q=!1;if(f.nativeType)try{await f.nativeType(g);await f.wait(0.2);q=!!(await f.evaluate(n()))?.hasText}catch{}if(!q)q=!!(await f.evaluate(I(g)))?.hasText;if(!q)throw new P("Failed to insert text into Gemini composer");if(await f.evaluate(m())==="button"){await f.wait(1);return"button"}if(f.nativeKeyPress)try{await f.nativeKeyPress("Enter")}catch{await f.evaluate(A())}else await f.evaluate(A());await f.wait(1);return"enter"}function wf(f){if(!Array.isArray(f))return[];const g=new Set,j=[];for(const q of f){const w=String(q??"").trim();if(!w||g.has(w))continue;g.add(w);j.push(w)}return j}export function pickGeminiDeepResearchExportUrl(f,g){let j=-1/0,q="",w="none";const v={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 z of f){const H=z.match(/^([a-z-]+)::(.+)$/i),D=(H?.[1]??"performance").toLowerCase(),J=(H?.[2]??z).trim();if(!J)continue;let B=J,N=!1;if(J.startsWith("blob:"))N=!0;else try{B=new URL(J,g).href}catch{continue}if(!N)try{const p=new URL(B);if(!["http:","https:"].includes(p.protocol))continue}catch{continue}const E=/\.md(?:$|[?#])/i.test(B)||/markdown/i.test(B),K=/export|download|attachment|file|save-report/i.test(B),L=/docs\.google\.com\/document\//i.test(B),O=/docs\.google\.com\/spreadsheets\//i.test(B),l=/cspreport|allowlist|gen_204|telemetry|metrics|analytics|doubleclick|logging|collect|favicon/i.test(B);let M=v[D]??20;if(E)M+=45;if(K)M+=25;if(L)M+=100;if(O)M-=160;if(/gemini\.google\.com\/app\//i.test(B))M-=60;if(/googleapis\.com|gstatic\.com|doubleclick\.net|google-analytics/i.test(B))M-=40;if(!E&&!K&&!N)M-=40;if(l)M-=120;if(B===g)M-=80;if(N)M+=25;if(M>j){j=M;q=B;if(N)w="blob";else if(D==="open")w="window-open";else if(D==="anchor")w="anchor";else if(D==="performance")w="performance";else w="network"}}if(!q||j<60)return{url:"",source:"none"};return{url:q,source:w}}function zf(f){return`
|
|
772
|
+
(async () => {
|
|
773
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
774
|
+
const labels = {
|
|
775
|
+
actionMenu: ['open menu for conversation actions', 'conversation actions', '会话操作'],
|
|
776
|
+
share: ['share & export', 'share and export', 'share/export', '分享与导出', '分享和导出', '分享并导出', '共享和导出'],
|
|
777
|
+
shareConversation: ['share conversation', '分享会话', '分享对话'],
|
|
778
|
+
export: ['export', '导出'],
|
|
779
|
+
exportDocs: ['export to docs', 'export to google docs', 'export to doc', '导出到 docs', '导出到文档', '导出到 google docs'],
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
const recorderKey = '__opencliGeminiExportUrls';
|
|
783
|
+
const patchedKey = '__opencliGeminiExportPatched';
|
|
784
|
+
const trace = [];
|
|
785
|
+
const tracePush = (step, detail = '') => {
|
|
786
|
+
const entry = detail ? step + ':' + detail : step;
|
|
787
|
+
trace.push(entry);
|
|
788
|
+
if (trace.length > 80) trace.shift();
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim().toLowerCase();
|
|
792
|
+
const normalizeLabels = (values) => {
|
|
793
|
+
if (!Array.isArray(values)) return [];
|
|
794
|
+
return values.map((value) => normalize(value)).filter(Boolean);
|
|
795
|
+
};
|
|
796
|
+
const includesAny = (value, candidates) => {
|
|
797
|
+
const text = normalize(value);
|
|
798
|
+
if (!text) return false;
|
|
799
|
+
return candidates.some((candidate) => text.includes(candidate));
|
|
800
|
+
};
|
|
801
|
+
const labelsNormalized = {
|
|
802
|
+
actionMenu: normalizeLabels(labels.actionMenu),
|
|
803
|
+
share: normalizeLabels(labels.share),
|
|
804
|
+
shareConversation: normalizeLabels(labels.shareConversation),
|
|
805
|
+
export: normalizeLabels(labels.export),
|
|
806
|
+
exportDocs: normalizeLabels(labels.exportDocs),
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
const queryAllDeep = (roots, selector) => {
|
|
810
|
+
const seed = Array.isArray(roots) && roots.length > 0 ? roots : [document];
|
|
811
|
+
const seenScopes = new Set();
|
|
812
|
+
const seenElements = new Set();
|
|
813
|
+
const out = [];
|
|
814
|
+
const queue = [...seed];
|
|
815
|
+
while (queue.length > 0) {
|
|
816
|
+
const scope = queue.shift();
|
|
817
|
+
const isValidScope = scope === document
|
|
818
|
+
|| scope instanceof Document
|
|
819
|
+
|| scope instanceof Element
|
|
820
|
+
|| scope instanceof ShadowRoot;
|
|
821
|
+
if (!isValidScope || seenScopes.has(scope)) continue;
|
|
822
|
+
seenScopes.add(scope);
|
|
823
|
+
|
|
824
|
+
let nodes = [];
|
|
825
|
+
try {
|
|
826
|
+
nodes = Array.from(scope.querySelectorAll(selector));
|
|
827
|
+
} catch {}
|
|
828
|
+
|
|
829
|
+
for (const node of nodes) {
|
|
830
|
+
if (!(node instanceof Element)) continue;
|
|
831
|
+
if (!seenElements.has(node)) {
|
|
832
|
+
seenElements.add(node);
|
|
833
|
+
out.push(node);
|
|
834
|
+
}
|
|
835
|
+
if (node.shadowRoot) queue.push(node.shadowRoot);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
let descendants = [];
|
|
839
|
+
try {
|
|
840
|
+
descendants = Array.from(scope.querySelectorAll('*'));
|
|
841
|
+
} catch {}
|
|
842
|
+
for (const child of descendants) {
|
|
843
|
+
if (child instanceof Element && child.shadowRoot) queue.push(child.shadowRoot);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return out;
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
const isVisible = (el) => {
|
|
850
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
851
|
+
if (el.hidden || el.closest('[hidden]')) return false;
|
|
852
|
+
const ariaHidden = (el.getAttribute('aria-hidden') || '').toLowerCase();
|
|
853
|
+
if (ariaHidden === 'true' || el.closest('[aria-hidden="true"]')) return false;
|
|
854
|
+
const style = window.getComputedStyle(el);
|
|
855
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
856
|
+
if (Number(style.opacity) === 0 || style.pointerEvents === 'none') return false;
|
|
857
|
+
const rect = el.getBoundingClientRect();
|
|
858
|
+
return rect.width > 0 && rect.height > 0;
|
|
859
|
+
};
|
|
860
|
+
const isDisabled = (el) => {
|
|
861
|
+
if (!(el instanceof HTMLElement)) return true;
|
|
862
|
+
if ('disabled' in el && el.disabled) return true;
|
|
863
|
+
if (el.hasAttribute('disabled')) return true;
|
|
864
|
+
return (el.getAttribute('aria-disabled') || '').toLowerCase() === 'true';
|
|
865
|
+
};
|
|
866
|
+
const isInteractable = (el) => isVisible(el) && !isDisabled(el);
|
|
867
|
+
const textOf = (node) => [
|
|
868
|
+
node?.textContent || '',
|
|
869
|
+
node instanceof HTMLElement ? (node.innerText || '') : '',
|
|
870
|
+
node?.getAttribute?.('aria-label') || '',
|
|
871
|
+
node?.getAttribute?.('title') || '',
|
|
872
|
+
node?.getAttribute?.('data-tooltip') || '',
|
|
873
|
+
node?.getAttribute?.('mattooltip') || '',
|
|
874
|
+
].join(' ');
|
|
875
|
+
const hasTokens = (value, tokens) => {
|
|
876
|
+
const normalized = normalize(value);
|
|
877
|
+
if (!normalized) return false;
|
|
878
|
+
return tokens.every((token) => normalized.includes(token));
|
|
879
|
+
};
|
|
880
|
+
const isKindMatch = (kind, combined, targetLabels) => {
|
|
881
|
+
if (includesAny(combined, targetLabels)) return true;
|
|
882
|
+
if (kind === 'share') return hasTokens(combined, ['share', 'export']) || hasTokens(combined, ['分享', '导出']);
|
|
883
|
+
if (kind === 'export') return hasTokens(combined, ['export']) || hasTokens(combined, ['导出']);
|
|
884
|
+
if (kind === 'export-docs') {
|
|
885
|
+
return hasTokens(combined, ['export', 'docs'])
|
|
886
|
+
|| hasTokens(combined, ['导出', '文档'])
|
|
887
|
+
|| hasTokens(combined, ['导出', 'docs']);
|
|
888
|
+
}
|
|
889
|
+
if (kind === 'action-menu') {
|
|
890
|
+
return hasTokens(combined, ['conversation', 'action']) || hasTokens(combined, ['会话', '操作']);
|
|
891
|
+
}
|
|
892
|
+
return false;
|
|
893
|
+
};
|
|
894
|
+
const triggerClick = (node) => {
|
|
895
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
896
|
+
try { node.scrollIntoView({ block: 'center', inline: 'center' }); } catch {}
|
|
897
|
+
try { node.focus({ preventScroll: true }); } catch {}
|
|
898
|
+
try {
|
|
899
|
+
const EventCtor = window.PointerEvent || window.MouseEvent;
|
|
900
|
+
node.dispatchEvent(new EventCtor('pointerdown', { bubbles: true, cancelable: true, composed: true, button: 0 }));
|
|
901
|
+
} catch {}
|
|
902
|
+
try { node.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true, composed: true, button: 0 })); } catch {}
|
|
903
|
+
try { node.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, cancelable: true, composed: true, button: 0 })); } catch {}
|
|
904
|
+
try { node.click(); } catch { return false; }
|
|
905
|
+
return true;
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
const ensureRecorder = () => {
|
|
909
|
+
if (!Array.isArray(window[recorderKey])) window[recorderKey] = [];
|
|
910
|
+
const push = (prefix, raw) => {
|
|
911
|
+
const url = String(raw || '').trim();
|
|
912
|
+
if (!url) return;
|
|
913
|
+
window[recorderKey].push(prefix + '::' + url);
|
|
914
|
+
};
|
|
915
|
+
const extractUrlsFromText = (rawText) => {
|
|
916
|
+
const text = String(rawText || '');
|
|
917
|
+
const urls = [];
|
|
918
|
+
const direct = text.match(/https?:\\/\\/[^\\s"'<>\\\\]+/g) || [];
|
|
919
|
+
urls.push(...direct);
|
|
920
|
+
const escaped = text.match(/https?:\\\\\\/\\\\\\/[^\\s"'<>]+/g) || [];
|
|
921
|
+
for (const item of escaped) {
|
|
922
|
+
urls.push(
|
|
923
|
+
item
|
|
924
|
+
.split('\\\\/').join('/')
|
|
925
|
+
.split('\\\\u003d').join('=')
|
|
926
|
+
.split('\\\\u0026').join('&'),
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
return Array.from(new Set(urls.map((value) => String(value || '').trim()).filter(Boolean)));
|
|
930
|
+
};
|
|
931
|
+
const extractDocsIdsFromText = (rawText) => {
|
|
932
|
+
const text = String(rawText || '');
|
|
933
|
+
const ids = [];
|
|
934
|
+
const patterns = [
|
|
935
|
+
/"id"\\s*:\\s*"([a-zA-Z0-9_-]{15,})"/g,
|
|
936
|
+
/'id'\\s*:\\s*'([a-zA-Z0-9_-]{15,})'/g,
|
|
937
|
+
];
|
|
938
|
+
for (const pattern of patterns) {
|
|
939
|
+
let match;
|
|
940
|
+
while ((match = pattern.exec(text)) !== null) {
|
|
941
|
+
const docId = String(match[1] || '').trim();
|
|
942
|
+
if (docId) ids.push(docId);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return Array.from(new Set(ids));
|
|
946
|
+
};
|
|
947
|
+
const docsUrlFromId = (id) => {
|
|
948
|
+
const docId = String(id || '').trim();
|
|
949
|
+
if (!/^[a-zA-Z0-9_-]{15,}$/.test(docId)) return '';
|
|
950
|
+
return 'https://docs.google.com/document/d/' + docId + '/edit';
|
|
951
|
+
};
|
|
952
|
+
const isDriveDocCreateRequest = (url) => /\\/upload\\/drive\\/v3\\/files/i.test(String(url || ''));
|
|
953
|
+
|
|
954
|
+
if (window[patchedKey]) return push;
|
|
955
|
+
window[patchedKey] = true;
|
|
956
|
+
|
|
957
|
+
const originalFetch = window.fetch.bind(window);
|
|
958
|
+
window.fetch = (...args) => {
|
|
959
|
+
let reqUrl = '';
|
|
960
|
+
try {
|
|
961
|
+
const input = args[0];
|
|
962
|
+
reqUrl = typeof input === 'string' ? input : (input && input.url) || '';
|
|
963
|
+
push('fetch', reqUrl);
|
|
964
|
+
} catch {}
|
|
965
|
+
return originalFetch(...args).then((response) => {
|
|
966
|
+
try {
|
|
967
|
+
response.clone().text().then((text) => {
|
|
968
|
+
const embeddedUrls = extractUrlsFromText(text);
|
|
969
|
+
for (const embeddedUrl of embeddedUrls) push('fetch-body', embeddedUrl);
|
|
970
|
+
if (isDriveDocCreateRequest(reqUrl)) {
|
|
971
|
+
const docIds = extractDocsIdsFromText(text);
|
|
972
|
+
for (const docId of docIds) {
|
|
973
|
+
const docUrl = docsUrlFromId(docId);
|
|
974
|
+
if (docUrl) push('fetch-body-docs-id', docUrl);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}).catch(() => {});
|
|
978
|
+
} catch {}
|
|
979
|
+
return response;
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
const originalXhrOpen = XMLHttpRequest.prototype.open;
|
|
984
|
+
XMLHttpRequest.prototype.open = function(method, url, ...rest) {
|
|
985
|
+
try { push('xhr', url); } catch {}
|
|
986
|
+
try { this.__opencliReqUrl = String(url || ''); } catch {}
|
|
987
|
+
return originalXhrOpen.call(this, method, url, ...rest);
|
|
988
|
+
};
|
|
989
|
+
const originalXhrSend = XMLHttpRequest.prototype.send;
|
|
990
|
+
XMLHttpRequest.prototype.send = function(...args) {
|
|
991
|
+
try {
|
|
992
|
+
this.addEventListener('load', () => {
|
|
993
|
+
try {
|
|
994
|
+
const embeddedUrls = extractUrlsFromText(this.responseText || '');
|
|
995
|
+
for (const embeddedUrl of embeddedUrls) push('xhr-body', embeddedUrl);
|
|
996
|
+
const reqUrl = String(this.__opencliReqUrl || '');
|
|
997
|
+
if (isDriveDocCreateRequest(reqUrl)) {
|
|
998
|
+
const docIds = extractDocsIdsFromText(this.responseText || '');
|
|
999
|
+
for (const docId of docIds) {
|
|
1000
|
+
const docUrl = docsUrlFromId(docId);
|
|
1001
|
+
if (docUrl) push('xhr-body-docs-id', docUrl);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
} catch {}
|
|
1005
|
+
});
|
|
1006
|
+
} catch {}
|
|
1007
|
+
return originalXhrSend.apply(this, args);
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
const originalOpen = window.open.bind(window);
|
|
1011
|
+
window.open = (...args) => {
|
|
1012
|
+
try { push('open', args[0]); } catch {}
|
|
1013
|
+
return originalOpen(...args);
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
const originalAnchorClick = HTMLAnchorElement.prototype.click;
|
|
1017
|
+
HTMLAnchorElement.prototype.click = function(...args) {
|
|
1018
|
+
try { push('anchor', this.href || this.getAttribute('href')); } catch {}
|
|
1019
|
+
return originalAnchorClick.apply(this, args);
|
|
1020
|
+
};
|
|
1021
|
+
|
|
1022
|
+
return push;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
const pushUrl = ensureRecorder();
|
|
1026
|
+
const collectUrls = () => {
|
|
1027
|
+
try {
|
|
1028
|
+
const entries = performance.getEntriesByType('resource');
|
|
1029
|
+
for (const entry of entries) {
|
|
1030
|
+
if (!entry || !entry.name) continue;
|
|
1031
|
+
pushUrl('performance', entry.name);
|
|
1032
|
+
}
|
|
1033
|
+
} catch {}
|
|
1034
|
+
try {
|
|
1035
|
+
const anchors = queryAllDeep([document], 'a[href]');
|
|
1036
|
+
for (const anchor of anchors) {
|
|
1037
|
+
const href = anchor.getAttribute('href') || '';
|
|
1038
|
+
if (!href) continue;
|
|
1039
|
+
if (/docs\\.google\\.com\\/document\\//i.test(href)) pushUrl('anchor', href);
|
|
1040
|
+
}
|
|
1041
|
+
} catch {}
|
|
1042
|
+
const all = Array.isArray(window[recorderKey]) ? window[recorderKey] : [];
|
|
1043
|
+
return Array.from(new Set(all.map((value) => String(value || '').trim()).filter(Boolean)));
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
const clickByLabels = (kind, targetLabels, roots) => {
|
|
1047
|
+
const allRoots = Array.isArray(roots) && roots.length > 0 ? roots : [document];
|
|
1048
|
+
const selector = 'button, [role="button"], [role="menuitem"], [role="option"], a, li';
|
|
1049
|
+
|
|
1050
|
+
for (const root of allRoots) {
|
|
1051
|
+
if (!(root instanceof Document || root instanceof Element)) continue;
|
|
1052
|
+
let nodes = [];
|
|
1053
|
+
try {
|
|
1054
|
+
nodes = Array.from(root.querySelectorAll(selector));
|
|
1055
|
+
} catch {
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
for (const node of nodes) {
|
|
1060
|
+
if (!isInteractable(node)) continue;
|
|
1061
|
+
const combined = normalize(textOf(node));
|
|
1062
|
+
if (!combined) continue;
|
|
1063
|
+
if (!isKindMatch(kind, combined, targetLabels)) continue;
|
|
1064
|
+
if (triggerClick(node)) {
|
|
1065
|
+
const clickedText = (textOf(node) || targetLabels[0] || '').trim();
|
|
1066
|
+
tracePush('clicked', kind + '|' + clickedText.slice(0, 120));
|
|
1067
|
+
return clickedText;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
tracePush('miss', kind);
|
|
1072
|
+
return '';
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
const getDialogRoots = () =>
|
|
1076
|
+
queryAllDeep([document], '[role="dialog"], [aria-modal="true"], [role="menu"], [role="listbox"]')
|
|
1077
|
+
.filter((node) => isVisible(node));
|
|
1078
|
+
const buildRoots = () => {
|
|
1079
|
+
const dialogRoots = getDialogRoots();
|
|
1080
|
+
if (dialogRoots.length > 0) return [...dialogRoots, document];
|
|
1081
|
+
return [document];
|
|
1082
|
+
};
|
|
1083
|
+
const clickWithRetry = async (kind, targetLabels, attempts, delayMs, includeDialogs = true) => {
|
|
1084
|
+
for (let index = 0; index < attempts; index += 1) {
|
|
1085
|
+
const roots = includeDialogs ? buildRoots() : [document];
|
|
1086
|
+
const clicked = clickByLabels(kind, targetLabels, roots);
|
|
1087
|
+
if (clicked) return clicked;
|
|
1088
|
+
await sleep(delayMs);
|
|
1089
|
+
}
|
|
1090
|
+
return '';
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
tracePush('start', window.location.href);
|
|
1094
|
+
let exportDocsBtn = await clickWithRetry('export-docs', labelsNormalized.exportDocs, 2, 250, true);
|
|
1095
|
+
let share = '';
|
|
1096
|
+
if (!exportDocsBtn) {
|
|
1097
|
+
share = await clickWithRetry('share', labelsNormalized.share, 4, 280, true);
|
|
1098
|
+
}
|
|
1099
|
+
if (!exportDocsBtn && !share) {
|
|
1100
|
+
await clickWithRetry('action-menu', labelsNormalized.actionMenu, 2, 250, false);
|
|
1101
|
+
await clickWithRetry('share-conversation', labelsNormalized.shareConversation, 2, 250, true);
|
|
1102
|
+
share = await clickWithRetry('share', labelsNormalized.share, 4, 280, true);
|
|
1103
|
+
}
|
|
1104
|
+
if (!exportDocsBtn) {
|
|
1105
|
+
await sleep(350);
|
|
1106
|
+
exportDocsBtn = await clickWithRetry('export-docs', labelsNormalized.exportDocs, 8, 280, true);
|
|
1107
|
+
}
|
|
1108
|
+
if (!exportDocsBtn) {
|
|
1109
|
+
const exportEntry = await clickWithRetry('export', labelsNormalized.export, 2, 220, true);
|
|
1110
|
+
if (exportEntry) {
|
|
1111
|
+
await sleep(240);
|
|
1112
|
+
exportDocsBtn = await clickWithRetry('export-docs', labelsNormalized.exportDocs, 6, 280, true);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
if (!share && !exportDocsBtn) {
|
|
1117
|
+
return { ok: false, step: 'share', currentUrl: window.location.href, trace, urls: collectUrls() };
|
|
1118
|
+
}
|
|
1119
|
+
if (!exportDocsBtn) {
|
|
1120
|
+
return { ok: false, step: 'export-docs', currentUrl: window.location.href, share, trace, urls: collectUrls() };
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
const deadline = Date.now() + ${Math.max(5000,Math.min(f,180000))};
|
|
1124
|
+
while (Date.now() < deadline) {
|
|
1125
|
+
const urls = collectUrls();
|
|
1126
|
+
const hasDocsSignal = urls.some((value) => /docs\\.google\\.com\\/document\\//i.test(String(value || '')));
|
|
1127
|
+
const sameTabDocs = /docs\\.google\\.com\\/document\\//i.test(window.location.href || '');
|
|
1128
|
+
if (hasDocsSignal) {
|
|
1129
|
+
return { ok: true, step: 'done', currentUrl: window.location.href, share, exportDocs: exportDocsBtn, trace, urls };
|
|
1130
|
+
}
|
|
1131
|
+
if (sameTabDocs) {
|
|
1132
|
+
urls.push('open::' + window.location.href);
|
|
1133
|
+
return { ok: true, step: 'same-tab-docs', currentUrl: window.location.href, share, exportDocs: exportDocsBtn, trace, urls };
|
|
1134
|
+
}
|
|
1135
|
+
await sleep(300);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
return { ok: true, step: 'timeout', currentUrl: window.location.href, share, exportDocs: exportDocsBtn, trace, urls: collectUrls() };
|
|
1139
|
+
})()
|
|
1140
|
+
`}function T(f){if(!Array.isArray(f))return"";for(const g of f){if(!g||typeof g!=="object")continue;const j=String(g.url??"").trim();if(/^https:\/\/docs\.google\.com\/document\//i.test(j))return j}return""}export async function exportGeminiDeepResearchReport(f,g=120){await ensureGeminiPage(f);const j=Math.max(1,g)*1000,q=await f.tabs().catch(()=>[]),w=zf(j),v=await f.evaluate(w).catch(()=>null),z=await f.tabs().catch(()=>[]),H=T(z)||T(q);if(H)return{url:H,source:"tab"};const D=typeof v?.currentUrl==="string"&&/^https:\/\/docs\.google\.com\/document\//i.test(v.currentUrl)?v.currentUrl:"";if(D)return{url:D,source:"window-open"};const J=wf(v?.urls),B=typeof v?.currentUrl==="string"&&v.currentUrl?v.currentUrl:await getCurrentGeminiUrl(f);return pickGeminiDeepResearchExportUrl(J,B)}export const __test__={GEMINI_COMPOSER_SELECTORS:Y,GEMINI_COMPOSER_MARKER_ATTR:Z,collapseAdjacentGeminiTurns,clickNewChatScript:o,diffTranscriptLines:y,diffTrustedStructuredTurns:b,hasGeminiTurnPrefix:W,readGeminiSnapshot,readGeminiSnapshotScript:G,expandGeminiRecentScript:x,submitComposerScript:m,insertComposerTextFallbackScript:I};export async function getGeminiVisibleImageUrls(f){await ensureGeminiPage(f);return await f.evaluate(`
|
|
1141
|
+
(() => {
|
|
1142
|
+
const isVisible = (el) => {
|
|
1143
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
1144
|
+
const style = window.getComputedStyle(el);
|
|
1145
|
+
if (style.display === 'none' || style.visibility === 'hidden') return false;
|
|
1146
|
+
const rect = el.getBoundingClientRect();
|
|
1147
|
+
return rect.width > 32 && rect.height > 32;
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
const imgs = Array.from(document.querySelectorAll('main img')).filter((img) => img instanceof HTMLImageElement && isVisible(img));
|
|
1151
|
+
const urls = [];
|
|
1152
|
+
const seen = new Set();
|
|
1153
|
+
|
|
1154
|
+
for (const img of imgs) {
|
|
1155
|
+
const src = img.currentSrc || img.src || '';
|
|
1156
|
+
const alt = (img.getAttribute('alt') || '').toLowerCase();
|
|
1157
|
+
const width = img.naturalWidth || img.width || 0;
|
|
1158
|
+
const height = img.naturalHeight || img.height || 0;
|
|
1159
|
+
if (!src) continue;
|
|
1160
|
+
if (alt.includes('avatar') || alt.includes('logo') || alt.includes('icon')) continue;
|
|
1161
|
+
if (width < 128 && height < 128) continue;
|
|
1162
|
+
if (seen.has(src)) continue;
|
|
1163
|
+
seen.add(src);
|
|
1164
|
+
urls.push(src);
|
|
1165
|
+
}
|
|
1166
|
+
return urls;
|
|
1167
|
+
})()
|
|
1168
|
+
`)}export async function waitForGeminiImages(f,g,j){const q=new Set(g),w=3,v=Math.max(1,Math.ceil(j/w));let z=[],H=0;for(let D=0;D<v;D+=1){await f.wait(D===0?2:w);const J=(await getGeminiVisibleImageUrls(f)).filter((E)=>!q.has(E));if(J.length===0)continue;const B=J.join(`
|
|
1169
|
+
`),N=z.join(`
|
|
1170
|
+
`);if(B==N)H+=1;else{z=J;H=1}if(H>=2||D===v-1)return z}return z}export async function exportGeminiImages(f,g){await ensureGeminiPage(f);const j=JSON.stringify(g);return await f.evaluate(`
|
|
1171
|
+
(async (targetUrls) => {
|
|
1172
|
+
const blobToDataUrl = (blob) => new Promise((resolve, reject) => {
|
|
1173
|
+
const reader = new FileReader();
|
|
1174
|
+
reader.onloadend = () => resolve(String(reader.result || ''));
|
|
1175
|
+
reader.onerror = () => reject(new Error('Failed to read blob'));
|
|
1176
|
+
reader.readAsDataURL(blob);
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
const inferMime = (value, fallbackUrl) => {
|
|
1180
|
+
if (value) return value;
|
|
1181
|
+
const lower = String(fallbackUrl || '').toLowerCase();
|
|
1182
|
+
if (lower.includes('.png')) return 'image/png';
|
|
1183
|
+
if (lower.includes('.webp')) return 'image/webp';
|
|
1184
|
+
if (lower.includes('.gif')) return 'image/gif';
|
|
1185
|
+
return 'image/jpeg';
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
const images = Array.from(document.querySelectorAll('main img'));
|
|
1189
|
+
const results = [];
|
|
1190
|
+
|
|
1191
|
+
for (const targetUrl of targetUrls) {
|
|
1192
|
+
const img = images.find((node) => (node.currentSrc || node.src || '') === targetUrl);
|
|
1193
|
+
let dataUrl = '';
|
|
1194
|
+
let mimeType = 'image/jpeg';
|
|
1195
|
+
const width = img?.naturalWidth || img?.width || 0;
|
|
1196
|
+
const height = img?.naturalHeight || img?.height || 0;
|
|
1197
|
+
|
|
1198
|
+
try {
|
|
1199
|
+
if (String(targetUrl).startsWith('data:')) {
|
|
1200
|
+
dataUrl = String(targetUrl);
|
|
1201
|
+
mimeType = (String(targetUrl).match(/^data:([^;]+);/i) || [])[1] || 'image/png';
|
|
1202
|
+
} else {
|
|
1203
|
+
const res = await fetch(String(targetUrl), { credentials: 'include' });
|
|
1204
|
+
if (res.ok) {
|
|
1205
|
+
const blob = await res.blob();
|
|
1206
|
+
mimeType = inferMime(blob.type, targetUrl);
|
|
1207
|
+
dataUrl = await blobToDataUrl(blob);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
} catch {}
|
|
1211
|
+
|
|
1212
|
+
if (!dataUrl && img instanceof HTMLImageElement) {
|
|
1213
|
+
try {
|
|
1214
|
+
const canvas = document.createElement('canvas');
|
|
1215
|
+
canvas.width = img.naturalWidth || img.width;
|
|
1216
|
+
canvas.height = img.naturalHeight || img.height;
|
|
1217
|
+
const ctx = canvas.getContext('2d');
|
|
1218
|
+
if (ctx) {
|
|
1219
|
+
ctx.drawImage(img, 0, 0);
|
|
1220
|
+
dataUrl = canvas.toDataURL('image/png');
|
|
1221
|
+
mimeType = 'image/png';
|
|
1222
|
+
}
|
|
1223
|
+
} catch {}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
if (dataUrl) {
|
|
1227
|
+
results.push({ url: String(targetUrl), dataUrl, mimeType, width, height });
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
return results;
|
|
1232
|
+
})(${j})
|
|
1233
|
+
`)}export async function waitForGeminiResponse(f,g,j,q){if(q<=0)return"";const w=(E)=>{if(!E.structuredTurnsTrusted)return"";const K=c(E.turns,g.userAnchorTurn);if(K!==null){const L=E.turns.slice(K+1).filter((O)=>O.Role==="Assistant").at(-1);return L?sanitizeGeminiResponseText(L.Text,j):""}if(W(g.snapshot.turns,E.turns)){const L=E.turns.slice(g.snapshot.turns.length).filter((O)=>O.Role==="Assistant").at(-1);if(L)return sanitizeGeminiResponseText(L.Text,j)}return""},v=(E)=>E.transcriptLines.filter((K)=>!g.snapshot.transcriptLines.includes(K)).map((K)=>F(K,j)).filter(Boolean).join(`
|
|
1234
|
+
`).trim(),z=Math.max(1,Math.ceil(q/2));let H="",D=0,J="",B=0,N=0;for(let E=0;E<z;E+=1){await f.wait(E===0?1:2);const K=await readGeminiSnapshot(f),L=w(K);if(L){if(L===H)D+=1;else{H=L;D=1}if(!K.isGenerating&&D>=2)return L;continue}N+=1;if(N<2)continue;const O=v(K);if(!O)continue;if(O===J)B+=1;else{J=O;B=1}if(!K.isGenerating&&B>=2)return O}return""}
|