@hasna/skills 0.5.4 → 0.5.5

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
@@ -120,6 +120,20 @@ credential has resolved, so an install with no credential names no host at all.
120
120
  `skills setup --api-url <origin>` writes the credentials file; the address is
121
121
  per-user, never per-project.
122
122
 
123
+ The internal gateway resource contract is `/skills/v1/...`; commercial and custom
124
+ instances retain their `/api/v1/...` routes. A full gateway `/skills/v1` base is
125
+ accepted and normalizes to the same credential-bound instance. Select a
126
+ customer-owned instance explicitly with `HASNA_SKILLS_API_URL=https://skills.example` and
127
+ its own profile/credential; configuring one instance does not select the other.
128
+ The OSS server accepts `/v1/...` aliases through the same handlers as its
129
+ `/api/v1/...` routes, plus `/v1/auth/whoami` for existing API-key identity and
130
+ `/v1/health` for liveness. Gateway integration is incomplete until the internal
131
+ origin runs this version and passes authenticated live acceptance. Login and
132
+ device authorization still use `/api/auth/...` on standalone instances; the
133
+ internal gateway has no interactive login service, so these operations stop
134
+ before transmitting account input or credentials. This is an explicit readiness gap, not support for
135
+ logging into the internal service through the commercial account.
136
+
123
137
  The unprefixed `SKILLS_API_KEY` and `SKILLS_API_URL` spellings are still accepted
124
138
  as silent aliases one rung below the canonical names, for one release. Use the
125
139
  `HASNA_`-prefixed names. `SKILL_API_KEY` (singular) is no longer read at all.
@@ -484,17 +498,58 @@ switch instances. `HASNA_HOME` / `HASNA_CONFIG_HOME` isolate credential state;
484
498
  `HASNA_SKILLS_DIR` separately isolates corpus/configuration data. They do not
485
499
  require changing `HOME`.
486
500
 
501
+ Private source publication uses a separate hosted contract advertised by
502
+ `capabilities.privatePublishing`. It requires fresh email verification, an
503
+ existing private/team skill UUID, and an explicit comparison with the observed
504
+ current version UUID (or `--expect-empty`). Request a code with `auth signup`
505
+ first, then enter it over stdin; do not put verification codes in shell history.
506
+
507
+ ```sh
508
+ skills --profile customer publication publish ./my-skill \
509
+ --skill-id <skill-uuid> --expect-empty --recovery-dir "$PWD/publication-receipt" \
510
+ --email you@example.com --code-stdin --confirm --json
511
+ skills --profile customer publication status --recovery-dir "$PWD/publication-receipt" \
512
+ --email you@example.com --code-stdin --json
513
+ ```
514
+
515
+ Without an enrolled named profile, also supply the observed `--user-id` and
516
+ `--membership-id`. `publication resume` and `publication cancel` use the same
517
+ recovery directory, fresh verification, and `--confirm`. The directory must be
518
+ new for `publish`, have a canonical absolute parent path, and contain no symbolic
519
+ links. It keeps immutable archive bytes and a generated idempotency key before
520
+ the first publication request. Preserve it after interruption: resume reconciles
521
+ the same declaration, and an uncertain upload is never sent twice. If a process
522
+ crashes while holding `operation.lock`, confirm it has stopped before removing
523
+ that lock explicitly. Status and cancellation remain available when new
524
+ publishing is disabled. Exit 2 means publication is still pending; `committed`
525
+ means source was published. Private execution remains unavailable.
526
+
527
+ The SDK exports `RemotePrivatePublicationsClient` through both the root and
528
+ `./sdk`; `RemoteSkillsAuthClient.openPrivatePublications` creates one from fresh
529
+ workspace verification. The shared `preparePrivatePublication`,
530
+ `continuePrivatePublication`, `inspectPrivatePublication`, and
531
+ `readPrivatePublicationRecovery` functions implement the same durable workflow.
532
+ MCP exposes `publish_private_skill`, `get_private_publication`,
533
+ `resume_private_publication`, and `cancel_private_publication` with equivalent
534
+ explicit authority and consent. Recovery directories are local to the MCP host;
535
+ request history may retain supplied verification codes. Tokens and signed upload
536
+ URLs are never returned or written to the recovery directory.
537
+
487
538
  A paid remote run requires explicit approval. Interactive runs ask before
488
539
  submission; JSON and other noninteractive runs require `--yes`. The approved
489
540
  quote becomes the server-enforced credit ceiling. A changed price above that
490
- ceiling fails before admission. A compatible server must advertise bounded
541
+ ceiling fails before admission. When the server returns `quoteReceipt`, the
542
+ client preserves that opaque value from the approved quote without obtaining a
543
+ replacement. The server checks its version, request and expiry binding; a refusal
544
+ stops the submission. A compatible server must advertise bounded
491
545
  approval; older or unsupported APIs return errors, not local results. Reuse the
492
546
  same idempotency key only for an identical submission to safely recover an
493
547
  interrupted response. `runs cancel` and `runs resume` call the server's lifecycle
494
548
  operations and can be refused when the current state does not allow them.
495
549
 
496
- `run --remote --file input.txt ...` declares upload hashes before admission and
497
- uploads bytes without forwarding the account key to storage. Failed uploads
550
+ `run --remote --file input.txt ...` quotes the owned files' names, sizes, SHA-256
551
+ hashes and content types before approval, declares those same descriptors at
552
+ admission, and uploads the original bytes without forwarding the account key to storage. Failed uploads
498
553
  request cancellation. Upload support must be advertised by the server.
499
554
  Downloads verify authenticated size and SHA-256 metadata before writing files;
500
555
  existing files and unsafe paths are refused. CLI/SDK downloads are bounded to
@@ -505,9 +560,11 @@ commands return external links; payment confirmation remains in the browser.
505
560
  The MCP server uses the same account, quote, run and artifact client. Agent
506
561
  hosts must launch `skills-mcp --stdio`; the standalone default is loopback HTTP.
507
562
  Configure its environment with the selected `HASNA_PROFILE` and isolated state
508
- paths. `run_skill` accepts `remote:true`, `maxCredits`, `idempotency_key`, and
563
+ paths. `run_skill` accepts `remote:true`, `maxCredits`, `quoteReceipt`, `idempotency_key`, and
509
564
  optional inline `files:[{name,base64,contentType}]`. An omitted ceiling permits
510
- only free execution. `quote_skill` never submits a run.
565
+ only free execution. `quote_skill` accepts the same input, args and inline files
566
+ and never submits a run. After approval, pass its receipt unchanged to `run_skill`
567
+ with those same values; do not automatically re-quote after a refusal.
511
568
 
512
569
  ```ts
513
570
  import { RemoteSkillsAuthClient, createRemoteSkillsClient } from "@hasna/skills/sdk";
@@ -524,6 +581,7 @@ const quote = await client.quoteRun("blog-article", {}, ["--topic", "Your topic"
524
581
  // Obtain explicit user approval of quote.pricing.costCents before this call.
525
582
  const run = await client.submitQuotedRun("blog-article", {}, ["--topic", "Your topic"], {
526
583
  maxCredits: quote.pricing.costCents,
584
+ quoteReceipt: quote.quoteReceipt,
527
585
  idempotencyKey: "article-001",
528
586
  });
529
587
  ```
@@ -531,7 +589,14 @@ const run = await client.submitQuotedRun("blog-article", {}, ["--topic", "Your t
531
589
  `submitRun` remains a low-level compatibility transport. New paid integrations
532
590
  should use `submitQuotedRun` or `submitQuotedRunWithFiles` so capability and
533
591
  approval checks run before submission. Credit counts are integers; `maxCostCents`
534
- is a legacy spelling for the same credit ceiling. Missing billing capabilities
592
+ is a legacy spelling for the same credit ceiling. An optional receipt is a
593
+ nonempty opaque string of at most 4,096 UTF-8 bytes, preserved without normalization.
594
+ `quoteRun` accepts optional file descriptors as its fourth argument; each descriptor
595
+ contains `name`, `sizeBytes`, `sha256`, and `contentType` and must match the later
596
+ submission. `submitQuotedRunWithFiles` captures owned bytes and derives these
597
+ descriptors before its asynchronous calls. Explicit receipts are never replaced;
598
+ without one, it requests a quote and carries the returned receipt into admission.
599
+ Missing billing capabilities
535
600
  on an internal instance are explicit unsupported responses; this package does
536
601
  not add a billing engine to the OSS server.
537
602
 
@@ -674,7 +739,7 @@ skills/ # Public skill contracts and local OSS skills
674
739
  |---|---|---|
675
740
  | Catalog skills | 86 | `SKILLS.length` (`src/lib/registry-data/`) |
676
741
  | Categories | 17 | `CATEGORIES` (`src/lib/registry-types.ts`) |
677
- | MCP tools | 68 | `tools/list` against a live `buildServer()` |
742
+ | MCP tools | 72 | `tools/list` against a live `buildServer()` |
678
743
 
679
744
  Every number in this table is re-derived from the source tree on each test run by
680
745
  `src/lib/readme-derived-counts.test.ts`, so a drifted figure fails a test rather