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/dist/plugnz.mjs CHANGED
@@ -14490,8 +14490,8 @@ class SemanticInventoryError extends Error {
14490
14490
  this.name = "SemanticInventoryError";
14491
14491
  }
14492
14492
  }
14493
- function inventoryPackageSemantics(plugin) {
14494
- const files = walkFiles(plugin.dir);
14493
+ function inventoryPackageSemantics(plugin, inspection) {
14494
+ const files = inspection?.files ?? listPackageFiles(plugin.dir);
14495
14495
  let portableAgents = false;
14496
14496
  try {
14497
14497
  portableAgents = planPortableAgents(plugin.dir, "inventory") !== null;
@@ -14545,7 +14545,8 @@ function inventoryPackageSemantics(plugin) {
14545
14545
  const invocationPolicies = skills.map((path) => inventorySkillPolicy(plugin.dir, path));
14546
14546
  const manifest = manifests[0];
14547
14547
  if (manifest?.mcpServers !== undefined) {
14548
- if (!isRecord2(manifest.mcpServers))
14548
+ const reference = inspection?.allowMcpFileReference && typeof manifest.mcpServers === "string";
14549
+ if (!isRecord2(manifest.mcpServers) && !reference)
14549
14550
  invalid6("plugin manifest mcpServers must be an object");
14550
14551
  mcp.push(`${manifest.path}#mcpServers`);
14551
14552
  }
@@ -14790,6 +14791,8 @@ function inventoryHooks(root, files, manifests) {
14790
14791
  const cached = documents.get(path);
14791
14792
  if (cached !== undefined)
14792
14793
  return cached;
14794
+ if (!files.includes(path))
14795
+ invalid6(`hook configuration is outside the package inventory: ${path}`);
14793
14796
  const value = parseJsonObject(join23(root, path), `hook configuration ${path}`);
14794
14797
  if (Object.keys(value).some((field) => field !== "hooks") || !isRecord2(value["hooks"])) {
14795
14798
  invalid6(`hook configuration ${path} must contain only a top-level hooks object`);
@@ -14975,7 +14978,7 @@ function validateHookHandler(hook, label) {
14975
14978
  return;
14976
14979
  invalid6(`${label} has an unknown type or is missing required fields`);
14977
14980
  }
14978
- function walkFiles(root) {
14981
+ function listPackageFiles(root) {
14979
14982
  const files = [];
14980
14983
  const walk = (dir) => {
14981
14984
  for (const entry of readdirSync10(dir).sort()) {
@@ -15136,7 +15139,7 @@ function invalid6(diagnostic) {
15136
15139
  function errorDiagnostic(error) {
15137
15140
  return error instanceof Error && error.message.trim() !== "" ? error.message : String(error);
15138
15141
  }
15139
- var OPENING_FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/u;
15142
+ var OPENING_FRONTMATTER = /^(?:\uFEFF)?---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/u;
15140
15143
  var MODEL_INVOCATION_ALIASES = ["disable-model-invocation", "disable_model_invocation"];
15141
15144
  var USER_INVOCATION_ALIASES = ["user-invocable", "user_invocable"];
15142
15145
  var PERMISSION_FIELDS = [
@@ -15753,7 +15756,14 @@ function freezeLocalSource(source) {
15753
15756
  throw new Error(`Cached Source snapshot is corrupt: ${target}`);
15754
15757
  return target;
15755
15758
  }
15756
- renameSync2(candidate, target);
15759
+ try {
15760
+ renameSync2(candidate, target);
15761
+ } catch (error) {
15762
+ if (!["ENOTEMPTY", "EEXIST"].includes(error.code))
15763
+ throw error;
15764
+ if (fingerprintTree(assertSafeSourceTree(target)) !== fingerprint)
15765
+ throw new Error(`Cached Source snapshot is corrupt: ${target}`);
15766
+ }
15757
15767
  return target;
15758
15768
  } finally {
15759
15769
  rmSync4(candidate, { recursive: true, force: true });
@@ -15950,9 +15960,9 @@ function isRecord3(value) {
15950
15960
  function isPluginDir(dir) {
15951
15961
  return manifestPaths(dir).some(existsSync20) || existsSync20(join26(dir, ".mcp.json")) || existsSync20(join26(dir, "mcp.json"));
15952
15962
  }
15953
- function readPluginManifest(dir) {
15963
+ function readPluginManifest(dir, additionalManifests = []) {
15954
15964
  let selected;
15955
- for (const path of manifestPaths(dir)) {
15965
+ for (const path of [...manifestPaths(dir), ...additionalManifests.map((name) => join26(dir, name))]) {
15956
15966
  if (!existsSync20(path))
15957
15967
  continue;
15958
15968
  const current = parsePluginManifest(path);
@@ -37413,7 +37423,7 @@ function legacyCommandAction(command) {
37413
37423
  // package.json
37414
37424
  var package_default = {
37415
37425
  name: "plugnz",
37416
- version: "0.0.38",
37426
+ version: "0.0.39",
37417
37427
  description: "Install, diagnose and update agent plugins (Agent Plugins spec) and MCP configs across Claude Code, Codex, Cursor, Kimi and more",
37418
37428
  license: "MIT",
37419
37429
  type: "module",
@@ -37421,6 +37431,14 @@ var package_default = {
37421
37431
  type: "git",
37422
37432
  url: "git+https://github.com/archeism/plugnz.git"
37423
37433
  },
37434
+ exports: {
37435
+ ".": {
37436
+ types: "./dist/index.d.mts",
37437
+ import: "./dist/index.mjs"
37438
+ },
37439
+ "./dist/*": "./dist/*",
37440
+ "./package.json": "./package.json"
37441
+ },
37424
37442
  bin: {
37425
37443
  plugnz: "dist/plugnz.mjs",
37426
37444
  plgnz: "dist/plugnz.mjs"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugnz",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "Install, diagnose and update agent plugins (Agent Plugins spec) and MCP configs across Claude Code, Codex, Cursor, Kimi and more",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,6 +8,14 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/archeism/plugnz.git"
10
10
  },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.mts",
14
+ "import": "./dist/index.mjs"
15
+ },
16
+ "./dist/*": "./dist/*",
17
+ "./package.json": "./package.json"
18
+ },
11
19
  "bin": {
12
20
  "plugnz": "dist/plugnz.mjs",
13
21
  "plgnz": "dist/plugnz.mjs"