@huyuan-ai/cli 1.0.0 → 1.0.2
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/package.json +14 -6
- package/vendor/opencli/dist/analysis.d.ts +38 -0
- package/vendor/opencli/dist/analysis.js +166 -0
- package/vendor/opencli/dist/browser/base-page.d.ts +50 -0
- package/vendor/opencli/dist/browser/base-page.js +193 -0
- package/vendor/opencli/dist/browser/bridge.d.ts +21 -0
- package/vendor/opencli/dist/browser/bridge.js +109 -0
- package/vendor/opencli/dist/browser/cdp.d.ts +40 -0
- package/vendor/opencli/dist/browser/cdp.js +310 -0
- package/vendor/opencli/dist/browser/cdp.test.d.ts +1 -0
- package/vendor/opencli/dist/browser/cdp.test.js +52 -0
- package/vendor/opencli/dist/browser/daemon-client.d.ts +74 -0
- package/vendor/opencli/dist/browser/daemon-client.js +113 -0
- package/vendor/opencli/dist/browser/daemon-client.test.d.ts +1 -0
- package/vendor/opencli/dist/browser/daemon-client.test.js +77 -0
- package/vendor/opencli/dist/browser/discover.d.ts +15 -0
- package/vendor/opencli/dist/browser/discover.js +19 -0
- package/vendor/opencli/dist/browser/dom-helpers.d.ts +41 -0
- package/vendor/opencli/dist/browser/dom-helpers.js +227 -0
- package/vendor/opencli/dist/browser/dom-helpers.test.d.ts +1 -0
- package/vendor/opencli/dist/browser/dom-helpers.test.js +105 -0
- package/vendor/opencli/dist/browser/dom-snapshot.d.ts +86 -0
- package/vendor/opencli/dist/browser/dom-snapshot.js +804 -0
- package/vendor/opencli/dist/browser/dom-snapshot.test.d.ts +11 -0
- package/vendor/opencli/dist/browser/dom-snapshot.test.js +248 -0
- package/vendor/opencli/dist/browser/errors.d.ts +13 -0
- package/vendor/opencli/dist/browser/errors.js +40 -0
- package/vendor/opencli/dist/browser/index.d.ts +13 -0
- package/vendor/opencli/dist/browser/index.js +12 -0
- package/vendor/opencli/dist/browser/page.d.ts +62 -0
- package/vendor/opencli/dist/browser/page.js +304 -0
- package/vendor/opencli/dist/browser/page.test.d.ts +1 -0
- package/vendor/opencli/dist/browser/page.test.js +44 -0
- package/vendor/opencli/dist/browser/stealth.d.ts +16 -0
- package/vendor/opencli/dist/browser/stealth.js +353 -0
- package/vendor/opencli/dist/browser/stealth.test.d.ts +1 -0
- package/vendor/opencli/dist/browser/stealth.test.js +134 -0
- package/vendor/opencli/dist/browser/tabs.d.ts +13 -0
- package/vendor/opencli/dist/browser/tabs.js +70 -0
- package/vendor/opencli/dist/browser/utils.d.ts +10 -0
- package/vendor/opencli/dist/browser/utils.js +27 -0
- package/vendor/opencli/dist/browser.test.d.ts +1 -0
- package/vendor/opencli/dist/browser.test.js +159 -0
- package/vendor/opencli/dist/build-manifest.d.ts +47 -0
- package/vendor/opencli/dist/build-manifest.js +225 -0
- package/vendor/opencli/dist/build-manifest.test.d.ts +1 -0
- package/vendor/opencli/dist/build-manifest.test.js +176 -0
- package/vendor/opencli/dist/capabilityRouting.d.ts +4 -0
- package/vendor/opencli/dist/capabilityRouting.js +31 -0
- package/vendor/opencli/dist/capabilityRouting.test.d.ts +1 -0
- package/vendor/opencli/dist/capabilityRouting.test.js +42 -0
- package/vendor/opencli/dist/cascade.d.ts +46 -0
- package/vendor/opencli/dist/cascade.js +149 -0
- package/vendor/opencli/dist/cli-manifest.json +16706 -0
- package/vendor/opencli/dist/cli.d.ts +9 -0
- package/vendor/opencli/dist/cli.js +953 -0
- package/vendor/opencli/dist/cli.test.d.ts +1 -0
- package/vendor/opencli/dist/cli.test.js +88 -0
- package/vendor/opencli/dist/clis/1688/item.d.ts +70 -0
- package/vendor/opencli/dist/clis/1688/item.js +187 -0
- package/vendor/opencli/dist/clis/1688/item.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/1688/item.test.js +67 -0
- package/vendor/opencli/dist/clis/1688/search.d.ts +56 -0
- package/vendor/opencli/dist/clis/1688/search.js +309 -0
- package/vendor/opencli/dist/clis/1688/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/1688/search.test.js +75 -0
- package/vendor/opencli/dist/clis/1688/shared.d.ts +112 -0
- package/vendor/opencli/dist/clis/1688/shared.js +514 -0
- package/vendor/opencli/dist/clis/1688/shared.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/1688/shared.test.js +57 -0
- package/vendor/opencli/dist/clis/1688/store.d.ts +45 -0
- package/vendor/opencli/dist/clis/1688/store.js +226 -0
- package/vendor/opencli/dist/clis/1688/store.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/1688/store.test.js +62 -0
- package/vendor/opencli/dist/clis/36kr/article.d.ts +1 -0
- package/vendor/opencli/dist/clis/36kr/article.js +62 -0
- package/vendor/opencli/dist/clis/36kr/hot.d.ts +3 -0
- package/vendor/opencli/dist/clis/36kr/hot.js +80 -0
- package/vendor/opencli/dist/clis/36kr/hot.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/36kr/hot.test.js +15 -0
- package/vendor/opencli/dist/clis/36kr/news.d.ts +1 -0
- package/vendor/opencli/dist/clis/36kr/news.js +51 -0
- package/vendor/opencli/dist/clis/36kr/news.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/36kr/news.test.js +85 -0
- package/vendor/opencli/dist/clis/36kr/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/36kr/search.js +72 -0
- package/vendor/opencli/dist/clis/_shared/common.d.ts +8 -0
- package/vendor/opencli/dist/clis/_shared/common.js +10 -0
- package/vendor/opencli/dist/clis/_shared/desktop-commands.d.ts +22 -0
- package/vendor/opencli/dist/clis/_shared/desktop-commands.js +108 -0
- package/vendor/opencli/dist/clis/amazon/bestsellers.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/bestsellers.js +7 -0
- package/vendor/opencli/dist/clis/amazon/bestsellers.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/bestsellers.test.js +29 -0
- package/vendor/opencli/dist/clis/amazon/discussion.d.ts +20 -0
- package/vendor/opencli/dist/clis/amazon/discussion.js +91 -0
- package/vendor/opencli/dist/clis/amazon/discussion.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/discussion.test.js +36 -0
- package/vendor/opencli/dist/clis/amazon/movers-shakers.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/movers-shakers.js +7 -0
- package/vendor/opencli/dist/clis/amazon/new-releases.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/new-releases.js +7 -0
- package/vendor/opencli/dist/clis/amazon/offer.d.ts +23 -0
- package/vendor/opencli/dist/clis/amazon/offer.js +140 -0
- package/vendor/opencli/dist/clis/amazon/offer.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/offer.test.js +29 -0
- package/vendor/opencli/dist/clis/amazon/product.d.ts +18 -0
- package/vendor/opencli/dist/clis/amazon/product.js +92 -0
- package/vendor/opencli/dist/clis/amazon/product.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/product.test.js +24 -0
- package/vendor/opencli/dist/clis/amazon/rankings.d.ts +59 -0
- package/vendor/opencli/dist/clis/amazon/rankings.js +226 -0
- package/vendor/opencli/dist/clis/amazon/rankings.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/rankings.test.js +41 -0
- package/vendor/opencli/dist/clis/amazon/search.d.ts +18 -0
- package/vendor/opencli/dist/clis/amazon/search.js +87 -0
- package/vendor/opencli/dist/clis/amazon/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/search.test.js +22 -0
- package/vendor/opencli/dist/clis/amazon/shared.d.ts +75 -0
- package/vendor/opencli/dist/clis/amazon/shared.js +365 -0
- package/vendor/opencli/dist/clis/amazon/shared.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/amazon/shared.test.js +44 -0
- package/vendor/opencli/dist/clis/antigravity/dump.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/dump.js +28 -0
- package/vendor/opencli/dist/clis/antigravity/extract-code.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/extract-code.js +32 -0
- package/vendor/opencli/dist/clis/antigravity/model.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/model.js +44 -0
- package/vendor/opencli/dist/clis/antigravity/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/new.js +25 -0
- package/vendor/opencli/dist/clis/antigravity/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/read.js +34 -0
- package/vendor/opencli/dist/clis/antigravity/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/send.js +35 -0
- package/vendor/opencli/dist/clis/antigravity/serve.d.ts +14 -0
- package/vendor/opencli/dist/clis/antigravity/serve.js +512 -0
- package/vendor/opencli/dist/clis/antigravity/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/status.js +18 -0
- package/vendor/opencli/dist/clis/antigravity/watch.d.ts +1 -0
- package/vendor/opencli/dist/clis/antigravity/watch.js +41 -0
- package/vendor/opencli/dist/clis/apple-podcasts/commands.test.d.ts +2 -0
- package/vendor/opencli/dist/clis/apple-podcasts/commands.test.js +99 -0
- package/vendor/opencli/dist/clis/apple-podcasts/episodes.d.ts +1 -0
- package/vendor/opencli/dist/clis/apple-podcasts/episodes.js +28 -0
- package/vendor/opencli/dist/clis/apple-podcasts/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/apple-podcasts/search.js +30 -0
- package/vendor/opencli/dist/clis/apple-podcasts/top.d.ts +1 -0
- package/vendor/opencli/dist/clis/apple-podcasts/top.js +44 -0
- package/vendor/opencli/dist/clis/apple-podcasts/utils.d.ts +11 -0
- package/vendor/opencli/dist/clis/apple-podcasts/utils.js +30 -0
- package/vendor/opencli/dist/clis/apple-podcasts/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/apple-podcasts/utils.test.js +57 -0
- package/vendor/opencli/dist/clis/arxiv/paper.d.ts +1 -0
- package/vendor/opencli/dist/clis/arxiv/paper.js +21 -0
- package/vendor/opencli/dist/clis/arxiv/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/arxiv/search.js +24 -0
- package/vendor/opencli/dist/clis/arxiv/utils.d.ts +18 -0
- package/vendor/opencli/dist/clis/arxiv/utils.js +49 -0
- package/vendor/opencli/dist/clis/band/bands.d.ts +1 -0
- package/vendor/opencli/dist/clis/band/bands.js +72 -0
- package/vendor/opencli/dist/clis/band/mentions.d.ts +1 -0
- package/vendor/opencli/dist/clis/band/mentions.js +127 -0
- package/vendor/opencli/dist/clis/band/post.d.ts +1 -0
- package/vendor/opencli/dist/clis/band/post.js +175 -0
- package/vendor/opencli/dist/clis/band/posts.d.ts +1 -0
- package/vendor/opencli/dist/clis/band/posts.js +94 -0
- package/vendor/opencli/dist/clis/barchart/flow.d.ts +1 -0
- package/vendor/opencli/dist/clis/barchart/flow.js +115 -0
- package/vendor/opencli/dist/clis/barchart/greeks.d.ts +1 -0
- package/vendor/opencli/dist/clis/barchart/greeks.js +119 -0
- package/vendor/opencli/dist/clis/barchart/options.d.ts +1 -0
- package/vendor/opencli/dist/clis/barchart/options.js +106 -0
- package/vendor/opencli/dist/clis/barchart/quote.d.ts +1 -0
- package/vendor/opencli/dist/clis/barchart/quote.js +133 -0
- package/vendor/opencli/dist/clis/bbc/news.d.ts +1 -0
- package/vendor/opencli/dist/clis/bbc/news.js +41 -0
- package/vendor/opencli/dist/clis/bilibili/comments.d.ts +5 -0
- package/vendor/opencli/dist/clis/bilibili/comments.js +40 -0
- package/vendor/opencli/dist/clis/bilibili/comments.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/comments.test.js +83 -0
- package/vendor/opencli/dist/clis/bilibili/download.d.ts +10 -0
- package/vendor/opencli/dist/clis/bilibili/download.js +81 -0
- package/vendor/opencli/dist/clis/bilibili/dynamic.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/dynamic.js +33 -0
- package/vendor/opencli/dist/clis/bilibili/dynamic.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/dynamic.test.js +68 -0
- package/vendor/opencli/dist/clis/bilibili/favorite.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/favorite.js +41 -0
- package/vendor/opencli/dist/clis/bilibili/feed.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/feed.js +64 -0
- package/vendor/opencli/dist/clis/bilibili/following.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/following.js +42 -0
- package/vendor/opencli/dist/clis/bilibili/history.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/history.js +44 -0
- package/vendor/opencli/dist/clis/bilibili/hot.yaml +38 -0
- package/vendor/opencli/dist/clis/bilibili/me.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/me.js +13 -0
- package/vendor/opencli/dist/clis/bilibili/ranking.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/ranking.js +24 -0
- package/vendor/opencli/dist/clis/bilibili/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/search.js +24 -0
- package/vendor/opencli/dist/clis/bilibili/subtitle.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/subtitle.js +92 -0
- package/vendor/opencli/dist/clis/bilibili/subtitle.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/subtitle.test.js +49 -0
- package/vendor/opencli/dist/clis/bilibili/user-videos.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/user-videos.js +38 -0
- package/vendor/opencli/dist/clis/bilibili/utils.d.ts +19 -0
- package/vendor/opencli/dist/clis/bilibili/utils.js +126 -0
- package/vendor/opencli/dist/clis/bilibili/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/bilibili/utils.test.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/businessweek.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/businessweek.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/economics.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/economics.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/feeds.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/feeds.js +15 -0
- package/vendor/opencli/dist/clis/bloomberg/industries.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/industries.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/main.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/main.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/markets.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/markets.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/news.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/news.js +105 -0
- package/vendor/opencli/dist/clis/bloomberg/opinions.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/opinions.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/politics.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/politics.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/tech.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/tech.js +17 -0
- package/vendor/opencli/dist/clis/bloomberg/utils.d.ts +34 -0
- package/vendor/opencli/dist/clis/bloomberg/utils.js +364 -0
- package/vendor/opencli/dist/clis/bloomberg/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/bloomberg/utils.test.js +129 -0
- package/vendor/opencli/dist/clis/bluesky/feeds.yaml +29 -0
- package/vendor/opencli/dist/clis/bluesky/followers.yaml +33 -0
- package/vendor/opencli/dist/clis/bluesky/following.yaml +33 -0
- package/vendor/opencli/dist/clis/bluesky/profile.yaml +27 -0
- package/vendor/opencli/dist/clis/bluesky/search.yaml +34 -0
- package/vendor/opencli/dist/clis/bluesky/starter-packs.yaml +34 -0
- package/vendor/opencli/dist/clis/bluesky/thread.yaml +32 -0
- package/vendor/opencli/dist/clis/bluesky/trending.yaml +27 -0
- package/vendor/opencli/dist/clis/bluesky/user.yaml +34 -0
- package/vendor/opencli/dist/clis/boss/batchgreet.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/batchgreet.js +60 -0
- package/vendor/opencli/dist/clis/boss/chatlist.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/chatlist.js +33 -0
- package/vendor/opencli/dist/clis/boss/chatmsg.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/chatmsg.js +42 -0
- package/vendor/opencli/dist/clis/boss/detail.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/detail.js +62 -0
- package/vendor/opencli/dist/clis/boss/exchange.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/exchange.js +45 -0
- package/vendor/opencli/dist/clis/boss/greet.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/greet.js +48 -0
- package/vendor/opencli/dist/clis/boss/invite.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/invite.js +63 -0
- package/vendor/opencli/dist/clis/boss/joblist.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/joblist.js +30 -0
- package/vendor/opencli/dist/clis/boss/mark.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/mark.js +69 -0
- package/vendor/opencli/dist/clis/boss/recommend.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/recommend.js +44 -0
- package/vendor/opencli/dist/clis/boss/resume.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/resume.js +149 -0
- package/vendor/opencli/dist/clis/boss/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/search.js +155 -0
- package/vendor/opencli/dist/clis/boss/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/send.js +43 -0
- package/vendor/opencli/dist/clis/boss/stats.d.ts +1 -0
- package/vendor/opencli/dist/clis/boss/stats.js +65 -0
- package/vendor/opencli/dist/clis/boss/utils.d.ts +92 -0
- package/vendor/opencli/dist/clis/boss/utils.js +223 -0
- package/vendor/opencli/dist/clis/chaoxing/assignments.d.ts +1 -0
- package/vendor/opencli/dist/clis/chaoxing/assignments.js +75 -0
- package/vendor/opencli/dist/clis/chaoxing/exams.d.ts +1 -0
- package/vendor/opencli/dist/clis/chaoxing/exams.js +74 -0
- package/vendor/opencli/dist/clis/chaoxing/utils.d.ts +58 -0
- package/vendor/opencli/dist/clis/chaoxing/utils.js +223 -0
- package/vendor/opencli/dist/clis/chaoxing/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/chaoxing/utils.test.js +45 -0
- package/vendor/opencli/dist/clis/chatgpt/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatgpt/ask.js +88 -0
- package/vendor/opencli/dist/clis/chatgpt/ax.d.ts +7 -0
- package/vendor/opencli/dist/clis/chatgpt/ax.js +249 -0
- package/vendor/opencli/dist/clis/chatgpt/model.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatgpt/model.js +24 -0
- package/vendor/opencli/dist/clis/chatgpt/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatgpt/new.js +27 -0
- package/vendor/opencli/dist/clis/chatgpt/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatgpt/read.js +31 -0
- package/vendor/opencli/dist/clis/chatgpt/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatgpt/send.js +52 -0
- package/vendor/opencli/dist/clis/chatgpt/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatgpt/status.js +25 -0
- package/vendor/opencli/dist/clis/chatwise/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/ask.js +80 -0
- package/vendor/opencli/dist/clis/chatwise/export.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/export.js +46 -0
- package/vendor/opencli/dist/clis/chatwise/history.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/history.js +60 -0
- package/vendor/opencli/dist/clis/chatwise/model.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/model.js +84 -0
- package/vendor/opencli/dist/clis/chatwise/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/new.js +2 -0
- package/vendor/opencli/dist/clis/chatwise/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/read.js +39 -0
- package/vendor/opencli/dist/clis/chatwise/screenshot.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/screenshot.js +2 -0
- package/vendor/opencli/dist/clis/chatwise/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/send.js +49 -0
- package/vendor/opencli/dist/clis/chatwise/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/chatwise/status.js +2 -0
- package/vendor/opencli/dist/clis/codex/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/ask.js +71 -0
- package/vendor/opencli/dist/clis/codex/dump.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/dump.js +2 -0
- package/vendor/opencli/dist/clis/codex/export.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/export.js +37 -0
- package/vendor/opencli/dist/clis/codex/extract-diff.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/extract-diff.js +44 -0
- package/vendor/opencli/dist/clis/codex/history.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/history.js +43 -0
- package/vendor/opencli/dist/clis/codex/model.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/model.js +55 -0
- package/vendor/opencli/dist/clis/codex/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/new.js +2 -0
- package/vendor/opencli/dist/clis/codex/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/read.js +34 -0
- package/vendor/opencli/dist/clis/codex/screenshot.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/screenshot.js +2 -0
- package/vendor/opencli/dist/clis/codex/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/send.js +43 -0
- package/vendor/opencli/dist/clis/codex/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/codex/status.js +2 -0
- package/vendor/opencli/dist/clis/coupang/add-to-cart.d.ts +1 -0
- package/vendor/opencli/dist/clis/coupang/add-to-cart.js +140 -0
- package/vendor/opencli/dist/clis/coupang/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/coupang/search.js +451 -0
- package/vendor/opencli/dist/clis/coupang/utils.d.ts +24 -0
- package/vendor/opencli/dist/clis/coupang/utils.js +262 -0
- package/vendor/opencli/dist/clis/coupang/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/coupang/utils.test.js +62 -0
- package/vendor/opencli/dist/clis/ctrip/search.d.ts +14 -0
- package/vendor/opencli/dist/clis/ctrip/search.js +86 -0
- package/vendor/opencli/dist/clis/ctrip/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/ctrip/search.test.js +64 -0
- package/vendor/opencli/dist/clis/cursor/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/ask.js +70 -0
- package/vendor/opencli/dist/clis/cursor/composer.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/composer.js +42 -0
- package/vendor/opencli/dist/clis/cursor/dump.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/dump.js +2 -0
- package/vendor/opencli/dist/clis/cursor/export.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/export.js +51 -0
- package/vendor/opencli/dist/clis/cursor/extract-code.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/extract-code.js +35 -0
- package/vendor/opencli/dist/clis/cursor/history.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/history.js +43 -0
- package/vendor/opencli/dist/clis/cursor/model.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/model.js +53 -0
- package/vendor/opencli/dist/clis/cursor/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/new.js +2 -0
- package/vendor/opencli/dist/clis/cursor/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/read.js +44 -0
- package/vendor/opencli/dist/clis/cursor/screenshot.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/screenshot.js +2 -0
- package/vendor/opencli/dist/clis/cursor/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/send.js +40 -0
- package/vendor/opencli/dist/clis/cursor/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/cursor/status.js +2 -0
- package/vendor/opencli/dist/clis/devto/tag.yaml +34 -0
- package/vendor/opencli/dist/clis/devto/top.yaml +29 -0
- package/vendor/opencli/dist/clis/devto/user.yaml +33 -0
- package/vendor/opencli/dist/clis/dictionary/examples.yaml +25 -0
- package/vendor/opencli/dist/clis/dictionary/search.yaml +27 -0
- package/vendor/opencli/dist/clis/dictionary/synonyms.yaml +25 -0
- package/vendor/opencli/dist/clis/discord-app/channels.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/channels.js +57 -0
- package/vendor/opencli/dist/clis/discord-app/members.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/members.js +38 -0
- package/vendor/opencli/dist/clis/discord-app/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/read.js +45 -0
- package/vendor/opencli/dist/clis/discord-app/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/search.js +56 -0
- package/vendor/opencli/dist/clis/discord-app/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/send.js +27 -0
- package/vendor/opencli/dist/clis/discord-app/servers.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/servers.js +36 -0
- package/vendor/opencli/dist/clis/discord-app/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/discord-app/status.js +16 -0
- package/vendor/opencli/dist/clis/douban/book-hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/book-hot.js +14 -0
- package/vendor/opencli/dist/clis/douban/download.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/download.js +67 -0
- package/vendor/opencli/dist/clis/douban/download.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/download.test.js +170 -0
- package/vendor/opencli/dist/clis/douban/marks.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/marks.js +115 -0
- package/vendor/opencli/dist/clis/douban/movie-hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/movie-hot.js +14 -0
- package/vendor/opencli/dist/clis/douban/photos.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/photos.js +34 -0
- package/vendor/opencli/dist/clis/douban/reviews.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/reviews.js +106 -0
- package/vendor/opencli/dist/clis/douban/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/search.js +16 -0
- package/vendor/opencli/dist/clis/douban/subject.yaml +107 -0
- package/vendor/opencli/dist/clis/douban/top250.yaml +70 -0
- package/vendor/opencli/dist/clis/douban/utils.d.ts +63 -0
- package/vendor/opencli/dist/clis/douban/utils.js +389 -0
- package/vendor/opencli/dist/clis/douban/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douban/utils.test.js +64 -0
- package/vendor/opencli/dist/clis/doubao/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/ask.js +35 -0
- package/vendor/opencli/dist/clis/doubao/detail.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/detail.js +33 -0
- package/vendor/opencli/dist/clis/doubao/detail.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/detail.test.js +42 -0
- package/vendor/opencli/dist/clis/doubao/history.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/history.js +28 -0
- package/vendor/opencli/dist/clis/doubao/history.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/history.test.js +37 -0
- package/vendor/opencli/dist/clis/doubao/meeting-summary.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/meeting-summary.js +39 -0
- package/vendor/opencli/dist/clis/doubao/meeting-transcript.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/meeting-transcript.js +36 -0
- package/vendor/opencli/dist/clis/doubao/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/new.js +20 -0
- package/vendor/opencli/dist/clis/doubao/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/read.js +19 -0
- package/vendor/opencli/dist/clis/doubao/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/send.js +22 -0
- package/vendor/opencli/dist/clis/doubao/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/status.js +24 -0
- package/vendor/opencli/dist/clis/doubao/utils.d.ts +50 -0
- package/vendor/opencli/dist/clis/doubao/utils.js +901 -0
- package/vendor/opencli/dist/clis/doubao/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao/utils.test.js +24 -0
- package/vendor/opencli/dist/clis/doubao-app/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/ask.js +53 -0
- package/vendor/opencli/dist/clis/doubao-app/dump.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/dump.js +24 -0
- package/vendor/opencli/dist/clis/doubao-app/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/new.js +20 -0
- package/vendor/opencli/dist/clis/doubao-app/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/read.js +18 -0
- package/vendor/opencli/dist/clis/doubao-app/screenshot.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/screenshot.js +18 -0
- package/vendor/opencli/dist/clis/doubao-app/send.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/send.js +27 -0
- package/vendor/opencli/dist/clis/doubao-app/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/doubao-app/status.js +16 -0
- package/vendor/opencli/dist/clis/doubao-app/utils.d.ts +37 -0
- package/vendor/opencli/dist/clis/doubao-app/utils.js +110 -0
- package/vendor/opencli/dist/clis/douyin/_shared/browser-fetch.d.ts +10 -0
- package/vendor/opencli/dist/clis/douyin/_shared/browser-fetch.js +30 -0
- package/vendor/opencli/dist/clis/douyin/_shared/browser-fetch.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/browser-fetch.test.js +30 -0
- package/vendor/opencli/dist/clis/douyin/_shared/creation-id.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/creation-id.js +5 -0
- package/vendor/opencli/dist/clis/douyin/_shared/creation-id.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/creation-id.test.js +22 -0
- package/vendor/opencli/dist/clis/douyin/_shared/imagex-upload.d.ts +20 -0
- package/vendor/opencli/dist/clis/douyin/_shared/imagex-upload.js +53 -0
- package/vendor/opencli/dist/clis/douyin/_shared/imagex-upload.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/imagex-upload.test.js +87 -0
- package/vendor/opencli/dist/clis/douyin/_shared/public-api.d.ts +33 -0
- package/vendor/opencli/dist/clis/douyin/_shared/public-api.js +29 -0
- package/vendor/opencli/dist/clis/douyin/_shared/sts2.d.ts +8 -0
- package/vendor/opencli/dist/clis/douyin/_shared/sts2.js +21 -0
- package/vendor/opencli/dist/clis/douyin/_shared/sts2.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/sts2.test.js +27 -0
- package/vendor/opencli/dist/clis/douyin/_shared/text-extra.d.ts +18 -0
- package/vendor/opencli/dist/clis/douyin/_shared/text-extra.js +15 -0
- package/vendor/opencli/dist/clis/douyin/_shared/text-extra.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/text-extra.test.js +37 -0
- package/vendor/opencli/dist/clis/douyin/_shared/timing.d.ts +2 -0
- package/vendor/opencli/dist/clis/douyin/_shared/timing.js +22 -0
- package/vendor/opencli/dist/clis/douyin/_shared/timing.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/timing.test.js +28 -0
- package/vendor/opencli/dist/clis/douyin/_shared/tos-upload-short-read.test.d.ts +11 -0
- package/vendor/opencli/dist/clis/douyin/_shared/tos-upload-short-read.test.js +83 -0
- package/vendor/opencli/dist/clis/douyin/_shared/tos-upload.d.ts +53 -0
- package/vendor/opencli/dist/clis/douyin/_shared/tos-upload.js +295 -0
- package/vendor/opencli/dist/clis/douyin/_shared/tos-upload.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/tos-upload.test.js +229 -0
- package/vendor/opencli/dist/clis/douyin/_shared/transcode.d.ts +27 -0
- package/vendor/opencli/dist/clis/douyin/_shared/transcode.js +45 -0
- package/vendor/opencli/dist/clis/douyin/_shared/transcode.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/_shared/transcode.test.js +91 -0
- package/vendor/opencli/dist/clis/douyin/_shared/types.d.ts +26 -0
- package/vendor/opencli/dist/clis/douyin/_shared/types.js +1 -0
- package/vendor/opencli/dist/clis/douyin/activities.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/activities.js +22 -0
- package/vendor/opencli/dist/clis/douyin/activities.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/activities.test.js +55 -0
- package/vendor/opencli/dist/clis/douyin/collections.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/collections.js +22 -0
- package/vendor/opencli/dist/clis/douyin/collections.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/collections.test.js +45 -0
- package/vendor/opencli/dist/clis/douyin/delete.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/delete.js +18 -0
- package/vendor/opencli/dist/clis/douyin/delete.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/delete.test.js +11 -0
- package/vendor/opencli/dist/clis/douyin/draft.d.ts +11 -0
- package/vendor/opencli/dist/clis/douyin/draft.js +354 -0
- package/vendor/opencli/dist/clis/douyin/draft.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/draft.test.js +364 -0
- package/vendor/opencli/dist/clis/douyin/drafts.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/drafts.js +23 -0
- package/vendor/opencli/dist/clis/douyin/drafts.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/drafts.test.js +11 -0
- package/vendor/opencli/dist/clis/douyin/hashtag.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/hashtag.js +52 -0
- package/vendor/opencli/dist/clis/douyin/hashtag.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/hashtag.test.js +58 -0
- package/vendor/opencli/dist/clis/douyin/location.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/location.js +24 -0
- package/vendor/opencli/dist/clis/douyin/location.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/location.test.js +23 -0
- package/vendor/opencli/dist/clis/douyin/profile.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/profile.js +28 -0
- package/vendor/opencli/dist/clis/douyin/profile.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/profile.test.js +46 -0
- package/vendor/opencli/dist/clis/douyin/publish.d.ts +14 -0
- package/vendor/opencli/dist/clis/douyin/publish.js +288 -0
- package/vendor/opencli/dist/clis/douyin/publish.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/publish.test.js +38 -0
- package/vendor/opencli/dist/clis/douyin/stats.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/stats.js +27 -0
- package/vendor/opencli/dist/clis/douyin/stats.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/stats.test.js +22 -0
- package/vendor/opencli/dist/clis/douyin/update.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/update.js +31 -0
- package/vendor/opencli/dist/clis/douyin/update.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/update.test.js +11 -0
- package/vendor/opencli/dist/clis/douyin/user-videos.d.ts +5 -0
- package/vendor/opencli/dist/clis/douyin/user-videos.js +74 -0
- package/vendor/opencli/dist/clis/douyin/user-videos.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/user-videos.test.js +108 -0
- package/vendor/opencli/dist/clis/douyin/videos.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/videos.js +51 -0
- package/vendor/opencli/dist/clis/douyin/videos.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/douyin/videos.test.js +54 -0
- package/vendor/opencli/dist/clis/facebook/add-friend.yaml +43 -0
- package/vendor/opencli/dist/clis/facebook/events.yaml +44 -0
- package/vendor/opencli/dist/clis/facebook/feed.yaml +63 -0
- package/vendor/opencli/dist/clis/facebook/friends.yaml +42 -0
- package/vendor/opencli/dist/clis/facebook/groups.yaml +50 -0
- package/vendor/opencli/dist/clis/facebook/join-group.yaml +44 -0
- package/vendor/opencli/dist/clis/facebook/memories.yaml +39 -0
- package/vendor/opencli/dist/clis/facebook/notifications.yaml +40 -0
- package/vendor/opencli/dist/clis/facebook/profile.yaml +37 -0
- package/vendor/opencli/dist/clis/facebook/search.test.d.ts +5 -0
- package/vendor/opencli/dist/clis/facebook/search.test.js +58 -0
- package/vendor/opencli/dist/clis/facebook/search.yaml +47 -0
- package/vendor/opencli/dist/clis/gemini/ask.d.ts +1 -0
- package/vendor/opencli/dist/clis/gemini/ask.js +46 -0
- package/vendor/opencli/dist/clis/gemini/ask.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/gemini/ask.test.js +100 -0
- package/vendor/opencli/dist/clis/gemini/image.d.ts +1 -0
- package/vendor/opencli/dist/clis/gemini/image.js +105 -0
- package/vendor/opencli/dist/clis/gemini/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/gemini/new.js +20 -0
- package/vendor/opencli/dist/clis/gemini/reply-state.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/gemini/reply-state.test.js +641 -0
- package/vendor/opencli/dist/clis/gemini/utils.d.ts +77 -0
- package/vendor/opencli/dist/clis/gemini/utils.js +930 -0
- package/vendor/opencli/dist/clis/gemini/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/gemini/utils.test.js +178 -0
- package/vendor/opencli/dist/clis/google/news.d.ts +5 -0
- package/vendor/opencli/dist/clis/google/news.js +58 -0
- package/vendor/opencli/dist/clis/google/search.d.ts +10 -0
- package/vendor/opencli/dist/clis/google/search.js +127 -0
- package/vendor/opencli/dist/clis/google/suggest.d.ts +5 -0
- package/vendor/opencli/dist/clis/google/suggest.js +34 -0
- package/vendor/opencli/dist/clis/google/trends.d.ts +5 -0
- package/vendor/opencli/dist/clis/google/trends.js +38 -0
- package/vendor/opencli/dist/clis/google/utils.d.ts +9 -0
- package/vendor/opencli/dist/clis/google/utils.js +23 -0
- package/vendor/opencli/dist/clis/google/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/google/utils.test.js +75 -0
- package/vendor/opencli/dist/clis/grok/ask.d.ts +19 -0
- package/vendor/opencli/dist/clis/grok/ask.js +292 -0
- package/vendor/opencli/dist/clis/grok/ask.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/grok/ask.test.js +54 -0
- package/vendor/opencli/dist/clis/hackernews/ask.yaml +38 -0
- package/vendor/opencli/dist/clis/hackernews/best.yaml +38 -0
- package/vendor/opencli/dist/clis/hackernews/jobs.yaml +36 -0
- package/vendor/opencli/dist/clis/hackernews/new.yaml +38 -0
- package/vendor/opencli/dist/clis/hackernews/search.yaml +44 -0
- package/vendor/opencli/dist/clis/hackernews/show.yaml +38 -0
- package/vendor/opencli/dist/clis/hackernews/top.yaml +38 -0
- package/vendor/opencli/dist/clis/hackernews/user.yaml +25 -0
- package/vendor/opencli/dist/clis/hf/top.d.ts +1 -0
- package/vendor/opencli/dist/clis/hf/top.js +119 -0
- package/vendor/opencli/dist/clis/hupu/detail.d.ts +1 -0
- package/vendor/opencli/dist/clis/hupu/detail.js +72 -0
- package/vendor/opencli/dist/clis/hupu/hot.yaml +43 -0
- package/vendor/opencli/dist/clis/hupu/like.d.ts +1 -0
- package/vendor/opencli/dist/clis/hupu/like.js +75 -0
- package/vendor/opencli/dist/clis/hupu/reply.d.ts +1 -0
- package/vendor/opencli/dist/clis/hupu/reply.js +71 -0
- package/vendor/opencli/dist/clis/hupu/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/hupu/search.js +59 -0
- package/vendor/opencli/dist/clis/hupu/unlike.d.ts +1 -0
- package/vendor/opencli/dist/clis/hupu/unlike.js +75 -0
- package/vendor/opencli/dist/clis/hupu/utils.d.ts +20 -0
- package/vendor/opencli/dist/clis/hupu/utils.js +319 -0
- package/vendor/opencli/dist/clis/imdb/person.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/person.js +203 -0
- package/vendor/opencli/dist/clis/imdb/reviews.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/reviews.js +88 -0
- package/vendor/opencli/dist/clis/imdb/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/search.js +161 -0
- package/vendor/opencli/dist/clis/imdb/title.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/title.js +93 -0
- package/vendor/opencli/dist/clis/imdb/top.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/top.js +53 -0
- package/vendor/opencli/dist/clis/imdb/trending.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/trending.js +52 -0
- package/vendor/opencli/dist/clis/imdb/utils.d.ts +46 -0
- package/vendor/opencli/dist/clis/imdb/utils.js +285 -0
- package/vendor/opencli/dist/clis/imdb/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/imdb/utils.test.js +88 -0
- package/vendor/opencli/dist/clis/instagram/_shared/private-publish.d.ts +138 -0
- package/vendor/opencli/dist/clis/instagram/_shared/private-publish.js +1030 -0
- package/vendor/opencli/dist/clis/instagram/_shared/private-publish.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/_shared/private-publish.test.js +705 -0
- package/vendor/opencli/dist/clis/instagram/_shared/protocol-capture.d.ts +26 -0
- package/vendor/opencli/dist/clis/instagram/_shared/protocol-capture.js +282 -0
- package/vendor/opencli/dist/clis/instagram/_shared/protocol-capture.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/_shared/protocol-capture.test.js +114 -0
- package/vendor/opencli/dist/clis/instagram/_shared/runtime-info.d.ts +9 -0
- package/vendor/opencli/dist/clis/instagram/_shared/runtime-info.js +81 -0
- package/vendor/opencli/dist/clis/instagram/comment.yaml +52 -0
- package/vendor/opencli/dist/clis/instagram/download.d.ts +16 -0
- package/vendor/opencli/dist/clis/instagram/download.js +225 -0
- package/vendor/opencli/dist/clis/instagram/download.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/download.test.js +118 -0
- package/vendor/opencli/dist/clis/instagram/explore.yaml +43 -0
- package/vendor/opencli/dist/clis/instagram/follow.yaml +41 -0
- package/vendor/opencli/dist/clis/instagram/followers.yaml +51 -0
- package/vendor/opencli/dist/clis/instagram/following.yaml +51 -0
- package/vendor/opencli/dist/clis/instagram/like.yaml +46 -0
- package/vendor/opencli/dist/clis/instagram/note.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/note.js +222 -0
- package/vendor/opencli/dist/clis/instagram/note.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/note.test.js +81 -0
- package/vendor/opencli/dist/clis/instagram/post.d.ts +4 -0
- package/vendor/opencli/dist/clis/instagram/post.js +1496 -0
- package/vendor/opencli/dist/clis/instagram/post.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/post.test.js +1647 -0
- package/vendor/opencli/dist/clis/instagram/profile.yaml +42 -0
- package/vendor/opencli/dist/clis/instagram/reel.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/reel.js +826 -0
- package/vendor/opencli/dist/clis/instagram/reel.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/reel.test.js +167 -0
- package/vendor/opencli/dist/clis/instagram/save.yaml +46 -0
- package/vendor/opencli/dist/clis/instagram/saved.yaml +40 -0
- package/vendor/opencli/dist/clis/instagram/search.yaml +44 -0
- package/vendor/opencli/dist/clis/instagram/story.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/story.js +115 -0
- package/vendor/opencli/dist/clis/instagram/story.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/instagram/story.test.js +167 -0
- package/vendor/opencli/dist/clis/instagram/unfollow.yaml +38 -0
- package/vendor/opencli/dist/clis/instagram/unlike.yaml +46 -0
- package/vendor/opencli/dist/clis/instagram/unsave.yaml +46 -0
- package/vendor/opencli/dist/clis/instagram/user.yaml +54 -0
- package/vendor/opencli/dist/clis/jd/item.d.ts +5 -0
- package/vendor/opencli/dist/clis/jd/item.js +97 -0
- package/vendor/opencli/dist/clis/jd/item.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/jd/item.test.js +43 -0
- package/vendor/opencli/dist/clis/jike/comment.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/comment.js +106 -0
- package/vendor/opencli/dist/clis/jike/create.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/create.js +105 -0
- package/vendor/opencli/dist/clis/jike/feed.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/feed.js +66 -0
- package/vendor/opencli/dist/clis/jike/like.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/like.js +60 -0
- package/vendor/opencli/dist/clis/jike/notifications.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/notifications.js +168 -0
- package/vendor/opencli/dist/clis/jike/post.yaml +59 -0
- package/vendor/opencli/dist/clis/jike/repost.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/repost.js +102 -0
- package/vendor/opencli/dist/clis/jike/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/jike/search.js +66 -0
- package/vendor/opencli/dist/clis/jike/topic.yaml +53 -0
- package/vendor/opencli/dist/clis/jike/user.yaml +52 -0
- package/vendor/opencli/dist/clis/jike/utils.d.ts +19 -0
- package/vendor/opencli/dist/clis/jike/utils.js +25 -0
- package/vendor/opencli/dist/clis/jimeng/generate.yaml +85 -0
- package/vendor/opencli/dist/clis/jimeng/history.yaml +46 -0
- package/vendor/opencli/dist/clis/linkedin/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/linkedin/search.js +367 -0
- package/vendor/opencli/dist/clis/linkedin/timeline.d.ts +21 -0
- package/vendor/opencli/dist/clis/linkedin/timeline.js +503 -0
- package/vendor/opencli/dist/clis/linkedin/timeline.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/linkedin/timeline.test.js +81 -0
- package/vendor/opencli/dist/clis/linux-do/categories.yaml +70 -0
- package/vendor/opencli/dist/clis/linux-do/category.d.ts +1 -0
- package/vendor/opencli/dist/clis/linux-do/category.js +36 -0
- package/vendor/opencli/dist/clis/linux-do/feed.d.ts +45 -0
- package/vendor/opencli/dist/clis/linux-do/feed.js +397 -0
- package/vendor/opencli/dist/clis/linux-do/feed.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/linux-do/feed.test.js +118 -0
- package/vendor/opencli/dist/clis/linux-do/hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/linux-do/hot.js +25 -0
- package/vendor/opencli/dist/clis/linux-do/latest.d.ts +1 -0
- package/vendor/opencli/dist/clis/linux-do/latest.js +18 -0
- package/vendor/opencli/dist/clis/linux-do/search.yaml +48 -0
- package/vendor/opencli/dist/clis/linux-do/tags.yaml +41 -0
- package/vendor/opencli/dist/clis/linux-do/topic.yaml +77 -0
- package/vendor/opencli/dist/clis/linux-do/user-posts.yaml +67 -0
- package/vendor/opencli/dist/clis/linux-do/user-topics.yaml +54 -0
- package/vendor/opencli/dist/clis/lobsters/active.yaml +29 -0
- package/vendor/opencli/dist/clis/lobsters/hot.yaml +29 -0
- package/vendor/opencli/dist/clis/lobsters/newest.yaml +29 -0
- package/vendor/opencli/dist/clis/lobsters/tag.yaml +34 -0
- package/vendor/opencli/dist/clis/medium/feed.d.ts +1 -0
- package/vendor/opencli/dist/clis/medium/feed.js +15 -0
- package/vendor/opencli/dist/clis/medium/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/medium/search.js +15 -0
- package/vendor/opencli/dist/clis/medium/user.d.ts +1 -0
- package/vendor/opencli/dist/clis/medium/user.js +15 -0
- package/vendor/opencli/dist/clis/medium/utils.d.ts +5 -0
- package/vendor/opencli/dist/clis/medium/utils.js +79 -0
- package/vendor/opencli/dist/clis/notebooklm/compat.test.d.ts +3 -0
- package/vendor/opencli/dist/clis/notebooklm/compat.test.js +16 -0
- package/vendor/opencli/dist/clis/notebooklm/current.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/current.js +27 -0
- package/vendor/opencli/dist/clis/notebooklm/get.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/get.js +36 -0
- package/vendor/opencli/dist/clis/notebooklm/history.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/history.js +24 -0
- package/vendor/opencli/dist/clis/notebooklm/history.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/history.test.js +58 -0
- package/vendor/opencli/dist/clis/notebooklm/list.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/list.js +35 -0
- package/vendor/opencli/dist/clis/notebooklm/note-list.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/note-list.js +27 -0
- package/vendor/opencli/dist/clis/notebooklm/note-list.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/note-list.test.js +56 -0
- package/vendor/opencli/dist/clis/notebooklm/notes-get.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/notes-get.js +46 -0
- package/vendor/opencli/dist/clis/notebooklm/notes-get.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/notes-get.test.js +72 -0
- package/vendor/opencli/dist/clis/notebooklm/open.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/open.js +41 -0
- package/vendor/opencli/dist/clis/notebooklm/open.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/open.test.js +63 -0
- package/vendor/opencli/dist/clis/notebooklm/rpc.d.ts +36 -0
- package/vendor/opencli/dist/clis/notebooklm/rpc.js +189 -0
- package/vendor/opencli/dist/clis/notebooklm/rpc.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/rpc.test.js +105 -0
- package/vendor/opencli/dist/clis/notebooklm/shared.d.ts +87 -0
- package/vendor/opencli/dist/clis/notebooklm/shared.js +3 -0
- package/vendor/opencli/dist/clis/notebooklm/source-fulltext.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-fulltext.js +43 -0
- package/vendor/opencli/dist/clis/notebooklm/source-fulltext.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-fulltext.test.js +106 -0
- package/vendor/opencli/dist/clis/notebooklm/source-get.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-get.js +39 -0
- package/vendor/opencli/dist/clis/notebooklm/source-get.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-get.test.js +84 -0
- package/vendor/opencli/dist/clis/notebooklm/source-guide.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-guide.js +43 -0
- package/vendor/opencli/dist/clis/notebooklm/source-guide.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-guide.test.js +104 -0
- package/vendor/opencli/dist/clis/notebooklm/source-list.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/source-list.js +29 -0
- package/vendor/opencli/dist/clis/notebooklm/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/status.js +30 -0
- package/vendor/opencli/dist/clis/notebooklm/summary.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/summary.js +29 -0
- package/vendor/opencli/dist/clis/notebooklm/summary.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/summary.test.js +78 -0
- package/vendor/opencli/dist/clis/notebooklm/utils.d.ts +38 -0
- package/vendor/opencli/dist/clis/notebooklm/utils.js +738 -0
- package/vendor/opencli/dist/clis/notebooklm/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/notebooklm/utils.test.js +390 -0
- package/vendor/opencli/dist/clis/notion/export.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/export.js +31 -0
- package/vendor/opencli/dist/clis/notion/favorites.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/favorites.js +84 -0
- package/vendor/opencli/dist/clis/notion/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/new.js +34 -0
- package/vendor/opencli/dist/clis/notion/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/read.js +30 -0
- package/vendor/opencli/dist/clis/notion/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/search.js +46 -0
- package/vendor/opencli/dist/clis/notion/sidebar.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/sidebar.js +41 -0
- package/vendor/opencli/dist/clis/notion/status.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/status.js +16 -0
- package/vendor/opencli/dist/clis/notion/write.d.ts +1 -0
- package/vendor/opencli/dist/clis/notion/write.js +40 -0
- package/vendor/opencli/dist/clis/ones/common.d.ts +32 -0
- package/vendor/opencli/dist/clis/ones/common.js +144 -0
- package/vendor/opencli/dist/clis/ones/enrich-tasks.d.ts +5 -0
- package/vendor/opencli/dist/clis/ones/enrich-tasks.js +37 -0
- package/vendor/opencli/dist/clis/ones/login.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/login.js +80 -0
- package/vendor/opencli/dist/clis/ones/logout.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/logout.js +17 -0
- package/vendor/opencli/dist/clis/ones/me.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/me.js +30 -0
- package/vendor/opencli/dist/clis/ones/my-tasks.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/my-tasks.js +120 -0
- package/vendor/opencli/dist/clis/ones/resolve-labels.d.ts +10 -0
- package/vendor/opencli/dist/clis/ones/resolve-labels.js +64 -0
- package/vendor/opencli/dist/clis/ones/task-helpers.d.ts +29 -0
- package/vendor/opencli/dist/clis/ones/task-helpers.js +212 -0
- package/vendor/opencli/dist/clis/ones/task-helpers.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/task-helpers.test.js +12 -0
- package/vendor/opencli/dist/clis/ones/task.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/task.js +66 -0
- package/vendor/opencli/dist/clis/ones/tasks.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/tasks.js +79 -0
- package/vendor/opencli/dist/clis/ones/token-info.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/token-info.js +42 -0
- package/vendor/opencli/dist/clis/ones/worklog.d.ts +11 -0
- package/vendor/opencli/dist/clis/ones/worklog.js +267 -0
- package/vendor/opencli/dist/clis/ones/worklog.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/ones/worklog.test.js +20 -0
- package/vendor/opencli/dist/clis/paperreview/commands.test.d.ts +3 -0
- package/vendor/opencli/dist/clis/paperreview/commands.test.js +243 -0
- package/vendor/opencli/dist/clis/paperreview/feedback.d.ts +1 -0
- package/vendor/opencli/dist/clis/paperreview/feedback.js +52 -0
- package/vendor/opencli/dist/clis/paperreview/review.d.ts +1 -0
- package/vendor/opencli/dist/clis/paperreview/review.js +37 -0
- package/vendor/opencli/dist/clis/paperreview/submit.d.ts +1 -0
- package/vendor/opencli/dist/clis/paperreview/submit.js +85 -0
- package/vendor/opencli/dist/clis/paperreview/utils.d.ts +46 -0
- package/vendor/opencli/dist/clis/paperreview/utils.js +197 -0
- package/vendor/opencli/dist/clis/paperreview/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/paperreview/utils.test.js +49 -0
- package/vendor/opencli/dist/clis/pixiv/detail.yaml +49 -0
- package/vendor/opencli/dist/clis/pixiv/download.d.ts +7 -0
- package/vendor/opencli/dist/clis/pixiv/download.js +78 -0
- package/vendor/opencli/dist/clis/pixiv/download.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/pixiv/download.test.js +87 -0
- package/vendor/opencli/dist/clis/pixiv/illusts.d.ts +8 -0
- package/vendor/opencli/dist/clis/pixiv/illusts.js +65 -0
- package/vendor/opencli/dist/clis/pixiv/illusts.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/pixiv/illusts.test.js +99 -0
- package/vendor/opencli/dist/clis/pixiv/ranking.yaml +53 -0
- package/vendor/opencli/dist/clis/pixiv/search.d.ts +6 -0
- package/vendor/opencli/dist/clis/pixiv/search.js +43 -0
- package/vendor/opencli/dist/clis/pixiv/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/pixiv/search.test.js +83 -0
- package/vendor/opencli/dist/clis/pixiv/test-utils.d.ts +12 -0
- package/vendor/opencli/dist/clis/pixiv/test-utils.js +23 -0
- package/vendor/opencli/dist/clis/pixiv/user.yaml +46 -0
- package/vendor/opencli/dist/clis/pixiv/utils.d.ts +27 -0
- package/vendor/opencli/dist/clis/pixiv/utils.js +49 -0
- package/vendor/opencli/dist/clis/producthunt/browse.d.ts +1 -0
- package/vendor/opencli/dist/clis/producthunt/browse.js +99 -0
- package/vendor/opencli/dist/clis/producthunt/hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/producthunt/hot.js +110 -0
- package/vendor/opencli/dist/clis/producthunt/posts.d.ts +1 -0
- package/vendor/opencli/dist/clis/producthunt/posts.js +28 -0
- package/vendor/opencli/dist/clis/producthunt/today.d.ts +1 -0
- package/vendor/opencli/dist/clis/producthunt/today.js +35 -0
- package/vendor/opencli/dist/clis/producthunt/utils.d.ts +29 -0
- package/vendor/opencli/dist/clis/producthunt/utils.js +99 -0
- package/vendor/opencli/dist/clis/producthunt/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/producthunt/utils.test.js +64 -0
- package/vendor/opencli/dist/clis/reddit/comment.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/comment.js +57 -0
- package/vendor/opencli/dist/clis/reddit/frontpage.yaml +30 -0
- package/vendor/opencli/dist/clis/reddit/hot.yaml +47 -0
- package/vendor/opencli/dist/clis/reddit/popular.yaml +40 -0
- package/vendor/opencli/dist/clis/reddit/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/read.js +184 -0
- package/vendor/opencli/dist/clis/reddit/read.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/read.test.js +28 -0
- package/vendor/opencli/dist/clis/reddit/save.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/save.js +51 -0
- package/vendor/opencli/dist/clis/reddit/saved.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/saved.js +49 -0
- package/vendor/opencli/dist/clis/reddit/search.yaml +61 -0
- package/vendor/opencli/dist/clis/reddit/subreddit.yaml +50 -0
- package/vendor/opencli/dist/clis/reddit/subscribe.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/subscribe.js +50 -0
- package/vendor/opencli/dist/clis/reddit/upvote.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/upvote.js +64 -0
- package/vendor/opencli/dist/clis/reddit/upvoted.d.ts +1 -0
- package/vendor/opencli/dist/clis/reddit/upvoted.js +49 -0
- package/vendor/opencli/dist/clis/reddit/user-comments.yaml +46 -0
- package/vendor/opencli/dist/clis/reddit/user-posts.yaml +44 -0
- package/vendor/opencli/dist/clis/reddit/user.yaml +40 -0
- package/vendor/opencli/dist/clis/reuters/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/reuters/search.js +51 -0
- package/vendor/opencli/dist/clis/sinablog/article.d.ts +1 -0
- package/vendor/opencli/dist/clis/sinablog/article.js +14 -0
- package/vendor/opencli/dist/clis/sinablog/hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/sinablog/hot.js +14 -0
- package/vendor/opencli/dist/clis/sinablog/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/sinablog/search.js +51 -0
- package/vendor/opencli/dist/clis/sinablog/user.d.ts +1 -0
- package/vendor/opencli/dist/clis/sinablog/user.js +15 -0
- package/vendor/opencli/dist/clis/sinablog/utils.d.ts +7 -0
- package/vendor/opencli/dist/clis/sinablog/utils.js +186 -0
- package/vendor/opencli/dist/clis/sinafinance/news.d.ts +7 -0
- package/vendor/opencli/dist/clis/sinafinance/news.js +61 -0
- package/vendor/opencli/dist/clis/sinafinance/rolling-news.d.ts +4 -0
- package/vendor/opencli/dist/clis/sinafinance/rolling-news.js +40 -0
- package/vendor/opencli/dist/clis/sinafinance/stock-rank.d.ts +4 -0
- package/vendor/opencli/dist/clis/sinafinance/stock-rank.js +65 -0
- package/vendor/opencli/dist/clis/sinafinance/stock.d.ts +8 -0
- package/vendor/opencli/dist/clis/sinafinance/stock.js +117 -0
- package/vendor/opencli/dist/clis/smzdm/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/smzdm/search.js +54 -0
- package/vendor/opencli/dist/clis/spotify/spotify.d.ts +1 -0
- package/vendor/opencli/dist/clis/spotify/spotify.js +316 -0
- package/vendor/opencli/dist/clis/spotify/utils.d.ts +21 -0
- package/vendor/opencli/dist/clis/spotify/utils.js +66 -0
- package/vendor/opencli/dist/clis/spotify/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/spotify/utils.test.js +67 -0
- package/vendor/opencli/dist/clis/stackoverflow/bounties.yaml +29 -0
- package/vendor/opencli/dist/clis/stackoverflow/hot.yaml +28 -0
- package/vendor/opencli/dist/clis/stackoverflow/search.yaml +33 -0
- package/vendor/opencli/dist/clis/stackoverflow/unanswered.yaml +28 -0
- package/vendor/opencli/dist/clis/steam/top-sellers.yaml +29 -0
- package/vendor/opencli/dist/clis/substack/feed.d.ts +1 -0
- package/vendor/opencli/dist/clis/substack/feed.js +15 -0
- package/vendor/opencli/dist/clis/substack/publication.d.ts +1 -0
- package/vendor/opencli/dist/clis/substack/publication.js +15 -0
- package/vendor/opencli/dist/clis/substack/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/substack/search.js +78 -0
- package/vendor/opencli/dist/clis/substack/utils.d.ts +8 -0
- package/vendor/opencli/dist/clis/substack/utils.js +136 -0
- package/vendor/opencli/dist/clis/substack/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/substack/utils.test.js +44 -0
- package/vendor/opencli/dist/clis/tieba/commands.test.d.ts +4 -0
- package/vendor/opencli/dist/clis/tieba/commands.test.js +79 -0
- package/vendor/opencli/dist/clis/tieba/hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/tieba/hot.js +48 -0
- package/vendor/opencli/dist/clis/tieba/posts.d.ts +1 -0
- package/vendor/opencli/dist/clis/tieba/posts.js +85 -0
- package/vendor/opencli/dist/clis/tieba/read.d.ts +1 -0
- package/vendor/opencli/dist/clis/tieba/read.js +140 -0
- package/vendor/opencli/dist/clis/tieba/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/tieba/search.js +108 -0
- package/vendor/opencli/dist/clis/tieba/utils.d.ts +101 -0
- package/vendor/opencli/dist/clis/tieba/utils.js +240 -0
- package/vendor/opencli/dist/clis/tieba/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/tieba/utils.test.js +290 -0
- package/vendor/opencli/dist/clis/tiktok/comment.yaml +66 -0
- package/vendor/opencli/dist/clis/tiktok/explore.yaml +39 -0
- package/vendor/opencli/dist/clis/tiktok/follow.yaml +39 -0
- package/vendor/opencli/dist/clis/tiktok/following.yaml +46 -0
- package/vendor/opencli/dist/clis/tiktok/friends.yaml +47 -0
- package/vendor/opencli/dist/clis/tiktok/like.yaml +38 -0
- package/vendor/opencli/dist/clis/tiktok/live.yaml +51 -0
- package/vendor/opencli/dist/clis/tiktok/notifications.yaml +52 -0
- package/vendor/opencli/dist/clis/tiktok/profile.yaml +45 -0
- package/vendor/opencli/dist/clis/tiktok/save.yaml +34 -0
- package/vendor/opencli/dist/clis/tiktok/search.yaml +47 -0
- package/vendor/opencli/dist/clis/tiktok/unfollow.yaml +44 -0
- package/vendor/opencli/dist/clis/tiktok/unlike.yaml +38 -0
- package/vendor/opencli/dist/clis/tiktok/unsave.yaml +36 -0
- package/vendor/opencli/dist/clis/tiktok/user.yaml +44 -0
- package/vendor/opencli/dist/clis/twitter/accept.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/accept.js +203 -0
- package/vendor/opencli/dist/clis/twitter/article.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/article.js +163 -0
- package/vendor/opencli/dist/clis/twitter/block.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/block.js +89 -0
- package/vendor/opencli/dist/clis/twitter/bookmark.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/bookmark.js +64 -0
- package/vendor/opencli/dist/clis/twitter/bookmarks.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/bookmarks.js +172 -0
- package/vendor/opencli/dist/clis/twitter/delete.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/delete.js +73 -0
- package/vendor/opencli/dist/clis/twitter/download.d.ts +8 -0
- package/vendor/opencli/dist/clis/twitter/download.js +110 -0
- package/vendor/opencli/dist/clis/twitter/follow.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/follow.js +66 -0
- package/vendor/opencli/dist/clis/twitter/followers.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/followers.js +102 -0
- package/vendor/opencli/dist/clis/twitter/following.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/following.js +95 -0
- package/vendor/opencli/dist/clis/twitter/hide-reply.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/hide-reply.js +67 -0
- package/vendor/opencli/dist/clis/twitter/like.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/like.js +69 -0
- package/vendor/opencli/dist/clis/twitter/likes.d.ts +24 -0
- package/vendor/opencli/dist/clis/twitter/likes.js +217 -0
- package/vendor/opencli/dist/clis/twitter/likes.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/likes.test.js +85 -0
- package/vendor/opencli/dist/clis/twitter/notifications.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/notifications.js +127 -0
- package/vendor/opencli/dist/clis/twitter/post.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/post.js +98 -0
- package/vendor/opencli/dist/clis/twitter/post.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/post.test.js +116 -0
- package/vendor/opencli/dist/clis/twitter/profile.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/profile.js +103 -0
- package/vendor/opencli/dist/clis/twitter/reply-dm.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/reply-dm.js +182 -0
- package/vendor/opencli/dist/clis/twitter/reply.d.ts +13 -0
- package/vendor/opencli/dist/clis/twitter/reply.js +280 -0
- package/vendor/opencli/dist/clis/twitter/reply.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/reply.test.js +151 -0
- package/vendor/opencli/dist/clis/twitter/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/search.js +169 -0
- package/vendor/opencli/dist/clis/twitter/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/search.test.js +236 -0
- package/vendor/opencli/dist/clis/twitter/shared.d.ts +6 -0
- package/vendor/opencli/dist/clis/twitter/shared.js +35 -0
- package/vendor/opencli/dist/clis/twitter/thread.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/thread.js +151 -0
- package/vendor/opencli/dist/clis/twitter/timeline.d.ts +24 -0
- package/vendor/opencli/dist/clis/twitter/timeline.js +204 -0
- package/vendor/opencli/dist/clis/twitter/timeline.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/timeline.test.js +102 -0
- package/vendor/opencli/dist/clis/twitter/trending.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/trending.js +60 -0
- package/vendor/opencli/dist/clis/twitter/unblock.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/unblock.js +72 -0
- package/vendor/opencli/dist/clis/twitter/unbookmark.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/unbookmark.js +63 -0
- package/vendor/opencli/dist/clis/twitter/unfollow.d.ts +1 -0
- package/vendor/opencli/dist/clis/twitter/unfollow.js +72 -0
- package/vendor/opencli/dist/clis/v2ex/daily.d.ts +1 -0
- package/vendor/opencli/dist/clis/v2ex/daily.js +98 -0
- package/vendor/opencli/dist/clis/v2ex/hot.yaml +28 -0
- package/vendor/opencli/dist/clis/v2ex/latest.yaml +28 -0
- package/vendor/opencli/dist/clis/v2ex/me.d.ts +1 -0
- package/vendor/opencli/dist/clis/v2ex/me.js +99 -0
- package/vendor/opencli/dist/clis/v2ex/member.yaml +29 -0
- package/vendor/opencli/dist/clis/v2ex/node.yaml +34 -0
- package/vendor/opencli/dist/clis/v2ex/nodes.yaml +31 -0
- package/vendor/opencli/dist/clis/v2ex/notifications.d.ts +1 -0
- package/vendor/opencli/dist/clis/v2ex/notifications.js +71 -0
- package/vendor/opencli/dist/clis/v2ex/replies.yaml +32 -0
- package/vendor/opencli/dist/clis/v2ex/topic.yaml +33 -0
- package/vendor/opencli/dist/clis/v2ex/user.yaml +34 -0
- package/vendor/opencli/dist/clis/web/read.d.ts +16 -0
- package/vendor/opencli/dist/clis/web/read.js +202 -0
- package/vendor/opencli/dist/clis/weibo/comments.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/comments.js +53 -0
- package/vendor/opencli/dist/clis/weibo/feed.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/feed.js +56 -0
- package/vendor/opencli/dist/clis/weibo/hot.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/hot.js +39 -0
- package/vendor/opencli/dist/clis/weibo/me.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/me.js +76 -0
- package/vendor/opencli/dist/clis/weibo/post.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/post.js +75 -0
- package/vendor/opencli/dist/clis/weibo/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/search.js +73 -0
- package/vendor/opencli/dist/clis/weibo/user.d.ts +1 -0
- package/vendor/opencli/dist/clis/weibo/user.js +63 -0
- package/vendor/opencli/dist/clis/weibo/utils.d.ts +6 -0
- package/vendor/opencli/dist/clis/weibo/utils.js +30 -0
- package/vendor/opencli/dist/clis/weixin/download.d.ts +38 -0
- package/vendor/opencli/dist/clis/weixin/download.js +321 -0
- package/vendor/opencli/dist/clis/weread/book.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/book.js +219 -0
- package/vendor/opencli/dist/clis/weread/commands.test.d.ts +3 -0
- package/vendor/opencli/dist/clis/weread/commands.test.js +374 -0
- package/vendor/opencli/dist/clis/weread/highlights.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/highlights.js +23 -0
- package/vendor/opencli/dist/clis/weread/notebooks.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/notebooks.js +21 -0
- package/vendor/opencli/dist/clis/weread/notes.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/notes.js +29 -0
- package/vendor/opencli/dist/clis/weread/private-api-regression.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/private-api-regression.test.js +369 -0
- package/vendor/opencli/dist/clis/weread/ranking.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/ranking.js +28 -0
- package/vendor/opencli/dist/clis/weread/search-regression.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/search-regression.test.js +407 -0
- package/vendor/opencli/dist/clis/weread/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/search.js +162 -0
- package/vendor/opencli/dist/clis/weread/shelf.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/shelf.js +65 -0
- package/vendor/opencli/dist/clis/weread/utils.d.ts +76 -0
- package/vendor/opencli/dist/clis/weread/utils.js +321 -0
- package/vendor/opencli/dist/clis/weread/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/weread/utils.test.js +128 -0
- package/vendor/opencli/dist/clis/wikipedia/random.d.ts +1 -0
- package/vendor/opencli/dist/clis/wikipedia/random.js +19 -0
- package/vendor/opencli/dist/clis/wikipedia/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/wikipedia/search.js +30 -0
- package/vendor/opencli/dist/clis/wikipedia/summary.d.ts +1 -0
- package/vendor/opencli/dist/clis/wikipedia/summary.js +23 -0
- package/vendor/opencli/dist/clis/wikipedia/trending.d.ts +1 -0
- package/vendor/opencli/dist/clis/wikipedia/trending.js +35 -0
- package/vendor/opencli/dist/clis/wikipedia/utils.d.ts +36 -0
- package/vendor/opencli/dist/clis/wikipedia/utils.js +31 -0
- package/vendor/opencli/dist/clis/xianyu/chat.d.ts +7 -0
- package/vendor/opencli/dist/clis/xianyu/chat.js +146 -0
- package/vendor/opencli/dist/clis/xianyu/chat.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xianyu/chat.test.js +15 -0
- package/vendor/opencli/dist/clis/xianyu/item.d.ts +7 -0
- package/vendor/opencli/dist/clis/xianyu/item.js +152 -0
- package/vendor/opencli/dist/clis/xianyu/item.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xianyu/item.test.js +56 -0
- package/vendor/opencli/dist/clis/xianyu/search.d.ts +10 -0
- package/vendor/opencli/dist/clis/xianyu/search.js +134 -0
- package/vendor/opencli/dist/clis/xianyu/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xianyu/search.test.js +17 -0
- package/vendor/opencli/dist/clis/xianyu/utils.d.ts +1 -0
- package/vendor/opencli/dist/clis/xianyu/utils.js +8 -0
- package/vendor/opencli/dist/clis/xiaoe/catalog.yaml +129 -0
- package/vendor/opencli/dist/clis/xiaoe/content.yaml +43 -0
- package/vendor/opencli/dist/clis/xiaoe/courses.yaml +73 -0
- package/vendor/opencli/dist/clis/xiaoe/detail.yaml +39 -0
- package/vendor/opencli/dist/clis/xiaoe/play-url.yaml +124 -0
- package/vendor/opencli/dist/clis/xiaohongshu/comments.d.ts +8 -0
- package/vendor/opencli/dist/clis/xiaohongshu/comments.js +133 -0
- package/vendor/opencli/dist/clis/xiaohongshu/comments.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/comments.test.js +139 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-note-detail.d.ts +84 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-note-detail.js +341 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-note-detail.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-note-detail.test.js +259 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes-summary.d.ts +28 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes-summary.js +92 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes-summary.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes-summary.test.js +49 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes.d.ts +24 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes.js +227 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-notes.test.js +192 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-profile.d.ts +10 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-profile.js +53 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-stats.d.ts +10 -0
- package/vendor/opencli/dist/clis/xiaohongshu/creator-stats.js +73 -0
- package/vendor/opencli/dist/clis/xiaohongshu/download.d.ts +10 -0
- package/vendor/opencli/dist/clis/xiaohongshu/download.js +167 -0
- package/vendor/opencli/dist/clis/xiaohongshu/download.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/download.test.js +73 -0
- package/vendor/opencli/dist/clis/xiaohongshu/feed.yaml +31 -0
- package/vendor/opencli/dist/clis/xiaohongshu/note-helpers.d.ts +12 -0
- package/vendor/opencli/dist/clis/xiaohongshu/note-helpers.js +23 -0
- package/vendor/opencli/dist/clis/xiaohongshu/note.d.ts +7 -0
- package/vendor/opencli/dist/clis/xiaohongshu/note.js +87 -0
- package/vendor/opencli/dist/clis/xiaohongshu/note.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/note.test.js +183 -0
- package/vendor/opencli/dist/clis/xiaohongshu/notifications.yaml +37 -0
- package/vendor/opencli/dist/clis/xiaohongshu/publish.d.ts +18 -0
- package/vendor/opencli/dist/clis/xiaohongshu/publish.js +531 -0
- package/vendor/opencli/dist/clis/xiaohongshu/publish.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/publish.test.js +195 -0
- package/vendor/opencli/dist/clis/xiaohongshu/search.d.ts +15 -0
- package/vendor/opencli/dist/clis/xiaohongshu/search.js +131 -0
- package/vendor/opencli/dist/clis/xiaohongshu/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/search.test.js +160 -0
- package/vendor/opencli/dist/clis/xiaohongshu/user-helpers.d.ts +16 -0
- package/vendor/opencli/dist/clis/xiaohongshu/user-helpers.js +69 -0
- package/vendor/opencli/dist/clis/xiaohongshu/user-helpers.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/user-helpers.test.js +99 -0
- package/vendor/opencli/dist/clis/xiaohongshu/user.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaohongshu/user.js +56 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/episode.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/episode.js +28 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/podcast-episodes.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/podcast-episodes.js +36 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/podcast.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/podcast.js +27 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/utils.d.ts +16 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/utils.js +55 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xiaoyuzhou/utils.test.js +99 -0
- package/vendor/opencli/dist/clis/xueqiu/comments.d.ts +118 -0
- package/vendor/opencli/dist/clis/xueqiu/comments.js +354 -0
- package/vendor/opencli/dist/clis/xueqiu/comments.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xueqiu/comments.test.js +696 -0
- package/vendor/opencli/dist/clis/xueqiu/danjuan-utils.d.ts +55 -0
- package/vendor/opencli/dist/clis/xueqiu/danjuan-utils.js +126 -0
- package/vendor/opencli/dist/clis/xueqiu/danjuan-utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/xueqiu/danjuan-utils.test.js +41 -0
- package/vendor/opencli/dist/clis/xueqiu/earnings-date.yaml +69 -0
- package/vendor/opencli/dist/clis/xueqiu/feed.yaml +53 -0
- package/vendor/opencli/dist/clis/xueqiu/fund-holdings.d.ts +1 -0
- package/vendor/opencli/dist/clis/xueqiu/fund-holdings.js +28 -0
- package/vendor/opencli/dist/clis/xueqiu/fund-snapshot.d.ts +1 -0
- package/vendor/opencli/dist/clis/xueqiu/fund-snapshot.js +25 -0
- package/vendor/opencli/dist/clis/xueqiu/hot-stock.yaml +49 -0
- package/vendor/opencli/dist/clis/xueqiu/hot.yaml +46 -0
- package/vendor/opencli/dist/clis/xueqiu/search.yaml +55 -0
- package/vendor/opencli/dist/clis/xueqiu/stock.yaml +69 -0
- package/vendor/opencli/dist/clis/xueqiu/watchlist.yaml +46 -0
- package/vendor/opencli/dist/clis/yahoo-finance/quote.d.ts +1 -0
- package/vendor/opencli/dist/clis/yahoo-finance/quote.js +72 -0
- package/vendor/opencli/dist/clis/yollomi/background.d.ts +4 -0
- package/vendor/opencli/dist/clis/yollomi/background.js +45 -0
- package/vendor/opencli/dist/clis/yollomi/edit.d.ts +5 -0
- package/vendor/opencli/dist/clis/yollomi/edit.js +56 -0
- package/vendor/opencli/dist/clis/yollomi/face-swap.d.ts +5 -0
- package/vendor/opencli/dist/clis/yollomi/face-swap.js +43 -0
- package/vendor/opencli/dist/clis/yollomi/generate.d.ts +9 -0
- package/vendor/opencli/dist/clis/yollomi/generate.js +100 -0
- package/vendor/opencli/dist/clis/yollomi/models.d.ts +1 -0
- package/vendor/opencli/dist/clis/yollomi/models.js +33 -0
- package/vendor/opencli/dist/clis/yollomi/object-remover.d.ts +4 -0
- package/vendor/opencli/dist/clis/yollomi/object-remover.js +42 -0
- package/vendor/opencli/dist/clis/yollomi/remove-bg.d.ts +4 -0
- package/vendor/opencli/dist/clis/yollomi/remove-bg.js +38 -0
- package/vendor/opencli/dist/clis/yollomi/restore.d.ts +4 -0
- package/vendor/opencli/dist/clis/yollomi/restore.js +38 -0
- package/vendor/opencli/dist/clis/yollomi/try-on.d.ts +4 -0
- package/vendor/opencli/dist/clis/yollomi/try-on.js +46 -0
- package/vendor/opencli/dist/clis/yollomi/upload.d.ts +7 -0
- package/vendor/opencli/dist/clis/yollomi/upload.js +71 -0
- package/vendor/opencli/dist/clis/yollomi/upscale.d.ts +4 -0
- package/vendor/opencli/dist/clis/yollomi/upscale.js +53 -0
- package/vendor/opencli/dist/clis/yollomi/utils.d.ts +45 -0
- package/vendor/opencli/dist/clis/yollomi/utils.js +180 -0
- package/vendor/opencli/dist/clis/yollomi/video.d.ts +5 -0
- package/vendor/opencli/dist/clis/yollomi/video.js +56 -0
- package/vendor/opencli/dist/clis/youtube/channel.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/channel.js +150 -0
- package/vendor/opencli/dist/clis/youtube/comments.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/comments.js +95 -0
- package/vendor/opencli/dist/clis/youtube/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/search.js +99 -0
- package/vendor/opencli/dist/clis/youtube/transcript-group.d.ts +44 -0
- package/vendor/opencli/dist/clis/youtube/transcript-group.js +226 -0
- package/vendor/opencli/dist/clis/youtube/transcript-group.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/transcript-group.test.js +99 -0
- package/vendor/opencli/dist/clis/youtube/transcript.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/transcript.js +263 -0
- package/vendor/opencli/dist/clis/youtube/utils.d.ts +17 -0
- package/vendor/opencli/dist/clis/youtube/utils.js +92 -0
- package/vendor/opencli/dist/clis/youtube/utils.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/utils.test.js +37 -0
- package/vendor/opencli/dist/clis/youtube/video.d.ts +1 -0
- package/vendor/opencli/dist/clis/youtube/video.js +116 -0
- package/vendor/opencli/dist/clis/yuanbao/ask.d.ts +21 -0
- package/vendor/opencli/dist/clis/yuanbao/ask.js +427 -0
- package/vendor/opencli/dist/clis/yuanbao/ask.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/yuanbao/ask.test.js +124 -0
- package/vendor/opencli/dist/clis/yuanbao/new.d.ts +1 -0
- package/vendor/opencli/dist/clis/yuanbao/new.js +70 -0
- package/vendor/opencli/dist/clis/yuanbao/new.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/yuanbao/new.test.js +30 -0
- package/vendor/opencli/dist/clis/yuanbao/shared.d.ts +13 -0
- package/vendor/opencli/dist/clis/yuanbao/shared.js +49 -0
- package/vendor/opencli/dist/clis/zhihu/download.d.ts +7 -0
- package/vendor/opencli/dist/clis/zhihu/download.js +79 -0
- package/vendor/opencli/dist/clis/zhihu/download.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/zhihu/download.test.js +12 -0
- package/vendor/opencli/dist/clis/zhihu/hot.yaml +46 -0
- package/vendor/opencli/dist/clis/zhihu/question.d.ts +1 -0
- package/vendor/opencli/dist/clis/zhihu/question.js +53 -0
- package/vendor/opencli/dist/clis/zhihu/question.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/zhihu/question.test.js +72 -0
- package/vendor/opencli/dist/clis/zhihu/search.yaml +59 -0
- package/vendor/opencli/dist/clis/zsxq/dynamics.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/dynamics.js +47 -0
- package/vendor/opencli/dist/clis/zsxq/groups.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/groups.js +32 -0
- package/vendor/opencli/dist/clis/zsxq/search.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/search.js +43 -0
- package/vendor/opencli/dist/clis/zsxq/search.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/search.test.js +24 -0
- package/vendor/opencli/dist/clis/zsxq/topic.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/topic.js +47 -0
- package/vendor/opencli/dist/clis/zsxq/topic.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/topic.test.js +29 -0
- package/vendor/opencli/dist/clis/zsxq/topics.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/topics.js +25 -0
- package/vendor/opencli/dist/clis/zsxq/topics.test.d.ts +1 -0
- package/vendor/opencli/dist/clis/zsxq/topics.test.js +24 -0
- package/vendor/opencli/dist/clis/zsxq/utils.d.ts +97 -0
- package/vendor/opencli/dist/clis/zsxq/utils.js +230 -0
- package/vendor/opencli/dist/commanderAdapter.d.ts +22 -0
- package/vendor/opencli/dist/commanderAdapter.js +301 -0
- package/vendor/opencli/dist/commanderAdapter.test.d.ts +1 -0
- package/vendor/opencli/dist/commanderAdapter.test.js +244 -0
- package/vendor/opencli/dist/commands/daemon.d.ts +9 -0
- package/vendor/opencli/dist/commands/daemon.js +85 -0
- package/vendor/opencli/dist/commands/daemon.test.d.ts +1 -0
- package/vendor/opencli/dist/commands/daemon.test.js +160 -0
- package/vendor/opencli/dist/completion.d.ts +21 -0
- package/vendor/opencli/dist/completion.js +120 -0
- package/vendor/opencli/dist/completion.test.d.ts +1 -0
- package/vendor/opencli/dist/completion.test.js +23 -0
- package/vendor/opencli/dist/constants.d.ts +17 -0
- package/vendor/opencli/dist/constants.js +34 -0
- package/vendor/opencli/dist/daemon.d.ts +21 -0
- package/vendor/opencli/dist/daemon.js +303 -0
- package/vendor/opencli/dist/daemon.test.d.ts +1 -0
- package/vendor/opencli/dist/daemon.test.js +65 -0
- package/vendor/opencli/dist/discovery.d.ts +31 -0
- package/vendor/opencli/dist/discovery.js +330 -0
- package/vendor/opencli/dist/doctor.d.ts +38 -0
- package/vendor/opencli/dist/doctor.js +126 -0
- package/vendor/opencli/dist/doctor.test.d.ts +1 -0
- package/vendor/opencli/dist/doctor.test.js +91 -0
- package/vendor/opencli/dist/download/article-download.d.ts +59 -0
- package/vendor/opencli/dist/download/article-download.js +178 -0
- package/vendor/opencli/dist/download/index.d.ts +71 -0
- package/vendor/opencli/dist/download/index.js +345 -0
- package/vendor/opencli/dist/download/index.test.d.ts +1 -0
- package/vendor/opencli/dist/download/index.test.js +118 -0
- package/vendor/opencli/dist/download/media-download.d.ts +49 -0
- package/vendor/opencli/dist/download/media-download.js +114 -0
- package/vendor/opencli/dist/download/progress.d.ts +36 -0
- package/vendor/opencli/dist/download/progress.js +111 -0
- package/vendor/opencli/dist/electron-apps.d.ts +31 -0
- package/vendor/opencli/dist/electron-apps.js +71 -0
- package/vendor/opencli/dist/electron-apps.test.d.ts +1 -0
- package/vendor/opencli/dist/electron-apps.test.js +43 -0
- package/vendor/opencli/dist/engine.test.d.ts +1 -0
- package/vendor/opencli/dist/engine.test.js +297 -0
- package/vendor/opencli/dist/errors.d.ts +76 -0
- package/vendor/opencli/dist/errors.js +119 -0
- package/vendor/opencli/dist/errors.test.d.ts +1 -0
- package/vendor/opencli/dist/errors.test.js +59 -0
- package/vendor/opencli/dist/execution.d.ts +14 -0
- package/vendor/opencli/dist/execution.js +209 -0
- package/vendor/opencli/dist/execution.test.d.ts +1 -0
- package/vendor/opencli/dist/execution.test.js +40 -0
- package/vendor/opencli/dist/explore.d.ts +101 -0
- package/vendor/opencli/dist/explore.js +379 -0
- package/vendor/opencli/dist/extension-manifest-regression.test.d.ts +1 -0
- package/vendor/opencli/dist/extension-manifest-regression.test.js +13 -0
- package/vendor/opencli/dist/external-clis.yaml +56 -0
- package/vendor/opencli/dist/external.d.ts +40 -0
- package/vendor/opencli/dist/external.js +209 -0
- package/vendor/opencli/dist/external.test.d.ts +1 -0
- package/vendor/opencli/dist/external.test.js +68 -0
- package/vendor/opencli/dist/generate.d.ts +41 -0
- package/vendor/opencli/dist/generate.js +121 -0
- package/vendor/opencli/dist/hooks.d.ts +46 -0
- package/vendor/opencli/dist/hooks.js +58 -0
- package/vendor/opencli/dist/hooks.test.d.ts +4 -0
- package/vendor/opencli/dist/hooks.test.js +92 -0
- package/vendor/opencli/dist/idle-manager.d.ts +19 -0
- package/vendor/opencli/dist/idle-manager.js +54 -0
- package/vendor/opencli/dist/interceptor.d.ts +42 -0
- package/vendor/opencli/dist/interceptor.js +186 -0
- package/vendor/opencli/dist/interceptor.test.d.ts +4 -0
- package/vendor/opencli/dist/interceptor.test.js +81 -0
- package/vendor/opencli/dist/launcher.d.ts +40 -0
- package/vendor/opencli/dist/launcher.js +208 -0
- package/vendor/opencli/dist/launcher.test.d.ts +1 -0
- package/vendor/opencli/dist/launcher.test.js +138 -0
- package/vendor/opencli/dist/logger.d.ts +22 -0
- package/vendor/opencli/dist/logger.js +47 -0
- package/vendor/opencli/dist/main.d.ts +5 -0
- package/vendor/opencli/dist/main.js +60 -0
- package/vendor/opencli/dist/node-network.d.ts +10 -0
- package/vendor/opencli/dist/node-network.js +174 -0
- package/vendor/opencli/dist/node-network.test.d.ts +1 -0
- package/vendor/opencli/dist/node-network.test.js +55 -0
- package/vendor/opencli/dist/output.d.ts +14 -0
- package/vendor/opencli/dist/output.js +147 -0
- package/vendor/opencli/dist/output.test.d.ts +1 -0
- package/vendor/opencli/dist/output.test.js +62 -0
- package/vendor/opencli/dist/pipeline/executor.d.ts +11 -0
- package/vendor/opencli/dist/pipeline/executor.js +93 -0
- package/vendor/opencli/dist/pipeline/executor.test.d.ts +4 -0
- package/vendor/opencli/dist/pipeline/executor.test.js +173 -0
- package/vendor/opencli/dist/pipeline/index.d.ts +5 -0
- package/vendor/opencli/dist/pipeline/index.js +5 -0
- package/vendor/opencli/dist/pipeline/registry.d.ts +19 -0
- package/vendor/opencli/dist/pipeline/registry.js +43 -0
- package/vendor/opencli/dist/pipeline/steps/browser.d.ts +12 -0
- package/vendor/opencli/dist/pipeline/steps/browser.js +76 -0
- package/vendor/opencli/dist/pipeline/steps/download.d.ts +34 -0
- package/vendor/opencli/dist/pipeline/steps/download.js +263 -0
- package/vendor/opencli/dist/pipeline/steps/download.test.d.ts +1 -0
- package/vendor/opencli/dist/pipeline/steps/download.test.js +100 -0
- package/vendor/opencli/dist/pipeline/steps/fetch.d.ts +5 -0
- package/vendor/opencli/dist/pipeline/steps/fetch.js +142 -0
- package/vendor/opencli/dist/pipeline/steps/fetch.test.d.ts +1 -0
- package/vendor/opencli/dist/pipeline/steps/fetch.test.js +123 -0
- package/vendor/opencli/dist/pipeline/steps/intercept.d.ts +5 -0
- package/vendor/opencli/dist/pipeline/steps/intercept.js +50 -0
- package/vendor/opencli/dist/pipeline/steps/tap.d.ts +12 -0
- package/vendor/opencli/dist/pipeline/steps/tap.js +92 -0
- package/vendor/opencli/dist/pipeline/steps/transform.d.ts +9 -0
- package/vendor/opencli/dist/pipeline/steps/transform.js +70 -0
- package/vendor/opencli/dist/pipeline/template.d.ts +16 -0
- package/vendor/opencli/dist/pipeline/template.js +276 -0
- package/vendor/opencli/dist/pipeline/template.test.d.ts +4 -0
- package/vendor/opencli/dist/pipeline/template.test.js +172 -0
- package/vendor/opencli/dist/pipeline/transform.test.d.ts +4 -0
- package/vendor/opencli/dist/pipeline/transform.test.js +119 -0
- package/vendor/opencli/dist/plugin-manifest.d.ts +70 -0
- package/vendor/opencli/dist/plugin-manifest.js +160 -0
- package/vendor/opencli/dist/plugin-manifest.test.d.ts +4 -0
- package/vendor/opencli/dist/plugin-manifest.test.js +179 -0
- package/vendor/opencli/dist/plugin-scaffold.d.ts +28 -0
- package/vendor/opencli/dist/plugin-scaffold.js +142 -0
- package/vendor/opencli/dist/plugin-scaffold.test.d.ts +4 -0
- package/vendor/opencli/dist/plugin-scaffold.test.js +83 -0
- package/vendor/opencli/dist/plugin.d.ts +145 -0
- package/vendor/opencli/dist/plugin.js +1221 -0
- package/vendor/opencli/dist/plugin.test.d.ts +4 -0
- package/vendor/opencli/dist/plugin.test.js +1312 -0
- package/vendor/opencli/dist/record.d.ts +97 -0
- package/vendor/opencli/dist/record.js +694 -0
- package/vendor/opencli/dist/record.test.d.ts +1 -0
- package/vendor/opencli/dist/record.test.js +293 -0
- package/vendor/opencli/dist/registry-api.d.ts +13 -0
- package/vendor/opencli/dist/registry-api.js +10 -0
- package/vendor/opencli/dist/registry.d.ts +81 -0
- package/vendor/opencli/dist/registry.js +78 -0
- package/vendor/opencli/dist/registry.test.d.ts +4 -0
- package/vendor/opencli/dist/registry.test.js +113 -0
- package/vendor/opencli/dist/runtime-detect.d.ts +21 -0
- package/vendor/opencli/dist/runtime-detect.js +32 -0
- package/vendor/opencli/dist/runtime-detect.test.d.ts +1 -0
- package/vendor/opencli/dist/runtime-detect.test.js +27 -0
- package/vendor/opencli/dist/runtime.d.ts +36 -0
- package/vendor/opencli/dist/runtime.js +61 -0
- package/vendor/opencli/dist/scripts/framework.d.ts +4 -0
- package/vendor/opencli/dist/scripts/framework.js +21 -0
- package/vendor/opencli/dist/scripts/interact.d.ts +4 -0
- package/vendor/opencli/dist/scripts/interact.js +20 -0
- package/vendor/opencli/dist/scripts/store.d.ts +9 -0
- package/vendor/opencli/dist/scripts/store.js +44 -0
- package/vendor/opencli/dist/serialization.d.ts +38 -0
- package/vendor/opencli/dist/serialization.js +78 -0
- package/vendor/opencli/dist/serialization.test.d.ts +1 -0
- package/vendor/opencli/dist/serialization.test.js +39 -0
- package/vendor/opencli/dist/snapshotFormatter.d.ts +11 -0
- package/vendor/opencli/dist/snapshotFormatter.js +338 -0
- package/vendor/opencli/dist/snapshotFormatter.test.d.ts +7 -0
- package/vendor/opencli/dist/snapshotFormatter.test.js +521 -0
- package/vendor/opencli/dist/synthesize.d.ts +103 -0
- package/vendor/opencli/dist/synthesize.js +216 -0
- package/vendor/opencli/dist/tui.d.ts +29 -0
- package/vendor/opencli/dist/tui.js +192 -0
- package/vendor/opencli/dist/tui.test.d.ts +1 -0
- package/vendor/opencli/dist/tui.test.js +19 -0
- package/vendor/opencli/dist/types.d.ts +98 -0
- package/vendor/opencli/dist/types.js +7 -0
- package/vendor/opencli/dist/update-check.d.ts +22 -0
- package/vendor/opencli/dist/update-check.js +112 -0
- package/vendor/opencli/dist/utils.d.ts +11 -0
- package/vendor/opencli/dist/utils.js +33 -0
- package/vendor/opencli/dist/validate.d.ts +14 -0
- package/vendor/opencli/dist/validate.js +96 -0
- package/vendor/opencli/dist/verify.d.ts +26 -0
- package/vendor/opencli/dist/verify.js +67 -0
- package/vendor/opencli/dist/version.d.ts +4 -0
- package/vendor/opencli/dist/version.js +16 -0
- package/vendor/opencli/dist/weixin-download.test.d.ts +1 -0
- package/vendor/opencli/dist/weixin-download.test.js +44 -0
- package/vendor/opencli/dist/yaml-schema.d.ts +29 -0
- package/vendor/opencli/dist/yaml-schema.js +22 -0
|
@@ -0,0 +1,1312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for plugin management: install, uninstall, list, and lock file support.
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
5
|
+
import * as fs from 'node:fs';
|
|
6
|
+
import * as os from 'node:os';
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { pathToFileURL } from 'node:url';
|
|
9
|
+
import { PLUGINS_DIR } from './discovery.js';
|
|
10
|
+
import * as pluginModule from './plugin.js';
|
|
11
|
+
const { mockExecFileSync, mockExecSync } = vi.hoisted(() => ({
|
|
12
|
+
mockExecFileSync: vi.fn(),
|
|
13
|
+
mockExecSync: vi.fn(),
|
|
14
|
+
}));
|
|
15
|
+
const { _getCommitHash, _installDependencies, _postInstallMonorepoLifecycle, _promoteDir, _replaceDir, installPlugin, listPlugins, _readLockFile, _readLockFileWithWriter, _resolveEsbuildBin, uninstallPlugin, updatePlugin, _parseSource, _updateAllPlugins, _validatePluginStructure, _writeLockFile, _writeLockFileWithFs, _isSymlinkSync, _getMonoreposDir, getLockFilePath, _installLocalPlugin, _isLocalPluginSource, _moveDir, _resolvePluginSource, _resolveStoredPluginSource, _toStoredPluginSource, _toLocalPluginSource, } = pluginModule;
|
|
16
|
+
describe('parseSource', () => {
|
|
17
|
+
it('parses github:user/repo format', () => {
|
|
18
|
+
const result = _parseSource('github:ByteYue/opencli-plugin-github-trending');
|
|
19
|
+
expect(result).toEqual({
|
|
20
|
+
type: 'git',
|
|
21
|
+
cloneUrl: 'https://github.com/ByteYue/opencli-plugin-github-trending.git',
|
|
22
|
+
name: 'github-trending',
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
it('parses https URL format', () => {
|
|
26
|
+
const result = _parseSource('https://github.com/ByteYue/opencli-plugin-hot-digest');
|
|
27
|
+
expect(result).toEqual({
|
|
28
|
+
type: 'git',
|
|
29
|
+
cloneUrl: 'https://github.com/ByteYue/opencli-plugin-hot-digest.git',
|
|
30
|
+
name: 'hot-digest',
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
it('strips opencli-plugin- prefix from name', () => {
|
|
34
|
+
const result = _parseSource('github:user/opencli-plugin-my-tool');
|
|
35
|
+
expect(result.name).toBe('my-tool');
|
|
36
|
+
});
|
|
37
|
+
it('keeps name without prefix', () => {
|
|
38
|
+
const result = _parseSource('github:user/awesome-cli');
|
|
39
|
+
expect(result.name).toBe('awesome-cli');
|
|
40
|
+
});
|
|
41
|
+
it('returns null for invalid source', () => {
|
|
42
|
+
expect(_parseSource('invalid')).toBeNull();
|
|
43
|
+
expect(_parseSource('npm:some-package')).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
it('parses file:// local plugin directories', () => {
|
|
46
|
+
const localDir = path.join(os.tmpdir(), 'opencli-plugin-test');
|
|
47
|
+
const fileUrl = pathToFileURL(localDir).href;
|
|
48
|
+
const result = _parseSource(fileUrl);
|
|
49
|
+
expect(result).toEqual({
|
|
50
|
+
type: 'local',
|
|
51
|
+
localPath: localDir,
|
|
52
|
+
name: 'test',
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it('parses plain absolute local plugin directories', () => {
|
|
56
|
+
const localDir = path.join(os.tmpdir(), 'my-plugin');
|
|
57
|
+
const result = _parseSource(localDir);
|
|
58
|
+
expect(result).toEqual({
|
|
59
|
+
type: 'local',
|
|
60
|
+
localPath: localDir,
|
|
61
|
+
name: 'my-plugin',
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
it('strips opencli-plugin- prefix for local paths', () => {
|
|
65
|
+
const localDir = path.join(os.tmpdir(), 'opencli-plugin-foo');
|
|
66
|
+
const result = _parseSource(localDir);
|
|
67
|
+
expect(result.name).toBe('foo');
|
|
68
|
+
});
|
|
69
|
+
// ── Generic git URL support ──
|
|
70
|
+
it('parses ssh:// URLs', () => {
|
|
71
|
+
const result = _parseSource('ssh://git@gitlab.com/team/opencli-plugin-tools.git');
|
|
72
|
+
expect(result).toEqual({
|
|
73
|
+
type: 'git',
|
|
74
|
+
cloneUrl: 'ssh://git@gitlab.com/team/opencli-plugin-tools.git',
|
|
75
|
+
name: 'tools',
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
it('parses ssh:// URLs without .git suffix', () => {
|
|
79
|
+
const result = _parseSource('ssh://git@gitlab.com/team/my-plugin');
|
|
80
|
+
expect(result).toEqual({
|
|
81
|
+
type: 'git',
|
|
82
|
+
cloneUrl: 'ssh://git@gitlab.com/team/my-plugin',
|
|
83
|
+
name: 'my-plugin',
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
it('parses git@ SCP-style URLs', () => {
|
|
87
|
+
const result = _parseSource('git@gitlab.com:team/my-plugin.git');
|
|
88
|
+
expect(result).toEqual({
|
|
89
|
+
type: 'git',
|
|
90
|
+
cloneUrl: 'git@gitlab.com:team/my-plugin.git',
|
|
91
|
+
name: 'my-plugin',
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
it('parses git@ SCP-style URLs and strips opencli-plugin- prefix', () => {
|
|
95
|
+
const result = _parseSource('git@github.com:user/opencli-plugin-awesome.git');
|
|
96
|
+
expect(result).toEqual({
|
|
97
|
+
type: 'git',
|
|
98
|
+
cloneUrl: 'git@github.com:user/opencli-plugin-awesome.git',
|
|
99
|
+
name: 'awesome',
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
it('parses generic HTTPS git URLs (non-GitHub)', () => {
|
|
103
|
+
const result = _parseSource('https://codehub.example.com/Team/App/opencli-plugins-app.git');
|
|
104
|
+
expect(result).toEqual({
|
|
105
|
+
type: 'git',
|
|
106
|
+
cloneUrl: 'https://codehub.example.com/Team/App/opencli-plugins-app.git',
|
|
107
|
+
name: 'opencli-plugins-app',
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
it('parses generic HTTPS git URLs without .git suffix', () => {
|
|
111
|
+
const result = _parseSource('https://gitlab.example.com/org/my-plugin');
|
|
112
|
+
expect(result).toEqual({
|
|
113
|
+
type: 'git',
|
|
114
|
+
cloneUrl: 'https://gitlab.example.com/org/my-plugin.git',
|
|
115
|
+
name: 'my-plugin',
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
it('still prefers GitHub shorthand over generic HTTPS for github.com', () => {
|
|
119
|
+
const result = _parseSource('https://github.com/user/repo');
|
|
120
|
+
// Should be handled by the GitHub-specific matcher (normalizes URL)
|
|
121
|
+
expect(result).toEqual({
|
|
122
|
+
type: 'git',
|
|
123
|
+
cloneUrl: 'https://github.com/user/repo.git',
|
|
124
|
+
name: 'repo',
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
describe('validatePluginStructure', () => {
|
|
129
|
+
const testDir = path.join(PLUGINS_DIR, '__test-validate__');
|
|
130
|
+
beforeEach(() => {
|
|
131
|
+
fs.mkdirSync(testDir, { recursive: true });
|
|
132
|
+
});
|
|
133
|
+
afterEach(() => {
|
|
134
|
+
try {
|
|
135
|
+
fs.rmSync(testDir, { recursive: true });
|
|
136
|
+
}
|
|
137
|
+
catch { }
|
|
138
|
+
});
|
|
139
|
+
it('returns invalid for non-existent directory', () => {
|
|
140
|
+
const res = _validatePluginStructure(path.join(PLUGINS_DIR, '__does_not_exist__'));
|
|
141
|
+
expect(res.valid).toBe(false);
|
|
142
|
+
expect(res.errors[0]).toContain('does not exist');
|
|
143
|
+
});
|
|
144
|
+
it('returns invalid for empty directory', () => {
|
|
145
|
+
const res = _validatePluginStructure(testDir);
|
|
146
|
+
expect(res.valid).toBe(false);
|
|
147
|
+
expect(res.errors[0]).toContain('No command files found');
|
|
148
|
+
});
|
|
149
|
+
it('returns valid for YAML plugin', () => {
|
|
150
|
+
fs.writeFileSync(path.join(testDir, 'cmd.yaml'), 'site: test');
|
|
151
|
+
const res = _validatePluginStructure(testDir);
|
|
152
|
+
expect(res.valid).toBe(true);
|
|
153
|
+
expect(res.errors).toHaveLength(0);
|
|
154
|
+
});
|
|
155
|
+
it('returns valid for JS plugin', () => {
|
|
156
|
+
fs.writeFileSync(path.join(testDir, 'cmd.js'), 'console.log("hi");');
|
|
157
|
+
const res = _validatePluginStructure(testDir);
|
|
158
|
+
expect(res.valid).toBe(true);
|
|
159
|
+
expect(res.errors).toHaveLength(0);
|
|
160
|
+
});
|
|
161
|
+
it('returns invalid for TS plugin without package.json', () => {
|
|
162
|
+
fs.writeFileSync(path.join(testDir, 'cmd.ts'), 'console.log("hi");');
|
|
163
|
+
const res = _validatePluginStructure(testDir);
|
|
164
|
+
expect(res.valid).toBe(false);
|
|
165
|
+
expect(res.errors[0]).toContain('contains .ts files but no package.json');
|
|
166
|
+
});
|
|
167
|
+
it('returns invalid for TS plugin with missing type: module', () => {
|
|
168
|
+
fs.writeFileSync(path.join(testDir, 'cmd.ts'), 'console.log("hi");');
|
|
169
|
+
fs.writeFileSync(path.join(testDir, 'package.json'), JSON.stringify({ name: 'test' }));
|
|
170
|
+
const res = _validatePluginStructure(testDir);
|
|
171
|
+
expect(res.valid).toBe(false);
|
|
172
|
+
expect(res.errors[0]).toContain('must have "type": "module"');
|
|
173
|
+
});
|
|
174
|
+
it('returns valid for TS plugin with correct package.json', () => {
|
|
175
|
+
fs.writeFileSync(path.join(testDir, 'cmd.ts'), 'console.log("hi");');
|
|
176
|
+
fs.writeFileSync(path.join(testDir, 'package.json'), JSON.stringify({ type: 'module' }));
|
|
177
|
+
const res = _validatePluginStructure(testDir);
|
|
178
|
+
expect(res.valid).toBe(true);
|
|
179
|
+
expect(res.errors).toHaveLength(0);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
describe('lock file', () => {
|
|
183
|
+
const backupPath = `${getLockFilePath()}.test-backup`;
|
|
184
|
+
let hadOriginal = false;
|
|
185
|
+
beforeEach(() => {
|
|
186
|
+
hadOriginal = fs.existsSync(getLockFilePath());
|
|
187
|
+
if (hadOriginal) {
|
|
188
|
+
fs.mkdirSync(path.dirname(backupPath), { recursive: true });
|
|
189
|
+
fs.copyFileSync(getLockFilePath(), backupPath);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
afterEach(() => {
|
|
193
|
+
if (hadOriginal) {
|
|
194
|
+
fs.copyFileSync(backupPath, getLockFilePath());
|
|
195
|
+
fs.unlinkSync(backupPath);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
fs.unlinkSync(getLockFilePath());
|
|
200
|
+
}
|
|
201
|
+
catch { }
|
|
202
|
+
});
|
|
203
|
+
it('reads empty lock when file does not exist', () => {
|
|
204
|
+
try {
|
|
205
|
+
fs.unlinkSync(getLockFilePath());
|
|
206
|
+
}
|
|
207
|
+
catch { }
|
|
208
|
+
expect(_readLockFile()).toEqual({});
|
|
209
|
+
});
|
|
210
|
+
it('round-trips lock entries', () => {
|
|
211
|
+
const entries = {
|
|
212
|
+
'test-plugin': {
|
|
213
|
+
source: { kind: 'git', url: 'https://github.com/user/repo.git' },
|
|
214
|
+
commitHash: 'abc1234567890def',
|
|
215
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
216
|
+
},
|
|
217
|
+
'another-plugin': {
|
|
218
|
+
source: { kind: 'git', url: 'https://github.com/user/another.git' },
|
|
219
|
+
commitHash: 'def4567890123abc',
|
|
220
|
+
installedAt: '2025-02-01T00:00:00.000Z',
|
|
221
|
+
updatedAt: '2025-03-01T00:00:00.000Z',
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
_writeLockFile(entries);
|
|
225
|
+
expect(_readLockFile()).toEqual(entries);
|
|
226
|
+
});
|
|
227
|
+
it('handles malformed lock file gracefully', () => {
|
|
228
|
+
fs.mkdirSync(path.dirname(getLockFilePath()), { recursive: true });
|
|
229
|
+
fs.writeFileSync(getLockFilePath(), 'not valid json');
|
|
230
|
+
expect(_readLockFile()).toEqual({});
|
|
231
|
+
});
|
|
232
|
+
it('keeps the previous lockfile contents when atomic rewrite fails', () => {
|
|
233
|
+
const existing = {
|
|
234
|
+
stable: {
|
|
235
|
+
source: { kind: 'git', url: 'https://github.com/user/stable.git' },
|
|
236
|
+
commitHash: 'stable1234567890',
|
|
237
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
_writeLockFile(existing);
|
|
241
|
+
const renameSync = vi.fn(() => {
|
|
242
|
+
throw new Error('rename failed');
|
|
243
|
+
});
|
|
244
|
+
const rmSync = vi.fn(() => undefined);
|
|
245
|
+
expect(() => _writeLockFileWithFs({
|
|
246
|
+
broken: {
|
|
247
|
+
source: { kind: 'git', url: 'https://github.com/user/broken.git' },
|
|
248
|
+
commitHash: 'broken1234567890',
|
|
249
|
+
installedAt: '2025-02-01T00:00:00.000Z',
|
|
250
|
+
},
|
|
251
|
+
}, {
|
|
252
|
+
mkdirSync: fs.mkdirSync,
|
|
253
|
+
writeFileSync: fs.writeFileSync,
|
|
254
|
+
renameSync,
|
|
255
|
+
rmSync,
|
|
256
|
+
})).toThrow('rename failed');
|
|
257
|
+
expect(_readLockFile()).toEqual(existing);
|
|
258
|
+
expect(rmSync).toHaveBeenCalledTimes(1);
|
|
259
|
+
});
|
|
260
|
+
it('migrates legacy string sources to structured sources on read', () => {
|
|
261
|
+
const legacyLocalPath = path.resolve(path.join(os.tmpdir(), 'opencli-legacy-local-plugin'));
|
|
262
|
+
fs.mkdirSync(path.dirname(getLockFilePath()), { recursive: true });
|
|
263
|
+
fs.writeFileSync(getLockFilePath(), JSON.stringify({
|
|
264
|
+
alpha: {
|
|
265
|
+
source: 'https://github.com/user/opencli-plugins.git',
|
|
266
|
+
commitHash: 'abc1234567890def',
|
|
267
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
268
|
+
monorepo: { name: 'opencli-plugins', subPath: 'packages/alpha' },
|
|
269
|
+
},
|
|
270
|
+
beta: {
|
|
271
|
+
source: `local:${legacyLocalPath}`,
|
|
272
|
+
commitHash: 'local',
|
|
273
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
274
|
+
},
|
|
275
|
+
}, null, 2));
|
|
276
|
+
expect(_readLockFile()).toEqual({
|
|
277
|
+
alpha: {
|
|
278
|
+
source: {
|
|
279
|
+
kind: 'monorepo',
|
|
280
|
+
url: 'https://github.com/user/opencli-plugins.git',
|
|
281
|
+
repoName: 'opencli-plugins',
|
|
282
|
+
subPath: 'packages/alpha',
|
|
283
|
+
},
|
|
284
|
+
commitHash: 'abc1234567890def',
|
|
285
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
286
|
+
},
|
|
287
|
+
beta: {
|
|
288
|
+
source: { kind: 'local', path: legacyLocalPath },
|
|
289
|
+
commitHash: 'local',
|
|
290
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
it('returns normalized entries even when migration rewrite fails', () => {
|
|
295
|
+
fs.mkdirSync(path.dirname(getLockFilePath()), { recursive: true });
|
|
296
|
+
fs.writeFileSync(getLockFilePath(), JSON.stringify({
|
|
297
|
+
alpha: {
|
|
298
|
+
source: 'https://github.com/user/opencli-plugins.git',
|
|
299
|
+
commitHash: 'abc1234567890def',
|
|
300
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
301
|
+
monorepo: { name: 'opencli-plugins', subPath: 'packages/alpha' },
|
|
302
|
+
},
|
|
303
|
+
}, null, 2));
|
|
304
|
+
expect(_readLockFileWithWriter(() => {
|
|
305
|
+
throw new Error('disk full');
|
|
306
|
+
})).toEqual({
|
|
307
|
+
alpha: {
|
|
308
|
+
source: {
|
|
309
|
+
kind: 'monorepo',
|
|
310
|
+
url: 'https://github.com/user/opencli-plugins.git',
|
|
311
|
+
repoName: 'opencli-plugins',
|
|
312
|
+
subPath: 'packages/alpha',
|
|
313
|
+
},
|
|
314
|
+
commitHash: 'abc1234567890def',
|
|
315
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
describe('getCommitHash', () => {
|
|
321
|
+
it('returns a hash for a git repo', () => {
|
|
322
|
+
const hash = _getCommitHash(process.cwd());
|
|
323
|
+
expect(hash).toBeDefined();
|
|
324
|
+
expect(hash).toMatch(/^[0-9a-f]{40}$/);
|
|
325
|
+
});
|
|
326
|
+
it('returns undefined for non-git directory', () => {
|
|
327
|
+
expect(_getCommitHash(os.tmpdir())).toBeUndefined();
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
describe('resolveEsbuildBin', () => {
|
|
331
|
+
it('resolves a usable esbuild executable path', () => {
|
|
332
|
+
const binPath = _resolveEsbuildBin();
|
|
333
|
+
expect(binPath).not.toBeNull();
|
|
334
|
+
expect(typeof binPath).toBe('string');
|
|
335
|
+
expect(fs.existsSync(binPath)).toBe(true);
|
|
336
|
+
expect(binPath).toMatch(/esbuild(\.cmd)?$/);
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
describe('listPlugins', () => {
|
|
340
|
+
const testDir = path.join(PLUGINS_DIR, '__test-list-plugin__');
|
|
341
|
+
afterEach(() => {
|
|
342
|
+
try {
|
|
343
|
+
fs.rmSync(testDir, { recursive: true });
|
|
344
|
+
}
|
|
345
|
+
catch { }
|
|
346
|
+
});
|
|
347
|
+
it('lists installed plugins', () => {
|
|
348
|
+
fs.mkdirSync(testDir, { recursive: true });
|
|
349
|
+
fs.writeFileSync(path.join(testDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
350
|
+
const plugins = listPlugins();
|
|
351
|
+
const found = plugins.find(p => p.name === '__test-list-plugin__');
|
|
352
|
+
expect(found).toBeDefined();
|
|
353
|
+
expect(found.commands).toContain('hello');
|
|
354
|
+
});
|
|
355
|
+
it('includes version metadata from the lock file', () => {
|
|
356
|
+
fs.mkdirSync(testDir, { recursive: true });
|
|
357
|
+
fs.writeFileSync(path.join(testDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
358
|
+
const lock = _readLockFile();
|
|
359
|
+
lock['__test-list-plugin__'] = {
|
|
360
|
+
source: { kind: 'git', url: 'https://github.com/user/repo.git' },
|
|
361
|
+
commitHash: 'abcdef1234567890abcdef1234567890abcdef12',
|
|
362
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
363
|
+
};
|
|
364
|
+
_writeLockFile(lock);
|
|
365
|
+
const plugins = listPlugins();
|
|
366
|
+
const found = plugins.find(p => p.name === '__test-list-plugin__');
|
|
367
|
+
expect(found).toBeDefined();
|
|
368
|
+
expect(found.version).toBe('abcdef1');
|
|
369
|
+
expect(found.installedAt).toBe('2025-01-01T00:00:00.000Z');
|
|
370
|
+
delete lock['__test-list-plugin__'];
|
|
371
|
+
_writeLockFile(lock);
|
|
372
|
+
});
|
|
373
|
+
it('returns empty array when no plugins dir', () => {
|
|
374
|
+
const plugins = listPlugins();
|
|
375
|
+
expect(Array.isArray(plugins)).toBe(true);
|
|
376
|
+
});
|
|
377
|
+
it('prefers lockfile source for local symlink plugins', () => {
|
|
378
|
+
const localTarget = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-local-list-'));
|
|
379
|
+
const linkPath = path.join(PLUGINS_DIR, '__test-list-plugin__');
|
|
380
|
+
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
381
|
+
fs.writeFileSync(path.join(localTarget, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
382
|
+
try {
|
|
383
|
+
fs.unlinkSync(linkPath);
|
|
384
|
+
}
|
|
385
|
+
catch { }
|
|
386
|
+
try {
|
|
387
|
+
fs.rmSync(linkPath, { recursive: true, force: true });
|
|
388
|
+
}
|
|
389
|
+
catch { }
|
|
390
|
+
fs.symlinkSync(localTarget, linkPath, 'dir');
|
|
391
|
+
const lock = _readLockFile();
|
|
392
|
+
lock['__test-list-plugin__'] = {
|
|
393
|
+
source: { kind: 'local', path: localTarget },
|
|
394
|
+
commitHash: 'local',
|
|
395
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
396
|
+
};
|
|
397
|
+
_writeLockFile(lock);
|
|
398
|
+
const plugins = listPlugins();
|
|
399
|
+
const found = plugins.find(p => p.name === '__test-list-plugin__');
|
|
400
|
+
expect(found?.source).toBe(`local:${localTarget}`);
|
|
401
|
+
try {
|
|
402
|
+
fs.unlinkSync(linkPath);
|
|
403
|
+
}
|
|
404
|
+
catch { }
|
|
405
|
+
try {
|
|
406
|
+
fs.rmSync(localTarget, { recursive: true, force: true });
|
|
407
|
+
}
|
|
408
|
+
catch { }
|
|
409
|
+
delete lock['__test-list-plugin__'];
|
|
410
|
+
_writeLockFile(lock);
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
describe('uninstallPlugin', () => {
|
|
414
|
+
const testDir = path.join(PLUGINS_DIR, '__test-uninstall__');
|
|
415
|
+
afterEach(() => {
|
|
416
|
+
try {
|
|
417
|
+
fs.rmSync(testDir, { recursive: true });
|
|
418
|
+
}
|
|
419
|
+
catch { }
|
|
420
|
+
});
|
|
421
|
+
it('removes plugin directory', () => {
|
|
422
|
+
fs.mkdirSync(testDir, { recursive: true });
|
|
423
|
+
fs.writeFileSync(path.join(testDir, 'test.yaml'), 'site: test');
|
|
424
|
+
uninstallPlugin('__test-uninstall__');
|
|
425
|
+
expect(fs.existsSync(testDir)).toBe(false);
|
|
426
|
+
});
|
|
427
|
+
it('removes lock entry on uninstall', () => {
|
|
428
|
+
fs.mkdirSync(testDir, { recursive: true });
|
|
429
|
+
fs.writeFileSync(path.join(testDir, 'test.yaml'), 'site: test');
|
|
430
|
+
const lock = _readLockFile();
|
|
431
|
+
lock['__test-uninstall__'] = {
|
|
432
|
+
source: { kind: 'git', url: 'https://github.com/user/repo.git' },
|
|
433
|
+
commitHash: 'abc123',
|
|
434
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
435
|
+
};
|
|
436
|
+
_writeLockFile(lock);
|
|
437
|
+
uninstallPlugin('__test-uninstall__');
|
|
438
|
+
expect(_readLockFile()['__test-uninstall__']).toBeUndefined();
|
|
439
|
+
});
|
|
440
|
+
it('throws for non-existent plugin', () => {
|
|
441
|
+
expect(() => uninstallPlugin('__nonexistent__')).toThrow('not installed');
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
describe('updatePlugin', () => {
|
|
445
|
+
it('throws for non-existent plugin', () => {
|
|
446
|
+
expect(() => updatePlugin('__nonexistent__')).toThrow('not installed');
|
|
447
|
+
});
|
|
448
|
+
it('refreshes local plugins without running git pull', () => {
|
|
449
|
+
const localTarget = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-local-update-'));
|
|
450
|
+
const linkPath = path.join(PLUGINS_DIR, '__test-local-update__');
|
|
451
|
+
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
452
|
+
fs.writeFileSync(path.join(localTarget, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
453
|
+
fs.symlinkSync(localTarget, linkPath, 'dir');
|
|
454
|
+
const lock = _readLockFile();
|
|
455
|
+
lock['__test-local-update__'] = {
|
|
456
|
+
source: { kind: 'local', path: localTarget },
|
|
457
|
+
commitHash: 'local',
|
|
458
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
459
|
+
};
|
|
460
|
+
_writeLockFile(lock);
|
|
461
|
+
mockExecFileSync.mockClear();
|
|
462
|
+
updatePlugin('__test-local-update__');
|
|
463
|
+
expect(mockExecFileSync.mock.calls.some(([cmd, args, opts]) => cmd === 'git'
|
|
464
|
+
&& Array.isArray(args)
|
|
465
|
+
&& args[0] === 'pull'
|
|
466
|
+
&& opts?.cwd === linkPath)).toBe(false);
|
|
467
|
+
const updated = _readLockFile()['__test-local-update__'];
|
|
468
|
+
expect(updated?.source).toEqual({ kind: 'local', path: path.resolve(localTarget) });
|
|
469
|
+
expect(updated?.updatedAt).toBeDefined();
|
|
470
|
+
try {
|
|
471
|
+
fs.unlinkSync(linkPath);
|
|
472
|
+
}
|
|
473
|
+
catch { }
|
|
474
|
+
try {
|
|
475
|
+
fs.rmSync(localTarget, { recursive: true, force: true });
|
|
476
|
+
}
|
|
477
|
+
catch { }
|
|
478
|
+
const finalLock = _readLockFile();
|
|
479
|
+
delete finalLock['__test-local-update__'];
|
|
480
|
+
_writeLockFile(finalLock);
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
vi.mock('node:child_process', () => {
|
|
484
|
+
return {
|
|
485
|
+
execFileSync: mockExecFileSync.mockImplementation((_cmd, args, opts) => {
|
|
486
|
+
if (Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
487
|
+
if (opts?.cwd === os.tmpdir()) {
|
|
488
|
+
throw new Error('not a git repository');
|
|
489
|
+
}
|
|
490
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
491
|
+
}
|
|
492
|
+
if (opts && opts.cwd && String(opts.cwd).endsWith('plugin-b')) {
|
|
493
|
+
throw new Error('Network error');
|
|
494
|
+
}
|
|
495
|
+
return '';
|
|
496
|
+
}),
|
|
497
|
+
execSync: mockExecSync.mockImplementation(() => ''),
|
|
498
|
+
};
|
|
499
|
+
});
|
|
500
|
+
describe('installDependencies', () => {
|
|
501
|
+
beforeEach(() => {
|
|
502
|
+
mockExecFileSync.mockClear();
|
|
503
|
+
mockExecSync.mockClear();
|
|
504
|
+
});
|
|
505
|
+
it('throws when npm install fails', () => {
|
|
506
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-plugin-b-'));
|
|
507
|
+
const failingDir = path.join(tmpDir, 'plugin-b');
|
|
508
|
+
fs.mkdirSync(failingDir, { recursive: true });
|
|
509
|
+
fs.writeFileSync(path.join(failingDir, 'package.json'), JSON.stringify({ name: 'plugin-b' }));
|
|
510
|
+
expect(() => _installDependencies(failingDir)).toThrow('npm install failed');
|
|
511
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
describe('postInstallMonorepoLifecycle', () => {
|
|
515
|
+
let repoDir;
|
|
516
|
+
let subDir;
|
|
517
|
+
beforeEach(() => {
|
|
518
|
+
mockExecFileSync.mockClear();
|
|
519
|
+
mockExecSync.mockClear();
|
|
520
|
+
repoDir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-monorepo-'));
|
|
521
|
+
subDir = path.join(repoDir, 'packages', 'alpha');
|
|
522
|
+
fs.mkdirSync(subDir, { recursive: true });
|
|
523
|
+
fs.writeFileSync(path.join(repoDir, 'package.json'), JSON.stringify({
|
|
524
|
+
name: 'opencli-plugins',
|
|
525
|
+
private: true,
|
|
526
|
+
workspaces: ['packages/*'],
|
|
527
|
+
}));
|
|
528
|
+
fs.writeFileSync(path.join(subDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
529
|
+
});
|
|
530
|
+
afterEach(() => {
|
|
531
|
+
fs.rmSync(repoDir, { recursive: true, force: true });
|
|
532
|
+
});
|
|
533
|
+
it('installs dependencies once at the monorepo root, not in each sub-plugin', () => {
|
|
534
|
+
_postInstallMonorepoLifecycle(repoDir, [subDir]);
|
|
535
|
+
const npmCalls = mockExecFileSync.mock.calls.filter(([cmd, args]) => cmd === 'npm' && Array.isArray(args) && args[0] === 'install');
|
|
536
|
+
expect(npmCalls).toHaveLength(1);
|
|
537
|
+
expect(npmCalls[0][2]).toMatchObject({ cwd: repoDir });
|
|
538
|
+
expect(npmCalls.some(([, , opts]) => opts?.cwd === subDir)).toBe(false);
|
|
539
|
+
});
|
|
540
|
+
});
|
|
541
|
+
describe('updateAllPlugins', () => {
|
|
542
|
+
const testDirA = path.join(PLUGINS_DIR, 'plugin-a');
|
|
543
|
+
const testDirB = path.join(PLUGINS_DIR, 'plugin-b');
|
|
544
|
+
const testDirC = path.join(PLUGINS_DIR, 'plugin-c');
|
|
545
|
+
beforeEach(() => {
|
|
546
|
+
fs.mkdirSync(testDirA, { recursive: true });
|
|
547
|
+
fs.mkdirSync(testDirB, { recursive: true });
|
|
548
|
+
fs.mkdirSync(testDirC, { recursive: true });
|
|
549
|
+
fs.writeFileSync(path.join(testDirA, 'cmd.yaml'), 'site: a');
|
|
550
|
+
fs.writeFileSync(path.join(testDirB, 'cmd.yaml'), 'site: b');
|
|
551
|
+
fs.writeFileSync(path.join(testDirC, 'cmd.yaml'), 'site: c');
|
|
552
|
+
const lock = _readLockFile();
|
|
553
|
+
lock['plugin-a'] = {
|
|
554
|
+
source: { kind: 'git', url: 'https://github.com/user/plugin-a.git' },
|
|
555
|
+
commitHash: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
|
556
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
557
|
+
};
|
|
558
|
+
lock['plugin-b'] = {
|
|
559
|
+
source: { kind: 'git', url: 'https://github.com/user/plugin-b.git' },
|
|
560
|
+
commitHash: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
|
|
561
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
562
|
+
};
|
|
563
|
+
lock['plugin-c'] = {
|
|
564
|
+
source: { kind: 'git', url: 'https://github.com/user/plugin-c.git' },
|
|
565
|
+
commitHash: 'cccccccccccccccccccccccccccccccccccccccc',
|
|
566
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
567
|
+
};
|
|
568
|
+
_writeLockFile(lock);
|
|
569
|
+
});
|
|
570
|
+
afterEach(() => {
|
|
571
|
+
try {
|
|
572
|
+
fs.rmSync(testDirA, { recursive: true });
|
|
573
|
+
}
|
|
574
|
+
catch { }
|
|
575
|
+
try {
|
|
576
|
+
fs.rmSync(testDirB, { recursive: true });
|
|
577
|
+
}
|
|
578
|
+
catch { }
|
|
579
|
+
try {
|
|
580
|
+
fs.rmSync(testDirC, { recursive: true });
|
|
581
|
+
}
|
|
582
|
+
catch { }
|
|
583
|
+
const lock = _readLockFile();
|
|
584
|
+
delete lock['plugin-a'];
|
|
585
|
+
delete lock['plugin-b'];
|
|
586
|
+
delete lock['plugin-c'];
|
|
587
|
+
_writeLockFile(lock);
|
|
588
|
+
vi.clearAllMocks();
|
|
589
|
+
});
|
|
590
|
+
it('collects successes and failures without throwing', () => {
|
|
591
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
592
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
593
|
+
const cloneUrl = String(args[3]);
|
|
594
|
+
const cloneDir = String(args[4]);
|
|
595
|
+
fs.mkdirSync(cloneDir, { recursive: true });
|
|
596
|
+
fs.writeFileSync(path.join(cloneDir, 'cmd.yaml'), 'site: test\nname: hello\n');
|
|
597
|
+
if (cloneUrl.includes('plugin-b')) {
|
|
598
|
+
fs.writeFileSync(path.join(cloneDir, 'package.json'), JSON.stringify({ name: 'plugin-b' }));
|
|
599
|
+
}
|
|
600
|
+
return '';
|
|
601
|
+
}
|
|
602
|
+
if (cmd === 'npm' && Array.isArray(args) && args[0] === 'install') {
|
|
603
|
+
throw new Error('Network error');
|
|
604
|
+
}
|
|
605
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
606
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
607
|
+
}
|
|
608
|
+
return '';
|
|
609
|
+
});
|
|
610
|
+
const results = _updateAllPlugins();
|
|
611
|
+
const resA = results.find(r => r.name === 'plugin-a');
|
|
612
|
+
const resB = results.find(r => r.name === 'plugin-b');
|
|
613
|
+
const resC = results.find(r => r.name === 'plugin-c');
|
|
614
|
+
expect(resA).toBeDefined();
|
|
615
|
+
expect(resA.success).toBe(true);
|
|
616
|
+
expect(resB).toBeDefined();
|
|
617
|
+
expect(resB.success).toBe(false);
|
|
618
|
+
expect(resB.error).toContain('Network error');
|
|
619
|
+
expect(resC).toBeDefined();
|
|
620
|
+
expect(resC.success).toBe(true);
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
// ── Monorepo-specific tests ─────────────────────────────────────────────────
|
|
624
|
+
describe('parseSource with monorepo subplugin', () => {
|
|
625
|
+
it('parses github:user/repo/subplugin format', () => {
|
|
626
|
+
const result = _parseSource('github:ByteYue/opencli-plugins/polymarket');
|
|
627
|
+
expect(result).toEqual({
|
|
628
|
+
type: 'git',
|
|
629
|
+
cloneUrl: 'https://github.com/ByteYue/opencli-plugins.git',
|
|
630
|
+
name: 'opencli-plugins',
|
|
631
|
+
subPlugin: 'polymarket',
|
|
632
|
+
});
|
|
633
|
+
});
|
|
634
|
+
it('strips opencli-plugin- prefix from repo name in subplugin format', () => {
|
|
635
|
+
const result = _parseSource('github:user/opencli-plugin-collection/defi');
|
|
636
|
+
expect(result.name).toBe('collection');
|
|
637
|
+
expect(result.subPlugin).toBe('defi');
|
|
638
|
+
});
|
|
639
|
+
it('still parses github:user/repo without subplugin', () => {
|
|
640
|
+
const result = _parseSource('github:user/my-repo');
|
|
641
|
+
expect(result).toEqual({
|
|
642
|
+
type: 'git',
|
|
643
|
+
cloneUrl: 'https://github.com/user/my-repo.git',
|
|
644
|
+
name: 'my-repo',
|
|
645
|
+
});
|
|
646
|
+
expect(result.subPlugin).toBeUndefined();
|
|
647
|
+
});
|
|
648
|
+
});
|
|
649
|
+
describe('isSymlinkSync', () => {
|
|
650
|
+
let tmpDir;
|
|
651
|
+
beforeEach(() => {
|
|
652
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-symlink-test-'));
|
|
653
|
+
});
|
|
654
|
+
afterEach(() => {
|
|
655
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
656
|
+
});
|
|
657
|
+
it('returns false for a regular directory', () => {
|
|
658
|
+
const dir = path.join(tmpDir, 'regular');
|
|
659
|
+
fs.mkdirSync(dir);
|
|
660
|
+
expect(_isSymlinkSync(dir)).toBe(false);
|
|
661
|
+
});
|
|
662
|
+
it('returns true for a symlink', () => {
|
|
663
|
+
const target = path.join(tmpDir, 'target');
|
|
664
|
+
const link = path.join(tmpDir, 'link');
|
|
665
|
+
fs.mkdirSync(target);
|
|
666
|
+
fs.symlinkSync(target, link, 'dir');
|
|
667
|
+
expect(_isSymlinkSync(link)).toBe(true);
|
|
668
|
+
});
|
|
669
|
+
it('returns false for non-existent path', () => {
|
|
670
|
+
expect(_isSymlinkSync(path.join(tmpDir, 'nope'))).toBe(false);
|
|
671
|
+
});
|
|
672
|
+
});
|
|
673
|
+
describe('monorepo uninstall with symlink', () => {
|
|
674
|
+
let tmpDir;
|
|
675
|
+
let pluginDir;
|
|
676
|
+
let monoDir;
|
|
677
|
+
beforeEach(() => {
|
|
678
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-mono-uninstall-'));
|
|
679
|
+
pluginDir = path.join(PLUGINS_DIR, '__test-mono-sub__');
|
|
680
|
+
monoDir = path.join(_getMonoreposDir(), '__test-mono__');
|
|
681
|
+
const subDir = path.join(monoDir, 'packages', 'sub');
|
|
682
|
+
fs.mkdirSync(subDir, { recursive: true });
|
|
683
|
+
fs.writeFileSync(path.join(subDir, 'cmd.yaml'), 'site: test');
|
|
684
|
+
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
685
|
+
fs.symlinkSync(subDir, pluginDir, 'dir');
|
|
686
|
+
const lock = _readLockFile();
|
|
687
|
+
lock['__test-mono-sub__'] = {
|
|
688
|
+
source: {
|
|
689
|
+
kind: 'monorepo',
|
|
690
|
+
url: 'https://github.com/user/test.git',
|
|
691
|
+
repoName: '__test-mono__',
|
|
692
|
+
subPath: 'packages/sub',
|
|
693
|
+
},
|
|
694
|
+
commitHash: 'abc123',
|
|
695
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
696
|
+
};
|
|
697
|
+
_writeLockFile(lock);
|
|
698
|
+
});
|
|
699
|
+
afterEach(() => {
|
|
700
|
+
try {
|
|
701
|
+
fs.unlinkSync(pluginDir);
|
|
702
|
+
}
|
|
703
|
+
catch { }
|
|
704
|
+
try {
|
|
705
|
+
fs.rmSync(pluginDir, { recursive: true, force: true });
|
|
706
|
+
}
|
|
707
|
+
catch { }
|
|
708
|
+
try {
|
|
709
|
+
fs.rmSync(monoDir, { recursive: true, force: true });
|
|
710
|
+
}
|
|
711
|
+
catch { }
|
|
712
|
+
const lock = _readLockFile();
|
|
713
|
+
delete lock['__test-mono-sub__'];
|
|
714
|
+
_writeLockFile(lock);
|
|
715
|
+
});
|
|
716
|
+
it('removes symlink but keeps monorepo if other sub-plugins reference it', () => {
|
|
717
|
+
const lock = _readLockFile();
|
|
718
|
+
lock['__test-mono-other__'] = {
|
|
719
|
+
source: {
|
|
720
|
+
kind: 'monorepo',
|
|
721
|
+
url: 'https://github.com/user/test.git',
|
|
722
|
+
repoName: '__test-mono__',
|
|
723
|
+
subPath: 'packages/other',
|
|
724
|
+
},
|
|
725
|
+
commitHash: 'abc123',
|
|
726
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
727
|
+
};
|
|
728
|
+
_writeLockFile(lock);
|
|
729
|
+
uninstallPlugin('__test-mono-sub__');
|
|
730
|
+
expect(fs.existsSync(pluginDir)).toBe(false);
|
|
731
|
+
expect(fs.existsSync(monoDir)).toBe(true);
|
|
732
|
+
expect(_readLockFile()['__test-mono-sub__']).toBeUndefined();
|
|
733
|
+
expect(_readLockFile()['__test-mono-other__']).toBeDefined();
|
|
734
|
+
const finalLock = _readLockFile();
|
|
735
|
+
delete finalLock['__test-mono-other__'];
|
|
736
|
+
_writeLockFile(finalLock);
|
|
737
|
+
});
|
|
738
|
+
it('removes symlink AND monorepo dir when last sub-plugin is uninstalled', () => {
|
|
739
|
+
uninstallPlugin('__test-mono-sub__');
|
|
740
|
+
expect(fs.existsSync(pluginDir)).toBe(false);
|
|
741
|
+
expect(fs.existsSync(monoDir)).toBe(false);
|
|
742
|
+
expect(_readLockFile()['__test-mono-sub__']).toBeUndefined();
|
|
743
|
+
});
|
|
744
|
+
});
|
|
745
|
+
describe('listPlugins with monorepo metadata', () => {
|
|
746
|
+
const testSymlinkTarget = path.join(os.tmpdir(), 'opencli-list-mono-target');
|
|
747
|
+
const testLink = path.join(PLUGINS_DIR, '__test-mono-list__');
|
|
748
|
+
beforeEach(() => {
|
|
749
|
+
fs.mkdirSync(testSymlinkTarget, { recursive: true });
|
|
750
|
+
fs.writeFileSync(path.join(testSymlinkTarget, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
751
|
+
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
752
|
+
try {
|
|
753
|
+
fs.unlinkSync(testLink);
|
|
754
|
+
}
|
|
755
|
+
catch { }
|
|
756
|
+
fs.symlinkSync(testSymlinkTarget, testLink, 'dir');
|
|
757
|
+
const lock = _readLockFile();
|
|
758
|
+
lock['__test-mono-list__'] = {
|
|
759
|
+
source: {
|
|
760
|
+
kind: 'monorepo',
|
|
761
|
+
url: 'https://github.com/user/test-mono.git',
|
|
762
|
+
repoName: 'test-mono',
|
|
763
|
+
subPath: 'packages/list',
|
|
764
|
+
},
|
|
765
|
+
commitHash: 'def456def456def456def456def456def456def4',
|
|
766
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
767
|
+
};
|
|
768
|
+
_writeLockFile(lock);
|
|
769
|
+
});
|
|
770
|
+
afterEach(() => {
|
|
771
|
+
try {
|
|
772
|
+
fs.unlinkSync(testLink);
|
|
773
|
+
}
|
|
774
|
+
catch { }
|
|
775
|
+
try {
|
|
776
|
+
fs.rmSync(testSymlinkTarget, { recursive: true, force: true });
|
|
777
|
+
}
|
|
778
|
+
catch { }
|
|
779
|
+
const lock = _readLockFile();
|
|
780
|
+
delete lock['__test-mono-list__'];
|
|
781
|
+
_writeLockFile(lock);
|
|
782
|
+
});
|
|
783
|
+
it('lists symlinked plugins with monorepoName', () => {
|
|
784
|
+
const plugins = listPlugins();
|
|
785
|
+
const found = plugins.find(p => p.name === '__test-mono-list__');
|
|
786
|
+
expect(found).toBeDefined();
|
|
787
|
+
expect(found.monorepoName).toBe('test-mono');
|
|
788
|
+
expect(found.commands).toContain('hello');
|
|
789
|
+
expect(found.source).toBe('https://github.com/user/test-mono.git');
|
|
790
|
+
});
|
|
791
|
+
});
|
|
792
|
+
describe('installLocalPlugin', () => {
|
|
793
|
+
let tmpDir;
|
|
794
|
+
const pluginName = '__test-local-plugin__';
|
|
795
|
+
beforeEach(() => {
|
|
796
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'opencli-local-install-'));
|
|
797
|
+
fs.writeFileSync(path.join(tmpDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
798
|
+
});
|
|
799
|
+
afterEach(() => {
|
|
800
|
+
const linkPath = path.join(PLUGINS_DIR, pluginName);
|
|
801
|
+
try {
|
|
802
|
+
fs.unlinkSync(linkPath);
|
|
803
|
+
}
|
|
804
|
+
catch { }
|
|
805
|
+
try {
|
|
806
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
807
|
+
}
|
|
808
|
+
catch { }
|
|
809
|
+
const lock = _readLockFile();
|
|
810
|
+
delete lock[pluginName];
|
|
811
|
+
_writeLockFile(lock);
|
|
812
|
+
});
|
|
813
|
+
it('creates a symlink to the local directory', () => {
|
|
814
|
+
const result = _installLocalPlugin(tmpDir, pluginName);
|
|
815
|
+
expect(result).toBe(pluginName);
|
|
816
|
+
const linkPath = path.join(PLUGINS_DIR, pluginName);
|
|
817
|
+
expect(fs.existsSync(linkPath)).toBe(true);
|
|
818
|
+
expect(_isSymlinkSync(linkPath)).toBe(true);
|
|
819
|
+
});
|
|
820
|
+
it('records local: source in lockfile', () => {
|
|
821
|
+
_installLocalPlugin(tmpDir, pluginName);
|
|
822
|
+
const lock = _readLockFile();
|
|
823
|
+
expect(lock[pluginName]).toBeDefined();
|
|
824
|
+
expect(lock[pluginName].source).toEqual({ kind: 'local', path: path.resolve(tmpDir) });
|
|
825
|
+
});
|
|
826
|
+
it('lists the recorded local source', () => {
|
|
827
|
+
_installLocalPlugin(tmpDir, pluginName);
|
|
828
|
+
const plugins = listPlugins();
|
|
829
|
+
const found = plugins.find(p => p.name === pluginName);
|
|
830
|
+
expect(found).toBeDefined();
|
|
831
|
+
expect(found.source).toBe(`local:${path.resolve(tmpDir)}`);
|
|
832
|
+
});
|
|
833
|
+
it('throws for non-existent path', () => {
|
|
834
|
+
expect(() => _installLocalPlugin('/does/not/exist', 'x')).toThrow('does not exist');
|
|
835
|
+
});
|
|
836
|
+
});
|
|
837
|
+
describe('isLocalPluginSource', () => {
|
|
838
|
+
it('detects lockfile local sources', () => {
|
|
839
|
+
expect(_isLocalPluginSource('local:/tmp/plugin')).toBe(true);
|
|
840
|
+
expect(_isLocalPluginSource('https://github.com/user/repo.git')).toBe(false);
|
|
841
|
+
expect(_isLocalPluginSource(undefined)).toBe(false);
|
|
842
|
+
});
|
|
843
|
+
});
|
|
844
|
+
describe('plugin source helpers', () => {
|
|
845
|
+
it('formats local plugin sources consistently', () => {
|
|
846
|
+
const dir = path.join(os.tmpdir(), 'opencli-plugin-source');
|
|
847
|
+
expect(_toLocalPluginSource(dir)).toBe(`local:${path.resolve(dir)}`);
|
|
848
|
+
});
|
|
849
|
+
it('serializes structured local sources consistently', () => {
|
|
850
|
+
const dir = path.join(os.tmpdir(), 'opencli-plugin-source');
|
|
851
|
+
expect(_toStoredPluginSource({ kind: 'local', path: dir })).toBe(`local:${path.resolve(dir)}`);
|
|
852
|
+
});
|
|
853
|
+
it('prefers lockfile source over git remote lookup', () => {
|
|
854
|
+
const dir = path.join(os.tmpdir(), 'opencli-plugin-source');
|
|
855
|
+
const localPath = path.resolve(path.join(os.tmpdir(), 'opencli-plugin-source-local'));
|
|
856
|
+
const source = _resolveStoredPluginSource({
|
|
857
|
+
source: { kind: 'local', path: localPath },
|
|
858
|
+
commitHash: 'local',
|
|
859
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
860
|
+
}, dir);
|
|
861
|
+
expect(source).toBe(`local:${localPath}`);
|
|
862
|
+
});
|
|
863
|
+
it('returns structured monorepo sources unchanged', () => {
|
|
864
|
+
const dir = path.join(os.tmpdir(), 'opencli-plugin-source');
|
|
865
|
+
const source = _resolvePluginSource({
|
|
866
|
+
source: {
|
|
867
|
+
kind: 'monorepo',
|
|
868
|
+
url: 'https://github.com/user/opencli-plugins.git',
|
|
869
|
+
repoName: 'opencli-plugins',
|
|
870
|
+
subPath: 'packages/alpha',
|
|
871
|
+
},
|
|
872
|
+
commitHash: 'abcdef1234567890abcdef1234567890abcdef12',
|
|
873
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
874
|
+
}, dir);
|
|
875
|
+
expect(source).toEqual({
|
|
876
|
+
kind: 'monorepo',
|
|
877
|
+
url: 'https://github.com/user/opencli-plugins.git',
|
|
878
|
+
repoName: 'opencli-plugins',
|
|
879
|
+
subPath: 'packages/alpha',
|
|
880
|
+
});
|
|
881
|
+
});
|
|
882
|
+
});
|
|
883
|
+
describe('moveDir', () => {
|
|
884
|
+
it('cleans up destination when EXDEV fallback copy fails', () => {
|
|
885
|
+
const src = path.join(os.tmpdir(), 'opencli-move-src');
|
|
886
|
+
const dest = path.join(os.tmpdir(), 'opencli-move-dest');
|
|
887
|
+
const renameErr = Object.assign(new Error('cross-device link not permitted'), { code: 'EXDEV' });
|
|
888
|
+
const copyErr = new Error('copy failed');
|
|
889
|
+
const renameSync = vi.fn(() => { throw renameErr; });
|
|
890
|
+
const cpSync = vi.fn(() => { throw copyErr; });
|
|
891
|
+
const rmSync = vi.fn(() => undefined);
|
|
892
|
+
expect(() => _moveDir(src, dest, { renameSync, cpSync, rmSync })).toThrow(copyErr);
|
|
893
|
+
expect(renameSync).toHaveBeenCalledWith(src, dest);
|
|
894
|
+
expect(cpSync).toHaveBeenCalledWith(src, dest, { recursive: true });
|
|
895
|
+
expect(rmSync).toHaveBeenCalledWith(dest, { recursive: true, force: true });
|
|
896
|
+
});
|
|
897
|
+
});
|
|
898
|
+
describe('promoteDir', () => {
|
|
899
|
+
it('cleans up temporary publish dir when final rename fails', () => {
|
|
900
|
+
const staging = path.join(os.tmpdir(), 'opencli-promote-stage');
|
|
901
|
+
const dest = path.join(os.tmpdir(), 'opencli-promote-dest');
|
|
902
|
+
const publishErr = new Error('publish failed');
|
|
903
|
+
const existsSync = vi.fn(() => false);
|
|
904
|
+
const mkdirSync = vi.fn(() => undefined);
|
|
905
|
+
const cpSync = vi.fn(() => undefined);
|
|
906
|
+
const rmSync = vi.fn(() => undefined);
|
|
907
|
+
const renameSync = vi.fn((src, _target) => {
|
|
908
|
+
if (String(src) === staging)
|
|
909
|
+
return;
|
|
910
|
+
throw publishErr;
|
|
911
|
+
});
|
|
912
|
+
expect(() => _promoteDir(staging, dest, { existsSync, mkdirSync, renameSync, cpSync, rmSync })).toThrow(publishErr);
|
|
913
|
+
const tempDest = renameSync.mock.calls[0][1];
|
|
914
|
+
expect(renameSync).toHaveBeenNthCalledWith(1, staging, tempDest);
|
|
915
|
+
expect(renameSync).toHaveBeenNthCalledWith(2, tempDest, dest);
|
|
916
|
+
expect(rmSync).toHaveBeenCalledWith(tempDest, { recursive: true, force: true });
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
describe('replaceDir', () => {
|
|
920
|
+
it('rolls back the original destination when swap fails', () => {
|
|
921
|
+
const staging = path.join(os.tmpdir(), 'opencli-replace-stage');
|
|
922
|
+
const dest = path.join(os.tmpdir(), 'opencli-replace-dest');
|
|
923
|
+
const publishErr = new Error('swap failed');
|
|
924
|
+
const existingPaths = new Set([dest]);
|
|
925
|
+
const existsSync = vi.fn((p) => existingPaths.has(String(p)));
|
|
926
|
+
const mkdirSync = vi.fn(() => undefined);
|
|
927
|
+
const cpSync = vi.fn(() => undefined);
|
|
928
|
+
const rmSync = vi.fn(() => undefined);
|
|
929
|
+
const renameSync = vi.fn((src, target) => {
|
|
930
|
+
if (String(src) === staging) {
|
|
931
|
+
existingPaths.add(String(target));
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
if (String(src) === dest) {
|
|
935
|
+
existingPaths.delete(dest);
|
|
936
|
+
existingPaths.add(String(target));
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
if (String(target) === dest)
|
|
940
|
+
throw publishErr;
|
|
941
|
+
if (existingPaths.has(String(src))) {
|
|
942
|
+
existingPaths.delete(String(src));
|
|
943
|
+
existingPaths.add(String(target));
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
expect(() => _replaceDir(staging, dest, { existsSync, mkdirSync, renameSync, cpSync, rmSync })).toThrow(publishErr);
|
|
947
|
+
const tempDest = renameSync.mock.calls[0][1];
|
|
948
|
+
const backupDest = renameSync.mock.calls[1][1];
|
|
949
|
+
expect(renameSync).toHaveBeenNthCalledWith(1, staging, tempDest);
|
|
950
|
+
expect(renameSync).toHaveBeenNthCalledWith(2, dest, backupDest);
|
|
951
|
+
expect(renameSync).toHaveBeenNthCalledWith(3, tempDest, dest);
|
|
952
|
+
expect(renameSync).toHaveBeenNthCalledWith(4, backupDest, dest);
|
|
953
|
+
expect(rmSync).toHaveBeenCalledWith(tempDest, { recursive: true, force: true });
|
|
954
|
+
});
|
|
955
|
+
});
|
|
956
|
+
describe('installPlugin transactional staging', () => {
|
|
957
|
+
const standaloneSource = 'github:user/opencli-plugin-__test-transactional-standalone__';
|
|
958
|
+
const standaloneName = '__test-transactional-standalone__';
|
|
959
|
+
const standaloneDir = path.join(PLUGINS_DIR, standaloneName);
|
|
960
|
+
const monorepoSource = 'github:user/opencli-plugins-__test-transactional__';
|
|
961
|
+
const monorepoRepoDir = path.join(_getMonoreposDir(), 'opencli-plugins-__test-transactional__');
|
|
962
|
+
const monorepoLink = path.join(PLUGINS_DIR, 'alpha');
|
|
963
|
+
beforeEach(() => {
|
|
964
|
+
mockExecFileSync.mockClear();
|
|
965
|
+
mockExecSync.mockClear();
|
|
966
|
+
});
|
|
967
|
+
afterEach(() => {
|
|
968
|
+
try {
|
|
969
|
+
fs.unlinkSync(monorepoLink);
|
|
970
|
+
}
|
|
971
|
+
catch { }
|
|
972
|
+
try {
|
|
973
|
+
fs.rmSync(monorepoLink, { recursive: true, force: true });
|
|
974
|
+
}
|
|
975
|
+
catch { }
|
|
976
|
+
try {
|
|
977
|
+
fs.rmSync(monorepoRepoDir, { recursive: true, force: true });
|
|
978
|
+
}
|
|
979
|
+
catch { }
|
|
980
|
+
try {
|
|
981
|
+
fs.rmSync(standaloneDir, { recursive: true, force: true });
|
|
982
|
+
}
|
|
983
|
+
catch { }
|
|
984
|
+
const lock = _readLockFile();
|
|
985
|
+
delete lock[standaloneName];
|
|
986
|
+
delete lock.alpha;
|
|
987
|
+
_writeLockFile(lock);
|
|
988
|
+
vi.clearAllMocks();
|
|
989
|
+
});
|
|
990
|
+
it('does not expose the final standalone plugin dir when lifecycle fails in staging', () => {
|
|
991
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
992
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
993
|
+
const cloneDir = String(args[args.length - 1]);
|
|
994
|
+
fs.mkdirSync(cloneDir, { recursive: true });
|
|
995
|
+
fs.writeFileSync(path.join(cloneDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
996
|
+
fs.writeFileSync(path.join(cloneDir, 'package.json'), JSON.stringify({ name: standaloneName }));
|
|
997
|
+
return '';
|
|
998
|
+
}
|
|
999
|
+
if (cmd === 'npm' && Array.isArray(args) && args[0] === 'install') {
|
|
1000
|
+
throw new Error('boom');
|
|
1001
|
+
}
|
|
1002
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1003
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1004
|
+
}
|
|
1005
|
+
return '';
|
|
1006
|
+
});
|
|
1007
|
+
expect(() => installPlugin(standaloneSource)).toThrow(`npm install failed`);
|
|
1008
|
+
expect(fs.existsSync(standaloneDir)).toBe(false);
|
|
1009
|
+
expect(_readLockFile()[standaloneName]).toBeUndefined();
|
|
1010
|
+
});
|
|
1011
|
+
it('does not expose monorepo links or repo dir when lifecycle fails in staging', () => {
|
|
1012
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
1013
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
1014
|
+
const cloneDir = String(args[args.length - 1]);
|
|
1015
|
+
const alphaDir = path.join(cloneDir, 'packages', 'alpha');
|
|
1016
|
+
fs.mkdirSync(alphaDir, { recursive: true });
|
|
1017
|
+
fs.writeFileSync(path.join(cloneDir, 'package.json'), JSON.stringify({
|
|
1018
|
+
name: 'opencli-plugins-__test-transactional__',
|
|
1019
|
+
private: true,
|
|
1020
|
+
}));
|
|
1021
|
+
fs.writeFileSync(path.join(cloneDir, 'opencli-plugin.json'), JSON.stringify({
|
|
1022
|
+
plugins: {
|
|
1023
|
+
alpha: { path: 'packages/alpha' },
|
|
1024
|
+
},
|
|
1025
|
+
}));
|
|
1026
|
+
fs.writeFileSync(path.join(alphaDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
1027
|
+
return '';
|
|
1028
|
+
}
|
|
1029
|
+
if (cmd === 'npm' && Array.isArray(args) && args[0] === 'install') {
|
|
1030
|
+
throw new Error('boom');
|
|
1031
|
+
}
|
|
1032
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1033
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1034
|
+
}
|
|
1035
|
+
return '';
|
|
1036
|
+
});
|
|
1037
|
+
expect(() => installPlugin(monorepoSource)).toThrow(`npm install failed`);
|
|
1038
|
+
expect(fs.existsSync(monorepoRepoDir)).toBe(false);
|
|
1039
|
+
expect(fs.existsSync(monorepoLink)).toBe(false);
|
|
1040
|
+
expect(_readLockFile().alpha).toBeUndefined();
|
|
1041
|
+
});
|
|
1042
|
+
});
|
|
1043
|
+
describe('installPlugin with existing monorepo', () => {
|
|
1044
|
+
const repoName = '__test-existing-monorepo__';
|
|
1045
|
+
const repoDir = path.join(_getMonoreposDir(), repoName);
|
|
1046
|
+
const pluginName = 'beta';
|
|
1047
|
+
const pluginLink = path.join(PLUGINS_DIR, pluginName);
|
|
1048
|
+
beforeEach(() => {
|
|
1049
|
+
mockExecFileSync.mockClear();
|
|
1050
|
+
mockExecSync.mockClear();
|
|
1051
|
+
});
|
|
1052
|
+
afterEach(() => {
|
|
1053
|
+
try {
|
|
1054
|
+
fs.unlinkSync(pluginLink);
|
|
1055
|
+
}
|
|
1056
|
+
catch { }
|
|
1057
|
+
try {
|
|
1058
|
+
fs.rmSync(pluginLink, { recursive: true, force: true });
|
|
1059
|
+
}
|
|
1060
|
+
catch { }
|
|
1061
|
+
try {
|
|
1062
|
+
fs.rmSync(repoDir, { recursive: true, force: true });
|
|
1063
|
+
}
|
|
1064
|
+
catch { }
|
|
1065
|
+
const lock = _readLockFile();
|
|
1066
|
+
delete lock[pluginName];
|
|
1067
|
+
_writeLockFile(lock);
|
|
1068
|
+
vi.clearAllMocks();
|
|
1069
|
+
});
|
|
1070
|
+
it('reinstalls root dependencies when adding a sub-plugin from an existing monorepo', () => {
|
|
1071
|
+
const subDir = path.join(repoDir, 'packages', pluginName);
|
|
1072
|
+
fs.mkdirSync(subDir, { recursive: true });
|
|
1073
|
+
fs.writeFileSync(path.join(repoDir, 'package.json'), JSON.stringify({
|
|
1074
|
+
name: repoName,
|
|
1075
|
+
private: true,
|
|
1076
|
+
workspaces: ['packages/*'],
|
|
1077
|
+
}));
|
|
1078
|
+
fs.writeFileSync(path.join(repoDir, 'opencli-plugin.json'), JSON.stringify({
|
|
1079
|
+
plugins: {
|
|
1080
|
+
[pluginName]: { path: `packages/${pluginName}` },
|
|
1081
|
+
},
|
|
1082
|
+
}));
|
|
1083
|
+
fs.writeFileSync(path.join(subDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
1084
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
1085
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
1086
|
+
const cloneDir = String(args[4]);
|
|
1087
|
+
fs.mkdirSync(cloneDir, { recursive: true });
|
|
1088
|
+
fs.writeFileSync(path.join(cloneDir, 'opencli-plugin.json'), JSON.stringify({
|
|
1089
|
+
plugins: {
|
|
1090
|
+
[pluginName]: { path: `packages/${pluginName}` },
|
|
1091
|
+
},
|
|
1092
|
+
}));
|
|
1093
|
+
return '';
|
|
1094
|
+
}
|
|
1095
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1096
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1097
|
+
}
|
|
1098
|
+
return '';
|
|
1099
|
+
});
|
|
1100
|
+
installPlugin(`github:user/${repoName}/${pluginName}`);
|
|
1101
|
+
const npmCalls = mockExecFileSync.mock.calls.filter(([cmd, args]) => cmd === 'npm' && Array.isArray(args) && args[0] === 'install');
|
|
1102
|
+
expect(npmCalls.some(([, , opts]) => opts?.cwd === repoDir)).toBe(true);
|
|
1103
|
+
expect(fs.realpathSync(pluginLink)).toBe(fs.realpathSync(subDir));
|
|
1104
|
+
});
|
|
1105
|
+
});
|
|
1106
|
+
describe('updatePlugin transactional staging', () => {
|
|
1107
|
+
const standaloneName = '__test-transactional-update__';
|
|
1108
|
+
const standaloneDir = path.join(PLUGINS_DIR, standaloneName);
|
|
1109
|
+
const monorepoName = '__test-transactional-mono-update__';
|
|
1110
|
+
const monorepoRepoDir = path.join(_getMonoreposDir(), monorepoName);
|
|
1111
|
+
const monorepoPluginName = 'alpha-update';
|
|
1112
|
+
const monorepoLink = path.join(PLUGINS_DIR, monorepoPluginName);
|
|
1113
|
+
beforeEach(() => {
|
|
1114
|
+
mockExecFileSync.mockClear();
|
|
1115
|
+
mockExecSync.mockClear();
|
|
1116
|
+
});
|
|
1117
|
+
afterEach(() => {
|
|
1118
|
+
try {
|
|
1119
|
+
fs.unlinkSync(monorepoLink);
|
|
1120
|
+
}
|
|
1121
|
+
catch { }
|
|
1122
|
+
try {
|
|
1123
|
+
fs.rmSync(monorepoLink, { recursive: true, force: true });
|
|
1124
|
+
}
|
|
1125
|
+
catch { }
|
|
1126
|
+
try {
|
|
1127
|
+
fs.rmSync(monorepoRepoDir, { recursive: true, force: true });
|
|
1128
|
+
}
|
|
1129
|
+
catch { }
|
|
1130
|
+
try {
|
|
1131
|
+
fs.rmSync(standaloneDir, { recursive: true, force: true });
|
|
1132
|
+
}
|
|
1133
|
+
catch { }
|
|
1134
|
+
const lock = _readLockFile();
|
|
1135
|
+
delete lock[standaloneName];
|
|
1136
|
+
delete lock[monorepoPluginName];
|
|
1137
|
+
_writeLockFile(lock);
|
|
1138
|
+
vi.clearAllMocks();
|
|
1139
|
+
});
|
|
1140
|
+
it('keeps the existing standalone plugin when staged update preparation fails', () => {
|
|
1141
|
+
fs.mkdirSync(standaloneDir, { recursive: true });
|
|
1142
|
+
fs.writeFileSync(path.join(standaloneDir, 'old.yaml'), 'site: old\nname: old\n');
|
|
1143
|
+
const lock = _readLockFile();
|
|
1144
|
+
lock[standaloneName] = {
|
|
1145
|
+
source: {
|
|
1146
|
+
kind: 'git',
|
|
1147
|
+
url: 'https://github.com/user/opencli-plugin-__test-transactional-update__.git',
|
|
1148
|
+
},
|
|
1149
|
+
commitHash: 'oldhasholdhasholdhasholdhasholdhasholdh',
|
|
1150
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
1151
|
+
};
|
|
1152
|
+
_writeLockFile(lock);
|
|
1153
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
1154
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
1155
|
+
const cloneDir = String(args[4]);
|
|
1156
|
+
fs.mkdirSync(cloneDir, { recursive: true });
|
|
1157
|
+
fs.writeFileSync(path.join(cloneDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
1158
|
+
fs.writeFileSync(path.join(cloneDir, 'package.json'), JSON.stringify({ name: standaloneName }));
|
|
1159
|
+
return '';
|
|
1160
|
+
}
|
|
1161
|
+
if (cmd === 'npm' && Array.isArray(args) && args[0] === 'install') {
|
|
1162
|
+
throw new Error('boom');
|
|
1163
|
+
}
|
|
1164
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1165
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1166
|
+
}
|
|
1167
|
+
return '';
|
|
1168
|
+
});
|
|
1169
|
+
expect(() => updatePlugin(standaloneName)).toThrow('npm install failed');
|
|
1170
|
+
expect(fs.existsSync(standaloneDir)).toBe(true);
|
|
1171
|
+
expect(fs.readFileSync(path.join(standaloneDir, 'old.yaml'), 'utf-8')).toContain('site: old');
|
|
1172
|
+
expect(_readLockFile()[standaloneName]?.commitHash).toBe('oldhasholdhasholdhasholdhasholdhasholdh');
|
|
1173
|
+
});
|
|
1174
|
+
it('keeps the existing monorepo repo and link when staged update preparation fails', () => {
|
|
1175
|
+
const subDir = path.join(monorepoRepoDir, 'packages', monorepoPluginName);
|
|
1176
|
+
fs.mkdirSync(subDir, { recursive: true });
|
|
1177
|
+
fs.writeFileSync(path.join(subDir, 'old.yaml'), 'site: old\nname: old\n');
|
|
1178
|
+
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
1179
|
+
fs.symlinkSync(subDir, monorepoLink, 'dir');
|
|
1180
|
+
const lock = _readLockFile();
|
|
1181
|
+
lock[monorepoPluginName] = {
|
|
1182
|
+
source: {
|
|
1183
|
+
kind: 'monorepo',
|
|
1184
|
+
url: 'https://github.com/user/opencli-plugins-__test-transactional-mono-update__.git',
|
|
1185
|
+
repoName: monorepoName,
|
|
1186
|
+
subPath: `packages/${monorepoPluginName}`,
|
|
1187
|
+
},
|
|
1188
|
+
commitHash: 'oldmonooldmonooldmonooldmonooldmonoold',
|
|
1189
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
1190
|
+
};
|
|
1191
|
+
_writeLockFile(lock);
|
|
1192
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
1193
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
1194
|
+
const cloneDir = String(args[4]);
|
|
1195
|
+
const alphaDir = path.join(cloneDir, 'packages', monorepoPluginName);
|
|
1196
|
+
fs.mkdirSync(alphaDir, { recursive: true });
|
|
1197
|
+
fs.writeFileSync(path.join(cloneDir, 'package.json'), JSON.stringify({
|
|
1198
|
+
name: 'opencli-plugins-__test-transactional-mono-update__',
|
|
1199
|
+
private: true,
|
|
1200
|
+
}));
|
|
1201
|
+
fs.writeFileSync(path.join(cloneDir, 'opencli-plugin.json'), JSON.stringify({
|
|
1202
|
+
plugins: {
|
|
1203
|
+
[monorepoPluginName]: { path: `packages/${monorepoPluginName}` },
|
|
1204
|
+
},
|
|
1205
|
+
}));
|
|
1206
|
+
fs.writeFileSync(path.join(alphaDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
1207
|
+
return '';
|
|
1208
|
+
}
|
|
1209
|
+
if (cmd === 'npm' && Array.isArray(args) && args[0] === 'install') {
|
|
1210
|
+
throw new Error('boom');
|
|
1211
|
+
}
|
|
1212
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1213
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1214
|
+
}
|
|
1215
|
+
return '';
|
|
1216
|
+
});
|
|
1217
|
+
expect(() => updatePlugin(monorepoPluginName)).toThrow('npm install failed');
|
|
1218
|
+
expect(fs.existsSync(monorepoRepoDir)).toBe(true);
|
|
1219
|
+
expect(fs.existsSync(monorepoLink)).toBe(true);
|
|
1220
|
+
expect(fs.readFileSync(path.join(subDir, 'old.yaml'), 'utf-8')).toContain('site: old');
|
|
1221
|
+
expect(_readLockFile()[monorepoPluginName]?.commitHash).toBe('oldmonooldmonooldmonooldmonooldmonoold');
|
|
1222
|
+
});
|
|
1223
|
+
it('relinks monorepo plugins when the updated manifest moves their subPath', () => {
|
|
1224
|
+
const oldSubDir = path.join(monorepoRepoDir, 'packages', 'old-alpha');
|
|
1225
|
+
fs.mkdirSync(oldSubDir, { recursive: true });
|
|
1226
|
+
fs.writeFileSync(path.join(oldSubDir, 'old.yaml'), 'site: old\nname: old\n');
|
|
1227
|
+
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
1228
|
+
fs.symlinkSync(oldSubDir, monorepoLink, 'dir');
|
|
1229
|
+
const lock = _readLockFile();
|
|
1230
|
+
lock[monorepoPluginName] = {
|
|
1231
|
+
source: {
|
|
1232
|
+
kind: 'monorepo',
|
|
1233
|
+
url: 'https://github.com/user/opencli-plugins-__test-transactional-mono-update__.git',
|
|
1234
|
+
repoName: monorepoName,
|
|
1235
|
+
subPath: 'packages/old-alpha',
|
|
1236
|
+
},
|
|
1237
|
+
commitHash: 'oldmonooldmonooldmonooldmonooldmonoold',
|
|
1238
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
1239
|
+
};
|
|
1240
|
+
_writeLockFile(lock);
|
|
1241
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
1242
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
1243
|
+
const cloneDir = String(args[4]);
|
|
1244
|
+
const movedDir = path.join(cloneDir, 'packages', 'moved-alpha');
|
|
1245
|
+
fs.mkdirSync(movedDir, { recursive: true });
|
|
1246
|
+
fs.writeFileSync(path.join(cloneDir, 'opencli-plugin.json'), JSON.stringify({
|
|
1247
|
+
plugins: {
|
|
1248
|
+
[monorepoPluginName]: { path: 'packages/moved-alpha' },
|
|
1249
|
+
},
|
|
1250
|
+
}));
|
|
1251
|
+
fs.writeFileSync(path.join(movedDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
1252
|
+
return '';
|
|
1253
|
+
}
|
|
1254
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1255
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1256
|
+
}
|
|
1257
|
+
return '';
|
|
1258
|
+
});
|
|
1259
|
+
updatePlugin(monorepoPluginName);
|
|
1260
|
+
const expectedTarget = path.join(monorepoRepoDir, 'packages', 'moved-alpha');
|
|
1261
|
+
expect(fs.realpathSync(monorepoLink)).toBe(fs.realpathSync(expectedTarget));
|
|
1262
|
+
expect(_readLockFile()[monorepoPluginName]?.source).toMatchObject({
|
|
1263
|
+
kind: 'monorepo',
|
|
1264
|
+
subPath: 'packages/moved-alpha',
|
|
1265
|
+
});
|
|
1266
|
+
});
|
|
1267
|
+
it('rolls back the monorepo repo swap when relinking fails', () => {
|
|
1268
|
+
const oldSubDir = path.join(monorepoRepoDir, 'packages', 'old-alpha');
|
|
1269
|
+
fs.mkdirSync(oldSubDir, { recursive: true });
|
|
1270
|
+
fs.writeFileSync(path.join(oldSubDir, 'old.yaml'), 'site: old\nname: old\n');
|
|
1271
|
+
fs.mkdirSync(monorepoLink, { recursive: true });
|
|
1272
|
+
fs.writeFileSync(path.join(monorepoLink, 'blocker.txt'), 'not a symlink');
|
|
1273
|
+
const lock = _readLockFile();
|
|
1274
|
+
lock[monorepoPluginName] = {
|
|
1275
|
+
source: {
|
|
1276
|
+
kind: 'monorepo',
|
|
1277
|
+
url: 'https://github.com/user/opencli-plugins-__test-transactional-mono-update__.git',
|
|
1278
|
+
repoName: monorepoName,
|
|
1279
|
+
subPath: 'packages/old-alpha',
|
|
1280
|
+
},
|
|
1281
|
+
commitHash: 'oldmonooldmonooldmonooldmonooldmonoold',
|
|
1282
|
+
installedAt: '2025-01-01T00:00:00.000Z',
|
|
1283
|
+
};
|
|
1284
|
+
_writeLockFile(lock);
|
|
1285
|
+
mockExecFileSync.mockImplementation((cmd, args) => {
|
|
1286
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'clone') {
|
|
1287
|
+
const cloneDir = String(args[4]);
|
|
1288
|
+
const movedDir = path.join(cloneDir, 'packages', 'moved-alpha');
|
|
1289
|
+
fs.mkdirSync(movedDir, { recursive: true });
|
|
1290
|
+
fs.writeFileSync(path.join(cloneDir, 'opencli-plugin.json'), JSON.stringify({
|
|
1291
|
+
plugins: {
|
|
1292
|
+
[monorepoPluginName]: { path: 'packages/moved-alpha' },
|
|
1293
|
+
},
|
|
1294
|
+
}));
|
|
1295
|
+
fs.writeFileSync(path.join(movedDir, 'hello.yaml'), 'site: test\nname: hello\n');
|
|
1296
|
+
return '';
|
|
1297
|
+
}
|
|
1298
|
+
if (cmd === 'git' && Array.isArray(args) && args[0] === 'rev-parse' && args[1] === 'HEAD') {
|
|
1299
|
+
return '1234567890abcdef1234567890abcdef12345678\n';
|
|
1300
|
+
}
|
|
1301
|
+
return '';
|
|
1302
|
+
});
|
|
1303
|
+
expect(() => updatePlugin(monorepoPluginName)).toThrow('to be a symlink');
|
|
1304
|
+
expect(fs.existsSync(path.join(monorepoRepoDir, 'packages', 'old-alpha', 'old.yaml'))).toBe(true);
|
|
1305
|
+
expect(fs.existsSync(path.join(monorepoRepoDir, 'packages', 'moved-alpha'))).toBe(false);
|
|
1306
|
+
expect(fs.readFileSync(path.join(monorepoLink, 'blocker.txt'), 'utf-8')).toBe('not a symlink');
|
|
1307
|
+
expect(_readLockFile()[monorepoPluginName]?.source).toMatchObject({
|
|
1308
|
+
kind: 'monorepo',
|
|
1309
|
+
subPath: 'packages/old-alpha',
|
|
1310
|
+
});
|
|
1311
|
+
});
|
|
1312
|
+
});
|