@g3nomaly/core 0.3.1 → 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 (222) hide show
  1. package/dist/cli/commands/add.d.ts +24 -4
  2. package/dist/cli/commands/add.d.ts.map +1 -1
  3. package/dist/cli/commands/add.js +37 -14
  4. package/dist/cli/commands/add.js.map +1 -1
  5. package/dist/cli/commands/conflict.d.ts +52 -0
  6. package/dist/cli/commands/conflict.d.ts.map +1 -0
  7. package/dist/cli/commands/conflict.js +88 -0
  8. package/dist/cli/commands/conflict.js.map +1 -0
  9. package/dist/cli/commands/installFromSources.d.ts +42 -13
  10. package/dist/cli/commands/installFromSources.d.ts.map +1 -1
  11. package/dist/cli/commands/installFromSources.js +68 -19
  12. package/dist/cli/commands/installFromSources.js.map +1 -1
  13. package/dist/cli/commands/ls.d.ts +13 -3
  14. package/dist/cli/commands/ls.d.ts.map +1 -1
  15. package/dist/cli/commands/ls.js +26 -6
  16. package/dist/cli/commands/ls.js.map +1 -1
  17. package/dist/cli/commands/remove.d.ts +7 -1
  18. package/dist/cli/commands/remove.d.ts.map +1 -1
  19. package/dist/cli/commands/remove.js +15 -1
  20. package/dist/cli/commands/remove.js.map +1 -1
  21. package/dist/cli/commands/sources.d.ts +34 -10
  22. package/dist/cli/commands/sources.d.ts.map +1 -1
  23. package/dist/cli/commands/sources.js +17 -3
  24. package/dist/cli/commands/sources.js.map +1 -1
  25. package/dist/cli/commands/update.d.ts +11 -4
  26. package/dist/cli/commands/update.d.ts.map +1 -1
  27. package/dist/cli/commands/update.js +32 -14
  28. package/dist/cli/commands/update.js.map +1 -1
  29. package/dist/cli/dialogue.d.ts +65 -13
  30. package/dist/cli/dialogue.d.ts.map +1 -1
  31. package/dist/cli/dialogue.js +46 -7
  32. package/dist/cli/dialogue.js.map +1 -1
  33. package/dist/cli/index.d.ts +1 -1
  34. package/dist/cli/index.d.ts.map +1 -1
  35. package/dist/cli/index.js +1 -1
  36. package/dist/cli/index.js.map +1 -1
  37. package/dist/cli/installDialogues.d.ts +11 -3
  38. package/dist/cli/installDialogues.d.ts.map +1 -1
  39. package/dist/cli/installDialogues.js +22 -5
  40. package/dist/cli/installDialogues.js.map +1 -1
  41. package/dist/cli/pick.d.ts +11 -2
  42. package/dist/cli/pick.d.ts.map +1 -1
  43. package/dist/cli/pick.js +11 -2
  44. package/dist/cli/pick.js.map +1 -1
  45. package/dist/cli/report.d.ts +32 -8
  46. package/dist/cli/report.d.ts.map +1 -1
  47. package/dist/cli/report.js +26 -5
  48. package/dist/cli/report.js.map +1 -1
  49. package/dist/cli/theme.d.ts +4 -0
  50. package/dist/cli/theme.d.ts.map +1 -1
  51. package/dist/cli/theme.js +4 -0
  52. package/dist/cli/theme.js.map +1 -1
  53. package/dist/cli/types.d.ts +56 -5
  54. package/dist/cli/types.d.ts.map +1 -1
  55. package/dist/config/config.d.ts +32 -7
  56. package/dist/config/config.d.ts.map +1 -1
  57. package/dist/config/config.js +37 -7
  58. package/dist/config/config.js.map +1 -1
  59. package/dist/config/types.d.ts +58 -0
  60. package/dist/config/types.d.ts.map +1 -1
  61. package/dist/config/types.js +0 -10
  62. package/dist/config/types.js.map +1 -1
  63. package/dist/hash/hash.d.ts +6 -8
  64. package/dist/hash/hash.d.ts.map +1 -1
  65. package/dist/hash/hash.js +7 -8
  66. package/dist/hash/hash.js.map +1 -1
  67. package/dist/hash/index.d.ts.map +1 -1
  68. package/dist/hash/index.js +1 -0
  69. package/dist/hash/index.js.map +1 -1
  70. package/dist/index.js +1 -0
  71. package/dist/index.js.map +1 -1
  72. package/dist/installer/classify.d.ts +27 -1
  73. package/dist/installer/classify.d.ts.map +1 -1
  74. package/dist/installer/classify.js +36 -1
  75. package/dist/installer/classify.js.map +1 -1
  76. package/dist/installer/files.d.ts +10 -6
  77. package/dist/installer/files.d.ts.map +1 -1
  78. package/dist/installer/files.js +4 -3
  79. package/dist/installer/files.js.map +1 -1
  80. package/dist/installer/index.d.ts +1 -1
  81. package/dist/installer/index.d.ts.map +1 -1
  82. package/dist/installer/index.js +1 -1
  83. package/dist/installer/index.js.map +1 -1
  84. package/dist/installer/install.d.ts +18 -6
  85. package/dist/installer/install.d.ts.map +1 -1
  86. package/dist/installer/install.js +20 -7
  87. package/dist/installer/install.js.map +1 -1
  88. package/dist/installer/io.d.ts +6 -1
  89. package/dist/installer/io.d.ts.map +1 -1
  90. package/dist/installer/io.js +6 -1
  91. package/dist/installer/io.js.map +1 -1
  92. package/dist/installer/manifest.d.ts +29 -19
  93. package/dist/installer/manifest.d.ts.map +1 -1
  94. package/dist/installer/manifest.js +20 -10
  95. package/dist/installer/manifest.js.map +1 -1
  96. package/dist/installer/manifestSources.d.ts +18 -7
  97. package/dist/installer/manifestSources.d.ts.map +1 -1
  98. package/dist/installer/manifestSources.js +18 -7
  99. package/dist/installer/manifestSources.js.map +1 -1
  100. package/dist/installer/marketplace.d.ts +24 -12
  101. package/dist/installer/marketplace.d.ts.map +1 -1
  102. package/dist/installer/marketplace.js +18 -10
  103. package/dist/installer/marketplace.js.map +1 -1
  104. package/dist/installer/origin.d.ts +23 -7
  105. package/dist/installer/origin.d.ts.map +1 -1
  106. package/dist/installer/origin.js +14 -7
  107. package/dist/installer/origin.js.map +1 -1
  108. package/dist/installer/remove.d.ts +17 -5
  109. package/dist/installer/remove.d.ts.map +1 -1
  110. package/dist/installer/remove.js +17 -5
  111. package/dist/installer/remove.js.map +1 -1
  112. package/dist/installer/resolve.d.ts +80 -31
  113. package/dist/installer/resolve.d.ts.map +1 -1
  114. package/dist/installer/resolve.js +96 -29
  115. package/dist/installer/resolve.js.map +1 -1
  116. package/dist/installer/sourceRegistry.d.ts +59 -22
  117. package/dist/installer/sourceRegistry.d.ts.map +1 -1
  118. package/dist/installer/sourceRegistry.js +25 -10
  119. package/dist/installer/sourceRegistry.js.map +1 -1
  120. package/dist/installer/types.d.ts +72 -19
  121. package/dist/installer/types.d.ts.map +1 -1
  122. package/dist/installer/types.js +18 -8
  123. package/dist/installer/types.js.map +1 -1
  124. package/dist/registry/index.d.ts +0 -4
  125. package/dist/registry/index.d.ts.map +1 -1
  126. package/dist/registry/index.js +1 -4
  127. package/dist/registry/index.js.map +1 -1
  128. package/dist/registry/registry.handlers.d.ts +7 -0
  129. package/dist/registry/registry.handlers.d.ts.map +1 -1
  130. package/dist/registry/registry.handlers.js.map +1 -1
  131. package/dist/registry/registry.io.d.ts +23 -7
  132. package/dist/registry/registry.io.d.ts.map +1 -1
  133. package/dist/registry/registry.io.js +37 -14
  134. package/dist/registry/registry.io.js.map +1 -1
  135. package/dist/registry/registry.mutations.d.ts +10 -3
  136. package/dist/registry/registry.mutations.d.ts.map +1 -1
  137. package/dist/registry/registry.mutations.js +10 -3
  138. package/dist/registry/registry.mutations.js.map +1 -1
  139. package/dist/registry/registry.selectors.d.ts +41 -11
  140. package/dist/registry/registry.selectors.d.ts.map +1 -1
  141. package/dist/registry/registry.selectors.js +41 -11
  142. package/dist/registry/registry.selectors.js.map +1 -1
  143. package/dist/registry/registry.store.d.ts +22 -9
  144. package/dist/registry/registry.store.d.ts.map +1 -1
  145. package/dist/registry/registry.store.js +12 -3
  146. package/dist/registry/registry.store.js.map +1 -1
  147. package/dist/registry/registry.template.d.ts +12 -6
  148. package/dist/registry/registry.template.d.ts.map +1 -1
  149. package/dist/registry/registry.template.js +13 -6
  150. package/dist/registry/registry.template.js.map +1 -1
  151. package/dist/registry/types.d.ts +17 -3
  152. package/dist/registry/types.d.ts.map +1 -1
  153. package/dist/registry/types.js +16 -6
  154. package/dist/registry/types.js.map +1 -1
  155. package/dist/security/index.d.ts.map +1 -1
  156. package/dist/security/index.js +1 -0
  157. package/dist/security/index.js.map +1 -1
  158. package/dist/security/securityParser.d.ts +9 -8
  159. package/dist/security/securityParser.d.ts.map +1 -1
  160. package/dist/security/securityParser.js +12 -22
  161. package/dist/security/securityParser.js.map +1 -1
  162. package/dist/security/securityWorker.d.ts +11 -0
  163. package/dist/security/securityWorker.d.ts.map +1 -1
  164. package/dist/security/securityWorker.js +17 -38
  165. package/dist/security/securityWorker.js.map +1 -1
  166. package/dist/sources/checkout.d.ts +10 -4
  167. package/dist/sources/checkout.d.ts.map +1 -1
  168. package/dist/sources/checkout.js +10 -4
  169. package/dist/sources/checkout.js.map +1 -1
  170. package/dist/sources/git.d.ts +5 -3
  171. package/dist/sources/git.d.ts.map +1 -1
  172. package/dist/sources/git.js +5 -3
  173. package/dist/sources/git.js.map +1 -1
  174. package/dist/sources/local.d.ts +6 -4
  175. package/dist/sources/local.d.ts.map +1 -1
  176. package/dist/sources/local.js +6 -4
  177. package/dist/sources/local.js.map +1 -1
  178. package/dist/sources/npm.d.ts +10 -7
  179. package/dist/sources/npm.d.ts.map +1 -1
  180. package/dist/sources/npm.js +49 -15
  181. package/dist/sources/npm.js.map +1 -1
  182. package/dist/sources/parse.d.ts +24 -16
  183. package/dist/sources/parse.d.ts.map +1 -1
  184. package/dist/sources/parse.js +40 -18
  185. package/dist/sources/parse.js.map +1 -1
  186. package/dist/sources/process.d.ts +10 -7
  187. package/dist/sources/process.d.ts.map +1 -1
  188. package/dist/sources/process.js +10 -7
  189. package/dist/sources/process.js.map +1 -1
  190. package/dist/sources/register.d.ts +20 -5
  191. package/dist/sources/register.d.ts.map +1 -1
  192. package/dist/sources/register.js +20 -5
  193. package/dist/sources/register.js.map +1 -1
  194. package/dist/sources/types.d.ts +43 -8
  195. package/dist/sources/types.d.ts.map +1 -1
  196. package/dist/sources/types.js +21 -4
  197. package/dist/sources/types.js.map +1 -1
  198. package/dist/utils/errors.d.ts +6 -1
  199. package/dist/utils/errors.d.ts.map +1 -1
  200. package/dist/utils/errors.js +6 -1
  201. package/dist/utils/errors.js.map +1 -1
  202. package/dist/utils/merge.d.ts +8 -2
  203. package/dist/utils/merge.d.ts.map +1 -1
  204. package/dist/utils/merge.js +9 -2
  205. package/dist/utils/merge.js.map +1 -1
  206. package/dist/utils/packageMeta.d.ts +16 -2
  207. package/dist/utils/packageMeta.d.ts.map +1 -1
  208. package/dist/utils/packageMeta.js +6 -2
  209. package/dist/utils/packageMeta.js.map +1 -1
  210. package/dist/utils/paths.d.ts +16 -5
  211. package/dist/utils/paths.d.ts.map +1 -1
  212. package/dist/utils/paths.js +16 -5
  213. package/dist/utils/paths.js.map +1 -1
  214. package/dist/utils/prompt.d.ts +6 -1
  215. package/dist/utils/prompt.d.ts.map +1 -1
  216. package/dist/utils/prompt.js +6 -1
  217. package/dist/utils/prompt.js.map +1 -1
  218. package/dist/utils/version.d.ts +7 -2
  219. package/dist/utils/version.d.ts.map +1 -1
  220. package/dist/utils/version.js +40 -3
  221. package/dist/utils/version.js.map +1 -1
  222. package/package.json +1 -1
@@ -1,31 +1,43 @@
1
1
  /** Folders a plugin or marketplace manifest may sit in, in the order they are tried. */
2
2
  export declare const MANIFEST_DIRS: string[];
3
- /** One plugin a marketplace lists, by its folder inside the source. */
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
+ */
4
9
  export interface MarketplacePlugin {
5
10
  name: string;
6
- /** Absolute plugin folder */
7
11
  dir: string;
8
12
  }
9
13
  /**
10
- * First existing `<dir>/.claude-plugin/<file>` or `<dir>/.cursor-plugin/<file>`.
14
+ * @brief Finds a manifest file in the first manifest folder that holds it.
11
15
  *
12
- * @returns absolute path, or `null` when neither exists
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.
13
21
  */
14
22
  export declare function manifestFile(dir: string, file: string): string | null;
15
23
  /**
16
- * Resolves `rel` against `base` and rejects a result outside `root`.
24
+ * @brief Resolves a relative path against a base folder and rejects a result outside `root`.
17
25
  *
18
- * @param root - Absolute folder nothing may leave, e.g. a source checkout
19
- * @throws when the path points outside `root`
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`.
20
31
  */
21
32
  export declare function resolveInside(root: string, base: string, rel: string): string;
22
33
  /**
23
- * The plugins a source's `marketplace.json` lists. Plugins whose `source` is
24
- * not a relative path (a git or npm reference) are skipped with a warning.
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.
25
37
  *
26
- * @param root - Absolute root of the source
27
- * @returns `null` when the source has no marketplace
28
- * @throws when the marketplace is not valid JSON, or a plugin path leaves the source
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.
29
41
  */
30
42
  export declare function readMarketplace(root: string): {
31
43
  plugins: MarketplacePlugin[];
@@ -1 +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,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,GAAG,EAAG,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMrE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAezG"}
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"}
@@ -12,9 +12,13 @@ const MarketplaceSchema = z.object({
12
12
  })).default([]),
13
13
  });
14
14
  /**
15
- * First existing `<dir>/.claude-plugin/<file>` or `<dir>/.cursor-plugin/<file>`.
15
+ * @brief Finds a manifest file in the first manifest folder that holds it.
16
16
  *
17
- * @returns absolute path, or `null` when neither exists
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.
18
22
  */
19
23
  export function manifestFile(dir, file) {
20
24
  for (const manifestDir of MANIFEST_DIRS) {
@@ -25,10 +29,13 @@ export function manifestFile(dir, file) {
25
29
  return null;
26
30
  }
27
31
  /**
28
- * Resolves `rel` against `base` and rejects a result outside `root`.
32
+ * @brief Resolves a relative path against a base folder and rejects a result outside `root`.
29
33
  *
30
- * @param root - Absolute folder nothing may leave, e.g. a source checkout
31
- * @throws when the path points outside `root`
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`.
32
39
  */
33
40
  export function resolveInside(root, base, rel) {
34
41
  const resolved = path.resolve(base, rel);
@@ -38,12 +45,13 @@ export function resolveInside(root, base, rel) {
38
45
  return resolved;
39
46
  }
40
47
  /**
41
- * The plugins a source's `marketplace.json` lists. Plugins whose `source` is
42
- * not a relative path (a git or npm reference) are skipped with a warning.
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.
43
51
  *
44
- * @param root - Absolute root of the source
45
- * @returns `null` when the source has no marketplace
46
- * @throws when the marketplace is not valid JSON, or a plugin path leaves the source
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.
47
55
  */
48
56
  export function readMarketplace(root) {
49
57
  const file = manifestFile(root, MARKETPLACE_FILE);
@@ -1 +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,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;AAEjE,MAAM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QACzC,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,sDAAsD,CAAC,CAAA;YACnF,SAAQ;QACV,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACpF,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA;AAC9B,CAAC"}
@@ -1,7 +1,11 @@
1
1
  import { z } from "zod";
2
2
  /**
3
- * Where an entry came from: the registered source, the folder its file paths
4
- * resolve against, and the revision the source was read at.
3
+ * @brief Where an entry came from: the registered source, the folder its file paths resolve against, and the revision read.
4
+ *
5
+ * @property source - Name of the registered source, e.g. `g3n-skills`.
6
+ * @property dir - Source-relative folder that `files[].path` resolves against, e.g. `skills/speech` or `dist/components`.
7
+ * @property commit - Commit a git source resolved to.
8
+ * @property version - Version an npm source resolved to, or the version in a local source's package.json.
5
9
  */
6
10
  export declare const EntryOriginSchema: z.ZodObject<{
7
11
  source: z.ZodString;
@@ -9,8 +13,15 @@ export declare const EntryOriginSchema: z.ZodObject<{
9
13
  commit: z.ZodOptional<z.ZodString>;
10
14
  version: z.ZodOptional<z.ZodString>;
11
15
  }, z.core.$strip>;
16
+ /** Origin of one entry, inferred from `EntryOriginSchema`. */
12
17
  export type EntryOrigin = z.infer<typeof EntryOriginSchema>;
13
- /** A registry entry read from a source: the base fields plus its origin. */
18
+ /**
19
+ * @brief A registry entry read from a source: the base fields plus its origin.
20
+ *
21
+ * @property origin - Where the entry came from.
22
+ * @property forkedFrom - Key of the entry this one was forked from, after local changes. A fork keeps the original's files and
23
+ * `origin`, is never updated, and stands in for that key as a dependency.
24
+ */
14
25
  export declare const OriginEntrySchema: z.ZodObject<{
15
26
  name: z.ZodString;
16
27
  description: z.ZodOptional<z.ZodString>;
@@ -29,15 +40,20 @@ export declare const OriginEntrySchema: z.ZodObject<{
29
40
  commit: z.ZodOptional<z.ZodString>;
30
41
  version: z.ZodOptional<z.ZodString>;
31
42
  }, z.core.$strip>;
43
+ forkedFrom: z.ZodOptional<z.ZodString>;
32
44
  }, z.core.$strip>;
45
+ /** Registry entry with its origin, inferred from `OriginEntrySchema`. */
33
46
  export type OriginEntry = z.infer<typeof OriginEntrySchema>;
34
- /** What a source's reader passes to the function that reads one entry folder. */
47
+ /**
48
+ * @brief What a source's reader passes to the function that reads one entry folder.
49
+ *
50
+ * @property origin - Origin recorded on the entry.
51
+ * @property group - Group the entry is listed under, e.g. the plugin it ships in.
52
+ * @property version - Version to record when the entry's own manifest has none.
53
+ */
35
54
  export interface ReadContext {
36
- /** Origin recorded on the entry */
37
55
  origin: EntryOrigin;
38
- /** Group the entry is listed under, e.g. the plugin it ships in */
39
56
  group: string;
40
- /** Version to record when the entry's own manifest has none */
41
57
  version?: string;
42
58
  }
43
59
  //# sourceMappingURL=origin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../src/installer/origin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;iBAS5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;iBAE5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,MAAM,EAAI,WAAW,CAAA;IACrB,mEAAmE;IACnE,KAAK,EAAK,MAAM,CAAA;IAChB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
1
+ {"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../src/installer/origin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAA;AAEF,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;iBAG5B,CAAA;AAEF,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAI,WAAW,CAAA;IACrB,KAAK,EAAK,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
@@ -2,21 +2,28 @@
2
2
  import { z } from "zod";
3
3
  import { BaseRegistryEntrySchema } from "../registry/types";
4
4
  /**
5
- * Where an entry came from: the registered source, the folder its file paths
6
- * resolve against, and the revision the source was read at.
5
+ * @brief Where an entry came from: the registered source, the folder its file paths resolve against, and the revision read.
6
+ *
7
+ * @property source - Name of the registered source, e.g. `g3n-skills`.
8
+ * @property dir - Source-relative folder that `files[].path` resolves against, e.g. `skills/speech` or `dist/components`.
9
+ * @property commit - Commit a git source resolved to.
10
+ * @property version - Version an npm source resolved to, or the version in a local source's package.json.
7
11
  */
8
12
  export const EntryOriginSchema = z.object({
9
- /** Name of the registered source, e.g. `g3n-skills` */
10
13
  source: z.string().min(1),
11
- /** Source-relative folder that `files[].path` resolves against, e.g. `skills/speech` or `dist/components` */
12
14
  dir: z.string(),
13
- /** Commit a git source resolved to */
14
15
  commit: z.string().min(1).optional(),
15
- /** Version an npm source resolved to, or the version in a local source's package.json */
16
16
  version: z.string().min(1).optional(),
17
17
  });
18
- /** A registry entry read from a source: the base fields plus its origin. */
18
+ /**
19
+ * @brief A registry entry read from a source: the base fields plus its origin.
20
+ *
21
+ * @property origin - Where the entry came from.
22
+ * @property forkedFrom - Key of the entry this one was forked from, after local changes. A fork keeps the original's files and
23
+ * `origin`, is never updated, and stands in for that key as a dependency.
24
+ */
19
25
  export const OriginEntrySchema = BaseRegistryEntrySchema.extend({
20
26
  origin: EntryOriginSchema,
27
+ forkedFrom: z.string().min(1).optional(),
21
28
  });
22
29
  //# sourceMappingURL=origin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"origin.js","sourceRoot":"","sources":["../../src/installer/origin.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,uDAAuD;IACvD,MAAM,EAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,6GAA6G;IAC7G,GAAG,EAAM,CAAC,CAAC,MAAM,EAAE;IACnB,sCAAsC;IACtC,MAAM,EAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrC,yFAAyF;IACzF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAA;AAIF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB;CAC1B,CAAC,CAAA"}
1
+ {"version":3,"file":"origin.js","sourceRoot":"","sources":["../../src/installer/origin.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,GAAG,EAAM,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAA;AAKF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAM,iBAAiB;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAA"}
@@ -1,14 +1,26 @@
1
1
  import type { BaseFileEntry } from "../registry/types";
2
2
  import type { InstallerIO, RemoveResult } from "./types";
3
3
  /**
4
- * Removes a manifest entry's files from `installDir`. A file whose on-disk
5
- * hash differs from the hash recorded at install time is kept unless `force`
6
- * is set. Directories left empty by the removals are pruned up to
7
- * `installDir`.
4
+ * @brief Removes a manifest entry's files from `installDir`.
5
+ *
6
+ * A file whose on-disk hash differs from the hash recorded at install time is kept unless `opts.force`
7
+ * is set. Directories left empty by the removals are pruned up to `installDir`.
8
+ *
9
+ * @param files - Manifest entries to remove, with their install-time hashes.
10
+ * @param installDir - Absolute folder the package is installed into.
11
+ * @param opts - `force` removes changed files too.
12
+ * @param io - Filesystem boundary used to test, hash and delete files.
13
+ * @returns Removed, kept and missing relative paths.
8
14
  */
9
15
  export declare function removeInstalledFiles(files: readonly BaseFileEntry[], installDir: string, opts: {
10
16
  force?: boolean;
11
17
  }, io: InstallerIO): Promise<RemoveResult>;
12
- /** Removes `dir` and its parents while they exist and are empty, stopping at `stopAt`. */
18
+ /**
19
+ * @brief Removes `dir` and its parents while they exist and are empty.
20
+ *
21
+ * @param dir - Absolute folder to start from.
22
+ * @param stopAt - Absolute folder never removed, such as the install root.
23
+ * @param io - Filesystem boundary used to test and delete folders.
24
+ */
13
25
  export declare function pruneEmptyDirs(dir: string, stopAt: string, io: InstallerIO): void;
14
26
  //# sourceMappingURL=remove.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/installer/remove.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAExD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EACzB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,YAAY,CAAC,CAsBvB;AAED,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAMjF"}
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/installer/remove.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAExD;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EACzB,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,YAAY,CAAC,CAsBvB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAMjF"}
@@ -1,10 +1,16 @@
1
1
  // packages/core/src/installer/remove.ts
2
2
  import path from "node:path";
3
3
  /**
4
- * Removes a manifest entry's files from `installDir`. A file whose on-disk
5
- * hash differs from the hash recorded at install time is kept unless `force`
6
- * is set. Directories left empty by the removals are pruned up to
7
- * `installDir`.
4
+ * @brief Removes a manifest entry's files from `installDir`.
5
+ *
6
+ * A file whose on-disk hash differs from the hash recorded at install time is kept unless `opts.force`
7
+ * is set. Directories left empty by the removals are pruned up to `installDir`.
8
+ *
9
+ * @param files - Manifest entries to remove, with their install-time hashes.
10
+ * @param installDir - Absolute folder the package is installed into.
11
+ * @param opts - `force` removes changed files too.
12
+ * @param io - Filesystem boundary used to test, hash and delete files.
13
+ * @returns Removed, kept and missing relative paths.
8
14
  */
9
15
  export async function removeInstalledFiles(files, installDir, opts, io) {
10
16
  const result = { removed: [], kept: [], missing: [] };
@@ -26,7 +32,13 @@ export async function removeInstalledFiles(files, installDir, opts, io) {
26
32
  }
27
33
  return result;
28
34
  }
29
- /** Removes `dir` and its parents while they exist and are empty, stopping at `stopAt`. */
35
+ /**
36
+ * @brief Removes `dir` and its parents while they exist and are empty.
37
+ *
38
+ * @param dir - Absolute folder to start from.
39
+ * @param stopAt - Absolute folder never removed, such as the install root.
40
+ * @param io - Filesystem boundary used to test and delete folders.
41
+ */
30
42
  export function pruneEmptyDirs(dir, stopAt, io) {
31
43
  let current = dir;
32
44
  while (current !== stopAt && io.exists(current) && io.listDir(current).length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"remove.js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F,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC3B,SAAQ;QACV,CAAC;QACD,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QACvB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,MAAc,EAAE,EAAe;IACzE,IAAI,OAAO,GAAG,GAAG,CAAA;IACjB,OAAO,OAAO,KAAK,MAAM,IAAI,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpF,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QACrB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACjC,CAAC;AACH,CAAC"}
@@ -1,75 +1,124 @@
1
1
  import type { OriginEntry } from "./origin";
2
2
  import type { SourceOffer } from "./sourceRegistry";
3
- /** An entry or group as named on the command line or in `registryDependencies`. */
3
+ /**
4
+ * @brief An entry or group as named on the command line or in `registryDependencies`.
5
+ *
6
+ * @property name - Entry key or group name, lowercased, e.g. `emphasise`.
7
+ * @property source - Registered source the name must come from, e.g. `g3n-skills`, when given as `<name>@<source>`. Absent when not given.
8
+ */
4
9
  export interface EntryRequest {
5
10
  name: string;
6
- /** Registered source the name must come from, when given as `<name>@<source>` */
7
11
  source?: string;
8
12
  }
9
- /** Entries a set of requests resolved to, and what could not be resolved. */
13
+ /**
14
+ * @brief Entries a set of requests resolved to, and what could not be resolved.
15
+ *
16
+ * @property entries - Resolved entries by key, `registryDependencies` rewritten to the resolved keys.
17
+ * @property unknown - Requests and dependencies no source offers, e.g. `ghost` or `ghost@mine`.
18
+ * @property ambiguous - One message per name more than one source offers, naming the qualified forms to pick from.
19
+ * @property notes - Why an entry nobody named is in the set, e.g. `{ vocabulary: "dep of plan" }`.
20
+ */
10
21
  export interface Resolution<T extends OriginEntry> {
11
- /** Resolved entries by key, `registryDependencies` rewritten to the resolved keys */
12
22
  entries: Map<string, SourceOffer<T>>;
13
- /** Requests and dependencies no source offers, e.g. `ghost` or `ghost@mine` */
14
23
  unknown: string[];
15
- /** One message per name more than one source offers, naming the qualified forms to pick from */
16
24
  ambiguous: string[];
17
- /** Why an entry nobody named is in the set, e.g. `{ vocabulary: "dep of plan" }` */
18
25
  notes: Record<string, string>;
19
26
  }
20
- /** One entry with its dependencies resolved across sources. */
27
+ /**
28
+ * @brief One entry with its dependencies resolved across sources.
29
+ *
30
+ * @property offer - The entry with `registryDependencies` rewritten to the resolved keys.
31
+ * @property dependencies - Offers of the dependencies found, in the order declared.
32
+ * @property unknown - Dependencies no source offers, e.g. `ghost (dep of plan)`.
33
+ * @property ambiguous - One message per dependency more than one source offers.
34
+ */
21
35
  export interface ResolvedDependencies<T extends OriginEntry> {
22
- /** The entry with `registryDependencies` rewritten to the resolved keys */
23
36
  offer: SourceOffer<T>;
24
37
  dependencies: SourceOffer<T>[];
25
- /** Dependencies no source offers, e.g. `ghost (dep of plan)` */
26
38
  unknown: string[];
27
39
  ambiguous: string[];
28
40
  }
29
41
  /**
30
- * Reads `emphasise` or `emphasise@g3n-skills`; names are matched in
31
- * lowercase. A leading `@` belongs to the name, as in `@shadcn/button@shadcn`.
42
+ * @brief Parses a typed request such as `emphasise` or `emphasise@g3n-skills`.
43
+ *
44
+ * Names are matched in lowercase. A leading `@` belongs to the name, as in
45
+ * `@shadcn/button@shadcn`, so the source starts at the first `@` after the first character.
46
+ *
47
+ * @param token - Word as typed on the command line, e.g. `emphasise@g3n-skills`.
48
+ * @returns Request with the lowercased name, and the source when one is given.
32
49
  */
33
50
  export declare function parseRequest(token: string): EntryRequest;
34
- /** A request as it is typed, e.g. `emphasise@g3n-skills`. */
51
+ /**
52
+ * @brief Formats a request as it is typed, e.g. `emphasise@g3n-skills`.
53
+ *
54
+ * @param request - Parsed request, e.g. `{ name: "emphasise", source: "g3n-skills" }`.
55
+ */
35
56
  export declare function formatRequest(request: EntryRequest): string;
36
57
  /**
37
- * Resolves the `registryDependencies` of one entry against every offer. A
38
- * dependency that cannot be resolved keeps its bare name in the rewritten
58
+ * @brief Resolves the `registryDependencies` of one entry against every offer.
59
+ *
60
+ * A dependency that cannot be resolved keeps its bare name in the rewritten
39
61
  * list and is reported in `unknown` or `ambiguous`.
40
62
  *
41
- * @param preferred - Source to take a key from when several offer it: where it is installed, or where the request named it
63
+ * @param offer - Offer whose dependencies are resolved.
64
+ * @param offers - Every offer to resolve against, across all sources.
65
+ * @param preferred - Source to take a key from when several offer it: where it is installed, or where the request named it.
66
+ * @returns The offer with rewritten dependencies, the dependency offers found, and the ones that did not resolve.
42
67
  */
43
68
  export declare function resolveDependencies<T extends OriginEntry>(offer: SourceOffer<T>, offers: readonly SourceOffer<T>[], preferred?: Record<string, string>): ResolvedDependencies<T>;
44
69
  /**
45
- * Resolves entry and group names against every offer, with the dependency
46
- * closure of each across sources. An entry named in the request settles which
47
- * source its key comes from for every dependency. Two different entries
48
- * wanted under one key are reported as ambiguous, since a target holds one
49
- * folder per key.
70
+ * @brief Resolves entry and group names against every offer, with the dependency closure of each across sources.
71
+ *
72
+ * An entry named in the request settles which source its key comes from for
73
+ * every dependency. Two different entries wanted under one key are reported as
74
+ * ambiguous, since a target holds one folder per key.
50
75
  *
51
- * @param installed - Source each installed key came from
76
+ * @param tokens - Names as typed on the command line, e.g. `["emphasise", "ui@g3n-skills"]`.
77
+ * @param offers - Every offer to resolve against, across all sources.
78
+ * @param installed - Source each installed key came from.
79
+ * @returns The entries to install, and what could not be resolved or was ambiguous.
52
80
  */
53
81
  export declare function resolveRequests<T extends OriginEntry>(tokens: readonly string[], offers: readonly SourceOffer<T>[], installed?: Record<string, string>): Resolution<T>;
54
82
  /**
55
- * Resolves entry and group names against what a target has installed, with
56
- * `<name>@<source>` keeping only entries installed from that source. Works
57
- * from the install manifest alone, so no source needs to be reachable.
83
+ * @brief Resolves entry and group names against what a target has installed.
58
84
  *
59
- * @returns installed keys in the order named, and the names that match nothing installed
85
+ * `<name>@<source>` keeps only entries installed from that source. Works from
86
+ * the install manifest alone, so no source needs to be reachable.
87
+ *
88
+ * @param tokens - Names as typed, e.g. `["emphasise@g3n-skills"]`.
89
+ * @param installed - Installed entries by key, from one target's manifest.
90
+ * @returns Installed keys in the order named, and the names that match nothing installed.
60
91
  */
61
92
  export declare function resolveInstalled<T extends OriginEntry>(tokens: readonly string[], installed: Record<string, T>): {
62
93
  keys: string[];
63
94
  unknown: string[];
64
95
  };
65
- /** Source each installed key came from, across manifests; the first manifest wins on a clash. */
96
+ /**
97
+ * @brief Maps each installed key to the source it came from, across manifests.
98
+ *
99
+ * The first manifest wins on a clash.
100
+ *
101
+ * @param installed - Installed entries by key, one record per target manifest.
102
+ * @returns Source name by installed key, e.g. `{ emphasise: "g3n-skills" }`.
103
+ */
66
104
  export declare function installedOrigins<T extends OriginEntry>(installed: readonly Record<string, T>[]): Record<string, string>;
67
105
  /**
68
- * The fresh offer for each installed key, from the source it was installed
69
- * from and never another, with its dependencies resolved.
106
+ * @brief Maps each forked key to the installed fork that stands in for it, across manifests.
107
+ *
108
+ * The first manifest wins on a clash.
109
+ *
110
+ * @param installed - Installed entries by key, one record per target manifest.
111
+ * @returns Installed fork key by forked key, e.g. `{ emphasise: "my-emphasise" }`.
112
+ */
113
+ export declare function installedForks<T extends OriginEntry>(installed: readonly Record<string, T>[]): Record<string, string>;
114
+ /**
115
+ * @brief Finds the fresh offer for each installed key, from the source it was installed from and never another, with its dependencies resolved.
70
116
  *
71
- * @param preferred - Source each installed key came from, across targets
72
- * @returns the offers found, and the keys whose source is gone or no longer offers them
117
+ * @param keys - Installed keys to update.
118
+ * @param installed - Installed entries by key, from one target's manifest.
119
+ * @param offers - Every offer to search, across all sources.
120
+ * @param preferred - Source each installed key came from, across targets.
121
+ * @returns The offers found, and the keys whose source is gone or no longer offers them.
73
122
  */
74
123
  export declare function resolveUpdates<T extends OriginEntry>(keys: readonly string[], installed: Record<string, T>, offers: readonly SourceOffer<T>[], preferred?: Record<string, string>): {
75
124
  offers: SourceOffer<T>[];
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/installer/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAK,MAAM,CAAA;IACf,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,6EAA6E;AAC7E,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW;IAC/C,qFAAqF;IACrF,OAAO,EAAI,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACtC,+EAA+E;IAC/E,OAAO,EAAI,MAAM,EAAE,CAAA;IACnB,gGAAgG;IAChG,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,oFAAoF;IACpF,KAAK,EAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,WAAW;IACzD,2EAA2E;IAC3E,KAAK,EAAS,WAAW,CAAC,CAAC,CAAC,CAAA;IAC5B,YAAY,EAAE,WAAW,CAAC,CAAC,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