@hashicorp/kits 0.1.4 → 0.1.5

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 (122) hide show
  1. package/README.md +173 -32
  2. package/dist/adapters/base-adapter.d.ts +2 -2
  3. package/dist/adapters/base-adapter.js +2 -2
  4. package/dist/adapters/claude-code/index.d.ts +1 -1
  5. package/dist/adapters/claude-code/index.js +1 -1
  6. package/dist/adapters/codex/index.d.ts +1 -1
  7. package/dist/adapters/codex/index.js +1 -1
  8. package/dist/adapters/gemini-cli/index.d.ts +1 -1
  9. package/dist/adapters/gemini-cli/index.js +1 -1
  10. package/dist/adapters/github-copilot/index.d.ts +1 -1
  11. package/dist/adapters/github-copilot/index.js +1 -1
  12. package/dist/adapters/opencode/index.d.ts +1 -1
  13. package/dist/adapters/opencode/index.js +1 -1
  14. package/dist/cli/index.d.ts.map +1 -1
  15. package/dist/cli/index.js +29 -9
  16. package/dist/cli/index.js.map +1 -1
  17. package/dist/cli/install.d.ts.map +1 -1
  18. package/dist/cli/install.js +820 -161
  19. package/dist/cli/install.js.map +1 -1
  20. package/dist/cli/list.d.ts.map +1 -1
  21. package/dist/cli/list.js +8 -6
  22. package/dist/cli/list.js.map +1 -1
  23. package/dist/cli/types.d.ts +17 -0
  24. package/dist/cli/types.d.ts.map +1 -1
  25. package/dist/cli/types.js +1 -0
  26. package/dist/cli/types.js.map +1 -1
  27. package/dist/cli/uninstall.d.ts.map +1 -1
  28. package/dist/cli/uninstall.js +300 -38
  29. package/dist/cli/uninstall.js.map +1 -1
  30. package/dist/cli/upgrade.d.ts.map +1 -1
  31. package/dist/cli/upgrade.js +334 -105
  32. package/dist/cli/upgrade.js.map +1 -1
  33. package/dist/cli/validate.js +5 -5
  34. package/dist/cli/validate.js.map +1 -1
  35. package/dist/core/types.d.ts +5 -5
  36. package/dist/core/upgrade-executor.d.ts +7 -7
  37. package/dist/core/upgrade-executor.d.ts.map +1 -1
  38. package/dist/core/upgrade-executor.js +17 -17
  39. package/dist/core/upgrade-executor.js.map +1 -1
  40. package/dist/discovery/kit-scanner.d.ts +3 -3
  41. package/dist/discovery/kit-scanner.js +17 -17
  42. package/dist/discovery/kit-scanner.js.map +1 -1
  43. package/dist/discovery/types.d.ts +1 -1
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +3 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/lockfile/index.d.ts +79 -0
  49. package/dist/lockfile/index.d.ts.map +1 -0
  50. package/dist/lockfile/index.js +203 -0
  51. package/dist/lockfile/index.js.map +1 -0
  52. package/dist/lockfile/read.d.ts +32 -0
  53. package/dist/lockfile/read.d.ts.map +1 -0
  54. package/dist/lockfile/read.js +88 -0
  55. package/dist/lockfile/read.js.map +1 -0
  56. package/dist/lockfile/types.d.ts +126 -0
  57. package/dist/lockfile/types.d.ts.map +1 -0
  58. package/dist/lockfile/types.js +44 -0
  59. package/dist/lockfile/types.js.map +1 -0
  60. package/dist/{manifest → lockfile}/upgrade-check.d.ts +5 -5
  61. package/dist/lockfile/upgrade-check.d.ts.map +1 -0
  62. package/dist/{manifest → lockfile}/upgrade-check.js +11 -9
  63. package/dist/lockfile/upgrade-check.js.map +1 -0
  64. package/dist/lockfile/utils.d.ts +35 -0
  65. package/dist/lockfile/utils.d.ts.map +1 -0
  66. package/dist/lockfile/utils.js +57 -0
  67. package/dist/lockfile/utils.js.map +1 -0
  68. package/dist/lockfile/write.d.ts +44 -0
  69. package/dist/lockfile/write.d.ts.map +1 -0
  70. package/dist/lockfile/write.js +77 -0
  71. package/dist/lockfile/write.js.map +1 -0
  72. package/dist/manifest/hash.d.ts +7 -0
  73. package/dist/manifest/hash.d.ts.map +1 -0
  74. package/dist/manifest/hash.js +30 -0
  75. package/dist/manifest/hash.js.map +1 -0
  76. package/dist/manifest/index.d.ts +8 -77
  77. package/dist/manifest/index.d.ts.map +1 -1
  78. package/dist/manifest/index.js +6 -197
  79. package/dist/manifest/index.js.map +1 -1
  80. package/dist/manifest/read.d.ts +4 -24
  81. package/dist/manifest/read.d.ts.map +1 -1
  82. package/dist/manifest/read.js +22 -46
  83. package/dist/manifest/read.js.map +1 -1
  84. package/dist/manifest/types.d.ts +17 -109
  85. package/dist/manifest/types.d.ts.map +1 -1
  86. package/dist/manifest/types.js +8 -37
  87. package/dist/manifest/types.js.map +1 -1
  88. package/dist/manifest/utils.d.ts +1 -27
  89. package/dist/manifest/utils.d.ts.map +1 -1
  90. package/dist/manifest/utils.js +1 -28
  91. package/dist/manifest/utils.js.map +1 -1
  92. package/dist/manifest/write.d.ts +3 -34
  93. package/dist/manifest/write.d.ts.map +1 -1
  94. package/dist/manifest/write.js +5 -45
  95. package/dist/manifest/write.js.map +1 -1
  96. package/dist/resolution/index.d.ts +7 -7
  97. package/dist/resolution/index.d.ts.map +1 -1
  98. package/dist/resolution/index.js +29 -19
  99. package/dist/resolution/index.js.map +1 -1
  100. package/dist/resolution/multi-kit-resolver.d.ts +2 -2
  101. package/dist/resolution/multi-kit-resolver.js +2 -2
  102. package/dist/resolution/primitives-registry.d.ts +1 -1
  103. package/dist/resolution/primitives-registry.js +2 -2
  104. package/dist/resolution/primitives-registry.js.map +1 -1
  105. package/dist/resolution/types.d.ts +1 -1
  106. package/dist/resolution/types.js +1 -1
  107. package/dist/tui/types.d.ts +1 -0
  108. package/dist/tui/types.d.ts.map +1 -1
  109. package/dist/tui/upgrade-select.d.ts +1 -1
  110. package/dist/tui/upgrade-select.d.ts.map +1 -1
  111. package/dist/tui/upgrade-select.js +15 -4
  112. package/dist/tui/upgrade-select.js.map +1 -1
  113. package/dist/validation/validate-kits.d.ts +1 -1
  114. package/dist/validation/validate-kits.js +5 -5
  115. package/dist/validation/validate-kits.js.map +1 -1
  116. package/package.json +1 -1
  117. package/schemas/{manifest.schema.json → kits-lock.schema.json} +34 -8
  118. package/schemas/kits-manifest.schema.json +95 -0
  119. package/schemas/{kits.schema.json → kits-registry.schema.json} +3 -3
  120. package/schemas/{primitives.schema.json → primitives-registry.schema.json} +2 -2
  121. package/dist/manifest/upgrade-check.d.ts.map +0 -1
  122. package/dist/manifest/upgrade-check.js.map +0 -1
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared utilities for the lockfile module.
3
+ */
4
+ import type { InstallationScope } from "../core/types.js";
5
+ /**
6
+ * Expand ~ to home directory.
7
+ *
8
+ * @param pathStr - Path string that may contain ~
9
+ * @returns Expanded path string
10
+ */
11
+ export declare function expandPath(pathStr: string): string;
12
+ /**
13
+ * Get the lockfile path for a given scope.
14
+ *
15
+ * @param scope - Installation scope (global or project)
16
+ * @param projectRoot - Absolute path to project root (required for project scope)
17
+ * @returns Absolute path to the lockfile file
18
+ */
19
+ export declare function getLockfilePath(scope: InstallationScope, projectRoot?: string): string;
20
+ /**
21
+ * Get the lockfile directory path for a given scope.
22
+ *
23
+ * @param scope - Installation scope (global or project)
24
+ * @param projectRoot - Absolute path to project root (required for project scope)
25
+ * @returns Absolute path to the lockfile directory
26
+ */
27
+ export declare function getLockfileDir(scope: InstallationScope, projectRoot?: string): string;
28
+ /**
29
+ * Ensure the lockfile directory exists for a given scope.
30
+ *
31
+ * @param scope - Installation scope (global or project)
32
+ * @param projectRoot - Absolute path to project root (required for project scope)
33
+ */
34
+ export declare function ensureLockfileDir(scope: InstallationScope, projectRoot?: string): Promise<void>;
35
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lockfile/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO1D;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,iBAAiB,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAWR;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,iBAAiB,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,iBAAiB,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Shared utilities for the lockfile module.
3
+ */
4
+ import fs from "node:fs/promises";
5
+ import path from "node:path";
6
+ import { GLOBAL_LOCKFILE_PATH, PROJECT_LOCKFILE_DIR, PROJECT_LOCKFILE_FILENAME, } from "./types.js";
7
+ /**
8
+ * Expand ~ to home directory.
9
+ *
10
+ * @param pathStr - Path string that may contain ~
11
+ * @returns Expanded path string
12
+ */
13
+ export function expandPath(pathStr) {
14
+ if (pathStr.startsWith("~")) {
15
+ const home = process.env["HOME"] || process.env["USERPROFILE"] || "";
16
+ return path.join(home, pathStr.slice(1));
17
+ }
18
+ return pathStr;
19
+ }
20
+ /**
21
+ * Get the lockfile path for a given scope.
22
+ *
23
+ * @param scope - Installation scope (global or project)
24
+ * @param projectRoot - Absolute path to project root (required for project scope)
25
+ * @returns Absolute path to the lockfile file
26
+ */
27
+ export function getLockfilePath(scope, projectRoot) {
28
+ if (scope === "global") {
29
+ return expandPath(GLOBAL_LOCKFILE_PATH);
30
+ }
31
+ // Project scope
32
+ if (!projectRoot) {
33
+ throw new Error("projectRoot is required for project scope");
34
+ }
35
+ return path.join(projectRoot, PROJECT_LOCKFILE_DIR, PROJECT_LOCKFILE_FILENAME);
36
+ }
37
+ /**
38
+ * Get the lockfile directory path for a given scope.
39
+ *
40
+ * @param scope - Installation scope (global or project)
41
+ * @param projectRoot - Absolute path to project root (required for project scope)
42
+ * @returns Absolute path to the lockfile directory
43
+ */
44
+ export function getLockfileDir(scope, projectRoot) {
45
+ return path.dirname(getLockfilePath(scope, projectRoot));
46
+ }
47
+ /**
48
+ * Ensure the lockfile directory exists for a given scope.
49
+ *
50
+ * @param scope - Installation scope (global or project)
51
+ * @param projectRoot - Absolute path to project root (required for project scope)
52
+ */
53
+ export async function ensureLockfileDir(scope, projectRoot) {
54
+ const lockfileDir = getLockfileDir(scope, projectRoot);
55
+ await fs.mkdir(lockfileDir, { recursive: true });
56
+ }
57
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lockfile/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QACrE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAwB,EACxB,WAAoB;IAEpB,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED,gBAAgB;IAChB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,EAAE,yBAAyB,CAAC,CAAC;AACjF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAwB,EACxB,WAAoB;IAEpB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAwB,EACxB,WAAoB;IAEpB,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Lockfile write operations.
3
+ *
4
+ * Provides functionality to write and update the kits lockfile.
5
+ */
6
+ import type { InstallationScope } from "../core/types.js";
7
+ import type { KitsLockfile } from "./types.js";
8
+ /**
9
+ * Error thrown when lockfile write fails.
10
+ */
11
+ export declare class LockfileWriteError extends Error {
12
+ readonly errorCause?: unknown;
13
+ constructor(message: string, cause?: unknown);
14
+ }
15
+ /**
16
+ * Write the kits lockfile to disk.
17
+ *
18
+ * Creates the lockfile directory if it doesn't exist.
19
+ * Updates the lastUpdated timestamp automatically.
20
+ * Ensures the scope field matches the write location.
21
+ *
22
+ * @param lockfile - The lockfile to write
23
+ * @param scope - Installation scope (global or project), defaults to lockfile.scope
24
+ * @param projectRoot - Absolute path to project root (required for project scope)
25
+ * @throws LockfileWriteError if writing fails
26
+ */
27
+ export declare function writeLockfile(lockfile: KitsLockfile, scope?: InstallationScope, projectRoot?: string): Promise<void>;
28
+ /**
29
+ * Get the expanded lockfile path for a given scope.
30
+ *
31
+ * @param scope - Installation scope (global or project), defaults to global
32
+ * @param projectRoot - Absolute path to project root (required for project scope)
33
+ * @returns The absolute path to the lockfile file
34
+ */
35
+ export declare function getLockfilePathForScope(scope?: InstallationScope, projectRoot?: string): string;
36
+ /**
37
+ * Get the lockfile directory path for a given scope.
38
+ *
39
+ * @param scope - Installation scope (global or project), defaults to global
40
+ * @param projectRoot - Absolute path to project root (required for project scope)
41
+ * @returns The absolute path to the lockfile directory
42
+ */
43
+ export declare function getLockfileDirForScope(scope?: InstallationScope, projectRoot?: string): string;
44
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/lockfile/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,iBAAiB,EACzB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAER"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Lockfile write operations.
3
+ *
4
+ * Provides functionality to write and update the kits lockfile.
5
+ */
6
+ import fs from "node:fs/promises";
7
+ import { getLockfilePath, getLockfileDir, ensureLockfileDir } from "./utils.js";
8
+ /**
9
+ * Error thrown when lockfile write fails.
10
+ */
11
+ export class LockfileWriteError extends Error {
12
+ errorCause;
13
+ constructor(message, cause) {
14
+ super(message);
15
+ this.name = "LockfileWriteError";
16
+ this.errorCause = cause;
17
+ }
18
+ }
19
+ /**
20
+ * Write the kits lockfile to disk.
21
+ *
22
+ * Creates the lockfile directory if it doesn't exist.
23
+ * Updates the lastUpdated timestamp automatically.
24
+ * Ensures the scope field matches the write location.
25
+ *
26
+ * @param lockfile - The lockfile to write
27
+ * @param scope - Installation scope (global or project), defaults to lockfile.scope
28
+ * @param projectRoot - Absolute path to project root (required for project scope)
29
+ * @throws LockfileWriteError if writing fails
30
+ */
31
+ export async function writeLockfile(lockfile, scope, projectRoot) {
32
+ // Use provided scope or fall back to lockfile's scope
33
+ const effectiveScope = scope ?? lockfile.scope;
34
+ const lockfilePath = getLockfilePath(effectiveScope, projectRoot);
35
+ try {
36
+ // Ensure directory exists
37
+ await ensureLockfileDir(effectiveScope, projectRoot);
38
+ // Update timestamp
39
+ lockfile.lastUpdated = new Date().toISOString();
40
+ // Ensure scope field is set correctly
41
+ lockfile.scope = effectiveScope;
42
+ // Set or clear projectRoot based on scope
43
+ if (effectiveScope === "project" && projectRoot) {
44
+ lockfile.projectRoot = projectRoot;
45
+ }
46
+ else if (effectiveScope === "global") {
47
+ delete lockfile.projectRoot;
48
+ }
49
+ // Write lockfile with pretty formatting
50
+ const content = JSON.stringify(lockfile, null, 2);
51
+ await fs.writeFile(lockfilePath, content, "utf-8");
52
+ }
53
+ catch (error) {
54
+ throw new LockfileWriteError(`Failed to write lockfile to ${lockfilePath}`, error);
55
+ }
56
+ }
57
+ /**
58
+ * Get the expanded lockfile path for a given scope.
59
+ *
60
+ * @param scope - Installation scope (global or project), defaults to global
61
+ * @param projectRoot - Absolute path to project root (required for project scope)
62
+ * @returns The absolute path to the lockfile file
63
+ */
64
+ export function getLockfilePathForScope(scope = "global", projectRoot) {
65
+ return getLockfilePath(scope, projectRoot);
66
+ }
67
+ /**
68
+ * Get the lockfile directory path for a given scope.
69
+ *
70
+ * @param scope - Installation scope (global or project), defaults to global
71
+ * @param projectRoot - Absolute path to project root (required for project scope)
72
+ * @returns The absolute path to the lockfile directory
73
+ */
74
+ export function getLockfileDirForScope(scope = "global", projectRoot) {
75
+ return getLockfileDir(scope, projectRoot);
76
+ }
77
+ //# sourceMappingURL=write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/lockfile/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIlC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEhF;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,UAAU,CAAW;IAE9B,YAAY,OAAe,EAAE,KAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAsB,EACtB,KAAyB,EACzB,WAAoB;IAEpB,sDAAsD;IACtD,MAAM,cAAc,GAAG,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC;IAC/C,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAElE,IAAI,CAAC;QACH,0BAA0B;QAC1B,MAAM,iBAAiB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAErD,mBAAmB;QACnB,QAAQ,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAEhD,sCAAsC;QACtC,QAAQ,CAAC,KAAK,GAAG,cAAc,CAAC;QAEhC,0CAA0C;QAC1C,IAAI,cAAc,KAAK,SAAS,IAAI,WAAW,EAAE,CAAC;YAChD,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;QACrC,CAAC;aAAM,IAAI,cAAc,KAAK,QAAQ,EAAE,CAAC;YACvC,OAAO,QAAQ,CAAC,WAAW,CAAC;QAC9B,CAAC;QAED,wCAAwC;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClD,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,kBAAkB,CAC1B,+BAA+B,YAAY,EAAE,EAC7C,KAAK,CACN,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,OAAO,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,OAAO,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Canonical hashing for kits manifests.
3
+ */
4
+ import type { KitsManifest } from "./types.js";
5
+ export declare function canonicalizeManifest(manifest: KitsManifest): string;
6
+ export declare function hashManifest(manifest: KitsManifest): string;
7
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/manifest/hash.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAmB/C,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAGnE;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAI3D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Canonical hashing for kits manifests.
3
+ */
4
+ import crypto from "node:crypto";
5
+ function sortObject(value) {
6
+ if (Array.isArray(value)) {
7
+ return value.map((item) => sortObject(item));
8
+ }
9
+ if (!value || typeof value !== "object") {
10
+ return value;
11
+ }
12
+ const entries = Object.entries(value)
13
+ .filter(([, v]) => v !== undefined)
14
+ .sort(([a], [b]) => a.localeCompare(b));
15
+ const result = {};
16
+ for (const [key, val] of entries) {
17
+ result[key] = sortObject(val);
18
+ }
19
+ return result;
20
+ }
21
+ export function canonicalizeManifest(manifest) {
22
+ const sorted = sortObject(manifest);
23
+ return JSON.stringify(sorted);
24
+ }
25
+ export function hashManifest(manifest) {
26
+ const canonical = canonicalizeManifest(manifest);
27
+ const hash = crypto.createHash("sha256").update(canonical).digest("hex");
28
+ return `sha256:${hash}`;
29
+ }
30
+ //# sourceMappingURL=hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/manifest/hash.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAIjC,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC;SAC7D,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;SAClC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAsB;IACzD,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAiB,CAAC;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAsB;IACjD,MAAM,SAAS,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzE,OAAO,UAAU,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -1,79 +1,10 @@
1
1
  /**
2
- * Manifest module for the kit installer.
3
- *
4
- * This module handles reading, writing, and managing the installation manifest
5
- * that tracks installed kits and primitives across harnesses.
6
- */
7
- import type { HarnessName, InstallationScope, ResolvedPrimitive, KitManifest } from "../core/types.js";
8
- import type { InstalledKit } from "./types.js";
9
- export type { InstalledPrimitive, InstalledKit, HarnessInstallation, InstallationManifest, UpgradeCheck, UpgradeSummary, } from "./types.js";
10
- export { MANIFEST_VERSION, GLOBAL_MANIFEST_PATH, PROJECT_MANIFEST_DIR, PROJECT_MANIFEST_FILENAME, createEmptyManifest, } from "./types.js";
11
- export { readManifest, getOrCreateManifest, ManifestReadError } from "./read.js";
12
- export { writeManifest, ManifestWriteError } from "./write.js";
13
- export { getManifestPathForScope, getManifestDirForScope } from "./write.js";
14
- export { checkForUpgrades, checkForUpgradesInScope, createUpgradeSummary, } from "./upgrade-check.js";
15
- export { expandPath, getManifestPath, getManifestDir, ensureManifestDir, } from "./utils.js";
16
- /**
17
- * Record a kit installation in the manifest.
18
- *
19
- * @param harness - The harness name
20
- * @param kit - The kit definition
21
- * @param primitives - The resolved primitives that were installed
22
- * @param source - The source repository
23
- * @param scope - Installation scope (global or project)
24
- * @param projectRoot - Absolute path to project root (required for project scope)
25
- */
26
- export declare function recordInstallation(harness: HarnessName, kit: KitManifest, primitives: ResolvedPrimitive[], source: string, scope?: InstallationScope, projectRoot?: string): Promise<void>;
27
- /**
28
- * Remove a kit installation from the manifest.
29
- *
30
- * @param harness - The harness name
31
- * @param kitName - The kit name to remove
32
- * @param scope - Installation scope (global or project)
33
- * @param projectRoot - Absolute path to project root (required for project scope)
34
- * @returns The removed kit info or null if not found
35
- */
36
- export declare function removeInstallation(harness: HarnessName, kitName: string, scope?: InstallationScope, projectRoot?: string): Promise<InstalledKit | null>;
37
- /**
38
- * Get all installed kits, optionally filtered by harness.
39
- *
40
- * @param scope - Installation scope (global or project)
41
- * @param projectRoot - Absolute path to project root (required for project scope)
42
- * @param harness - Optional harness name to filter by
43
- * @returns Array of installed kit info with harness context
44
- */
45
- export declare function getInstalledKits(scope?: InstallationScope, projectRoot?: string, harness?: HarnessName): Promise<Array<{
46
- harness: HarnessName;
47
- kitName: string;
48
- kit: InstalledKit;
49
- }>>;
50
- /**
51
- * Check if a kit is installed in any harness.
52
- *
53
- * @param kitName - The kit name to check
54
- * @param scope - Installation scope (global or project)
55
- * @param projectRoot - Absolute path to project root (required for project scope)
56
- * @returns True if the kit is installed somewhere
57
- */
58
- export declare function isKitInstalled(kitName: string, scope?: InstallationScope, projectRoot?: string): Promise<boolean>;
59
- /**
60
- * Check if a kit is installed in a specific harness.
61
- *
62
- * @param harness - The harness name
63
- * @param kitName - The kit name to check
64
- * @param scope - Installation scope (global or project)
65
- * @param projectRoot - Absolute path to project root (required for project scope)
66
- * @returns True if the kit is installed in the harness
67
- */
68
- export declare function isKitInstalledInHarness(harness: HarnessName, kitName: string, scope?: InstallationScope, projectRoot?: string): Promise<boolean>;
69
- /**
70
- * Get a specific installed kit.
71
- *
72
- * @param harness - The harness name
73
- * @param kitName - The kit name
74
- * @param scope - Installation scope (global or project)
75
- * @param projectRoot - Absolute path to project root (required for project scope)
76
- * @returns The installed kit or null if not found
77
- */
78
- export declare function getInstalledKit(harness: HarnessName, kitName: string, scope?: InstallationScope, projectRoot?: string): Promise<InstalledKit | null>;
2
+ * Kits manifest (intent) module.
3
+ */
4
+ export type { KitsManifest, KitsManifestSource, ManifestCompatibility } from "./types.js";
5
+ export { MANIFEST_SCHEMA_VERSION, GLOBAL_MANIFEST_PATH, PROJECT_MANIFEST_DIR, PROJECT_MANIFEST_FILENAME, createEmptyManifest, } from "./types.js";
6
+ export { ManifestReadError, readManifest, readManifestFile } from "./read.js";
7
+ export { ManifestWriteError, writeManifest, getManifestPathForScope, getManifestDirForScope } from "./write.js";
8
+ export { expandPath, getManifestPath, getManifestDir, ensureManifestDir } from "./utils.js";
9
+ export { canonicalizeManifest, hashManifest } from "./hash.js";
79
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,YAAY,CAAC;AAKnE,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,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AAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAY9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -1,200 +1,9 @@
1
1
  /**
2
- * Manifest module for the kit installer.
3
- *
4
- * This module handles reading, writing, and managing the installation manifest
5
- * that tracks installed kits and primitives across harnesses.
2
+ * Kits manifest (intent) module.
6
3
  */
7
- import { readManifest, getOrCreateManifest } from "./read.js";
8
- import { writeManifest } from "./write.js";
9
- export { MANIFEST_VERSION, GLOBAL_MANIFEST_PATH, PROJECT_MANIFEST_DIR, PROJECT_MANIFEST_FILENAME, createEmptyManifest, } from "./types.js";
10
- // Re-export read functions
11
- export { readManifest, getOrCreateManifest, ManifestReadError } from "./read.js";
12
- // Re-export write functions
13
- export { writeManifest, ManifestWriteError } from "./write.js";
14
- // Re-export scope-aware path functions (renamed for clarity)
15
- export { getManifestPathForScope, getManifestDirForScope } from "./write.js";
16
- // Re-export upgrade check functions
17
- export { checkForUpgrades, checkForUpgradesInScope, createUpgradeSummary, } from "./upgrade-check.js";
18
- // Re-export utils
19
- export { expandPath, getManifestPath, getManifestDir, ensureManifestDir, } from "./utils.js";
20
- /**
21
- * Record a kit installation in the manifest.
22
- *
23
- * @param harness - The harness name
24
- * @param kit - The kit definition
25
- * @param primitives - The resolved primitives that were installed
26
- * @param source - The source repository
27
- * @param scope - Installation scope (global or project)
28
- * @param projectRoot - Absolute path to project root (required for project scope)
29
- */
30
- export async function recordInstallation(harness, kit, primitives, source, scope = "global", projectRoot) {
31
- const manifest = await getOrCreateManifest(scope, projectRoot);
32
- // Ensure harness entry exists
33
- if (!manifest.harnesses[harness]) {
34
- manifest.harnesses[harness] = { kits: {} };
35
- }
36
- // Convert resolved primitives to installed primitives
37
- const installedPrimitives = primitives.map((p) => {
38
- const installed = {
39
- name: p.name,
40
- type: p.type,
41
- namespacedName: `${kit.name}.${p.name}`,
42
- isInline: p.isInline,
43
- installedPath: p.sourcePath,
44
- };
45
- // Only add optional fields if they have values
46
- if (p.resolvedVersion) {
47
- installed.version = p.resolvedVersion;
48
- }
49
- const versionSpec = p.ref ? extractVersionSpec(p.ref) : undefined;
50
- if (versionSpec) {
51
- installed.versionSpec = versionSpec;
52
- }
53
- return installed;
54
- });
55
- // Record the kit installation
56
- const harnessEntry = manifest.harnesses[harness];
57
- if (harnessEntry) {
58
- harnessEntry.kits[kit.name] = {
59
- version: kit.version,
60
- installedAt: new Date().toISOString(),
61
- source,
62
- primitives: installedPrimitives,
63
- };
64
- }
65
- // Update source
66
- manifest.source = source;
67
- await writeManifest(manifest, scope, projectRoot);
68
- }
69
- /**
70
- * Remove a kit installation from the manifest.
71
- *
72
- * @param harness - The harness name
73
- * @param kitName - The kit name to remove
74
- * @param scope - Installation scope (global or project)
75
- * @param projectRoot - Absolute path to project root (required for project scope)
76
- * @returns The removed kit info or null if not found
77
- */
78
- export async function removeInstallation(harness, kitName, scope = "global", projectRoot) {
79
- const manifest = await readManifest(scope, projectRoot);
80
- if (!manifest) {
81
- return null;
82
- }
83
- const harnessEntry = manifest.harnesses[harness];
84
- if (!harnessEntry) {
85
- return null;
86
- }
87
- const kit = harnessEntry.kits[kitName];
88
- if (!kit) {
89
- return null;
90
- }
91
- // Remove the kit
92
- delete harnessEntry.kits[kitName];
93
- // Clean up empty harness entries
94
- if (Object.keys(harnessEntry.kits).length === 0) {
95
- delete manifest.harnesses[harness];
96
- }
97
- await writeManifest(manifest, scope, projectRoot);
98
- return kit;
99
- }
100
- /**
101
- * Get all installed kits, optionally filtered by harness.
102
- *
103
- * @param scope - Installation scope (global or project)
104
- * @param projectRoot - Absolute path to project root (required for project scope)
105
- * @param harness - Optional harness name to filter by
106
- * @returns Array of installed kit info with harness context
107
- */
108
- export async function getInstalledKits(scope = "global", projectRoot, harness) {
109
- const manifest = await readManifest(scope, projectRoot);
110
- if (!manifest) {
111
- return [];
112
- }
113
- const result = [];
114
- for (const [harnessName, harnessEntry] of Object.entries(manifest.harnesses)) {
115
- if (harness && harnessName !== harness) {
116
- continue;
117
- }
118
- if (harnessEntry) {
119
- for (const [kitName, kit] of Object.entries(harnessEntry.kits)) {
120
- result.push({
121
- harness: harnessName,
122
- kitName,
123
- kit,
124
- });
125
- }
126
- }
127
- }
128
- return result;
129
- }
130
- /**
131
- * Check if a kit is installed in any harness.
132
- *
133
- * @param kitName - The kit name to check
134
- * @param scope - Installation scope (global or project)
135
- * @param projectRoot - Absolute path to project root (required for project scope)
136
- * @returns True if the kit is installed somewhere
137
- */
138
- export async function isKitInstalled(kitName, scope = "global", projectRoot) {
139
- const manifest = await readManifest(scope, projectRoot);
140
- if (!manifest) {
141
- return false;
142
- }
143
- for (const harness of Object.values(manifest.harnesses)) {
144
- if (harness && kitName in harness.kits) {
145
- return true;
146
- }
147
- }
148
- return false;
149
- }
150
- /**
151
- * Check if a kit is installed in a specific harness.
152
- *
153
- * @param harness - The harness name
154
- * @param kitName - The kit name to check
155
- * @param scope - Installation scope (global or project)
156
- * @param projectRoot - Absolute path to project root (required for project scope)
157
- * @returns True if the kit is installed in the harness
158
- */
159
- export async function isKitInstalledInHarness(harness, kitName, scope = "global", projectRoot) {
160
- const manifest = await readManifest(scope, projectRoot);
161
- if (!manifest) {
162
- return false;
163
- }
164
- const harnessEntry = manifest.harnesses[harness];
165
- return harnessEntry ? kitName in harnessEntry.kits : false;
166
- }
167
- /**
168
- * Get a specific installed kit.
169
- *
170
- * @param harness - The harness name
171
- * @param kitName - The kit name
172
- * @param scope - Installation scope (global or project)
173
- * @param projectRoot - Absolute path to project root (required for project scope)
174
- * @returns The installed kit or null if not found
175
- */
176
- export async function getInstalledKit(harness, kitName, scope = "global", projectRoot) {
177
- const manifest = await readManifest(scope, projectRoot);
178
- if (!manifest) {
179
- return null;
180
- }
181
- const harnessEntry = manifest.harnesses[harness];
182
- if (!harnessEntry) {
183
- return null;
184
- }
185
- return harnessEntry.kits[kitName] ?? null;
186
- }
187
- /**
188
- * Extract version spec from a ref string.
189
- *
190
- * @param ref - The ref string (e.g., "tf-plan@^1.0.0")
191
- * @returns The version spec portion or undefined
192
- */
193
- function extractVersionSpec(ref) {
194
- const atIndex = ref.indexOf("@");
195
- if (atIndex === -1) {
196
- return undefined;
197
- }
198
- return ref.slice(atIndex + 1);
199
- }
4
+ export { MANIFEST_SCHEMA_VERSION, GLOBAL_MANIFEST_PATH, PROJECT_MANIFEST_DIR, PROJECT_MANIFEST_FILENAME, createEmptyManifest, } from "./types.js";
5
+ export { ManifestReadError, readManifest, readManifestFile } from "./read.js";
6
+ export { ManifestWriteError, writeManifest, getManifestPathForScope, getManifestDirForScope } from "./write.js";
7
+ export { expandPath, getManifestPath, getManifestDir, ensureManifestDir } from "./utils.js";
8
+ export { canonicalizeManifest, hashManifest } from "./hash.js";
200
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAY3C,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,2BAA2B;AAC3B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEjF,4BAA4B;AAC5B,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/D,6DAA6D;AAC7D,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAE7E,oCAAoC;AACpC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,kBAAkB;AAClB,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAoB,EACpB,GAAgB,EAChB,UAA+B,EAC/B,MAAc,EACd,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAE/D,8BAA8B;IAC9B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE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U,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -1,32 +1,12 @@
1
1
  /**
2
- * Manifest read operations.
3
- *
4
- * Provides functionality to read and validate the installation manifest.
2
+ * Kits manifest (intent) read operations.
5
3
  */
6
4
  import type { InstallationScope } from "../core/types.js";
7
- import type { InstallationManifest } from "./types.js";
8
- /**
9
- * Error thrown when manifest read fails.
10
- */
5
+ import type { KitsManifest } from "./types.js";
11
6
  export declare class ManifestReadError extends Error {
12
7
  readonly errorCause?: unknown;
13
8
  constructor(message: string, cause?: unknown);
14
9
  }
15
- /**
16
- * Read the installation manifest from disk.
17
- *
18
- * @param scope - Installation scope (global or project)
19
- * @param projectRoot - Absolute path to project root (required for project scope)
20
- * @returns The manifest or null if it doesn't exist
21
- * @throws ManifestReadError if the file exists but cannot be read or parsed
22
- */
23
- export declare function readManifest(scope?: InstallationScope, projectRoot?: string): Promise<InstallationManifest | null>;
24
- /**
25
- * Get or create the installation manifest.
26
- *
27
- * @param scope - Installation scope (global or project)
28
- * @param projectRoot - Absolute path to project root (required for project scope)
29
- * @returns The existing manifest or a new empty manifest
30
- */
31
- export declare function getOrCreateManifest(scope?: InstallationScope, projectRoot?: string): Promise<InstallationManifest>;
10
+ export declare function readManifestFile(manifestPath: string): Promise<KitsManifest>;
11
+ export declare function readManifest(scope?: InstallationScope, projectRoot?: string): Promise<KitsManifest | null>;
32
12
  //# sourceMappingURL=read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/manifest/read.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIvD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAuCtC;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAG/B"}
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/manifest/read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAED,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA0BlF;AAED,wBAAsB,YAAY,CAChC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAc9B"}