feat: add registry command to manage global and local skill registries, drop built-in registries#19
feat: add registry command to manage global and local skill registries, drop built-in registries#19jakemac53 wants to merge 14 commits into
Conversation
…s, drop built-in registries
…and the dir name also is just that URI
…orphaned skills when registries are uninstalled
|
cc @vlidholt I have a few prs out if you could help me get reviews :) |
Hi @jakemac53! I just approved and merged your other #14 PR, but only afterwards I saw this note. Indeed, losing registries on a Also, whenever you need an opinion or review, just mark me on a comment or for review and I'll try to contribute. But feel free to merge other smaller/simple changes directly. |
I don't think the pubspec is a good place because in many cases you wouldn't want these settings to be persistent across all users (maybe some developers of the package want certain skills but others don't etc). There will also be a lot more configuration and data stored here in the future - specific information about exactly which skills were installed, at what versions, etc etc. That information is almost certainly specific to an individual user.
Ok, I do generally want reviews but I could add a googler for those reviews instead for some of these |
|
Another idea I had to resolve this is to basically have a "recovery" mode based on metadata injected into each installed skill directory. So if this package installs a skill it dumps a file in there saying where it came from, also some of the info such as the version or hash of its contents. Some of that data may only exist in the skill install dir. This way we could recover the config as long as any skill was in fact installed from a registry. |
|
cc @kenzieschmoll did you want to look at this? I am curious what your thoughts are in particular around the local configuration location. |
|
|
| final globalConfigFile = File(globalConfigPath); | ||
| final globalConfig = await GlobalConfig.loadOrEmpty(globalConfigFile); | ||
|
|
||
| final removalLists = await (rest.isEmpty |
There was a problem hiding this comment.
should there be an easy way to remove all?
There was a problem hiding this comment.
I don't think its as necessary for this one, you won't have nearly as many registries as skills.
| final parts = arg.split('/'); | ||
| if (parts.length != 2) { |
There was a problem hiding this comment.
would a git uri pass this check?
There was a problem hiding this comment.
This whole code path is only meant to handle the owner/repo format, which we special case for GitHub repos.
Anything with a : or an @ (http or ssh URIs) will fall back to the simpler case where we just use the URI directly.
This task ended up snowballing a lot and includes various registry related improvements and a new set of commands:
registry add,registry list, andregistry removecommands.Closes dart-lang/ai#463
Note that this PR and #14 are stepping on each toes a bit, whichever lands first though I can reconcile the other one. Or possibly we should just not do #14, as deleting .dart_tool will end up also effectively removing any locally installed registries as well, I am a bit unsure about that.