@r_masseater/plugin-kit 0.1.0 → 0.2.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.
- package/README.md +11 -1
- package/dist/index.d.mts +5125 -3
- package/dist/index.mjs +6758 -3865
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
- package/skills/find-cache-folder/SKILL.md +36 -0
- package/skills/read-hook-input/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @r_masseater/plugin-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared code for Claude Code plugin hooks and scripts: read untrusted JSON and find the cache folder.
|
|
4
4
|
|
|
5
5
|
It requires Node.js 26 or later. It bundles the little of Effect it needs, so installing it adds no other package.
|
|
6
6
|
|
|
@@ -21,6 +21,16 @@ if (parsed._tag === "Some" && isRecord(parsed.value)) {
|
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## Find the cache folder
|
|
25
|
+
|
|
26
|
+
`cacheRootOf` returns the folder a plugin keeps downloaded or built files in: `$XDG_CACHE_HOME/<segments>`, or `~/.cache/<segments>` when `XDG_CACHE_HOME` is unset or empty. It builds the path and creates nothing. `cacheRootEffect` is the same lookup as an Effect that fails with `CacheRootError` when neither variable is set.
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { cacheRootOf } from "@r_masseater/plugin-kit";
|
|
30
|
+
|
|
31
|
+
const root = await cacheRootOf(["my-plugin", "runtime"]);
|
|
32
|
+
```
|
|
33
|
+
|
|
24
34
|
## Agent skills
|
|
25
35
|
|
|
26
36
|
The package ships an agent skill in `skills/`. Add `permissions: { "@r_masseater/plugin-kit": { skills: true } }` to `pnpm-workspace.yaml` and `vp install` links it into the skill directories of your agents.
|