@hasna/skills 0.1.58 → 0.1.59
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 +53 -50
- package/bin/index.js +3501 -3163
- package/bin/mcp.js +2621 -2428
- package/bin/migrate.js +70 -0
- package/bin/server.js +33666 -0
- package/bin/worker.js +30939 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3384 -3137
- package/dist/lib/config.d.ts +2 -2
- package/dist/lib/content-scan.d.ts +69 -0
- package/dist/lib/discovery.d.ts +1 -0
- package/dist/lib/packlist.d.ts +13 -0
- package/dist/lib/portable-skills.d.ts +46 -1
- package/dist/lib/project-state.d.ts +4 -1
- package/dist/lib/public-boundary.d.ts +31 -0
- package/dist/lib/registry-types.d.ts +13 -1
- package/dist/lib/remote-registry.d.ts +2 -2
- package/dist/lib/skill-validation.d.ts +5 -1
- package/dist/lib/skillinfo.d.ts +15 -0
- package/dist/storage.js +18 -6
- package/docs/skill-standard.md +34 -4
- package/migrations/0001_open_skills_self_hosted.sql +129 -0
- package/package.json +11 -3
- package/skills/browse/README.md +1 -1
- package/skills/browse/SKILL.md +1 -1
- package/skills/deepresearch/README.md +1 -1
- package/skills/deepresearch/SKILL.md +1 -1
- package/skills/image/README.md +1 -1
- package/skills/tmux-session/SKILL.md +2 -2
- package/skills/transcript/SKILL.md +1 -1
- package/skills/webcrawling/README.md +1 -1
- package/skills/apidocs/.claude/settings.json +0 -5
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ Requires [Bun](https://bun.sh/) 1.0+.
|
|
|
19
19
|
# Browse skills interactively
|
|
20
20
|
skills
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
skills setup --mode hosted
|
|
24
|
-
skills auth login
|
|
22
|
+
# Self-hosted setup points the CLI at the Hasna-owned API
|
|
23
|
+
skills setup --mode self-hosted
|
|
24
|
+
skills auth login --api-key "$SKILLS_API_KEY"
|
|
25
25
|
|
|
26
26
|
# Local-only setup stays available and does not require an account
|
|
27
27
|
skills setup --mode local
|
|
@@ -35,7 +35,7 @@ skills setup agents
|
|
|
35
35
|
# See what a skill needs
|
|
36
36
|
skills info image
|
|
37
37
|
|
|
38
|
-
# Premium skills run through the configured hosted API
|
|
38
|
+
# Premium skills run through the configured self-hosted API
|
|
39
39
|
skills run image "a cat sitting on a windowsill"
|
|
40
40
|
|
|
41
41
|
# Free/local skills can still use your own provider keys when documented
|
|
@@ -43,27 +43,29 @@ skills requires brand-style-guide
|
|
|
43
43
|
OPENAI_API_KEY=... skills run brand-style-guide ./brand-notes.md
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Self-Hosted Runtime Skills
|
|
47
47
|
|
|
48
|
-
Premium skills are hosted
|
|
49
|
-
configured hosted API, create local run metadata, and then expose status
|
|
50
|
-
artifact commands. They do not fall back to bundled local execution when
|
|
51
|
-
missing or the
|
|
48
|
+
Premium skills are self-hosted runs. The CLI and MCP server submit them to the
|
|
49
|
+
configured self-hosted API, create local run metadata, and then expose status
|
|
50
|
+
and artifact commands. They do not fall back to bundled local execution when
|
|
51
|
+
auth is missing or the self-hosted runtime is unavailable.
|
|
52
52
|
|
|
53
|
-
Use `SKILLS_API_KEY` or `skills auth login` for premium hosted
|
|
53
|
+
Use `SKILLS_API_KEY` or `skills auth login --api-key` for premium self-hosted
|
|
54
|
+
execution:
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
|
-
skills setup --mode hosted
|
|
57
|
-
skills auth login
|
|
57
|
+
skills setup --mode self-hosted --api-url https://skills.md
|
|
58
|
+
skills auth login --api-key "$SKILLS_API_KEY"
|
|
58
59
|
skills run image "editorial product photo on a white sweep"
|
|
59
60
|
skills runs status <run-id>
|
|
60
61
|
skills exports download <run-id>
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
Browser/device-code and email-code login commands are retained for compatible
|
|
65
|
+
deployments. The Hasna self-hosted deployment can bootstrap with a provisioned
|
|
66
|
+
API key via `skills auth login --api-key`.
|
|
65
67
|
|
|
66
|
-
`SKILLS_API_KEY` is the hosted
|
|
68
|
+
`SKILLS_API_KEY` is the self-hosted API credential. It is not a provider
|
|
67
69
|
credential. Provider keys such as `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or
|
|
68
70
|
`GEMINI_API_KEY` remain supported only for free/local OSS skills whose
|
|
69
71
|
requirements explicitly document local provider use.
|
|
@@ -77,8 +79,8 @@ requirements explicitly document local provider use.
|
|
|
77
79
|
| `skills pin --category "Development Tools"` | | Pin all skills in a category |
|
|
78
80
|
| `skills unpin <name>` | | Remove a project pin |
|
|
79
81
|
| `skills pins list` | | List pinned skills |
|
|
80
|
-
| `skills setup --mode hosted` | | Configure hosted mode with a compatible API origin |
|
|
81
|
-
| `skills setup --mode local` | | Configure local-only mode without hosted credentials |
|
|
82
|
+
| `skills setup --mode self-hosted` | | Configure self-hosted mode with a compatible API origin |
|
|
83
|
+
| `skills setup --mode local` | | Configure local-only mode without self-hosted credentials |
|
|
82
84
|
| `skills setup agents` | | Register the Skills MCP server with all supported agents |
|
|
83
85
|
| `skills list` | `ls` | List available skills (filter with `-c`, `--pinned`, `-t`, `--brief`) |
|
|
84
86
|
| `skills search <query>` | `s` | Search by name, description, or tags |
|
|
@@ -97,11 +99,12 @@ requirements explicitly document local provider use.
|
|
|
97
99
|
| `skills doctor` | | Check env vars, system deps, and pinned skill health |
|
|
98
100
|
| `skills test [name]` | | Test skill readiness (env, system, npm deps) |
|
|
99
101
|
| `skills outdated` | | Compare pinned vs registry versions |
|
|
100
|
-
| `skills auth login
|
|
101
|
-
| `skills
|
|
102
|
-
| `skills billing
|
|
103
|
-
| `skills billing
|
|
104
|
-
| `skills
|
|
102
|
+
| `skills auth login --api-key <key>` | | Verify and store a self-hosted API key |
|
|
103
|
+
| `skills auth login` | | Sign in to a compatible API with browser/device-code auth or email code |
|
|
104
|
+
| `skills billing status` | | Show self-hosted account plan and balance |
|
|
105
|
+
| `skills billing checkout` | | Create a checkout session when billing is enabled |
|
|
106
|
+
| `skills billing portal` | | Create a customer portal session when billing is enabled |
|
|
107
|
+
| `skills credits buy <amount>` | | Create a credit-pack checkout session when billing is enabled |
|
|
105
108
|
| `skills setup-info` | | Version, pinned skills, agent configs, paths |
|
|
106
109
|
| `skills export` | | Export pinned skills as JSON |
|
|
107
110
|
| `skills import <file>` | | Pin skills from a JSON export |
|
|
@@ -171,7 +174,7 @@ Stable command shapes:
|
|
|
171
174
|
`{ "dryRun": true, "actions": [...] }` where applicable.
|
|
172
175
|
- Runtime: `run --json <skill> ...` returns
|
|
173
176
|
`{ "skill", "args", "exitCode", "stdout", "stderr", "error", "run" }`.
|
|
174
|
-
Premium
|
|
177
|
+
Premium self-hosted runs include `{ "contractVersion": 1, "remote": true,
|
|
175
178
|
"remoteRun", "pricing", "run", "nextActions" }` and return immediately with
|
|
176
179
|
status commands such as `skills runs status <run-id>` and
|
|
177
180
|
`skills exports download <run-id>`.
|
|
@@ -183,15 +186,15 @@ Stable command shapes:
|
|
|
183
186
|
- MCP registration: `mcp --register <agent> --json` returns
|
|
184
187
|
`{ "registered": number, "results": [...] }`.
|
|
185
188
|
|
|
186
|
-
##
|
|
189
|
+
## Self-Hosted Registry Mode
|
|
187
190
|
|
|
188
191
|
Local bundled skills remain the default for discovery. To point browse/search
|
|
189
|
-
commands at a compatible hosted registry, set an API base URL:
|
|
192
|
+
commands at a compatible self-hosted registry, set an API base URL:
|
|
190
193
|
|
|
191
194
|
```bash
|
|
192
|
-
export SKILLS_API_URL=https://
|
|
195
|
+
export SKILLS_API_URL=https://your-server.example
|
|
193
196
|
# or persist it:
|
|
194
|
-
skills config set apiUrl https://
|
|
197
|
+
skills config set apiUrl https://your-server.example
|
|
195
198
|
|
|
196
199
|
skills list --remote --json
|
|
197
200
|
skills search transcribe --remote --json
|
|
@@ -199,12 +202,12 @@ skills categories --remote
|
|
|
199
202
|
skills tags --remote --json
|
|
200
203
|
```
|
|
201
204
|
|
|
202
|
-
If the URL is an origin such as `https://
|
|
205
|
+
If the URL is an origin such as `https://your-server.example`, the CLI requests
|
|
203
206
|
`/api/v1/skills`. If it already ends in `/api` or `/api/v1`, the CLI appends
|
|
204
207
|
`/skills`.
|
|
205
208
|
|
|
206
|
-
Authenticated
|
|
207
|
-
or the credential saved by `skills auth login`.
|
|
209
|
+
Authenticated registry listing and self-hosted premium execution use
|
|
210
|
+
`SKILLS_API_KEY` or the credential saved by `skills auth login --api-key`.
|
|
208
211
|
|
|
209
212
|
For the reusable upstream contract, see
|
|
210
213
|
`docs/architecture/reusable-skills-engine.md`.
|
|
@@ -273,24 +276,25 @@ skills mcp --register claude # Auto-register with Claude Code
|
|
|
273
276
|
skills mcp --register all # Register with all supported agents
|
|
274
277
|
```
|
|
275
278
|
|
|
276
|
-
## Hosted
|
|
279
|
+
## Self-Hosted API
|
|
277
280
|
|
|
278
281
|
```bash
|
|
279
|
-
skills setup --mode hosted
|
|
280
|
-
skills auth login
|
|
282
|
+
skills setup --mode self-hosted --api-url https://skills.md
|
|
283
|
+
skills auth login --api-key "$SKILLS_API_KEY"
|
|
281
284
|
skills billing status
|
|
282
285
|
```
|
|
283
286
|
|
|
284
|
-
|
|
285
|
-
The public package only
|
|
286
|
-
|
|
287
|
+
Self-hosted account, run, log, artifact, and optional billing commands use the
|
|
288
|
+
configured self-hosted API. The public package stores only local configuration
|
|
289
|
+
and CLI credentials. Runtime state belongs in Postgres and artifacts can be
|
|
290
|
+
stored in S3 when `HASNA_SKILLS_S3_BUCKET` is configured.
|
|
287
291
|
|
|
288
292
|
## Storage Boundary
|
|
289
293
|
|
|
290
|
-
|
|
294
|
+
Hasna Skills is local-first. Project runtime state stays in `.skills/`; global
|
|
291
295
|
config and auth stay under `~/.hasna/skills/`.
|
|
292
296
|
|
|
293
|
-
Optional repo-native sync can be configured without a hosted
|
|
297
|
+
Optional repo-native sync can be configured without a self-hosted API account:
|
|
294
298
|
|
|
295
299
|
```bash
|
|
296
300
|
HASNA_SKILLS_STORAGE_MODE=hybrid # local | remote | hybrid
|
|
@@ -310,11 +314,9 @@ import { getStorageStatus, resolveStorageConfig } from "@hasna/skills/storage";
|
|
|
310
314
|
```
|
|
311
315
|
|
|
312
316
|
Plain `SKILLS_DATABASE_URL`, `SKILLS_STORAGE_MODE`, and `SKILLS_S3_BUCKET`
|
|
313
|
-
fallbacks are accepted for local development.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
wrapper envs into `HASNA_SKILLS_*` rather than passing the private SaaS database
|
|
317
|
-
implicitly.
|
|
317
|
+
fallbacks are accepted for local development. Self-hosted deployments should map
|
|
318
|
+
runtime database and artifact settings into `HASNA_SKILLS_*` so local CLI state
|
|
319
|
+
cannot accidentally point at production storage.
|
|
318
320
|
|
|
319
321
|
## Project Structure
|
|
320
322
|
|
|
@@ -336,13 +338,14 @@ src/
|
|
|
336
338
|
|
|
337
339
|
skills/ # 202+ public skill contracts and local OSS skills
|
|
338
340
|
├── _common/ # Shared utilities
|
|
339
|
-
└── */ # Local skills include src/; hosted skills
|
|
341
|
+
└── */ # Local skills include src/; self-hosted skills expose metadata/contracts
|
|
340
342
|
```
|
|
341
343
|
|
|
342
344
|
## Project Runtime State
|
|
343
345
|
|
|
344
|
-
Skills are discovered from the
|
|
345
|
-
folders and agent-native skill folders are never used as skill
|
|
346
|
+
Skills are discovered from the configured self-hosted registry or bundled OSS
|
|
347
|
+
registry. Project folders and agent-native skill folders are never used as skill
|
|
348
|
+
libraries.
|
|
346
349
|
|
|
347
350
|
`.skills/` is runtime/output state only:
|
|
348
351
|
|
|
@@ -355,7 +358,8 @@ folders and agent-native skill folders are never used as skill libraries.
|
|
|
355
358
|
```
|
|
356
359
|
|
|
357
360
|
Auth stays global in `~/.hasna/skills/auth.json`. Registry and doc caches
|
|
358
|
-
belong in `~/.cache/skills` or the
|
|
361
|
+
belong in `~/.cache/skills` or the self-hosted API, not inside project
|
|
362
|
+
`.skills`.
|
|
359
363
|
|
|
360
364
|
## Development
|
|
361
365
|
|
|
@@ -375,9 +379,8 @@ bun run typecheck # TypeScript type checking
|
|
|
375
379
|
manifests, bin entries, docs, and SKILL.md frontmatter
|
|
376
380
|
4. Run `bun test` to verify registry-wide validation passes
|
|
377
381
|
|
|
378
|
-
Premium hosted skills should add public contracts, pricing, docs, and tests
|
|
379
|
-
without adding
|
|
380
|
-
OSS package.
|
|
382
|
+
Premium self-hosted skills should add public contracts, pricing, docs, and tests
|
|
383
|
+
without adding provider secrets to the OSS package.
|
|
381
384
|
|
|
382
385
|
Portable skill directories are auto-discovered from `~/.hasna/skills/<name>/`.
|
|
383
386
|
Legacy custom skill directories are still discovered from
|