mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
1d39295f4b
* feat: plugin system (Stage 0-2) - Stage 0: discoverPlugins() scans ~/.opencli/plugins/ at startup - Stage 1: demo plugin repos (github-trending, hot-digest) - Stage 2: opencli plugin install/uninstall/list commands - package.json exports ./registry for TS plugin peerDep support - 17 new/updated tests, tsc --noEmit clean * fix: CDPBridge connect timeout unit mismatch (seconds vs ms) opts.timeout is passed in seconds from runtime.ts but CDPBridge was using it as milliseconds, causing instant timeout (30ms). * feat: add registry-api public entry point for TS plugin peerDep support - Add src/registry-api.ts: re-exports core registration API (cli, Strategy, getRegistry) without transitive side-effects, safe for plugin imports - Update package.json exports: './registry' -> './dist/registry-api.js' - Update src/registry.ts: use globalThis shared registry to ensure single instance across npm-linked plugin modules - Update .gitignore for plugin-related artifacts * fix: symlink host opencli into plugin node_modules on install After npm install, replace the npm-installed @jackwener/opencli with a symlink to the running host's package root. This ensures TS plugins always resolve '@jackwener/opencli/registry' against the host installation, avoiding version mismatches when the published npm package lags behind. * fix: transpile TS plugins to JS on install, deduplicate .ts/.js discovery - installPlugin: after symlinking host opencli, transpile any .ts files to .js using esbuild from the host's node_modules/.bin/ - discoverPluginDir: skip .ts files when a .js sibling exists (production node cannot load .ts directly) - scanPluginCommands: deduplicate basenames via Set to avoid showing 'aggregate, aggregate' when both .ts and .js exist * docs: add plugin system user guide - New docs/guide/plugins.md covering: - Installation/uninstallation commands - Creating YAML plugins (zero-dep) - Creating TS plugins (with peerDep) - TS plugin install lifecycle (clone → deps → symlink → transpile) - Example plugins and troubleshooting - Add Plugins to VitePress sidebar (EN + ZH) - Link from getting-started.md Next Steps * fix: address review issues in plugin system - Security: replace execSync with execFileSync to prevent shell injection - Replace deprecated npm --production with --omit=dev - Tighten parseSource regex to [\w.-]+ to reject special chars - Fix ZH sidebar plugin link (/guide/plugins → /zh/guide/plugins) - Return plugin name from installPlugin() to avoid duplicated logic - Use execFileSync for esbuild transpilation - Fix misleading comment in linkHostOpencli --------- Co-authored-by: jackwener <jakevingoo@gmail.com>
22 lines
218 B
Plaintext
22 lines
218 B
Plaintext
node_modules/
|
|
dist/
|
|
!extension/dist/
|
|
*.tsbuildinfo
|
|
.opencli/
|
|
.mcp.json
|
|
*.log
|
|
.DS_Store
|
|
|
|
# VitePress
|
|
docs/.vitepress/dist
|
|
docs/.vitepress/cache
|
|
|
|
# Extensions & Secrets
|
|
*.pem
|
|
*.crx
|
|
*.zip
|
|
.envrc
|
|
.windsurf
|
|
.claude
|
|
.cortex
|