plugnz 0.0.38 → 0.0.39
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 +31 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.mjs +9349 -0
- package/dist/plugnz.mjs +27 -9
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -42,3 +42,34 @@ Published on npm as `plugnz`; source repository: `archeism/plugnz`.
|
|
|
42
42
|
|
|
43
43
|
Maintainers: see [publishing instructions](docs/publishing.md). Pushes to `main`
|
|
44
44
|
automatically publish the next patch after local verification.
|
|
45
|
+
|
|
46
|
+
### Inspect a local plugin from an application
|
|
47
|
+
|
|
48
|
+
The `plugnz` package exports two synchronous ESM functions for Node 22+ and Bun.
|
|
49
|
+
Pass a path to a single plugin directory containing a supported manifest. To
|
|
50
|
+
bind a registration to reviewed bytes, capture the directory first. Inspection
|
|
51
|
+
accepts root and `.plugin` manifests as well as Claude, Codex, and ZCode plugin
|
|
52
|
+
manifests. It recognizes both wrapped MCP server maps and the bare-map form
|
|
53
|
+
used by the [official Claude marketplace Playwright plugin](https://github.com/anthropics/claude-plugins-official/tree/0fbfda5a91f4adc311daca25acc99132f40f0b6e/external_plugins/playwright).
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { capturePlugin, inspectPlugin } from 'plugnz';
|
|
57
|
+
|
|
58
|
+
const snapshot = capturePlugin('/projects/my-plugin');
|
|
59
|
+
const plugin = inspectPlugin(snapshot.directory);
|
|
60
|
+
if (snapshot.revision !== plugin.revision) throw new Error('Plugin snapshot changed');
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`capturePlugin` uses plugnz's content-addressed local cache. The SHA-256
|
|
64
|
+
revision covers the file paths, bytes and executable bits, excluding Git
|
|
65
|
+
metadata. `inspectPlugin` only reads the supplied directory. It preserves skill
|
|
66
|
+
Markdown and reports stdio MCP declarations with their authored arguments and
|
|
67
|
+
environment. It never expands environment variables, runs a server or installs
|
|
68
|
+
hooks. Keep server declarations local since their environment can include secrets.
|
|
69
|
+
|
|
70
|
+
The returned `hooks`, `restrictions` and `unsupported` arrays identify source
|
|
71
|
+
declarations that have no equivalent in the plain skill/stdio projection. A
|
|
72
|
+
consumer must account for them before exposing the plugin to another harness.
|
|
73
|
+
Explicit native installation still uses `plugnz install --target <host>`.
|
|
74
|
+
Malformed or conflicting input throws an error. Supply stable source bytes
|
|
75
|
+
during inspection and use the revision to check any persisted registration.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A local stdio declaration. Values are authored strings and may contain credentials. */
|
|
2
|
+
export interface StdioServerDeclaration {
|
|
3
|
+
command: string;
|
|
4
|
+
args?: string[];
|
|
5
|
+
env?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface PluginInspection {
|
|
9
|
+
name: string;
|
|
10
|
+
/** SHA-256 of package files, paths and executable bits, excluding Git metadata. */
|
|
11
|
+
revision: string;
|
|
12
|
+
skills: Array<{ name: string; text: string }>;
|
|
13
|
+
mcpServers: Record<string, StdioServerDeclaration>;
|
|
14
|
+
/** Source declarations that need a native hook runtime. */
|
|
15
|
+
hooks: string[];
|
|
16
|
+
/** Authored restrictions that a consumer must preserve before exposure. */
|
|
17
|
+
restrictions: string[];
|
|
18
|
+
/** Components or fields outside this projection, identified by source. */
|
|
19
|
+
unsupported: string[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Inspect one stable local plugin directory. Throws on invalid or ambiguous source. */
|
|
23
|
+
export function inspectPlugin(directory: string): PluginInspection;
|
|
24
|
+
|
|
25
|
+
/** Capture a stable local plugin tree in the existing plugnz snapshot cache. */
|
|
26
|
+
export function capturePlugin(directory: string): { directory: string; revision: string };
|