@hashicorp/kits 0.1.4 → 0.1.6

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 (142) hide show
  1. package/README.md +175 -33
  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.d.ts.map +1 -1
  6. package/dist/adapters/claude-code/index.js +23 -9
  7. package/dist/adapters/claude-code/index.js.map +1 -1
  8. package/dist/adapters/claude-code/installer.d.ts +1 -4
  9. package/dist/adapters/claude-code/installer.d.ts.map +1 -1
  10. package/dist/adapters/claude-code/installer.js +17 -16
  11. package/dist/adapters/claude-code/installer.js.map +1 -1
  12. package/dist/adapters/codex/index.d.ts +1 -1
  13. package/dist/adapters/codex/index.js +1 -1
  14. package/dist/adapters/gemini-cli/index.d.ts +1 -1
  15. package/dist/adapters/gemini-cli/index.js +1 -1
  16. package/dist/adapters/gemini-cli/installer.d.ts +1 -4
  17. package/dist/adapters/gemini-cli/installer.d.ts.map +1 -1
  18. package/dist/adapters/gemini-cli/installer.js +15 -15
  19. package/dist/adapters/gemini-cli/installer.js.map +1 -1
  20. package/dist/adapters/github-copilot/index.d.ts +1 -1
  21. package/dist/adapters/github-copilot/index.js +1 -1
  22. package/dist/adapters/opencode/index.d.ts +1 -1
  23. package/dist/adapters/opencode/index.js +1 -1
  24. package/dist/adapters/opencode/installer.d.ts.map +1 -1
  25. package/dist/adapters/opencode/installer.js +19 -14
  26. package/dist/adapters/opencode/installer.js.map +1 -1
  27. package/dist/cli/index.d.ts.map +1 -1
  28. package/dist/cli/index.js +29 -9
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/cli/install.d.ts.map +1 -1
  31. package/dist/cli/install.js +820 -161
  32. package/dist/cli/install.js.map +1 -1
  33. package/dist/cli/list.d.ts.map +1 -1
  34. package/dist/cli/list.js +8 -6
  35. package/dist/cli/list.js.map +1 -1
  36. package/dist/cli/types.d.ts +17 -0
  37. package/dist/cli/types.d.ts.map +1 -1
  38. package/dist/cli/types.js +1 -0
  39. package/dist/cli/types.js.map +1 -1
  40. package/dist/cli/uninstall.d.ts.map +1 -1
  41. package/dist/cli/uninstall.js +300 -38
  42. package/dist/cli/uninstall.js.map +1 -1
  43. package/dist/cli/upgrade.d.ts.map +1 -1
  44. package/dist/cli/upgrade.js +334 -105
  45. package/dist/cli/upgrade.js.map +1 -1
  46. package/dist/cli/validate.js +5 -5
  47. package/dist/cli/validate.js.map +1 -1
  48. package/dist/core/types.d.ts +6 -9
  49. package/dist/core/types.d.ts.map +1 -1
  50. package/dist/core/upgrade-executor.d.ts +7 -7
  51. package/dist/core/upgrade-executor.d.ts.map +1 -1
  52. package/dist/core/upgrade-executor.js +17 -17
  53. package/dist/core/upgrade-executor.js.map +1 -1
  54. package/dist/discovery/kit-scanner.d.ts +3 -3
  55. package/dist/discovery/kit-scanner.js +17 -17
  56. package/dist/discovery/kit-scanner.js.map +1 -1
  57. package/dist/discovery/types.d.ts +1 -1
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +3 -1
  61. package/dist/index.js.map +1 -1
  62. package/dist/lockfile/index.d.ts +79 -0
  63. package/dist/lockfile/index.d.ts.map +1 -0
  64. package/dist/lockfile/index.js +203 -0
  65. package/dist/lockfile/index.js.map +1 -0
  66. package/dist/lockfile/read.d.ts +32 -0
  67. package/dist/lockfile/read.d.ts.map +1 -0
  68. package/dist/lockfile/read.js +88 -0
  69. package/dist/lockfile/read.js.map +1 -0
  70. package/dist/lockfile/types.d.ts +126 -0
  71. package/dist/lockfile/types.d.ts.map +1 -0
  72. package/dist/lockfile/types.js +44 -0
  73. package/dist/lockfile/types.js.map +1 -0
  74. package/dist/{manifest → lockfile}/upgrade-check.d.ts +5 -5
  75. package/dist/lockfile/upgrade-check.d.ts.map +1 -0
  76. package/dist/{manifest → lockfile}/upgrade-check.js +11 -9
  77. package/dist/lockfile/upgrade-check.js.map +1 -0
  78. package/dist/lockfile/utils.d.ts +35 -0
  79. package/dist/lockfile/utils.d.ts.map +1 -0
  80. package/dist/lockfile/utils.js +57 -0
  81. package/dist/lockfile/utils.js.map +1 -0
  82. package/dist/lockfile/write.d.ts +44 -0
  83. package/dist/lockfile/write.d.ts.map +1 -0
  84. package/dist/lockfile/write.js +77 -0
  85. package/dist/lockfile/write.js.map +1 -0
  86. package/dist/manifest/hash.d.ts +7 -0
  87. package/dist/manifest/hash.d.ts.map +1 -0
  88. package/dist/manifest/hash.js +30 -0
  89. package/dist/manifest/hash.js.map +1 -0
  90. package/dist/manifest/index.d.ts +8 -77
  91. package/dist/manifest/index.d.ts.map +1 -1
  92. package/dist/manifest/index.js +6 -197
  93. package/dist/manifest/index.js.map +1 -1
  94. package/dist/manifest/read.d.ts +4 -24
  95. package/dist/manifest/read.d.ts.map +1 -1
  96. package/dist/manifest/read.js +22 -46
  97. package/dist/manifest/read.js.map +1 -1
  98. package/dist/manifest/types.d.ts +17 -109
  99. package/dist/manifest/types.d.ts.map +1 -1
  100. package/dist/manifest/types.js +8 -37
  101. package/dist/manifest/types.js.map +1 -1
  102. package/dist/manifest/utils.d.ts +1 -27
  103. package/dist/manifest/utils.d.ts.map +1 -1
  104. package/dist/manifest/utils.js +1 -28
  105. package/dist/manifest/utils.js.map +1 -1
  106. package/dist/manifest/write.d.ts +3 -34
  107. package/dist/manifest/write.d.ts.map +1 -1
  108. package/dist/manifest/write.js +5 -45
  109. package/dist/manifest/write.js.map +1 -1
  110. package/dist/resolution/index.d.ts +7 -7
  111. package/dist/resolution/index.d.ts.map +1 -1
  112. package/dist/resolution/index.js +29 -19
  113. package/dist/resolution/index.js.map +1 -1
  114. package/dist/resolution/multi-kit-resolver.d.ts +2 -2
  115. package/dist/resolution/multi-kit-resolver.js +2 -2
  116. package/dist/resolution/primitives-registry.d.ts +1 -1
  117. package/dist/resolution/primitives-registry.js +2 -2
  118. package/dist/resolution/primitives-registry.js.map +1 -1
  119. package/dist/resolution/types.d.ts +1 -1
  120. package/dist/resolution/types.js +1 -1
  121. package/dist/tui/types.d.ts +1 -0
  122. package/dist/tui/types.d.ts.map +1 -1
  123. package/dist/tui/upgrade-select.d.ts +1 -1
  124. package/dist/tui/upgrade-select.d.ts.map +1 -1
  125. package/dist/tui/upgrade-select.js +15 -4
  126. package/dist/tui/upgrade-select.js.map +1 -1
  127. package/dist/validation/validate-hooks.d.ts.map +1 -1
  128. package/dist/validation/validate-hooks.js +2 -1
  129. package/dist/validation/validate-hooks.js.map +1 -1
  130. package/dist/validation/validate-kits.d.ts +1 -1
  131. package/dist/validation/validate-kits.js +5 -5
  132. package/dist/validation/validate-kits.js.map +1 -1
  133. package/package.json +2 -1
  134. package/schemas/examples/hook-binding-valid.json +1 -2
  135. package/schemas/hook-binding.schema.json +5 -4
  136. package/schemas/kit.schema.json +5 -4
  137. package/schemas/{manifest.schema.json → kits-lock.schema.json} +34 -8
  138. package/schemas/kits-manifest.schema.json +95 -0
  139. package/schemas/{kits.schema.json → kits-registry.schema.json} +3 -3
  140. package/schemas/{primitives.schema.json → primitives-registry.schema.json} +2 -2
  141. package/dist/manifest/upgrade-check.d.ts.map +0 -1
  142. package/dist/manifest/upgrade-check.js.map +0 -1
@@ -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","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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"}
@@ -1,14 +1,9 @@
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 fs from "node:fs/promises";
7
- import { MANIFEST_VERSION, createEmptyManifest } from "./types.js";
5
+ import { MANIFEST_SCHEMA_VERSION } from "./types.js";
8
6
  import { getManifestPath } from "./utils.js";
9
- /**
10
- * Error thrown when manifest read fails.
11
- */
12
7
  export class ManifestReadError extends Error {
13
8
  errorCause;
14
9
  constructor(message, cause) {
@@ -17,70 +12,51 @@ export class ManifestReadError extends Error {
17
12
  this.errorCause = cause;
18
13
  }
19
14
  }
20
- /**
21
- * Read the installation manifest from disk.
22
- *
23
- * @param scope - Installation scope (global or project)
24
- * @param projectRoot - Absolute path to project root (required for project scope)
25
- * @returns The manifest or null if it doesn't exist
26
- * @throws ManifestReadError if the file exists but cannot be read or parsed
27
- */
28
- export async function readManifest(scope = "global", projectRoot) {
29
- const manifestPath = getManifestPath(scope, projectRoot);
15
+ export async function readManifestFile(manifestPath) {
30
16
  try {
31
17
  const content = await fs.readFile(manifestPath, "utf-8");
32
18
  const manifest = JSON.parse(content);
33
- // Validate manifest version
34
19
  if (!isValidManifest(manifest)) {
35
- throw new ManifestReadError(`Invalid manifest format at ${manifestPath}; expected version ${MANIFEST_VERSION}`);
20
+ throw new ManifestReadError(`Invalid kits manifest format at ${manifestPath}; expected schemaVersion ${MANIFEST_SCHEMA_VERSION}`);
36
21
  }
37
22
  return manifest;
38
23
  }
39
24
  catch (error) {
40
- const nodeError = error;
41
- // File doesn't exist - return null
42
- if (nodeError.code === "ENOENT") {
43
- return null;
44
- }
45
- // Re-throw ManifestReadError as-is
46
25
  if (error instanceof ManifestReadError) {
47
26
  throw error;
48
27
  }
49
- // JSON parse errors
50
28
  if (error instanceof SyntaxError) {
51
- throw new ManifestReadError(`Failed to parse manifest at ${manifestPath}; invalid JSON`, error);
29
+ throw new ManifestReadError(`Failed to parse kits manifest at ${manifestPath}; invalid JSON`, error);
52
30
  }
53
- // Other errors
54
- throw new ManifestReadError(`Failed to read manifest at ${manifestPath}`, error);
31
+ throw new ManifestReadError(`Failed to read kits manifest at ${manifestPath}`, error);
55
32
  }
56
33
  }
57
- /**
58
- * Get or create the installation manifest.
59
- *
60
- * @param scope - Installation scope (global or project)
61
- * @param projectRoot - Absolute path to project root (required for project scope)
62
- * @returns The existing manifest or a new empty manifest
63
- */
64
- export async function getOrCreateManifest(scope = "global", projectRoot) {
65
- const manifest = await readManifest(scope, projectRoot);
66
- return manifest ?? createEmptyManifest(scope, projectRoot);
34
+ export async function readManifest(scope = "global", projectRoot) {
35
+ const manifestPath = getManifestPath(scope, projectRoot);
36
+ try {
37
+ return await readManifestFile(manifestPath);
38
+ }
39
+ catch (error) {
40
+ const cause = error instanceof ManifestReadError && error.errorCause ? error.errorCause : error;
41
+ const nodeError = cause;
42
+ if (nodeError?.code === "ENOENT") {
43
+ return null;
44
+ }
45
+ throw error;
46
+ }
67
47
  }
68
- /**
69
- * Validates that a manifest has the expected structure.
70
- */
71
48
  function isValidManifest(manifest) {
72
49
  if (!manifest || typeof manifest !== "object") {
73
50
  return false;
74
51
  }
75
52
  const m = manifest;
76
- // Check required fields
77
- if (typeof m["version"] !== "string") {
53
+ if (typeof m["schemaVersion"] !== "string") {
78
54
  return false;
79
55
  }
80
- if (typeof m["lastUpdated"] !== "string") {
56
+ if (typeof m["scope"] !== "string") {
81
57
  return false;
82
58
  }
83
- if (!m["harnesses"] || typeof m["harnesses"] !== "object") {
59
+ if (!Array.isArray(m["sources"])) {
84
60
  return false;
85
61
  }
86
62
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/manifest/read.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIlC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,UAAU,CAAW;IAE9B,YAAY,OAAe,EAAE,KAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,MAAM,YAAY,GAAG,eAA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,CAAC,CAAC,eAAe,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,119 +1,27 @@
1
1
  /**
2
- * Installation manifest type definitions.
3
- *
4
- * The manifest tracks all installed kits and primitives across harnesses,
5
- * enabling uninstallation, upgrade checking, and conflict detection.
6
- */
7
- import type { PrimitiveType, HarnessName, InstallationScope } from "../core/types.js";
8
- /**
9
- * Version of the manifest schema.
10
- */
11
- export declare const MANIFEST_VERSION: "1.0";
12
- /**
13
- * Global manifest file location.
14
- * User-level installation, available in all projects.
15
- */
16
- export declare const GLOBAL_MANIFEST_PATH = "~/.agents/manifest.json";
17
- /**
18
- * Project manifest directory name.
19
- * Repository-level installation, version-controllable.
2
+ * Kits manifest (intent) type definitions.
20
3
  */
4
+ import type { HarnessName, InstallationScope } from "../core/types.js";
5
+ export declare const MANIFEST_SCHEMA_VERSION: "1.0.0";
6
+ export declare const GLOBAL_MANIFEST_PATH = "~/.agents/kits.json";
21
7
  export declare const PROJECT_MANIFEST_DIR = ".agents";
22
- /**
23
- * Project manifest file name within PROJECT_MANIFEST_DIR.
24
- */
25
- export declare const PROJECT_MANIFEST_FILENAME = "manifest.json";
26
- /**
27
- * Information about an installed primitive.
28
- */
29
- export interface InstalledPrimitive {
8
+ export declare const PROJECT_MANIFEST_FILENAME = "kits.json";
9
+ export type ManifestCompatibility = "strict" | "compatible-only";
10
+ export interface KitsManifestKit {
30
11
  name: string;
31
- type: PrimitiveType;
32
- namespacedName: string;
33
- version?: string;
34
- versionSpec?: string;
35
- isInline: boolean;
36
- installedPath: string;
37
- instanceName?: string;
38
- configHash?: string;
12
+ installAs?: string;
39
13
  }
40
- /**
41
- * Information about an installed kit.
42
- */
43
- export interface InstalledKit {
44
- version: string;
45
- installedAt: string;
14
+ export interface KitsManifestSource {
46
15
  source: string;
47
- primitives: InstalledPrimitive[];
16
+ kits?: Array<string | KitsManifestKit>;
48
17
  }
49
- /**
50
- * Harness installation record.
51
- */
52
- export interface HarnessInstallation {
53
- kits: Record<string, InstalledKit>;
54
- mcpInstances?: Record<string, McpInstance>;
55
- hookInstances?: Record<string, HookInstance>;
56
- }
57
- /**
58
- * MCP server instance record.
59
- */
60
- export interface McpInstance {
61
- version: string;
62
- configHash: string;
63
- usedBy: string[];
64
- sourcePrimitive: string;
65
- installedAt: string;
66
- }
67
- /**
68
- * Hook program instance record.
69
- */
70
- export interface HookInstance {
71
- version: string;
72
- configHash: string;
73
- usedBy: string[];
74
- sourcePrimitive: string;
75
- installedAt: string;
76
- }
77
- /**
78
- * Installation manifest structure.
79
- */
80
- export interface InstallationManifest {
81
- version: typeof MANIFEST_VERSION;
18
+ export interface KitsManifest {
19
+ schemaVersion: string;
82
20
  scope: InstallationScope;
83
- projectRoot?: string;
84
- lastUpdated: string;
85
- source?: string;
86
- harnesses: Partial<Record<HarnessName, HarnessInstallation>>;
21
+ sources: KitsManifestSource[];
22
+ harnesses?: HarnessName[];
23
+ compatibility?: ManifestCompatibility;
24
+ mcpInstanceOverrides?: Record<string, Record<string, string>>;
87
25
  }
88
- /**
89
- * Available upgrade information.
90
- */
91
- export interface UpgradeCheck {
92
- kit: string;
93
- harness: HarnessName;
94
- primitive: string;
95
- type: PrimitiveType;
96
- currentVersion: string;
97
- availableVersion: string;
98
- versionSpec: string;
99
- breaking: boolean;
100
- }
101
- /**
102
- * Summary of available upgrades.
103
- */
104
- export interface UpgradeSummary {
105
- upgrades: UpgradeCheck[];
106
- totalUpgrades: number;
107
- breakingChanges: number;
108
- affectedKits: number;
109
- affectedHarnesses: number;
110
- }
111
- /**
112
- * Creates an empty manifest for the specified scope.
113
- *
114
- * @param scope - Installation scope (global or project)
115
- * @param projectRoot - Absolute path to project root (required for project scope)
116
- * @returns Empty installation manifest
117
- */
118
- export declare function createEmptyManifest(scope?: InstallationScope, projectRoot?: string): InstallationManifest;
26
+ export declare function createEmptyManifest(scope?: InstallationScope): KitsManifest;
119
27
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/manifest/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAG,KAAc,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,kBAAkB,EAAE,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CA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"}
@@ -1,44 +1,15 @@
1
1
  /**
2
- * Installation manifest type definitions.
3
- *
4
- * The manifest tracks all installed kits and primitives across harnesses,
5
- * enabling uninstallation, upgrade checking, and conflict detection.
6
- */
7
- /**
8
- * Version of the manifest schema.
9
- */
10
- export const MANIFEST_VERSION = "1.0";
11
- /**
12
- * Global manifest file location.
13
- * User-level installation, available in all projects.
14
- */
15
- export const GLOBAL_MANIFEST_PATH = "~/.agents/manifest.json";
16
- /**
17
- * Project manifest directory name.
18
- * Repository-level installation, version-controllable.
2
+ * Kits manifest (intent) type definitions.
19
3
  */
4
+ export const MANIFEST_SCHEMA_VERSION = "1.0.0";
5
+ export const GLOBAL_MANIFEST_PATH = "~/.agents/kits.json";
20
6
  export const PROJECT_MANIFEST_DIR = ".agents";
21
- /**
22
- * Project manifest file name within PROJECT_MANIFEST_DIR.
23
- */
24
- export const PROJECT_MANIFEST_FILENAME = "manifest.json";
25
- /**
26
- * Creates an empty manifest for the specified scope.
27
- *
28
- * @param scope - Installation scope (global or project)
29
- * @param projectRoot - Absolute path to project root (required for project scope)
30
- * @returns Empty installation manifest
31
- */
32
- export function createEmptyManifest(scope = "global", projectRoot) {
33
- const manifest = {
34
- version: MANIFEST_VERSION,
7
+ export const PROJECT_MANIFEST_FILENAME = "kits.json";
8
+ export function createEmptyManifest(scope = "global") {
9
+ return {
10
+ schemaVersion: MANIFEST_SCHEMA_VERSION,
35
11
  scope,
36
- lastUpdated: new Date().toISOString(),
37
- harnesses: {},
12
+ sources: [],
38
13
  };
39
- if (scope === "project" && projectRoot) {
40
- manifest.projectRoot = projectRoot;
41
- }
42
- return manifest;
43
14
  }
44
15
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/manifest/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC;AAgGzD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,MAAM,QAAQ,GAAyB;QACrC,OAAO,EAAE,gBAAgB;QACzB,KAAK;QACL,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,SAAS,EAAE,EAAE;KACd,CAAC;IAEF,IAAI,KAAK,KAAK,SAAS,IAAI,WAAW,EAAE,CAAC;QACvC,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;IACrC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/manifest/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAC9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAuBrD,MAAM,UAAU,mBAAmB,CAAC,QAA2B,QAAQ;IACrE,OAAO;QACL,aAAa,EAAE,uBAAuB;QACtC,KAAK;QACL,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC"}
@@ -1,35 +1,9 @@
1
1
  /**
2
- * Shared utilities for the manifest module.
2
+ * Shared utilities for the kits manifest module.
3
3
  */
4
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
5
  export declare function expandPath(pathStr: string): string;
12
- /**
13
- * Get the manifest file 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 manifest file
18
- */
19
6
  export declare function getManifestPath(scope: InstallationScope, projectRoot?: string): string;
20
- /**
21
- * Get the manifest 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 manifest directory
26
- */
27
7
  export declare function getManifestDir(scope: InstallationScope, projectRoot?: string): string;
28
- /**
29
- * Ensure the manifest 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
8
  export declare function ensureManifestDir(scope: InstallationScope, projectRoot?: string): Promise<void>;
35
9
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/manifest/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"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/manifest/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO1D,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAUtF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAErF;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGrG"}