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/medium/stats.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{EmptyResultError as d}from"@jackwener/opencli/errors";const p="https://medium.com/me/stats?publishedAt=DESC";u({site:"medium",name:"stats",access:"read",description:"Medium 文章数据(每篇曝光/浏览/读完/读完率/收益等运营指标)。首次调用要拉起浏览器会话、偏慢,客户端超时属正常,重试一次即可",domain:"medium.com",strategy:c.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","displays","reads","read_ratio","earnings","read_time","extra"],func:async(a,l)=>{const m=Math.max(1,Number(l.limit)||20);await a.goto(p);const e=await a.evaluate(`(async () => {
|
|
2
2
|
try {
|
|
3
3
|
if (!location.href.includes('medium.com')) {
|
|
4
4
|
return { error: '未登录 Medium(页面被重定向到 ' + location.href + '),请先在 Chrome 里登录 medium.com' };
|
|
@@ -6,7 +6,7 @@ import{cli as I,Strategy as J}from"@jackwener/opencli/registry";import{EmptyResu
|
|
|
6
6
|
if (location.pathname.includes('/m/signin') || location.pathname === '/') {
|
|
7
7
|
return { error: '未登录 Medium:请先在 Chrome 里登录 medium.com 再运行 medium stats' };
|
|
8
8
|
}
|
|
9
|
-
const limit = ${JSON.stringify(
|
|
9
|
+
const limit = ${JSON.stringify(m)};
|
|
10
10
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
11
11
|
const postsInCache = () => {
|
|
12
12
|
const c = window.__APOLLO_CLIENT__ && window.__APOLLO_CLIENT__.cache;
|
|
@@ -53,4 +53,4 @@ import{cli as I,Strategy as J}from"@jackwener/opencli/registry";import{EmptyResu
|
|
|
53
53
|
} catch (e) {
|
|
54
54
|
return { error: String((e && e.message) || e) };
|
|
55
55
|
}
|
|
56
|
-
})()`);if(!
|
|
56
|
+
})()`);if(!e||e.error)throw Error(e?.error||"medium stats:evaluate 无返回(浏览器会话异常)");const i=Array.isArray(e.items)?e.items:[];if(i.length===0)throw new d("medium stats","该 Medium 账号没有任何已发布文章。");i.sort((t,s)=>(s.publishedAt||0)-(t.publishedAt||0));return i.map((t)=>{const s=t.stats||{},r=s.views??0,n=s.reads??0,o=t.earnings?Number(t.earnings.units||0)+Number(t.earnings.nanos||0)/1e9:null;return{id:t.id||"",type:"article",title:t.title||"",url:t.url||"",published_at:t.publishedAt?new Date(t.publishedAt).toISOString():"",views:r,likes:"",comments:"",collects:"",shares:"",displays:s.presentations??0,reads:n,read_ratio:r>0?`${(n/r*100).toFixed(1)}%`:"",earnings:o!=null&&o>0?`$${o.toFixed(2)}`:"",read_time:t.readingTime?`${Math.round(t.readingTime)}min`:"",extra:JSON.stringify({visibility:t.visibility||"",is_locked:t.isLocked})}})}});
|
package/clis/medium/tag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as f,Strategy as w}from"@jackwener/opencli/registry";import{ArgumentError as
|
|
1
|
+
import{cli as f,Strategy as w}from"@jackwener/opencli/registry";import{ArgumentError as m,CommandExecutionError as g,EmptyResultError as l}from"@jackwener/opencli/errors";const S=/^[a-z0-9][a-z0-9-]*$/i,T={"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'"," ":" "};function s(t){return String(t??"").replace(/&#x([0-9a-fA-F]+);/g,(e,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&(amp|lt|gt|quot|apos|#39|nbsp);/g,(e)=>T[e]||e)}function o(t,e){const r=t.match(new RegExp(`<${e}[^>]*>\\s*<!\\[CDATA\\[([\\s\\S]*?)\\]\\]>\\s*<\\/${e}>`));if(r)return r[1];const n=t.match(new RegExp(`<${e}[^>]*>([\\s\\S]*?)<\\/${e}>`));return n?n[1]:""}function x(t){const e=[],r=/<category(?:[^>]*)>(?:<!\[CDATA\[([\s\S]*?)\]\]>|([\s\S]*?))<\/category>/g;let n;while((n=r.exec(t))!==null){const i=s((n[1]??n[2]??"").trim());if(i)e.push(i)}return e}function y(t){if(!t)return"";const e=new Date(t);if(Number.isNaN(e.getTime()))return"";return e.toISOString().slice(0,10)}function C(t){return s(String(t??"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim())}function E(t){const e=String(t??"").trim().toLowerCase();if(!e)throw new m('medium tag is required (e.g. "programming", "javascript")');if(!S.test(e))throw new m(`medium tag "${t}" is not valid`,'Tags are lowercase alphanumeric, optionally hyphenated (e.g. "machine-learning").');return e}function I(t,e,r){const n=t??e,i=typeof n==="number"?n:Number(n);if(!Number.isInteger(i)||i<=0)throw new m("medium limit must be a positive integer");if(i>r)throw new m(`medium limit must be <= ${r}`);return i}f({site:"medium",name:"tag",access:"read",description:"Latest Medium articles tagged with a given keyword (RSS feed)",domain:"medium.com",strategy:w.PUBLIC,browser:!1,args:[{name:"tag",positional:!0,required:!0,help:'Lowercase tag slug (e.g. "programming", "machine-learning")'},{name:"limit",type:"int",default:20,help:"Max articles (1-25 — single RSS page)"}],columns:["rank","title","author","description","categories","published","url"],func:async(t)=>{const e=E(t.tag),r=I(t.limit,20,25),n=`https://medium.com/feed/tag/${e}`;let i;try{i=await fetch(n,{headers:{"user-agent":"opencli-medium-adapter (+https://github.com/jackwener/OpenCLI)",accept:"application/rss+xml, application/xml"}})}catch(a){throw new g(`medium tag request failed: ${a?.message??a}`,"Check that medium.com is reachable from this network.")}if(i.status===404)throw new l("medium tag",`Medium tag "${e}" does not exist.`);if(!i.ok)throw new g(`medium tag returned HTTP ${i.status}`);const p=await i.text(),c=[],d=/<item[^>]*>([\s\S]*?)<\/item>/g;let u;while((u=d.exec(p))!==null)c.push(u[1]);if(!c.length)throw new l("medium tag",`Medium tag "${e}" RSS feed has no items.`);return c.slice(0,r).map((a,h)=>({rank:h+1,title:s(o(a,"title")).trim(),author:s(o(a,"dc:creator")).trim(),description:C(o(a,"description")),categories:x(a).join(", "),published:y(s(o(a,"pubDate")).trim()),url:s(o(a,"link")).trim()}))}});
|
package/clis/medium/whoami.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as r}from"@jackwener/opencli/registry";import{checkLogin as t,cookieQuickCheck as u}from"../_shared/article/auth.js";import{mediumAuthProfile as o}from"./article.js";m({site:"medium",name:"whoami",access:"read",description:"查询当前登录的 Medium 账户信息。",domain:"medium.com",strategy:r.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:u("https://medium.com",["sid","uid"])},func:async(i)=>{const e=await t(i,o);return[{logged_in:e.isAuthenticated,user_id:e.userId||"",username:e.username||""}]}});
|
package/clis/mubu/notes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as N,Strategy as b}from"@jackwener/opencli/registry";import{ArgumentError as l}from"@jackwener/opencli/errors";import{mubuPost as S,nodesToMarkdown as I,nodesToText as x,htmlToText as y}from"./utils.js";function Y(){const t=new Date;return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}}function g(t,e){return new Date(t,e,0).getDate()}function h(t,e="年份"){if(!Number.isInteger(t)||t<1)throw new l(`${e} 非法:${t},应为正整数`)}function w(t){if(!Number.isInteger(t)||t<1||t>12)throw new l(`月份非法:${t},应为 1-12`)}function K(t,e,o){const n=g(t,e);if(!Number.isInteger(o)||o<1||o>n)throw new l(`日期非法:${t}-${e}-${o}(${t} 年 ${e} 月共 ${n} 天)`)}function p(t){const e=t.split("-").map(Number);if(e.length!==3||e.some(isNaN))throw new l(`日期格式错误:${t},应为 YYYY-MM-DD`);const[o,n,s]=e;h(o);w(n);K(o,n,s);return{year:o,month:n,day:s}}function T(t){const e=t.split("-").map(Number);if(e.length!==2||e.some(isNaN))throw new l(`月份格式错误:${t},应为 YYYY-MM`);const[o,n]=e;h(o);w(n);return{year:o,month:n}}function m(t){return`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function v(t){const{date:e,month:o,year:n,from:s,to:c}=t;if(s||c){if(!s)throw new l("使用 --to 时必须同时指定 --from");const r=p(s),i=c?p(c):Y();if(m(r)>m(i))throw new l("--from 不能晚于 --to");return{start:r,end:i}}if(n!==void 0&&n!==null){h(n,"--year");return{start:{year:n,month:1,day:1},end:{year:n,month:12,day:31}}}if(o){const{year:r,month:i}=T(o);return{start:{year:r,month:i,day:1},end:{year:r,month:i,day:g(r,i)}}}if(e){const r=p(e);return{start:r,end:r}}const d=Y();return{start:d,end:d}}async function O(t,e){const o=await t.evaluate("localStorage.getItem('daily_notes_doc_list')");if(!o)return null;return JSON.parse(o).find((s)=>s.name===`${e}年`)?.id??null}async function E(t,e){const o=await S(t,"/document/edit/get",{docId:e});return JSON.parse(o.definition).nodes??[]}async function R(t,e){const o=await O(t,e);if(!o)return[];const n=await E(t,o),s=[];for(const c of n){const d=parseInt(y(c.text),10);if(!c.children?.length)continue;for(const r of c.children){const i=y(r.text).replace(/\s+/g," ").trim(),u=i.replace(/\s/g,"").match(/^(\d+)月(\d+)日/);if(!u)continue;const a=parseInt(u[1],10),M=parseInt(u[2],10);if(a!==d)continue;const D=m({year:e,month:a,day:M});s.push({dateKey:D,label:i,node:r})}}return s}function _(t,e){const o=[];for(let n=t.year;n<=e.year;n++)o.push(n);return o}N({site:"mubu",name:"notes",access:"read",description:"读取幕布速记(默认今天)。支持 --date/--month/--year/--from/--to 指定时间范围,--list 为概览模式(日期+条数)。",domain:"mubu.com",strategy:b.COOKIE,args:[{name:"list",type:"bool",default:!1,help:"概览模式:只输出日期和条数,不含速记内容。可与任意时间范围参数组合。"},{name:"date",help:"单日,格式 YYYY-MM-DD。不指定时间范围则默认今天(系统本地时间)。"},{name:"month",help:"整月,格式 YYYY-MM。"},{name:"year",type:"int",help:"整年,格式 YYYY(整数)。"},{name:"from",help:"范围起始日,格式 YYYY-MM-DD。须与 --to 同时使用。"},{name:"to",help:"范围截止日,格式 YYYY-MM-DD。须与 --from 同时使用。"},{name:"output",default:"md",help:"输出格式:md(默认,Markdown)或 text(纯文本)"}],columns:["date","content"],func:async(t,e)=>{const{list:o,output:n}=e;if(n!=="md"&&n!=="text")throw new l(`--output 只接受 md 或 text,收到:${n}`);await t.goto("https://mubu.com/app");const{start:s,end:c}=v(e),d=m(s),r=m(c),f=(await Promise.all(_(s,c).map((a)=>R(t,a)))).flat().filter((a)=>a.dateKey>=d&&a.dateKey<=r);if(f.length===0)return[{date:d===r?d:`${d} ~ ${r}`,content:"该时间段暂无速记"}];if(o)return f.map((a)=>({date:a.label,content:`${a.node.children?.length??0} 条记录`}));const u=(a)=>n==="text"?x(a):I(a);return f.filter((a)=>a.node.children?.length).map((a)=>({date:a.label,content:u(a.node.children??[])||"(空)"}))}});
|
package/clis/mubu/utils.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as h,CommandExecutionError as d}from"@jackwener/opencli/errors";export const API_BASE="https://api2.mubu.com/v3/api";const m="mubu.com",g="Mubu requires a logged-in browser session at mubu.com";function w(s,t){if(s===401||s===403)return!0;if(!t)return!1;return/not logged in|login required|unauthorized|未登录|请先登录|需要登录|login expired/i.test(t)}export async function mubuPost(s,t,n){const e=`${API_BASE}${t}`,o=await s.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const token = localStorage.getItem('Jwt-Token');
|
|
4
4
|
if (!token) return { ok: false, status: 0, data: null, error: 'no token' };
|
|
5
5
|
return await new Promise((resolve) => {
|
|
6
6
|
const xhr = new XMLHttpRequest();
|
|
7
|
-
xhr.open('POST', ${JSON.stringify(
|
|
7
|
+
xhr.open('POST', ${JSON.stringify(e)}, true);
|
|
8
8
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
9
9
|
xhr.setRequestHeader('Jwt-Token', token);
|
|
10
10
|
xhr.onload = () => {
|
|
@@ -13,19 +13,19 @@ import{AuthRequiredError as L,CommandExecutionError as q}from"@jackwener/opencli
|
|
|
13
13
|
resolve({ ok: xhr.status >= 200 && xhr.status < 300, status: xhr.status, data });
|
|
14
14
|
};
|
|
15
15
|
xhr.onerror = () => resolve({ ok: false, status: 0, data: null, error: 'network error' });
|
|
16
|
-
xhr.send(${JSON.stringify(JSON.stringify(
|
|
16
|
+
xhr.send(${JSON.stringify(JSON.stringify(n))});
|
|
17
17
|
});
|
|
18
18
|
})()
|
|
19
|
-
`);if(!
|
|
20
|
-
`)});
|
|
21
|
-
`).replace(/<[^>]+>/g,"");return
|
|
22
|
-
`)}export function htmlToMarkdown(
|
|
23
|
-
`);
|
|
24
|
-
`)){const[
|
|
25
|
-
`);
|
|
26
|
-
`))
|
|
27
|
-
`)}export function nodesToMarkdown(
|
|
28
|
-
`)){const[
|
|
29
|
-
`);
|
|
30
|
-
`);for(const
|
|
19
|
+
`);if(!o||o.error==="no token")throw new h(m,g);if(!o.ok||!o.data)throw new d(`mubu: ${t}: HTTP ${o.status} ${o.error??""}`);const{data:r}=o;if(r.code!==0){if(w(r.code,r.message))throw new h(m,g);throw new d(`mubu: ${t}: code=${r.code} ${r.message??""}`)}return r.data}export function formatDate(s){if(!s)return"";const t=new Date(s),n=(e)=>String(e).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}const k={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function p(s){return s.replace(/&#x([0-9a-f]+);/gi,(t,n)=>String.fromCodePoint(parseInt(n,16))).replace(/&#(\d+);/g,(t,n)=>String.fromCodePoint(parseInt(n,10))).replace(/&(amp|lt|gt|quot|apos|nbsp);/g,(t,n)=>k[n])}function b(s){const t=[],n=s.match(/<tr[^>]*>[\s\S]*?<\/tr>/gi)??[];for(const e of n){const o=[],r=e.match(/<(?:td|th)[^>]*>[\s\S]*?<\/(?:td|th)>/gi)??[];for(const c of r){let u=c.replace(/^<(?:td|th)[^>]*>|<\/(?:td|th)>$/gi,"");o.push(u.trim())}t.push(o)}return t}export function htmlToText(s){let t=s;t=t.replace(/<div class="table-container">[\s\S]*?<\/table>\s*<\/div>/g,(n)=>{return b(n).map((e)=>e.map((o)=>{let r=o.replace(/<br\s*\/?>/gi," ").replace(/<[^>]+>/g,"");return p(r).trim()}).join("\t")).join(`
|
|
20
|
+
`)});t=t.replace(/<br\s*\/?>/gi,`
|
|
21
|
+
`).replace(/<[^>]+>/g,"");return p(t).trim()}function T(s){const t=b(s);if(t.length===0)return"";const n=(o)=>o.map((r)=>{return r.replace(/<br\s*\/?>/gi,"[[BR]]")}).join(" | "),e=[`| ${n(t[0])} |`,`| ${t[0].map(()=>"---").join(" | ")} |`];for(let o=1;o<t.length;o++)e.push(`| ${n(t[o])} |`);return e.join(`
|
|
22
|
+
`)}export function htmlToMarkdown(s){let t=s;t=t.replace(/<div class="table-container">[\s\S]*?<\/table>\s*<\/div>/g,(n)=>T(n));t=t.replace(/<br\s*\/?>/gi,`
|
|
23
|
+
`);t=t.replace(/<span class="([^"]+)"[^>]*>([\s\S]*?)<\/span>/gi,(n,e,o)=>{if(e.includes("node-mention"))return n;let r=o;if(/\bbold\b/.test(e))r=`**${r}**`;if(/\bitalic\b/.test(e))r=`*${r}*`;if(/\bstrikethrough\b/.test(e))r=`~~${r}~~`;if(/\bunderline\b/.test(e))r=`U_OPEN${r}U_CLOSE`;return r});t=t.replace(/<span([^>]*\bclass="[^"]*\bnode-mention\b[^"]*"[^>]*)>([\s\S]*?)<\/span>/gi,(n,e,o)=>{const r=e.match(/\bdata-doc="([^"]+)"/i),c=r?r[1]:"";if(!c)return n;const u=e.match(/\bclass="([^"]+)"/i),a=u?u[1]:"";let i=o.replace(/<[^>]+>/g,"").trim();if(/\bbold\b/.test(a))i=`**${i}**`;if(/\bitalic\b/.test(a))i=`*${i}*`;if(/\bstrikethrough\b/.test(a))i=`~~${i}~~`;if(/\bunderline\b/.test(a))i=`U_OPEN${i}U_CLOSE`;return`[${i}](https://mubu.com/app/edit/${c})`});t=t.replace(/<a([^>]*)>([\s\S]*?)<\/a>/gi,(n,e,o)=>{const r=e.match(/\bhref="([^"]+)"/i);if(!r)return n;const c=r[1],u=e.match(/\bclass="([^"]+)"/i),a=u?u[1]:"";let i=o;if(/\bbold\b/.test(a))i=`**${i}**`;if(/\bitalic\b/.test(a))i=`*${i}*`;if(/\bstrikethrough\b/.test(a))i=`~~${i}~~`;if(/\bunderline\b/.test(a))i=`U_OPEN${i}U_CLOSE`;return`[${i}](${c})`});t=t.replace(/<span[^>]*>([\s\S]*?)<\/span>/gi,"$1");t=t.replace(/<[^>]+>/g,"");t=p(t);t=t.replace(/\uFFFEU_OPEN\uFFFE/g,"<u>").replace(/\uFFFEU_CLOSE\uFFFE/g,"</u>");t=t.replace(/\[\[BR\]\]/g,"<br>");return t.trim()}const M="https://api2.mubu.com/v3";function F(s){return s.startsWith("http")?s:`${M}/${s}`}function x(s){if(!s.taskStatus)return"";return s.taskStatus===2?"[x] ":"[ ] "}function E(s){const t=[];if(s.deadline){const n=formatDate(s.deadline*1000);t.push(`\uD83D\uDCC5 ${s.deadlineType==="date"?n.slice(0,10):n}`)}if(s.remindAt)t.push(`⏰ ${formatDate(s.remindAt*1000)}`);return t.length?" "+t.join(" "):""}export function nodesToText(s,t=0){const n=[];for(const e of s){const o=" ".repeat(t),r=e.emoji?e.emoji+" ":"",c=htmlToText(e.text),u=x(e),a=E(e);if(c||r||u)if(c.includes(`
|
|
24
|
+
`)){const[i,...l]=c.split(`
|
|
25
|
+
`);n.push(o+u+r+i);for(const f of l)n.push(o+" "+f);if(a)n.push(o+" "+a.trim())}else n.push(o+u+r+c+a);if(e.note){const i=htmlToText(e.note);for(const l of i.split(`
|
|
26
|
+
`))n.push(o+" "+l)}if(e.images?.length)for(const i of e.images)n.push(o+`[图片: ${F(i.uri)}]`);if(e.children?.length)n.push(nodesToText(e.children,t+1))}return n.filter(Boolean).join(`
|
|
27
|
+
`)}export function nodesToMarkdown(s,t=0){const n=[];for(const e of s){const o=htmlToMarkdown(e.text);if(!o&&!e.images?.length&&!e.note&&!e.emoji)continue;const r=" ".repeat(t),c=e.emoji?e.emoji+" ":"",u=x(e),a=E(e);if(o||c||u)if(o.includes(`
|
|
28
|
+
`)){const[i,...l]=o.split(`
|
|
29
|
+
`);n.push(r+"- "+u+c+i);const f=r+" ";for(const S of l)n.push(f+S);if(a)n.push(f+a.trim())}else n.push(r+"- "+u+c+o+a);if(e.note){const i=htmlToMarkdown(e.note).split(`
|
|
30
|
+
`);for(const l of i)n.push(r+" > "+l)}if(e.images?.length)for(const i of e.images)n.push(r+` })`);if(e.children?.length)n.push(nodesToMarkdown(e.children,t+1))}return n.filter(Boolean).join(`
|
|
31
31
|
`)}
|
package/clis/note/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as n,CommandExecutionError as o}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as a}from"../_shared/site-auth.js";async function
|
|
1
|
+
import{AuthRequiredError as n,CommandExecutionError as o}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as a}from"../_shared/site-auth.js";async function r(e){return(await e.getCookies({url:"https://note.com"})).some((s)=>s.name==="_note_session_v5")}async function i(e){if(!await r(e))throw new n("note.com","note _note_session_v5 cookie missing");await e.goto("https://note.com/");const t=await e.evaluate(`(async () => {
|
|
2
2
|
try {
|
|
3
3
|
const res = await fetch('/api/v2/current_user', { credentials: 'include', headers: { 'Accept': 'application/json' } });
|
|
4
4
|
if (res.status === 401 || res.status === 403) return { kind: 'auth', detail: 'current_user HTTP ' + res.status };
|
|
@@ -9,4 +9,4 @@ import{AuthRequiredError as n,CommandExecutionError as o}from"@jackwener/opencli
|
|
|
9
9
|
if (!d || (d.urlname == null && d.id == null)) return { kind: 'auth', detail: 'current_user returned no user — anonymous' };
|
|
10
10
|
return { ok: true, urlname: String(d.urlname || ''), nickname: String(d.nickname || ''), user_id: String(d.id || '') };
|
|
11
11
|
} catch (e) { return { kind: 'exception', detail: String(e && e.message || e) }; }
|
|
12
|
-
})()`);if(
|
|
12
|
+
})()`);if(t?.kind==="auth")throw new n("note.com",t.detail);if(t?.kind==="http")throw new o(`HTTP ${t.httpStatus} from current_user`);if(t?.kind==="exception")throw new o(`note whoami failed: ${t.detail}`);if(!t?.ok)throw new o(`Unexpected note probe: ${JSON.stringify(t)}`);return{urlname:t.urlname,nickname:t.nickname,url:t.urlname?`https://note.com/${t.urlname}`:""}}a({site:"note",domain:"note.com",loginUrl:"https://note.com/login",columns:["urlname","nickname","url"],quickCheck:r,verify:i,poll:async(e)=>{if(!await r(e))throw new n("note.com","Waiting for note session cookie");return i(e)}});
|
package/clis/note/note-utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
2
|
-
`).trim();if(!
|
|
1
|
+
import{ArgumentError as a}from"@jackwener/opencli/errors";export function xsrfTokenFromCookies(t){const e=(t||[]).find((r)=>r&&r.name==="XSRF-TOKEN");if(!e)return"";try{return decodeURIComponent(e.value)}catch{return e.value}}export function noteWriteHeaders(t){return{"Content-Type":"application/json",...t?{"X-XSRF-TOKEN":t}:{}}}function i(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}export function textToParagraphs(t){const e=String(t??"").replace(/\r\n/g,`
|
|
2
|
+
`).trim();if(!e)return[];return e.split(/\n{2,}/).map((r)=>r.trim()).filter(Boolean)}export function buildBodyHtml(t,e=[]){const r=(t||[]).map((n)=>`<p>${i(n)}</p>`);for(const n of e||[])r.push(`<figure><img src="${i(n)}"></figure>`);return r.join("")}export function bodyLength(t){return String(t??"").length}export function parseHashtags(t){if(!t)return[];return String(t).split(",").map((e)=>e.trim()).filter(Boolean).map((e)=>e.startsWith("#")?e:`#${e}`)}export function parseMagazineIds(t){if(!t)return[];return String(t).split(",").map((e)=>e.trim()).filter(Boolean).map((e)=>{const r=Number(e);if(!Number.isFinite(r))throw new a(`Invalid magazine id "${e}" (expected a number)`);return r})}export function buildDraftSavePayload({title:t,bodyHtml:e,imageKeys:r=[]}){return{name:String(t??""),body:String(e??""),body_length:bodyLength(e),index:!1,is_lead_form:!1,image_keys:r}}export function buildPublishPayload({title:t,bodyHtml:e,hashtags:r=[],magazineIds:n=[],imageKeys:o=[]}){return{name:String(t??""),free_body:String(e??""),pay_body:"",status:"published",price:0,separator:null,is_refund:!1,limited:!1,index:!1,image_keys:o,hashtags:r,magazine_ids:n,body_length:bodyLength(e),send_notifications_flag:!0,lead_form:null,line_add_friend:null}}export function publicUrl(t,e){return`https://note.com/${t}/n/${e}`}export function classifyImages(t){if(!t)return[];return String(t).split(",").map((e)=>e.trim()).filter(Boolean).map((e)=>({kind:/^https?:\/\//i.test(e)?"url":"path",value:e}))}
|
package/clis/note/publish.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as v from"node:fs";import*as x from"node:path";import{cli as J,Strategy as U}from"@jackwener/opencli/registry";import{AuthRequiredError as I,ArgumentError as T,CommandExecutionError as m}from"@jackwener/opencli/errors";import{xsrfTokenFromCookies as E,noteWriteHeaders as y,textToParagraphs as C,buildBodyHtml as A,parseHashtags as j,parseMagazineIds as z,buildDraftSavePayload as F,buildPublishPayload as q,publicUrl as N,classifyImages as D}from"./note-utils.js";const B=new Set([".jpg",".jpeg",".png",".gif",".webp"]);function O(t){if(t&&typeof t==="object"&&!Array.isArray(t)&&"session"in t&&"data"in t)return t.data;return t}async function g(t,{url:e,method:l="GET",headers:o={},body:u=null}){const a=`(async () => {
|
|
2
2
|
try {
|
|
3
|
-
const opts = { method: ${JSON.stringify(
|
|
4
|
-
${
|
|
5
|
-
const res = await fetch(${JSON.stringify(
|
|
3
|
+
const opts = { method: ${JSON.stringify(l)}, credentials: 'include', headers: ${JSON.stringify({Accept:"application/json",...o})} };
|
|
4
|
+
${u!=null?`opts.body = ${JSON.stringify(u)};`:""}
|
|
5
|
+
const res = await fetch(${JSON.stringify(e)}, opts);
|
|
6
6
|
const text = await res.text();
|
|
7
7
|
let data = null; try { data = JSON.parse(text); } catch {}
|
|
8
8
|
return { ok: res.ok, status: res.status, data, text: text.slice(0, 300) };
|
|
9
9
|
} catch (e) { return { ok: false, status: 0, data: null, text: String(e && e.message || e) }; }
|
|
10
|
-
})()`;return
|
|
10
|
+
})()`;return O(await t.evaluate(a))}async function P(t,e,l){const o=x.resolve(e);if(!B.has(x.extname(o).toLowerCase()))throw new T(`Unsupported image (jpg/png/gif/webp): ${e}`);const u=v.statSync(o,{throwIfNoEntry:!1});if(!u||!u.isFile())throw new T(`Not a file: ${o}`);const a=await g(t,{url:"https://editor.note.com/api/v1/presigns",method:"POST",headers:y(l),body:JSON.stringify({filename:x.basename(o)})}),s=a&&a.data&&(a.data.data||a.data),r=s&&s.url,d=s&&(s.s3_url||s.url);if(!a.ok||!r||!d)throw new m(`note image presign failed (best-effort): HTTP ${a.status} ${a.text}`);const p=v.readFileSync(o).toString("base64"),i=await t.evaluate(`(async () => {
|
|
11
11
|
try {
|
|
12
|
-
const bin = atob(${JSON.stringify(
|
|
12
|
+
const bin = atob(${JSON.stringify(p)});
|
|
13
13
|
const arr = new Uint8Array(bin.length); for (let i = 0; i < bin.length; i++) arr[i] = bin.charCodeAt(i);
|
|
14
|
-
const res = await fetch(${JSON.stringify(
|
|
14
|
+
const res = await fetch(${JSON.stringify(r)}, { method: 'PUT', body: new Blob([arr]) });
|
|
15
15
|
return { ok: res.ok, status: res.status };
|
|
16
16
|
} catch (e) { return { ok: false, status: 0, text: String(e && e.message || e) }; }
|
|
17
|
-
})()`),O
|
|
17
|
+
})()`),n=O(i);if(!n||!n.ok)throw new m(`note image upload PUT failed (best-effort): HTTP ${n?n.status:"?"}`);return d}J({site:"note",name:"publish",access:"write",description:"Publish a text note to note.com (or save a draft with --draft)",domain:"note.com",strategy:U.COOKIE,browser:!0,args:[{name:"title",type:"string",required:!0,positional:!0,help:"Note title"},{name:"body",fromFile:!0,type:"string",help:"Note body text (blank lines split paragraphs)"},{name:"tags",type:"string",help:"Hashtags, comma-separated (# optional)"},{name:"magazine",type:"string",help:"Magazine id(s) to file under, comma-separated"},{name:"images",type:"string",help:"(best-effort) in-body images: local paths and/or urls"},{name:"draft",type:"boolean",default:!1,help:"Save the draft but do not publish"}],columns:["status","note_key","url"],func:async(t,e)=>{if(!t)throw new m("Browser session required for note publish");const l=String(e.title??"").trim();if(!l)throw new T("note publish: title is required");const o=j(e.tags),u=z(e.magazine),a=D(e.images);await t.goto("https://note.com/");const s=E(await t.getCookies({url:"https://note.com"})),r=await g(t,{url:"https://note.com/api/v2/current_user"}),d=r.data&&(r.data.data||r.data);if(r.status===401||r.status===403||!d||!d.urlname)throw new I("note.com",`Not logged in (current_user HTTP ${r.status})`);const p=String(d.urlname),i=await g(t,{url:"https://note.com/api/v1/text_notes",method:"POST",headers:y(s),body:JSON.stringify({template_key:null})}),n=i.data&&(i.data.data||i.data);if(!i.ok||!n||n.id==null)throw new m(`note create-draft failed: HTTP ${i.status} ${i.text}`);const b=n.id;let c=n.key?String(n.key):"";const _=[];for(const S of a)_.push(S.kind==="url"?S.value:await P(t,S.value,s));const k=A(C(e.body),_),w=await g(t,{url:`https://note.com/api/v1/text_notes/draft_save?id=${encodeURIComponent(b)}&is_temp_saved=true`,method:"POST",headers:y(s),body:JSON.stringify(F({title:l,bodyHtml:k}))});if(!w.ok)throw new m(`note draft_save failed: HTTP ${w.status} ${w.text}`);if(e.draft)return{status:"draft",note_key:c,url:c?N(p,c):`https://note.com/notes/${b}/edit`};const f=await g(t,{url:`https://note.com/api/v1/text_notes/${encodeURIComponent(b)}`,method:"PUT",headers:y(s),body:JSON.stringify(q({title:l,bodyHtml:k,hashtags:o,magazineIds:u}))});if(!f.ok)throw new m(`note publish failed: HTTP ${f.status} ${f.text}`);const h=f.data&&(f.data.data||f.data);if(h&&h.note_key)c=String(h.note_key);const H=h&&h.public_url||(c?N(p,c):`https://note.com/${p}`);return{status:"published",note_key:c,url:H}}});export const __test__={uploadInlineImage:P};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as x from"node:fs";import*as m from"node:path";import{cli as k,Strategy as O}from"@jackwener/opencli/registry";import{ArgumentError as s,CommandExecutionError as h}from"@jackwener/opencli/errors";import{NOTEBOOKLM_DOMAIN as N,NOTEBOOKLM_SITE as L}from"./shared.js";import{callNotebooklmRpc as g}from"./rpc.js";import{buildNotebooklmNotebookUrl as w,ensureNotebooklmHome as T,getNotebooklmAuthuser as A,parseNotebooklmNotebookTarget as E,requireNotebooklmExecute as C,requireNotebooklmSession as M,verifyNotebooklmSourceAdded as y}from"./utils.js";const I="izAoDd",v="o4cbdc",S=10485760,b=52428800,R=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i,X={".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".markdown":"text/markdown",".html":"text/html",".htm":"text/html",".csv":"text/csv",".json":"application/json",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".doc":"application/msword",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".epub":"application/epub+zip",".mp3":"audio/mpeg",".m4a":"audio/mp4",".wav":"audio/wav"};export function inferMimeType(t,e){if(e)return String(e);const o=m.extname(t).toLowerCase();return X[o]||"application/octet-stream"}export function readFileForUpload(t){const e=m.resolve(t);let o;try{o=x.statSync(e)}catch{throw new s(`--file path does not exist: ${t}`)}if(!o.isFile())throw new s(`--file path is not a regular file: ${t}`);if(o.size>b)throw new s(`--file exceeds ${b} bytes (got ${o.size}); use a smaller file or upload via the NotebookLM UI for now.`);return{base64:x.readFileSync(e).toString("base64"),filename:m.basename(e),size:o.size}}export function buildRegisterFileSourceArgs(t,e){return[[[e]],t,[2],[1,null,null,null,null,null,null,null,null,null,[1]]]}export function parseSourceUrl(t){const e=String(t??"").trim();if(!e)return"";let o;try{o=new URL(e)}catch{throw new s(`Invalid source URL: "${e}"`,"URL must be a valid http:// or https:// URL.")}if(o.protocol!=="http:"&&o.protocol!=="https:"||!o.hostname)throw new s(`Invalid source URL: "${e}"`,"URL must start with http:// or https://.");return o.toString()}export function parseSourceText(t){if(t===void 0||t===null)return null;const e=String(t);if(!e.trim())throw new s("--content must not be empty");if(e.length>S)throw new s(`--content exceeds ${S} bytes; split into smaller sources or upload as a file.`);return e}export function parseSourceTitle(t,e){return String(t??"").trim()||e}export function buildAddSourceFromUrlArgs(t,e){return[[[null,null,[e]]],t]}export function buildAddSourceFromTextArgs(t,e,o){return[[[null,[e,o],null,2]],t]}function D(t){return new Set(t.map((e)=>String(e??"").toLowerCase()).filter(Boolean))}export function parseAddSourceResult(t,e=[]){const o=D(e);if(typeof t==="string")return R.test(t)&&!o.has(t.toLowerCase())?t:"";if(!Array.isArray(t)&&(typeof t!=="object"||t===null))return"";const n=[t];while(n.length){const r=n.shift();if(typeof r==="string"){if(R.test(r)&&!o.has(r.toLowerCase()))return r;continue}if(Array.isArray(r)){for(const i of r)n.push(i);continue}if(r&&typeof r==="object")for(const i of Object.values(r))n.push(i)}return""}async function F(t,e,o,n,r,i){const u=A()||"0",d=`{"PROJECT_ID":${JSON.stringify(e)},"SOURCE_NAME":${JSON.stringify(n)},"SOURCE_ID":${JSON.stringify(o)}}`,p=String.raw`(async () => {
|
|
2
2
|
try {
|
|
3
|
-
const initRes = await fetch(${JSON.stringify("https://notebooklm.google.com/upload/_/?authuser="+
|
|
3
|
+
const initRes = await fetch(${JSON.stringify("https://notebooklm.google.com/upload/_/?authuser="+u)}, {
|
|
4
4
|
method: 'POST',
|
|
5
5
|
credentials: 'include',
|
|
6
6
|
headers: {
|
|
7
7
|
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
|
8
8
|
'X-Goog-Upload-Command': 'start',
|
|
9
9
|
'X-Goog-Upload-Protocol': 'resumable',
|
|
10
|
-
'X-Goog-Upload-Header-Content-Length': ${JSON.stringify(String(
|
|
11
|
-
'X-Goog-AuthUser': ${JSON.stringify(
|
|
10
|
+
'X-Goog-Upload-Header-Content-Length': ${JSON.stringify(String(i))},
|
|
11
|
+
'X-Goog-AuthUser': ${JSON.stringify(u)},
|
|
12
12
|
},
|
|
13
|
-
body: ${JSON.stringify(
|
|
13
|
+
body: ${JSON.stringify(d)},
|
|
14
14
|
});
|
|
15
15
|
if (!initRes.ok) {
|
|
16
16
|
const status = initRes.headers.get('X-Goog-Upload-Status') || '';
|
|
@@ -20,7 +20,7 @@ import*as B from"node:fs";import*as L from"node:path";import{cli as U,Strategy a
|
|
|
20
20
|
const uploadURL = initRes.headers.get('X-Goog-Upload-Url') || initRes.headers.get('x-goog-upload-url');
|
|
21
21
|
if (!uploadURL) return { error: 'no X-Goog-Upload-URL header in init response' };
|
|
22
22
|
// Decode base64 to Uint8Array for binary PUT
|
|
23
|
-
const bin = atob(${JSON.stringify(
|
|
23
|
+
const bin = atob(${JSON.stringify(r)});
|
|
24
24
|
const bytes = new Uint8Array(bin.length);
|
|
25
25
|
for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
|
|
26
26
|
const uploadRes = await fetch(uploadURL, {
|
|
@@ -30,7 +30,7 @@ import*as B from"node:fs";import*as L from"node:path";import{cli as U,Strategy a
|
|
|
30
30
|
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
|
|
31
31
|
'X-Goog-Upload-Command': 'upload, finalize',
|
|
32
32
|
'X-Goog-Upload-Offset': '0',
|
|
33
|
-
'X-Goog-AuthUser': ${JSON.stringify(
|
|
33
|
+
'X-Goog-AuthUser': ${JSON.stringify(u)},
|
|
34
34
|
},
|
|
35
35
|
body: bytes,
|
|
36
36
|
});
|
|
@@ -43,4 +43,4 @@ import*as B from"node:fs";import*as L from"node:path";import{cli as U,Strategy a
|
|
|
43
43
|
} catch (e) {
|
|
44
44
|
return { error: 'upload exception: ' + ((e && e.message) || String(e)) };
|
|
45
45
|
}
|
|
46
|
-
})()`,
|
|
46
|
+
})()`,a=await t.evaluate(p),l=a&&typeof a==="object"&&"data"in a&&"session"in a?a.data:a;if(!l||l.error)throw new h("NotebookLM file upload failed: "+(l?.error||"unknown error"));return l}k({site:L,name:"add-source",access:"write",description:"Add a URL, text, or local file source to an existing NotebookLM notebook",domain:N,strategy:O.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"notebook",positional:!0,required:!0,help:"Notebook id from `notebooklm list` or full notebook URL"},{name:"url",help:"Source URL to add (http/https). Pass exactly one of --url, --content, --file."},{name:"content",fromFile:"content-file",help:"Raw text content to add as a Text source (max 10 MB)."},{name:"file",help:`Local file path to upload as a source (max ${b} bytes; pdf / txt / md / html / docx / etc.). Uses Google Drive's 3-step resumable upload protocol.`},{name:"title",help:'Title for the text source (default "Text Source"). Ignored for --url and --file.'},{name:"mime-type",help:"Override the auto-detected MIME type when --file is given."},{name:"execute",type:"boolean",help:"Actually add the remote source to the NotebookLM notebook"}],columns:["notebook_id","source_id","kind","identifier","notebook_url"],func:async(t,e)=>{const o=E(String(e.notebook??"")),n=parseSourceUrl(e.url),r=parseSourceText(e.content),i=typeof e.file==="string"&&e.file.trim()?e.file.trim():"",u=[n?"url":"",r!==null?"text":"",i?"file":""].filter(Boolean);if(u.length===0)throw new s("Pass exactly one of --url <url>, --content <text>, or --file <path>");if(u.length>1)throw new s("Pass exactly one of --url, --content, --file (got: "+u.join(" + ")+")");C(e.execute,"add a NotebookLM source");const d=parseSourceTitle(e.title,"Text Source");await T(t);await M(t);if(i){const c=readFileForUpload(i),U=inferMimeType(c.filename,e["mime-type"]),_=await g(t,v,buildRegisterFileSourceArgs(o,c.filename)),f=parseAddSourceResult(_.result,[o]);if(!f)throw new h("NotebookLM AddFileSource (o4cbdc) RPC returned no source id; cannot start file upload.");await F(t,o,f,c.filename,c.base64,c.size);await y(t,o,f,"add-source --file");return[{notebook_id:o,source_id:f,kind:"file",identifier:`${c.filename} (${U}, ${c.size} bytes)`,notebook_url:w(o)}]}const p=n?buildAddSourceFromUrlArgs(o,n):buildAddSourceFromTextArgs(o,d,r),a=await g(t,I,p),l=parseAddSourceResult(a.result,[o]);if(!l)throw new h("NotebookLM AddSources RPC returned no source id; verify the input reaches the NotebookLM backend.");await y(t,o,l,`add-source --${n?"url":"content"}`);return[{notebook_id:o,source_id:l,kind:n?"url":"text",identifier:n||d,notebook_url:w(o)}]}});export const __test__={parseSourceUrl,parseSourceText,parseSourceTitle,inferMimeType,buildAddSourceFromUrlArgs,buildAddSourceFromTextArgs,buildRegisterFileSourceArgs,readFileForUpload,parseAddSourceResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as m}from"@jackwener/opencli/registry";import{ArgumentError as n,CommandExecutionError as u}from"@jackwener/opencli/errors";import{NOTEBOOKLM_DOMAIN as f,NOTEBOOKLM_SITE as b}from"./shared.js";import{callNotebooklmRpc as p}from"./rpc.js";import{buildNotebooklmNotebookUrl as E,ensureNotebooklmHome as N,requireNotebooklmExecute as k,requireNotebooklmSession as O,verifyNotebooklmNotebookExists as h}from"./utils.js";const y="CCqFvf",a="\uD83D\uDCD2",s=200,_=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;export function parseCreateTitle(t){const e=String(t??"").trim();if(!e)throw new n("<title> is required");if(e.length>s)throw new n(`Title must be at most ${s} characters (got ${e.length})`);return e}export function parseCreateEmoji(t){const e=String(t??"").trim();if(!e)return a;return e}export function parseCreateProjectResult(t){let e=t;while(Array.isArray(e)&&e.length===1&&Array.isArray(e[0]))e=e[0];const o=Array.isArray(e)?typeof e[2]==="string"&&e[2]||typeof e[0]==="string"&&e[0]||"":"";return typeof o==="string"&&_.test(o)?o:""}l({site:b,name:"create",access:"write",description:"Create a new NotebookLM notebook with the given title",domain:f,strategy:m.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"title",positional:!0,required:!0,help:"Notebook title (1-200 chars)"},{name:"emoji",help:`Notebook emoji icon (default ${a})`},{name:"execute",type:"boolean",help:"Actually create the remote NotebookLM notebook"}],columns:["id","title","emoji","url"],func:async(t,e)=>{const o=parseCreateTitle(e.title),i=parseCreateEmoji(e.emoji);k(e.execute,"create a NotebookLM notebook");await N(t);await O(t);const c=await p(t,y,[o,i]),r=parseCreateProjectResult(c.result);if(!r)throw new u("NotebookLM CreateProject RPC returned no notebook id");await h(t,r,"create");return[{id:r,title:o,emoji:i,url:E(r)}]}});export const __test__={parseCreateTitle,parseCreateEmoji,parseCreateProjectResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as b}from"@jackwener/opencli/registry";import{ArgumentError as h,CommandExecutionError as a,EmptyResultError as k}from"@jackwener/opencli/errors";import{NOTEBOOKLM_DOMAIN as p,NOTEBOOKLM_SITE as _}from"./shared.js";import{callNotebooklmRpc as N}from"./rpc.js";import{buildNotebooklmNotebookUrl as c,listNotebooklmSourcesViaRpc as w,parseNotebooklmNotebookTarget as E,requireNotebooklmExecute as I,requireNotebooklmSession as L}from"./utils.js";const S="R7cb6c",d=[2,null,null,[1,null,null,null,null,null,null,null,null,null,[1]],[[1,4,2,3,6]]],g=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;function C(e){return new Set(e.map((o)=>String(o??"").toLowerCase()).filter(Boolean))}export function buildCreateSlidesArgs(e,o,t={}){const r=o.map((i)=>[[i]]),n=t.language||"en",s=Number.isInteger(t.length)?t.length:3;return[d,e,[null,null,8,r,null,null,null,null,null,null,null,null,null,null,null,null,[[null,n,1,s]]]]}export function parseSlidesIdFromResult(e,o=[]){const t=C(o);if(typeof e==="string"&&g.test(e)&&!t.has(e.toLowerCase()))return e;const r=[e];while(r.length){const n=r.shift();if(typeof n==="string"&&g.test(n)&&!t.has(n.toLowerCase()))return n;if(Array.isArray(n))for(const s of n)r.push(s);else if(n&&typeof n==="object")for(const s of Object.values(n))r.push(s)}return""}export function parseSlideDeckLength(e){if(e===void 0||e==="")return 3;const o=Number(e);if(!Number.isInteger(o)||o<=0)throw new h("--length must be a positive integer");return o}m({site:_,name:"generate-slides",access:"write",description:"Trigger a Slide Deck (AI presentation) generation for a NotebookLM notebook, using all of its sources",domain:p,strategy:b.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"notebook",positional:!0,required:!0,help:"Notebook id from `notebooklm list` or full notebook URL"},{name:"length",help:"Slide deck length: 1=Short, 3=Default (default 3)"},{name:"language",help:"Language code (default en)"},{name:"execute",type:"boolean",help:"Actually trigger remote NotebookLM slide deck generation"}],columns:["notebook_id","slides_id","source_count","status","notebook_url"],func:async(e,o)=>{const t=E(String(o.notebook??"")),r=parseSlideDeckLength(o.length),n=String(o.language??"en").trim()||"en";I(o.execute,"generate NotebookLM slides");try{await e.goto(c(t));await e.wait(2)}catch(l){throw new a(`Failed to open NotebookLM notebook ${t}: ${l?.message||l}`)}await L(e);const i=(await w(e)).map((l)=>l.id).filter((l)=>typeof l==="string"&&l);if(i.length===0)throw new k("notebooklm generate-slides","The notebook has no sources; add a source before generating a slide deck.");const f=await N(e,S,buildCreateSlidesArgs(t,i,{length:r,language:n})),u=parseSlidesIdFromResult(f.result,[t,...i]);if(!u)throw new a("NotebookLM CreateArtifact (slides) RPC returned no slide-deck id; the server may have rejected the request.");return[{notebook_id:t,slides_id:u,source_count:i.length,status:"pending",notebook_url:c(t)}]}});export const __test__={SLIDE_DECK_CONFIG_BLOCK:d,buildCreateSlidesArgs,parseSlideDeckLength,parseSlidesIdFromResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as l,Strategy as a}from"@jackwener/opencli/registry";import{EmptyResultError as i}from"@jackwener/opencli/errors";import{NOTEBOOKLM_DOMAIN as m,NOTEBOOKLM_SITE as c}from"./shared.js";import{findNotebooklmNoteRow as b,getNotebooklmPageState as u,listNotebooklmNotesFromPage as f,readNotebooklmVisibleNoteFromPage as d,requireNotebooklmSession as p}from"./utils.js";function N(t,e){const n=e.trim().toLowerCase();if(!n)return!1;const o=t.trim().toLowerCase();return o===n||o.includes(n)}l({site:c,name:"notes-get",access:"read",description:"Get one note from the current NotebookLM notebook by title from the visible note editor",domain:m,strategy:a.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"note",positional:!0,required:!0,help:"Note title or id from the current notebook"}],columns:["title","content","source","url"],func:async(t,e)=>{await p(t);if((await u(t)).kind!=="notebook")throw new i("ppcli notebooklm notes-get","No NotebookLM notebook is open in the adapter session. Run `ppcli notebooklm open <notebook>` first.");const o=typeof e.note==="string"?e.note:String(e.note??""),r=await d(t);if(r&&N(r.title,o))return[r];const s=await f(t);if(b(s,o))throw new i("ppcli notebooklm notes-get",`Note "${o}" is listed in Studio, but ppcli currently reads note content only from the visible note editor. Open that note in NotebookLM, then retry.`);throw new i("ppcli notebooklm notes-get",`Note "${o}" was not found in the current notebook.`)}});
|
package/clis/notebooklm/rpc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as f,CliError as c}from"@jackwener/opencli/errors";import{NOTEBOOKLM_DOMAIN as u}from"./shared.js";export function unwrapNotebooklmEvaluateResult(t){if(t&&typeof t==="object"&&!Array.isArray(t)&&"session"in t&&"data"in t)return t.data;return t}export function extractNotebooklmPageAuthFromHtml(t,e="/",s){const r=t.match(/"SNlM0e":"([^"]+)"/),a=t.match(/"FdrFJe":"([^"]+)"/),n=s?.csrfToken?.trim()||(r?r[1]:""),o=s?.sessionId?.trim()||(a?a[1]:"");if(!n||!o)throw new c("NOTEBOOKLM_TOKENS","NotebookLM page tokens were not found in the current page HTML","Open the NotebookLM notebook page in Chrome, wait for it to finish loading, then retry with --verbose if it still fails.");return{csrfToken:n,sessionId:o,sourcePath:e||"/",authuser:s?.authuser??""}}async function d(t){const e=unwrapNotebooklmEvaluateResult(await t.evaluate(`(() => {
|
|
2
2
|
const wiz = window.WIZ_global_data || {};
|
|
3
3
|
const html = document.documentElement.innerHTML;
|
|
4
4
|
const authMatch = (location.search || '').match(/[?&]authuser=(\\d+)/);
|
|
@@ -11,13 +11,13 @@ import{AuthRequiredError as $,CliError as W}from"@jackwener/opencli/errors";impo
|
|
|
11
11
|
sessionId: typeof wiz.FdrFJe === 'string' ? wiz.FdrFJe : '',
|
|
12
12
|
authuser: authMatch ? authMatch[1] : (pathMatch ? pathMatch[1] : ''),
|
|
13
13
|
};
|
|
14
|
-
})()`));return{html:String(
|
|
15
|
-
`),
|
|
14
|
+
})()`));return{html:String(e?.html??""),sourcePath:String(e?.sourcePath??"/"),readyState:String(e?.readyState??""),csrfToken:String(e?.csrfToken??""),sessionId:String(e?.sessionId??""),authuser:String(e?.authuser??"")}}export async function getNotebooklmPageAuth(t){let e;for(let s=0;s<2;s+=1){const r=await d(t);try{return extractNotebooklmPageAuthFromHtml(r.html,r.sourcePath,{csrfToken:r.csrfToken,sessionId:r.sessionId,authuser:r.authuser})}catch(a){e=a;if(s===0&&typeof t.wait==="function"){await t.wait(0.5).catch(()=>{return});continue}}}throw e}export function buildNotebooklmRpcBody(t,e,s){const r=[[[t,JSON.stringify(e),null,"generic"]]];return`f.req=${encodeURIComponent(JSON.stringify(r))}&at=${encodeURIComponent(s)}&`}export function stripNotebooklmAntiXssi(t){if(!t.startsWith(")]}'"))return t;return t.replace(/^\)\]\}'\r?\n/,"")}export function parseNotebooklmChunkedResponse(t){const e=stripNotebooklmAntiXssi(t).trim();if(!e)return[];const s=e.split(`
|
|
15
|
+
`),r=[];for(let a=0;a<s.length;a+=1){const n=s[a].trim();if(!n)continue;if(/^\d+$/.test(n)){const o=s[a+1];if(!o)continue;try{r.push(JSON.parse(o))}catch{}a+=1;continue}if(n.startsWith("["))try{r.push(JSON.parse(n))}catch{}}return r}export function extractNotebooklmRpcResult(t,e){const s=parseNotebooklmChunkedResponse(t);for(const r of s){if(!Array.isArray(r))continue;const a=Array.isArray(r[0])?r:[r];for(const n of a){if(!Array.isArray(n)||n.length<1)continue;if(n[0]==="er"){const o=typeof n[2]==="number"?n[2]:typeof n[5]==="number"?n[5]:null;if(o===401||o===403)throw new f(u,`NotebookLM RPC returned auth error (${o})`);throw new c("NOTEBOOKLM_RPC",`NotebookLM RPC failed${o?` (code=${o})`:""}`,"Retry from an already logged-in NotebookLM session, or inspect the raw response with debug logging.")}if(n[0]==="wrb.fr"&&n[1]===e){const o=n[2];if(typeof o==="string")try{return JSON.parse(o)}catch{return o}return o}}}return null}export async function fetchNotebooklmInPage(t,e,s={}){const r=s.method??"GET",a=s.headers??{},n=s.body??"",o=unwrapNotebooklmEvaluateResult(await t.evaluate(`(async () => {
|
|
16
16
|
const request = {
|
|
17
|
-
url: ${JSON.stringify(
|
|
18
|
-
method: ${JSON.stringify(
|
|
19
|
-
headers: ${JSON.stringify(
|
|
20
|
-
body: ${JSON.stringify(
|
|
17
|
+
url: ${JSON.stringify(e)},
|
|
18
|
+
method: ${JSON.stringify(r)},
|
|
19
|
+
headers: ${JSON.stringify(a)},
|
|
20
|
+
body: ${JSON.stringify(n)},
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const response = await fetch(request.url, {
|
|
@@ -33,4 +33,4 @@ import{AuthRequiredError as $,CliError as W}from"@jackwener/opencli/errors";impo
|
|
|
33
33
|
body: await response.text(),
|
|
34
34
|
finalUrl: response.url,
|
|
35
35
|
};
|
|
36
|
-
})()`));return{ok:Boolean(
|
|
36
|
+
})()`));return{ok:Boolean(o?.ok),status:Number(o?.status??0),body:String(o?.body??""),finalUrl:String(o?.finalUrl??e)}}export async function callNotebooklmRpc(t,e,s,r={}){const a=await getNotebooklmPageAuth(t),n=buildNotebooklmRpcBody(e,s,a.csrfToken),o=a.authuser||"",h=`https://${u}/_/LabsTailwindUi/data/batchexecute?rpcids=${e}&source-path=${encodeURIComponent(a.sourcePath)}`+(o?`&authuser=${encodeURIComponent(o)}`:"")+`&hl=${encodeURIComponent(r.hl??"en")}&f.sid=${encodeURIComponent(a.sessionId)}&rt=c`,i=await fetchNotebooklmInPage(t,h,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:n});if(i.status===401||i.status===403)throw new f(u,`NotebookLM RPC returned auth error (${i.status})`);if(!i.ok)throw new c("NOTEBOOKLM_RPC",`NotebookLM RPC request failed with HTTP ${i.status}`,"Retry from the NotebookLM home page in an already logged-in Chrome session.");return{auth:a,url:h,requestBody:n,response:i,result:extractNotebooklmRpcResult(i.body,e)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as s,Strategy as u}from"@jackwener/opencli/registry";import{EmptyResultError as t}from"@jackwener/opencli/errors";import{NOTEBOOKLM_DOMAIN as a,NOTEBOOKLM_SITE as f}from"./shared.js";import{findNotebooklmSourceRow as m,getNotebooklmPageState as b,getNotebooklmSourceFulltextViaRpc as p,listNotebooklmSourcesFromPage as k,listNotebooklmSourcesViaRpc as w,requireNotebooklmSession as h}from"./utils.js";s({site:f,name:"source-fulltext",access:"read",description:"Get the extracted fulltext for one source in the currently opened NotebookLM notebook",domain:a,strategy:u.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"source",positional:!0,required:!0,help:"Source id or title from the current notebook"}],columns:["title","kind","char_count","url","source"],func:async(o,e)=>{await h(o);if((await b(o)).kind!=="notebook")throw new t("ppcli notebooklm source-fulltext","No NotebookLM notebook is open in the adapter session. Run `ppcli notebooklm open <notebook>` first.");const n=await w(o).catch(()=>[]),l=n.length>0?n:await k(o);if(l.length===0)throw new t("ppcli notebooklm source-fulltext","No NotebookLM sources were found on the current page.");const c=typeof e.source==="string"?e.source:String(e.source??""),r=m(l,c);if(!r)throw new t("ppcli notebooklm source-fulltext",`Source "${c}" was not found in the current notebook.`);const i=await p(o,r.id).catch(()=>null);if(i)return[i];throw new t("ppcli notebooklm source-fulltext",`NotebookLM fulltext was not available for source "${r.title}".`)}});
|