@jackwener/opencli 1.0.6 → 1.1.1
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/.agents/skills/cross-project-adapter-migration/SKILL.md +2 -2
- package/.github/pull_request_template.md +7 -0
- package/.github/workflows/doc-check.yml +36 -0
- package/.github/workflows/docs.yml +7 -42
- package/CHANGELOG.md +23 -0
- package/CLI-EXPLORER.md +9 -8
- package/README.md +51 -10
- package/README.zh-CN.md +29 -11
- package/SKILL.md +102 -33
- package/dist/browser/cdp.js +6 -1
- package/dist/browser/page.d.ts +4 -1
- package/dist/browser/page.js +7 -1
- package/dist/build-manifest.js +23 -16
- package/dist/cli-manifest.json +951 -296
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +225 -148
- package/dist/clis/antigravity/serve.js +296 -47
- package/dist/clis/apple-podcasts/commands.test.d.ts +2 -0
- package/dist/clis/apple-podcasts/commands.test.js +76 -0
- package/dist/clis/apple-podcasts/search.js +2 -2
- package/dist/clis/apple-podcasts/top.js +9 -2
- package/dist/clis/arxiv/paper.js +21 -0
- package/dist/clis/arxiv/search.js +24 -0
- package/dist/clis/arxiv/utils.d.ts +18 -0
- package/dist/clis/arxiv/utils.js +49 -0
- package/dist/clis/bilibili/dynamic.js +1 -1
- package/dist/clis/bilibili/favorite.js +1 -1
- package/dist/clis/bilibili/feed.js +1 -1
- package/dist/clis/bilibili/following.js +1 -1
- package/dist/clis/bilibili/history.js +1 -1
- package/dist/clis/bilibili/me.js +1 -1
- package/dist/clis/bilibili/ranking.js +1 -1
- package/dist/clis/bilibili/search.js +3 -3
- package/dist/clis/bilibili/subtitle.js +1 -1
- package/dist/clis/bilibili/user-videos.js +1 -1
- package/dist/{bilibili.d.ts → clis/bilibili/utils.d.ts} +1 -1
- package/dist/clis/bloomberg/businessweek.d.ts +1 -0
- package/dist/clis/bloomberg/businessweek.js +17 -0
- package/dist/clis/bloomberg/economics.d.ts +1 -0
- package/dist/clis/bloomberg/economics.js +17 -0
- package/dist/clis/bloomberg/feeds.d.ts +1 -0
- package/dist/clis/bloomberg/feeds.js +15 -0
- package/dist/clis/bloomberg/industries.d.ts +1 -0
- package/dist/clis/bloomberg/industries.js +17 -0
- package/dist/clis/bloomberg/main.d.ts +1 -0
- package/dist/clis/bloomberg/main.js +17 -0
- package/dist/clis/bloomberg/markets.d.ts +1 -0
- package/dist/clis/bloomberg/markets.js +17 -0
- package/dist/clis/bloomberg/news.d.ts +1 -0
- package/dist/clis/bloomberg/news.js +105 -0
- package/dist/clis/bloomberg/opinions.d.ts +1 -0
- package/dist/clis/bloomberg/opinions.js +17 -0
- package/dist/clis/bloomberg/politics.d.ts +1 -0
- package/dist/clis/bloomberg/politics.js +17 -0
- package/dist/clis/bloomberg/tech.d.ts +1 -0
- package/dist/clis/bloomberg/tech.js +17 -0
- package/dist/clis/bloomberg/utils.d.ts +34 -0
- package/dist/clis/bloomberg/utils.js +364 -0
- package/dist/clis/bloomberg/utils.test.d.ts +1 -0
- package/dist/clis/bloomberg/utils.test.js +129 -0
- package/dist/clis/boss/batchgreet.d.ts +1 -0
- package/dist/clis/boss/batchgreet.js +147 -0
- package/dist/clis/boss/chatlist.js +2 -2
- package/dist/clis/boss/detail.js +2 -2
- package/dist/clis/boss/exchange.d.ts +1 -0
- package/dist/clis/boss/exchange.js +111 -0
- package/dist/clis/boss/greet.d.ts +1 -0
- package/dist/clis/boss/greet.js +175 -0
- package/dist/clis/boss/invite.d.ts +1 -0
- package/dist/clis/boss/invite.js +158 -0
- package/dist/clis/boss/joblist.d.ts +1 -0
- package/dist/clis/boss/joblist.js +55 -0
- package/dist/clis/boss/mark.d.ts +1 -0
- package/dist/clis/boss/mark.js +141 -0
- package/dist/clis/boss/recommend.d.ts +1 -0
- package/dist/clis/boss/recommend.js +83 -0
- package/dist/clis/boss/search.js +1 -1
- package/dist/clis/boss/send.js +1 -1
- package/dist/clis/boss/stats.d.ts +1 -0
- package/dist/clis/boss/stats.js +116 -0
- package/dist/clis/chaoxing/assignments.js +1 -1
- package/dist/clis/chaoxing/exams.js +1 -1
- package/dist/{chaoxing.d.ts → clis/chaoxing/utils.d.ts} +1 -1
- package/dist/{chaoxing.js → clis/chaoxing/utils.js} +0 -2
- package/dist/clis/chaoxing/utils.test.d.ts +1 -0
- package/dist/{chaoxing.test.js → clis/chaoxing/utils.test.js} +1 -1
- package/dist/clis/chatgpt/read.js +1 -1
- package/dist/clis/chatwise/export.js +1 -1
- package/dist/clis/chatwise/model.js +2 -2
- package/dist/clis/chatwise/screenshot.js +1 -1
- package/dist/clis/codex/export.js +1 -1
- package/dist/clis/codex/model.js +2 -2
- package/dist/clis/codex/screenshot.js +1 -1
- package/dist/clis/coupang/add-to-cart.js +3 -4
- package/dist/clis/coupang/search.js +2 -4
- package/dist/clis/coupang/utils.test.d.ts +1 -0
- package/dist/{coupang.test.js → clis/coupang/utils.test.js} +1 -1
- package/dist/clis/ctrip/search.js +1 -1
- package/dist/clis/cursor/export.js +1 -1
- package/dist/clis/cursor/model.js +2 -2
- package/dist/clis/cursor/screenshot.js +1 -1
- package/dist/clis/jike/comment.js +2 -3
- package/dist/clis/jike/create.js +1 -2
- package/dist/clis/jike/feed.js +0 -1
- package/dist/clis/jike/like.js +1 -2
- package/dist/clis/jike/notifications.js +0 -1
- package/dist/clis/jike/post.yaml +1 -0
- package/dist/clis/jike/repost.js +1 -2
- package/dist/clis/jike/search.js +2 -3
- package/dist/clis/jike/topic.yaml +1 -0
- package/dist/clis/jike/user.yaml +1 -0
- package/dist/clis/jimeng/history.yaml +0 -1
- package/dist/clis/linkedin/search.js +7 -7
- package/dist/clis/linux-do/category.yaml +1 -0
- package/dist/clis/linux-do/search.yaml +4 -3
- package/dist/clis/linux-do/topic.yaml +1 -0
- package/dist/clis/notion/export.js +1 -1
- package/dist/clis/reddit/comment.js +3 -4
- package/dist/clis/reddit/read.js +4 -5
- package/dist/clis/reddit/save.js +2 -3
- package/dist/clis/reddit/saved.js +0 -1
- package/dist/clis/reddit/search.yaml +1 -0
- package/dist/clis/reddit/subscribe.js +0 -1
- package/dist/clis/reddit/upvote.js +2 -3
- package/dist/clis/reddit/upvoted.js +0 -1
- package/dist/clis/reddit/user-comments.yaml +1 -0
- package/dist/clis/reddit/user-posts.yaml +1 -0
- package/dist/clis/reddit/user.yaml +1 -0
- package/dist/clis/reuters/search.js +1 -1
- package/dist/clis/sinafinance/news.d.ts +7 -0
- package/dist/clis/sinafinance/news.js +61 -0
- package/dist/clis/smzdm/search.js +2 -3
- package/dist/clis/stackoverflow/search.yaml +1 -0
- package/dist/clis/steam/top-sellers.yaml +29 -0
- package/dist/clis/twitter/accept.js +2 -2
- package/dist/clis/twitter/article.js +2 -2
- package/dist/clis/twitter/block.d.ts +1 -0
- package/dist/clis/twitter/block.js +88 -0
- package/dist/clis/twitter/delete.js +1 -1
- package/dist/clis/twitter/hide-reply.d.ts +1 -0
- package/dist/clis/twitter/hide-reply.js +66 -0
- package/dist/clis/twitter/like.js +1 -1
- package/dist/clis/twitter/post.js +1 -1
- package/dist/clis/twitter/reply-dm.js +1 -1
- package/dist/clis/twitter/reply.js +2 -2
- package/dist/clis/twitter/search.js +1 -1
- package/dist/clis/twitter/thread.js +2 -2
- package/dist/clis/twitter/trending.d.ts +1 -0
- package/dist/clis/twitter/trending.js +91 -0
- package/dist/clis/twitter/unblock.d.ts +1 -0
- package/dist/clis/twitter/unblock.js +71 -0
- package/dist/clis/v2ex/topic.yaml +1 -0
- package/dist/clis/weibo/hot.js +0 -1
- package/dist/clis/weread/book.js +1 -1
- package/dist/clis/weread/highlights.js +1 -1
- package/dist/clis/weread/notes.js +1 -1
- package/dist/clis/weread/search.js +1 -1
- package/dist/clis/wikipedia/search.d.ts +1 -0
- package/dist/clis/wikipedia/search.js +30 -0
- package/dist/clis/wikipedia/summary.d.ts +1 -0
- package/dist/clis/wikipedia/summary.js +28 -0
- package/dist/clis/wikipedia/utils.d.ts +8 -0
- package/dist/clis/wikipedia/utils.js +18 -0
- package/dist/clis/xiaohongshu/creator-note-detail.d.ts +79 -5
- package/dist/clis/xiaohongshu/creator-note-detail.js +323 -70
- package/dist/clis/xiaohongshu/creator-note-detail.test.d.ts +1 -0
- package/dist/clis/xiaohongshu/creator-note-detail.test.js +258 -0
- package/dist/clis/xiaohongshu/creator-notes-summary.d.ts +28 -0
- package/dist/clis/xiaohongshu/creator-notes-summary.js +92 -0
- package/dist/clis/xiaohongshu/creator-notes-summary.test.d.ts +1 -0
- package/dist/clis/xiaohongshu/creator-notes-summary.test.js +49 -0
- package/dist/clis/xiaohongshu/creator-notes.d.ts +18 -5
- package/dist/clis/xiaohongshu/creator-notes.js +189 -71
- package/dist/clis/xiaohongshu/creator-notes.test.d.ts +1 -0
- package/dist/clis/xiaohongshu/creator-notes.test.js +191 -0
- package/dist/clis/xiaohongshu/creator-profile.js +0 -1
- package/dist/clis/xiaohongshu/creator-stats.js +0 -1
- package/dist/clis/xiaohongshu/download.js +2 -3
- package/dist/clis/xiaohongshu/feed.yaml +0 -1
- package/dist/clis/xiaohongshu/notifications.yaml +0 -1
- package/dist/clis/xiaohongshu/search.js +2 -2
- package/dist/clis/xiaohongshu/user.js +1 -2
- package/dist/clis/yahoo-finance/quote.js +0 -1
- package/dist/clis/youtube/search.js +1 -1
- package/dist/clis/youtube/transcript.js +1 -1
- package/dist/clis/youtube/video.js +1 -1
- package/dist/clis/zhihu/download.js +1 -2
- package/dist/clis/zhihu/question.js +1 -1
- package/dist/clis/zhihu/search.yaml +4 -3
- package/dist/commanderAdapter.d.ts +21 -0
- package/dist/commanderAdapter.js +111 -0
- package/dist/{engine.d.ts → discovery.d.ts} +0 -6
- package/dist/{engine.js → discovery.js} +1 -98
- package/dist/download/index.d.ts +2 -6
- package/dist/download/index.js +19 -46
- package/dist/engine.test.d.ts +1 -1
- package/dist/engine.test.js +8 -7
- package/dist/execution.d.ts +22 -0
- package/dist/execution.js +129 -0
- package/dist/explore.js +121 -107
- package/dist/external-clis.yaml +48 -0
- package/dist/external.d.ts +25 -0
- package/dist/external.js +156 -0
- package/dist/main.js +1 -1
- package/dist/pipeline/steps/browser.js +8 -2
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +2 -0
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.js +8 -0
- package/dist/serialization.d.ts +34 -0
- package/dist/serialization.js +63 -0
- package/dist/types.d.ts +4 -1
- package/docs/.vitepress/config.mts +14 -3
- package/docs/adapters/browser/arxiv.md +27 -0
- package/docs/adapters/browser/barchart.md +32 -0
- package/docs/adapters/browser/bloomberg.md +70 -0
- package/docs/adapters/browser/chaoxing.md +39 -0
- package/docs/adapters/browser/grok.md +35 -0
- package/docs/adapters/browser/hf.md +42 -0
- package/docs/adapters/browser/jike.md +45 -0
- package/docs/adapters/browser/jimeng.md +39 -0
- package/docs/adapters/browser/linux-do.md +45 -0
- package/docs/adapters/browser/sinafinance.md +35 -0
- package/docs/adapters/browser/stackoverflow.md +35 -0
- package/docs/adapters/browser/steam.md +26 -0
- package/docs/adapters/browser/twitter.md +3 -0
- package/docs/adapters/browser/weread.md +48 -0
- package/docs/adapters/browser/wikipedia.md +30 -0
- package/docs/adapters/browser/xiaohongshu.md +5 -1
- package/docs/adapters/desktop/chatgpt.md +3 -3
- package/docs/adapters/index.md +13 -0
- package/docs/advanced/download.md +4 -4
- package/docs/developer/architecture.md +17 -4
- package/package.json +1 -1
- package/scripts/check-doc-coverage.sh +69 -0
- package/scripts/copy-yaml.cjs +7 -0
- package/src/browser/cdp.ts +9 -4
- package/src/browser/page.ts +7 -1
- package/src/build-manifest.ts +25 -19
- package/src/cli.ts +253 -119
- package/src/clis/antigravity/serve.ts +323 -50
- package/src/clis/apple-podcasts/commands.test.ts +95 -0
- package/src/clis/apple-podcasts/search.ts +2 -2
- package/src/clis/apple-podcasts/top.ts +12 -2
- package/src/clis/arxiv/paper.ts +21 -0
- package/src/clis/arxiv/search.ts +24 -0
- package/src/clis/arxiv/utils.ts +63 -0
- package/src/clis/bilibili/dynamic.ts +1 -1
- package/src/clis/bilibili/favorite.ts +1 -1
- package/src/clis/bilibili/feed.ts +1 -1
- package/src/clis/bilibili/following.ts +1 -1
- package/src/clis/bilibili/history.ts +1 -1
- package/src/clis/bilibili/me.ts +1 -1
- package/src/clis/bilibili/ranking.ts +1 -1
- package/src/clis/bilibili/search.ts +3 -3
- package/src/clis/bilibili/subtitle.ts +1 -1
- package/src/clis/bilibili/user-videos.ts +1 -1
- package/src/{bilibili.ts → clis/bilibili/utils.ts} +1 -1
- package/src/clis/bloomberg/businessweek.ts +18 -0
- package/src/clis/bloomberg/economics.ts +18 -0
- package/src/clis/bloomberg/feeds.ts +16 -0
- package/src/clis/bloomberg/industries.ts +18 -0
- package/src/clis/bloomberg/main.ts +18 -0
- package/src/clis/bloomberg/markets.ts +18 -0
- package/src/clis/bloomberg/news.ts +136 -0
- package/src/clis/bloomberg/opinions.ts +18 -0
- package/src/clis/bloomberg/politics.ts +18 -0
- package/src/clis/bloomberg/tech.ts +18 -0
- package/src/clis/bloomberg/utils.test.ts +135 -0
- package/src/clis/bloomberg/utils.ts +429 -0
- package/src/clis/boss/batchgreet.ts +167 -0
- package/src/clis/boss/chatlist.ts +2 -2
- package/src/clis/boss/detail.ts +2 -2
- package/src/clis/boss/exchange.ts +126 -0
- package/src/clis/boss/greet.ts +198 -0
- package/src/clis/boss/invite.ts +177 -0
- package/src/clis/boss/joblist.ts +63 -0
- package/src/clis/boss/mark.ts +155 -0
- package/src/clis/boss/recommend.ts +94 -0
- package/src/clis/boss/search.ts +1 -1
- package/src/clis/boss/send.ts +1 -1
- package/src/clis/boss/stats.ts +130 -0
- package/src/clis/chaoxing/assignments.ts +1 -1
- package/src/clis/chaoxing/exams.ts +1 -1
- package/src/{chaoxing.test.ts → clis/chaoxing/utils.test.ts} +1 -1
- package/src/{chaoxing.ts → clis/chaoxing/utils.ts} +1 -3
- package/src/clis/chatgpt/README.zh-CN.md +3 -3
- package/src/clis/chatgpt/read.ts +1 -1
- package/src/clis/chatwise/export.ts +1 -1
- package/src/clis/chatwise/model.ts +2 -2
- package/src/clis/chatwise/screenshot.ts +1 -1
- package/src/clis/codex/export.ts +1 -1
- package/src/clis/codex/model.ts +2 -2
- package/src/clis/codex/screenshot.ts +1 -1
- package/src/clis/coupang/add-to-cart.ts +3 -4
- package/src/clis/coupang/search.ts +2 -4
- package/src/{coupang.test.ts → clis/coupang/utils.test.ts} +1 -1
- package/src/clis/ctrip/search.ts +1 -1
- package/src/clis/cursor/export.ts +1 -1
- package/src/clis/cursor/model.ts +2 -2
- package/src/clis/cursor/screenshot.ts +1 -1
- package/src/clis/jike/comment.ts +2 -3
- package/src/clis/jike/create.ts +1 -2
- package/src/clis/jike/feed.ts +0 -1
- package/src/clis/jike/like.ts +1 -2
- package/src/clis/jike/notifications.ts +0 -1
- package/src/clis/jike/post.yaml +1 -0
- package/src/clis/jike/repost.ts +1 -2
- package/src/clis/jike/search.ts +2 -3
- package/src/clis/jike/topic.yaml +1 -0
- package/src/clis/jike/user.yaml +1 -0
- package/src/clis/jimeng/history.yaml +0 -1
- package/src/clis/linkedin/search.ts +7 -7
- package/src/clis/linux-do/category.yaml +1 -0
- package/src/clis/linux-do/search.yaml +4 -3
- package/src/clis/linux-do/topic.yaml +1 -0
- package/src/clis/notion/export.ts +1 -1
- package/src/clis/reddit/comment.ts +3 -4
- package/src/clis/reddit/read.ts +4 -5
- package/src/clis/reddit/save.ts +2 -3
- package/src/clis/reddit/saved.ts +0 -1
- package/src/clis/reddit/search.yaml +1 -0
- package/src/clis/reddit/subscribe.ts +0 -1
- package/src/clis/reddit/upvote.ts +2 -3
- package/src/clis/reddit/upvoted.ts +0 -1
- package/src/clis/reddit/user-comments.yaml +1 -0
- package/src/clis/reddit/user-posts.yaml +1 -0
- package/src/clis/reddit/user.yaml +1 -0
- package/src/clis/reuters/search.ts +1 -1
- package/src/clis/sinafinance/news.ts +76 -0
- package/src/clis/smzdm/search.ts +2 -3
- package/src/clis/stackoverflow/search.yaml +1 -0
- package/src/clis/steam/top-sellers.yaml +29 -0
- package/src/clis/twitter/accept.ts +2 -2
- package/src/clis/twitter/article.ts +2 -2
- package/src/clis/twitter/block.ts +92 -0
- package/src/clis/twitter/delete.ts +1 -1
- package/src/clis/twitter/hide-reply.ts +70 -0
- package/src/clis/twitter/like.ts +1 -1
- package/src/clis/twitter/post.ts +1 -1
- package/src/clis/twitter/reply-dm.ts +1 -1
- package/src/clis/twitter/reply.ts +2 -2
- package/src/clis/twitter/search.ts +1 -1
- package/src/clis/twitter/thread.ts +2 -2
- package/src/clis/twitter/trending.ts +113 -0
- package/src/clis/twitter/unblock.ts +75 -0
- package/src/clis/v2ex/topic.yaml +1 -0
- package/src/clis/weibo/hot.ts +0 -1
- package/src/clis/weread/book.ts +1 -1
- package/src/clis/weread/highlights.ts +1 -1
- package/src/clis/weread/notes.ts +1 -1
- package/src/clis/weread/search.ts +1 -1
- package/src/clis/wikipedia/search.ts +32 -0
- package/src/clis/wikipedia/summary.ts +28 -0
- package/src/clis/wikipedia/utils.ts +20 -0
- package/src/clis/xiaohongshu/creator-note-detail.test.ts +272 -0
- package/src/clis/xiaohongshu/creator-note-detail.ts +425 -73
- package/src/clis/xiaohongshu/creator-notes-summary.test.ts +54 -0
- package/src/clis/xiaohongshu/creator-notes-summary.ts +120 -0
- package/src/clis/xiaohongshu/creator-notes.test.ts +211 -0
- package/src/clis/xiaohongshu/creator-notes.ts +254 -75
- package/src/clis/xiaohongshu/creator-profile.ts +0 -1
- package/src/clis/xiaohongshu/creator-stats.ts +0 -1
- package/src/clis/xiaohongshu/download.ts +2 -3
- package/src/clis/xiaohongshu/feed.yaml +0 -1
- package/src/clis/xiaohongshu/notifications.yaml +0 -1
- package/src/clis/xiaohongshu/search.ts +2 -2
- package/src/clis/xiaohongshu/user.ts +1 -2
- package/src/clis/yahoo-finance/quote.ts +0 -1
- package/src/clis/youtube/search.ts +1 -1
- package/src/clis/youtube/transcript.ts +1 -1
- package/src/clis/youtube/video.ts +1 -1
- package/src/clis/zhihu/download.ts +1 -2
- package/src/clis/zhihu/question.ts +1 -1
- package/src/clis/zhihu/search.yaml +4 -3
- package/src/commanderAdapter.ts +113 -0
- package/src/daemon.ts +3 -3
- package/src/{engine.ts → discovery.ts} +1 -108
- package/src/download/index.ts +21 -54
- package/src/engine.test.ts +8 -7
- package/src/execution.ts +138 -0
- package/src/explore.ts +135 -109
- package/src/external-clis.yaml +48 -0
- package/src/external.ts +185 -0
- package/src/main.ts +1 -1
- package/src/pipeline/steps/browser.ts +7 -2
- package/src/registry.ts +5 -0
- package/src/runtime.ts +9 -0
- package/src/serialization.ts +79 -0
- package/src/types.ts +1 -1
- package/tests/e2e/browser-public.test.ts +25 -0
- package/tests/e2e/public-commands.test.ts +55 -1
- package/dist/clis/twitter/trending.yaml +0 -46
- package/src/clis/twitter/trending.yaml +0 -46
- /package/dist/{chaoxing.test.d.ts → clis/arxiv/paper.d.ts} +0 -0
- /package/dist/{coupang.test.d.ts → clis/arxiv/search.d.ts} +0 -0
- /package/dist/{bilibili.js → clis/bilibili/utils.js} +0 -0
- /package/dist/{coupang.d.ts → clis/coupang/utils.d.ts} +0 -0
- /package/dist/{coupang.js → clis/coupang/utils.js} +0 -0
- /package/src/{coupang.ts → clis/coupang/utils.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 微信读书 (WeRead)
|
|
2
|
+
|
|
3
|
+
**Mode**: 🔐 Browser · **Domain**: `weread.qq.com`
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
| Command | Description |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| `opencli weread shelf` | List books on your bookshelf |
|
|
10
|
+
| `opencli weread search` | Search books on WeRead |
|
|
11
|
+
| `opencli weread book` | View book details |
|
|
12
|
+
| `opencli weread ranking` | Book rankings by category |
|
|
13
|
+
| `opencli weread notebooks` | List books that have highlights or notes |
|
|
14
|
+
| `opencli weread highlights` | List your highlights (underlines) in a book |
|
|
15
|
+
| `opencli weread notes` | List your notes (thoughts) on a book |
|
|
16
|
+
|
|
17
|
+
## Usage Examples
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# View your bookshelf
|
|
21
|
+
opencli weread shelf --limit 20
|
|
22
|
+
|
|
23
|
+
# Search books
|
|
24
|
+
opencli weread search "三体"
|
|
25
|
+
|
|
26
|
+
# View book details
|
|
27
|
+
opencli weread book <book-id>
|
|
28
|
+
|
|
29
|
+
# Book rankings
|
|
30
|
+
opencli weread ranking --limit 10
|
|
31
|
+
|
|
32
|
+
# List books with notes/highlights
|
|
33
|
+
opencli weread notebooks
|
|
34
|
+
|
|
35
|
+
# View highlights for a book
|
|
36
|
+
opencli weread highlights <book-id>
|
|
37
|
+
|
|
38
|
+
# View your notes
|
|
39
|
+
opencli weread notes <book-id>
|
|
40
|
+
|
|
41
|
+
# JSON output
|
|
42
|
+
opencli weread shelf -f json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Prerequisites
|
|
46
|
+
|
|
47
|
+
- Chrome running and **logged into** weread.qq.com
|
|
48
|
+
- [Browser Bridge extension](/guide/browser-bridge) installed
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Wikipedia
|
|
2
|
+
|
|
3
|
+
**Mode**: 🌐 Public · **Domain**: `wikipedia.org`
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
| Command | Description |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| `opencli wikipedia search` | Search Wikipedia articles |
|
|
10
|
+
| `opencli wikipedia summary` | Get Wikipedia article summary |
|
|
11
|
+
|
|
12
|
+
## Usage Examples
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Search articles
|
|
16
|
+
opencli wikipedia search "quantum computing" --limit 10
|
|
17
|
+
|
|
18
|
+
# Get article summary
|
|
19
|
+
opencli wikipedia summary --title "Artificial intelligence"
|
|
20
|
+
|
|
21
|
+
# Search in other languages
|
|
22
|
+
opencli wikipedia search "人工智能" --lang zh
|
|
23
|
+
|
|
24
|
+
# JSON output
|
|
25
|
+
opencli wikipedia search "Rust" -f json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- No browser required — uses public Wikipedia API
|
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
| `opencli xiaohongshu search` | |
|
|
10
10
|
| `opencli xiaohongshu notifications` | |
|
|
11
11
|
| `opencli xiaohongshu feed` | |
|
|
12
|
-
| `opencli xiaohongshu me` | |
|
|
13
12
|
| `opencli xiaohongshu user` | |
|
|
14
13
|
| `opencli xiaohongshu download` | |
|
|
14
|
+
| `opencli xiaohongshu creator-notes` | |
|
|
15
|
+
| `opencli xiaohongshu creator-note-detail` | |
|
|
16
|
+
| `opencli xiaohongshu creator-notes-summary` | |
|
|
17
|
+
| `opencli xiaohongshu creator-profile` | |
|
|
18
|
+
| `opencli xiaohongshu creator-stats` | |
|
|
15
19
|
|
|
16
20
|
## Usage Examples
|
|
17
21
|
|
|
@@ -14,7 +14,7 @@ The current built-in commands use native AppleScript automation — no extra lau
|
|
|
14
14
|
- `opencli chatgpt status`: Check if the ChatGPT app is currently running.
|
|
15
15
|
- `opencli chatgpt new`: Activate ChatGPT and press `Cmd+N` to start a new conversation.
|
|
16
16
|
- `opencli chatgpt send "message"`: Copy your message to clipboard, activate ChatGPT, paste, and submit.
|
|
17
|
-
- `opencli chatgpt read`:
|
|
17
|
+
- `opencli chatgpt read`: Read the last visible message from the focused ChatGPT window via the Accessibility tree.
|
|
18
18
|
|
|
19
19
|
## Approach 2: CDP (Advanced, Electron Debug Mode)
|
|
20
20
|
|
|
@@ -33,11 +33,11 @@ export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9224"
|
|
|
33
33
|
|
|
34
34
|
## How It Works
|
|
35
35
|
|
|
36
|
-
- **AppleScript mode**: Uses `osascript`
|
|
36
|
+
- **AppleScript mode**: Uses `osascript` to control ChatGPT, `pbcopy`/`pbpaste` to paste prompts, and the macOS Accessibility tree to read visible chat messages.
|
|
37
37
|
- **CDP mode**: Connects via Chrome DevTools Protocol to the Electron renderer process.
|
|
38
38
|
|
|
39
39
|
## Limitations
|
|
40
40
|
|
|
41
41
|
- macOS only (AppleScript dependency)
|
|
42
42
|
- AppleScript mode requires Accessibility permissions
|
|
43
|
-
- `read`
|
|
43
|
+
- `read` returns the last visible message in the focused ChatGPT window — scroll first if the message you want is not visible
|
package/docs/adapters/index.md
CHANGED
|
@@ -14,6 +14,7 @@ Run `opencli list` for the live registry.
|
|
|
14
14
|
| **[xueqiu](/adapters/browser/xueqiu)** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | 🔐 Browser |
|
|
15
15
|
| **[youtube](/adapters/browser/youtube)** | `search` `video` `transcript` | 🔐 Browser |
|
|
16
16
|
| **[v2ex](/adapters/browser/v2ex)** | `hot` `latest` `topic` `daily` `me` `notifications` | 🌐 / 🔐 |
|
|
17
|
+
| **[bloomberg](/adapters/browser/bloomberg)** | `main` `markets` `economics` `industries` `tech` `politics` `businessweek` `opinions` `feeds` `news` | 🌐 / 🔐 |
|
|
17
18
|
| **[weibo](/adapters/browser/weibo)** | `hot` | 🔐 Browser |
|
|
18
19
|
| **[linkedin](/adapters/browser/linkedin)** | `search` | 🔐 Browser |
|
|
19
20
|
| **[coupang](/adapters/browser/coupang)** | `search` `add-to-cart` | 🔐 Browser |
|
|
@@ -21,6 +22,12 @@ Run `opencli list` for the live registry.
|
|
|
21
22
|
| **[ctrip](/adapters/browser/ctrip)** | `search` | 🔐 Browser |
|
|
22
23
|
| **[reuters](/adapters/browser/reuters)** | `search` | 🔐 Browser |
|
|
23
24
|
| **[smzdm](/adapters/browser/smzdm)** | `search` | 🔐 Browser |
|
|
25
|
+
| **[jike](/adapters/browser/jike)** | `feed` `search` `post` `topic` `user` `create` `comment` `like` `repost` `notifications` | 🔐 Browser |
|
|
26
|
+
| **[jimeng](/adapters/browser/jimeng)** | `generate` `history` | 🔐 Browser |
|
|
27
|
+
| **[linux-do](/adapters/browser/linux-do)** | `hot` `latest` `categories` `category` `search` `topic` | 🔐 Browser |
|
|
28
|
+
| **[chaoxing](/adapters/browser/chaoxing)** | `assignments` `exams` | 🔐 Browser |
|
|
29
|
+
| **[grok](/adapters/browser/grok)** | `ask` | 🔐 Browser |
|
|
30
|
+
| **[weread](/adapters/browser/weread)** | `shelf` `search` `book` `ranking` `notebooks` `highlights` `notes` | 🔐 Browser |
|
|
24
31
|
|
|
25
32
|
## Public API Adapters
|
|
26
33
|
|
|
@@ -32,6 +39,12 @@ Run `opencli list` for the live registry.
|
|
|
32
39
|
| **[apple-podcasts](/adapters/browser/apple-podcasts)** | `search` `episodes` `top` | 🌐 Public |
|
|
33
40
|
| **[xiaoyuzhou](/adapters/browser/xiaoyuzhou)** | `podcast` `podcast-episodes` `episode` | 🌐 Public |
|
|
34
41
|
| **[yahoo-finance](/adapters/browser/yahoo-finance)** | `quote` | 🌐 Public |
|
|
42
|
+
| **[arxiv](/adapters/browser/arxiv)** | `search` `paper` | 🌐 Public |
|
|
43
|
+
| **[barchart](/adapters/browser/barchart)** | `quote` `options` `greeks` `flow` | 🌐 Public |
|
|
44
|
+
| **[hf](/adapters/browser/hf)** | `top` | 🌐 Public |
|
|
45
|
+
| **[sinafinance](/adapters/browser/sinafinance)** | `news` | 🌐 Public |
|
|
46
|
+
| **[stackoverflow](/adapters/browser/stackoverflow)** | `hot` `search` `bounties` `unanswered` | 🌐 Public |
|
|
47
|
+
| **[wikipedia](/adapters/browser/wikipedia)** | `search` `summary` | 🌐 Public |
|
|
35
48
|
|
|
36
49
|
## Desktop Adapters
|
|
37
50
|
|
|
@@ -26,23 +26,23 @@ brew install yt-dlp
|
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
# Download images/videos from Xiaohongshu note
|
|
29
|
-
opencli xiaohongshu download --
|
|
29
|
+
opencli xiaohongshu download --note-id abc123 --output ./xhs
|
|
30
30
|
|
|
31
31
|
# Download Bilibili video (requires yt-dlp)
|
|
32
32
|
opencli bilibili download --bvid BV1xxx --output ./bilibili
|
|
33
33
|
opencli bilibili download --bvid BV1xxx --quality 1080p
|
|
34
34
|
|
|
35
35
|
# Download Twitter media from user
|
|
36
|
-
opencli twitter download
|
|
36
|
+
opencli twitter download elonmusk --limit 20 --output ./twitter
|
|
37
37
|
|
|
38
38
|
# Download single tweet media
|
|
39
39
|
opencli twitter download --tweet-url "https://x.com/user/status/123" --output ./twitter
|
|
40
40
|
|
|
41
41
|
# Export Zhihu article to Markdown
|
|
42
|
-
opencli zhihu download
|
|
42
|
+
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
|
|
43
43
|
|
|
44
44
|
# Export with local images
|
|
45
|
-
opencli zhihu download
|
|
45
|
+
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Pipeline Step (YAML Adapters)
|
|
@@ -34,8 +34,14 @@ OpenCLI is built on a **Dual-Engine Architecture** that supports both declarativ
|
|
|
34
34
|
### Registry (`src/registry.ts`)
|
|
35
35
|
Central command registry. All adapters register their commands via the `cli()` function with metadata: site, name, description, domain, strategy, args, columns.
|
|
36
36
|
|
|
37
|
-
###
|
|
38
|
-
|
|
37
|
+
### Discovery (`src/discovery.ts`)
|
|
38
|
+
CLI discovery and manifest loading. Discovers commands from YAML and TypeScript adapter files, parses YAML pipelines, and registers them into the central registry.
|
|
39
|
+
|
|
40
|
+
### Execution (`src/execution.ts`)
|
|
41
|
+
Command execution: argument validation, lazy loading of adapter modules, and executing the appropriate handler function.
|
|
42
|
+
|
|
43
|
+
### Commander Adapter (`src/commanderAdapter.ts`)
|
|
44
|
+
Bridges the Registry commands to Commander.js subcommands. Handles positional args, named options, browser session wiring, and output formatting. Isolates all Commander-specific logic so the core is framework-agnostic.
|
|
39
45
|
|
|
40
46
|
### Browser (`src/browser.ts`)
|
|
41
47
|
Manages connections to Chrome via the Browser Bridge WebSocket daemon. Handles JSON-RPC messaging, tab management, and extension/standalone mode switching.
|
|
@@ -60,15 +66,22 @@ OpenCLI uses a 3-tier authentication strategy:
|
|
|
60
66
|
| `public` | Direct HTTP fetch, no auth | Public APIs (HackerNews, BBC) |
|
|
61
67
|
| `cookie` | Reuse Chrome cookies via Browser Bridge | Logged-in sites (Bilibili, Zhihu) |
|
|
62
68
|
| `header` | Custom auth headers | API-key based services |
|
|
69
|
+
| `intercept` | Network request interception | GraphQL/XHR capture (Twitter) |
|
|
70
|
+
| `ui` | DOM interaction via accessibility snapshot | Desktop apps, write operations |
|
|
63
71
|
|
|
64
72
|
## Directory Structure
|
|
65
73
|
|
|
66
74
|
```
|
|
67
75
|
src/
|
|
68
76
|
├── main.ts # Entry point
|
|
69
|
-
├──
|
|
77
|
+
├── cli.ts # Commander.js CLI setup + built-in commands
|
|
78
|
+
├── commanderAdapter.ts # Registry → Commander bridge
|
|
79
|
+
├── discovery.ts # CLI discovery, manifest loading, YAML parsing
|
|
80
|
+
├── execution.ts # Arg validation, command execution
|
|
70
81
|
├── registry.ts # Command registry
|
|
71
|
-
├──
|
|
82
|
+
├── serialization.ts # Command serialization helpers
|
|
83
|
+
├── runtime.ts # Browser session & timeout management
|
|
84
|
+
├── browser/ # Browser Bridge connection
|
|
72
85
|
├── output.ts # Output formatting
|
|
73
86
|
├── doctor.ts # Diagnostic tool
|
|
74
87
|
├── pipeline/ # YAML pipeline engine
|
package/package.json
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# check-doc-coverage.sh — Verify every adapter in src/clis/ has a doc page.
|
|
3
|
+
#
|
|
4
|
+
# Exit codes:
|
|
5
|
+
# 0 — all adapters have docs
|
|
6
|
+
# 1 — at least one adapter is missing documentation
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# bash scripts/check-doc-coverage.sh # report only
|
|
10
|
+
# bash scripts/check-doc-coverage.sh --strict # exit 1 on missing docs
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
STRICT=false
|
|
15
|
+
if [[ "${1:-}" == "--strict" ]]; then
|
|
16
|
+
STRICT=true
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
20
|
+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
21
|
+
|
|
22
|
+
SRC_DIR="$ROOT_DIR/src/clis"
|
|
23
|
+
DOCS_DIR="$ROOT_DIR/docs/adapters"
|
|
24
|
+
|
|
25
|
+
missing=()
|
|
26
|
+
covered=0
|
|
27
|
+
total=0
|
|
28
|
+
|
|
29
|
+
for adapter_dir in "$SRC_DIR"/*/; do
|
|
30
|
+
adapter_name="$(basename "$adapter_dir")"
|
|
31
|
+
total=$((total + 1))
|
|
32
|
+
|
|
33
|
+
# Check if doc exists in browser/ or desktop/ subdirectories
|
|
34
|
+
if [[ -f "$DOCS_DIR/browser/$adapter_name.md" ]] || \
|
|
35
|
+
[[ -f "$DOCS_DIR/desktop/$adapter_name.md" ]]; then
|
|
36
|
+
covered=$((covered + 1))
|
|
37
|
+
else
|
|
38
|
+
# Handle directory name mismatches (e.g., discord-app -> discord)
|
|
39
|
+
alt_name="${adapter_name%-app}"
|
|
40
|
+
if [[ "$alt_name" != "$adapter_name" ]] && \
|
|
41
|
+
{ [[ -f "$DOCS_DIR/browser/$alt_name.md" ]] || \
|
|
42
|
+
[[ -f "$DOCS_DIR/desktop/$alt_name.md" ]]; }; then
|
|
43
|
+
covered=$((covered + 1))
|
|
44
|
+
else
|
|
45
|
+
missing+=("$adapter_name")
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
48
|
+
done
|
|
49
|
+
|
|
50
|
+
echo "📊 Doc Coverage: $covered/$total adapters documented"
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
if [[ ${#missing[@]} -gt 0 ]]; then
|
|
54
|
+
echo "⚠️ Missing docs for ${#missing[@]} adapter(s):"
|
|
55
|
+
for name in "${missing[@]}"; do
|
|
56
|
+
echo " - $name → create docs/adapters/browser/$name.md or docs/adapters/desktop/$name.md"
|
|
57
|
+
done
|
|
58
|
+
echo ""
|
|
59
|
+
if $STRICT; then
|
|
60
|
+
echo "❌ Doc check failed (--strict mode)."
|
|
61
|
+
exit 1
|
|
62
|
+
else
|
|
63
|
+
echo "💡 Run with --strict to fail CI on missing docs."
|
|
64
|
+
exit 0
|
|
65
|
+
fi
|
|
66
|
+
else
|
|
67
|
+
echo "✅ All adapters have documentation."
|
|
68
|
+
exit 0
|
|
69
|
+
fi
|
package/scripts/copy-yaml.cjs
CHANGED
|
@@ -19,3 +19,10 @@ function walk(src, dst) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
walk('src/clis', 'dist/clis');
|
|
22
|
+
|
|
23
|
+
// Copy external CLI registry to dist/
|
|
24
|
+
const extSrc = 'src/external-clis.yaml';
|
|
25
|
+
if (existsSync(extSrc)) {
|
|
26
|
+
mkdirSync('dist', { recursive: true });
|
|
27
|
+
copyFileSync(extSrc, 'dist/external-clis.yaml');
|
|
28
|
+
}
|
package/src/browser/cdp.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Shared DOM helper methods extracted to reduce duplication with Page (P1 #5)
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { WebSocket } from 'ws';
|
|
11
|
+
import { WebSocket, type RawData } from 'ws';
|
|
12
12
|
import type { IPage } from '../types.js';
|
|
13
13
|
import { wrapForEval } from './utils.js';
|
|
14
14
|
import {
|
|
@@ -63,12 +63,12 @@ export class CDPBridge {
|
|
|
63
63
|
resolve(new CDPPage(this));
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
ws.on('error', (err) => {
|
|
66
|
+
ws.on('error', (err: Error) => {
|
|
67
67
|
clearTimeout(timeout);
|
|
68
68
|
reject(err);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
ws.on('message', (data) => {
|
|
71
|
+
ws.on('message', (data: RawData) => {
|
|
72
72
|
try {
|
|
73
73
|
const msg = JSON.parse(data.toString());
|
|
74
74
|
// Handle command responses
|
|
@@ -158,12 +158,17 @@ class CDPPage implements IPage {
|
|
|
158
158
|
constructor(private bridge: CDPBridge) {}
|
|
159
159
|
|
|
160
160
|
/** Navigate with proper load event waiting (P1 fix #3) */
|
|
161
|
-
async goto(url: string): Promise<void> {
|
|
161
|
+
async goto(url: string, options?: { waitUntil?: 'load' | 'none'; settleMs?: number }): Promise<void> {
|
|
162
162
|
await this.bridge.send('Page.enable');
|
|
163
163
|
const loadPromise = this.bridge.waitForEvent('Page.loadEventFired', 30_000)
|
|
164
164
|
.catch(() => {}); // Don't fail if event times out
|
|
165
165
|
await this.bridge.send('Page.navigate', { url });
|
|
166
166
|
await loadPromise;
|
|
167
|
+
// Post-load settle: SPA frameworks need extra time to render after load event
|
|
168
|
+
if (options?.waitUntil !== 'none') {
|
|
169
|
+
const settleMs = options?.settleMs ?? 1000;
|
|
170
|
+
await new Promise(resolve => setTimeout(resolve, settleMs));
|
|
171
|
+
}
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
async evaluate(js: string): Promise<any> {
|
package/src/browser/page.ts
CHANGED
|
@@ -42,7 +42,7 @@ export class Page implements IPage {
|
|
|
42
42
|
return { workspace: this.workspace };
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async goto(url: string): Promise<void> {
|
|
45
|
+
async goto(url: string, options?: { waitUntil?: 'load' | 'none'; settleMs?: number }): Promise<void> {
|
|
46
46
|
const result = await sendCommand('navigate', {
|
|
47
47
|
url,
|
|
48
48
|
...this._workspaceOpt(),
|
|
@@ -52,6 +52,12 @@ export class Page implements IPage {
|
|
|
52
52
|
if (result?.tabId) {
|
|
53
53
|
this._tabId = result.tabId;
|
|
54
54
|
}
|
|
55
|
+
// Post-load settle: the extension already waits for tab.status === 'complete',
|
|
56
|
+
// but SPA frameworks (React/Vue) need extra time to render after DOM load.
|
|
57
|
+
if (options?.waitUntil !== 'none') {
|
|
58
|
+
const settleMs = options?.settleMs ?? 1000;
|
|
59
|
+
await new Promise(resolve => setTimeout(resolve, settleMs));
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
/** Close the automation window in the extension */
|
package/src/build-manifest.ts
CHANGED
|
@@ -196,26 +196,29 @@ function scanYaml(filePath: string, site: string): ManifestEntry | null {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
function scanTs(filePath: string, site: string): ManifestEntry {
|
|
199
|
+
function scanTs(filePath: string, site: string): ManifestEntry | null {
|
|
200
200
|
// TS adapters self-register via cli() at import time.
|
|
201
201
|
// We statically parse the source to extract metadata for the manifest stub.
|
|
202
202
|
const baseName = path.basename(filePath, path.extname(filePath));
|
|
203
203
|
const relativePath = `${site}/${baseName}.js`;
|
|
204
204
|
|
|
205
|
-
const entry: ManifestEntry = {
|
|
206
|
-
site,
|
|
207
|
-
name: baseName,
|
|
208
|
-
description: '',
|
|
209
|
-
strategy: 'cookie',
|
|
210
|
-
browser: true,
|
|
211
|
-
args: [],
|
|
212
|
-
type: 'ts',
|
|
213
|
-
modulePath: relativePath,
|
|
214
|
-
};
|
|
215
|
-
|
|
216
205
|
try {
|
|
217
206
|
const src = fs.readFileSync(filePath, 'utf-8');
|
|
218
207
|
|
|
208
|
+
// Helper/test modules should not appear as CLI commands in the manifest.
|
|
209
|
+
if (!/\bcli\s*\(/.test(src)) return null;
|
|
210
|
+
|
|
211
|
+
const entry: ManifestEntry = {
|
|
212
|
+
site,
|
|
213
|
+
name: baseName,
|
|
214
|
+
description: '',
|
|
215
|
+
strategy: 'cookie',
|
|
216
|
+
browser: true,
|
|
217
|
+
args: [],
|
|
218
|
+
type: 'ts',
|
|
219
|
+
modulePath: relativePath,
|
|
220
|
+
};
|
|
221
|
+
|
|
219
222
|
// Extract description
|
|
220
223
|
const descMatch = src.match(/description\s*:\s*['"`]([^'"`]*)['"`]/);
|
|
221
224
|
if (descMatch) entry.description = descMatch[1];
|
|
@@ -244,11 +247,13 @@ function scanTs(filePath: string, site: string): ManifestEntry {
|
|
|
244
247
|
if (argsBlock) {
|
|
245
248
|
entry.args = parseTsArgsBlock(argsBlock);
|
|
246
249
|
}
|
|
247
|
-
} catch {
|
|
248
|
-
// If parsing fails, fall back to empty metadata — module will self-register at runtime
|
|
249
|
-
}
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
return entry;
|
|
252
|
+
} catch (err: any) {
|
|
253
|
+
// If parsing fails, log a warning (matching scanYaml behaviour) and skip the entry.
|
|
254
|
+
process.stderr.write(`Warning: failed to scan ${filePath}: ${err.message}\n`);
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
252
257
|
}
|
|
253
258
|
|
|
254
259
|
export function buildManifest(): ManifestEntry[] {
|
|
@@ -264,10 +269,11 @@ export function buildManifest(): ManifestEntry[] {
|
|
|
264
269
|
const entry = scanYaml(filePath, site);
|
|
265
270
|
if (entry) manifest.push(entry);
|
|
266
271
|
} else if (
|
|
267
|
-
(file.endsWith('.ts') && !file.endsWith('.d.ts') && file !== 'index.ts') ||
|
|
268
|
-
(file.endsWith('.js') && !file.endsWith('.d.js') && file !== 'index.js')
|
|
272
|
+
(file.endsWith('.ts') && !file.endsWith('.d.ts') && !file.endsWith('.test.ts') && file !== 'index.ts') ||
|
|
273
|
+
(file.endsWith('.js') && !file.endsWith('.d.js') && !file.endsWith('.test.js') && file !== 'index.js')
|
|
269
274
|
) {
|
|
270
|
-
|
|
275
|
+
const entry = scanTs(filePath, site);
|
|
276
|
+
if (entry) manifest.push(entry);
|
|
271
277
|
}
|
|
272
278
|
}
|
|
273
279
|
}
|