A complete automated plugin metadata aggregation system that:
- Reads plugin metadata (
meta.json) from the plugins directory - Fetches version info from remote
update.jsonURLs - Merges remote versions with manual patches
- Validates compatibility constraints
- Generates JSON outputs for frontend consumption
- Reports results to GitHub (PRs & issues)
- CLI → bot/src/cli.ts - Entry point
- Build → bot/src/build.ts - Orchestration
- Loader → bot/src/loaders/ - Read inputs
- Merger → bot/src/merger.ts - Combine versions
- Processor → bot/src/processor.ts - Generate outputs
- Report → bot/src/report.ts - Communicate results
- bot/src/utils/http.ts - GitHub-aware HTTP client
- bot/src/utils/xpi.ts - XPI download & parsing
- bot/src/utils/git.ts - Git operations
- bot/src/github-reporter.ts - GitHub API
- shared/src/types.ts - Type definitions (PluginMeta, Version, etc.)
- shared/schemas/meta.schema.json - JSON schema for validation
{
"id": "plugin@domain",
"name": "Plugin Name",
"updateUrl": "https://example.com/update.json",
"tags": ["metadata", "ai"],
"patchedVersions": [
{ "version": "1.0.0", "update_link": "..." }
]
}Remote Versions (from update.json)
↓
[Merge Strategy]
↓
Patched Versions (from meta.json)
↓
[Sort by SemVer]
↓
Final Version List
{
"...": "base meta.json fields",
"versions": ["complete merged list"],
"latestVersion": "1.26.0",
"compatibleApps": { "zotero": { "min": "6.0", "max": "8.*" } }
}{
"pluginId": "plugin@domain",
"version": "1.26.0",
"update_link": "https://...",
"strict_min_version": "6.0",
"strict_max_version": "8.*"
}# Build all plugins
pnpm exec tsx bot/src/cli.ts build
# Build specific plugin(s)
pnpm exec tsx bot/src/cli.ts build plugin-id-1 plugin-id-2
# Check mode (for PR validation)
pnpm exec tsx bot/src/cli.ts check
# Show help
pnpm exec tsx bot/src/cli.ts --helpProcessResult tracks:
success: string[]- Successfully processed plugin IDserrors: PluginError[]- Failed plugins with stage + message
Stages: schema | fetch | xpi | merge | validation
Exit Codes:
- 0: Success (no errors)
- 1: Failures detected
- Detects changed plugins
- Validates meta.json schema
- Comments on PR with errors (if any)
- Processes all plugins
- Creates/updates GitHub issue with summary
- Labels:
plugin-sync,automated
GITHUB_TOKEN: Authentication for GitHub requestsCI: Set to 'true' in GitHub ActionsGITHUB_EVENT_NAME: 'pull_request' for PRsGITHUB_REPOSITORY: 'owner/repo' format
semver: Version comparisonsimple-git: Git operationscommander: CLI frameworkconsola: Pretty loggingoctokit: GitHub API
- Remote versions added first (source of truth)
- Patched versions override on conflict
- Enables manual fixes without waiting for upstream
- Attempts semver comparison
- Falls back to string comparison for non-semver versions
- Handles both Zotero 7+ (
zotero) and Zotero 6 (gecko) formats
- Auto-detects GitHub domains
- Applies Bearer token to GitHub URLs
- 10-second timeout for normal requests
- 30-second timeout for XPI downloads
- Implement GitHub Actions workflow (.github/workflows/sync.yml)
- Add HTTP caching for bandwidth optimization
- Add XPI download + integrity verification
- Add unit tests for merger logic
- Document API for frontend consumption
Status: ✅ Core implementation complete and tested