@namzu/sdk 69.1.0 → 69.3.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/constants/plugin/index.d.ts +8 -0
  3. package/dist/constants/plugin/index.d.ts.map +1 -1
  4. package/dist/constants/plugin/index.js +8 -0
  5. package/dist/constants/plugin/index.js.map +1 -1
  6. package/dist/persona/assembler.d.ts.map +1 -1
  7. package/dist/persona/assembler.js +7 -1
  8. package/dist/persona/assembler.js.map +1 -1
  9. package/dist/plugin/common-layout/index.d.ts +5 -0
  10. package/dist/plugin/common-layout/index.d.ts.map +1 -0
  11. package/dist/plugin/common-layout/index.js +3 -0
  12. package/dist/plugin/common-layout/index.js.map +1 -0
  13. package/dist/plugin/common-layout/mcp.d.ts +21 -0
  14. package/dist/plugin/common-layout/mcp.d.ts.map +1 -0
  15. package/dist/plugin/common-layout/mcp.js +305 -0
  16. package/dist/plugin/common-layout/mcp.js.map +1 -0
  17. package/dist/plugin/common-layout/paths.d.ts +27 -0
  18. package/dist/plugin/common-layout/paths.d.ts.map +1 -0
  19. package/dist/plugin/common-layout/paths.js +48 -0
  20. package/dist/plugin/common-layout/paths.js.map +1 -0
  21. package/dist/plugin/common-layout/read.d.ts +25 -0
  22. package/dist/plugin/common-layout/read.d.ts.map +1 -0
  23. package/dist/plugin/common-layout/read.js +1155 -0
  24. package/dist/plugin/common-layout/read.js.map +1 -0
  25. package/dist/plugin/common-layout/types.d.ts +66 -0
  26. package/dist/plugin/common-layout/types.d.ts.map +1 -0
  27. package/dist/plugin/common-layout/types.js +2 -0
  28. package/dist/plugin/common-layout/types.js.map +1 -0
  29. package/dist/plugin/common-layout-names.d.ts +65 -0
  30. package/dist/plugin/common-layout-names.d.ts.map +1 -0
  31. package/dist/plugin/common-layout-names.js +94 -0
  32. package/dist/plugin/common-layout-names.js.map +1 -0
  33. package/dist/plugin/hook-module/capabilities.d.ts +41 -0
  34. package/dist/plugin/hook-module/capabilities.d.ts.map +1 -0
  35. package/dist/plugin/hook-module/capabilities.js +438 -0
  36. package/dist/plugin/hook-module/capabilities.js.map +1 -0
  37. package/dist/plugin/hook-module/consent.d.ts +39 -0
  38. package/dist/plugin/hook-module/consent.d.ts.map +1 -0
  39. package/dist/plugin/hook-module/consent.js +59 -0
  40. package/dist/plugin/hook-module/consent.js.map +1 -0
  41. package/dist/plugin/hook-module/events.d.ts +33 -0
  42. package/dist/plugin/hook-module/events.d.ts.map +1 -0
  43. package/dist/plugin/hook-module/events.js +149 -0
  44. package/dist/plugin/hook-module/events.js.map +1 -0
  45. package/dist/plugin/hook-module/host.d.ts +79 -0
  46. package/dist/plugin/hook-module/host.d.ts.map +1 -0
  47. package/dist/plugin/hook-module/host.js +546 -0
  48. package/dist/plugin/hook-module/host.js.map +1 -0
  49. package/dist/plugin/hook-module/index.d.ts +11 -0
  50. package/dist/plugin/hook-module/index.d.ts.map +1 -0
  51. package/dist/plugin/hook-module/index.js +6 -0
  52. package/dist/plugin/hook-module/index.js.map +1 -0
  53. package/dist/plugin/hook-module/scan.d.ts +99 -0
  54. package/dist/plugin/hook-module/scan.d.ts.map +1 -0
  55. package/dist/plugin/hook-module/scan.js +789 -0
  56. package/dist/plugin/hook-module/scan.js.map +1 -0
  57. package/dist/plugin/hook-module/worker-source.d.ts +31 -0
  58. package/dist/plugin/hook-module/worker-source.d.ts.map +1 -0
  59. package/dist/plugin/hook-module/worker-source.js +498 -0
  60. package/dist/plugin/hook-module/worker-source.js.map +1 -0
  61. package/dist/plugin/index.d.ts +5 -2
  62. package/dist/plugin/index.d.ts.map +1 -1
  63. package/dist/plugin/index.js +4 -1
  64. package/dist/plugin/index.js.map +1 -1
  65. package/dist/plugin/lifecycle.d.ts +57 -0
  66. package/dist/plugin/lifecycle.d.ts.map +1 -1
  67. package/dist/plugin/lifecycle.js +92 -11
  68. package/dist/plugin/lifecycle.js.map +1 -1
  69. package/dist/plugin/loader.d.ts +30 -0
  70. package/dist/plugin/loader.d.ts.map +1 -1
  71. package/dist/plugin/loader.js +76 -19
  72. package/dist/plugin/loader.js.map +1 -1
  73. package/dist/plugin/shell-hook-env.d.ts +7 -0
  74. package/dist/plugin/shell-hook-env.d.ts.map +1 -1
  75. package/dist/plugin/shell-hook-env.js.map +1 -1
  76. package/dist/plugin/shell-hook.d.ts +10 -1
  77. package/dist/plugin/shell-hook.d.ts.map +1 -1
  78. package/dist/plugin/shell-hook.js +81 -70
  79. package/dist/plugin/shell-hook.js.map +1 -1
  80. package/dist/public-runtime.d.ts +3 -2
  81. package/dist/public-runtime.d.ts.map +1 -1
  82. package/dist/public-runtime.js +2 -2
  83. package/dist/public-runtime.js.map +1 -1
  84. package/dist/public-tools.d.ts +2 -0
  85. package/dist/public-tools.d.ts.map +1 -1
  86. package/dist/public-tools.js +4 -0
  87. package/dist/public-tools.js.map +1 -1
  88. package/dist/skills/loader.d.ts +8 -2
  89. package/dist/skills/loader.d.ts.map +1 -1
  90. package/dist/skills/loader.js +22 -11
  91. package/dist/skills/loader.js.map +1 -1
  92. package/dist/skills/registry.d.ts.map +1 -1
  93. package/dist/skills/registry.js +9 -1
  94. package/dist/skills/registry.js.map +1 -1
  95. package/dist/tools/builtins/atomic-write-file.d.ts +19 -3
  96. package/dist/tools/builtins/atomic-write-file.d.ts.map +1 -1
  97. package/dist/tools/builtins/atomic-write-file.js +56 -3
  98. package/dist/tools/builtins/atomic-write-file.js.map +1 -1
  99. package/dist/types/plugin/index.d.ts +73 -0
  100. package/dist/types/plugin/index.d.ts.map +1 -1
  101. package/dist/types/plugin/index.js +28 -6
  102. package/dist/types/plugin/index.js.map +1 -1
  103. package/dist/types/skills/index.d.ts +13 -0
  104. package/dist/types/skills/index.d.ts.map +1 -1
  105. package/dist/types/skills/index.js.map +1 -1
  106. package/package.json +2 -1
  107. package/src/constants/plugin/index.ts +9 -0
  108. package/src/persona/assembler.ts +7 -1
  109. package/src/plugin/common-layout/index.ts +19 -0
  110. package/src/plugin/common-layout/mcp.ts +362 -0
  111. package/src/plugin/common-layout/paths.ts +70 -0
  112. package/src/plugin/common-layout/read.ts +1282 -0
  113. package/src/plugin/common-layout/types.ts +77 -0
  114. package/src/plugin/common-layout-names.ts +108 -0
  115. package/src/plugin/hook-module/capabilities.ts +500 -0
  116. package/src/plugin/hook-module/consent.ts +96 -0
  117. package/src/plugin/hook-module/events.ts +177 -0
  118. package/src/plugin/hook-module/host.ts +649 -0
  119. package/src/plugin/hook-module/index.ts +52 -0
  120. package/src/plugin/hook-module/scan.ts +1004 -0
  121. package/src/plugin/hook-module/worker-source.ts +500 -0
  122. package/src/plugin/index.ts +13 -1
  123. package/src/plugin/lifecycle.ts +179 -17
  124. package/src/plugin/loader.ts +97 -18
  125. package/src/plugin/shell-hook-env.ts +7 -0
  126. package/src/plugin/shell-hook.ts +91 -70
  127. package/src/public-runtime.ts +35 -0
  128. package/src/public-tools.ts +6 -0
  129. package/src/skills/loader.ts +26 -9
  130. package/src/skills/registry.ts +9 -1
  131. package/src/tools/builtins/atomic-write-file.ts +73 -5
  132. package/src/types/plugin/index.ts +81 -24
  133. package/src/types/skills/index.ts +15 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 69.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a547c46: A plugin folder written in the common plugin layout now loads without a `plugin.json`. `loadPluginManifest` falls back to a new reader (`readCommonLayout`) when there is no `plugin.json`: it reads the layout's own manifest, a root `SKILL.md`, or just the conventional folders, auto-scans `skills/`, `commands/` and `agents/`, takes a command or agent as a single file, reads a root servers file in its keyed and flat forms, and reports every entry as used, ignored, not used or refused (`loadPluginManifestWithFindings`, `PluginLifecycleManager.layoutFindings`). `discoverPlugins` now also finds a folder whose manifest is the layout's. `install` takes an optional `manifestSource` for a manifest the caller already read. Plugin manifests may list `remoteMcpServers`, which are parsed and reported and never started, and a plugin in the layout may hold 64 skills, 16 MCP servers and 64 command and agent entries (a `plugin.json` keeps 20, 5, 10 and 10; `CommonLayoutManifestSchema`). A hooks path to program code is refused and a folder with hooks or servers and no manifest is refused. Nothing existing breaks: a folder with a `plugin.json` is read as before. One difference to know: a folder that has no `plugin.json` used to fail to load with a file error and now either loads or fails with a sentence saying why. `${NAMZU_PLUGIN_ROOT}` in a plugin skill's text is now replaced by the plugin's folder, and a hook of a plugin read through the layout also gets the three compatibility environment names (`PluginFolders.layout`).
8
+ - 634ec72: A plugin read through the common plugin layout may now name a hooks module in `hooks/hooks.json` (`"modules": ["./mod.js"]`), and the SDK can run it: `startHookModule` runs the module in a `worker_threads` Worker of its own inside a `node:vm` context with no `require`, `process`, timers or network, and returns hooks to attach for the `classic.*` events it registers (`register(on, options)`, globs, negations, matchers, `.catch`, `next`). Its answers are read by the same code as a command hook's JSON, a dispatch fails closed after 10 seconds, and `$` reaches the host through a bridge with limits. `scanHookModule` and `locateHookModule` read a module with `acorn` before it runs; `summarizeHookModule` and `hookModuleConsentEntry` give a consent surface what it does. `PluginLifecycleManager` takes a `hookModuleFor` callback and ends what it started when the plugin is disabled, uninstalled or rolled back; `shellHookInputFor` is exported from the shell-hook adapter's input builder. Nothing existing breaks. What changes for a reader of the layout: `hooks-modules-refused` is no longer raised for the module in `hooks/hooks.json` (it appears as `hooks-module-used`, `hooks-module-scan-refused` or `hooks-module-not-used`); a second module and a `modules` list in any other hooks file are still refused, and so is a `.js` path given directly in the manifest's `hooks`. `acorn` is a new dependency.
9
+ - 5946954: A `mcp-needs-setup` finding from the common plugin layout reader now carries the server as written (`server`, type `LayoutSetupServer`), so a host can still show a server that is not admitted yet. Nothing existing changes; the field is new and optional.
10
+ - 5946954: Adds `COMMON_MARKETPLACE_DIR`, `COMMON_MARKETPLACE_FILE` and `isOfficialLookingMarketplaceName` to the exports, for hosts that add marketplaces in the common plugin layout. Nothing existing changes.
11
+ - da59f91: A plugin whose only content is a remote server that needs setup now loads and reports that server, instead of being refused for having nothing Namzu uses. The `mcp-server-remote` finding's message says the server connects only after the person approves it. Nothing existing breaks; no other finding changes.
12
+
13
+ ### Patch Changes
14
+
15
+ - 634ec72: A hooks module can no longer climb out of its context to the worker: `$`, `console`, the event, `next` and its signal are now made inside the module's context, so `console.log.constructor` and `e.constructor.constructor` no longer reach `process`. What a module loses: `URL`, `URLSearchParams`, `TextEncoder`, `TextDecoder`, `AbortController`, `atob`, `btoa` and `structuredClone` are no longer defined in it (a module that used them should do without or parse the text itself), and the scan now refuses `constructor`, `__proto__`, `getPrototypeOf` and the like with the file and line. A dispatch may take no more than six times its budget in all (60 seconds), calls on `$` included, then the worker is ended and the programs it started are killed; a cancelled hook that does not stop within a second has its worker ended. `$.process.run` starts a program with `PATH`, `HOME`, the locale and temporary folder variables and the names the module reads with `$.env.get`, no longer the whole environment; a module that needs another variable names it with `$.env.get` or passes `env` to `run`. `namzu plugin validate` says a module the scan refused is not run (`hooksModule.status` is `refused`, and `hooks[].runs` is false), says a module that registers nothing Namzu runs is not loaded (`empty`), and prints each not-used line once.
16
+
17
+ ## 69.2.0
18
+
19
+ ### Minor Changes
20
+
21
+ - cc45e90: Adds `atomicWriteFile` and `UnsafeWritePathError` to the public exports: the atomic file write the `write` and `edit` tools use, for a host that writes a file the same safe way. A new `refuseLinksBelow` option refuses to write through a symbolic link below a folder and keeps the path inside it; a new `mode` option sets the bits of a new file. Without them behaviour is unchanged: the write goes through a link and keeps it.
22
+ - 0a11e87: Adds `SkillMetadata.listing`. A host that sets `listing: 'name-only'` on a skill it hands to the prompt gets a manifest entry with the name and location and no description, so the skill costs a few tokens a turn and the model can still load it by name. Absent keeps the whole entry; nothing changes for a host that does not set it.
23
+
3
24
  ## 69.1.0
4
25
 
5
26
  ### Minor Changes
@@ -30,6 +30,14 @@ export declare const MAX_CONNECTORS_PER_PLUGIN = 10;
30
30
  export declare const MAX_PERSONAS_PER_PLUGIN = 5;
31
31
  export declare const MAX_COMMAND_DIRS_PER_PLUGIN = 10;
32
32
  export declare const MAX_AGENT_DIRS_PER_PLUGIN = 10;
33
+ /** Limits for a plugin read in the common plugin layout, which ships larger plugins. */
34
+ export declare const COMMON_LAYOUT_MAX_MCP_SERVERS = 16;
35
+ export declare const COMMON_LAYOUT_MAX_SKILLS = 64;
36
+ export declare const COMMON_LAYOUT_MAX_COMMANDS = 64;
37
+ export declare const COMMON_LAYOUT_MAX_AGENTS = 64;
38
+ /** A plugin folder over either of these is refused. */
39
+ export declare const COMMON_LAYOUT_MAX_FILES = 20000;
40
+ export declare const COMMON_LAYOUT_MAX_BYTES: number;
33
41
  /** Hook execution */
34
42
  export declare const HOOK_TIMEOUT_MS = 600000;
35
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/plugin/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,eAAO,MAAM,kBAAkB,mBAAmB,CAAA;AAClD,eAAO,MAAM,eAAe,mBAAmB,CAAA;AAE/C,yBAAyB;AACzB,eAAO,MAAM,wBAAwB,gBAAgB,CAAA;AAErD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAA;AAE9C,6BAA6B;AAC7B,eAAO,MAAM,sBAAsB,KAAK,CAAA;AACxC,eAAO,MAAM,mBAAmB,QAA+B,CAAA;AAE/D,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,KAAK,CAAA;AACtC,eAAO,MAAM,oBAAoB,KAAK,CAAA;AACtC,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAC3C,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAC3C,eAAO,MAAM,uBAAuB,IAAI,CAAA;AACxC,eAAO,MAAM,2BAA2B,KAAK,CAAA;AAC7C,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAE3C,qBAAqB;AACrB,eAAO,MAAM,eAAe,SAAU,CAAA;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAA;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 +30,14 @@ export const MAX_CONNECTORS_PER_PLUGIN = 10;
30
30
  export const MAX_PERSONAS_PER_PLUGIN = 5;
31
31
  export const MAX_COMMAND_DIRS_PER_PLUGIN = 10;
32
32
  export const MAX_AGENT_DIRS_PER_PLUGIN = 10;
33
+ /** Limits for a plugin read in the common plugin layout, which ships larger plugins. */
34
+ export const COMMON_LAYOUT_MAX_MCP_SERVERS = 16;
35
+ export const COMMON_LAYOUT_MAX_SKILLS = 64;
36
+ export const COMMON_LAYOUT_MAX_COMMANDS = 64;
37
+ export const COMMON_LAYOUT_MAX_AGENTS = 64;
38
+ /** A plugin folder over either of these is refused. */
39
+ export const COMMON_LAYOUT_MAX_FILES = 20_000;
40
+ export const COMMON_LAYOUT_MAX_BYTES = 256 * 1024 * 1024;
33
41
  /** Hook execution */
34
42
  export const HOOK_TIMEOUT_MS = 600_000;
35
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/plugin/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAA;AAClD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAA;AAE/C,yBAAyB;AACzB,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAA;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAA;AAE9C,6BAA6B;AAC7B,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,4BAA4B,CAAA;AAE/D,qCAAqC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;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AgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,GAAG,YAAY,CAE9F"}
1
+ {"version":3,"file":"assembler.d.ts","sourceRoot":"","sources":["../../src/persona/assembler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,KAAK,KAAK,EAAwC,MAAM,0BAA0B,CAAA;AAE3F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,MAAM,CAwCpF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,MAAM,GAAG,IAAI,CA0DnE;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CA4B3E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAiB/F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,GAAG,YAAY,CAE9F"}
@@ -45,9 +45,15 @@ export function renderSkillsSection(skills) {
45
45
  const lines = [
46
46
  '<skill>',
47
47
  `<name>${s.metadata.name}</name>`,
48
- `<description>${skillModelDescription(s.metadata)}</description>`,
48
+ ...(s.metadata.listing === 'name-only'
49
+ ? []
50
+ : [`<description>${skillModelDescription(s.metadata)}</description>`]),
49
51
  `<location>${s.dirPath}/SKILL.md</location>`,
50
52
  ];
53
+ if (s.metadata.listing === 'name-only') {
54
+ lines.push('</skill>');
55
+ return lines.join('\n');
56
+ }
51
57
  if (s.metadata.compatibility) {
52
58
  lines.push(`<compatibility>${s.metadata.compatibility}</compatibility>`);
53
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assembler.js","sourceRoot":"","sources":["../../src/persona/assembler.ts"],"names":[],"mappings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Q,EAAE,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,YAAY;YAC5E,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,IAAI,IAAI,CAAC,QAAQ,EAAE,gBAAgB;SACxF;QACD,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM;QACtC,cAAc,EAAE,QAAQ,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc;KAC9D,CAAA;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAqB,EAAE,cAAsB;IAC/E,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAA;AACtC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { findCommonLayoutRoot, MAX_LAYOUT_MANIFEST_BYTES, readCommonLayout, } from './read.js';
2
+ export { expandPluginPaths, expandPluginRootText, PLUGIN_PATH_VARIABLES, } from './paths.js';
3
+ export type { ExpandedPaths, PluginPathValues } from './paths.js';
4
+ export type { CommonLayoutOptions, CommonLayoutRead, CommonLayoutSource, LayoutFinding, LayoutFindingLevel, LayoutSetupServer, } from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugin/common-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,GAChB,MAAM,WAAW,CAAA;AAClB,OAAO,EACN,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACjE,YAAY,EACX,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { findCommonLayoutRoot, MAX_LAYOUT_MANIFEST_BYTES, readCommonLayout, } from './read.js';
2
+ export { expandPluginPaths, expandPluginRootText, PLUGIN_PATH_VARIABLES, } from './paths.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugin/common-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,GAChB,MAAM,WAAW,CAAA;AAClB,OAAO,EACN,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,YAAY,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { PluginMCPServerConfig, PluginRemoteMCPServerConfig } from '../../types/plugin/index.js';
2
+ import { type PluginPathValues } from './paths.js';
3
+ import type { LayoutFinding } from './types.js';
4
+ /** One servers map and the file (or manifest) it was read from. */
5
+ export interface McpSource {
6
+ readonly origin: string;
7
+ readonly map: Readonly<Record<string, unknown>>;
8
+ }
9
+ export interface McpReadResult {
10
+ readonly local: readonly PluginMCPServerConfig[];
11
+ readonly remote: readonly PluginRemoteMCPServerConfig[];
12
+ readonly findings: readonly LayoutFinding[];
13
+ }
14
+ /**
15
+ * The servers of one parsed file or inline value: `{ "mcpServers": { name: spec } }`
16
+ * or the flat `{ name: spec }`.
17
+ */
18
+ export declare function serversOf(value: unknown): Record<string, unknown> | undefined;
19
+ /** Read every server of every source, applying the path and environment rules. */
20
+ export declare function readMcpSources(sources: readonly McpSource[], values: PluginPathValues, environment: Readonly<Record<string, string | undefined>>): McpReadResult;
21
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/plugin/common-layout/mcp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,qBAAqB,EACrB,2BAA2B,EAC3B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,YAAY,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAA;AAElE,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAC/C;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,2BAA2B,EAAE,CAAA;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAC3C;AAUD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAI7E;AAuTD,kFAAkF;AAClF,wBAAgB,cAAc,CAC7B,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GACvD,aAAa,CAQf"}
@@ -0,0 +1,305 @@
1
+ import { isAbsolute } from 'node:path';
2
+ import { COMMON_USER_CONFIG_PREFIX } from '../common-layout-names.js';
3
+ import { expandPluginPaths } from './paths.js';
4
+ const SERVER_NAME = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/;
5
+ const KNOWN_KEYS = new Set(['command', 'args', 'env', 'type', 'url', 'headers', 'connectTimeoutMs']);
6
+ const REMOTE_TYPES = new Set(['http', 'sse', 'streamable-http']);
7
+ function isMapping(value) {
8
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
9
+ }
10
+ /**
11
+ * The servers of one parsed file or inline value: `{ "mcpServers": { name: spec } }`
12
+ * or the flat `{ name: spec }`.
13
+ */
14
+ export function serversOf(value) {
15
+ if (!isMapping(value))
16
+ return undefined;
17
+ if (isMapping(value.mcpServers))
18
+ return value.mcpServers;
19
+ return value;
20
+ }
21
+ class Reader {
22
+ values;
23
+ environment;
24
+ findings = [];
25
+ local = [];
26
+ remote = [];
27
+ seen = new Set();
28
+ constructor(values, environment) {
29
+ this.values = values;
30
+ this.environment = environment;
31
+ }
32
+ add(finding) {
33
+ this.findings.push(finding);
34
+ }
35
+ /** Path names, then (only in an `env` value) bare environment references; the rest is said. */
36
+ expand(text, field, name, mode) {
37
+ const needs = [];
38
+ let expanded;
39
+ try {
40
+ const result = expandPluginPaths(text, this.values);
41
+ expanded = result.text;
42
+ for (const unresolved of result.unresolved) {
43
+ needs.push(`\${${unresolved}} has no folder here (${field})`);
44
+ }
45
+ }
46
+ catch (error) {
47
+ needs.push(error instanceof Error ? error.message : String(error));
48
+ expanded = text;
49
+ }
50
+ expanded = expanded.replace(/\$\{([^}]*)\}/g, (whole, inner) => {
51
+ if (inner.startsWith(COMMON_USER_CONFIG_PREFIX)) {
52
+ needs.push(`${whole} is a saved option, which is not supported yet (${field})`);
53
+ return whole;
54
+ }
55
+ if ((mode === 'env' || mode === 'keep') && /^[A-Za-z_][A-Za-z0-9_]*$/.test(inner)) {
56
+ const value = this.environment[inner];
57
+ if (value === undefined || value === '') {
58
+ needs.push(`${inner} is not set`);
59
+ return whole;
60
+ }
61
+ // A header keeps its reference as written: the value is read when it connects.
62
+ return mode === 'keep' ? whole : value;
63
+ }
64
+ needs.push(`${whole} is not expanded in ${field}`);
65
+ return whole;
66
+ });
67
+ const bare = expanded.replace(/\$\{[^}]*\}/g, '');
68
+ if (/\$[A-Za-z_]|`|%[A-Za-z_][A-Za-z0-9_]*%/.test(bare)) {
69
+ this.add({
70
+ level: 'ignored',
71
+ code: 'mcp-text-left-as-is',
72
+ field: `mcpServers.${name}.${field}`,
73
+ message: `${name}: ${field} holds a $-name, backtick or %NAME% that is left as written; no shell reads it.`,
74
+ });
75
+ }
76
+ return { text: expanded, needs };
77
+ }
78
+ refuse(name, code, message) {
79
+ this.add({ level: 'refused', code, field: `mcpServers.${name}`, message });
80
+ }
81
+ needsSetup(name, needs, server) {
82
+ this.add({
83
+ ...(server !== undefined ? { server: { name, ...server } } : {}),
84
+ level: 'notUsed',
85
+ code: 'mcp-needs-setup',
86
+ field: `mcpServers.${name}`,
87
+ message: `${name} needs setup: ${needs.join('; ')}. It is not started.`,
88
+ });
89
+ }
90
+ readSource(source) {
91
+ for (const [name, spec] of Object.entries(source.map)) {
92
+ if (this.seen.has(name)) {
93
+ this.add({
94
+ level: 'ignored',
95
+ code: 'mcp-server-duplicate',
96
+ field: `mcpServers.${name}`,
97
+ message: `${name} is named twice; the first one in ${source.origin} order is kept.`,
98
+ });
99
+ continue;
100
+ }
101
+ this.seen.add(name);
102
+ this.readOne(name, spec);
103
+ }
104
+ }
105
+ readOne(name, spec) {
106
+ if (!SERVER_NAME.test(name)) {
107
+ this.refuse(name, 'mcp-name-invalid', `"${name}" is not a usable server name.`);
108
+ return;
109
+ }
110
+ if (!isMapping(spec)) {
111
+ this.add({
112
+ level: 'ignored',
113
+ code: 'mcp-server-empty',
114
+ field: `mcpServers.${name}`,
115
+ message: `${name} has no settings.`,
116
+ });
117
+ return;
118
+ }
119
+ for (const key of Object.keys(spec)) {
120
+ if (!KNOWN_KEYS.has(key)) {
121
+ this.add({
122
+ level: 'ignored',
123
+ code: 'mcp-key-ignored',
124
+ field: `mcpServers.${name}.${key}`,
125
+ message: `${name}: "${key}" is not read.`,
126
+ });
127
+ }
128
+ }
129
+ const hasCommand = typeof spec.command === 'string' && spec.command.length > 0;
130
+ const hasUrl = typeof spec.url === 'string' && spec.url.length > 0;
131
+ const type = typeof spec.type === 'string' ? spec.type : undefined;
132
+ if (hasCommand && hasUrl) {
133
+ this.refuse(name, 'mcp-server-both', `${name} names both a command and an address; use one.`);
134
+ return;
135
+ }
136
+ if (!hasCommand && !hasUrl) {
137
+ this.add({
138
+ level: 'ignored',
139
+ code: 'mcp-server-empty',
140
+ field: `mcpServers.${name}`,
141
+ message: `${name} names neither a command nor an address.`,
142
+ });
143
+ return;
144
+ }
145
+ if (hasUrl) {
146
+ if (type !== undefined && !REMOTE_TYPES.has(type)) {
147
+ this.refuse(name, 'mcp-type-unsupported', `${name}: the type "${type}" is not supported.`);
148
+ return;
149
+ }
150
+ this.readRemote(name, spec, type);
151
+ return;
152
+ }
153
+ if (type !== undefined && type !== 'stdio') {
154
+ this.refuse(name, 'mcp-type-unsupported', `${name}: the type "${type}" is not supported.`);
155
+ return;
156
+ }
157
+ this.readLocal(name, spec);
158
+ }
159
+ readLocal(name, spec) {
160
+ const needs = [];
161
+ const command = this.expand(spec.command, 'command', name, 'none');
162
+ needs.push(...command.needs);
163
+ const looksRelative = /[\\/]/.test(command.text) && !isAbsolute(command.text) && !/^[A-Za-z]:/.test(command.text);
164
+ if (looksRelative && command.text.split(/[\\/]/).includes('..')) {
165
+ this.refuse(name, 'mcp-command-escapes', `${name}: the command leaves the plugin with "..".`);
166
+ return;
167
+ }
168
+ let args;
169
+ if (spec.args !== undefined) {
170
+ if (!Array.isArray(spec.args) || !spec.args.every((arg) => typeof arg === 'string')) {
171
+ this.refuse(name, 'mcp-args-invalid', `${name}: "args" must be a list of text.`);
172
+ return;
173
+ }
174
+ args = spec.args.map((arg) => {
175
+ const expanded = this.expand(arg, 'args', name, 'none');
176
+ needs.push(...expanded.needs);
177
+ return expanded.text;
178
+ });
179
+ }
180
+ let env;
181
+ if (spec.env !== undefined) {
182
+ if (!isMapping(spec.env) ||
183
+ !Object.values(spec.env).every((value) => typeof value === 'string')) {
184
+ this.refuse(name, 'mcp-env-invalid', `${name}: "env" must map names to text.`);
185
+ return;
186
+ }
187
+ env = {};
188
+ for (const [key, value] of Object.entries(spec.env)) {
189
+ const expanded = this.expand(value, `env.${key}`, name, 'env');
190
+ needs.push(...expanded.needs);
191
+ env[key] = expanded.text;
192
+ }
193
+ }
194
+ let connectTimeoutMs;
195
+ if (typeof spec.connectTimeoutMs === 'number') {
196
+ if (!Number.isInteger(spec.connectTimeoutMs) ||
197
+ spec.connectTimeoutMs <= 0 ||
198
+ spec.connectTimeoutMs > 3_600_000) {
199
+ this.refuse(name, 'mcp-timeout-invalid', `${name}: "connectTimeoutMs" is out of range.`);
200
+ return;
201
+ }
202
+ connectTimeoutMs = spec.connectTimeoutMs;
203
+ }
204
+ if (needs.length > 0) {
205
+ this.needsSetup(name, [...new Set(needs)], {
206
+ kind: 'local',
207
+ target: spec.command,
208
+ args: Array.isArray(spec.args) ? spec.args : [],
209
+ values: isMapping(spec.env) ? spec.env : {},
210
+ });
211
+ return;
212
+ }
213
+ this.local.push({
214
+ name,
215
+ command: command.text,
216
+ ...(args !== undefined ? { args } : {}),
217
+ ...(env !== undefined ? { env } : {}),
218
+ ...(connectTimeoutMs !== undefined ? { connectTimeoutMs } : {}),
219
+ });
220
+ this.add({
221
+ level: 'used',
222
+ code: 'mcp-server-local',
223
+ field: `mcpServers.${name}`,
224
+ message: `${name} starts as a local program while the plugin is on.`,
225
+ });
226
+ }
227
+ readRemote(name, spec, type) {
228
+ const url = this.expand(spec.url, 'url', name, 'none');
229
+ const asWritten = () => ({
230
+ kind: 'remote',
231
+ target: spec.url,
232
+ transport: type === 'sse' ? 'sse' : 'http',
233
+ values: isMapping(spec.headers) &&
234
+ Object.values(spec.headers).every((value) => typeof value === 'string')
235
+ ? spec.headers
236
+ : {},
237
+ });
238
+ if (url.needs.length > 0) {
239
+ this.needsSetup(name, url.needs, asWritten());
240
+ return;
241
+ }
242
+ let parsed;
243
+ try {
244
+ parsed = new URL(url.text);
245
+ }
246
+ catch {
247
+ this.refuse(name, 'mcp-url-invalid', `${name}: the address is not a valid URL.`);
248
+ return;
249
+ }
250
+ if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
251
+ this.refuse(name, 'mcp-url-invalid', `${name}: the address must start with https:// or http://.`);
252
+ return;
253
+ }
254
+ if (parsed.username !== '' || parsed.password !== '') {
255
+ this.refuse(name, 'mcp-url-invalid', `${name}: the address must not hold a user name or password.`);
256
+ return;
257
+ }
258
+ let headers;
259
+ if (spec.headers !== undefined) {
260
+ if (!isMapping(spec.headers) ||
261
+ !Object.values(spec.headers).every((value) => typeof value === 'string')) {
262
+ this.refuse(name, 'mcp-headers-invalid', `${name}: "headers" must map names to text.`);
263
+ return;
264
+ }
265
+ headers = {};
266
+ const needs = [];
267
+ for (const [key, value] of Object.entries(spec.headers)) {
268
+ // A `${VAR}` stays as written: the host that connects reads the variable
269
+ // then, and the plugin file never holds the value.
270
+ const expanded = this.expand(value, `headers.${key}`, name, 'keep');
271
+ needs.push(...expanded.needs);
272
+ headers[key] = expanded.text;
273
+ }
274
+ if (needs.length > 0) {
275
+ this.needsSetup(name, [...new Set(needs)], asWritten());
276
+ return;
277
+ }
278
+ }
279
+ const transport = type === 'sse' ? 'sse' : 'http';
280
+ this.remote.push({
281
+ name,
282
+ url: url.text,
283
+ transport,
284
+ ...(headers !== undefined ? { headers } : {}),
285
+ });
286
+ this.add({
287
+ level: 'notUsed',
288
+ code: 'mcp-server-remote',
289
+ field: `mcpServers.${name}`,
290
+ message: `${name} is a remote server at ${parsed.origin}${parsed.pathname === '/' ? '' : parsed.pathname}. It connects only after you approve it.`,
291
+ });
292
+ }
293
+ }
294
+ /** Read every server of every source, applying the path and environment rules. */
295
+ export function readMcpSources(sources, values, environment) {
296
+ const reader = new Reader(values, environment);
297
+ for (const source of sources)
298
+ reader.readSource(source);
299
+ return {
300
+ local: reader.local,
301
+ remote: reader.remote,
302
+ findings: reader.findings,
303
+ };
304
+ }
305
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/plugin/common-layout/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAKtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAyB,iBAAiB,EAAE,MAAM,YAAY,CAAA;A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vD,OAAO;QACN,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KACzB,CAAA;AACF,CAAC"}
@@ -0,0 +1,27 @@
1
+ /** The folders the six path names stand for. A name with no folder here is left as written. */
2
+ export interface PluginPathValues {
3
+ /** The plugin's own folder. */
4
+ readonly root: string;
5
+ /** The folder kept for the plugin's data. */
6
+ readonly data?: string | undefined;
7
+ /** The folder the session was started for. */
8
+ readonly project?: string | undefined;
9
+ }
10
+ /** The six names {@link expandPluginPaths} replaces, and nothing else. */
11
+ export declare const PLUGIN_PATH_VARIABLES: readonly string[];
12
+ export interface ExpandedPaths {
13
+ readonly text: string;
14
+ /** Path names that had no folder to stand for, in order of appearance. */
15
+ readonly unresolved: readonly string[];
16
+ }
17
+ /**
18
+ * `${NAME}` for exactly the six path names becomes the folder. Nothing runs a
19
+ * shell and nothing else is touched: `$NAME`, `${OTHER}` and `${NAME:-x}` are
20
+ * left as written. A folder that is not absolute, or holds a NUL, is refused
21
+ * with a thrown reason, so a substituted value never turns into a relative
22
+ * or truncated path.
23
+ */
24
+ export declare function expandPluginPaths(text: string, values: PluginPathValues): ExpandedPaths;
25
+ /** Only the plugin's own folder: the form skill, command and agent text gets. */
26
+ export declare function expandPluginRootText(text: string, root: string): string;
27
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/plugin/common-layout/paths.ts"],"names":[],"mappings":"AASA,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAChC,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACrC;AAED,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAOlD,CAAA;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC;AASD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,aAAa,CAevF;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvE"}
@@ -0,0 +1,48 @@
1
+ import { COMMON_DATA_VARIABLE, COMMON_PROJECT_VARIABLE, COMMON_ROOT_VARIABLE, NAMZU_DATA_VARIABLE, NAMZU_PROJECT_VARIABLE, NAMZU_ROOT_VARIABLE, } from '../common-layout-names.js';
2
+ /** The six names {@link expandPluginPaths} replaces, and nothing else. */
3
+ export const PLUGIN_PATH_VARIABLES = [
4
+ COMMON_ROOT_VARIABLE,
5
+ NAMZU_ROOT_VARIABLE,
6
+ COMMON_DATA_VARIABLE,
7
+ NAMZU_DATA_VARIABLE,
8
+ COMMON_PROJECT_VARIABLE,
9
+ NAMZU_PROJECT_VARIABLE,
10
+ ];
11
+ function folderFor(name, values) {
12
+ if (name === COMMON_ROOT_VARIABLE || name === NAMZU_ROOT_VARIABLE)
13
+ return values.root;
14
+ if (name === COMMON_DATA_VARIABLE || name === NAMZU_DATA_VARIABLE)
15
+ return values.data;
16
+ if (name === COMMON_PROJECT_VARIABLE || name === NAMZU_PROJECT_VARIABLE)
17
+ return values.project;
18
+ return undefined;
19
+ }
20
+ /**
21
+ * `${NAME}` for exactly the six path names becomes the folder. Nothing runs a
22
+ * shell and nothing else is touched: `$NAME`, `${OTHER}` and `${NAME:-x}` are
23
+ * left as written. A folder that is not absolute, or holds a NUL, is refused
24
+ * with a thrown reason, so a substituted value never turns into a relative
25
+ * or truncated path.
26
+ */
27
+ export function expandPluginPaths(text, values) {
28
+ const unresolved = [];
29
+ const out = text.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (whole, name) => {
30
+ if (!PLUGIN_PATH_VARIABLES.includes(name))
31
+ return whole;
32
+ const folder = folderFor(name, values);
33
+ if (folder === undefined) {
34
+ unresolved.push(name);
35
+ return whole;
36
+ }
37
+ if (folder.includes('\0') || !/^([A-Za-z]:[\\/]|[\\/])/.test(folder)) {
38
+ throw new Error(`The folder for ${name} must be an absolute path without NUL characters.`);
39
+ }
40
+ return folder;
41
+ });
42
+ return { text: out, unresolved };
43
+ }
44
+ /** Only the plugin's own folder: the form skill, command and agent text gets. */
45
+ export function expandPluginRootText(text, root) {
46
+ return expandPluginPaths(text, { root }).text;
47
+ }
48
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/plugin/common-layout/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,2BAA2B,CAAA;AAYlC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACvD,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;IACnB,uBAAuB;IACvB,sBAAsB;CACtB,CAAA;AAQD,SAAS,SAAS,CAAC,IAAY,EAAE,MAAwB;IACxD,IAAI,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,mBAAmB;QAAE,OAAO,MAAM,CAAC,IAAI,CAAA;IACrF,IAAI,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,mBAAmB;QAAE,OAAO,MAAM,CAAC,IAAI,CAAA;IACrF,IAAI,IAAI,KAAK,uBAAuB,IAAI,IAAI,KAAK,sBAAsB;QAAE,OAAO,MAAM,CAAC,OAAO,CAAA;IAC9F,OAAO,SAAS,CAAA;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,MAAwB;IACvE,MAAM,UAAU,GAAa,EAAE,CAAA;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,iCAAiC,EAAE,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;QAC3F,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAA;QACvD,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACtC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACrB,OAAO,KAAK,CAAA;QACb,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACtE,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,mDAAmD,CAAC,CAAA;QAC3F,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC,CAAC,CAAA;IACF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAA;AACjC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,IAAY;IAC9D,OAAO,iBAAiB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAA;AAC9C,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { CommonLayoutOptions, CommonLayoutRead } from './types.js';
2
+ /** A manifest, sidecar or hooks file larger than this is refused unread. */
3
+ export declare const MAX_LAYOUT_MANIFEST_BYTES: number;
4
+ /**
5
+ * Read a plugin folder written in the common plugin layout.
6
+ *
7
+ * Pure: it reads inside the folder, never follows a symbolic link, runs and
8
+ * imports nothing (a hooks module is parsed, not run), and opens no connection. It returns the manifest Namzu
9
+ * would admit, the remote servers it found, and a finding for everything it
10
+ * used, left out or refused (see {@link LayoutFinding}).
11
+ *
12
+ * Which file speaks, in order: a `plugin.json` at the root (Namzu's own; this
13
+ * reader says only that it was there), the common layout's manifest, the
14
+ * install sidecar (only when `options.entrySidecar` is set), a root `SKILL.md`
15
+ * (a one-skill plugin), or the conventional folders alone.
16
+ */
17
+ export declare function readCommonLayout(root: string, options?: CommonLayoutOptions): Promise<CommonLayoutRead>;
18
+ /**
19
+ * The folder to read when a download or archive was unpacked: a single
20
+ * wrapping folder is descended into when it holds the manifest folder or a
21
+ * recognised component, ignoring `__MACOSX` and `.DS_Store`. The folder itself
22
+ * when it already holds one, or when there is no such wrapper.
23
+ */
24
+ export declare function findCommonLayoutRoot(dir: string): Promise<string>;
25
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/plugin/common-layout/read.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EACX,mBAAmB,EACnB,gBAAgB,EAGhB,MAAM,YAAY,CAAA;AAEnB,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,QAAa,CAAA;AA8OnD;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,mBAAwB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CA4K3B;AA0wBD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBvE"}