Commit 4042e61
authored
feat(fetchers): add PackageRegistryFetcher for PyPI, crates.io, npm (#65)
## What
Adds a `PackageRegistryFetcher` handling PyPI, crates.io, and npm
package URLs with structured metadata via their JSON APIs.
Closes #54
## Why
Agents evaluating dependencies need quick access to version, license,
and dependency info without parsing noisy registry HTML. Directly
supports the AGENTS.md requirement to avoid non-permissive licenses.
## How
- Single fetcher with sub-matching for three registries
- PyPI: `pypi.org/project/{name}` via `pypi.org/pypi/{name}/json`
- crates.io: `crates.io/crates/{name}` via
`crates.io/api/v1/crates/{name}`
- npm: `npmjs.com/package/{name}` via `registry.npmjs.org/{name}`
- Supports version-specific PyPI URLs and scoped npm packages
- Format field: `"package_registry"`
## Risk
- Low
### Checklist
- [x] Unit tests passed
- [x] Clippy clean
- [x] Formatting applied1 parent ad3d30a commit 4042e61
File tree
3 files changed
+525
-4
lines changed- crates/fetchkit/src
- fetchers
3 files changed
+525
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
296 | | - | |
| 299 | + | |
297 | 300 | | |
298 | 301 | | |
299 | 302 | | |
300 | 303 | | |
301 | 304 | | |
302 | | - | |
303 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
| |||
0 commit comments