@g3nomaly/core 0.3.0 → 0.3.2

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 (247) hide show
  1. package/LICENSE +95 -0
  2. package/dist/cli/commands/add.d.ts +37 -0
  3. package/dist/cli/commands/add.d.ts.map +1 -0
  4. package/dist/cli/commands/add.js +99 -0
  5. package/dist/cli/commands/add.js.map +1 -0
  6. package/dist/cli/commands/conflict.d.ts +52 -0
  7. package/dist/cli/commands/conflict.d.ts.map +1 -0
  8. package/dist/cli/commands/conflict.js +88 -0
  9. package/dist/cli/commands/conflict.js.map +1 -0
  10. package/dist/cli/commands/installFromSources.d.ts +78 -0
  11. package/dist/cli/commands/installFromSources.d.ts.map +1 -0
  12. package/dist/cli/commands/installFromSources.js +187 -0
  13. package/dist/cli/commands/installFromSources.js.map +1 -0
  14. package/dist/cli/commands/ls.d.ts +26 -0
  15. package/dist/cli/commands/ls.d.ts.map +1 -0
  16. package/dist/cli/commands/ls.js +85 -0
  17. package/dist/cli/commands/ls.js.map +1 -0
  18. package/dist/cli/commands/remove.d.ts +19 -0
  19. package/dist/cli/commands/remove.d.ts.map +1 -0
  20. package/dist/cli/commands/remove.js +123 -0
  21. package/dist/cli/commands/remove.js.map +1 -0
  22. package/dist/cli/commands/sources.d.ts +69 -0
  23. package/dist/cli/commands/sources.d.ts.map +1 -0
  24. package/dist/cli/commands/sources.js +103 -0
  25. package/dist/cli/commands/sources.js.map +1 -0
  26. package/dist/cli/commands/update.d.ts +17 -0
  27. package/dist/cli/commands/update.d.ts.map +1 -0
  28. package/dist/cli/commands/update.js +110 -0
  29. package/dist/cli/commands/update.js.map +1 -0
  30. package/dist/cli/dialogue.d.ts +126 -0
  31. package/dist/cli/dialogue.d.ts.map +1 -0
  32. package/dist/cli/dialogue.js +156 -0
  33. package/dist/cli/dialogue.js.map +1 -0
  34. package/dist/cli/index.d.ts +19 -0
  35. package/dist/cli/index.d.ts.map +1 -0
  36. package/dist/cli/index.js +16 -0
  37. package/dist/cli/index.js.map +1 -0
  38. package/dist/cli/installDialogues.d.ts +23 -0
  39. package/dist/cli/installDialogues.d.ts.map +1 -0
  40. package/dist/cli/installDialogues.js +89 -0
  41. package/dist/cli/installDialogues.js.map +1 -0
  42. package/dist/cli/pick.d.ts +23 -0
  43. package/dist/cli/pick.d.ts.map +1 -0
  44. package/dist/cli/pick.js +44 -0
  45. package/dist/cli/pick.js.map +1 -0
  46. package/dist/cli/report.d.ts +58 -0
  47. package/dist/cli/report.d.ts.map +1 -0
  48. package/dist/cli/report.js +92 -0
  49. package/dist/cli/report.js.map +1 -0
  50. package/dist/cli/theme.d.ts +27 -0
  51. package/dist/cli/theme.d.ts.map +1 -0
  52. package/dist/cli/theme.js +29 -0
  53. package/dist/cli/theme.js.map +1 -0
  54. package/dist/cli/types.d.ts +96 -0
  55. package/dist/cli/types.d.ts.map +1 -0
  56. package/dist/cli/types.js +2 -0
  57. package/dist/cli/types.js.map +1 -0
  58. package/dist/config/config.d.ts +55 -0
  59. package/dist/config/config.d.ts.map +1 -0
  60. package/dist/config/config.js +107 -0
  61. package/dist/config/config.js.map +1 -0
  62. package/dist/config/index.d.ts +4 -0
  63. package/dist/config/index.d.ts.map +1 -0
  64. package/dist/config/index.js +3 -0
  65. package/dist/config/index.js.map +1 -0
  66. package/dist/config/types.d.ts +182 -0
  67. package/dist/config/types.d.ts.map +1 -0
  68. package/dist/config/types.js +51 -0
  69. package/dist/config/types.js.map +1 -0
  70. package/dist/hash/hash.d.ts +23 -0
  71. package/dist/hash/hash.d.ts.map +1 -0
  72. package/dist/hash/hash.js +43 -0
  73. package/dist/hash/hash.js.map +1 -0
  74. package/dist/hash/index.d.ts +2 -0
  75. package/dist/hash/index.d.ts.map +1 -0
  76. package/dist/hash/index.js +3 -0
  77. package/dist/hash/index.js.map +1 -0
  78. package/dist/index.d.ts +1 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +3 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/installer/classify.d.ts +33 -0
  83. package/dist/installer/classify.d.ts.map +1 -0
  84. package/dist/installer/classify.js +82 -0
  85. package/dist/installer/classify.js.map +1 -0
  86. package/dist/installer/files.d.ts +19 -0
  87. package/dist/installer/files.d.ts.map +1 -0
  88. package/dist/installer/files.js +23 -0
  89. package/dist/installer/files.js.map +1 -0
  90. package/dist/installer/index.d.ts +19 -0
  91. package/dist/installer/index.d.ts.map +1 -0
  92. package/dist/installer/index.js +14 -0
  93. package/dist/installer/index.js.map +1 -0
  94. package/dist/installer/install.d.ts +25 -0
  95. package/dist/installer/install.d.ts.map +1 -0
  96. package/dist/installer/install.js +74 -0
  97. package/dist/installer/install.js.map +1 -0
  98. package/dist/installer/io.d.ts +9 -0
  99. package/dist/installer/io.d.ts.map +1 -0
  100. package/dist/installer/io.js +23 -0
  101. package/dist/installer/io.js.map +1 -0
  102. package/dist/installer/manifest.d.ts +69 -0
  103. package/dist/installer/manifest.d.ts.map +1 -0
  104. package/dist/installer/manifest.js +70 -0
  105. package/dist/installer/manifest.js.map +1 -0
  106. package/dist/installer/manifestSources.d.ts +32 -0
  107. package/dist/installer/manifestSources.d.ts.map +1 -0
  108. package/dist/installer/manifestSources.js +50 -0
  109. package/dist/installer/manifestSources.js.map +1 -0
  110. package/dist/installer/marketplace.d.ts +46 -0
  111. package/dist/installer/marketplace.d.ts.map +1 -0
  112. package/dist/installer/marketplace.js +72 -0
  113. package/dist/installer/marketplace.js.map +1 -0
  114. package/dist/installer/origin.d.ts +59 -0
  115. package/dist/installer/origin.d.ts.map +1 -0
  116. package/dist/installer/origin.js +29 -0
  117. package/dist/installer/origin.js.map +1 -0
  118. package/dist/installer/remove.d.ts +26 -0
  119. package/dist/installer/remove.d.ts.map +1 -0
  120. package/dist/installer/remove.js +49 -0
  121. package/dist/installer/remove.js.map +1 -0
  122. package/dist/installer/resolve.d.ts +127 -0
  123. package/dist/installer/resolve.d.ts.map +1 -0
  124. package/dist/installer/resolve.js +251 -0
  125. package/dist/installer/resolve.js.map +1 -0
  126. package/dist/installer/sourceRegistry.d.ts +96 -0
  127. package/dist/installer/sourceRegistry.d.ts.map +1 -0
  128. package/dist/installer/sourceRegistry.js +86 -0
  129. package/dist/installer/sourceRegistry.js.map +1 -0
  130. package/dist/installer/types.d.ts +133 -0
  131. package/dist/installer/types.d.ts.map +1 -0
  132. package/dist/installer/types.js +31 -0
  133. package/dist/installer/types.js.map +1 -0
  134. package/dist/registry/index.d.ts +8 -0
  135. package/dist/registry/index.d.ts.map +1 -0
  136. package/dist/registry/index.js +9 -0
  137. package/dist/registry/index.js.map +1 -0
  138. package/dist/registry/registry.handlers.d.ts +16 -0
  139. package/dist/registry/registry.handlers.d.ts.map +1 -0
  140. package/dist/registry/registry.handlers.js +13 -0
  141. package/dist/registry/registry.handlers.js.map +1 -0
  142. package/dist/registry/registry.io.d.ts +38 -0
  143. package/dist/registry/registry.io.d.ts.map +1 -0
  144. package/dist/registry/registry.io.js +101 -0
  145. package/dist/registry/registry.io.js.map +1 -0
  146. package/dist/registry/registry.mutations.d.ts +19 -0
  147. package/dist/registry/registry.mutations.d.ts.map +1 -0
  148. package/dist/registry/registry.mutations.js +29 -0
  149. package/dist/registry/registry.mutations.js.map +1 -0
  150. package/dist/registry/registry.selectors.d.ts +68 -0
  151. package/dist/registry/registry.selectors.d.ts.map +1 -0
  152. package/dist/registry/registry.selectors.js +91 -0
  153. package/dist/registry/registry.selectors.js.map +1 -0
  154. package/dist/registry/registry.store.d.ts +47 -0
  155. package/dist/registry/registry.store.d.ts.map +1 -0
  156. package/dist/registry/registry.store.js +36 -0
  157. package/dist/registry/registry.store.js.map +1 -0
  158. package/dist/registry/registry.template.d.ts +29 -0
  159. package/dist/registry/registry.template.d.ts.map +1 -0
  160. package/dist/registry/registry.template.js +70 -0
  161. package/dist/registry/registry.template.js.map +1 -0
  162. package/dist/registry/types.d.ts +47 -0
  163. package/dist/registry/types.d.ts.map +1 -0
  164. package/dist/registry/types.js +35 -0
  165. package/dist/registry/types.js.map +1 -0
  166. package/dist/security/index.d.ts +2 -0
  167. package/dist/security/index.d.ts.map +1 -0
  168. package/dist/security/index.js +3 -0
  169. package/dist/security/index.js.map +1 -0
  170. package/dist/security/securityParser.d.ts +15 -0
  171. package/dist/security/securityParser.d.ts.map +1 -0
  172. package/dist/security/securityParser.js +79 -0
  173. package/dist/security/securityParser.js.map +1 -0
  174. package/dist/security/securityWorker.d.ts +19 -0
  175. package/dist/security/securityWorker.d.ts.map +1 -0
  176. package/dist/security/securityWorker.js +137 -0
  177. package/dist/security/securityWorker.js.map +1 -0
  178. package/dist/sources/checkout.d.ts +20 -0
  179. package/dist/sources/checkout.d.ts.map +1 -0
  180. package/dist/sources/checkout.js +33 -0
  181. package/dist/sources/checkout.js.map +1 -0
  182. package/dist/sources/git.d.ts +11 -0
  183. package/dist/sources/git.d.ts.map +1 -0
  184. package/dist/sources/git.js +24 -0
  185. package/dist/sources/git.js.map +1 -0
  186. package/dist/sources/index.d.ts +5 -0
  187. package/dist/sources/index.d.ts.map +1 -0
  188. package/dist/sources/index.js +6 -0
  189. package/dist/sources/index.js.map +1 -0
  190. package/dist/sources/local.d.ts +12 -0
  191. package/dist/sources/local.d.ts.map +1 -0
  192. package/dist/sources/local.js +22 -0
  193. package/dist/sources/local.js.map +1 -0
  194. package/dist/sources/npm.d.ts +16 -0
  195. package/dist/sources/npm.d.ts.map +1 -0
  196. package/dist/sources/npm.js +162 -0
  197. package/dist/sources/npm.js.map +1 -0
  198. package/dist/sources/packageJson.d.ts +3 -0
  199. package/dist/sources/packageJson.d.ts.map +1 -0
  200. package/dist/sources/packageJson.js +13 -0
  201. package/dist/sources/packageJson.js.map +1 -0
  202. package/dist/sources/parse.d.ts +42 -0
  203. package/dist/sources/parse.d.ts.map +1 -0
  204. package/dist/sources/parse.js +114 -0
  205. package/dist/sources/parse.js.map +1 -0
  206. package/dist/sources/process.d.ts +21 -0
  207. package/dist/sources/process.d.ts.map +1 -0
  208. package/dist/sources/process.js +46 -0
  209. package/dist/sources/process.js.map +1 -0
  210. package/dist/sources/register.d.ts +31 -0
  211. package/dist/sources/register.d.ts.map +1 -0
  212. package/dist/sources/register.js +52 -0
  213. package/dist/sources/register.js.map +1 -0
  214. package/dist/sources/types.d.ts +108 -0
  215. package/dist/sources/types.d.ts.map +1 -0
  216. package/dist/sources/types.js +53 -0
  217. package/dist/sources/types.js.map +1 -0
  218. package/dist/utils/errors.d.ts +8 -0
  219. package/dist/utils/errors.d.ts.map +1 -0
  220. package/dist/utils/errors.js +11 -0
  221. package/dist/utils/errors.js.map +1 -0
  222. package/dist/utils/index.d.ts +7 -0
  223. package/dist/utils/index.d.ts.map +1 -0
  224. package/dist/utils/index.js +7 -0
  225. package/dist/utils/index.js.map +1 -0
  226. package/dist/utils/merge.d.ts +12 -0
  227. package/dist/utils/merge.d.ts.map +1 -0
  228. package/dist/utils/merge.js +28 -0
  229. package/dist/utils/merge.js.map +1 -0
  230. package/dist/utils/packageMeta.d.ts +26 -0
  231. package/dist/utils/packageMeta.d.ts.map +1 -0
  232. package/dist/utils/packageMeta.js +24 -0
  233. package/dist/utils/packageMeta.js.map +1 -0
  234. package/dist/utils/paths.d.ts +27 -0
  235. package/dist/utils/paths.d.ts.map +1 -0
  236. package/dist/utils/paths.js +51 -0
  237. package/dist/utils/paths.js.map +1 -0
  238. package/dist/utils/prompt.d.ts +8 -0
  239. package/dist/utils/prompt.d.ts.map +1 -0
  240. package/dist/utils/prompt.js +13 -0
  241. package/dist/utils/prompt.js.map +1 -0
  242. package/dist/utils/version.d.ts +14 -0
  243. package/dist/utils/version.d.ts.map +1 -0
  244. package/dist/utils/version.js +140 -0
  245. package/dist/utils/version.js.map +1 -0
  246. package/package.json +64 -3
  247. package/README.md +0 -3
@@ -0,0 +1,23 @@
1
+ // packages/core/src/installer/files.ts
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ const ALWAYS_SKIPPED = ["node_modules", ".git"];
5
+ /**
6
+ * @brief Lists every file below a folder, leaving out the folders and files `filter` names.
7
+ *
8
+ * @param dir - Absolute folder to list.
9
+ * @param filter - Folders and files to skip.
10
+ * @returns Paths relative to `dir`, sorted.
11
+ */
12
+ export function listFiles(dir, filter = {}) {
13
+ const skipDirs = new Set([...ALWAYS_SKIPPED, ...(filter.skipDirs ?? [])]);
14
+ const walk = (current) => fs.readdirSync(current, { withFileTypes: true }).flatMap((d) => {
15
+ const full = path.join(current, d.name);
16
+ const rel = path.relative(dir, full);
17
+ if (d.isDirectory())
18
+ return skipDirs.has(d.name) || skipDirs.has(rel) ? [] : walk(full);
19
+ return filter.skipFiles?.test(d.name) === true ? [] : [rel];
20
+ });
21
+ return walk(dir).sort();
22
+ }
23
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/installer/files.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAa5B,MAAM,cAAc,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAM,GAAe,EAAE;IAC5D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACzE,MAAM,IAAI,GAAG,CAAC,OAAe,EAAY,EAAE,CACzC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;QACvC,MAAM,GAAG,GAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACrC,IAAI,CAAC,CAAC,WAAW,EAAE;YAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvF,OAAO,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;IACJ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;AACzB,CAAC"}
@@ -0,0 +1,19 @@
1
+ export * from "./types";
2
+ export { createInstallerIO } from "./io";
3
+ export { classifyFile, classifyFiles, recordedHashes } from "./classify";
4
+ export { applyClassifications, copySource } from "./install";
5
+ export { removeInstalledFiles, pruneEmptyDirs } from "./remove";
6
+ export { EntryOriginSchema, OriginEntrySchema } from "./origin";
7
+ export type { EntryOrigin, OriginEntry, ReadContext } from "./origin";
8
+ export { listFiles } from "./files";
9
+ export type { FileFilter } from "./files";
10
+ export { MANIFEST_DIRS, manifestFile, readMarketplace, resolveInside } from "./marketplace";
11
+ export type { MarketplacePlugin } from "./marketplace";
12
+ export { installManifestSchema, loadInstallManifest, installedEntries, saveInstallManifest } from "./manifest";
13
+ export type { InstallManifest } from "./manifest";
14
+ export { manifestSources, registerSource, unregisterSource } from "./manifestSources";
15
+ export { loadSourceRegistry, offers, offerRegistry, entrySource } from "./sourceRegistry";
16
+ export type { SourceRegistry, SourceEntries, SourceOffer, ReadSource, FailedSource } from "./sourceRegistry";
17
+ export { parseRequest, formatRequest, resolveDependencies, resolveRequests, resolveInstalled, resolveUpdates, installedOrigins, installedForks } from "./resolve";
18
+ export type { EntryRequest, Resolution, ResolvedDependencies } from "./resolve";
19
+ //#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AAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACjK,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,14 @@
1
+ // packages/core/src/installer/index.ts
2
+ export * from "./types";
3
+ export { createInstallerIO } from "./io";
4
+ export { classifyFile, classifyFiles, recordedHashes } from "./classify";
5
+ export { applyClassifications, copySource } from "./install";
6
+ export { removeInstalledFiles, pruneEmptyDirs } from "./remove";
7
+ export { EntryOriginSchema, OriginEntrySchema } from "./origin";
8
+ export { listFiles } from "./files";
9
+ export { MANIFEST_DIRS, manifestFile, readMarketplace, resolveInside } from "./marketplace";
10
+ export { installManifestSchema, loadInstallManifest, installedEntries, saveInstallManifest } from "./manifest";
11
+ export { manifestSources, registerSource, unregisterSource } from "./manifestSources";
12
+ export { loadSourceRegistry, offers, offerRegistry, entrySource } from "./sourceRegistry";
13
+ export { parseRequest, formatRequest, resolveDependencies, resolveRequests, resolveInstalled, resolveUpdates, installedOrigins, installedForks } from "./resolve";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE3F,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAE9G,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEzF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,25 @@
1
+ import type { BaseFileEntry } from "../registry/types";
2
+ import type { ApplyOptions, ApplyResult, FileClassification, FileSource, InstallerIO } from "./types";
3
+ /**
4
+ * @brief Builds a `FileSource` that copies each file from the package source tree.
5
+ *
6
+ * @param resolveSourcePath - Maps a file's relative path to its absolute path in the source tree.
7
+ * @returns Source that returns a `copy` content for every file.
8
+ */
9
+ export declare function copySource<F extends BaseFileEntry>(resolveSourcePath: (relPath: string) => string): FileSource<F>;
10
+ /**
11
+ * @brief Writes the files an install or update decision allows and reports the result per file.
12
+ *
13
+ * `SafeUpdate` files are always written. `UserOnly` and `Conflict` files are written only when
14
+ * `opts.decision` is `Overwrite` or `opts.force` is set. The result's `files` is what the caller
15
+ * registers in the user manifest. A kept file keeps the hash it was installed with, so its local
16
+ * change stays visible to every later run instead of becoming the new baseline.
17
+ *
18
+ * @param classifications - Per-file states from `classifyFiles`.
19
+ * @param source - Produces each file's content when it is written.
20
+ * @param opts - Conflict decision, `force` and `dryRun` flags.
21
+ * @param io - Filesystem boundary used to write and hash files.
22
+ * @returns Written, kept and missing-source paths, and the manifest entries to register.
23
+ */
24
+ export declare function applyClassifications<F extends BaseFileEntry>(classifications: readonly FileClassification<F>[], source: FileSource<F>, opts: ApplyOptions, io: InstallerIO): Promise<ApplyResult<F>>;
25
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/installer/install.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErG;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,aAAa,EAAE,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAEjH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,aAAa,EAChE,eAAe,EAAE,SAAS,kBAAkB,CAAC,CAAC,CAAC,EAAE,EACjD,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA4CzB"}
@@ -0,0 +1,74 @@
1
+ // packages/core/src/installer/install.ts
2
+ import path from "node:path";
3
+ import { ConflictDecision, FileState } from "./types";
4
+ /**
5
+ * @brief Builds a `FileSource` that copies each file from the package source tree.
6
+ *
7
+ * @param resolveSourcePath - Maps a file's relative path to its absolute path in the source tree.
8
+ * @returns Source that returns a `copy` content for every file.
9
+ */
10
+ export function copySource(resolveSourcePath) {
11
+ return (file) => ({ kind: "copy", sourcePath: resolveSourcePath(file.path) });
12
+ }
13
+ /**
14
+ * @brief Writes the files an install or update decision allows and reports the result per file.
15
+ *
16
+ * `SafeUpdate` files are always written. `UserOnly` and `Conflict` files are written only when
17
+ * `opts.decision` is `Overwrite` or `opts.force` is set. The result's `files` is what the caller
18
+ * registers in the user manifest. A kept file keeps the hash it was installed with, so its local
19
+ * change stays visible to every later run instead of becoming the new baseline.
20
+ *
21
+ * @param classifications - Per-file states from `classifyFiles`.
22
+ * @param source - Produces each file's content when it is written.
23
+ * @param opts - Conflict decision, `force` and `dryRun` flags.
24
+ * @param io - Filesystem boundary used to write and hash files.
25
+ * @returns Written, kept and missing-source paths, and the manifest entries to register.
26
+ */
27
+ export async function applyClassifications(classifications, source, opts, io) {
28
+ const result = { written: [], kept: [], missingSource: [], files: [] };
29
+ const overwrite = opts.force === true || opts.decision === ConflictDecision.Overwrite;
30
+ const write = async (cl) => {
31
+ const content = await source(cl.file);
32
+ if (content === null) {
33
+ result.missingSource.push(cl.file.path);
34
+ if (cl.exists)
35
+ result.files.push({ ...cl.file, hash: cl.currentHash ?? undefined });
36
+ return;
37
+ }
38
+ if (opts.dryRun === true) {
39
+ result.files.push({ ...cl.file, hash: cl.latestHash });
40
+ }
41
+ else {
42
+ io.ensureDir(path.dirname(cl.destPath));
43
+ if (content.kind === "copy")
44
+ io.copyFile(content.sourcePath, cl.destPath);
45
+ else
46
+ io.writeFile(cl.destPath, content.content);
47
+ result.files.push({ ...cl.file, hash: await io.hashFile(cl.destPath) });
48
+ }
49
+ result.written.push(cl.file.path);
50
+ };
51
+ for (const cl of classifications) {
52
+ switch (cl.state) {
53
+ case FileState.UpToDate:
54
+ result.files.push({ ...cl.file, hash: cl.currentHash ?? cl.latestHash });
55
+ break;
56
+ case FileState.SafeUpdate:
57
+ await write(cl);
58
+ break;
59
+ case FileState.UserOnly:
60
+ case FileState.Conflict:
61
+ if (overwrite) {
62
+ await write(cl);
63
+ }
64
+ else {
65
+ result.kept.push(cl.file.path);
66
+ // An untracked file has no install-time hash; the source version is the baseline it differs from.
67
+ result.files.push({ ...cl.file, hash: cl.recordedHash ?? cl.latestHash });
68
+ }
69
+ break;
70
+ }
71
+ }
72
+ return result;
73
+ }
74
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../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AAA;gBACjB,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBAC9B,kGAAkG;oBAClG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,CAAA;gBAC3E,CAAC;gBACD,MAAK;QACT,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { InstallerIO } from "./types";
2
+ /**
3
+ * @brief Builds the real-filesystem `InstallerIO`, with any field replaced by `overrides`.
4
+ *
5
+ * @param overrides - Fields to replace, such as stubs in tests. Empty by default.
6
+ * @returns Filesystem boundary backed by `node:fs` and `hashFile`, except for the overridden fields.
7
+ */
8
+ export declare function createInstallerIO(overrides?: Partial<InstallerIO>): InstallerIO;
9
+ //# sourceMappingURL=io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/installer/io.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAYnF"}
@@ -0,0 +1,23 @@
1
+ // packages/core/src/installer/io.ts
2
+ import fs from "node:fs";
3
+ import { hashFile } from "../hash/hash";
4
+ /**
5
+ * @brief Builds the real-filesystem `InstallerIO`, with any field replaced by `overrides`.
6
+ *
7
+ * @param overrides - Fields to replace, such as stubs in tests. Empty by default.
8
+ * @returns Filesystem boundary backed by `node:fs` and `hashFile`, except for the overridden fields.
9
+ */
10
+ export function createInstallerIO(overrides = {}) {
11
+ return {
12
+ exists: (path) => fs.existsSync(path),
13
+ ensureDir: (dir) => { fs.mkdirSync(dir, { recursive: true }); },
14
+ copyFile: (src, dest) => { fs.copyFileSync(src, dest); },
15
+ writeFile: (dest, content) => { fs.writeFileSync(dest, content, "utf8"); },
16
+ removeFile: (path) => { fs.rmSync(path); },
17
+ listDir: (dir) => fs.readdirSync(dir),
18
+ removeDir: (dir) => { fs.rmSync(dir, { recursive: true }); },
19
+ hashFile,
20
+ ...overrides,
21
+ };
22
+ }
23
+ //# sourceMappingURL=io.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/installer/io.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGvC;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAS,GAAyB,EAAE;IACpE,OAAO;QACL,MAAM,EAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;QACzC,SAAS,EAAG,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA,CAAC,CAAC;QAC/D,QAAQ,EAAI,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA,CAAC,CAAC;QACzD,SAAS,EAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA,CAAC,CAAC;QAC1E,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC;QACzC,OAAO,EAAK,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC;QACxC,SAAS,EAAG,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA,CAAC,CAAC;QAC5D,QAAQ;QACR,GAAG,SAAS;KACb,CAAA;AACH,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+ import { type RegistryStore } from "../registry/registry.store";
3
+ import type { BaseRegistryEntry } from "../registry/types";
4
+ import { type SourceRecord } from "../sources/types";
5
+ /**
6
+ * @brief Install manifest: the sources registered for an install target and the entries installed into it.
7
+ *
8
+ * On disk it is `{ "sources": {...}, "entries": {...} }`. Created by `loadInstallManifest` in each
9
+ * installer's project setup (`skills.json`, `mods.json`, the g3nui manifest). The installer changes
10
+ * `sources` directly and hands `store` to the core `add`, `update` and `remove` commands.
11
+ * `saveInstallManifest` writes both back.
12
+ *
13
+ * @property filePath - Absolute path of the file, e.g. `/home/me/app/.claude/skills.json`.
14
+ * @property sources - Sources registered for this target, by name.
15
+ * @property store - Installed entries by key.
16
+ */
17
+ export interface InstallManifest {
18
+ filePath: string;
19
+ sources: SourceRecord;
20
+ store: RegistryStore<BaseRegistryEntry>;
21
+ }
22
+ /**
23
+ * @brief Builds the zod schema of a manifest file whose entries match `entrySchema`.
24
+ *
25
+ * @param entrySchema - Schema each value of `entries` must match.
26
+ * @returns Strict object schema with `sources` and `entries`, both defaulting to empty.
27
+ */
28
+ export declare function installManifestSchema<S extends z.ZodType>(entrySchema: S): z.ZodObject<{
29
+ sources: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
30
+ kind: z.ZodLiteral<"git">;
31
+ url: z.ZodString;
32
+ ref: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ kind: z.ZodLiteral<"npm">;
35
+ package: z.ZodString;
36
+ version: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"local">;
39
+ path: z.ZodString;
40
+ }, z.core.$strip>], "kind">>>;
41
+ entries: z.ZodDefault<z.ZodRecord<z.ZodString, S>>;
42
+ }, z.core.$strict>;
43
+ /**
44
+ * @brief Reads a manifest file and checks every entry against `entrySchema`. A missing file reads as no sources and no entries.
45
+ *
46
+ * @param filePath - Absolute path of the manifest, e.g. `/home/me/app/.claude/skills.json`.
47
+ * @param entrySchema - Schema each installed entry must match.
48
+ * @returns The manifest, with its entries loaded into `store`.
49
+ * @throws {Error} Naming the file when it is not JSON or does not match the schema.
50
+ */
51
+ export declare function loadInstallManifest(filePath: string, entrySchema: z.ZodType<BaseRegistryEntry>): InstallManifest;
52
+ /**
53
+ * @brief Reads the installed entries of a manifest, each checked against `entrySchema`.
54
+ *
55
+ * @param manifest - Manifest whose `store` is read.
56
+ * @param entrySchema - Schema each entry must match.
57
+ * @returns Entries by key.
58
+ * @throws {ZodError} When an entry the install commands wrote does not match the schema.
59
+ */
60
+ export declare function installedEntries<T extends BaseRegistryEntry>(manifest: InstallManifest, entrySchema: z.ZodType<T>): Record<string, T>;
61
+ /**
62
+ * @brief Writes sources and entries back to `manifest.filePath`, each sorted by name, after checking every entry against `entrySchema`.
63
+ *
64
+ * @param manifest - Manifest to write.
65
+ * @param entrySchema - Schema each entry must match.
66
+ * @throws {ZodError} When an entry does not match the schema. Nothing is written then.
67
+ */
68
+ export declare function saveInstallManifest(manifest: InstallManifest, entrySchema: z.ZodType<BaseRegistryEntry>): void;
69
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/installer/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGxE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAG,YAAY,CAAA;IACtB,KAAK,EAAK,aAAa,CAAC,iBAAiB,CAAC,CAAA;CAC3C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;;;;;;;;;;;;;;mBAKxE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,eAAe,CAehH;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAErI;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAK9G"}
@@ -0,0 +1,70 @@
1
+ // packages/core/src/installer/manifest.ts
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { z } from "zod";
5
+ import { createRegistryStore } from "../registry/registry.store";
6
+ import { entries } from "../registry/registry.selectors";
7
+ import { SourceRecordSchema } from "../sources/types";
8
+ import { errorMessage } from "../utils/errors";
9
+ /**
10
+ * @brief Builds the zod schema of a manifest file whose entries match `entrySchema`.
11
+ *
12
+ * @param entrySchema - Schema each value of `entries` must match.
13
+ * @returns Strict object schema with `sources` and `entries`, both defaulting to empty.
14
+ */
15
+ export function installManifestSchema(entrySchema) {
16
+ return z.strictObject({
17
+ sources: SourceRecordSchema.default({}),
18
+ entries: z.record(z.string(), entrySchema).default({}),
19
+ });
20
+ }
21
+ /**
22
+ * @brief Reads a manifest file and checks every entry against `entrySchema`. A missing file reads as no sources and no entries.
23
+ *
24
+ * @param filePath - Absolute path of the manifest, e.g. `/home/me/app/.claude/skills.json`.
25
+ * @param entrySchema - Schema each installed entry must match.
26
+ * @returns The manifest, with its entries loaded into `store`.
27
+ * @throws {Error} Naming the file when it is not JSON or does not match the schema.
28
+ */
29
+ export function loadInstallManifest(filePath, entrySchema) {
30
+ const store = createRegistryStore();
31
+ if (!fs.existsSync(filePath))
32
+ return { filePath, sources: {}, store };
33
+ let raw;
34
+ try {
35
+ raw = JSON.parse(fs.readFileSync(filePath, "utf8"));
36
+ }
37
+ catch (error) {
38
+ throw new Error(`${filePath} is not valid JSON: ${errorMessage(error)}`);
39
+ }
40
+ const parsed = installManifestSchema(entrySchema).safeParse(raw);
41
+ if (!parsed.success)
42
+ throw new Error(`${filePath} is not a valid install manifest:\n${z.prettifyError(parsed.error)}`);
43
+ store.store.setState(() => ({ ...parsed.data.entries }));
44
+ return { filePath, sources: parsed.data.sources, store };
45
+ }
46
+ /**
47
+ * @brief Reads the installed entries of a manifest, each checked against `entrySchema`.
48
+ *
49
+ * @param manifest - Manifest whose `store` is read.
50
+ * @param entrySchema - Schema each entry must match.
51
+ * @returns Entries by key.
52
+ * @throws {ZodError} When an entry the install commands wrote does not match the schema.
53
+ */
54
+ export function installedEntries(manifest, entrySchema) {
55
+ return z.record(z.string(), entrySchema).parse(entries(manifest.store));
56
+ }
57
+ /**
58
+ * @brief Writes sources and entries back to `manifest.filePath`, each sorted by name, after checking every entry against `entrySchema`.
59
+ *
60
+ * @param manifest - Manifest to write.
61
+ * @param entrySchema - Schema each entry must match.
62
+ * @throws {ZodError} When an entry does not match the schema. Nothing is written then.
63
+ */
64
+ export function saveInstallManifest(manifest, entrySchema) {
65
+ const sorted = (record) => Object.fromEntries(Object.entries(record).sort(([a], [b]) => a.localeCompare(b)));
66
+ const content = { sources: sorted(manifest.sources), entries: sorted(installedEntries(manifest, entrySchema)) };
67
+ fs.mkdirSync(path.dirname(manifest.filePath), { recursive: true });
68
+ fs.writeFileSync(manifest.filePath, JSON.stringify(content, null, 2) + "\n");
69
+ }
70
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/installer/manifest.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAsB,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAqB,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAoB9C;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAsB,WAAc;IACvE,OAAO,CAAC,CAAC,YAAY,CAAC;QACpB,OAAO,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KACvD,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,WAAyC;IAC7F,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAA;IACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAA;IAErE,IAAI,GAAY,CAAA;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAA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AC,CAAC,CAAA;IAClI,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,CAAA;IAC/G,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAClE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;AAC9E,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { RegisteredSource, SourceRecord, SourceSpec } from "../sources/types";
2
+ import type { InstallManifest } from "./manifest";
3
+ /**
4
+ * @brief Sources of one or more manifests plus the built-in ones, each name once, built-in sources first.
5
+ *
6
+ * When two manifests register one name for different places, the first manifest's spec is used.
7
+ *
8
+ * @param manifests - Manifests to read sources from, in priority order.
9
+ * @param builtins - Sources shipped with the installer.
10
+ * @returns Every source once, by name.
11
+ */
12
+ export declare function manifestSources(manifests: readonly InstallManifest[], builtins: SourceRecord): RegisteredSource[];
13
+ /**
14
+ * @brief Registers a source in every manifest. Nothing changes unless every manifest accepts it.
15
+ *
16
+ * @param manifests - Manifests to register the source in.
17
+ * @param name - Name the source is registered under.
18
+ * @param spec - Where the source is read from.
19
+ * @param builtins - Sources shipped with the installer, which names cannot shadow.
20
+ * @throws {Error} When the name is built in, invalid, or already registered in any manifest.
21
+ */
22
+ export declare function registerSource(manifests: readonly InstallManifest[], name: string, spec: SourceSpec, builtins: SourceRecord): void;
23
+ /**
24
+ * @brief Unregisters a source from every manifest that has it.
25
+ *
26
+ * @param manifests - Manifests to remove the source from.
27
+ * @param name - Name of the source to remove.
28
+ * @param builtins - Sources shipped with the installer, which cannot be removed.
29
+ * @throws {Error} When the name is built in or no manifest registers it.
30
+ */
31
+ export declare function unregisterSource(manifests: readonly InstallManifest[], name: string, builtins: SourceRecord): void;
32
+ //# sourceMappingURL=manifestSources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestSources.d.ts","sourceRoot":"","sources":["../../src/installer/manifestSources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,EAAE,QAAQ,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAMjH;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAGlI;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAKlH"}
@@ -0,0 +1,50 @@
1
+ // packages/core/src/installer/manifestSources.ts
2
+ import { addSource, listSources, removeSource } from "../sources/register";
3
+ /**
4
+ * @brief Sources of one or more manifests plus the built-in ones, each name once, built-in sources first.
5
+ *
6
+ * When two manifests register one name for different places, the first manifest's spec is used.
7
+ *
8
+ * @param manifests - Manifests to read sources from, in priority order.
9
+ * @param builtins - Sources shipped with the installer.
10
+ * @returns Every source once, by name.
11
+ */
12
+ export function manifestSources(manifests, builtins) {
13
+ const byName = new Map();
14
+ for (const manifest of manifests) {
15
+ for (const source of listSources(manifest.sources, builtins))
16
+ if (!byName.has(source.name))
17
+ byName.set(source.name, source);
18
+ }
19
+ return [...byName.values()];
20
+ }
21
+ /**
22
+ * @brief Registers a source in every manifest. Nothing changes unless every manifest accepts it.
23
+ *
24
+ * @param manifests - Manifests to register the source in.
25
+ * @param name - Name the source is registered under.
26
+ * @param spec - Where the source is read from.
27
+ * @param builtins - Sources shipped with the installer, which names cannot shadow.
28
+ * @throws {Error} When the name is built in, invalid, or already registered in any manifest.
29
+ */
30
+ export function registerSource(manifests, name, spec, builtins) {
31
+ const updated = manifests.map((manifest) => addSource(manifest.sources, name, spec, builtins));
32
+ manifests.forEach((manifest, index) => { manifest.sources = updated[index] ?? manifest.sources; });
33
+ }
34
+ /**
35
+ * @brief Unregisters a source from every manifest that has it.
36
+ *
37
+ * @param manifests - Manifests to remove the source from.
38
+ * @param name - Name of the source to remove.
39
+ * @param builtins - Sources shipped with the installer, which cannot be removed.
40
+ * @throws {Error} When the name is built in or no manifest registers it.
41
+ */
42
+ export function unregisterSource(manifests, name, builtins) {
43
+ const holding = manifests.filter((manifest) => manifest.sources[name] !== undefined);
44
+ // With no manifest holding it, removeSource throws the reason: built in, or never registered.
45
+ if (holding.length === 0)
46
+ removeSource({}, name, builtins);
47
+ for (const manifest of holding)
48
+ manifest.sources = removeSource(manifest.sources, name, builtins);
49
+ }
50
+ //# sourceMappingURL=manifestSources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestSources.js","sourceRoot":"","sources":["../../src/installer/manifestSources.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAI1E;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,SAAqC,EAAE,QAAsB;IAC3F,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAA;IAClD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;YAAE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
+ export declare const MANIFEST_DIRS: string[];
3
+ /**
4
+ * @brief One plugin a marketplace lists, located by its folder inside the source.
5
+ *
6
+ * @property name - Plugin name from the marketplace.
7
+ * @property dir - Absolute plugin folder.
8
+ */
9
+ export interface MarketplacePlugin {
10
+ name: string;
11
+ dir: string;
12
+ }
13
+ /**
14
+ * @brief Finds a manifest file in the first manifest folder that holds it.
15
+ *
16
+ * Looks for `<dir>/.claude-plugin/<file>`, then `<dir>/.cursor-plugin/<file>`.
17
+ *
18
+ * @param dir - Absolute folder of the plugin or source.
19
+ * @param file - Manifest file name, e.g. `marketplace.json`.
20
+ * @returns Absolute path of the first existing file, or `null` when neither exists.
21
+ */
22
+ export declare function manifestFile(dir: string, file: string): string | null;
23
+ /**
24
+ * @brief Resolves a relative path against a base folder and rejects a result outside `root`.
25
+ *
26
+ * @param root - Absolute folder nothing may leave, e.g. a source checkout.
27
+ * @param base - Absolute folder `rel` is resolved against.
28
+ * @param rel - Path to resolve, as written in a manifest.
29
+ * @returns Absolute resolved path, which is `root` or lies below it.
30
+ * @throws {Error} When the path points outside `root`.
31
+ */
32
+ export declare function resolveInside(root: string, base: string, rel: string): string;
33
+ /**
34
+ * @brief Reads the plugins a source's `marketplace.json` lists.
35
+ *
36
+ * Plugins whose `source` is not a relative path (a git or npm reference) are skipped with a warning.
37
+ *
38
+ * @param root - Absolute root of the source.
39
+ * @returns Plugins and skip warnings, or `null` when the source has no marketplace.
40
+ * @throws {Error} When the marketplace is not valid JSON, or a plugin path leaves the source.
41
+ */
42
+ export declare function readMarketplace(root: string): {
43
+ plugins: MarketplacePlugin[];
44
+ warnings: string[];
45
+ } | null;
46
+ //# sourceMappingURL=marketplace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/installer/marketplace.ts"],"names":[],"mappings":"AAKA,wFAAwF;AACxF,eAAO,MAAM,aAAa,UAAuC,CAAA;AAWjE;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAG,MAAM,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAezG"}
@@ -0,0 +1,72 @@
1
+ // packages/core/src/installer/marketplace.ts
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { z } from "zod";
5
+ /** Folders a plugin or marketplace manifest may sit in, in the order they are tried. */
6
+ export const MANIFEST_DIRS = [".claude-plugin", ".cursor-plugin"];
7
+ const MARKETPLACE_FILE = "marketplace.json";
8
+ const MarketplaceSchema = z.object({
9
+ plugins: z.array(z.object({
10
+ name: z.string().min(1),
11
+ source: z.unknown(),
12
+ })).default([]),
13
+ });
14
+ /**
15
+ * @brief Finds a manifest file in the first manifest folder that holds it.
16
+ *
17
+ * Looks for `<dir>/.claude-plugin/<file>`, then `<dir>/.cursor-plugin/<file>`.
18
+ *
19
+ * @param dir - Absolute folder of the plugin or source.
20
+ * @param file - Manifest file name, e.g. `marketplace.json`.
21
+ * @returns Absolute path of the first existing file, or `null` when neither exists.
22
+ */
23
+ export function manifestFile(dir, file) {
24
+ for (const manifestDir of MANIFEST_DIRS) {
25
+ const candidate = path.join(dir, manifestDir, file);
26
+ if (fs.existsSync(candidate))
27
+ return candidate;
28
+ }
29
+ return null;
30
+ }
31
+ /**
32
+ * @brief Resolves a relative path against a base folder and rejects a result outside `root`.
33
+ *
34
+ * @param root - Absolute folder nothing may leave, e.g. a source checkout.
35
+ * @param base - Absolute folder `rel` is resolved against.
36
+ * @param rel - Path to resolve, as written in a manifest.
37
+ * @returns Absolute resolved path, which is `root` or lies below it.
38
+ * @throws {Error} When the path points outside `root`.
39
+ */
40
+ export function resolveInside(root, base, rel) {
41
+ const resolved = path.resolve(base, rel);
42
+ if (resolved !== root && !resolved.startsWith(root + path.sep)) {
43
+ throw new Error(`manifest path "${rel}" points outside the source`);
44
+ }
45
+ return resolved;
46
+ }
47
+ /**
48
+ * @brief Reads the plugins a source's `marketplace.json` lists.
49
+ *
50
+ * Plugins whose `source` is not a relative path (a git or npm reference) are skipped with a warning.
51
+ *
52
+ * @param root - Absolute root of the source.
53
+ * @returns Plugins and skip warnings, or `null` when the source has no marketplace.
54
+ * @throws {Error} When the marketplace is not valid JSON, or a plugin path leaves the source.
55
+ */
56
+ export function readMarketplace(root) {
57
+ const file = manifestFile(root, MARKETPLACE_FILE);
58
+ if (file === null)
59
+ return null;
60
+ const marketplace = MarketplaceSchema.parse(JSON.parse(fs.readFileSync(file, "utf8")));
61
+ const plugins = [];
62
+ const warnings = [];
63
+ for (const plugin of marketplace.plugins) {
64
+ if (typeof plugin.source !== "string") {
65
+ warnings.push(`${plugin.name}: marketplace source is not a relative path, skipped`);
66
+ continue;
67
+ }
68
+ plugins.push({ name: plugin.name, dir: resolveInside(root, root, plugin.source) });
69
+ }
70
+ return { plugins, warnings };
71
+ }
72
+ //# sourceMappingURL=marketplace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/installer/marketplace.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,wFAAwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,gB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