skills-package-manager 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,7 +31,9 @@ spm add owner/repo --skill find-skills
31
31
 
32
32
  # Direct specifier — skip discovery
33
33
  spm add https://github.com/owner/repo.git#path:/skills/my-skill
34
- spm add file:./local-source#path:/skills/my-skill
34
+ spm add link:./local-source/skills/my-skill
35
+ spm add file:./skills-package.tgz#path:/skills/my-skill
36
+ spm add npm:@scope/skills-package#path:/skills/my-skill
35
37
  ```
36
38
 
37
39
  After `spm add`, the newly added skills are resolved, materialized into `installDir`, and linked to each configured `linkTarget` immediately.
@@ -86,7 +88,7 @@ This resolves each skill from its specifier, materializes it into `installDir` (
86
88
 
87
89
  ### `spm update`
88
90
 
89
- Refresh git-based skills declared in `skills.json` without changing the manifest:
91
+ Refresh resolvable skills declared in `skills.json` without changing the manifest:
90
92
 
91
93
  ```bash
92
94
  spm update
@@ -96,8 +98,8 @@ spm update find-skills rspress-custom-theme
96
98
  Behavior:
97
99
 
98
100
  - Uses `skills.json` as the source of truth
99
- - Re-resolves git refs to the latest commit
100
- - Skips `file:` skills
101
+ - Re-resolves git refs and npm package targets
102
+ - Skips `link:` skills
101
103
  - Fails immediately for unknown skill names
102
104
  - Writes `skills-lock.yaml` only after fetch and link succeed
103
105
 
@@ -123,13 +125,14 @@ const skills = await listRepoSkills('vercel-labs', 'skills')
123
125
 
124
126
  ## Specifier Format
125
127
 
126
- ```
127
- <source>#[ref&]path:<skill-path>
128
+ ```text
129
+ git/file/npm: <source>#[ref&]path:<skill-path>
130
+ link: link:<path-to-skill-dir>
128
131
  ```
129
132
 
130
133
  | Part | Description | Example |
131
134
  |------|-------------|---------|
132
- | `source` | Git URL or `file:` path | `https://github.com/o/r.git`, `file:./local` |
135
+ | `source` | Git URL, direct `link:` skill path, `file:` tarball, or `npm:` package name | `https://github.com/o/r.git`, `link:./local/skills/my-skill`, `file:./skills.tgz`, `npm:@scope/pkg` |
133
136
  | `ref` | Optional git ref | `main`, `v1.0.0`, `HEAD`, `6cb0992`, `6cb0992a176f2ca142e19f64dca8ac12025b035e` |
134
137
  | `path` | Path to skill directory within source | `/skills/my-skill` |
135
138
 
@@ -138,7 +141,11 @@ const skills = await listRepoSkills('vercel-labs', 'skills')
138
141
  ### Resolution Types
139
142
 
140
143
  - **`git`** — Clones the repo, resolves commit hash, copies skill files
141
- - **`file`** — Reads from local filesystem, computes content digest
144
+ - **`link`** — Reads from a local directory and copies the selected skill
145
+ - **`file`** — Extracts a local `tgz` package and copies the selected skill
146
+ - **`npm`** — Resolves a package from the configured npm registry, locks the tarball URL/version/integrity, and installs from the downloaded tarball
147
+
148
+ `npm:` reads `registry` and scoped `@scope:registry` values from `.npmrc`. Matching `:_authToken`, `:_auth`, or `username` + `:_password` entries are also used for private registry requests.
142
149
 
143
150
  ## Architecture
144
151
 
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from "../dist/index.js";
3
- runCli(process.argv).catch((error)=>{
4
- console.error(error instanceof Error ? error.message : error);
5
- process.exitCode = 1;
6
- });
2
+ import { formatErrorForDisplay, getExitCode, isSpmError, runCli } from '../dist/index.js'
3
+
4
+ runCli(process.argv).catch((error) => {
5
+ if (isSpmError(error)) {
6
+ console.error(formatErrorForDisplay(error))
7
+ process.exit(getExitCode(error))
8
+ }
9
+ console.error(error instanceof Error ? error.message : error)
10
+ process.exit(1)
11
+ })
package/bin/spm.js CHANGED
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from "../dist/index.js";
3
- runCli(process.argv).catch((error)=>{
4
- console.error(error instanceof Error ? error.message : error);
5
- process.exitCode = 1;
6
- });
2
+ import { formatErrorForDisplay, getExitCode, isSpmError, runCli } from '../dist/index.js'
3
+
4
+ runCli(process.argv).catch((error) => {
5
+ if (isSpmError(error)) {
6
+ console.error(formatErrorForDisplay(error))
7
+ process.exit(getExitCode(error))
8
+ }
9
+ console.error(error instanceof Error ? error.message : error)
10
+ process.exit(1)
11
+ })