@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
@@ -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,OAA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,CAAC;QACf,MAAM,KAAK,GACT,KAAK,YAAY,iBAAiB,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;QACpF,MAAM,SAAS,GAAG,KAA8B,CAAC;QACjD,IAAI,SAAS,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,QAAiB;IACxC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,GAAG,QAAmC,CAAC;IAC9C,IAAI,OAAO,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;IAC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MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,GAAE,iBAA4B,GAAG,YAAY,CAMrF"}
@@ -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"}
@@ -1,15 +1,9 @@
1
1
  /**
2
- * Shared utilities for the manifest module.
2
+ * Shared utilities for the kits manifest module.
3
3
  */
4
4
  import fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import { GLOBAL_MANIFEST_PATH, PROJECT_MANIFEST_DIR, PROJECT_MANIFEST_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
7
  export function expandPath(pathStr) {
14
8
  if (pathStr.startsWith("~")) {
15
9
  const home = process.env["HOME"] || process.env["USERPROFILE"] || "";
@@ -17,39 +11,18 @@ export function expandPath(pathStr) {
17
11
  }
18
12
  return pathStr;
19
13
  }
20
- /**
21
- * Get the manifest file 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 file
26
- */
27
14
  export function getManifestPath(scope, projectRoot) {
28
15
  if (scope === "global") {
29
16
  return expandPath(GLOBAL_MANIFEST_PATH);
30
17
  }
31
- // Project scope
32
18
  if (!projectRoot) {
33
19
  throw new Error("projectRoot is required for project scope");
34
20
  }
35
21
  return path.join(projectRoot, PROJECT_MANIFEST_DIR, PROJECT_MANIFEST_FILENAME);
36
22
  }
37
- /**
38
- * Get the manifest 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 manifest directory
43
- */
44
23
  export function getManifestDir(scope, projectRoot) {
45
24
  return path.dirname(getManifestPath(scope, projectRoot));
46
25
  }
47
- /**
48
- * Ensure the manifest 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
26
  export async function ensureManifestDir(scope, projectRoot) {
54
27
  const manifestDir = getManifestDir(scope, projectRoot);
55
28
  await fs.mkdir(manifestDir, { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/manifest/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;QAC5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 * Kits manifest (intent) write 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 write fails.
10
- */
5
+ import type { KitsManifest } from "./types.js";
11
6
  export declare class ManifestWriteError extends Error {
12
7
  readonly errorCause?: unknown;
13
8
  constructor(message: string, cause?: unknown);
14
9
  }
15
- /**
16
- * Write the installation manifest to disk.
17
- *
18
- * Creates the manifest directory if it doesn't exist.
19
- * Updates the lastUpdated timestamp automatically.
20
- * Ensures the scope field matches the write location.
21
- *
22
- * @param manifest - The manifest to write
23
- * @param scope - Installation scope (global or project), defaults to manifest.scope
24
- * @param projectRoot - Absolute path to project root (required for project scope)
25
- * @throws ManifestWriteError if writing fails
26
- */
27
- export declare function writeManifest(manifest: InstallationManifest, scope?: InstallationScope, projectRoot?: string): Promise<void>;
28
- /**
29
- * Get the expanded manifest 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 manifest file
34
- */
10
+ export declare function writeManifest(manifest: KitsManifest, scope?: InstallationScope, projectRoot?: string): Promise<void>;
35
11
  export declare function getManifestPathForScope(scope?: InstallationScope, projectRoot?: string): string;
36
- /**
37
- * Get the manifest 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 manifest directory
42
- */
43
12
  export declare function getManifestDirForScope(scope?: InstallationScope, projectRoot?: string): string;
44
13
  //# sourceMappingURL=write.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/manifest/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD;;GAEG;AACH,qBA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9 @@
1
1
  /**
2
- * Manifest write operations.
3
- *
4
- * Provides functionality to write and update the installation manifest.
2
+ * Kits manifest (intent) write operations.
5
3
  */
6
4
  import fs from "node:fs/promises";
5
+ import { MANIFEST_SCHEMA_VERSION } from "./types.js";
7
6
  import { getManifestPath, getManifestDir, ensureManifestDir } from "./utils.js";
8
- /**
9
- * Error thrown when manifest write fails.
10
- */
11
7
  export class ManifestWriteError extends Error {
12
8
  errorCause;
13
9
  constructor(message, cause) {
@@ -16,61 +12,25 @@ export class ManifestWriteError extends Error {
16
12
  this.errorCause = cause;
17
13
  }
18
14
  }
19
- /**
20
- * Write the installation manifest to disk.
21
- *
22
- * Creates the manifest directory if it doesn't exist.
23
- * Updates the lastUpdated timestamp automatically.
24
- * Ensures the scope field matches the write location.
25
- *
26
- * @param manifest - The manifest to write
27
- * @param scope - Installation scope (global or project), defaults to manifest.scope
28
- * @param projectRoot - Absolute path to project root (required for project scope)
29
- * @throws ManifestWriteError if writing fails
30
- */
31
15
  export async function writeManifest(manifest, scope, projectRoot) {
32
- // Use provided scope or fall back to manifest's scope
33
16
  const effectiveScope = scope ?? manifest.scope;
34
17
  const manifestPath = getManifestPath(effectiveScope, projectRoot);
35
18
  try {
36
- // Ensure directory exists
37
19
  await ensureManifestDir(effectiveScope, projectRoot);
38
- // Update timestamp
39
- manifest.lastUpdated = new Date().toISOString();
40
- // Ensure scope field is set correctly
41
20
  manifest.scope = effectiveScope;
42
- // Set or clear projectRoot based on scope
43
- if (effectiveScope === "project" && projectRoot) {
44
- manifest.projectRoot = projectRoot;
45
- }
46
- else if (effectiveScope === "global") {
47
- delete manifest.projectRoot;
21
+ if (!manifest.schemaVersion) {
22
+ manifest.schemaVersion = MANIFEST_SCHEMA_VERSION;
48
23
  }
49
- // Write manifest with pretty formatting
50
24
  const content = JSON.stringify(manifest, null, 2);
51
25
  await fs.writeFile(manifestPath, content, "utf-8");
52
26
  }
53
27
  catch (error) {
54
- throw new ManifestWriteError(`Failed to write manifest to ${manifestPath}`, error);
28
+ throw new ManifestWriteError(`Failed to write kits manifest to ${manifestPath}`, error);
55
29
  }
56
30
  }
57
- /**
58
- * Get the expanded manifest 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 manifest file
63
- */
64
31
  export function getManifestPathForScope(scope = "global", projectRoot) {
65
32
  return getManifestPath(scope, projectRoot);
66
33
  }
67
- /**
68
- * Get the manifest 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 manifest directory
73
- */
74
34
  export function getManifestDirForScope(scope = "global", projectRoot) {
75
35
  return getManifestDir(scope, projectRoot);
76
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/manifest/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,QAA8B,EAC9B,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,iBA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WAAW,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Primitive resolution module.
3
3
  *
4
- * Provides functionality to resolve primitive references from kit definitions
4
+ * Provides functionality to resolve primitive references from kit manifests
5
5
  * to concrete versions in the shared primitives library.
6
6
  */
7
7
  import type { KitManifest } from "../core/types.js";
@@ -16,29 +16,29 @@ export { resolveMultipleKits, deduplicatePrimitives } from "./multi-kit-resolver
16
16
  export type { CliEnvFlags } from "./env-resolver.js";
17
17
  export { extractEnvDefsFromConfig, extractHeaderDefsFromConfig, resolveEnvVars, resolveHeaders, validateCliEnvFlags, resolveEnvVarsFromConfig, mergeEnvDefs, } from "./env-resolver.js";
18
18
  /**
19
- * Resolves all primitive references in a kit definition.
19
+ * Resolves all primitive references in a kit manifest.
20
20
  *
21
21
  * This function processes both referenced primitives (with `ref` syntax)
22
22
  * and inline primitives (with `entrypoint` syntax), resolving references
23
23
  * to concrete versions from the primitives registry.
24
24
  *
25
- * @param kit - The kit definition
25
+ * @param kit - The kit manifest
26
26
  * @param registry - The primitives registry loader
27
27
  * @param kitBasePath - Base path to the kit directory
28
28
  * @returns Resolution result with resolved primitives and any errors
29
29
  */
30
- export declare function resolvePrimitiveReferences(kit: KitManifest, registry: PrimitivesRegistryLoader, kitBasePath: string): Promise<KitResolutionResult>;
30
+ export declare function resolvePrimitiveReferences(kit: KitManifest, registry: PrimitivesRegistryLoader, kitBasePath: string, lockedVersions?: Map<string, string>, kitInstanceName?: string): Promise<KitResolutionResult>;
31
31
  /**
32
32
  * Checks if a kit has any referenced primitives (requiring resolution).
33
33
  *
34
- * @param kit - The kit definition
34
+ * @param kit - The kit manifest
35
35
  * @returns True if the kit has referenced primitives
36
36
  */
37
37
  export declare function hasReferencedPrimitives(kit: KitManifest): boolean;
38
38
  /**
39
39
  * Counts primitives by resolution type.
40
40
  *
41
- * @param kit - The kit definition
41
+ * @param kit - The kit manifest
42
42
  * @returns Object with referenced and inline counts
43
43
  */
44
44
  export declare function countPrimitivesByType(kit: KitManifest): {
@@ -48,7 +48,7 @@ export declare function countPrimitivesByType(kit: KitManifest): {
48
48
  /**
49
49
  * Extracts all primitive references from a kit.
50
50
  *
51
- * @param kit - The kit definition
51
+ * @param kit - The kit manifest
52
52
  * @returns Array of reference strings
53
53
  */
54
54
  export declare function extractReferences(kit: KitManifest): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolution/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,WAAW,EAOZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAMpE,YAAY,EACV,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGrF,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,2BAA2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