@hasna/skills 0.1.63 → 0.1.64

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 (38) hide show
  1. package/README.md +28 -6
  2. package/bin/index.js +1593 -228
  3. package/bin/mcp.js +290 -24
  4. package/bin/migrate.js +229 -33
  5. package/bin/server.js +774 -116
  6. package/bin/worker.js +558 -79
  7. package/dist/cli/commands/registry-reconcile.d.ts +2 -0
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +559 -251
  10. package/dist/lib/agent-sync.d.ts +26 -6
  11. package/dist/lib/auth-store.d.ts +37 -0
  12. package/dist/lib/config.d.ts +51 -0
  13. package/dist/lib/home-census.d.ts +4 -0
  14. package/dist/lib/home-migration.d.ts +8 -9
  15. package/dist/lib/native-storage.d.ts +1 -1
  16. package/dist/lib/portable-skills.d.ts +35 -6
  17. package/dist/lib/pull.d.ts +31 -0
  18. package/dist/lib/registry-reconcile.d.ts +114 -0
  19. package/dist/lib/registry.d.ts +7 -4
  20. package/dist/lib/remote-client.d.ts +118 -1
  21. package/dist/lib/remote-registry.d.ts +26 -0
  22. package/dist/lib/revision.d.ts +29 -0
  23. package/dist/sdk/index.js +1351 -353
  24. package/dist/server/app.d.ts +1 -1
  25. package/dist/server/config.d.ts +12 -2
  26. package/dist/server/rows.d.ts +2 -1
  27. package/dist/server/skills-api.d.ts +108 -6
  28. package/dist/server/sqlite-store.d.ts +20 -3
  29. package/dist/server/store.d.ts +31 -5
  30. package/dist/server/types.d.ts +98 -3
  31. package/dist/storage.js +7 -2
  32. package/migrations/postgres/0004_hosted_pins.sql +28 -0
  33. package/migrations/postgres/0005_revision_tombstone_registry.sql +37 -0
  34. package/migrations/postgres/0005_tag_projection.sql +36 -0
  35. package/migrations/sqlite/0004_hosted_pins.sql +21 -0
  36. package/migrations/sqlite/0005_revision_tombstone_registry.sql +18 -0
  37. package/migrations/sqlite/0005_tag_projection.sql +25 -0
  38. package/package.json +3 -2
package/README.md CHANGED
@@ -215,6 +215,12 @@ If the URL is an origin such as `https://your-server.example`, the CLI requests
215
215
  Authenticated registry listing and premium server-side execution use
216
216
  `SKILLS_API_KEY` or the credential saved by `skills auth login --api-key`.
217
217
 
218
+ The typed `RemoteSkillsClient` also exposes pin, tag, and cursor-based
219
+ incremental-sync methods (`listPins`/`pin`/`unpin`, `listTags`/`skillsByTag`,
220
+ `listUpdatedSince`). A server that predates those routes fails closed with an
221
+ explicit unsupported-route error — never a silent empty listing. Route table
222
+ and version-skew contract: `docs/architecture/remote-client-pins-tags-sync.md`.
223
+
218
224
  For the reusable upstream contract, see
219
225
  `docs/architecture/reusable-skills-engine.md`.
220
226
 
@@ -303,8 +309,8 @@ identical either way.
303
309
 
304
310
  ```bash
305
311
  skills-server # SQLite at ~/.hasna/skills/server.db
306
- HASNA_SKILLS_DATABASE_URL=/srv/skills/server.db skills-server
307
- HASNA_SKILLS_DATABASE_URL=postgres://user:pw@host/skills skills-server
312
+ HASNA_SKILLS_DATABASE_URL=<path>/server.db skills-server
313
+ HASNA_SKILLS_DATABASE_URL=postgres://user:CHANGEME@host/skills skills-server
308
314
  ```
309
315
 
310
316
  | `HASNA_SKILLS_DATABASE_URL` | Backend | Survives restart |
@@ -338,12 +344,19 @@ explicitly, because several replicas racing to migrate one shared database is no
338
344
  something to do implicitly:
339
345
 
340
346
  ```bash
341
- HASNA_SKILLS_DATABASE_URL=postgres://… skills-migrate
347
+ HASNA_SKILLS_DATABASE_URL=postgres://user:CHANGEME@host/skills skills-migrate
342
348
  ```
343
349
 
344
350
  `skills-migrate` fails if no database is configured rather than migrating a default
345
351
  SQLite file, so it stays usable as a deploy gate.
346
352
 
353
+ `HASNA_SKILLS_DATABASE_URL` and `DATABASE_URL` are server-only. CLI, MCP, and SDK
354
+ clients never read them and never open a database connection: a client reaches
355
+ the cloud only through `SKILLS_API_URL` plus an API key (the `apiKey` stored by
356
+ `skills auth`, or `SKILLS_API_KEY`). The one exception is the repo-native storage
357
+ sync under [Storage Boundary](#storage-boundary), an operator tool that
358
+ intentionally reads the same variables.
359
+
347
360
  Three things the server will not do:
348
361
 
349
362
  - Fall back to another backend when a configured Postgres URL cannot be reached.
@@ -421,7 +434,7 @@ skills/ # Public skill contracts and local OSS skills
421
434
 
422
435
  | Count | Value | Derived from |
423
436
  |---|---|---|
424
- | Catalog skills | 85 | `SKILLS.length` (`src/lib/registry-data/`) |
437
+ | Catalog skills | 86 | `SKILLS.length` (`src/lib/registry-data/`) |
425
438
  | Categories | 17 | `CATEGORIES` (`src/lib/registry-types.ts`) |
426
439
  | MCP tools | 37 | `tools/list` against a live `buildServer()` |
427
440
 
@@ -450,7 +463,8 @@ folders are never used as skill libraries.
450
463
  └── tmp/
451
464
  ```
452
465
 
453
- Auth stays global in `~/.hasna/skills/auth.json`. Registry and doc caches
466
+ Auth stays global in `<app folder>/auth.json` (default
467
+ `~/.hasna/skills/auth.json`). Registry and doc caches
454
468
  belong in `~/.cache/skills` or the Skills API, not inside project
455
469
  `.skills`.
456
470
 
@@ -513,7 +527,15 @@ overridden folder. `skills config path` reports the config file actually in use.
513
527
  | Installed skills | `<app folder>/installed/<name>/` | yes |
514
528
  | Global config | `<app folder>/config.json` | yes |
515
529
  | Feedback database | `<app folder>/skills.db` | yes |
516
- | Auth | `~/.hasna/skills/auth.json` | no (resolved at startup) |
530
+ | Auth | `<app folder>/auth.json` | yes |
531
+
532
+ There is no separate local-skills-folder override, and none is needed: one
533
+ variable relocates the whole app folder, so the corpus is always
534
+ `<app folder>/installed`. With the default app folder that is exactly the
535
+ migrated corpus location — the former `~/.skills` and `custom/` trees are folded
536
+ into `<app folder>/installed` on first resolution (see "Migrating from the older
537
+ layout"). Extension corpora are a separate concern and keep their own
538
+ `extensionsDir` config key.
517
539
 
518
540
  ### Migrating from the older layout
519
541