@hasna/skills 0.8.10 → 0.8.12

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
@@ -190,6 +190,16 @@ contract and 16 MiB file limit; they are not silently converted into byte hashes
190
190
  Directory membership and file bytes are separate witnesses. Neither substitutes
191
191
  for reviewing the actual executable, import paths or loader behavior.
192
192
 
193
+ For reviewed Claude user settings, `captureClaudeSettings(canonicalSettingsPath)`
194
+ emits an opt-in `claude-settings-v1` witness. It permits a fixed set of typed
195
+ terminal display preferences and recognized built-in model selections to change
196
+ while binding hooks, permissions, native skill protections, plugins,
197
+ marketplaces, environment and every unknown field. Provider mappings, custom
198
+ model values and instruction settings remain bound. Replace the settings source
199
+ in an explicitly reviewed discovery input, then use the normal `skills hook install
200
+ --discovery-inputs <file>` plan/apply flow; existing raw witnesses are never
201
+ automatically converted or refreshed. See [settings witness scope and migration](docs/plugin-admission.md#claude-settings-preferences).
202
+
193
203
  For an explicitly reviewed launcher or interpreter reached through symlinks,
194
204
  use `captureDiscoveryPathSources(paths)` and retain `hashMode: "path-bytes"`.
195
205
  Its digest binds the canonical input, directory identities, each link's identity
@@ -314,6 +324,42 @@ pinned session. It preserves exact versions and does not extend an expired
314
324
  receipt's lifetime. Authentication, integrity and native discovery failures still
315
325
  block; they do not silently switch to a local catalog.
316
326
 
327
+ An intentional profile change for an already running session uses a separate
328
+ reviewed operation. `sync` and hook reinstallation do not migrate session pins:
329
+
330
+ ```bash
331
+ skills sessions show <session-id> --json
332
+ skills sessions reconcile <session-id> \
333
+ --from-profile <old-profile> --from-revision <old-revision> \
334
+ --receipt-sha256 <receipt-sha256> \
335
+ --selection-profile <target-profile> --profile-revision <target-revision> --json
336
+ # Within five minutes, repeat with --apply --plan-digest <digest> \
337
+ # --plan-issued-at <issuedAt> --plan-expires-at <expiresAt>.
338
+ ```
339
+
340
+ Reconciliation authenticates against the current target profile and refuses a
341
+ changed target revision, authority, workspace, old receipt or plan. It archives
342
+ the original bytes and prepared replacement under
343
+ `selection-cache/session-reconciliations`, then replaces only the named session
344
+ receipt atomically. Loaded instructions are retained only when their exact
345
+ authority, workspace, version and bundle digest still match. Existing child
346
+ sessions and project locks keep their own pins; new children inherit the newly
347
+ reviewed parent selection. Each new child receipt privately records the exact
348
+ parent receipt hash and monotonic generation it inherited. Parent and child locks
349
+ are acquired in deterministic path order, and the parent is re-read immediately
350
+ before the child commit; any changed or ABA generation refuses the child write.
351
+ No agent process is stopped or restarted.
352
+
353
+ Use the same updated Skills installation for every process writing this cache.
354
+ Session writers coordinate with reconciliation and refuse a stale write that
355
+ would restore an earlier pin. Reviewed reconciliation approvals bind their
356
+ `issuedAt` and `expiresAt` into the digest and expire after five minutes; after
357
+ that replay boundary, prepare and review a new plan. A competing writer or surviving lock fails closed;
358
+ do not delete a lock without reviewing its owning operation. If application
359
+ reports an incomplete outcome, inspect `sessions show` and the preserved
360
+ operation receipt before retrying. The archive contains both original and
361
+ prepared bytes even if the final receipt write fails.
362
+
317
363
  ## Profiles, station sync and rollback
318
364
 
319
365
  ```bash
@@ -702,6 +748,8 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
702
748
  | `skills load <name> --selection-profile <id>` | | Load complete instructions from the verified selection |
703
749
  | `skills context <prompt> --selection-profile <id>` | | Resolve instructions matching the prompt and profile triggers |
704
750
  | `skills hook install --agent all --selection-profile <id>` | | Plan one CLI bridge plus supported native hooks; `--apply` installs it, then restart and trust the hooks |
751
+ | `skills sessions show <id> --json` | | Inspect one session's exact profile revision and receipt hash without loading payloads |
752
+ | `skills sessions reconcile <id> --from-profile <id> --from-revision <rev> --receipt-sha256 <sha> --selection-profile <id> --profile-revision <rev>` | | Plan an explicit migration of one live session; `--apply --plan-digest <digest> --plan-issued-at <time> --plan-expires-at <time>` (within five minutes) preserves its old receipt and applies the reviewed replacement |
705
753
  | `skills hook agents --json` | | Report maintained adapters and explicit coverage limits |
706
754
  | `skills migrate native` | | Inventory native copies; `--apply` archives managed copies, with explicit `--include-unmanaged` and `--include-vendor` retirement options |
707
755
  | `skills pull --all --selection-profile <id>` | | With CLI loading active, refresh the selected profile into the verified cache |
@@ -1107,7 +1155,7 @@ skills --profile customer billing status --json
1107
1155
  skills --profile customer billing usage --json
1108
1156
  skills --profile customer billing invoices --json
1109
1157
  skills --profile customer credits packs --json
1110
- skills --profile customer credits buy <pack-id> --json
1158
+ skills --profile customer credits buy <pack-id> --idempotency-key checkout-001 --json
1111
1159
  skills --profile customer billing portal --json
1112
1160
  skills --profile customer auth keys list --email you@example.com --code <FRESH-CODE> --json
1113
1161
  # Request a fresh OTP, then create a separately scoped key (shown once).
@@ -1116,6 +1164,19 @@ skills --profile customer auth keys create automation --email you@example.com --
1116
1164
  skills --profile customer auth logout --json
1117
1165
  ```
1118
1166
 
1167
+ For credit checkouts, generate and retain a unique request key **before** calling.
1168
+ The SDK accepts `createCreditCheckout(packId, { idempotencyKey })`; MCP
1169
+ `create_credit_checkout` accepts `idempotency_key`. Success and bounded checkout
1170
+ errors retain `requestIdempotencyKey`. An omitted key is generated before the
1171
+ single POST, but an explicit saved key is needed if the client process exits
1172
+ before returning any result. Recover only on the same server, account and pack.
1173
+ No surface retries a checkout automatically. For unresolved or in-progress
1174
+ outcomes, inspect billing and explicitly reuse the same key after any indicated
1175
+ wait. Expired or fulfilled outcomes need a deliberate decision, not a fresh key
1176
+ on an automatic retry. The provider's derived `idempotencyKey` is not the request
1177
+ key. This protocol requires the configured server to honor checkout idempotency;
1178
+ older servers can return a link without proving durable recovery semantics.
1179
+
1119
1180
  An origin, a full `/api/v1` base and a base with a path prefix normalize to the
1120
1181
  same routes. `HASNA_PROFILE=customer` selects the same profile as `--profile`.
1121
1182
  `HASNA_SKILLS_API_URL` (or the compatible `SKILLS_API_URL`) is an explicit URL