@hasna/skills 0.7.2 → 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 (50) hide show
  1. package/README.md +69 -18
  2. package/bin/index.js +31416 -17660
  3. package/bin/mcp.js +20185 -5957
  4. package/bin/migrate.js +24 -61
  5. package/bin/server.js +73578 -20340
  6. package/bin/worker.js +65161 -19252
  7. package/dist/admin-contract.js +34 -15
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +19581 -5535
  10. package/dist/lib/agent-discovery-bytes.d.ts +1 -0
  11. package/dist/lib/agent-discovery-path-bytes.d.ts +5 -0
  12. package/dist/lib/agent-discovery.d.ts +3 -1
  13. package/dist/lib/agent-policy-limits.d.ts +4 -0
  14. package/dist/lib/config.d.ts +3 -23
  15. package/dist/lib/installer.d.ts +1 -1
  16. package/dist/lib/portable-skills-types.d.ts +2 -0
  17. package/dist/lib/portable-skills.d.ts +1 -1
  18. package/dist/lib/registry-data/index.d.ts +1 -0
  19. package/dist/lib/registry-types.d.ts +2 -1
  20. package/dist/lib/registry.d.ts +2 -12
  21. package/dist/lib/release-dependencies.d.ts +30 -0
  22. package/dist/lib/skill-aliases.d.ts +2 -3
  23. package/dist/mcp/mcp-test-client.d.ts +2 -2
  24. package/dist/sdk/executor.d.ts +5 -5
  25. package/dist/sdk/index.js +89668 -40182
  26. package/dist/sdk/registry.d.ts +3 -3
  27. package/dist/server/config.d.ts +1 -2
  28. package/dist/server/handlers.d.ts +5 -2
  29. package/dist/server/registry.d.ts +6 -3
  30. package/dist/server/skills-api.d.ts +6 -38
  31. package/dist/storage.js +5 -42
  32. package/package.json +5 -3
  33. package/dist/lib/registry-data/business-marketing.d.ts +0 -2
  34. package/dist/lib/registry-data/communication.d.ts +0 -2
  35. package/dist/lib/registry-data/content-generation.d.ts +0 -2
  36. package/dist/lib/registry-data/data-analysis.d.ts +0 -2
  37. package/dist/lib/registry-data/design-branding.d.ts +0 -2
  38. package/dist/lib/registry-data/development-tools.d.ts +0 -2
  39. package/dist/lib/registry-data/education-learning.d.ts +0 -2
  40. package/dist/lib/registry-data/event-management.d.ts +0 -2
  41. package/dist/lib/registry-data/finance-compliance.d.ts +0 -2
  42. package/dist/lib/registry-data/health-wellness.d.ts +0 -2
  43. package/dist/lib/registry-data/media-processing.d.ts +0 -2
  44. package/dist/lib/registry-data/productivity-organization.d.ts +0 -2
  45. package/dist/lib/registry-data/project-management.d.ts +0 -2
  46. package/dist/lib/registry-data/research-writing.d.ts +0 -2
  47. package/dist/lib/registry-data/science-academic.d.ts +0 -2
  48. package/dist/lib/registry-data/travel-lifestyle.d.ts +0 -2
  49. package/dist/lib/registry-data/web-browser.d.ts +0 -2
  50. 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
@@ -134,6 +149,27 @@ contract and 16 MiB file limit; they are not silently converted into byte hashes
134
149
  Directory membership and file bytes are separate witnesses. Neither substitutes
135
150
  for reviewing the actual executable, import paths or loader behavior.
136
151
 
152
+ For an explicitly reviewed launcher or interpreter reached through symlinks,
153
+ use `captureDiscoveryPathSources(paths)` and retain `hashMode: "path-bytes"`.
154
+ Its digest binds the canonical input, directory identities, each link's identity
155
+ and target, and the resolved regular file's identity and exact bytes. Relative
156
+ link targets resolve component by component, including `..` after an alias.
157
+ Missing targets also receive a digest that binds the path leading to their
158
+ absence. Retargeting to identical bytes, replacing a link or an ancestor, or
159
+ changing a file's metadata requires a fresh review. Unrelated sibling writes
160
+ do not change directory identity witnesses.
161
+
162
+ Path witnesses share the 64 MiB file and 256 MiB aggregate byte limits. Each
163
+ path allows at most 40 links, 256 traversal steps and 64 KiB of metadata; one
164
+ capture or verification permits 8 MiB of path metadata. Special nodes, cycles,
165
+ oversized inputs and changes during capture refuse. Native hook checks repeat
166
+ the witness verification; this does not make a later native execution atomic
167
+ with external writers. Keep source writers quiescent during activation.
168
+ Use `bytes` mode for configuration that hook installation will replace: path
169
+ witnesses cannot predict the future identity of a planned write. Existing raw
170
+ byte and directory witnesses still refuse links. Older clients reject the new
171
+ mode; upgrade the CLI before installing a policy that uses it.
172
+
137
173
  Hermes requires directory witnesses, including when upgrading an older policy.
138
174
  For an automatic bridge with no runtime installed, rerun normal `skills hook install`
139
175
  to review and apply the new bindings. Existing native trust is preserved.
@@ -356,6 +392,20 @@ to be installed in the process. Every way that fetch can fail (SDK absent, vault
356
392
  unreachable, item missing or empty) is terminal and exits non-zero; a pointer
357
393
  never falls through to another tier, and never to the local corpus.
358
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
+
359
409
  **The service address, in the same shape:**
360
410
 
361
411
  `HASNA_SKILLS_API_URL` → the Keychain item `hasna.credentials.skills.api-url` →
@@ -400,8 +450,8 @@ as silent aliases one rung below the canonical names, for one release. Use the
400
450
  and the bare `skills` listing all exit 1; `skills-mcp` exits 1 at startup
401
451
  before answering `initialize` or binding a port, and each MCP data tool
402
452
  answers `AUTH_REQUIRED` on its own;
403
- - the explicit local opt-in → **local**. Skills ships its corpus, so running on
404
- 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:
405
455
  `HASNA_SKILLS_LOCAL=1` (alias `SKILLS_LOCAL=1`). It prints one line saying
406
456
  "local mode" on stderr. A configured environment always outranks the opt-in:
407
457
  with an authority or credential in the environment, `HASNA_SKILLS_LOCAL` is
@@ -418,7 +468,7 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
418
468
  |---|---|
419
469
  | `HASNA_SKILLS_API_KEY` | The API key (tier 5 of the ladder). The silent alias `SKILLS_API_KEY` is accepted for one release. |
420
470
  | `HASNA_SKILLS_API_URL` | The Skills API origin (HTTPS, or loopback HTTP). The silent alias `SKILLS_API_URL` is accepted for one release. |
421
- | `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. |
422
472
  | `HASNA_SKILLS_API_KEY_OVERRIDE` | Deliberate tier-2 key that outranks every store. |
423
473
  | `HASNA_SKILLS_API_KEY_REF` | Deliberate tier-2 vault-item pointer (resolved through `@hasna/secrets`). |
424
474
  | `HASNA_PROFILE` | Selects an isolated `credentials-<profile>` file (tier 1). |
@@ -439,7 +489,7 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
439
489
  | `skills list` | `ls` | List available skills (filter with `-c`, `--pinned`, `-t`, `--brief`) |
440
490
  | `skills search <query>` | `s` | Search by name, description, or tags |
441
491
  | `skills info <name>` | | Show metadata, env vars, and system dependencies |
442
- | `skills show <name>` | | Show bundled or portable skill details |
492
+ | `skills show <name>` | | Show account or owned portable skill details |
443
493
  | `skills docs <name>` | | Show documentation (SKILL.md > README.md > CLAUDE.md) |
444
494
  | `skills requires <name>` | | Show env vars, system deps, and npm dependencies |
445
495
  | `skills profiles show <id>` / `skills profiles set <id> --file <json>` | | Read an exact shared selection or update it with writer authorization |
@@ -459,7 +509,7 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
459
509
  | `skills runs status <run-id>` | | Poll a remote skill run |
460
510
  | `skills exports download <run-id>` | | Download completed remote artifacts |
461
511
  | `skills update` | | Refresh project pin metadata |
462
- | `skills diff <name>` | | Compare pin metadata against the bundled registry |
512
+ | `skills diff <name>` | | Compare pin metadata against the active registry |
463
513
  | `skills init` | | Generate `.env.example` and update `.gitignore` for pinned skills |
464
514
  | `skills categories` | | List all categories with skill counts |
465
515
  | `skills tags` | | List all unique tags with occurrence counts |
@@ -599,11 +649,9 @@ Stable command shapes:
599
649
 
600
650
  ## Remote Registry
601
651
 
602
- The npm package ships no bundled skill corpus. Discovery reads the local corpus
603
- cache (`~/.hasna/skills/installed`, filled by `skills pull`) and, when a
604
- credential resolves, the server's registry. This is not a mode you select:
605
- whether browse/search commands read a server's registry is one fact, whether a
606
- 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
607
655
  instance:
608
656
 
609
657
  ```bash
@@ -851,7 +899,14 @@ const run = await client.submitQuotedRun("blog-article", {}, ["--topic", "Your t
851
899
  });
852
900
  ```
853
901
 
854
- `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
855
910
  should use `submitQuotedRun` or `submitQuotedRunWithFiles` so capability and
856
911
  approval checks run before submission. Credit counts are integers; `maxCostCents`
857
912
  is a legacy spelling for the same credit ceiling. An optional receipt is a
@@ -981,8 +1036,8 @@ src/
981
1036
  ├── cli/index.tsx # Commander.js CLI + Ink TUI
982
1037
  ├── mcp/index.ts # MCP server (stdio)
983
1038
  ├── lib/
984
- │ ├── registry-data/ # The catalogue entries themselves, one file per category
985
- │ ├── 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
986
1041
  │ ├── installer.ts # Project pins and disabled source-copy paths
987
1042
  │ ├── project-state.ts # .skills/project.json preferences
988
1043
  │ ├── run-state.ts # .skills/runs and .skills/exports metadata
@@ -992,17 +1047,13 @@ src/
992
1047
  │ └── utils.ts # normalizeSkillName()
993
1048
  ├── index.ts # Library re-exports (npm package entry)
994
1049
  └── *.test.ts # Test files
995
-
996
- skills/ # Public skill contracts and local OSS skills
997
- ├── _common/ # Shared utilities
998
- └── */ # Local skills include src/; server-executed skills expose metadata/contracts
999
1050
  ```
1000
1051
 
1001
1052
  ### Derived counts
1002
1053
 
1003
1054
  | Count | Value | Derived from |
1004
1055
  |---|---|---|
1005
- | Catalog skills | 86 | `SKILLS.length` (`src/lib/registry-data/`) |
1056
+ | Catalog skills | 0 | `SKILLS.length` (`src/lib/registry-data/`) |
1006
1057
  | Categories | 17 | `CATEGORIES` (`src/lib/registry-types.ts`) |
1007
1058
  | MCP tools | 72 | `tools/list` against a live `buildServer()` |
1008
1059