feat: crate package support#4
Conversation
|
This is a really cool direction. I'll need to get back to you on it in the next couple of days. |
|
Sure, I tried to make it as agnostic as possible to open up support for other packages like Go, Python, etc. in next pull requests, but I feel like I'm missing something. Anyway, thanks for taking a look when you have a moment :) |
|
So, thinking a bit on this, I think it definitely has its place, but there are a few items on the roadmap I want to sort before we ship cross-language support.
My current concern is that going too broad before there's enough feedback will make quicker iterations more difficult. But I'm keen to ship this stuff as quickly as possible as the package needs to gain as much momentum as it can while still nailing the DX so I don't think we need to wait too long to merge (2-3 weeks). |
|
I was also thinking about this after submitting this pull request and will change it to a draft for now. I was wondering what exactly was missing from an agnostic perspective. I've been using Rust and Python, and various languages for agents depending on my needs, which is where this PR came from. However, after its creation, I realized there was a gap in the node ecosystem itself. There was no package that aggregated information from various registries from different languages into a single form, cached it, and made it usable offline. I'm currently working on:
And once that's released, I'll modify this PR to support my package, which will then support all registries simultaneously. And thanks so much for skilld! |
|
That sounds really useful, I would be very happy to receive that PR :) |
Adds `skilld add crate:<name>` for generating skills from crates.io docs. Routed through the new prefix parser alongside npm/gh/@-prefixes. - SkillSource gains a `crate` variant; `resolveSkillName` returns `crate:<name>` - New resolveCrateDocsWithAttempts hits crates.io, prefers docs.rs for versioned URLs, enriches from GitHub when applicable, and discovers llms.txt - Rate-limited via shared createRateLimitedRunner; SKILLD_USER_AGENT constant and retry-on-429/5xx for ofetch consumers - Storage/identity split: lockfile stores crate:<name>, cache/symlinks use @skilld-crate/<name> to avoid colliding with npm packages of the same name - Single-package path serializes crate syncs (respects crates.io rate limit) while npm batches keep the parallel path - toStoragePackageName applied to prepare/install/status/search-helpers so restore, doc counts, and search index lookups resolve crate cache paths - Bulk `skilld update` now includes all installed crate skills
a4208bd to
96f6f05
Compare
|
Force-pushed a rewrite onto this branch that rebuilds crate support on top of the new prefix parser ( What changed from the original PR
What was kept from the original
Verification
|
Description
This PR adds Rust crate support to
skilldwithcrate:<name>(e.g.skilld add crate:serde), while preserving existing npm/git behavior.What’s included:
src/sources/crates.ts)src/commands/sync.ts)@skilld-crate/<name>) and crate identity (crate:<name>) in lock metadatasrc/sources/utils.tsTests:
test/unit/sources-crates.test.tstest/unit/sync-crate-routing.test.tstest/unit/sync-crate-version.test.tstest/e2e/crate-smoke.test.tsValidation:
pnpm typecheckpassespnpm buildpassesLinked Issues
N/A
Additional context
Please focus review on namespace separation and cache/identity consistency in
src/commands/sync.ts.