publishport-opencli 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +17 -17
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/clis/chatgpt/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{htmlToMarkdown as
|
|
1
|
+
import{htmlToMarkdown as V}from"@jackwener/opencli/utils";import{ArgumentError as g,AuthRequiredError as A,CommandExecutionError as d,TimeoutError as E}from"@jackwener/opencli/errors";export const CHATGPT_DOMAIN="chatgpt.com",CHATGPT_URL="https://chatgpt.com";const y={instant:{label:"Instant",labels:["Instant","即时","极速"],optionLabels:["Instant","极速","即时"],testIds:["model-switcher-gpt-5-5"],intelligenceOrder:0},medium:{label:"Medium",labels:["Medium","均衡"],optionLabels:["Medium","均衡"],testIds:[],intelligenceOrder:1},high:{label:"High",labels:["High","高级","Thinking","思考"],optionLabels:["High","高级","Thinking","思考"],testIds:["model-switcher-gpt-5-5-thinking"],intelligenceOrder:2},"extra-high":{label:"Extra High",labels:["Extra High","超高"],optionLabels:["Extra High","超高"],testIds:[],intelligenceOrder:3},pro:{label:"Pro",labels:["Pro","进阶专业","专业"],optionLabels:["专业","Pro","进阶专业"],testIds:["model-switcher-gpt-5-5-pro"],intelligenceOrder:4}},M={thinking:"high"};export const CHATGPT_MODEL_CHOICES=[...Object.keys(y),...Object.keys(M)];const v={"deep-research":{label:"Deep Research",labels:["深度研究","Deep Research"]},"web-search":{label:"Web Search",labels:["网页搜索","搜索","Web Search","Search"]}};export const CHATGPT_TOOL_CHOICES=Object.keys(v);const b=['[contenteditable="true"][role="textbox"]','#prompt-textarea[contenteditable="true"]','[aria-label="Chat with ChatGPT"]','[aria-label="与 ChatGPT 聊天"]','[placeholder="Ask anything"]','[placeholder="有问题,尽管问"]',"#prompt-textarea",'[data-testid="prompt-textarea"]'],T='button[data-testid="send-button"]:not([disabled])',S=["#composer-submit-button:not([disabled])"],k=["Send prompt","Send message","Send","发送","发送消息","发送提示"],I=["Close sidebar","关闭边栏"];function x(e,t){if(!e||!t)return!1;return e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}#`)}function P(){return`
|
|
2
2
|
const isVisible = (el) => {
|
|
3
3
|
if (!(el instanceof HTMLElement)) return false;
|
|
4
4
|
const style = window.getComputedStyle(el);
|
|
@@ -15,7 +15,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const findComposer = () => {
|
|
18
|
-
for (const selector of ${JSON.stringify(
|
|
18
|
+
for (const selector of ${JSON.stringify(b)}) {
|
|
19
19
|
const candidates = Array.from(document.querySelectorAll(selector)).filter(c => c instanceof HTMLElement && isVisible(c));
|
|
20
20
|
const node = candidates.find(c => c.isContentEditable) || candidates[0];
|
|
21
21
|
if (node instanceof HTMLElement) {
|
|
@@ -28,7 +28,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
findComposer.toString = () => 'findComposer';
|
|
31
|
-
`}export function normalizeBooleanFlag(
|
|
31
|
+
`}export function normalizeBooleanFlag(e,t=!1){if(typeof e==="boolean")return e;if(e==null||e==="")return t;const n=String(e).trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"}export function requireNonEmptyPrompt(e,t){const n=String(e??"").trim();if(!n)throw new g(`${t} prompt cannot be empty`,`Example: ppcli ${t} "hello"`);return n}export function requirePositiveInt(e,t,n){if(!Number.isInteger(e)||e<1)throw new g(`${t} must be a positive integer`,n);return e}export function requireNonNegativeInt(e,t,n){if(!Number.isInteger(e)||e<0)throw new g(`${t} must be a non-negative integer`,n);return e}export function unwrapEvaluateResult(e){if(e&&!Array.isArray(e)&&typeof e==="object"&&"session"in e&&"data"in e)return e.data;return e}export function requireArrayEvaluateResult(e,t){if(!Array.isArray(e)){if(e&&typeof e==="object"&&"error"in e)throw new d(`${t}: ${String(e.error)}`);throw new d(`${t} returned malformed extraction payload`)}return e}export function requireObjectEvaluateResult(e,t){if(!e||Array.isArray(e)||typeof e!=="object")throw new d(`${t} returned malformed extraction payload`);return e}export function requireBooleanEvaluateResult(e,t){if(typeof e!=="boolean")throw new d(`${t} returned malformed extraction payload`);return e}function F(e){return e===CHATGPT_DOMAIN||e.endsWith(`.${CHATGPT_DOMAIN}`)}function W(e){const t=String(e||"").match(/^\/g\/g-p-([a-f0-9]{8,})(?:[-/]|$)/i);return t?t[1].toLowerCase():""}function j(e){try{const t=new URL(String(e||""),CHATGPT_URL);if(t.protocol!=="https:"||!F(t.hostname))return"";return W(t.pathname)}catch{return""}}export function parseChatGPTConversationId(e){const t=String(e??"").trim();if(/^https?:\/\//i.test(t)){try{const r=new URL(t);if(r.protocol!=="https:"||r.hostname!==CHATGPT_DOMAIN&&!r.hostname.endsWith(`.${CHATGPT_DOMAIN}`))throw Error("off-domain");const o=r.pathname.match(/^\/(?:g\/g-p-[^/]+\/)?c\/([A-Za-z0-9_-]{8,})$/);if(o)return o[1]}catch{}throw new g("chatgpt detail requires a conversation id or chatgpt.com /c/<id> URL","Example: ppcli chatgpt detail https://chatgpt.com/c/123e4567-e89b-12d3-a456-426614174000")}const n=t.match(/^\/(?:g\/g-p-[^/]+\/)?c\/([A-Za-z0-9_-]{8,})(?:[?#].*)?$/);if(n)return n[1];if(/^[A-Za-z0-9_-]{8,}$/.test(t))return t;throw new g("chatgpt detail requires a conversation id or chatgpt.com /c/<id> URL","Example: ppcli chatgpt detail 123e4567-e89b-12d3-a456-426614174000")}export async function currentChatGPTUrl(e){const t=unwrapEvaluateResult(await e.evaluate("window.location.href").catch(()=>""));return typeof t==="string"?t:""}export async function isOnChatGPT(e){const t=await currentChatGPTUrl(e);if(!t)return!1;try{const n=new URL(t).hostname;return n===CHATGPT_DOMAIN||n.endsWith(`.${CHATGPT_DOMAIN}`)}catch{return!1}}const C='#prompt-textarea, [data-testid="prompt-textarea"]',R='a[href*="/c/"]',O='a[href*="/g/g-p-"]';export const CONVERSATION_MESSAGE_SELECTOR='[data-message-author-role], article[data-testid*="conversation-turn"]';export async function ensureOnChatGPT(e){if(await isOnChatGPT(e))return!1;await e.goto(CHATGPT_URL,{settleMs:2000});try{await e.wait({selector:C,timeout:8})}catch{}return!0}export async function startNewChat(e){await e.goto(`${CHATGPT_URL}/new`,{settleMs:2000});try{await e.wait({selector:C,timeout:8})}catch{}}export async function openChatGPTConversation(e,t){const n=parseChatGPTConversationId(t);await e.goto(`${CHATGPT_URL}/c/${n}`,{settleMs:2000});try{await e.wait({selector:C,timeout:8})}catch{}return n}export async function getPageState(e){return requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
32
32
|
const isVisible = (el) => {
|
|
33
33
|
if (!(el instanceof HTMLElement)) return false;
|
|
34
34
|
const style = window.getComputedStyle(el);
|
|
@@ -36,7 +36,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
36
36
|
const rect = el.getBoundingClientRect();
|
|
37
37
|
return rect.width > 0 && rect.height > 0;
|
|
38
38
|
};
|
|
39
|
-
const composerSelectors = ${JSON.stringify(
|
|
39
|
+
const composerSelectors = ${JSON.stringify(b)};
|
|
40
40
|
const hasComposer = composerSelectors.some((selector) =>
|
|
41
41
|
Array.from(document.querySelectorAll(selector)).some((node) => isVisible(node))
|
|
42
42
|
);
|
|
@@ -54,7 +54,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
54
54
|
isLoggedIn: hasComposer || !!userMenu || !hasLoginGate,
|
|
55
55
|
hasLoginGate,
|
|
56
56
|
};
|
|
57
|
-
})()`)),"chatgpt page state")}export async function ensureChatGPTLogin(
|
|
57
|
+
})()`)),"chatgpt page state")}export async function ensureChatGPTLogin(e,t="ChatGPT requires a logged-in browser session."){const n=await getPageState(e);if(!n.isLoggedIn||n.hasLoginGate)throw new A(CHATGPT_DOMAIN,t);return n}export async function ensureChatGPTComposer(e,t="ChatGPT composer is not available on the current page."){const n=await ensureChatGPTLogin(e,t);if(!n.hasComposer)throw new d(t);return n}function _(e){const t=String(e??"").trim().toLowerCase(),n=M[t]||t,r=y[n];if(!r)throw new g(`Unknown ChatGPT model "${e}"`,`Choose one of: ${CHATGPT_MODEL_CHOICES.join(", ")}`);return{key:n,alias:t!==n?t:null,...r}}function D(e){const t=String(e??"").trim().toLowerCase(),n=v[t];if(!n)throw new g(`Unknown ChatGPT tool "${e}"`,`Choose one of: ${CHATGPT_TOOL_CHOICES.join(", ")}`);return{key:t,...n}}export async function getCurrentChatGPTModel(e){return requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
58
58
|
const isVisible = (el) => {
|
|
59
59
|
if (!(el instanceof HTMLElement)) return false;
|
|
60
60
|
const style = window.getComputedStyle(el);
|
|
@@ -74,7 +74,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
74
74
|
}
|
|
75
75
|
return normalizedText.replace(/\\s+/g, '').includes(normalizedLabel.replace(/\\s+/g, ''));
|
|
76
76
|
};
|
|
77
|
-
const labels = ${JSON.stringify(
|
|
77
|
+
const labels = ${JSON.stringify(y)};
|
|
78
78
|
const findEntryForText = (text) => {
|
|
79
79
|
const matches = [];
|
|
80
80
|
for (const [key, value] of Object.entries(labels)) {
|
|
@@ -114,7 +114,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
114
114
|
model: entry?.key ?? null,
|
|
115
115
|
label: entry?.value?.label ?? null,
|
|
116
116
|
};
|
|
117
|
-
})()`)),"chatgpt current model")}export async function selectChatGPTModel(
|
|
117
|
+
})()`)),"chatgpt current model")}export async function selectChatGPTModel(e,t){const n=_(t);if(typeof e.nativeClick!=="function")throw new d("ChatGPT model selection requires native browser click support.");await ensureOnChatGPT(e);await ensureChatGPTComposer(e,"ChatGPT model selection requires a logged-in ChatGPT session with a visible composer.");if((await getCurrentChatGPTModel(e)).model===n.key)return{Status:"Already selected",Model:n.label};const o=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
118
118
|
const isVisible = (el) => {
|
|
119
119
|
if (!(el instanceof HTMLElement)) return false;
|
|
120
120
|
const style = window.getComputedStyle(el);
|
|
@@ -134,7 +134,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
134
134
|
}
|
|
135
135
|
return normalizedText.replace(/\\s+/g, '').includes(normalizedLabel.replace(/\\s+/g, ''));
|
|
136
136
|
};
|
|
137
|
-
const labels = ${JSON.stringify(Object.values(
|
|
137
|
+
const labels = ${JSON.stringify(Object.values(y).flatMap((a)=>a.labels))};
|
|
138
138
|
const menuButtonSelectors = [
|
|
139
139
|
'button[data-testid="model-switcher-dropdown-button"]',
|
|
140
140
|
'button[aria-label*="model" i]',
|
|
@@ -157,7 +157,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
157
157
|
x: Math.round(rect.left + rect.width / 2),
|
|
158
158
|
y: Math.round(rect.top + rect.height / 2),
|
|
159
159
|
};
|
|
160
|
-
})()`)),"chatgpt model menu button");if(
|
|
160
|
+
})()`)),"chatgpt model menu button");if(!o.found)throw new d("Could not find the ChatGPT model selector in the composer.");await e.nativeClick(Number(o.x),Number(o.y));await e.wait(0.5);let i=null;for(let a=0;a<10;a+=1){i=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
161
161
|
const isVisible = (el) => {
|
|
162
162
|
if (!(el instanceof HTMLElement)) return false;
|
|
163
163
|
const style = window.getComputedStyle(el);
|
|
@@ -177,7 +177,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
177
177
|
}
|
|
178
178
|
return normalizedText.replace(/\\s+/g, '').includes(normalizedLabel.replace(/\\s+/g, ''));
|
|
179
179
|
};
|
|
180
|
-
const target = ${JSON.stringify(
|
|
180
|
+
const target = ${JSON.stringify(n)};
|
|
181
181
|
const clickableSelector = '[role="menuitemradio"], [role="menuitem"], [role="option"], button, [data-testid^="model-switcher"]';
|
|
182
182
|
const intelligenceContent = document.querySelector('[data-testid="composer-intelligence-picker-content"]');
|
|
183
183
|
const intelligenceOptions = intelligenceContent
|
|
@@ -223,7 +223,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
223
223
|
x: Math.round(rect.left + rect.width / 2),
|
|
224
224
|
y: Math.round(rect.top + rect.height / 2),
|
|
225
225
|
};
|
|
226
|
-
})()`)),"chatgpt model option click");if(
|
|
226
|
+
})()`)),"chatgpt model option click");if(i.found)break;await e.wait(0.5)}if(!i?.found)throw new d(`Could not click the ChatGPT ${n.label} model option.`);await e.nativeClick(Number(i.x),Number(i.y));await e.wait(0.5);if((await getCurrentChatGPTModel(e)).model!==n.key){await e.nativeClick(Number(o.x),Number(o.y));await e.wait(0.5);const a=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
227
227
|
const isVisible = (el) => {
|
|
228
228
|
if (!(el instanceof HTMLElement)) return false;
|
|
229
229
|
const style = window.getComputedStyle(el);
|
|
@@ -231,7 +231,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
231
231
|
const rect = el.getBoundingClientRect();
|
|
232
232
|
return rect.width > 0 && rect.height > 0;
|
|
233
233
|
};
|
|
234
|
-
const target = ${JSON.stringify(
|
|
234
|
+
const target = ${JSON.stringify(n)};
|
|
235
235
|
const intelligenceContent = document.querySelector('[data-testid="composer-intelligence-picker-content"]');
|
|
236
236
|
const options = intelligenceContent
|
|
237
237
|
? Array.from(intelligenceContent.querySelectorAll('[role="menuitemradio"]')).filter(isVisible)
|
|
@@ -241,7 +241,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
241
241
|
recognized: options.length === 5 && Number.isInteger(target.intelligenceOrder),
|
|
242
242
|
checkedIndex,
|
|
243
243
|
};
|
|
244
|
-
})()`)),"chatgpt model checked intelligence option");if(
|
|
244
|
+
})()`)),"chatgpt model checked intelligence option");if(a.recognized&&a.checkedIndex===n.intelligenceOrder){await e.nativeClick(Number(o.x),Number(o.y));return{Status:"Success",Model:n.label}}await e.nativeClick(Number(o.x),Number(o.y));throw new d(`ChatGPT model did not switch to ${n.label}.`)}return{Status:"Success",Model:n.label}}export async function getCurrentChatGPTTool(e){return requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
245
245
|
const isVisible = (el) => {
|
|
246
246
|
if (!(el instanceof HTMLElement)) return false;
|
|
247
247
|
const style = window.getComputedStyle(el);
|
|
@@ -250,7 +250,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
250
250
|
return rect.width > 0 && rect.height > 0;
|
|
251
251
|
};
|
|
252
252
|
const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
253
|
-
const labels = ${JSON.stringify(
|
|
253
|
+
const labels = ${JSON.stringify(v)};
|
|
254
254
|
const form = Array.from(document.querySelectorAll('form')).find((node) => node instanceof HTMLElement && isVisible(node));
|
|
255
255
|
const root = form || document.body;
|
|
256
256
|
const nodes = Array.from(root.querySelectorAll('button, [role="button"], [role="menuitemradio"], span, div'));
|
|
@@ -265,7 +265,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
265
265
|
tool: entry?.[0] ?? null,
|
|
266
266
|
label: entry?.[1]?.label ?? null,
|
|
267
267
|
};
|
|
268
|
-
})()`)),"chatgpt current tool")}export async function selectChatGPTTool(
|
|
268
|
+
})()`)),"chatgpt current tool")}export async function selectChatGPTTool(e,t){const n=D(t);if(typeof e.nativeClick!=="function")throw new d("ChatGPT tool selection requires native browser click support.");await ensureOnChatGPT(e);await ensureChatGPTComposer(e,"ChatGPT tool selection requires a logged-in ChatGPT session with a visible composer.");if((await getCurrentChatGPTTool(e)).tool===n.key)return{Status:"Already selected",Tool:n.label};const o=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
269
269
|
const isVisible = (el) => {
|
|
270
270
|
if (!(el instanceof HTMLElement)) return false;
|
|
271
271
|
const style = window.getComputedStyle(el);
|
|
@@ -282,7 +282,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
282
282
|
x: Math.round(rect.left + rect.width / 2),
|
|
283
283
|
y: Math.round(rect.top + rect.height / 2),
|
|
284
284
|
};
|
|
285
|
-
})()`)),"chatgpt tools menu button");if(
|
|
285
|
+
})()`)),"chatgpt tools menu button");if(!o.found)throw new d("Could not find the ChatGPT tools menu button in the composer.");await e.nativeClick(Number(o.x),Number(o.y));await e.wait(0.5);let i=null;for(let a=0;a<10;a+=1){i=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
286
286
|
const isVisible = (el) => {
|
|
287
287
|
if (!(el instanceof HTMLElement)) return false;
|
|
288
288
|
const style = window.getComputedStyle(el);
|
|
@@ -291,7 +291,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
291
291
|
return rect.width > 0 && rect.height > 0;
|
|
292
292
|
};
|
|
293
293
|
const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
294
|
-
const labels = ${JSON.stringify(
|
|
294
|
+
const labels = ${JSON.stringify(n.labels)};
|
|
295
295
|
const options = Array.from(document.querySelectorAll('[role="menuitemradio"]'));
|
|
296
296
|
const option = options.find((node) => node instanceof HTMLElement && isVisible(node) && labels.includes(normalize(node.textContent)));
|
|
297
297
|
if (!(option instanceof HTMLElement)) return { found: false };
|
|
@@ -304,7 +304,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
304
304
|
x: Math.round(rect.left + rect.width / 2),
|
|
305
305
|
y: Math.round(rect.top + rect.height / 2),
|
|
306
306
|
};
|
|
307
|
-
})()`)),"chatgpt tool option click");if(
|
|
307
|
+
})()`)),"chatgpt tool option click");if(i.found)break;await e.wait(0.5)}if(!i?.found)throw new d(`Could not find the ChatGPT ${n.label} tool option.`);if(!i.checked)await e.nativeClick(Number(i.x),Number(i.y));await e.wait(0.5);if((await getCurrentChatGPTTool(e)).tool!==n.key)throw new d(`ChatGPT tool did not switch to ${n.label}.`);return{Status:i.checked?"Already selected":"Success",Tool:n.label}}export async function clearChatGPTDraft(e){await e.evaluate(`
|
|
308
308
|
(() => {
|
|
309
309
|
const removeLabels = [/^remove file/i, /^移除文件/];
|
|
310
310
|
for (let pass = 0; pass < 10; pass += 1) {
|
|
@@ -316,7 +316,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
316
316
|
button.click();
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
const selectors = ${JSON.stringify(
|
|
319
|
+
const selectors = ${JSON.stringify(b)};
|
|
320
320
|
for (const selector of selectors) {
|
|
321
321
|
for (const node of document.querySelectorAll(selector)) {
|
|
322
322
|
if (!(node instanceof HTMLElement)) continue;
|
|
@@ -333,15 +333,15 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
})()
|
|
336
|
-
`);await
|
|
336
|
+
`);await e.wait(0.5)}export function parseChatGPTProjectId(e){const t=String(e??"").trim();if(/^https?:\/\//i.test(t)||t.startsWith("/")){const r=j(t);if(r)return r;throw new g("chatgpt project commands require a chatgpt.com project id or /g/g-p-<id> URL","Example: ppcli chatgpt project-file-add report.pdf --id 12345678")}const n=t.match(/^g-p-([a-f0-9]{8,})/i);if(n)return n[1].toLowerCase();if(/^[a-f0-9]{8,}$/i.test(t))return t.toLowerCase();throw new g("chatgpt project commands require a project id or /g/g-p-<id> URL","Example: ppcli chatgpt project-file-add report.pdf --id 12345678")}export async function sendChatGPTMessage(e,t){await e.evaluate(`
|
|
337
337
|
(() => {
|
|
338
|
-
const labels = ${JSON.stringify(
|
|
338
|
+
const labels = ${JSON.stringify(I)};
|
|
339
339
|
const closeBtn = Array.from(document.querySelectorAll('button')).find(b => labels.includes(b.getAttribute('aria-label') || ''));
|
|
340
340
|
if (closeBtn) closeBtn.click();
|
|
341
341
|
})()
|
|
342
|
-
`);const
|
|
342
|
+
`);const n=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
343
343
|
(() => {
|
|
344
|
-
${
|
|
344
|
+
${P()}
|
|
345
345
|
const composer = findComposer();
|
|
346
346
|
if (!composer) return { ready: false };
|
|
347
347
|
composer.focus();
|
|
@@ -363,16 +363,16 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
363
363
|
y: Math.round(rect.top + Math.max(8, Math.min(rect.height / 2, rect.height - 8))),
|
|
364
364
|
};
|
|
365
365
|
})()
|
|
366
|
-
`)),"chatgpt composer readiness");if(!
|
|
366
|
+
`)),"chatgpt composer readiness");if(!n.ready)return!1;try{if(e.nativeType){if(typeof e.nativeClick==="function"){await e.nativeClick(Number(n.x),Number(n.y));await e.wait(0.2)}await e.nativeType(t)}else throw Error("nativeType unavailable")}catch(o){await e.evaluate(`
|
|
367
367
|
(() => {
|
|
368
368
|
var composer = null;
|
|
369
|
-
var sels = ${JSON.stringify(
|
|
369
|
+
var sels = ${JSON.stringify(b)};
|
|
370
370
|
for (var si = 0; si < sels.length; si++) { composer = document.querySelector(sels[si]); if (composer) break; }
|
|
371
371
|
if (!composer) return;
|
|
372
372
|
composer.focus();
|
|
373
|
-
document.execCommand('insertText', false, ${JSON.stringify(
|
|
373
|
+
document.execCommand('insertText', false, ${JSON.stringify(t)});
|
|
374
374
|
})()
|
|
375
|
-
`)}let
|
|
375
|
+
`)}let r=null;for(let o=0;o<20;o+=1){await e.wait(0.5);r=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
376
376
|
(() => {
|
|
377
377
|
const isVisible = (el) => {
|
|
378
378
|
if (!(el instanceof HTMLElement)) return false;
|
|
@@ -387,10 +387,10 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
387
387
|
&& button.getAttribute('aria-disabled') !== 'true';
|
|
388
388
|
const form = Array.from(document.querySelectorAll('form')).find((node) => node instanceof HTMLElement && isVisible(node));
|
|
389
389
|
const root = form || document.body;
|
|
390
|
-
const primary = root.querySelector(${JSON.stringify(
|
|
391
|
-
|| ${JSON.stringify(
|
|
390
|
+
const primary = root.querySelector(${JSON.stringify(T)})
|
|
391
|
+
|| ${JSON.stringify(S)}.map(selector => root.querySelector(selector)).find(Boolean);
|
|
392
392
|
const btns = Array.from(root.querySelectorAll('button'));
|
|
393
|
-
const labels = ${JSON.stringify(
|
|
393
|
+
const labels = ${JSON.stringify(k)};
|
|
394
394
|
const looksLikeSend = (button) => {
|
|
395
395
|
const label = button.getAttribute('aria-label') || '';
|
|
396
396
|
const text = (button.innerText || button.textContent || '').replace(/\\s+/g, ' ').trim();
|
|
@@ -401,7 +401,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
401
401
|
: btns.find(b => looksLikeSend(b) && isUsable(b));
|
|
402
402
|
return { sendBtnFound: !!sendBtn };
|
|
403
403
|
})()
|
|
404
|
-
`)),"chatgpt send button readiness");if(
|
|
404
|
+
`)),"chatgpt send button readiness");if(r?.sendBtnFound)break}if(!r?.sendBtnFound)return!1;await e.evaluate(`
|
|
405
405
|
(() => {
|
|
406
406
|
const isVisible = (el) => {
|
|
407
407
|
if (!(el instanceof HTMLElement)) return false;
|
|
@@ -416,9 +416,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
416
416
|
&& button.getAttribute('aria-disabled') !== 'true';
|
|
417
417
|
const form = Array.from(document.querySelectorAll('form')).find((node) => node instanceof HTMLElement && isVisible(node));
|
|
418
418
|
const root = form || document.body;
|
|
419
|
-
const primary = root.querySelector(${JSON.stringify(
|
|
420
|
-
|| ${JSON.stringify(
|
|
421
|
-
const labels = ${JSON.stringify(
|
|
419
|
+
const primary = root.querySelector(${JSON.stringify(T)})
|
|
420
|
+
|| ${JSON.stringify(S)}.map(selector => root.querySelector(selector)).find(Boolean);
|
|
421
|
+
const labels = ${JSON.stringify(k)};
|
|
422
422
|
const looksLikeSend = (button) => {
|
|
423
423
|
const label = button.getAttribute('aria-label') || '';
|
|
424
424
|
const text = (button.innerText || button.textContent || '').replace(/\\s+/g, ' ').trim();
|
|
@@ -429,7 +429,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
429
429
|
: Array.from(root.querySelectorAll('button')).find(b => looksLikeSend(b) && isUsable(b));
|
|
430
430
|
if (sendBtn) sendBtn.click();
|
|
431
431
|
})()
|
|
432
|
-
`);return!0}export async function getVisibleMessages(
|
|
432
|
+
`);return!0}export async function getVisibleMessages(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
433
433
|
const isVisible = (el) => {
|
|
434
434
|
if (!(el instanceof HTMLElement)) return false;
|
|
435
435
|
const style = window.getComputedStyle(el);
|
|
@@ -475,7 +475,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
475
475
|
rows.push({ role, text, html });
|
|
476
476
|
}
|
|
477
477
|
return rows;
|
|
478
|
-
})()`)),"chatgpt visible messages").map((
|
|
478
|
+
})()`)),"chatgpt visible messages").map((n,r)=>({Index:r+1,Role:n?.role==="Assistant"?"Assistant":"User",Text:String(n?.text||"").trim(),Html:String(n?.html||"")})).filter((n)=>n.Text)}function N(e,{wantMarkdown:t,generating:n,stableSeconds:r}){return e.map((o)=>({Index:o.Index,Role:o.Role,Text:t&&o.Role==="Assistant"&&o.Html?messageHtmlToMarkdown(o.Html)||o.Text:o.Text,Generating:n,StableSeconds:r}))}export async function getChatGPTDetailRows(e,{wantMarkdown:t=!1,stableSeconds:n=0}={}){const r=await isGenerating(e),o=await getVisibleMessages(e);return{messages:o,rows:N(o,{wantMarkdown:t,generating:r,stableSeconds:n}),generating:r}}export async function waitForChatGPTDetailRows(e,{wantMarkdown:t=!1,timeoutSeconds:n=120,stableSeconds:r=6}={}){const o=Date.now();let i="",l=0;while(Date.now()-o<n*1000){const a=await isGenerating(e),u=await getVisibleMessages(e),c=JSON.stringify(u.map((s)=>[s.Role,s.Text]));if(!a&&u.length&&u[u.length-1]?.Role==="Assistant")if(c===i){if(!l)l=Date.now();const s=Math.floor((Date.now()-l)/1000);if(s>=r)return{messages:u,rows:N(u,{wantMarkdown:t,generating:!1,stableSeconds:s}),generating:!1}}else{i=c;l=Date.now()}else{i=c;l=0}await e.wait(3)}throw new E("chatgpt detail",n,"Conversation did not finish or stabilize before timeout. Re-run with a higher --timeout if it is still generating.")}export function messageHtmlToMarkdown(e){try{return V(e).trim()}catch{return String(e||"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}}export async function getBubbleCount(e){return(await getVisibleMessages(e)).length}function w(e){return String(e||"").replace(/\s+/g," ").trim()}function H(e,t){return JSON.stringify([w(e?.Text),String(t?.Text||"").trim()])}export function getChatGPTResponsePairKeys(e,t){const n=w(t);if(!n)return[];const r=[];for(let o=0;o<e.length;o+=1){const i=e[o];if(i?.Role!=="User"||w(i.Text)!==n)continue;const l=e.slice(o+1).find((a)=>a?.Role==="Assistant");if(!l||!String(l.Text||"").trim())continue;r.push(H(i,l))}return r}export function getChatGPTResponsePairCounts(e,t){const n=new Map;for(const r of getChatGPTResponsePairKeys(e,t))n.set(r,(n.get(r)||0)+1);return n}function J(e){if(e.baselinePairCounts instanceof Map)return e.baselinePairCounts;return new Map(Array.from(e.baselinePairKeys||[]).map((t)=>[t,1]))}function K(e,t,n){const r=w(t);if(!r)return"";const o=getChatGPTResponsePairCounts(e,t);for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l?.Role!=="User"||w(l.Text)!==r)continue;const a=e.findIndex((s,f)=>f>i&&s?.Role==="Assistant"&&String(s.Text||"").trim());if(a<0)continue;const u=e[a],c=H(l,u);if((o.get(c)||0)<=(n.get(c)||0))continue;return String(u.Text||"").trim()}return""}export async function waitForChatGPTResponse(e,t,n,r,o={}){const i=Date.now();let l="",a=0;const u=J(o);while(Date.now()-i<r*1000){await e.wait(3);if(o.conversationUrl){const f=await currentChatGPTUrl(e);if(f&&!x(f,o.conversationUrl))throw new d(`ChatGPT navigated away from the target conversation (${o.conversationUrl}); current URL is ${f}`)}if(await isGenerating(e)){a=0;continue}const c=await getVisibleMessages(e),s=K(c,n,u);if(!s||s===String(n||"").trim())continue;if(s===l){a+=1;if(a>=2)return s}else{l=s;a=0}}throw new E("chatgpt ask",r,"No ChatGPT response appeared before timeout. Re-run with a higher --timeout if it is still generating.")}export async function getConversationList(e){await ensureOnChatGPT(e);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
479
479
|
const button = Array.from(document.querySelectorAll('button'))
|
|
480
480
|
.find((node) => /open sidebar/i.test(node.getAttribute('aria-label') || ''));
|
|
481
481
|
if (button instanceof HTMLElement) {
|
|
@@ -483,7 +483,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
483
483
|
return true;
|
|
484
484
|
}
|
|
485
485
|
return false;
|
|
486
|
-
})()`)),"chatgpt sidebar open state"))try{await
|
|
486
|
+
})()`)),"chatgpt sidebar open state"))try{await e.wait({selector:R,timeout:3})}catch{}let n=await q(e);if(!n.length){await e.goto(CHATGPT_URL,{settleMs:2000});try{await e.wait({selector:R,timeout:8})}catch{}n=await q(e)}return n}async function q(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
487
487
|
const isVisible = (el) => {
|
|
488
488
|
if (!(el instanceof HTMLElement)) return false;
|
|
489
489
|
const style = window.getComputedStyle(el);
|
|
@@ -508,9 +508,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
510
|
return rows;
|
|
511
|
-
})()`)),"chatgpt conversation link extraction").map((
|
|
511
|
+
})()`)),"chatgpt conversation link extraction").map((n,r)=>({Index:r+1,Id:String(n?.Id||""),Title:String(n?.Title||"(untitled)").trim()||"(untitled)",Url:String(n?.Url||"")})).filter((n)=>n.Id)}function U(e){const t=String(e||"").toLowerCase();if(t.endsWith(".png"))return"image/png";if(t.endsWith(".webp"))return"image/webp";if(t.endsWith(".gif"))return"image/gif";if(t.endsWith(".heic"))return"image/heic";if(t.endsWith(".heif"))return"image/heif";return"image/jpeg"}export async function prepareChatGPTImagePaths(e){const t=await import("node:fs"),n=await import("node:path"),r=e.map((i)=>n.default.resolve(i)),o=new Set([".jpg",".jpeg",".png",".webp",".gif",".heic",".heif"]);for(const i of r){if(!t.default.existsSync(i))return{ok:!1,reason:`Image not found: ${i}`};const l=t.default.statSync(i);if(!l.isFile())return{ok:!1,reason:`Not a file: ${i}`};if(l.size>26214400)return{ok:!1,reason:`Image too large (${(l.size/1024/1024).toFixed(1)} MB). Max: 25 MB`};const a=n.default.extname(i).toLowerCase();if(!o.has(a))return{ok:!1,reason:`Unsupported image type: ${i}`}}return{ok:!0,paths:r}}async function X(e,t){const n=JSON.stringify(t);for(let r=0;r<10;r+=1){await e.wait(1);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
512
512
|
(() => {
|
|
513
|
-
const names = ${
|
|
513
|
+
const names = ${n};
|
|
514
514
|
const text = document.body ? (document.body.innerText || '') : '';
|
|
515
515
|
const matchedNames = names.filter(name => text.includes(name)).length;
|
|
516
516
|
if (matchedNames >= names.length) return true;
|
|
@@ -535,9 +535,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
535
535
|
const previewNodes = Array.from(scope.querySelectorAll('img[src], canvas, video, [style*="background-image"]')).filter(isVisibleMedia);
|
|
536
536
|
return previewNodes.length >= names.length;
|
|
537
537
|
})()
|
|
538
|
-
`)),"chatgpt upload preview detection"))return!0}return!1}export async function uploadChatGPTImages(
|
|
538
|
+
`)),"chatgpt upload preview detection"))return!0}return!1}export async function uploadChatGPTImages(e,t){const n=await import("node:fs"),r=await import("node:path"),o=await prepareChatGPTImagePaths(t);if(!o.ok)return o;const i=o.paths,l=i.map((c)=>r.default.basename(c));let a=!1;if(e.setFileInput)try{await e.setFileInput(i,'input[type="file"]');a=!0}catch(c){const s=String(c?.message||c);if(!s.includes("Unknown action")&&!s.includes("not supported")&&!s.includes("Not allowed")&&!s.includes("File access not granted")&&!s.includes("No element found"))throw c}if(!a){const c=i.map((f)=>({name:r.default.basename(f),mime:U(f),base64:n.default.readFileSync(f).toString("base64")})),s=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
539
539
|
(() => {
|
|
540
|
-
const files = ${JSON.stringify(
|
|
540
|
+
const files = ${JSON.stringify(c)};
|
|
541
541
|
const input = document.querySelector('input[type="file"]');
|
|
542
542
|
if (!(input instanceof HTMLInputElement)) {
|
|
543
543
|
return { ok: false, reason: 'file input not found' };
|
|
@@ -571,7 +571,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
571
571
|
}
|
|
572
572
|
return { ok: true };
|
|
573
573
|
})()
|
|
574
|
-
`)),"chatgpt image upload fallback");if(
|
|
574
|
+
`)),"chatgpt image upload fallback");if(s&&!s.ok)return s}if(!await X(e,l))return{ok:!1,reason:"image upload preview did not appear"};return{ok:!0,files:i}}export async function isGenerating(e){return requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
575
575
|
(() => {
|
|
576
576
|
const text = (document.body?.innerText || '').replace(/\\s+/g, ' ');
|
|
577
577
|
if (/正在思考|停止生成|Thinking/.test(text)) return true;
|
|
@@ -583,7 +583,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
583
583
|
|| label.includes('正在思考');
|
|
584
584
|
});
|
|
585
585
|
})()
|
|
586
|
-
`)),"chatgpt generation state")}export async function getChatGPTVisibleImageUrls(
|
|
586
|
+
`)),"chatgpt generation state")}export async function getChatGPTVisibleImageUrls(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
587
587
|
(() => {
|
|
588
588
|
const isVisible = (el) => {
|
|
589
589
|
if (!(el instanceof HTMLElement)) return false;
|
|
@@ -701,9 +701,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
701
701
|
}
|
|
702
702
|
return urls;
|
|
703
703
|
})()
|
|
704
|
-
`)),"chatgpt visible image url extraction")}export async function waitForChatGPTImages(
|
|
705
|
-
`),
|
|
706
|
-
`);if(
|
|
704
|
+
`)),"chatgpt visible image url extraction")}export async function waitForChatGPTImages(e,t,n,r){const o=new Set(t),i=3,l=Math.max(1,Math.ceil(n/i));let a=[],u=0;for(let c=0;c<l;c++){await e.wait(c===0?3:i);let s="";if(r&&r.includes("/c/")){s=unwrapEvaluateResult(await e.evaluate("window.location.href").catch(()=>""));if(s&&!x(s,r)){await e.goto(r);await e.sleep(3)}}if(await isGenerating(e))continue;if(r&&r.includes("/c/")&&c>0&&c%5===0){if(!s||x(s,r)){await e.goto(r);await e.sleep(3)}}const p=(await getChatGPTVisibleImageUrls(e)).filter((L)=>!o.has(L));if(p.length===0)continue;const h=p.join(`
|
|
705
|
+
`),m=a.join(`
|
|
706
|
+
`);if(h===m)u+=1;else{a=p;u=1}if(u>=2||c===l-1)return a}return a}export async function getProjectList(e){await ensureOnChatGPT(e);if(requireBooleanEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
707
707
|
const button = Array.from(document.querySelectorAll('button'))
|
|
708
708
|
.find((node) => /open sidebar/i.test(node.getAttribute('aria-label') || ''));
|
|
709
709
|
if (button instanceof HTMLElement) {
|
|
@@ -711,7 +711,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
711
711
|
return true;
|
|
712
712
|
}
|
|
713
713
|
return false;
|
|
714
|
-
})()`)),"chatgpt sidebar open state"))await
|
|
714
|
+
})()`)),"chatgpt sidebar open state"))await e.wait(0.5);await e.evaluate(`(() => {
|
|
715
715
|
var btn = Array.from(document.querySelectorAll('button')).find(function(b) {
|
|
716
716
|
var text = (b.innerText || '').trim();
|
|
717
717
|
return text === 'Show more' || text === '显示更多' || text === '查看更多';
|
|
@@ -719,7 +719,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
719
719
|
if (btn instanceof HTMLElement) {
|
|
720
720
|
btn.click();
|
|
721
721
|
}
|
|
722
|
-
})()`);await
|
|
722
|
+
})()`);await e.wait(0.5);let n=await z(e);if(!n.length){await e.goto(CHATGPT_URL,{settleMs:2000});await e.wait(1);await e.evaluate(`(() => {
|
|
723
723
|
var btn = Array.from(document.querySelectorAll('button')).find(function(b) {
|
|
724
724
|
var text = (b.innerText || '').trim();
|
|
725
725
|
return text === 'Show more' || text === '显示更多' || text === '查看更多';
|
|
@@ -727,8 +727,8 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
727
727
|
if (btn instanceof HTMLElement) {
|
|
728
728
|
btn.click();
|
|
729
729
|
}
|
|
730
|
-
})()`);await
|
|
731
|
-
const projectLinkSelector = ${JSON.stringify(
|
|
730
|
+
})()`);await e.wait(0.5);n=await z(e)}return n}async function z(e){return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`(() => {
|
|
731
|
+
const projectLinkSelector = ${JSON.stringify(O)};
|
|
732
732
|
const isVisible = (el) => {
|
|
733
733
|
if (!(el instanceof HTMLElement)) return false;
|
|
734
734
|
const style = window.getComputedStyle(el);
|
|
@@ -837,9 +837,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
837
837
|
}
|
|
838
838
|
|
|
839
839
|
return rows;
|
|
840
|
-
})()`)),"chatgpt project link extraction").map(function(
|
|
840
|
+
})()`)),"chatgpt project link extraction").map(function(n,r){return{Index:r+1,Id:String(n?.Id||""),Title:String(n?.Title||"(untitled project)").trim()||"(untitled project)",Url:String(n?.Url||"")}}).filter(function(n){return n.Id})}const Y=["Add files","Add sources","添加文件","Project files","项目文件"],G=['[role="tabpanel"][data-state="active"] [data-project-home-sources-surface="true"] input[type="file"]:not([accept])','[data-project-home-sources-surface="true"] input[type="file"]:not([accept])','[role="dialog"] input[type="file"]','[data-testid*="project-files"] input[type="file"]','[data-testid*="project"] input[type="file"]'];export async function navigateToProject(e,t){const n=parseChatGPTProjectId(t);await e.goto(`${CHATGPT_URL}/g/g-p-${n}`,{settleMs:2000});try{await e.wait({selector:C,timeout:10})}catch{}const r=await getPageState(e);if(j(r.url)===n)return n;if(r.hasLoginGate||!r.isLoggedIn)throw new A(CHATGPT_DOMAIN,"ChatGPT project requires a logged-in ChatGPT session.");throw new d(`ChatGPT did not open the requested project ${n}.`,`Current URL: ${r.url||"(unknown)"}`)}export async function openProjectKnowledgeDialog(e){const t=unwrapEvaluateResult(await e.evaluate(`
|
|
841
841
|
(() => {
|
|
842
|
-
const labels = ${JSON.stringify(
|
|
842
|
+
const labels = ${JSON.stringify(Y)};
|
|
843
843
|
const isVisible = (el) => {
|
|
844
844
|
if (!(el instanceof HTMLElement)) return false;
|
|
845
845
|
const style = window.getComputedStyle(el);
|
|
@@ -919,12 +919,12 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
919
919
|
|
|
920
920
|
return { ok: false };
|
|
921
921
|
})()
|
|
922
|
-
`)),
|
|
922
|
+
`)),n=typeof t==="boolean"?{ok:t}:requireObjectEvaluateResult(t,"chatgpt project knowledge dialog open");if(n.ok){if(n.nativeClick&&typeof e.nativeClick==="function")try{await e.nativeClick(n.nativeClick.x,n.nativeClick.y)}catch{}if(n.nativeClick&&typeof e.click==="function")try{await e.click('[role="tab"][id$="-sources"]')}catch{}await e.wait(1);try{await e.wait({selector:'[role="dialog"], [data-project-home-sources-surface="true"] input[type="file"]',timeout:5})}catch{}return!0}return!1}export async function uploadChatGPTProjectFiles(e,t,n){const r=parseChatGPTProjectId(t),o=await import("node:fs"),i=await import("node:path"),l=await prepareChatGPTFilePaths(n);if(!l.ok)return{...l,inputError:!0};const a=l.paths;await navigateToProject(e,r);await ensureChatGPTLogin(e,"ChatGPT project file upload requires a logged-in ChatGPT session.");if(!await openProjectKnowledgeDialog(e))return{ok:!1,reason:'could not find or click the project "Add files" button'};const c=a.map((p)=>i.default.basename(p));let s=!1;if(e.setFileInput)for(const p of G)try{await e.setFileInput(a,p);s=!0;break}catch(h){const m=String(h?.message||h);if(!m.includes("Unknown action")&&!m.includes("not supported")&&!m.includes("Not allowed")&&!m.includes("File access not granted")&&!m.includes("No element found"))throw h}if(!s){const p=a.map((m)=>({name:i.default.basename(m),mime:B(m),base64:o.default.readFileSync(m).toString("base64")})),h=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
923
923
|
(() => {
|
|
924
|
-
const files = ${JSON.stringify(
|
|
924
|
+
const files = ${JSON.stringify(p)};
|
|
925
925
|
|
|
926
926
|
// Look for file input inside a dialog or the project area
|
|
927
|
-
const selectors = ${JSON.stringify(
|
|
927
|
+
const selectors = ${JSON.stringify(G)};
|
|
928
928
|
let input = null;
|
|
929
929
|
for (const sel of selectors) {
|
|
930
930
|
input = document.querySelector(sel);
|
|
@@ -973,9 +973,9 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
973
973
|
}
|
|
974
974
|
return { ok: true };
|
|
975
975
|
})()
|
|
976
|
-
`)),"chatgpt project file upload fallback");if(
|
|
976
|
+
`)),"chatgpt project file upload fallback");if(h&&!h.ok)return h}const f=await Z(e,c);if(!f.ok)return f;return{ok:!0,files:a}}async function Z(e,t){const n=t.map((o)=>String(o||"").trim()).filter(Boolean);if(!n.length)return{ok:!0};let r="uploaded file did not appear in project knowledge";for(let o=0;o<10;o+=1){const i=requireObjectEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
977
977
|
(() => {
|
|
978
|
-
const expectedFileNames = ${JSON.stringify(
|
|
978
|
+
const expectedFileNames = ${JSON.stringify(n)};
|
|
979
979
|
const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();
|
|
980
980
|
const root = document.querySelector('[role="dialog"]')
|
|
981
981
|
|| document.querySelector('[data-project-home-sources-surface="true"]')
|
|
@@ -995,7 +995,7 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
995
995
|
if (!missing.length) return { ok: true };
|
|
996
996
|
return { ok: false, pending: true, reason: 'uploaded file did not appear in project knowledge: ' + missing.join(', ') };
|
|
997
997
|
})()
|
|
998
|
-
`)),"chatgpt project upload confirmation");if(
|
|
998
|
+
`)),"chatgpt project upload confirmation");if(i.ok===!0)return{ok:!0};r=String(i.reason||r);if(!i.pending)return{ok:!1,reason:r};await e.wait(0.5)}return{ok:!1,reason:r}}export async function prepareChatGPTFilePaths(e){const t=await import("node:fs"),n=await import("node:path"),r=e.map((o)=>n.default.resolve(o));for(const o of r){if(!t.default.existsSync(o))return{ok:!1,reason:`File not found: ${o}`};const i=t.default.statSync(o);if(!i.isFile())return{ok:!1,reason:`Not a file: ${o}`};if(i.size>536870912)return{ok:!1,reason:`File too large (${(i.size/1024/1024).toFixed(1)} MB). Max: 512 MB`}}return{ok:!0,paths:r}}function B(e){const t=String(e||"").toLowerCase();if(t.endsWith(".pdf"))return"application/pdf";if(t.endsWith(".doc"))return"application/msword";if(t.endsWith(".docx"))return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";if(t.endsWith(".xls"))return"application/vnd.ms-excel";if(t.endsWith(".xlsx"))return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(t.endsWith(".ppt"))return"application/vnd.ms-powerpoint";if(t.endsWith(".pptx"))return"application/vnd.openxmlformats-officedocument.presentationml.presentation";if(t.endsWith(".csv"))return"text/csv";if(t.endsWith(".txt"))return"text/plain";if(t.endsWith(".json"))return"application/json";if(t.endsWith(".xml"))return"application/xml";if(t.endsWith(".html")||t.endsWith(".htm"))return"text/html";if(t.endsWith(".md"))return"text/markdown";if(t.endsWith(".py"))return"text/x-python";if(t.endsWith(".js"))return"text/javascript";if(t.endsWith(".ts"))return"application/typescript";if(t.endsWith(".jsx"))return"text/jsx";if(t.endsWith(".tsx"))return"text/tsx";if(t.endsWith(".png"))return"image/png";if(t.endsWith(".jpg")||t.endsWith(".jpeg"))return"image/jpeg";if(t.endsWith(".gif"))return"image/gif";if(t.endsWith(".webp"))return"image/webp";if(t.endsWith(".svg"))return"image/svg+xml";return"application/octet-stream"}export const __test__={COMPOSER_SELECTORS:b,SEND_BUTTON_SELECTOR:T,SEND_BUTTON_FALLBACK_SELECTORS:S,SEND_BUTTON_LABELS:k,CLOSE_SIDEBAR_LABELS:I,buildComposerLocatorScript:P,isSameChatGPTConversation:x,parseChatGPTConversationId,parseChatGPTProjectId,imageMimeFromPath:U,mimeFromFilePath:B,PROJECT_LINK_SELECTOR:O};export async function getChatGPTImageAssets(e,t){const n=JSON.stringify(t);return requireArrayEvaluateResult(unwrapEvaluateResult(await e.evaluate(`
|
|
999
999
|
(async (targetUrls) => {
|
|
1000
1000
|
const blobToDataUrl = (blob) => new Promise((resolve, reject) => {
|
|
1001
1001
|
const reader = new FileReader();
|
|
@@ -1088,5 +1088,5 @@ import{htmlToMarkdown as m}from"@jackwener/opencli/utils";import{ArgumentError a
|
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
1090
|
return results;
|
|
1091
|
-
})(${
|
|
1091
|
+
})(${n})
|
|
1092
1092
|
`)),"chatgpt image asset export")}
|
package/clis/chatgpt-app/ask.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{statSync as
|
|
1
|
+
import{statSync as x}from"node:fs";import{cli as T,Strategy as C}from"@jackwener/opencli/registry";import{ArgumentError as n,ConfigError as P,TimeoutError as M}from"@jackwener/opencli/errors";import{activateChatGPT as r,getVisibleChatMessages as h,selectModel as b,MODEL_CHOICES as y,isGenerating as S,sendPrompt as q}from"./ax.js";export const askCommand=T({site:"chatgpt-app",name:"ask",access:"write",description:"Send a prompt and wait for the AI response (send + wait + read)",domain:"localhost",strategy:C.PUBLIC,browser:!1,args:[{name:"text",fromFile:!0,required:!0,positional:!0,help:"Prompt to send"},{name:"model",required:!1,help:"Model/mode to use: auto, instant, thinking, 5.2-instant, 5.2-thinking",choices:y},{name:"timeout",type:"int",required:!1,help:"Max seconds to wait for response (default: 30)",default:30},{name:"image",required:!1,help:"Path to local image to attach (optional)"}],columns:["Role","Text"],func:async(o)=>{if(process.platform!=="darwin")throw new P("ChatGPT Desktop integration requires macOS (osascript is not available on this platform)");const{text:s,model:l,timeout:i,image:t}=o;if(t){let e;try{e=x(t)}catch{throw new n(`The specified image path does not exist: ${t}`)}if(!e.isFile())throw new n(`The specified image path is not a file: ${t}`)}if(!Number.isInteger(i)||i<1)throw new n("--timeout must be a positive integer (seconds)");if(l){r();b(l)}const m=h();r();q(s,t);const c=2,u=Math.ceil(i/c);let a="",p=!1;for(let e=0;e<u;e++){await new Promise((d)=>setTimeout(d,c*1000));if(S()){p=!0;continue}if(!p&&e<3)continue;r(0.3);const f=h();if(f.length>m.length){const g=[...f.slice(m.length)].reverse().find((w)=>w!==s);if(g)a=g}break}if(!a)throw new M("chatgpt-app/ask",i,"ChatGPT may still be generating; rerun read or increase --timeout");return[{Role:"User",Text:s},{Role:"Assistant",Text:a}]}});
|
package/clis/chatgpt-app/send.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as a,Strategy as n}from"@jackwener/opencli/registry";import{CommandExecutionError as i,ConfigError as m,getErrorMessage as c}from"@jackwener/opencli/errors";import{activateChatGPT as o,selectModel as d,MODEL_CHOICES as l,sendPrompt as p}from"./ax.js";export const sendCommand=a({site:"chatgpt-app",name:"send",access:"write",description:"Send a message to the active ChatGPT Desktop App window",domain:"localhost",strategy:n.PUBLIC,browser:!1,args:[{name:"text",fromFile:!0,required:!0,positional:!0,help:"Message to send"},{name:"model",required:!1,help:"Model/mode to use: auto, instant, thinking, 5.2-instant, 5.2-thinking",choices:l}],columns:["Status"],func:async(e)=>{if(process.platform!=="darwin")throw new m("ChatGPT Desktop integration requires macOS (osascript is not available on this platform)");const{text:r,model:t}=e;try{if(t){o();d(t)}o();p(r);return[{Status:"Success"}]}catch(s){throw new i("Failed to send ChatGPT message: "+c(s))}}});
|