@hasna/skills 0.10.83 → 0.10.88
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 +133 -15
- package/bin/index.js +5690 -2868
- package/bin/mcp.js +1688 -810
- package/bin/migrate.js +1 -1
- package/bin/server.js +1 -1
- package/bin/worker.js +1 -1
- package/dist/cli/commands/agent-integration.d.ts +35 -0
- package/dist/cli/commands/context.d.ts +4 -0
- package/dist/cli/commands/runtime-launcher.d.ts +4 -9
- package/dist/index.js +3021 -1530
- package/dist/lib/agent-adapters.d.ts +5 -2
- package/dist/lib/agent-discovery.d.ts +22 -4
- package/dist/lib/agent-hermes.d.ts +7 -1
- package/dist/lib/agent-integration.d.ts +31 -2
- package/dist/lib/agent-opencode.d.ts +4 -0
- package/dist/lib/claude-hook-disable.d.ts +32 -0
- package/dist/lib/claude-settings-witness.d.ts +28 -0
- package/dist/lib/codex-settings-witness.d.ts +20 -0
- package/dist/lib/guarded-agent-config.d.ts +3 -0
- package/dist/lib/hook-diagnostics.d.ts +3 -1
- package/dist/lib/narrowed-witness-ledger.d.ts +24 -0
- package/dist/lib/native-discovery-roots.d.ts +8 -0
- package/dist/lib/native-drift-receipt.d.ts +55 -0
- package/dist/lib/opencode-hook-protocol.d.ts +5 -0
- package/dist/lib/profile-client.d.ts +1 -0
- package/dist/lib/selection-cache.d.ts +47 -2
- package/dist/lib/session-background-renewal.d.ts +118 -0
- package/dist/lib/session-reconciliation.d.ts +82 -2
- package/dist/lib/skill-context.d.ts +39 -1
- package/dist/lib/skill-relevance.d.ts +95 -0
- package/dist/runtime-prerequisites.js +569 -165
- package/dist/sdk/index.js +2626 -1396
- package/docs/plugin-admission.md +132 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -471,8 +471,12 @@ Retire native payloads before use. Legacy `skills-cli.md` files can shadow the
|
|
|
471
471
|
bridge and must also be preserved and retired before proceeding. Only `skill_view(name:
|
|
472
472
|
"skills-cli")` is allowed natively; author payloads with Skills CLI commands.
|
|
473
473
|
Hermes itself fails open on `pre_llm_call` errors. A returned refusal is visible
|
|
474
|
-
context
|
|
475
|
-
|
|
474
|
+
context. The trusted pre-tool guard blocks native payload skills and a
|
|
475
|
+
`skill_view(skills-cli)` call while the bridge is unverified or can be
|
|
476
|
+
shadowed (a legacy `skills-cli.md`, a bridge-named copy, or an environment
|
|
477
|
+
override above that leaves the effective discovery unchecked); other discovery
|
|
478
|
+
drift is reported and recorded, not blocked, and other tools proceed. This is
|
|
479
|
+
not a claim that Hermes can prevent every model call after a failed
|
|
476
480
|
prompt hook or guarantee refusal if the native host/supervisor itself dies. Arbitrary project/plugin paths still require a discovery audit.
|
|
477
481
|
|
|
478
482
|
Reviewed discovery can also bind `directories: [{ path, sha256 }]` alongside
|
|
@@ -604,7 +608,16 @@ inventory entry outside the manifest remains untouched.
|
|
|
604
608
|
|
|
605
609
|
`skills hook agents --json` reports the supported adapters and coverage limits.
|
|
606
610
|
Claude and Codex have lifecycle context hooks; Gemini uses `BeforeAgent`, and
|
|
607
|
-
OpenCode uses
|
|
611
|
+
OpenCode uses a v2 object plugin with awaited `prompt` and `context` hooks.
|
|
612
|
+
The OpenCode adapter targets the v2.0.32 Promise plugin contract. Prompt
|
|
613
|
+
admission stages genuine user text transiently. Request context matches that
|
|
614
|
+
text and restores verified selections
|
|
615
|
+
into transient system context without changing message history. Native skill
|
|
616
|
+
tools and prompt attachments allow only `skills-cli`. Disposal removes hook
|
|
617
|
+
registrations and cancels pending Skills hook children. Exact managed v1 plugin
|
|
618
|
+
bytes remain recognizable for reviewed upgrades. The isolated contract tests
|
|
619
|
+
do not establish adoption by an installed OpenCode process.
|
|
620
|
+
Cursor receives selected context at
|
|
608
621
|
session start and gates later prompt submission; its prompt hook does not
|
|
609
622
|
inject context on the supported installed path. Other inventoried clients do
|
|
610
623
|
not automatically gain a working prompt adapter.
|
|
@@ -989,13 +1002,45 @@ own bounded native client; it does not reload an existing agent session.
|
|
|
989
1002
|
Neither a receipt nor a config write proves an existing session adopted new rules;
|
|
990
1003
|
use the actual native session's supported acceptance path separately.
|
|
991
1004
|
|
|
992
|
-
At session start, the hook authenticates and refreshes the profile
|
|
1005
|
+
At session start, the hook authenticates and refreshes the profile within a
|
|
1006
|
+
five-second bound; a refresh that does not finish is named in one line and the
|
|
1007
|
+
session uses its last verified profile. Prompt hooks
|
|
993
1008
|
select complete skill instructions from that verified cache using explicit
|
|
994
1009
|
`$skill` references, profile keywords, paths and always-required selections.
|
|
995
|
-
A
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1010
|
+
A keyword matches as a phrase (its words adjacent and in order); a selection
|
|
1011
|
+
without keywords matches its whole slug as a phrase, or a shorter run of its
|
|
1012
|
+
slug words that has two words of three or more letters and the slug's
|
|
1013
|
+
least-used word ("seating plan" for event-seating-plan, never "run of" for
|
|
1014
|
+
live-event-run-of-show); a one-word trigger shared by more than three
|
|
1015
|
+
selections selects nothing on its own; and a one-word slug counts as named
|
|
1016
|
+
only beside the word "skill". A prompt match scoring under half of the
|
|
1017
|
+
prompt's best match, and prompt matches tied at the last free slot, are
|
|
1018
|
+
offered as `skills load` commands instead of being injected or picked by name
|
|
1019
|
+
order. Weaker pointers are offered the same way, at most three and never
|
|
1020
|
+
injected: a multi-word keyword whose words all appear apart, one of them
|
|
1021
|
+
discriminating ("designs review" in "the designs app for review"), or a common
|
|
1022
|
+
one-word keyword; a tie that does not fit is left out.
|
|
1023
|
+
A session retains its loaded selections; compaction restores the two most
|
|
1024
|
+
recently loaded instructions, and a subagent receives its parent's most recent
|
|
1025
|
+
one, each followed by `skills load` commands for the next most recent. A
|
|
1026
|
+
read-only prompt does not rewrite the session receipt or take its write lock
|
|
1027
|
+
(a damaged lock still refuses), and receipt writers wait up to two seconds for
|
|
1028
|
+
another live writer's lock before refusing; a lock another writer is
|
|
1029
|
+
publishing or releasing at that moment counts as held, not damaged. Every
|
|
1030
|
+
delivered body is recorded in the receipt: when only that write lost its lock
|
|
1031
|
+
race, skills the receipt already records are still delivered, and each newly
|
|
1032
|
+
read one is offered as its `skills load` command under one fixed
|
|
1033
|
+
`[SESSION_WRITE_BUSY]` line. A new subagent whose parent recorded a load or
|
|
1034
|
+
renewed its pin while the subagent resolved is resolved once more from the
|
|
1035
|
+
current parent pin. Managed hooks inject at most 24,000 instruction
|
|
1036
|
+
characters; instructions that exceed that or another context budget produce
|
|
1037
|
+
an explicit `skills load` command. A hook never executes
|
|
1038
|
+
a skill. Cached use is explicit and expires after 24 hours. Managed hooks renew
|
|
1039
|
+
session pins in a detached background worker (`docs/session-pin-renewal.md`),
|
|
1040
|
+
ahead of expiry for root sessions (a failed renewal ahead of expiry is named
|
|
1041
|
+
in one line while context comes from the still-valid pin); an expired pin
|
|
1042
|
+
waits at most three seconds for its renewal and delivers nothing until it
|
|
1043
|
+
commits. When a session
|
|
999
1044
|
receipt expires, the hook authenticates the current profile. If every loaded
|
|
1000
1045
|
selection still has identical metadata and bundle digest, it archives the old
|
|
1001
1046
|
receipt and advances that session to the current profile under an exact receipt
|
|
@@ -1015,7 +1060,7 @@ that lock in its receipt and is never migrated automatically, whatever
|
|
|
1015
1060
|
directory it later prompts from. A session without that record is not migrated
|
|
1016
1061
|
while a lock sits in the prompt's working directory or any ancestor. A loaded
|
|
1017
1062
|
skill whose lifecycle epoch rotated while its bytes stayed the same also keeps
|
|
1018
|
-
the refusal. If the migration cannot finish within the
|
|
1063
|
+
the refusal. If the migration cannot finish within the renewal window,
|
|
1019
1064
|
the hook reports `SESSION_RECONCILIATION_REQUIRED` with that reason and the next
|
|
1020
1065
|
prompt retries. Turn this off station-wide with `skills config set
|
|
1021
1066
|
sessionPinMigration off --global` (the key is refused without `--global`, and a
|
|
@@ -1543,6 +1588,54 @@ The operation is read-only. It reads the policy and the stored witness paths
|
|
|
1543
1588
|
and directories. It writes no file, cache, selection pin or policy, and it does
|
|
1544
1589
|
not start Claude or change native state.
|
|
1545
1590
|
|
|
1591
|
+
### Disable only Claude context delivery hooks
|
|
1592
|
+
|
|
1593
|
+
`skills hook disable-claude-context` previews removal of exact Skills-owned
|
|
1594
|
+
`SessionStart`, `UserPromptSubmit` and `SubagentStart` registrations. It requires
|
|
1595
|
+
an explicit physical settings path, its exact SHA-256 and `0600` mode, the exact
|
|
1596
|
+
Skills executable and its physical byte digest, and the registered selection
|
|
1597
|
+
profile. It compares complete commands produced by Skills' own renderer, never
|
|
1598
|
+
a command substring. Unsupported near matches refuse. Duplicate JSON keys,
|
|
1599
|
+
aliases, unsafe paths, and changed target/command witnesses refuse too.
|
|
1600
|
+
|
|
1601
|
+
```sh
|
|
1602
|
+
skills hook disable-claude-context --settings /absolute/native/settings.json \
|
|
1603
|
+
--expected-settings-sha256 <exact-settings-sha256> --expected-mode 0600 \
|
|
1604
|
+
--skills-command /absolute/bin/skills \
|
|
1605
|
+
--expected-command-sha256 <exact-command-sha256> \
|
|
1606
|
+
--selection-profile <exact-profile> --json
|
|
1607
|
+
```
|
|
1608
|
+
|
|
1609
|
+
The default preview writes nothing. Add `--apply --preimage-dir <new-absolute-dir>`
|
|
1610
|
+
to apply. The preservation directory's parent must already exist. Apply creates
|
|
1611
|
+
an exclusive private directory and reads back the exact original before changing
|
|
1612
|
+
settings. An existing directory is never reused. The operation preserves all
|
|
1613
|
+
other settings and handlers, including `PreToolUse` native Skill enforcement,
|
|
1614
|
+
unrelated empty groups, permissions, policy, profiles and sessions. JSON spacing
|
|
1615
|
+
is reserialized, while unknown numeric spellings remain intact.
|
|
1616
|
+
|
|
1617
|
+
The result distinguishes `no-data` (an explicitly absent target, using `absent`
|
|
1618
|
+
for both expected hash and mode), `no-op` (a present file with no exact matches),
|
|
1619
|
+
`preview`, `applied`, and `ambiguous`. `plannedAfterSha256` describes the proposed
|
|
1620
|
+
bytes. `afterSha256` is unavailable until readback verifies an applied target.
|
|
1621
|
+
Apply uses a descriptor-held package lock and atomic file exchange, retaining
|
|
1622
|
+
both a private preimage and the displaced entry. Exchange is not compare-and-swap.
|
|
1623
|
+
A post-exchange race or failed verification returns `ambiguous`, exit 2,
|
|
1624
|
+
`mutationOccurred: true` and exact recovery paths. It never claims no write or
|
|
1625
|
+
blindly overwrites a concurrent edit during rollback. Failed staging and all
|
|
1626
|
+
preservation evidence remain for recovery.
|
|
1627
|
+
|
|
1628
|
+
This command makes no hosted request and needs no credential. It can run from
|
|
1629
|
+
an exact reviewed task-scoped CLI artifact without installing it as the shared
|
|
1630
|
+
Skills command. Its lock file remains in the target directory. Removing context
|
|
1631
|
+
hooks can stale enrolled settings witnesses that bind those hooks. The operation
|
|
1632
|
+
reports `settingsWitness: not-renewed` and does not refresh or relax them.
|
|
1633
|
+
`PreToolUse` enforcement can therefore still refuse on a stale witness. This is
|
|
1634
|
+
a context-delivery shutdown, not admission recovery or permission to reactivate
|
|
1635
|
+
hooks. Linux uses `renameat2(RENAME_EXCHANGE)` and macOS uses
|
|
1636
|
+
`renamex_np(RENAME_SWAP)`; unsupported exchange or filesystem behavior refuses.
|
|
1637
|
+
|
|
1638
|
+
|
|
1546
1639
|
## Profiles, station sync and rollback
|
|
1547
1640
|
|
|
1548
1641
|
```bash
|
|
@@ -2099,7 +2192,7 @@ on the exact entry, through `env -i` with an explicit environment allowlist:
|
|
|
2099
2192
|
(`TERM`, `TERM_PROGRAM`, `TERM_PROGRAM_VERSION`, `COLORTERM`, `COLUMNS`, `LINES`),
|
|
2100
2193
|
`NO_COLOR`, `FORCE_COLOR`, `CI`, `EDITOR`, `VISUAL`, `PAGER`, `SSH_AUTH_SOCK`,
|
|
2101
2194
|
the server settings `HOST`, `PORT`, `NODE_ENV`, `AGENT_ID` and
|
|
2102
|
-
`ECS_CONTAINER_METADATA_URI_V4`, the agent names `TERMINAL_CWD`, `CODEX_HOME`,
|
|
2195
|
+
`ECS_CONTAINER_METADATA_URI_V4`, the agent names `TERMINAL_CWD`, `CODEX_HOME`, `CLAUDE_CONFIG_DIR`,
|
|
2103
2196
|
`HERMES_HOME` and `HERMES_ENABLE_PROJECT_PLUGINS`, and every name starting with
|
|
2104
2197
|
`HASNA_`, `SKILLS_`, `SKILL_`, `MCP_`, `XDG_`, `LC_` or `AWS_`. Your `LC_ALL` passes
|
|
2105
2198
|
through unchanged. Everything else never reaches the runtime, including `BUN_*`,
|
|
@@ -2107,7 +2200,7 @@ through unchanged. Everything else never reaches the runtime, including `BUN_*`,
|
|
|
2107
2200
|
(`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`). A `bunfig.toml`, `.env` or `tsconfig.json`
|
|
2108
2201
|
in the directory you run a command from is never read.
|
|
2109
2202
|
|
|
2110
|
-
New launchers use the
|
|
2203
|
+
New launchers use the V3 format, preserving `CLAUDE_CONFIG_DIR`, with an explicit environment profile. The CLI and
|
|
2111
2204
|
MCP entries use the client profile, which excludes `DATABASE_URL`,
|
|
2112
2205
|
`HASNA_SKILLS_DATABASE_URL` and `SKILLS_DATABASE_URL` even when their prefixes are
|
|
2113
2206
|
otherwise allowed. The API server, worker, maintenance and migration entries use
|
|
@@ -2124,10 +2217,10 @@ directory first. The receipt records the old and new launcher shape of every pat
|
|
|
2124
2217
|
the backup keeps the exact previous launcher (symlink text or pinned bytes), and
|
|
2125
2218
|
`--rollback` restores it byte for byte. Codex hook trust, the Claude settings
|
|
2126
2219
|
projection and `skills self-update` read a managed pinned launcher as the exact
|
|
2127
|
-
entry it runs and bind the launcher's own bytes as well. Existing V1 launchers
|
|
2128
|
-
remain recognized in their exact original
|
|
2129
|
-
format metadata restore V1 bytes; new receipts bind the
|
|
2130
|
-
profile. An upgrade
|
|
2220
|
+
entry it runs and bind the launcher's own bytes as well. Existing V1 and V2 launchers
|
|
2221
|
+
remain recognized in their exact original formats. Receipts without launcher
|
|
2222
|
+
format metadata restore V1 bytes; new receipts bind the V3 format and environment
|
|
2223
|
+
profile. An upgrade preserves byte-exact rollback to a prior V1 or V2 launcher.
|
|
2131
2224
|
|
|
2132
2225
|
An updater from before pinned launchers (0.10.48 and earlier) writes bare symlinks,
|
|
2133
2226
|
including when it installs a version that has them, and an exact-version update to
|
|
@@ -3416,6 +3509,12 @@ signal refuses before calling the transport.
|
|
|
3416
3509
|
|
|
3417
3510
|
Payload writers reject known native skill folders, physical aliases of the account's native roots, and configured home discovery roots (including OpenCode `skills.paths`) before creating directories. Malformed or unresolved native registrations fail closed and require the existing Skills discovery review. Changing the authoring data directory does not hide the account's native policy.
|
|
3418
3511
|
|
|
3512
|
+
`CODEX_HOME` and `CLAUDE_CONFIG_DIR` also exclude their selected native home and its current configured discovery roots. Relative Codex homes resolve from the caller's directory. Claude requires an absolute configuration directory. Native skills and plugin-cache subroots, Claude's synced-plugin and legacy-command subroots, and their physical targets remain excluded when those subroots are symlinks outside the selected home. Bounded metadata traversal also excludes readable descendant alias targets while allowing unrelated private authoring. The same traversal protects default homes with no override, or when the override equals or aliases the default home. Physical aliases and destinations containing an excluded root are refused too. Default and retained roots remain excluded when an override is selected. An override does not enroll a new native consumer or reuse another home's opaque-hook review. Unsupported custom Hermes homes fail closed even when the default Hermes directory is absent.
|
|
3513
|
+
|
|
3514
|
+
Authoring derives a read-only exclusion set from current supported discovery controls and unions it with every retained policy root. A stale full-file settings witness does not by itself block a safe portable destination. For example, ordinary Claude model/theme changes without opaque hooks, or a newly added OpenCode `skills.paths` directory, do not require enrollment or policy updates. Both the old and new custom roots remain forbidden destinations. Native loading and enrollment still verify their original witnesses strictly.
|
|
3515
|
+
|
|
3516
|
+
Unknown discovery controls, malformed or ambiguous registrations, unresolved aliases/runtimes and bounded-enumeration failures refuse before a payload write. Executable hooks whose roots cannot be enumerated still need their existing current source review. Typed Claude v5/Codex v7 settings witnesses and an already recorded narrowed witness can establish that review without a write. A legacy opaque hook registration whose full-file witness is stale and has no previously recorded narrowed proof remains unsupported. Authoring never manufactures that proof or enrolls the account. Opaque hooks also retain the existing reviewed executable/dependency source population and directory evidence: matching settings, `hooks.json`, or a manifest alone is insufficient. The authoring-only check reuses the native verifier's source, directory, semantic and retired-source predicates, exempting only the primary configuration already handled by the current bounded root pass. Missing executable closure evidence refuses. A filesystem-root exclusion such as OpenCode `skills.paths: ["/"]` excludes all descendants, including physical aliases.
|
|
3517
|
+
|
|
3419
3518
|
Other authoring tools can use the same read-only guard from the package root:
|
|
3420
3519
|
|
|
3421
3520
|
```ts
|
|
@@ -3462,6 +3561,25 @@ refuses native discovery or unknown control changes, and changes policy only.
|
|
|
3462
3561
|
After explicit migration, ordinary supported local MCP updates require no
|
|
3463
3562
|
coordinated policy write.
|
|
3464
3563
|
|
|
3564
|
+
### Native discovery drift is reported, not blocking
|
|
3565
|
+
|
|
3566
|
+
Live prompt, session, subagent and tool hooks no longer block on
|
|
3567
|
+
`NATIVE_SKILL_DRIFT`. The turn proceeds without Skills context, the agent shows
|
|
3568
|
+
one warning naming the change and the repair command, and the hook records a
|
|
3569
|
+
receipt in `<skills-data>/native-drift/<agent>.json`; `skills hook drift --json`
|
|
3570
|
+
lists them. Invoking a native payload skill instead of the `skills-cli` bridge
|
|
3571
|
+
is still denied, and so is invoking the bridge while the bridge itself is
|
|
3572
|
+
missing or modified; install, trust and migration still refuse drift.
|
|
3573
|
+
|
|
3574
|
+
`claude-settings-v5` and `codex-settings-v7` reviews bind only settings that can
|
|
3575
|
+
add, remove or redirect native skills, hooks or plugins (and, for Codex, every
|
|
3576
|
+
MCP server and instruction source), so a model switch, an "always allow" rule, a
|
|
3577
|
+
status line or Codex's folder trust and notices are not drift. Existing Claude
|
|
3578
|
+
and Codex reviews keep verifying through a narrowed-witness ledger the live hook
|
|
3579
|
+
records while they still match; a station that had already drifted, V6 and Sumi
|
|
3580
|
+
witnesses still need one fresh review. See
|
|
3581
|
+
[docs/plugin-admission.md](docs/plugin-admission.md#narrowed-discovery-reviews-claude-settings-v5-and-codex-settings-v7).
|
|
3582
|
+
|
|
3465
3583
|
### Reproduce a reviewed runtime dependency closure
|
|
3466
3584
|
|
|
3467
3585
|
For an exact-version copyfile update, supply an owner-private absolute npm
|