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/dist/src/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
if(process.platform!=="win32"){const
|
|
3
|
-
`));process.exit(
|
|
4
|
-
`);process.exit(
|
|
5
|
-
`);process.exit(
|
|
2
|
+
if(process.platform!=="win32"){const s=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin"],r=new Set((process.env.PATH??"").split(":").filter(Boolean));for(const e of s)r.add(e);process.env.PATH=[...r].join(":")}import*as m from"node:fs";import*as h from"node:os";import*as l from"node:path";import{fileURLToPath as w}from"node:url";import{getCompletionsFromManifest as C,hasAllManifests as v,printCompletionScriptFast as _}from"./completion-fast.js";import{findPackageRoot as E,getCliManifestPath as f}from"./package-paths.js";import{PKG_VERSION as O}from"./version.js";import{EXIT_CODES as i}from"./errors.js";import{isSupportedNodeVersion as P,MIN_SUPPORTED_NODE_MAJOR as R}from"./runtime-detect.js";import{unsupportedDaemonPortEnvMessage as N}from"./constants.js";const g=w(import.meta.url),q=l.dirname(g),a=l.join(E(g),"clis"),d=l.join(h.homedir(),".ppcli","clis"),c=process.argv.slice(2);if(typeof globalThis.Bun>"u"&&!P(process.version)){process.stderr.write([`ppcli requires Node.js >= ${R}.0.0.`,`Current runtime: ${process.version}`,"Upgrade Node.js, then retry the same command.",""].join(`
|
|
3
|
+
`));process.exit(i.CONFIG_ERROR)}if(process.env.OPENCLI_DAEMON_PORT){process.stderr.write(`error: ${N(process.env.OPENCLI_DAEMON_PORT)}
|
|
4
|
+
`);process.exit(i.CONFIG_ERROR)}if(c[0]==="--version"||c[0]==="-V"){process.stdout.write(O+`
|
|
5
|
+
`);process.exit(i.SUCCESS)}if(c[0]==="completion"&&c.length>=2){if(_(c[1]))process.exit(i.SUCCESS)}const p=process.argv.indexOf("--get-completions");if(p!==-1){const s=[f(a)],r=f(d);try{m.accessSync(r);s.push(r)}catch{}if(v(s)){const e=process.argv.slice(p+1);let n;const t=[];for(let o=0;o<e.length;o++)if(e[o]==="--cursor"&&o+1<e.length){n=parseInt(e[o+1],10);o++}else t.push(e[o]);if(n===void 0)n=t.length;const S=C(t,n,s);process.stdout.write(S.join(`
|
|
6
6
|
`)+`
|
|
7
|
-
`);process.exit(
|
|
7
|
+
`);process.exit(i.SUCCESS)}}const{discoverClis:u,discoverPlugins:I,ensureUserCliCompatShims:U,ensureUserAdapters:y}=await import("./discovery.js"),{getCompletions:A}=await import("./completion.js"),{runCli:x}=await import("./cli.js"),{emitHook:M}=await import("./hooks.js"),{installNodeNetwork:T}=await import("./node-network.js");T();const j=c[0]==="convention-audit";if(j)await u(a);else{const[,,]=await Promise.all([U(),y(),u(a)]);await u(d);await I()}if(p!==-1){const s=process.argv.slice(p+1);let r;const e=[];for(let t=0;t<s.length;t++)if(s[t]==="--cursor"&&t+1<s.length){r=parseInt(s[t+1],10);t++}else e.push(s[t]);if(r===void 0)r=e.length;const n=A(e,r);process.stdout.write(n.join(`
|
|
8
8
|
`)+`
|
|
9
|
-
`);process.exit(
|
|
10
|
-
`);process.exit(
|
|
9
|
+
`);process.exit(i.SUCCESS)}const{rewriteBrowserArgv:D,BrowserSessionArgvError:b,escapeLeadingDashPositional:L}=await import("./cli-argv-preprocess.js");try{let s=D(process.argv.slice(2));try{const r=f(a);if(m.existsSync(r)){const e=JSON.parse(m.readFileSync(r,"utf-8"));if(Array.isArray(e))s=L(s,e)}}catch{}process.argv.splice(2,process.argv.length-2,...s)}catch(s){if(s instanceof b){process.stderr.write(`error: ${s.message}
|
|
10
|
+
`);process.exit(i.GENERIC_ERROR)}throw s}await M("onStartup",{command:"__startup__",args:{}});x(a,d);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import*as c from"node:fs";import*as
|
|
1
|
+
import*as c from"node:fs";import*as V from"node:os";import*as s from"node:path";import{redactValue as p}from"./redaction.js";import{pruneTraceArtifacts as J,traceExpiresAt as b}from"./retention.js";import{CliError as k,getErrorMessage as T}from"../errors.js";import{log as C}from"../logger.js";import{PKG_VERSION as F}from"../version.js";function L(){return process.env.OPENCLI_CONFIG_DIR||s.join(V.homedir(),".ppcli")}function D(e){return(e||"default").replace(/[^a-zA-Z0-9_-]+/g,"_")||"default"}export function getTraceDirectory(e,n,t=L()){return s.join(t,"profiles",D(e),"traces",D(n))}export function exportObservationSession(e,n={}){const t=getTraceDirectory(e.scope.contextId,e.id,n.baseDir),r=n.status??(n.error===void 0?"success":"failure"),o=new Date().toISOString();c.mkdirSync(t,{recursive:!0});c.mkdirSync(s.join(t,"screenshots"),{recursive:!0});c.mkdirSync(s.join(t,"state"),{recursive:!0});const l=e.events(),h=l.map((f)=>_(f)),S=[],g=[],y=[];let i=0,d=0;for(let f=0;f<h.length;f++){const P=l[f],m=h[f],u={...m};if(m.stream==="screenshot"&&P.stream==="screenshot"&&typeof P.data==="string"){const w=m.format==="jpeg"?"jpg":"png",N=`screenshots/${String(++i).padStart(4,"0")}.${w}`;c.writeFileSync(s.join(t,N),P.data,"base64");u.path=N;delete u.data}if(m.stream==="state"&&u.snapshot!==void 0){const w=`state/${String(++d).padStart(4,"0")}.json`;c.writeFileSync(s.join(t,w),JSON.stringify(u.snapshot,null,2),"utf-8");u.snapshotPath=w;delete u.snapshot}const E=JSON.stringify(u);S.push(E);if(m.stream==="network")g.push(E);if(m.stream==="console")y.push(E)}c.writeFileSync(s.join(t,"trace.jsonl"),S.join(`
|
|
2
2
|
`)+(S.length?`
|
|
3
3
|
`:""),"utf-8");c.writeFileSync(s.join(t,"network.jsonl"),g.join(`
|
|
4
4
|
`)+(g.length?`
|
|
5
|
-
`:""),"utf-8");c.writeFileSync(s.join(t,"console.jsonl")
|
|
6
|
-
`)+(
|
|
7
|
-
`:""),"utf-8");const
|
|
8
|
-
`)}function
|
|
5
|
+
`:""),"utf-8");c.writeFileSync(s.join(t,"console.jsonl"),y.join(`
|
|
6
|
+
`)+(y.length?`
|
|
7
|
+
`:""),"utf-8");const x=s.join(t,"summary.md");c.writeFileSync(x,v(e,h,{error:n.error,status:r,dir:t,createdAt:o,retentionPolicy:n.retentionPolicy}),"utf-8");const O=s.join(t,"receipt.json"),A={traceId:e.id,dir:t,summaryPath:x,receiptPath:O},I=buildTraceReceipt(A,r,n.error,{createdAt:o,scope:e.scope,retentionPolicy:n.retentionPolicy});c.writeFileSync(O,JSON.stringify(I,null,2),"utf-8");z(s.dirname(t),t,n.retentionPolicy);return{...A,receipt:I}}function _(e){return p(e)}export function buildTraceReceipt(e,n,t,r={}){const o=t instanceof k?t:void 0,l=r.createdAt??new Date().toISOString();return{schemaVersion:1,opencliVersion:F,traceId:e.traceId,traceDir:e.dir,summaryPath:e.summaryPath,receiptPath:e.receiptPath,status:n,createdAt:l,expiresAt:b(l,r.retentionPolicy),...r.scope?{scope:r.scope}:{},...t===void 0?{}:{error:{...t instanceof Error?{name:t.name}:{},...o?{code:o.code,hint:o.hint,exitCode:o.exitCode}:{},message:String(p(T(t)))}}}}function z(e,n,t){try{J(e,{policy:t,protectedTraceDirs:[n],warn:(r)=>C.warn(`[trace] ${r}`)})}catch(r){C.warn(`[trace] Failed to prune trace artifacts: ${r instanceof Error?r.message:String(r)}`)}}function v(e,n,t){const r=n.reduce((i,d)=>{i[d.stream]=(i[d.stream]??0)+1;return i},{}),o=G(t.error),l=n.filter((i)=>i.stream==="error").slice(-20).reverse(),h=n.filter((i)=>i.stream==="network").filter((i)=>i.status===void 0||i.status===0||i.status>=400).slice(-20).reverse(),S=n.filter((i)=>i.stream==="console").filter((i)=>/^(error|warning|warn|assert)$/i.test(i.level)).slice(-20).reverse(),g=n.filter((i)=>i.stream==="action").slice(-30);return["---","schemaVersion: 1",`opencliVersion: ${a(F)}`,`traceId: ${a(e.id)}`,`status: ${t.status}`,`contextId: ${a(e.scope.contextId??"default")}`,`session: ${a(e.scope.session)}`,...e.scope.target?[`target: ${a(e.scope.target)}`]:[],...e.scope.site?[`site: ${a(e.scope.site)}`]:[],...e.scope.command?[`command: ${a(e.scope.command)}`]:[],...e.scope.adapterSourcePath?[`adapterSourcePath: ${a(e.scope.adapterSourcePath)}`]:[],...e.scope.adapterSourcePath?[`adapterSourcePathExists: ${c.existsSync(e.scope.adapterSourcePath)}`]:[],`traceDir: ${a(t.dir)}`,`startedAt: ${a(new Date(e.startedAt).toISOString())}`,`exportedAt: ${a(t.createdAt)}`,`expiresAt: ${a(b(t.createdAt,t.retentionPolicy))}`,...o?[`errorCode: ${a(o.code??"UNKNOWN")}`,`errorMessage: ${a(o.message)}`]:[],"---","","# ppcli Trace Summary","","## How To Use","","- Start with this summary, then inspect `trace.jsonl` only when the evidence below is insufficient.","- For adapter repair policy and retry limits, use the `opencli-autofix` skill.","- `adapterSourcePathExists: false` means the path is a best-effort hint, not a confirmed editable file.","","## Error","",...K(o,l),"","## Failed Network","",...U(h),"","## Suspicious Console","",...B(S),"","## Action Timeline","",...M(g),"","## Event Counts","",...Object.entries(r).map(([i,d])=>`- ${i}: ${d}`),"","## Artifact Files","","- `trace.jsonl`: full redacted event timeline","- `network.jsonl`: redacted network events","- `console.jsonl`: redacted console events","- `state/`: final state snapshots when available","- `screenshots/`: final screenshots when available",""].join(`
|
|
8
|
+
`)}function G(e){if(e===void 0)return;if(e instanceof k)return{code:e.code,message:String(p(e.message)),...e.hint?{hint:String(p(e.hint))}:{}};return{message:String(p(T(e)))}}function a(e){return JSON.stringify(e)}function K(e,n){const t=[];if(e){t.push(`- ${e.code??"UNKNOWN"}: ${e.message}`);if(e.hint)t.push(`- hint: ${e.hint}`)}for(const r of n){if(r.stream!=="error")continue;t.push(`- ${j(r.ts)} ${r.code??"ERROR"}: ${r.message}`)}return t.length?t:["- none"]}function U(e){if(!e.length)return["- none"];return e.map((n)=>{const t=n.status??"unknown",r=n.method??"GET",o=n.contentType?` ${n.contentType}`:"";return`- ${j(n.ts)} ${t} ${r} ${n.url}${o}`})}function B(e){if(!e.length)return["- none"];return e.map((n)=>`- ${j(n.ts)} ${n.level}: ${R(n.text,240)}`)}function M(e){if(!e.length)return["- none"];return e.map((n)=>{const t=n.phase?` ${n.phase}`:"",r=n.data&&Object.keys(n.data).length?` ${R(JSON.stringify(p(n.data)),240)}`:"";return`- ${j(n.ts)} ${n.name}${t}${r}`})}function j(e){return new Date(e).toISOString()}function R(e,n){const t=e.replace(/\s+/g," ").trim();return t.length>n?`${t.slice(0,n)}...`:t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as m from"node:fs";import*as u from"node:path";import{log as A}from"../logger.js";export const DEFAULT_TRACE_RETENTION_POLICY={maxAgeDays:7,maxCountPerProfile:20,maxBytesPerProfile:"500MB"};const w={B:1,KB:1024,MB:1048576,GB:1073741824};export function parseByteSize(t){if(typeof t==="number"){if(!Number.isFinite(t)||t<0)throw Error(`Invalid byte size: ${t}`);return Math.floor(t)}const r=t.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)?$/i);if(!r)throw Error(`Invalid byte size: ${t}`);const n=Number(r[1]),o=(r[2]??"B").toUpperCase();return Math.floor(n*w[o])}export function resolveTraceRetentionPolicy(t={}){const r=t.maxAgeDays??DEFAULT_TRACE_RETENTION_POLICY.maxAgeDays,n=t.maxCountPerProfile??DEFAULT_TRACE_RETENTION_POLICY.maxCountPerProfile;if(!Number.isFinite(r)||r<0)throw Error(`Invalid trace maxAgeDays: ${r}`);if(!Number.isInteger(n)||n<0)throw Error(`Invalid trace maxCountPerProfile: ${n}`);return{maxAgeDays:r,maxAgeMs:r*24*60*60*1000,maxCountPerProfile:n,maxBytesPerProfile:parseByteSize(t.maxBytesPerProfile??DEFAULT_TRACE_RETENTION_POLICY.maxBytesPerProfile)}}export function traceExpiresAt(t,r={}){const n=resolveTraceRetentionPolicy(r),o=Date.parse(t),c=Number.isFinite(o)?o:Date.now();return new Date(c+n.maxAgeMs).toISOString()}export function pruneTraceArtifacts(t,r={}){const n=r.warn??((e)=>A.warn(`[trace] ${e}`)),o=resolveTraceRetentionPolicy(r.policy),c=r.now??Date.now,f=new Set((r.protectedTraceDirs??[]).map((e)=>u.resolve(e))),s=E(t,f,n),a=s.reduce((e,i)=>e+i.sizeBytes,0),l=new Set,y=[...s].sort((e,i)=>e.createdAtMs-i.createdAtMs||e.dir.localeCompare(i.dir)),h=c()-o.maxAgeMs;for(const e of y)if(!e.protected&&e.createdAtMs<h)l.add(e.dir);let d=y.filter((e)=>!l.has(e.dir));while(d.length>o.maxCountPerProfile){const e=d.find((i)=>!i.protected);if(!e)break;l.add(e.dir);d=d.filter((i)=>i.dir!==e.dir)}let B=d.reduce((e,i)=>e+i.sizeBytes,0);while(B>o.maxBytesPerProfile){const e=d.find((i)=>!i.protected);if(!e)break;l.add(e.dir);d=d.filter((i)=>i.dir!==e.dir);B-=e.sizeBytes}const p=[];for(const e of y.map((i)=>i.dir).filter((i)=>l.has(i)))try{m.rmSync(e,{recursive:!0,force:!0});p.push(e)}catch(i){n(`Failed to prune trace artifact ${e}: ${i instanceof Error?i.message:String(i)}`)}const x=s.filter((e)=>!p.includes(e.dir));return{scanned:s.length,deleted:p,kept:x.map((e)=>e.dir),totalBytesBefore:a,totalBytesAfter:x.reduce((e,i)=>e+i.sizeBytes,0)}}function E(t,r,n){let o;try{o=m.readdirSync(t)}catch(f){if(g(f))return[];n(`Failed to list trace artifacts in ${t}: ${f instanceof Error?f.message:String(f)}`);return[]}const c=[];for(const f of o){const s=u.join(t,f);try{const a=m.statSync(s);if(!a.isDirectory())continue;c.push({dir:s,createdAtMs:S(s,a.mtimeMs),sizeBytes:P(s),protected:r.has(u.resolve(s))})}catch(a){if(!g(a))n(`Failed to inspect trace artifact ${s}: ${a instanceof Error?a.message:String(a)}`)}}return c}function S(t,r){try{const n=JSON.parse(m.readFileSync(u.join(t,"receipt.json"),"utf-8"));if(typeof n.createdAt==="string"){const o=Date.parse(n.createdAt);if(Number.isFinite(o))return o}}catch{}return r}function P(t){let r=0;for(const n of m.readdirSync(t)){const o=u.join(t,n),c=m.lstatSync(o);if(c.isDirectory())r+=P(o);else r+=c.size}return r}function g(t){return typeof t==="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}
|
package/dist/src/output.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
`)||
|
|
1
|
+
import g from"cli-table3";import m from"js-yaml";function i(e){if(Array.isArray(e))return e;if(e&&typeof e==="object")return[e];return[{value:e}]}function f(e,r){return r.columns??Object.keys(e[0]??{})}export function render(e,r={}){let o=r.fmt??"table";if(!r.fmtExplicit){if(o==="table"&&!process.stdout.isTTY)o="yaml"}if(e===null||e===void 0){console.log(e);return}switch(o){case"json":h(e);break;case"plain":p(e,r);break;case"md":case"markdown":b(e,r);break;case"csv":w(e,r);break;case"yaml":case"yml":y(e);break;default:d(e,r);break}}function d(e,r){const o=i(e);if(!o.length){console.log("(no data)");return}const l=f(o,r),s=l.map((c)=>k(c)),t=new g({head:s.map((c)=>c),style:{head:[],border:[]},wordWrap:!0,wrapOnWordBoundary:!0});for(const c of o)t.push(l.map((a)=>{const u=c[a];return u===null||u===void 0?"":String(u)}));console.log();if(r.title)console.log(` ${r.title}`);console.log(t.toString());const n=[];n.push(`${o.length} items`);if(r.elapsed!==void 0)n.push(`${r.elapsed.toFixed(1)}s`);if(r.source)n.push(r.source);if(r.footerExtra)n.push(r.footerExtra);console.log(n.join(" · "))}function h(e){console.log(JSON.stringify(e,null,2))}function p(e,r){const o=i(e);if(!o.length)return;if(o.length===1){const l=o[0],s=Object.entries(l);if(s.length===1){const[t,n]=s[0];if(t==="response"||t==="content"||t==="markdown"||t==="text"||t==="value"){console.log(String(n??""));return}}}o.forEach((l,s)=>{Object.entries(l).filter(([,n])=>n!==void 0&&n!==null&&String(n)!=="").forEach(([n,c])=>{console.log(`${n}: ${c}`)});if(s<o.length-1)console.log("")})}function b(e,r){const o=i(e);if(!o.length)return;if(o.length===1){const t=Object.entries(o[0]);if(t.length===1){const[n,c]=t[0];if(n==="content"||n==="markdown"||n==="text"||n==="value"){console.log(String(c??""));return}}}const l=f(o,r),s=(t)=>t.replace(/\|/g,"\\|").replace(/\r\n|\r|\n/g,"<br>");console.log("| "+l.map(s).join(" | ")+" |");console.log("| "+l.map(()=>"---").join(" | ")+" |");for(const t of o)console.log("| "+l.map((n)=>s(String(t[n]??""))).join(" | ")+" |")}function w(e,r){const o=i(e);if(!o.length)return;const l=f(o,r);console.log(l.join(","));for(const s of o)console.log(l.map((t)=>{const n=String(s[t]??"");return n.includes(",")||n.includes('"')||n.includes(`
|
|
2
|
+
`)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}).join(","))}function y(e){console.log(m.dump(e,{sortKeys:!1,lineWidth:120,noRefs:!0}))}function k(e){return e.charAt(0).toUpperCase()+e.slice(1)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as o from"node:fs";import*as t from"node:path";export function findPackageRoot(n,r=o.existsSync){let i=t.dirname(n);while(!0){if(r(t.join(i,"package.json")))return i;const e=t.dirname(i);if(e===i)throw Error(`Could not find package.json above ${n}`);i=e}}export function getBuiltEntryCandidates(n,r=(i)=>o.readFileSync(i,"utf-8")){const i=[];try{const e=JSON.parse(r(t.join(n,"package.json")));if(typeof e.bin==="string")i.push(t.join(n,e.bin));else if(e.bin&&typeof e.bin==="object")for(const f of["ppcli","opencli"]){const s=e.bin[f];if(typeof s==="string")i.push(t.join(n,s))}if(typeof e.main==="string")i.push(t.join(n,e.main))}catch{}i.push(t.join(n,"dist","src","main.js"),t.join(n,"dist","main.js"));return[...new Set(i)]}export function getCliManifestPath(n){return t.resolve(n,"..","cli-manifest.json")}export function getFetchAdaptersScriptPath(n){return t.join(n,"scripts","fetch-adapters.js")}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getStep as
|
|
1
|
+
import{getStep as y}from"./registry.js";import{log as l}from"../logger.js";import{ConfigError as g}from"../errors.js";import{BROWSER_ONLY_STEPS as w}from"../capabilityRouting.js";import{isTransientBrowserError as b}from"../browser/errors.js";export async function executePipeline(n,e,o={}){const t=o.args??{},s=o.debug??!1;let c=null;const u=e.length;try{for(let r=0;r<e.length;r++){const f=e[r];if(!f||typeof f!=="object")continue;for(const[i,p]of Object.entries(f)){if(s)R(r+1,u,i,p);const h=y(i);if(h)c=await m(h,n,p,c,t,i,o.stepRetries);else throw new g(`Unknown pipeline step "${i}" at index ${r}.`,"Check the YAML pipeline step name or register the custom step before execution.");if(s)j(i,c)}}}catch(r){if(n?.closeWindow)try{await n.closeWindow()}catch{}throw r}return c}async function m(n,e,o,t,s,c,u){const r=u??(w.has(c)?2:0);for(let f=0;f<=r;f++)try{return await n(e,o,t,s)}catch(i){if(f>=r)throw i;if(!b(i))throw i;await new Promise((p)=>setTimeout(p,1000))}throw Error(`Step "${c}" failed after ${r} retries`)}function R(n,e,o,t){let s="";if(typeof t==="string")s=t.length<=80?` → ${t}`:` → ${t.slice(0,77)}...`;else if(t&&typeof t==="object"&&!Array.isArray(t))s=` (${Object.keys(t).join(", ")})`;l.step(n,e,o,s)}function j(n,e){if(e===null||e===void 0)l.stepResult("(no data)");else if(Array.isArray(e))l.stepResult(`${e.length} items`);else if(typeof e==="object"){const o=Object.keys(e).slice(0,5);l.stepResult(`dict (${o.join(", ")}${Object.keys(e).length>5?"...":""})`)}else if(typeof e==="string"){const o=e.slice(0,60).replace(/\n/g,"\\n");l.stepResult(`"${o}${e.length>60?"...":""}"`)}else l.stepResult(`${typeof e}`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stepNavigate as
|
|
1
|
+
import{stepNavigate as s,stepClick as r,stepType as i,stepFill as o,stepWait as a,stepPress as n,stepSnapshot as m,stepEvaluate as l}from"./steps/browser.js";import{stepFetch as c}from"./steps/fetch.js";import{stepSelect as f,stepMap as g,stepFilter as u,stepSort as S,stepLimit as d}from"./steps/transform.js";import{stepIntercept as h}from"./steps/intercept.js";import{stepTap as v}from"./steps/tap.js";import{stepDownload as w}from"./steps/download.js";const e=new Map;export function getStep(t){return e.get(t)}export function getRegisteredStepNames(){return[...e.keys()]}export function registerStep(t,p){e.set(t,p)}registerStep("navigate",s);registerStep("fetch",c);registerStep("select",f);registerStep("evaluate",l);registerStep("snapshot",m);registerStep("click",r);registerStep("type",i);registerStep("fill",o);registerStep("wait",a);registerStep("press",n);registerStep("map",g);registerStep("filter",u);registerStep("sort",S);registerStep("limit",d);registerStep("intercept",h);registerStep("tap",v);registerStep("download",w);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{render as
|
|
1
|
+
import{render as r}from"../template.js";import{isRecord as s}from"../../utils.js";export async function stepNavigate(i,t,e,n){if(s(t)&&"url"in t){const o=String(r(t.url,{args:n,data:e}));await i.goto(o,{waitUntil:t.waitUntil,settleMs:typeof t.settleMs==="number"?t.settleMs:void 0})}else{const o=r(t,{args:n,data:e});await i.goto(String(o))}return e}export async function stepClick(i,t,e,n){await i.click(String(r(t,{args:n,data:e})).replace(/^@/,""));return e}export async function stepType(i,t,e,n){if(s(t)){const o=String(r(t.ref??"",{args:n,data:e})).replace(/^@/,""),c=String(r(t.text??"",{args:n,data:e}));await i.typeText(o,c);if(t.submit)await i.pressKey("Enter")}return e}export async function stepFill(i,t,e,n){if(s(t)){const o=String(r(t.ref??"",{args:n,data:e})).replace(/^@/,""),c=String(r(t.text??"",{args:n,data:e}));await i.fillText(o,c);if(t.submit)await i.pressKey("Enter")}return e}export async function stepWait(i,t,e,n){if(typeof t==="number")await i.wait(t);else if(s(t)){if("text"in t)await i.wait({text:String(r(t.text,{args:n,data:e})),timeout:typeof t.timeout==="number"?t.timeout:void 0});else if("time"in t)await i.wait(Number(t.time))}else if(typeof t==="string")await i.wait(Number(r(t,{args:n,data:e})));return e}export async function stepPress(i,t,e,n){await i.pressKey(String(r(t,{args:n,data:e})));return e}export async function stepSnapshot(i,t,e,n){const o=s(t)?t:{};return i.snapshot({interactive:typeof o.interactive==="boolean"?o.interactive:!1,compact:typeof o.compact==="boolean"?o.compact:!1,maxDepth:typeof o.max_depth==="number"?o.max_depth:void 0,raw:typeof o.raw==="boolean"?o.raw:!1})}export async function stepEvaluate(i,t,e,n){const o=String(r(t,{args:n,data:e}));let c=await i.evaluate(o);if(typeof c==="string"){const f=c.trim();if(f.startsWith("[")&&f.endsWith("]")||f.startsWith("{")&&f.endsWith("}"))try{c=JSON.parse(f)}catch{}}return c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as g from"node:fs";import*as T from"node:path";import{render as w}from"../template.js";import{getErrorMessage as G}from"../../errors.js";import{httpDownload as I,ytdlpDownload as J,saveDocument as K,detectContentType as Q,requiresYtdlp as z,sanitizeFilename as V,generateFilename as W,exportCookiesToNetscape as X,getTempDir as Z,formatCookieHeader as ee}from"../../download/index.js";import{DownloadProgressTracker as te,formatBytes as A}from"../../download/progress.js";import{mapConcurrent as oe}from"../../utils.js";async function se(a,r){try{const e=await a.getCookies({domain:r});return ee(e)}catch{return""}}async function ne(a,r){try{return(await a.getCookies({domain:r})).filter((o)=>o.name).map((o)=>({name:o.name,value:o.value,domain:o.domain,path:o.path??"/",secure:o.secure??!1,httpOnly:o.httpOnly??!1}))}catch{return[]}}function re(a){const r=new Map;for(const e of a)r.set(`${e.domain} ${e.path} ${e.name}`,e);return[...r.values()]}export async function stepDownload(a,r,e,o){const s=typeof r==="object"&&r!==null?r:{},C=typeof r==="string"?r:s.url??"",E=s.dir??"./downloads",_=s.filename??"",L=typeof s.concurrency==="number"?s.concurrency:3,M=s.skip_existing!==!1,O=typeof s.timeout==="number"?s.timeout*1000:30000,D=s.use_ytdlp??!1,U=Array.isArray(s.ytdlp_args)?s.ytdlp_args.map((n)=>String(n)):[],j=s.type??"auto",B=s.progress!==!1,v=s.content,x=s.metadata,F=String(w(E,{args:o,data:e}));g.mkdirSync(F,{recursive:!0});const k=Array.isArray(e)?e:e?[e]:[];if(k.length===0)return[];const S=new te(k.length,B),P=new Map;let h;if(a){if(D||k.some((n,i)=>{const l=String(w(C,{args:o,data:e,item:n,index:i}));return z(l)}))try{const n=[...new Set(k.flatMap((l,f)=>{const u=String(w(C,{args:o,data:e,item:l,index:f}));if(!D&&!z(u))return[];try{return[new URL(u).hostname]}catch{return[]}}))],i=re((await Promise.all(n.map((l)=>ne(a,l)))).flat());if(i.length>0){const l=Z();g.mkdirSync(l,{recursive:!0});h=T.join(l,`cookies_${Date.now()}.txt`);X(i,h)}}catch{}}const R=await oe(k,L,async(n,i)=>{const l=Date.now(),f=String(w(C,{args:o,data:e,item:n,index:i}));if(!f){S.onFileComplete(!1);return{...n,_download:{status:"failed",error:"Empty URL"}}}let u;if(_)u=String(w(_,{args:o,data:e,item:n,index:i}));else u=W(f,i);u=V(u);const y=T.join(F,u);if(M&&g.existsSync(y)){S.onFileComplete(!0,!0);return{...n,_download:{status:"skipped",path:y,size:g.statSync(y).size}}}const c=S.onFileStart(u,i),b=j==="auto"?Q(f):j,Y=D||b==="video"&&z(f);let t;try{if(b==="document"&&v){const p=String(w(v,{args:o,data:e,item:n,index:i})),m=x?Object.fromEntries(Object.entries(x).map(([q,N])=>[q,w(N,{args:o,data:e,item:n,index:i})])):void 0,d=T.extname(u).toLowerCase();t=await K(p,y,d===".json"?"json":d===".html"?"html":"markdown",m);if(c)c.complete(t.success,t.success?A(t.size):void 0)}else if(Y){t=await J(f,y,{cookiesFile:h,extraArgs:U,onProgress:(p)=>{if(c)c.update(p,100)}});if(c)c.complete(t.success,t.success?A(t.size):void 0)}else{let p="";if(a)try{const m=new URL(f).hostname;let d=P.get(m);if(!d){d=se(a,m);P.set(m,d)}p=await d}catch{p=""}t=await I(f,y,{cookies:p,timeout:O,onProgress:(m,d)=>{if(c)c.update(m,d)}});if(c)c.complete(t.success,t.success?A(t.size):void 0)}}catch(p){const m=G(p);t={success:!1,size:0,error:m};if(c)c.fail(m)}S.onFileComplete(t.success);const H=Date.now()-l;return{...n,_download:{status:t.success?"success":"failed",path:t.success?y:void 0,size:t.size,error:t.error,duration:H}}});if(h&&g.existsSync(h))try{g.unlinkSync(h)}catch{}S.finish();return R}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as E,getErrorMessage as T}from"../../errors.js";import{log as j}from"../../logger.js";import{render as d}from"../template.js";import{isRecord as g,mapConcurrent as P}from"../../utils.js";const x=/\$\{\{[^}]*\b(?:item|index)\b[^}]*\}\}/;async function k(u,a,r,o,e,h,f){const l={};for(const[t,y]of Object.entries(o))l[t]=String(d(y,{args:h,data:f}));const m={};for(const[t,y]of Object.entries(e))m[t]=String(d(y,{args:h,data:f}));let i=a;if(Object.keys(l).length>0){const t=new URLSearchParams(l).toString();i=`${i}${i.includes("?")?"&":"?"}${t}`}if(u===null){const t=await fetch(i,{method:r.toUpperCase(),headers:m});if(!t.ok)throw new E("FETCH_ERROR",`HTTP ${t.status} ${t.statusText} from ${i}`);return t.json()}return u.fetchJson(i,{method:r.toUpperCase(),headers:m})}async function J(u,a,r,o,e){const h=JSON.stringify(o),f=JSON.stringify(a),l=JSON.stringify(r);return await u.evaluate(`
|
|
2
2
|
async () => {
|
|
3
|
-
const urls = ${
|
|
4
|
-
const method = ${
|
|
5
|
-
const headers = ${
|
|
6
|
-
const concurrency = ${
|
|
3
|
+
const urls = ${f};
|
|
4
|
+
const method = ${l};
|
|
5
|
+
const headers = ${h};
|
|
6
|
+
const concurrency = ${e};
|
|
7
7
|
|
|
8
8
|
const results = new Array(urls.length);
|
|
9
9
|
let idx = 0;
|
|
@@ -28,4 +28,4 @@ import{CliError as x,getErrorMessage as E}from"../../errors.js";import{log as k}
|
|
|
28
28
|
await Promise.all(workers);
|
|
29
29
|
return results;
|
|
30
30
|
}
|
|
31
|
-
`)}export async function stepFetch(
|
|
31
|
+
`)}export async function stepFetch(u,a,r,o){const e=g(a)?a:{},h=typeof a==="string"?a:e.url??"",f=typeof e.method==="string"?e.method:"GET",l=g(e.params)?e.params:{},m=g(e.headers)?e.headers:{},i=String(h);if(Array.isArray(r)&&x.test(i)){const y=typeof e.concurrency==="number"?e.concurrency:5,S={};for(const[c,n]of Object.entries(m))S[c]=String(d(n,{args:o,data:r}));const p={};for(const[c,n]of Object.entries(l))p[c]=String(d(n,{args:o,data:r}));const O=r.map((c,n)=>{let s=String(d(i,{args:o,data:r,item:c,index:n}));if(Object.keys(p).length>0){const w=new URLSearchParams(p).toString();s=`${s}${s.includes("?")?"&":"?"}${w}`}return s});if(u!==null){const c=await J(u,O,f.toUpperCase(),S,y);for(let n=0;n<c.length;n++){const s=c[n];if(s&&typeof s==="object"&&"error"in s)j.warn(`Batch fetch failed for ${O[n]}: ${s.error}`)}return c}return P(r,y,async(c,n)=>{const s=String(d(i,{args:o,data:r,item:c,index:n}));try{return await k(null,s,f,l,m,o,r)}catch(w){const b=T(w);j.warn(`Batch fetch failed for ${s}: ${b}`);return{error:b}}})}const t=d(h,{args:o,data:r});return k(u,String(t),f,l,m,o,r)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{render as
|
|
1
|
+
import{render as a,normalizeEvaluateSource as w}from"../template.js";export async function stepIntercept(e,s,i,o){const n=typeof s==="object"&&s!==null?s:{},r=n.trigger??"",u=n.capture??"",g=n.timeout??8,f=n.select??null;if(!u)return i;await e.installInterceptor(u);if(r.startsWith("navigate:")){const t=a(r.slice(9),{args:o,data:i});await e.goto(String(t))}else if(r.startsWith("evaluate:")){const t=r.slice(9);await e.evaluate(w(a(t,{args:o,data:i})))}else if(r.startsWith("click:")){const t=a(r.slice(6),{args:o,data:i});await e.click(String(t).replace(/^@/,""))}else if(r==="scroll")await e.scroll("down");await e.waitForCapture(g);const c=await e.getInterceptedRequests();let l=c.length===1?c[0]:c.length>1?c:i;if(f&&l){let t=l;for(const h of String(f).split("."))if(t&&typeof t==="object"&&!Array.isArray(t))t=t[h];else break;l=t??l}return l}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{render as
|
|
1
|
+
import{render as i}from"../template.js";import{generateTapInterceptorJs as d}from"../../interceptor.js";import{CliError as P}from"../../errors.js";export async function stepTap(u,s,o,n){const e=typeof s==="object"&&s!==null?s:{},c=String(i(e.store??"",{args:n,data:o})),r=String(i(e.action??"",{args:n,data:o})),l=String(i(e.capture??"",{args:n,data:o})),m=e.timeout??5,p=e.select?String(i(e.select,{args:n,data:o})):null,y=e.framework??null,g=e.args??[];if(!c||!r)throw new P("TAP_MISSING_PARAMS","tap: store and action are required");const S=p?p.split(".").map((a)=>`?.[${JSON.stringify(a)}]`).join(""):"",f=g.map((a)=>{const h=i(a,{args:n,data:o});return JSON.stringify(h)}),N=f.length?`store[${JSON.stringify(r)}](${f.join(", ")})`:`store[${JSON.stringify(r)}]()`,t=d(JSON.stringify(l)),_=`
|
|
2
2
|
async () => {
|
|
3
3
|
// ── 1. Setup capture proxy (fetch + XHR dual interception) ──
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
${
|
|
4
|
+
${t.setupVar}
|
|
5
|
+
${t.fetchPatch}
|
|
6
|
+
${t.xhrPatch}
|
|
7
7
|
|
|
8
8
|
try {
|
|
9
9
|
// ── 2. Find store ──
|
|
10
10
|
let store = null;
|
|
11
|
-
const storeName = ${JSON.stringify(
|
|
12
|
-
const fw = ${JSON.stringify(
|
|
11
|
+
const storeName = ${JSON.stringify(c)};
|
|
12
|
+
const fw = ${JSON.stringify(y)};
|
|
13
13
|
|
|
14
14
|
const app = document.querySelector('#app');
|
|
15
15
|
if (!fw || fw === 'pinia') {
|
|
@@ -23,31 +23,31 @@ import{render as z}from"../template.js";import{generateTapInterceptorJs as _}fro
|
|
|
23
23
|
const vuexStore = app?.__vue_app__?.config?.globalProperties?.$store
|
|
24
24
|
?? app?.__vue__?.$store;
|
|
25
25
|
if (vuexStore) {
|
|
26
|
-
store = { [${JSON.stringify(
|
|
26
|
+
store = { [${JSON.stringify(r)}]: (...a) => vuexStore.dispatch(storeName + '/' + ${JSON.stringify(r)}, ...a) };
|
|
27
27
|
}
|
|
28
28
|
} catch {}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
if (!store) return { error: 'Store not found: ' + storeName, hint: 'Page may not be fully loaded or store name may be incorrect' };
|
|
32
|
-
if (typeof store[${JSON.stringify(
|
|
33
|
-
return { error: 'Action not found: ' + ${JSON.stringify(
|
|
32
|
+
if (typeof store[${JSON.stringify(r)}] !== 'function') {
|
|
33
|
+
return { error: 'Action not found: ' + ${JSON.stringify(r)} + ' on store ' + storeName,
|
|
34
34
|
hint: 'Available: ' + Object.keys(store).filter(k => typeof store[k] === 'function' && !k.startsWith('$') && !k.startsWith('_')).join(', ') };
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// ── 3. Call store action ──
|
|
38
|
-
await ${
|
|
38
|
+
await ${N};
|
|
39
39
|
|
|
40
40
|
// ── 4. Wait for network response ──
|
|
41
|
-
if (!${
|
|
42
|
-
const timeoutPromise = new Promise(r => setTimeout(r, ${
|
|
43
|
-
await Promise.race([${
|
|
41
|
+
if (!${t.capturedVar}) {
|
|
42
|
+
const timeoutPromise = new Promise(r => setTimeout(r, ${m} * 1000));
|
|
43
|
+
await Promise.race([${t.promiseVar}, timeoutPromise]);
|
|
44
44
|
}
|
|
45
45
|
} finally {
|
|
46
46
|
// ── 5. Always restore originals ──
|
|
47
|
-
${
|
|
47
|
+
${t.restorePatch}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
if (!${
|
|
51
|
-
return ${
|
|
50
|
+
if (!${t.capturedVar}) return { error: 'No matching response captured for pattern: ' + capturePattern };
|
|
51
|
+
return ${t.capturedVar}${S} ?? ${t.capturedVar};
|
|
52
52
|
}
|
|
53
|
-
`;return
|
|
53
|
+
`;return u.evaluate(_)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{render as
|
|
1
|
+
import{render as A,evalExpr as S}from"../template.js";import{isRecord as u}from"../../utils.js";export async function stepSelect(s,t,e,i){const r=String(A(t,{args:i,data:e}));if(e&&typeof e==="object"){let n=e;for(const o of r.split("."))if(u(n))n=n[o];else if(Array.isArray(n)&&/^\d+$/.test(o))n=n[parseInt(o,10)];else return null;return n}return e}export async function stepMap(s,t,e,i){if(!e||typeof e!=="object")return e;let r=e;if(u(t)&&"select"in t)r=await stepSelect(null,t.select,e,i);if(!r||typeof r!=="object")return r;let n=Array.isArray(r)?r:[r];if(u(r)&&Array.isArray(r.data))n=r.data;const o=[],y=u(t)?t:{};for(let l=0;l<n.length;l++){const g=n[l],f={};for(const[p,c]of Object.entries(y)){if(p==="select")continue;f[p]=A(c,{args:i,data:r,root:e,item:g,index:l})}o.push(f)}return o}export async function stepFilter(s,t,e,i){if(!Array.isArray(e))return e;return e.filter((r,n)=>S(String(t),{args:i,item:r,index:n}))}function m(s){return typeof s==="number"&&Number.isFinite(s)?s:null}export async function stepSort(s,t,e,i){if(!Array.isArray(e))return e;const r=u(t)?String(t.by??""):String(t),n=u(t)?t.order==="desc":!1;return[...e].sort((o,y)=>{const l=u(o)?o[r]:void 0,g=u(y)?y[r]:void 0,f=m(l),p=m(g);let c;if(f!==null&&p!==null)c=f-p;else if(f!==null)c=-1;else if(p!==null)c=1;else c=String(l??"").localeCompare(String(g??""),void 0,{numeric:!0});return n?-c:c})}export async function stepLimit(s,t,e,i){if(!Array.isArray(e))return e;return e.slice(0,Number(A(t,{args:i,data:e})))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import y from"node:vm";import{isRecord as S}from"../utils.js";import{log as A}from"../logger.js";export function render(r,t){if(typeof r!=="string")return r;const i=r.trim(),e=i.match(/^\$\{\{\s*([^}]*(?:\}[^}][^}]*)*)\s*\}\}$/);if(e&&!i.includes("}}-")&&!i.includes("}}${{"))return evalExpr(e[1].trim(),t);const c=i.match(/^\$\{\{\s*([\s\S]*?)\s*\}\}$/);if(c){const s=c[1];if(!s.includes("${{"))return evalExpr(s.trim(),t)}return r.replace(/\$\{\{\s*(.*?)\s*\}\}/g,(s,n)=>String(evalExpr(n.trim(),t)))}export function evalExpr(r,t){const i=t.args??{},e=t.item??{},c=t.data,s=t.root,n=t.index??0,f=r.split(/(?<!\|)\|(?!\|)/).map((a)=>a.trim());if(f.length>1){let a=evalExpr(f[0],t);for(let p=1;p<f.length;p++)a=C(f[p],a);return a}const d=r.match(/^(['"])(.*)\1$/);if(d)return d[2];if(/^\d+(\.\d+)?$/.test(r))return Number(r);const o=resolvePath(r,{args:i,item:e,data:c,root:s,index:n});if(o!==null&&o!==void 0)return o;return O(r,{args:i,item:e,data:c,root:s,index:n})}function C(r,t){const i=r.match(/^(\w+)(?:\((.+)\))?$/);if(!i)return t;const[,e,c]=i,s=c?.replace(/^['"]|['"]$/g,"")??"";switch(e){case"default":{if(t===null||t===void 0||t===""){const n=parseInt(s,10);if(!Number.isNaN(n)&&String(n)===s.trim())return n;return s}return t}case"join":return Array.isArray(t)?t.join(s||", "):t;case"upper":return typeof t==="string"?t.toUpperCase():t;case"lower":return typeof t==="string"?t.toLowerCase():t;case"trim":return typeof t==="string"?t.trim():t;case"truncate":{const n=parseInt(s,10)||50;return typeof t==="string"&&t.length>n?`${t.slice(0,n)}...`:t}case"replace":{if(typeof t!=="string")return t;if(c==null)return t;const n=c.indexOf(",");if(n===-1)return t;const f=(a)=>a.trim().replace(/^['"]|['"]$/g,""),d=f(c.slice(0,n)),o=f(c.slice(n+1));return t.replaceAll(d,o)}case"keys":return t&&typeof t==="object"?Object.keys(t):t;case"length":return Array.isArray(t)?t.length:typeof t==="string"?t.length:t;case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"json":return JSON.stringify(t??null);case"slugify":return typeof t==="string"?t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,""):t;case"sanitize":return typeof t==="string"?t.replace(/[<>:"/\\|?*\x00-\x1f]/g,"_"):t;case"ext":{if(typeof t!=="string")return t;const n=t.lastIndexOf("."),f=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>f?t.slice(n):""}case"basename":{if(typeof t!=="string")return t;const n=t.split(/[/\\]/);return n[n.length-1]||t}case"urlencode":return typeof t==="string"?encodeURIComponent(t):t;case"urldecode":return typeof t==="string"?decodeURIComponent(t):t;default:return t}}export function resolvePath(r,t){const i=t.args??{},e=t.item??{},c=t.data,s=t.root,n=t.index??0,f=r.split("."),d=f[0];let o,a;if(d==="args"){o=i;a=f.slice(1)}else if(d==="item"){o=e;a=f.slice(1)}else if(d==="data"){o=c;a=f.slice(1)}else if(d==="root"){o=s;a=f.slice(1)}else if(d==="index")return n;else{o=e;a=f}for(const p of a)if(S(o))o=o[p];else if(Array.isArray(o)&&/^\d+$/.test(p))o=o[parseInt(p,10)];else return null;return o}const _=/\b(constructor|__proto__|prototype|globalThis|process|require|import|eval)\b/,h=new WeakMap;function u(r){if(r===null||r===void 0)return r;if(typeof r!=="object"&&typeof r!=="function")return r;const t=r,i=h.get(t);if(i!==void 0)return JSON.parse(i);try{const e=JSON.stringify(r,(c,s)=>typeof s==="bigint"?s.toString():s);h.set(t,e);return JSON.parse(e)}catch(e){A.warn(`[pipeline/template] sanitizeContext failed: ${e instanceof Error?e.message:String(e)}. Returning {} for this branch. Likely cause: circular reference, Symbol, or other non-serializable value in pipeline context.`);return{}}}const b=256,g=new Map;function I(r){let t=g.get(r);if(t)return t;if(g.size>=b){const i=g.keys().next().value;if(i!==void 0)g.delete(i)}t=new y.Script(`(${r})`);g.set(r,t);return t}let m=null,l=null;function N(){if(m&&l)return{sandbox:m,context:l};m={args:{},item:{},data:null,root:null,index:0,encodeURIComponent,decodeURIComponent,JSON,Math,Number,String,Boolean,Array,Date};l=y.createContext(m,{codeGeneration:{strings:!1,wasm:!1}});return{sandbox:m,context:l}}const x=new Set(["args","item","data","root","index","encodeURIComponent","decodeURIComponent","JSON","Math","Number","String","Boolean","Array","Date"]);function O(r,t){if(r.length>2000)return;if(_.test(r))return;try{const i=I(r),{sandbox:e,context:c}=N();for(const s of Object.keys(e))if(!x.has(s))delete e[s];e.args=u(t.args??{});e.item=u(t.item??{});e.data=u(t.data);e.root=u(t.root);e.index=t.index??0;return i.runInContext(c,{timeout:50})}catch{return}}export function normalizeEvaluateSource(r){const t=r.trim();if(!t)return"() => undefined";if(t.startsWith("(")&&t.endsWith(")()"))return`() => (${t})`;if(/^(async\s+)?\([^)]*\)\s*=>/.test(t))return t;if(/^(async\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=>/.test(t))return t;if(t.startsWith("function ")||t.startsWith("async function "))return t;return`() => (${t})`}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as o from"node:fs";import*as a from"node:path";import{PKG_VERSION as c}from"./version.js";export const MANIFEST_FILENAME="opencli-plugin.json";export function readPluginManifest(t){const n=a.join(t,MANIFEST_FILENAME);try{const r=o.readFileSync(n,"utf-8"),s=JSON.parse(r);if(typeof s!=="object"||s===null||Array.isArray(s))return null;return s}catch{return null}}export function isMonorepo(t){return t.plugins!==void 0&&t.plugins!==null&&typeof t.plugins==="object"&&Object.keys(t.plugins).length>0}export function getEnabledPlugins(t){if(!t.plugins)return[];return Object.entries(t.plugins).filter(([,n])=>!n.disabled).map(([n,r])=>({name:n,entry:r})).sort((n,r)=>n.name.localeCompare(r.name))}export function checkCompatibility(t){if(!t||t.trim()==="")return!0;return satisfiesRange(c,t)}export function getCompatibilityRange(t){return t?.ppcli??t?.opencli}export function parseVersion(t){const n=t.trim().match(/^(\d+)\.(\d+)\.(\d+)/);if(!n)return null;return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)]}function i(t,n){for(let r=0;r<3;r++){if(t[r]<n[r])return-1;if(t[r]>n[r])return 1}return 0}function p(t,n){const r=n.trim();if(!r)return!0;if(r.startsWith("^")){const e=parseVersion(r.slice(1));if(!e)return!0;const u=[e[0]+1,0,0];return i(t,e)>=0&&i(t,u)<0}if(r.startsWith("~")){const e=parseVersion(r.slice(1));if(!e)return!0;const u=[e[0],e[1]+1,0];return i(t,e)>=0&&i(t,u)<0}if(r.startsWith(">=")){const e=parseVersion(r.slice(2));if(!e)return!0;return i(t,e)>=0}if(r.startsWith("<=")){const e=parseVersion(r.slice(2));if(!e)return!0;return i(t,e)<=0}if(r.startsWith(">")){const e=parseVersion(r.slice(1));if(!e)return!0;return i(t,e)>0}if(r.startsWith("<")){const e=parseVersion(r.slice(1));if(!e)return!0;return i(t,e)<0}if(r.startsWith("=")){const e=parseVersion(r.slice(1));if(!e)return!0;return i(t,e)===0}const s=parseVersion(r);if(!s)return!0;return i(t,s)===0}export function satisfiesRange(t,n){const r=parseVersion(t);if(!r)return!0;return n.trim().split(/\s+/).every((e)=>p(r,e))}export{readPluginManifest as _readPluginManifest,isMonorepo as _isMonorepo,getEnabledPlugins as _getEnabledPlugins,checkCompatibility as _checkCompatibility,parseVersion as _parseVersion,satisfiesRange as _satisfiesRange};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
`);
|
|
3
|
-
`);
|
|
4
|
-
* Sample pipeline command for ${
|
|
1
|
+
import*as n from"node:fs";import*as o from"node:path";import{PKG_VERSION as p}from"./version.js";export function createPluginScaffold(e,t={}){if(!/^[a-z][a-z0-9-]*$/.test(e))throw Error(`Invalid plugin name "${e}". Plugin names must start with a lowercase letter and contain only lowercase letters, digits, and hyphens.`);const i=t.dir?o.resolve(t.dir):o.resolve(e);if(n.existsSync(i)&&n.readdirSync(i).length>0)throw Error(`Directory "${i}" already exists and is not empty.`);n.mkdirSync(i,{recursive:!0});const r=[],s={name:e,version:"0.1.0",description:t.description??`A ppcli plugin: ${e}`,ppcli:`>=${p}`};l(i,"opencli-plugin.json",JSON.stringify(s,null,2)+`
|
|
2
|
+
`);r.push("opencli-plugin.json");const c={name:`opencli-plugin-${e}`,version:"0.1.0",type:"module",description:t.description??`A ppcli plugin: ${e}`,peerDependencies:{"@jackwener/opencli":`>=${p}`}};l(i,"package.json",JSON.stringify(c,null,2)+`
|
|
3
|
+
`);r.push("package.json");const a=`/**
|
|
4
|
+
* Sample pipeline command for ${e}.
|
|
5
5
|
* Demonstrates the declarative pipeline API.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
9
9
|
|
|
10
10
|
cli({
|
|
11
|
-
site: '${
|
|
11
|
+
site: '${e}',
|
|
12
12
|
name: 'hello',
|
|
13
13
|
description: 'A sample pipeline command',
|
|
14
14
|
strategy: Strategy.PUBLIC,
|
|
@@ -19,15 +19,15 @@ cli({
|
|
|
19
19
|
{ select: 'args' },
|
|
20
20
|
],
|
|
21
21
|
});
|
|
22
|
-
`;
|
|
23
|
-
* Sample TypeScript command for ${
|
|
22
|
+
`;l(i,"hello.ts",a);r.push("hello.ts");const g=`/**
|
|
23
|
+
* Sample TypeScript command for ${e}.
|
|
24
24
|
* Demonstrates the programmatic cli() registration API.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
28
28
|
|
|
29
29
|
cli({
|
|
30
|
-
site: '${
|
|
30
|
+
site: '${e}',
|
|
31
31
|
name: 'greet',
|
|
32
32
|
description: 'Greet someone by name',
|
|
33
33
|
strategy: Strategy.PUBLIC,
|
|
@@ -38,38 +38,38 @@ cli({
|
|
|
38
38
|
columns: ['greeting'],
|
|
39
39
|
func: async (kwargs) => [{ greeting: \`Hello, \${String(kwargs.name ?? 'World')}!\` }],
|
|
40
40
|
});
|
|
41
|
-
`;
|
|
41
|
+
`;l(i,"greet.ts",g);r.push("greet.ts");const m=`# opencli-plugin-${e}
|
|
42
42
|
|
|
43
|
-
${
|
|
43
|
+
${t.description??`A ppcli plugin: ${e}`}
|
|
44
44
|
|
|
45
45
|
## Install
|
|
46
46
|
|
|
47
47
|
\`\`\`bash
|
|
48
48
|
# From local development directory
|
|
49
|
-
ppcli plugin install file://${
|
|
49
|
+
ppcli plugin install file://${i}
|
|
50
50
|
|
|
51
51
|
# From GitHub (after publishing)
|
|
52
|
-
ppcli plugin install github:<user>/opencli-plugin-${
|
|
52
|
+
ppcli plugin install github:<user>/opencli-plugin-${e}
|
|
53
53
|
\`\`\`
|
|
54
54
|
|
|
55
55
|
## Commands
|
|
56
56
|
|
|
57
57
|
| Command | Type | Description |
|
|
58
58
|
|---------|------|-------------|
|
|
59
|
-
| \`${
|
|
60
|
-
| \`${
|
|
59
|
+
| \`${e}/hello\` | Pipeline | Sample pipeline command |
|
|
60
|
+
| \`${e}/greet\` | TypeScript | Sample TS command with func() |
|
|
61
61
|
|
|
62
62
|
## Development
|
|
63
63
|
|
|
64
64
|
\`\`\`bash
|
|
65
65
|
# Install locally for development (symlinked, changes reflect immediately)
|
|
66
|
-
ppcli plugin install file://${
|
|
66
|
+
ppcli plugin install file://${i}
|
|
67
67
|
|
|
68
68
|
# Verify commands are registered
|
|
69
|
-
ppcli list | grep ${
|
|
69
|
+
ppcli list | grep ${e}
|
|
70
70
|
|
|
71
71
|
# Run a command
|
|
72
|
-
ppcli ${
|
|
73
|
-
ppcli ${
|
|
72
|
+
ppcli ${e} hello
|
|
73
|
+
ppcli ${e} greet --name World
|
|
74
74
|
\`\`\`
|
|
75
|
-
`;
|
|
75
|
+
`;l(i,"README.md",m);r.push("README.md");return{name:e,dir:i,files:r}}function l(e,t,i){n.writeFileSync(o.join(e,t),i)}
|