@hasna/skills 0.7.3 → 0.8.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.
Files changed (44) hide show
  1. package/README.md +48 -18
  2. package/bin/index.js +1271 -2090
  3. package/bin/mcp.js +1135 -1955
  4. package/bin/migrate.js +22 -60
  5. package/bin/server.js +73576 -20339
  6. package/bin/worker.js +65159 -19251
  7. package/dist/admin-contract.js +8 -8
  8. package/dist/index.js +489 -1184
  9. package/dist/lib/config.d.ts +3 -23
  10. package/dist/lib/installer.d.ts +1 -1
  11. package/dist/lib/portable-skills.d.ts +1 -1
  12. package/dist/lib/registry-data/index.d.ts +1 -0
  13. package/dist/lib/registry-types.d.ts +2 -1
  14. package/dist/lib/registry.d.ts +2 -12
  15. package/dist/lib/release-dependencies.d.ts +3 -0
  16. package/dist/lib/skill-aliases.d.ts +2 -3
  17. package/dist/mcp/mcp-test-client.d.ts +2 -2
  18. package/dist/sdk/executor.d.ts +5 -5
  19. package/dist/sdk/index.js +89739 -40379
  20. package/dist/sdk/registry.d.ts +3 -3
  21. package/dist/server/config.d.ts +1 -2
  22. package/dist/server/handlers.d.ts +5 -2
  23. package/dist/server/registry.d.ts +6 -3
  24. package/dist/server/skills-api.d.ts +6 -38
  25. package/dist/storage.js +5 -42
  26. package/package.json +3 -2
  27. package/dist/lib/registry-data/business-marketing.d.ts +0 -2
  28. package/dist/lib/registry-data/communication.d.ts +0 -2
  29. package/dist/lib/registry-data/content-generation.d.ts +0 -2
  30. package/dist/lib/registry-data/data-analysis.d.ts +0 -2
  31. package/dist/lib/registry-data/design-branding.d.ts +0 -2
  32. package/dist/lib/registry-data/development-tools.d.ts +0 -2
  33. package/dist/lib/registry-data/education-learning.d.ts +0 -2
  34. package/dist/lib/registry-data/event-management.d.ts +0 -2
  35. package/dist/lib/registry-data/finance-compliance.d.ts +0 -2
  36. package/dist/lib/registry-data/health-wellness.d.ts +0 -2
  37. package/dist/lib/registry-data/media-processing.d.ts +0 -2
  38. package/dist/lib/registry-data/productivity-organization.d.ts +0 -2
  39. package/dist/lib/registry-data/project-management.d.ts +0 -2
  40. package/dist/lib/registry-data/research-writing.d.ts +0 -2
  41. package/dist/lib/registry-data/science-academic.d.ts +0 -2
  42. package/dist/lib/registry-data/travel-lifestyle.d.ts +0 -2
  43. package/dist/lib/registry-data/web-browser.d.ts +0 -2
  44. package/dist/server/seed-bundled.d.ts +0 -20
package/README.md CHANGED
@@ -13,6 +13,21 @@ bun install -g @hasna/skills
13
13
 
14
14
  Requires [Bun](https://bun.sh/) 1.3+.
15
15
 
16
+ ## Private skill catalogs
17
+
18
+ The public package provides the CLI, API, SDK, hooks, and runtime. A skill's
19
+ instructions and executable bundle belong to the organization that publishes
20
+ them. API reads require authentication and use that organization's catalog,
21
+ including tag filters, versions, and downloads. An empty account starts empty;
22
+ neither a repository checkout nor files on the server machine supply defaults.
23
+ Server startup and upgrades never import a bundled catalog.
24
+
25
+ Each operator can use their own compatible server and storage. S3 is optional:
26
+ the server supports durable SQLite or PostgreSQL and database-backed bundles
27
+ when no S3 bucket is configured. Publishing through an authenticated account
28
+ does not publish to GitHub or npm. Keep private source documents and executable
29
+ payloads outside public software repositories.
30
+
16
31
  ## Quick Start
17
32
 
18
33
  The fleet authority is `https://api.hasna.com/skills`; versioned requests use
@@ -377,6 +392,20 @@ to be installed in the process. Every way that fetch can fail (SDK absent, vault
377
392
  unreachable, item missing or empty) is terminal and exits non-zero; a pointer
378
393
  never falls through to another tier, and never to the local corpus.
379
394
 
395
+ For a durable reference without a raw Skills key, the same
396
+ `HASNA_SKILLS_API_KEY_REF` field can be stored in the owner-only canonical or
397
+ selected-profile credentials file, alongside its `HASNA_SKILLS_API_URL` and
398
+ `HASNA_SKILLS_BOUND_API_URL`. Do not keep a literal API key in that file too.
399
+ The file retains its existing priority, and the reference remains bound to its
400
+ recorded Skills instance. Secrets needs its own working bootstrap provider;
401
+ this setup does not unlock a Keychain or copy a Secrets bootstrap credential.
402
+ If the file changes during a vault lookup, the request is refused.
403
+
404
+ An explicit `skills auth login` replaces a stored reference with the newly
405
+ authenticated key. `skills auth logout` removes the app's file reference, not
406
+ the vault item or Secrets' credential. Changing the service URL preserves the
407
+ reference's previous instance binding.
408
+
380
409
  **The service address, in the same shape:**
381
410
 
382
411
  `HASNA_SKILLS_API_URL` → the Keychain item `hasna.credentials.skills.api-url` →
@@ -421,8 +450,8 @@ as silent aliases one rung below the canonical names, for one release. Use the
421
450
  and the bare `skills` listing all exit 1; `skills-mcp` exits 1 at startup
422
451
  before answering `initialize` or binding a port, and each MCP data tool
423
452
  answers `AUTH_REQUIRED` on its own;
424
- - the explicit local opt-in → **local**. Skills ships its corpus, so running on
425
- this machine is a real mode — but it must be asked for:
453
+ - the explicit local opt-in → **local**, using only owned drafts and the verified
454
+ local cache. An empty installation has no skills. Opt in with:
426
455
  `HASNA_SKILLS_LOCAL=1` (alias `SKILLS_LOCAL=1`). It prints one line saying
427
456
  "local mode" on stderr. A configured environment always outranks the opt-in:
428
457
  with an authority or credential in the environment, `HASNA_SKILLS_LOCAL` is
@@ -439,7 +468,7 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
439
468
  |---|---|
440
469
  | `HASNA_SKILLS_API_KEY` | The API key (tier 5 of the ladder). The silent alias `SKILLS_API_KEY` is accepted for one release. |
441
470
  | `HASNA_SKILLS_API_URL` | The Skills API origin (HTTPS, or loopback HTTP). The silent alias `SKILLS_API_URL` is accepted for one release. |
442
- | `HASNA_SKILLS_LOCAL` | Explicit unhosted opt-in: run on this machine against the bundled corpus when no authority is configured. Any non-blank value (`1`). Alias `SKILLS_LOCAL`. Ignored whenever an authority or credential variable IS set. |
471
+ | `HASNA_SKILLS_LOCAL` | Explicit unhosted opt-in: run on this machine against owned drafts and the verified cache when no authority is configured. Any non-blank value (`1`). Alias `SKILLS_LOCAL`. Ignored whenever an authority or credential variable IS set. |
443
472
  | `HASNA_SKILLS_API_KEY_OVERRIDE` | Deliberate tier-2 key that outranks every store. |
444
473
  | `HASNA_SKILLS_API_KEY_REF` | Deliberate tier-2 vault-item pointer (resolved through `@hasna/secrets`). |
445
474
  | `HASNA_PROFILE` | Selects an isolated `credentials-<profile>` file (tier 1). |
@@ -460,7 +489,7 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
460
489
  | `skills list` | `ls` | List available skills (filter with `-c`, `--pinned`, `-t`, `--brief`) |
461
490
  | `skills search <query>` | `s` | Search by name, description, or tags |
462
491
  | `skills info <name>` | | Show metadata, env vars, and system dependencies |
463
- | `skills show <name>` | | Show bundled or portable skill details |
492
+ | `skills show <name>` | | Show account or owned portable skill details |
464
493
  | `skills docs <name>` | | Show documentation (SKILL.md > README.md > CLAUDE.md) |
465
494
  | `skills requires <name>` | | Show env vars, system deps, and npm dependencies |
466
495
  | `skills profiles show <id>` / `skills profiles set <id> --file <json>` | | Read an exact shared selection or update it with writer authorization |
@@ -480,7 +509,7 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
480
509
  | `skills runs status <run-id>` | | Poll a remote skill run |
481
510
  | `skills exports download <run-id>` | | Download completed remote artifacts |
482
511
  | `skills update` | | Refresh project pin metadata |
483
- | `skills diff <name>` | | Compare pin metadata against the bundled registry |
512
+ | `skills diff <name>` | | Compare pin metadata against the active registry |
484
513
  | `skills init` | | Generate `.env.example` and update `.gitignore` for pinned skills |
485
514
  | `skills categories` | | List all categories with skill counts |
486
515
  | `skills tags` | | List all unique tags with occurrence counts |
@@ -620,11 +649,9 @@ Stable command shapes:
620
649
 
621
650
  ## Remote Registry
622
651
 
623
- The npm package ships no bundled skill corpus. Discovery reads the local corpus
624
- cache (`~/.hasna/skills/installed`, filled by `skills pull`) and, when a
625
- credential resolves, the server's registry. This is not a mode you select:
626
- whether browse/search commands read a server's registry is one fact, whether a
627
- credential resolves (see [Credentials](#credentials)). To point at your own
652
+ The npm package ships no skill corpus. Authenticated discovery reads the
653
+ account catalog. Explicit local mode reads owned drafts and verified downloads.
654
+ A failed hosted read never substitutes local content. To point at your own
628
655
  instance:
629
656
 
630
657
  ```bash
@@ -872,7 +899,14 @@ const run = await client.submitQuotedRun("blog-article", {}, ["--topic", "Your t
872
899
  });
873
900
  ```
874
901
 
875
- `submitRun` remains a low-level compatibility transport. New paid integrations
902
+ `submitRun` remains a compatibility transport for servers implementing the legacy
903
+ submission protocol. This OSS server returns HTTP 410 (`LEGACY_EXECUTION_RETIRED`)
904
+ for unversioned submissions and never queues or executes them. Use a selected,
905
+ immutable executable version through `skills run <name>@<version> --target cloud`;
906
+ see [versioned cloud execution](docs/architecture/cloud-execution-runtime.md).
907
+ Historical run reads, logs, artifacts, and cancellation remain available.
908
+
909
+ On servers that implement paid submission, new integrations
876
910
  should use `submitQuotedRun` or `submitQuotedRunWithFiles` so capability and
877
911
  approval checks run before submission. Credit counts are integers; `maxCostCents`
878
912
  is a legacy spelling for the same credit ceiling. An optional receipt is a
@@ -1002,8 +1036,8 @@ src/
1002
1036
  ├── cli/index.tsx # Commander.js CLI + Ink TUI
1003
1037
  ├── mcp/index.ts # MCP server (stdio)
1004
1038
  ├── lib/
1005
- │ ├── registry-data/ # The catalogue entries themselves, one file per category
1006
- │ ├── registry.ts # Registry API over registry-data: search, categories, tags
1039
+ │ ├── registry-data/ # Empty compatibility export; no catalog content
1040
+ │ ├── registry.ts # Discovery over owned cache and explicit sources
1007
1041
  │ ├── installer.ts # Project pins and disabled source-copy paths
1008
1042
  │ ├── project-state.ts # .skills/project.json preferences
1009
1043
  │ ├── run-state.ts # .skills/runs and .skills/exports metadata
@@ -1013,17 +1047,13 @@ src/
1013
1047
  │ └── utils.ts # normalizeSkillName()
1014
1048
  ├── index.ts # Library re-exports (npm package entry)
1015
1049
  └── *.test.ts # Test files
1016
-
1017
- skills/ # Public skill contracts and local OSS skills
1018
- ├── _common/ # Shared utilities
1019
- └── */ # Local skills include src/; server-executed skills expose metadata/contracts
1020
1050
  ```
1021
1051
 
1022
1052
  ### Derived counts
1023
1053
 
1024
1054
  | Count | Value | Derived from |
1025
1055
  |---|---|---|
1026
- | Catalog skills | 86 | `SKILLS.length` (`src/lib/registry-data/`) |
1056
+ | Catalog skills | 0 | `SKILLS.length` (`src/lib/registry-data/`) |
1027
1057
  | Categories | 17 | `CATEGORIES` (`src/lib/registry-types.ts`) |
1028
1058
  | MCP tools | 72 | `tools/list` against a live `buildServer()` |
1029
1059