publishport-opencli 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-manifest.json +35 -0
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +16 -16
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as r,Strategy as c}from"@jackwener/opencli/registry";r({site:"sinafinance",name:"stock-rank",access:"read",description:"新浪财经热搜榜",domain:"finance.sina.cn",strategy:c.COOKIE,navigateBefore:!1,args:[{name:"market",type:"string",default:"cn",choices:["cn","hk","us","wh","ft"],help:"Market: cn (A股), hk (港股), us (美股), wh (外汇), ft (期货)"}],columns:["rank","name","symbol","market","price","change","url"],func:async(e,n)=>{const a=n.market||"cn";await e.goto("https://finance.sina.cn/");await e.wait({selector:"#actionSearch",timeout:1e4});const t=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const wait = (ms) => new Promise(r => setTimeout(r, ms));
|
|
4
4
|
const cleanText = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as M,Strategy as P}from"@jackwener/opencli/registry";import{CliError as l}from"@jackwener/opencli/errors";const g="11",f="31",p="41";async function y(n){const t=await fetch(n,{headers:{Referer:"https://finance.sina.com.cn"}});if(!t.ok)throw new l("FETCH_ERROR",`Sina API HTTP ${t.status}`,"Check your network");const a=await t.arrayBuffer();return new TextDecoder("gbk").decode(a)}function R(n,t){const a=n.match(/suggestvalue="(.*)"/s);if(!a)return[];return a[1].split(";").filter(Boolean).map((i)=>{const r=i.split(",");return{name:r[4]||r[0]||"",market:r[1]||"",symbol:r[3]||""}}).filter((i)=>t.includes(i.market))}function S(n){if(n.market===f)return`hk${n.symbol}`;if(n.market===p)return`gb_${n.symbol}`;return n.symbol}function N(n,t){const a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=n.match(new RegExp(`hq_str_${a}="([^"]*)"`));return i?i[1].split(","):[]}function O(n){const t=parseFloat(n);if(!t)return"";if(t>=1000000000000)return(t/1000000000000).toFixed(2)+"T";if(t>=1e9)return(t/1e9).toFixed(2)+"B";if(t>=1e6)return(t/1e6).toFixed(2)+"M";return String(t)}M({site:"sinafinance",name:"stock",access:"read",description:"新浪财经行情(A股/港股/美股)",domain:"suggest3.sinajs.cn,hq.sinajs.cn",strategy:P.PUBLIC,browser:!1,args:[{name:"key",type:"string",required:!0,positional:!0,help:"Stock name or code (e.g. 贵州茅台, 腾讯控股, AAPL)"},{name:"market",type:"string",default:"auto",help:"Market: cn, hk, us, auto (default: auto searches cn → hk → us)"}],columns:["Symbol","Name","Price","Change","ChangePercent","Open","High","Low","Volume","MarketCap"],func:async(n)=>{const t=String(n.key),a=String(n.market),r={cn:[g],hk:[f],us:[p],auto:[g,f,p]}[a];if(!r)throw new l("INPUT_ERROR",`Invalid market: "${a}"`,"Expected cn, hk, us, or auto");const w=await y(`https://suggest3.sinajs.cn/suggest/type=${r.join(",")}&key=${encodeURIComponent(t)}`),k=R(w,r);if(!k.length)throw new l("NOT_FOUND",`No stock found for "${t}"`,"Try a different name, code, or --market");const u=t.toLowerCase(),d=(s)=>{const o=s.name.toLowerCase(),c=s.symbol.toLowerCase();if(c===u||o===u)return 1;if(c.includes(u))return u.length/c.length;if(o.includes(u))return u.length/o.length;return 0},m=k.sort((s,o)=>{const c=d(o)-d(s);return c!==0?c:r.indexOf(s.market)-r.indexOf(o.market)})[0],h=S(m),C=await y(`https://hq.sinajs.cn/list=${h}`),e=N(C,h);if(e.length<2||!e[0])throw new l("NOT_FOUND",`No quote data for "${t}"`,"Market may be closed or data unavailable");if(m.market===g){const s=parseFloat(e[3]),o=parseFloat(e[2]),c=(s-o).toFixed(2),b=((s-o)/o*100).toFixed(2)+"%";return[{Symbol:h.toUpperCase(),Name:e[0],Price:e[3],Change:c,ChangePercent:b,Open:e[1],High:e[4],Low:e[5],Volume:e[8],MarketCap:""}]}if(m.market===f)return[{Symbol:m.symbol,Name:e[1],Price:e[2],Change:e[7],ChangePercent:e[8]+"%",Open:e[6],High:e[4],Low:e[5],Volume:e[11],MarketCap:""}];return[{Symbol:m.symbol.toUpperCase(),Name:e[0],Price:e[1],Change:e[4],ChangePercent:e[2]+"%",Open:e[6],High:e[8],Low:e[9],Volume:e[10],MarketCap:O(e[12])}]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from"node:fs";import u from"node:path";import{cli as f,Strategy as p}from"@jackwener/opencli/registry";import{ArgumentError as w,CommandExecutionError as a}from"@jackwener/opencli/errors";import{buildFetchSnippet as g}from"./in-page.js";import{dispatchEvaluateResult as I}from"./errors.js";import{SLOCK_SITE as y,SLOCK_DOMAIN as v,SLOCK_HOME_URL as S}from"./shared.js";import{UUID_RE as U}from"./resolve.js";f({site:y,name:"attachment-download",access:"read",description:"Download an attachment to a local file. Resolves a signed CDN URL in the page, then fetches bytes node-side (no CORS).",domain:v,strategy:p.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"attachmentId",positional:!0,required:!0,help:"Attachment UUID"},{name:"out",help:"Local path to write to. Defaults to ./<attachmentId>.bin"},{name:"server",help:"Override active server slug"}],columns:["attachmentId","out","sizeBytes"],func:async(n,r)=>{const t=String(r.attachmentId??"").trim();if(!U.test(t))throw new w(`attachmentId "${t}" is not a UUID`);const s=u.resolve(String(r.out??`./${t}.bin`));await n.goto(S);const c=g({method:"GET",path:`/attachments/${encodeURIComponent(t)}/url`,serverScoped:!0,serverIdOverride:r.server}),d=await n.evaluate(`(async () => { ${c} })()`),o=I(d),i=(Array.isArray(o)?o[0]:o)?.url;if(!i)throw new a(`no signed url returned for attachment ${t}`);let e;try{e=await fetch(i)}catch(h){throw new a(`network error fetching signed URL: ${h.message}`)}if(!e.ok)throw new a(`HTTP ${e.status} from signed CDN URL while downloading ${t}`);const m=await e.arrayBuffer();l.writeFileSync(s,Buffer.from(m));return[{attachmentId:t,out:s,sizeBytes:m.byteLength}]}});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
${
|
|
3
|
-
${
|
|
1
|
+
import l from"node:fs";import c from"node:path";import{cli as w,Strategy as b}from"@jackwener/opencli/registry";import{ArgumentError as r}from"@jackwener/opencli/errors";import{authHeadersFragment as y,channelResolveFragment as v}from"./in-page.js";import{dispatchEvaluateResult as g}from"./errors.js";import{SLOCK_SITE as S,SLOCK_DOMAIN as I,SLOCK_HOME_URL as O,SLOCK_API_BASE as B}from"./shared.js";const d=52428800;w({site:S,name:"attachment-upload",access:"write",description:"Upload a local file to Slock attachments. Prints the attachmentId for use with `message-send --attach`.",domain:I,strategy:b.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"file",positional:!0,required:!0,help:"Local file path to upload (single file; max 50 MB)"},{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name — server requires the attachment be scoped to a channel"},{name:"server",help:"Override active server slug"}],columns:["attachmentId","filename","mimeType","sizeBytes"],func:async(n,s)=>{const i=String(s.file??"").trim();if(!i)throw new r("file path required");const o=String(s.channel??"").trim();if(!o)throw new r("channel required (UUID or #name); server rejects uploads without channelId");const t=c.resolve(i);let a;try{a=l.statSync(t)}catch(e){throw new r(`file not readable: ${t} (${e.message})`)}if(!a.isFile())throw new r(`not a regular file: ${t}`);if(a.size===0)throw new r(`file is empty: ${t}`);if(a.size>d)throw new r(`file is ${a.size} bytes, exceeds server limit ${d} (50 MiB). Split or compress before upload.`);const h=l.readFileSync(t),u=c.basename(t),m=h.toString("base64");await n.goto(O);const p=`
|
|
2
|
+
${y({serverScoped:!0,serverIdOverride:s.server})}
|
|
3
|
+
${v(o)}
|
|
4
4
|
// multipart wants the browser to set its own boundary — strip content-type.
|
|
5
5
|
const uploadHeaders = { authorization: headers.authorization, accept: headers.accept };
|
|
6
6
|
if (headers['x-server-id']) uploadHeaders['x-server-id'] = headers['x-server-id'];
|
|
7
7
|
// Rebuild File from base64 → Uint8Array → Blob → File. The base64 string
|
|
8
8
|
// is the only path across the page boundary; JSON.stringify it (caller did)
|
|
9
9
|
// so injection isn't possible.
|
|
10
|
-
const b64 = ${JSON.stringify(
|
|
10
|
+
const b64 = ${JSON.stringify(m)};
|
|
11
11
|
const bin = atob(b64);
|
|
12
12
|
const u8 = new Uint8Array(bin.length);
|
|
13
13
|
for (let i = 0; i < bin.length; i++) u8[i] = bin.charCodeAt(i);
|
|
14
14
|
const blob = new Blob([u8]);
|
|
15
|
-
const file = new File([blob], ${JSON.stringify(
|
|
15
|
+
const file = new File([blob], ${JSON.stringify(u)});
|
|
16
16
|
const fd = new FormData();
|
|
17
17
|
fd.append('files', file);
|
|
18
18
|
// qatester live-verified F4: server returns 400 "channelId is required"
|
|
19
19
|
// without this field. Must travel as a multipart text part.
|
|
20
20
|
fd.append('channelId', channelId);
|
|
21
|
-
const res = await fetch('${
|
|
21
|
+
const res = await fetch('${B}/attachments/upload', {
|
|
22
22
|
method: 'POST', credentials: 'include', headers: uploadHeaders, body: fd,
|
|
23
23
|
});
|
|
24
24
|
if (res.status === 401) return { kind: 'auth', detail: '/attachments/upload returned 401' };
|
|
@@ -31,4 +31,4 @@ import $ from"node:fs";import D from"node:path";import{cli as X,Strategy as Y}fr
|
|
|
31
31
|
const list = Array.isArray(data.attachments) ? data.attachments : [];
|
|
32
32
|
if (!list.length) return { kind: 'http', status: 200, where: '/attachments/upload (no attachments in response)' };
|
|
33
33
|
return { kind: 'ok', rows: list };
|
|
34
|
-
`,
|
|
34
|
+
`,f=await n.evaluate(`(async () => { ${p} })()`);return g(f).map((e)=>({attachmentId:e.id??e.attachmentId??null,filename:e.filename??e.name??null,mimeType:e.mimeType??e.contentType??null,sizeBytes:typeof e.sizeBytes==="number"?e.sizeBytes:e.size??null}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as i,Strategy as
|
|
1
|
+
import{cli as i,Strategy as m}from"@jackwener/opencli/registry";import{ArgumentError as c,CommandExecutionError as d}from"@jackwener/opencli/errors";import{buildFetchSnippet as u}from"./in-page.js";import{dispatchEvaluateResult as l}from"./errors.js";import{SLOCK_SITE as p,SLOCK_DOMAIN as h,SLOCK_HOME_URL as I}from"./shared.js";import{UUID_RE as f}from"./resolve.js";i({site:p,name:"attachment-url",access:"read",description:"Get a short-lived signed CDN URL for an attachment (does not download bytes).",domain:h,strategy:m.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"attachmentId",positional:!0,required:!0,help:"Attachment UUID"},{name:"server",help:"Override active server slug"}],columns:["attachmentId","url","expiresAt"],func:async(a,n)=>{const t=String(n.attachmentId??"").trim();if(!f.test(t))throw new c(`attachmentId "${t}" is not a UUID`);await a.goto(I);const o=u({method:"GET",path:`/attachments/${encodeURIComponent(t)}/url`,serverScoped:!0,serverIdOverride:n.server}),s=await a.evaluate(`(async () => { ${o} })()`),e=l(s),r=Array.isArray(e)?e[0]:e;if(!r?.url)throw new d(`no signed url returned for attachment ${t}`);return[{attachmentId:t,url:r?.url??null,expiresAt:r?.expiresAt??null}]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as n,CommandExecutionError as o}from"@jackwener/opencli/errors";import{buildFetchSnippet as a}from"./in-page.js";import{SLOCK_DOMAIN as m,SLOCK_HOME_URL as u}from"./shared.js";export async function verifySlockSession(r){await r.goto(u);const i=a({method:"GET",path:"/auth/me",serverScoped:!1}),e=await r.evaluate(`(async () => { ${i} })()`);if(e&&e.kind==="auth")throw new n(m,e.detail);if(!e||e.kind!=="ok")throw new o(`unexpected /auth/me result: ${JSON.stringify(e)}`);const t=e.rows??{};return{id:t.id??null,name:t.name??t.displayName??t.username??null,email:t.email??null}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as i,Strategy as d}from"@jackwener/opencli/registry";import{ArgumentError as n}from"@jackwener/opencli/errors";import{authHeadersFragment as m}from"./in-page.js";import{dispatchEvaluateResult as c}from"./errors.js";import{SLOCK_SITE as u,SLOCK_DOMAIN as h,SLOCK_HOME_URL as g,SLOCK_API_BASE as l}from"./shared.js";import{assertMessageIdShape as p}from"./resolve.js";i({site:u,name:"bookmark-add",access:"write",description:"Bookmark a message (POST /channels/saved). Requires full messageId UUID.",domain:h,strategy:d.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"messageId",positional:!0,required:!0,help:"Full messageId UUID (short ids rejected)"},{name:"server",help:"Override active server"}],columns:["messageId","saved"],func:async(r,t)=>{let e;try{e=p(String(t.messageId??""))}catch(s){throw new n(s.message)}await r.goto(g);const a=`
|
|
2
2
|
${m({serverScoped:!0,serverIdOverride:t.server})}
|
|
3
3
|
const res = await fetch('${l}/channels/saved', { method:'POST', credentials:'include', headers, body: JSON.stringify({ messageId: ${JSON.stringify(e)} }) });
|
|
4
4
|
if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/channels/saved' };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as n,Strategy as i}from"@jackwener/opencli/registry";import{ArgumentError as d}from"@jackwener/opencli/errors";import{authHeadersFragment as m}from"./in-page.js";import{dispatchEvaluateResult as u}from"./errors.js";import{SLOCK_SITE as c,SLOCK_DOMAIN as
|
|
1
|
+
import{cli as n,Strategy as i}from"@jackwener/opencli/registry";import{ArgumentError as d}from"@jackwener/opencli/errors";import{authHeadersFragment as m}from"./in-page.js";import{dispatchEvaluateResult as u}from"./errors.js";import{SLOCK_SITE as c,SLOCK_DOMAIN as p,SLOCK_HOME_URL as v,SLOCK_API_BASE as h}from"./shared.js";import{assertMessageIdShape as l}from"./resolve.js";n({site:c,name:"bookmark-remove",access:"write",description:"Remove a bookmark (DELETE /channels/saved/:messageId). 404 is treated as already-removed.",domain:p,strategy:i.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"messageId",positional:!0,required:!0,help:"Full messageId UUID"},{name:"server",help:"Override active server"}],columns:["messageId","removed","note"],func:async(t,s)=>{let e;try{e=l(String(s.messageId??""))}catch(o){throw new d(o.message)}await t.goto(v);const a=`
|
|
2
2
|
${m({serverScoped:!0,serverIdOverride:s.server})}
|
|
3
3
|
const res = await fetch('${h}/channels/saved/' + encodeURIComponent(${JSON.stringify(e)}), { method:'DELETE', credentials:'include', headers });
|
|
4
4
|
if (res.status === 404) return { kind: 'http', status: 404, where:'/channels/saved/:id' };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as u,Strategy as p}from"@jackwener/opencli/registry";import{ArgumentError as r}from"@jackwener/opencli/errors";import{buildChannelScopedSnippet as f}from"./in-page.js";import{dispatchEvaluateResult as v}from"./errors.js";import{SLOCK_SITE as S,SLOCK_DOMAIN as O,SLOCK_HOME_URL as I}from"./shared.js";export function makeChannelActionCommand({name:s,verb:o,resultLabel:c,description:h,archivedHint:l=!1}){u({site:S,name:s,access:"write",description:h,domain:O,strategy:p.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"server",help:"Override active server"}],columns:["channel","id","archivedAt","result"],func:async(a,i)=>{const t=String(i.channel??"").trim();if(!t)throw new r("channel required");await a.goto(I);const d=f({channelInput:t,method:"POST",pathSuffix:`/${o}`,serverIdOverride:i.server}),m=await a.evaluate(`(async () => { ${d} })()`);let n;try{n=v(m)}catch(e){if(l&&e instanceof r&&/no channel matches/.test(e.message))throw new r(`${e.message}. Archived channels are excluded from the name lookup; pass the channelId UUID instead (find it in the archived channel's URL in the Slock app).`);throw e}return[{channel:t,id:n?.id??"",archivedAt:n?.archivedAt??null,result:c}]}})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as p,Strategy as d}from"@jackwener/opencli/registry";import{ArgumentError as s}from"@jackwener/opencli/errors";import{buildFetchSnippet as l}from"./in-page.js";import{dispatchEvaluateResult as m}from"./errors.js";import{SLOCK_SITE as u,SLOCK_DOMAIN as h,SLOCK_HOME_URL as f}from"./shared.js";p({site:u,name:"channel-create",access:"write",description:"Create a channel — admin only (POST /channels/). Public unless --private.",domain:h,strategy:d.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"name",positional:!0,required:!0,help:"Channel name"},{name:"description",help:"Channel description / topic (≤500 chars)"},{name:"private",type:"bool",default:!1,help:"Create a private channel instead of public"},{name:"server",help:"Override active server"}],columns:["id","name","type","result"],func:async(r,e)=>{const n=String(e.name??"").trim();if(!n)throw new s("name required");const t=e.description!==void 0?String(e.description):void 0;if(t!==void 0&&t.length>500)throw new s("--description must be at most 500 characters");const a={name:n,visibility:e.private?"private":"public"};if(t!==void 0)a.description=t;await r.goto(f);const o=l({method:"POST",path:"/channels/",body:a,serverScoped:!0,serverIdOverride:e.server}),c=await r.evaluate(`(async () => { ${o} })()`),i=m(c);return[{id:i?.id??"",name:i?.name??n,type:i?.type??"",result:"created"}]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as o,Strategy as c}from"@jackwener/opencli/registry";import{ArgumentError as d,CommandExecutionError as p}from"@jackwener/opencli/errors";import{buildChannelScopedSnippet as u}from"./in-page.js";import{dispatchEvaluateResult as f}from"./errors.js";import{SLOCK_SITE as
|
|
1
|
+
import{cli as o,Strategy as c}from"@jackwener/opencli/registry";import{ArgumentError as d,CommandExecutionError as p}from"@jackwener/opencli/errors";import{buildChannelScopedSnippet as u}from"./in-page.js";import{dispatchEvaluateResult as f}from"./errors.js";import{SLOCK_SITE as y,SLOCK_DOMAIN as h,SLOCK_HOME_URL as I}from"./shared.js";import{parsePositiveInteger as v}from"./resolve.js";o({site:y,name:"channel-files",access:"read",description:"List files shared in a channel (GET /channels/:id/files)",domain:h,strategy:c.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"limit",type:"int",default:50,help:"Max files"},{name:"server",help:"Override active server"}],columns:["id","filename","mimeType","sizeBytes","messageId","createdAt"],func:async(a,t)=>{const n=String(t.channel??"").trim();if(!n)throw new d("channel required");const s=v(t.limit,"--limit",{defaultValue:50});await a.goto(I);const m=u({channelInput:n,method:"GET",pathSuffix:"/files",query:`?limit=${s}`,serverIdOverride:t.server}),l=await a.evaluate(`(async () => { ${m} })()`),i=f(l),r=Array.isArray(i)?i:i.files||[];if(!Array.isArray(r))throw new p(`expected files array, got ${typeof r} (contract drift?)`);return r.map((e)=>({id:e.id??"",filename:e.filename??"",mimeType:e.mimeType??"",sizeBytes:typeof e.sizeBytes==="number"?e.sizeBytes:null,messageId:e.messageId??"",createdAt:e.createdAt??""}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as a,Strategy as n}from"@jackwener/opencli/registry";import{CommandExecutionError as c}from"@jackwener/opencli/errors";import{buildFetchSnippet as m}from"./in-page.js";import{dispatchEvaluateResult as p}from"./errors.js";import{SLOCK_SITE as
|
|
1
|
+
import{cli as a,Strategy as n}from"@jackwener/opencli/registry";import{CommandExecutionError as c}from"@jackwener/opencli/errors";import{buildFetchSnippet as m}from"./in-page.js";import{dispatchEvaluateResult as p}from"./errors.js";import{SLOCK_SITE as d,SLOCK_DOMAIN as l,SLOCK_HOME_URL as u}from"./shared.js";a({site:d,name:"channel-list",access:"read",description:"List channels in the active slock server",domain:l,strategy:n.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"server",help:"Override active server (slug or id) for this call"}],columns:["id","name","topic"],func:async(t,s)=>{await t.goto(u);const o=m({method:"GET",path:"/channels/",serverScoped:!0,serverIdOverride:s.server}),i=await t.evaluate(`(async () => { ${o} })()`),r=p(i);if(!Array.isArray(r))throw new c(`expected array of rows from server, got ${typeof r} (contract drift?)`);return r.map((e)=>({id:e.id??"",name:e.name??e.slug??"",topic:e.topic??""}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as h}from"@jackwener/opencli/registry";import{ArgumentError as i}from"@jackwener/opencli/errors";import{buildChannelScopedSnippet as p}from"./in-page.js";import{dispatchEvaluateResult as f}from"./errors.js";import{SLOCK_SITE as q,SLOCK_DOMAIN as S,SLOCK_HOME_URL as v}from"./shared.js";m({site:q,name:"channel-mark",access:"write",description:"Mark a channel read (default), read up to --seq, or --unread.",domain:S,strategy:h.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"seq",type:"int",help:"Mark read up to this seq (omit for read-all)"},{name:"unread",type:"bool",default:!1,help:"Mark the channel unread instead of read"},{name:"server",help:"Override active server"}],columns:["channel","action","result"],func:async(s,e)=>{const o=String(e.channel??"").trim();if(!o)throw new i("channel required");const u=e.seq!==void 0&&e.seq!==null&&e.seq!=="";if(e.unread&&u)throw new i("--unread and --seq are mutually exclusive");let n,l,r;if(e.unread){n="/unread";r="unread"}else if(u){const a=Number(e.seq);if(!Number.isInteger(a)||a<=0)throw new i(`--seq must be a positive integer (got "${e.seq}")`);n="/read";l={seq:a};r=`read-to-${a}`}else{n="/read-all";r="read-all"}await s.goto(v);const d=p({channelInput:o,method:"POST",pathSuffix:n,body:l,serverIdOverride:e.server}),c=await s.evaluate(`(async () => { ${d} })()`),t=f(c);return[{channel:o,action:r,result:t?.seq!==void 0?`seq=${t.seq}`:t?.unreadCount!==void 0?`unreadCount=${t.unreadCount}`:"ok"}]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as m,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as d}from"@jackwener/opencli/errors";import{buildChannelScopedSnippet as c}from"./in-page.js";import{dispatchEvaluateResult as h}from"./errors.js";import{SLOCK_SITE as p,SLOCK_DOMAIN as y,SLOCK_HOME_URL as f}from"./shared.js";m({site:p,name:"channel-members",access:"read",description:"List members of a channel",domain:y,strategy:u.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"server",help:"Override active server (slug or id)"}],columns:["userId","name","kind","role"],func:async(s,t)=>{const i=String(t.channel??"").trim();if(!i)throw new d("channel required");await s.goto(f);const o=c({channelInput:i,method:"GET",pathSuffix:"/members",serverIdOverride:t.server}),l=await s.evaluate(`(async () => { ${o} })()`),r=h(l);let n=[],a=[];if(Array.isArray(r))a=r;else if(r){n=Array.isArray(r.agents)?r.agents:[];a=Array.isArray(r.humans)?r.humans:[];if(!n.length&&!a.length){const e=r.members||r.data||[];a=Array.isArray(e)?e:[]}}return[...a.map((e)=>({userId:e.userId??e.id??"",name:e.name??e.username??e.displayName??"",kind:"human",role:e.role??""})),...n.map((e)=>({userId:e.userId??e.id??"",name:e.name??e.username??e.displayName??"",kind:"agent",role:e.status??e.activity??""}))]}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeChannelActionCommand as
|
|
1
|
+
import{makeChannelActionCommand as e}from"./channel-action.js";e({name:"channel-unarchive",verb:"unarchive",resultLabel:"unarchived",description:"Unarchive a channel — admin only (POST /channels/:id/unarchive). "+"#name lookups exclude archived channels; pass the channelId UUID for archived ones.",archivedHint:!0});
|
package/clis/slock/dm-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as i,Strategy as o}from"@jackwener/opencli/registry";import{CommandExecutionError as d}from"@jackwener/opencli/errors";import{buildFetchSnippet as m}from"./in-page.js";import{dispatchEvaluateResult as p}from"./errors.js";import{SLOCK_SITE as c,SLOCK_DOMAIN as l,SLOCK_HOME_URL as h}from"./shared.js";i({site:c,name:"dm-list",access:"read",description:"List DM channels in the active server (GET /channels/dm)",domain:l,strategy:o.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"server",help:"Override active server (slug or id)"}],columns:["channelId","peerName","peerId","createdAt"],func:async(t,a)=>{await t.goto(h);const s=m({method:"GET",path:"/channels/dm",serverScoped:!0,serverIdOverride:a.server}),n=await t.evaluate(`(async () => { ${s} })()`),r=p(n);if(!Array.isArray(r))throw new d(`expected array of DM channels, got ${typeof r} (contract drift?)`);return r.map((e)=>({channelId:e.id??"",peerName:e.peerDisplayName??e.peerName??e.name??"",peerId:e.peerId??"",createdAt:e.createdAt??""}))}});
|
package/clis/slock/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as r,AuthRequiredError as o,CommandExecutionError as t,ConfigError as a}from"@jackwener/opencli/errors";import{SLOCK_DOMAIN as n}from"./shared.js";export function dispatchEvaluateResult(e){switch(e&&e.kind){case"ok":return e.rows;case"auth":throw new o(n,e.detail);case"http":throw new t(`HTTP ${e.status} from ${e.where}`);case"no-server":throw new a(e.detail,"Run `ppcli slock server-use <slug>` to set the active server.");case"unresolvable":throw new r(e.detail);case"no-thread":throw new t(`no-thread should be handled by caller, not dispatcher: ${e.parent}`);default:throw new t(`unexpected evaluate envelope: ${JSON.stringify(e)}`)}}
|
package/clis/slock/in-page.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{UUID_RE as
|
|
1
|
+
import{UUID_RE as o}from"./resolve.js";import{SLOCK_API_BASE as a}from"./shared.js";export function authHeadersFragment({serverScoped:e=!1,serverIdOverride:t=null}={}){const s=t?JSON.stringify(t):"null",r="^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",n=e?`
|
|
2
2
|
if (!sid) {
|
|
3
3
|
// Determine the slug to look up: override slug (if not a UUID) wins,
|
|
4
4
|
// otherwise fall back to the active slug from localStorage.
|
|
5
|
-
const __override = ${
|
|
5
|
+
const __override = ${s};
|
|
6
6
|
const __slug = __override ?? localStorage.getItem('slock_last_server_slug');
|
|
7
7
|
if (!__slug) return { kind: 'no-server', detail: 'no --server override and localStorage.slock_last_server_slug is empty; run \`slock server-use <slug>\` or pass --server <slug>' };
|
|
8
|
-
const sres = await fetch('${
|
|
8
|
+
const sres = await fetch('${a}/servers/', {
|
|
9
9
|
method: 'GET', credentials: 'include',
|
|
10
10
|
headers: { authorization: 'Bearer ' + token, accept: 'application/json' },
|
|
11
11
|
});
|
|
@@ -58,54 +58,54 @@ import{UUID_RE as T}from"./resolve.js";import{SLOCK_API_BASE as Q}from"./shared.
|
|
|
58
58
|
}
|
|
59
59
|
const token = localStorage.getItem('slock_access_token');
|
|
60
60
|
if (!token) return { kind: 'auth', detail: 'no access token in localStorage' };
|
|
61
|
-
let sid = ${!!
|
|
61
|
+
let sid = ${!!t&&new RegExp(r).test(String(t))?s:"null"};${n}
|
|
62
62
|
const headers = {
|
|
63
63
|
authorization: 'Bearer ' + token,
|
|
64
64
|
accept: 'application/json',
|
|
65
65
|
'content-type': 'application/json',
|
|
66
66
|
};
|
|
67
67
|
if (sid) headers['x-server-id'] = sid;
|
|
68
|
-
`}export function channelResolveFragment(
|
|
68
|
+
`}export function channelResolveFragment(e){const t=String(e??""),s=o.test(t),r=JSON.stringify(t),n=JSON.stringify(t.replace(/^#/,"").toLowerCase());return`
|
|
69
69
|
let channelId;
|
|
70
|
-
if (${
|
|
71
|
-
channelId = ${
|
|
70
|
+
if (${s}) {
|
|
71
|
+
channelId = ${r};
|
|
72
72
|
} else {
|
|
73
|
-
const cres = await fetch('${
|
|
73
|
+
const cres = await fetch('${a}/channels/', { credentials: 'include', headers });
|
|
74
74
|
if (cres.status === 401) return { kind: 'auth', detail: '/channels/ returned 401' };
|
|
75
75
|
if (!cres.ok) return { kind: 'http', status: cres.status, where: '/channels/' };
|
|
76
76
|
const carr = await cres.json();
|
|
77
77
|
const clist = Array.isArray(carr) ? carr : (carr.channels || carr.data || []);
|
|
78
|
-
const chit = clist.find((c) => (c.name || c.slug || '').toLowerCase() === ${
|
|
79
|
-
if (!chit) return { kind: 'unresolvable', detail: 'no channel matches ' + ${
|
|
78
|
+
const chit = clist.find((c) => (c.name || c.slug || '').toLowerCase() === ${n});
|
|
79
|
+
if (!chit) return { kind: 'unresolvable', detail: 'no channel matches ' + ${n} };
|
|
80
80
|
channelId = chit.id;
|
|
81
81
|
}
|
|
82
|
-
`}export function resolveShortIdFragment({shortIdVar:
|
|
83
|
-
if (!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(${
|
|
84
|
-
const cx = await fetch('${
|
|
82
|
+
`}export function resolveShortIdFragment({shortIdVar:e,parentChannelIdVar:t,contextDescription:s="''"}){return`
|
|
83
|
+
if (!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(${e})) {
|
|
84
|
+
const cx = await fetch('${a}/messages/context/' + encodeURIComponent(${e}) + '?channelId=' + encodeURIComponent(${t}), { credentials:'include', headers });
|
|
85
85
|
if (cx.status === 404) {
|
|
86
|
-
const __ctx = ${
|
|
87
|
-
return { kind: 'unresolvable', detail: 'short id "' + ${
|
|
86
|
+
const __ctx = ${s};
|
|
87
|
+
return { kind: 'unresolvable', detail: 'short id "' + ${e} + '" not found' + (__ctx ? ' in #' + __ctx : '') };
|
|
88
88
|
}
|
|
89
89
|
if (!cx.ok) return { kind: cx.status===401?'auth':'http', status: cx.status, where:'/messages/context' };
|
|
90
90
|
const cxd = await cx.json();
|
|
91
91
|
// CRITICAL — read targetMessageId, NOT m.message.id (Phase 7.1).
|
|
92
|
-
${
|
|
92
|
+
${e} = cxd.targetMessageId;
|
|
93
93
|
}
|
|
94
|
-
`}export function buildFetchSnippet(
|
|
95
|
-
${authHeadersFragment({serverScoped:
|
|
96
|
-
const res = await fetch(${
|
|
97
|
-
method: ${
|
|
98
|
-
body: ${
|
|
94
|
+
`}export function buildFetchSnippet(e){const t=JSON.stringify(e.method),s=JSON.stringify(a+e.path),r=e.body===void 0?"undefined":JSON.stringify(JSON.stringify(e.body));return`
|
|
95
|
+
${authHeadersFragment({serverScoped:e.serverScoped,serverIdOverride:e.serverIdOverride})}
|
|
96
|
+
const res = await fetch(${s}, {
|
|
97
|
+
method: ${t}, credentials: 'include', headers,
|
|
98
|
+
body: ${r},
|
|
99
99
|
});
|
|
100
|
-
if (res.status === 401) return { kind: 'auth', detail: ${
|
|
101
|
-
if (!res.ok) return { kind: 'http', status: res.status, where: ${
|
|
100
|
+
if (res.status === 401) return { kind: 'auth', detail: ${s} + ' returned 401' };
|
|
101
|
+
if (!res.ok) return { kind: 'http', status: res.status, where: ${s} };
|
|
102
102
|
const data = await res.json().catch(() => ({}));
|
|
103
103
|
return { kind: 'ok', rows: data };
|
|
104
|
-
`}export function buildChannelScopedSnippet(
|
|
105
|
-
${authHeadersFragment({serverScoped:!0,serverIdOverride:
|
|
106
|
-
${channelResolveFragment(
|
|
107
|
-
const __url = '${
|
|
108
|
-
const res = await fetch(__url, { method: ${
|
|
104
|
+
`}export function buildChannelScopedSnippet(e){const t=JSON.stringify(e.method),s=JSON.stringify(e.pathSuffix||""),r=e.query?JSON.stringify(e.query):"''",n=e.body===void 0?"undefined":JSON.stringify(JSON.stringify(e.body));return`
|
|
105
|
+
${authHeadersFragment({serverScoped:!0,serverIdOverride:e.serverIdOverride})}
|
|
106
|
+
${channelResolveFragment(e.channelInput)}
|
|
107
|
+
const __url = '${a}/channels/' + encodeURIComponent(channelId) + ${s} + ${r};
|
|
108
|
+
const res = await fetch(__url, { method: ${t}, credentials: 'include', headers, body: ${n} });
|
|
109
109
|
if (res.status === 401) return { kind: 'auth', detail: __url + ' returned 401' };
|
|
110
110
|
if (!res.ok) return { kind: 'http', status: res.status, where: __url };
|
|
111
111
|
const data = await res.json().catch(() => ({}));
|
package/clis/slock/inbox-done.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{cli as
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
const res = await fetch('${
|
|
1
|
+
import{cli as s,Strategy as o}from"@jackwener/opencli/registry";import{ArgumentError as i}from"@jackwener/opencli/errors";import{authHeadersFragment as c,channelResolveFragment as d}from"./in-page.js";import{dispatchEvaluateResult as l}from"./errors.js";import{SLOCK_SITE as h,SLOCK_DOMAIN as u,SLOCK_HOME_URL as m,SLOCK_API_BASE as p}from"./shared.js";s({site:h,name:"inbox-done",access:"write",description:"Mark one chat as done / clear it from the inbox (POST /channels/inbox/done)",domain:u,strategy:o.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:"channelId UUID or #name"},{name:"server",help:"Override active server"}],columns:["channel","result"],func:async(r,n)=>{const e=String(n.channel??"").trim();if(!e)throw new i("channel required");await r.goto(m);const t=`
|
|
2
|
+
${c({serverScoped:!0,serverIdOverride:n.server})}
|
|
3
|
+
${d(e)}
|
|
4
|
+
const res = await fetch('${p}/channels/inbox/done', { method:'POST', credentials:'include', headers, body: JSON.stringify({ channelId }) });
|
|
5
5
|
if (res.status === 401) return { kind: 'auth', detail: '/channels/inbox/done returned 401' };
|
|
6
6
|
if (!res.ok) return { kind: 'http', status: res.status, where:'/channels/inbox/done' };
|
|
7
7
|
const data = await res.json().catch(() => ({}));
|
|
8
8
|
return { kind: 'ok', rows: data };
|
|
9
|
-
`,
|
|
9
|
+
`,a=await r.evaluate(`(async () => { ${t} })()`);l(a);return[{channel:e,result:"done"}]}});
|
package/clis/slock/inbox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as d,Strategy as u}from"@jackwener/opencli/registry";import{ArgumentError as f,CommandExecutionError as c}from"@jackwener/opencli/errors";import{buildFetchSnippet as p}from"./in-page.js";import{dispatchEvaluateResult as h}from"./errors.js";import{SLOCK_SITE as v,SLOCK_DOMAIN as y,SLOCK_HOME_URL as A}from"./shared.js";import{parseNonNegativeInteger as C,parsePositiveInteger as w}from"./resolve.js";const i=["all","unread","mentions"];function M(e){if(e.kind==="thread")return{kind:"thread",id:e.threadChannelId??"",name:e.parentChannelName??"",unreadCount:typeof e.unreadCount==="number"?e.unreadCount:0,hasMention:!!e.hasMention,lastActivityAt:e.lastActivityAt??e.lastReplyAt??"",preview:e.latestActivityPreview??e.parentMessagePreview??""};return{kind:e.kind??"channel",id:e.channelId??"",name:e.channelName??"",unreadCount:typeof e.unreadCount==="number"?e.unreadCount:0,hasMention:!!e.hasMention,lastActivityAt:e.lastMessageAt??"",preview:e.lastMessagePreview??""}}d({site:v,name:"inbox",access:"read",description:"List unified inbox items (channels, DMs, followed threads) that need attention.",domain:y,strategy:u.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"filter",default:"all",help:"all | unread | mentions"},{name:"limit",type:"int",default:30,help:"Max items (server caps at 100)"},{name:"offset",type:"int",default:0,help:"Pagination offset"},{name:"server",help:"Override active server"}],columns:["kind","id","name","unreadCount","hasMention","lastActivityAt","preview"],func:async(e,t)=>{const n=String(t.filter??"all").toLowerCase();if(!i.includes(n))throw new f(`--filter must be one of ${i.join(" | ")} (got "${n}")`);const o=w(t.limit,"--limit",{defaultValue:30,max:100}),s=C(t.offset,"--offset",{defaultValue:0});await e.goto(A);const l=p({method:"GET",path:`/channels/inbox?filter=${encodeURIComponent(n)}&limit=${o}&offset=${s}`,serverScoped:!0,serverIdOverride:t.server}),m=await e.evaluate(`(async () => { ${l} })()`),a=h(m),r=Array.isArray(a)?a:a.items||[];if(!Array.isArray(r))throw new c(`expected inbox items array, got ${typeof r} (contract drift?)`);return r.map(M)}});
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import{cli as
|
|
2
|
-
${
|
|
1
|
+
import{cli as b,Strategy as q}from"@jackwener/opencli/registry";import{ArgumentError as h,CommandExecutionError as v}from"@jackwener/opencli/errors";import{authHeadersFragment as U,resolveShortIdFragment as O}from"./in-page.js";import{dispatchEvaluateResult as R}from"./errors.js";import{SLOCK_SITE as x,SLOCK_DOMAIN as D,SLOCK_HOME_URL as L,SLOCK_API_BASE as o}from"./shared.js";import{UUID_RE as m,classifyThreadTarget as M,parsePositiveInteger as p}from"./resolve.js";function N(e,t){const r=t&&typeof t==="object"?t[e.id??e.messageId]:void 0,a=t===null;return{id:e.id??e.messageId??"",seq:typeof e.seq==="number"?e.seq:null,createdAt:e.createdAt??e.created_at??"",senderName:e.sender?.name??e.user?.name??e.senderName??"",content:e.content??"",threadChannelId:a?null:r?.threadChannelId??null,replyCount:a?null:typeof r?.replyCount==="number"?r.replyCount:0,unreadCount:a?null:typeof r?.unreadCount==="number"?r.unreadCount:0,lastReplyAt:a?null:r?.lastReplyAt??null}}b({site:x,name:"message-read",access:"read",description:'Read messages in a channel or thread. Thread form: "#channel:msgIdOrShort". Use --after seq|UUID for cursor.',domain:D,strategy:q.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"channel",positional:!0,required:!0,help:'channelId UUID, "#name", or "#channel:msgIdOrShort"'},{name:"after",help:"Cursor: seq number or messageId UUID (exclusive)"},{name:"before",help:"seq to page before"},{name:"limit",type:"int",default:50,help:"Max messages"},{name:"no-threads",type:"bool",default:!1,help:"Skip /threads enrichment"},{name:"server",help:"Override active server"}],columns:["id","seq","createdAt","senderName","content","threadChannelId","replyCount","unreadCount","lastReplyAt"],func:async(e,t)=>{const r=String(t.channel??"").trim();if(!r)throw new h("channel required");const a=M(r),i=m.test(r),n=t.after!==void 0?String(t.after):"";if(n&&!/^\d+$/.test(n)&&!m.test(n))throw new h(`--after must be a seq number or messageId UUID (got "${n}")`);const c=p(t.limit,"--limit",{defaultValue:50}),s=t.before!==void 0?String(t.before):"";if(s&&!/^\d+$/.test(s))throw new h(`--before must be a seq number (got "${s}")`);if(s)p(s,"--before");const g=!!t["no-threads"],I=t.server??null;await e.goto(L);const y={isUuid:i,channel:r,after:n,before:s,limit:c,noThreads:g,override:I,parentTarget:a?.parentTarget??"",parentMsgId:a?.parentMsgId??"",isThread:!!a},C=T(y),d=await e.evaluate(`(async () => { ${C} })()`);if(d?.kind==="no-thread")return[{id:"",seq:null,createdAt:"",senderName:"",content:`(${d.parent} — no thread yet, 0 replies.)`,threadChannelId:null,replyCount:0,unreadCount:0,lastReplyAt:null}];const l=R(d);if(!Array.isArray(l))throw new v(`expected array of rows from server, got ${typeof l} (contract drift?)`);const S=d.meta?.threadsMap??{},u=d.meta?.threadsDegraded===!0,w=u?null:S,f=l.map((A)=>N(A,w));if(u)f.unshift({id:"",seq:null,createdAt:"",senderName:"",content:"(threads-enrichment unavailable — replyCount/threadChannelId set to null. Retry to get reply counts.)",threadChannelId:null,replyCount:null,unreadCount:null,lastReplyAt:null});return f}});function T(e){const t=JSON.stringify(e.channel.replace(/^#/,"").toLowerCase()),r=JSON.stringify(e.parentTarget.replace(/^#/,"").toLowerCase()),a=JSON.stringify(e.parentMsgId),i=JSON.stringify(e.after),n=JSON.stringify(e.before),c=JSON.stringify(e.limit);return`
|
|
2
|
+
${U({serverScoped:!0,serverIdOverride:e.override})}
|
|
3
3
|
let channelId;
|
|
4
|
-
${
|
|
4
|
+
${e.isThread?`
|
|
5
5
|
// thread shape: resolve parent channel, then short-id → full, then /threads/:msgId
|
|
6
|
-
const cres = await fetch('${
|
|
6
|
+
const cres = await fetch('${o}/channels/', { credentials:'include', headers });
|
|
7
7
|
if (!cres.ok) return { kind: cres.status===401?'auth':'http', status: cres.status, where:'/channels/' };
|
|
8
8
|
const carr = await cres.json();
|
|
9
9
|
const carrL = Array.isArray(carr) ? carr : (carr.channels || carr.data || []);
|
|
10
|
-
const phit = carrL.find((c) => (c.name||c.slug||'').toLowerCase() === ${
|
|
11
|
-
if (!phit) return { kind: 'unresolvable', detail: 'parent channel not found: ' + ${
|
|
10
|
+
const phit = carrL.find((c) => (c.name||c.slug||'').toLowerCase() === ${r});
|
|
11
|
+
if (!phit) return { kind: 'unresolvable', detail: 'parent channel not found: ' + ${r} };
|
|
12
12
|
const parentChannelId = phit.id;
|
|
13
|
-
let fullMsgId = ${
|
|
14
|
-
${
|
|
15
|
-
const tres = await fetch('${
|
|
16
|
-
if (tres.status === 404) return { kind: 'no-thread', parent: ${JSON.stringify(
|
|
13
|
+
let fullMsgId = ${a};
|
|
14
|
+
${O({shortIdVar:"fullMsgId",parentChannelIdVar:"parentChannelId",contextDescription:r})}
|
|
15
|
+
const tres = await fetch('${o}/channels/' + encodeURIComponent(parentChannelId) + '/threads/' + encodeURIComponent(fullMsgId), { credentials:'include', headers });
|
|
16
|
+
if (tres.status === 404) return { kind: 'no-thread', parent: ${JSON.stringify(e.channel)} };
|
|
17
17
|
if (!tres.ok) return { kind: tres.status===401?'auth':'http', status: tres.status, where:'/threads/:msgId' };
|
|
18
18
|
const tinfo = await tres.json();
|
|
19
19
|
channelId = tinfo.threadChannelId || tinfo.channelId || tinfo.id;
|
|
20
20
|
`:`
|
|
21
|
-
if (${
|
|
22
|
-
channelId = ${JSON.stringify(
|
|
21
|
+
if (${e.isUuid}) {
|
|
22
|
+
channelId = ${JSON.stringify(e.channel)};
|
|
23
23
|
} else {
|
|
24
|
-
const cres = await fetch('${
|
|
24
|
+
const cres = await fetch('${o}/channels/', { credentials:'include', headers });
|
|
25
25
|
if (!cres.ok) return { kind: cres.status===401?'auth':'http', status: cres.status, where:'/channels/' };
|
|
26
26
|
const arr = await cres.json();
|
|
27
27
|
const arrL = Array.isArray(arr) ? arr : (arr.channels || arr.data || []);
|
|
28
|
-
const hit = arrL.find((c) => (c.name||c.slug||'').toLowerCase() === ${
|
|
29
|
-
if (!hit) return { kind: 'unresolvable', detail: 'no channel matches ' + ${
|
|
28
|
+
const hit = arrL.find((c) => (c.name||c.slug||'').toLowerCase() === ${t});
|
|
29
|
+
if (!hit) return { kind: 'unresolvable', detail: 'no channel matches ' + ${t} };
|
|
30
30
|
channelId = hit.id;
|
|
31
31
|
}
|
|
32
32
|
`}
|
|
33
|
-
let afterSeq = ${
|
|
33
|
+
let afterSeq = ${i};
|
|
34
34
|
if (afterSeq && /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(afterSeq)) {
|
|
35
|
-
const cx = await fetch('${
|
|
35
|
+
const cx = await fetch('${o}/messages/context/' + encodeURIComponent(afterSeq), { credentials:'include', headers });
|
|
36
36
|
if (!cx.ok) return { kind: cx.status===401?'auth':'http', status: cx.status, where:'/messages/context (--after)' };
|
|
37
37
|
const cxd = await cx.json();
|
|
38
38
|
const anchor = (cxd.messages || []).find((m) => (m.id||m.messageId) === cxd.targetMessageId);
|
|
@@ -40,17 +40,17 @@ import{cli as C,Strategy as L}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
40
40
|
}
|
|
41
41
|
const qs = new URLSearchParams();
|
|
42
42
|
if (afterSeq) qs.set('after', afterSeq);
|
|
43
|
-
if (${
|
|
44
|
-
qs.set('limit', ${
|
|
45
|
-
const mres = await fetch('${
|
|
43
|
+
if (${n}) qs.set('before', ${n});
|
|
44
|
+
qs.set('limit', ${c});
|
|
45
|
+
const mres = await fetch('${o}/messages/channel/' + encodeURIComponent(channelId) + '?' + qs.toString(), { credentials:'include', headers });
|
|
46
46
|
if (!mres.ok) return { kind: mres.status===401?'auth':'http', status: mres.status, where: '/messages/channel/:id' };
|
|
47
47
|
const mdata = await mres.json();
|
|
48
48
|
const messages = Array.isArray(mdata) ? mdata : (mdata.messages || mdata.data || []);
|
|
49
49
|
let threadsMap = {};
|
|
50
50
|
let threadsDegraded = false;
|
|
51
|
-
${
|
|
51
|
+
${e.noThreads?"":`
|
|
52
52
|
try {
|
|
53
|
-
const thres = await fetch('${
|
|
53
|
+
const thres = await fetch('${o}/channels/' + encodeURIComponent(channelId) + '/threads', { credentials:'include', headers });
|
|
54
54
|
if (thres.ok) {
|
|
55
55
|
const tmap = await thres.json();
|
|
56
56
|
if (tmap && typeof tmap === 'object' && !Array.isArray(tmap)) threadsMap = tmap;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{cli as
|
|
2
|
-
${
|
|
1
|
+
import{cli as m,Strategy as f}from"@jackwener/opencli/registry";import{ArgumentError as p,CommandExecutionError as y}from"@jackwener/opencli/errors";import{authHeadersFragment as g}from"./in-page.js";import{dispatchEvaluateResult as I}from"./errors.js";import{SLOCK_SITE as S,SLOCK_DOMAIN as w,SLOCK_HOME_URL as O,SLOCK_API_BASE as i}from"./shared.js";import{UUID_RE as v,parsePositiveInteger as A}from"./resolve.js";m({site:S,name:"message-search",access:"read",description:"Search messages",domain:w,strategy:f.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"query",positional:!0,required:!0,help:"Search query"},{name:"channel",help:"Restrict to a channel (UUID or #name)"},{name:"limit",type:"int",default:50,help:"Max results"},{name:"server",help:"Override active server"}],columns:["id","channelId","createdAt","senderName","content"],func:async(s,t)=>{const n=String(t.query??"").trim();if(!n)throw new p("query required");const r=String(t.channel??"").trim(),c=r?v.test(r):!1,o=r?JSON.stringify(r.replace(/^#/,"").toLowerCase()):'""',d=t.server??null,l=A(t.limit,"--limit",{defaultValue:50});await s.goto(O);const h=`
|
|
2
|
+
${g({serverScoped:!0,serverIdOverride:d})}
|
|
3
3
|
let channelId = '';
|
|
4
|
-
if (${JSON.stringify(
|
|
5
|
-
if (${
|
|
6
|
-
channelId = ${JSON.stringify(
|
|
4
|
+
if (${JSON.stringify(r)}) {
|
|
5
|
+
if (${c}) {
|
|
6
|
+
channelId = ${JSON.stringify(r)};
|
|
7
7
|
} else {
|
|
8
|
-
const cres = await fetch('${
|
|
8
|
+
const cres = await fetch('${i}/channels/', { credentials:'include', headers });
|
|
9
9
|
if (!cres.ok) return { kind: cres.status===401?'auth':'http', status: cres.status, where:'/channels/' };
|
|
10
10
|
const arr = await cres.json();
|
|
11
|
-
const hit = (Array.isArray(arr)?arr:(arr.channels||arr.data||[])).find((c) => (c.name||c.slug||'').toLowerCase() === ${
|
|
12
|
-
if (!hit) return { kind: 'unresolvable', detail: 'no channel matches ' + ${JSON.stringify(
|
|
11
|
+
const hit = (Array.isArray(arr)?arr:(arr.channels||arr.data||[])).find((c) => (c.name||c.slug||'').toLowerCase() === ${o});
|
|
12
|
+
if (!hit) return { kind: 'unresolvable', detail: 'no channel matches ' + ${JSON.stringify(r)} };
|
|
13
13
|
channelId = hit.id;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
const searchUrl = '${
|
|
16
|
+
const searchUrl = '${i}/messages/search?q=' + encodeURIComponent(${JSON.stringify(n)}) + (channelId ? '&channelId=' + encodeURIComponent(channelId) : '') + '&limit=' + encodeURIComponent(${JSON.stringify(l)});
|
|
17
17
|
const res = await fetch(searchUrl, { credentials:'include', headers });
|
|
18
18
|
if (!res.ok) return { kind: res.status===401?'auth':'http', status: res.status, where:'/messages/search' };
|
|
19
19
|
const data = await res.json();
|
|
@@ -21,4 +21,4 @@ import{cli as N,Strategy as T}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
21
21
|
// Unwrap .results first; fall back to legacy .messages / .data /
|
|
22
22
|
// bare array for forward-compat.
|
|
23
23
|
return { kind: 'ok', rows: Array.isArray(data) ? data : (data.results || data.messages || data.data || []) };
|
|
24
|
-
`,
|
|
24
|
+
`,u=await s.evaluate(`(async () => { ${h} })()`),a=I(u);if(!Array.isArray(a))throw new y(`expected array of rows from server, got ${typeof a} (contract drift?)`);return a.map((e)=>({id:e.id??e.messageId??"",channelId:e.channelId??"",createdAt:e.createdAt??e.created_at??"",senderName:e.sender?.name??e.user?.name??"",content:e.content??""}))}});
|