@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.
- package/README.md +173 -32
- package/dist/adapters/base-adapter.d.ts +2 -2
- package/dist/adapters/base-adapter.js +2 -2
- package/dist/adapters/claude-code/index.d.ts +1 -1
- package/dist/adapters/claude-code/index.js +1 -1
- package/dist/adapters/codex/index.d.ts +1 -1
- package/dist/adapters/codex/index.js +1 -1
- package/dist/adapters/gemini-cli/index.d.ts +1 -1
- package/dist/adapters/gemini-cli/index.js +1 -1
- package/dist/adapters/github-copilot/index.d.ts +1 -1
- package/dist/adapters/github-copilot/index.js +1 -1
- package/dist/adapters/opencode/index.d.ts +1 -1
- package/dist/adapters/opencode/index.js +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +29 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +820 -161
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/list.d.ts.map +1 -1
- package/dist/cli/list.js +8 -6
- package/dist/cli/list.js.map +1 -1
- package/dist/cli/types.d.ts +17 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js +1 -0
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +300 -38
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/upgrade.d.ts.map +1 -1
- package/dist/cli/upgrade.js +334 -105
- package/dist/cli/upgrade.js.map +1 -1
- package/dist/cli/validate.js +5 -5
- package/dist/cli/validate.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/core/upgrade-executor.d.ts +7 -7
- package/dist/core/upgrade-executor.d.ts.map +1 -1
- package/dist/core/upgrade-executor.js +17 -17
- package/dist/core/upgrade-executor.js.map +1 -1
- package/dist/discovery/kit-scanner.d.ts +3 -3
- package/dist/discovery/kit-scanner.js +17 -17
- package/dist/discovery/kit-scanner.js.map +1 -1
- package/dist/discovery/types.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lockfile/index.d.ts +79 -0
- package/dist/lockfile/index.d.ts.map +1 -0
- package/dist/lockfile/index.js +203 -0
- package/dist/lockfile/index.js.map +1 -0
- package/dist/lockfile/read.d.ts +32 -0
- package/dist/lockfile/read.d.ts.map +1 -0
- package/dist/lockfile/read.js +88 -0
- package/dist/lockfile/read.js.map +1 -0
- package/dist/lockfile/types.d.ts +126 -0
- package/dist/lockfile/types.d.ts.map +1 -0
- package/dist/lockfile/types.js +44 -0
- package/dist/lockfile/types.js.map +1 -0
- package/dist/{manifest → lockfile}/upgrade-check.d.ts +5 -5
- package/dist/lockfile/upgrade-check.d.ts.map +1 -0
- package/dist/{manifest → lockfile}/upgrade-check.js +11 -9
- package/dist/lockfile/upgrade-check.js.map +1 -0
- package/dist/lockfile/utils.d.ts +35 -0
- package/dist/lockfile/utils.d.ts.map +1 -0
- package/dist/lockfile/utils.js +57 -0
- package/dist/lockfile/utils.js.map +1 -0
- package/dist/lockfile/write.d.ts +44 -0
- package/dist/lockfile/write.d.ts.map +1 -0
- package/dist/lockfile/write.js +77 -0
- package/dist/lockfile/write.js.map +1 -0
- package/dist/manifest/hash.d.ts +7 -0
- package/dist/manifest/hash.d.ts.map +1 -0
- package/dist/manifest/hash.js +30 -0
- package/dist/manifest/hash.js.map +1 -0
- package/dist/manifest/index.d.ts +8 -77
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest/index.js +6 -197
- package/dist/manifest/index.js.map +1 -1
- package/dist/manifest/read.d.ts +4 -24
- package/dist/manifest/read.d.ts.map +1 -1
- package/dist/manifest/read.js +22 -46
- package/dist/manifest/read.js.map +1 -1
- package/dist/manifest/types.d.ts +17 -109
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/manifest/types.js +8 -37
- package/dist/manifest/types.js.map +1 -1
- package/dist/manifest/utils.d.ts +1 -27
- package/dist/manifest/utils.d.ts.map +1 -1
- package/dist/manifest/utils.js +1 -28
- package/dist/manifest/utils.js.map +1 -1
- package/dist/manifest/write.d.ts +3 -34
- package/dist/manifest/write.d.ts.map +1 -1
- package/dist/manifest/write.js +5 -45
- package/dist/manifest/write.js.map +1 -1
- package/dist/resolution/index.d.ts +7 -7
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +29 -19
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/multi-kit-resolver.d.ts +2 -2
- package/dist/resolution/multi-kit-resolver.js +2 -2
- package/dist/resolution/primitives-registry.d.ts +1 -1
- package/dist/resolution/primitives-registry.js +2 -2
- package/dist/resolution/primitives-registry.js.map +1 -1
- package/dist/resolution/types.d.ts +1 -1
- package/dist/resolution/types.js +1 -1
- package/dist/tui/types.d.ts +1 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/upgrade-select.d.ts +1 -1
- package/dist/tui/upgrade-select.d.ts.map +1 -1
- package/dist/tui/upgrade-select.js +15 -4
- package/dist/tui/upgrade-select.js.map +1 -1
- package/dist/validation/validate-kits.d.ts +1 -1
- package/dist/validation/validate-kits.js +5 -5
- package/dist/validation/validate-kits.js.map +1 -1
- package/package.json +1 -1
- package/schemas/{manifest.schema.json → kits-lock.schema.json} +34 -8
- package/schemas/kits-manifest.schema.json +95 -0
- package/schemas/{kits.schema.json → kits-registry.schema.json} +3 -3
- package/schemas/{primitives.schema.json → primitives-registry.schema.json} +2 -2
- package/dist/manifest/upgrade-check.d.ts.map +0 -1
- package/dist/manifest/upgrade-check.js.map +0 -1
package/dist/manifest/read.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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 {
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
77
|
-
if (typeof m["version"] !== "string") {
|
|
53
|
+
if (typeof m["schemaVersion"] !== "string") {
|
|
78
54
|
return false;
|
|
79
55
|
}
|
|
80
|
-
if (typeof m["
|
|
56
|
+
if (typeof m["scope"] !== "string") {
|
|
81
57
|
return false;
|
|
82
58
|
}
|
|
83
|
-
if (!m["
|
|
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
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/manifest/read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,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,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,YAAoB;IACzD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAiB,CAAC;QAErD,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,iBAAiB,CACzB,mCAAmC,YAAY,4BAA4B,uBAAuB,EAAE,CACrG,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;YACvC,MAAM,KAAK,CAAC;QACd,CAAC;QAED,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,MAAM,IAAI,iBAAiB,CACzB,oCAAoC,YAAY,gBAAgB,EAChE,KAAK,CACN,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,iBAAiB,CAAC,mCAAmC,YAAY,EAAE,EAAE,KAAK,CAAC,CAAC;IACxF,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAEzD,IAAI,CAAC;QACH,OAAO,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,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"}
|
package/dist/manifest/types.d.ts
CHANGED
|
@@ -1,119 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
+
kits?: Array<string | KitsManifestKit>;
|
|
48
17
|
}
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/manifest/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,eAAO,MAAM,uBAAuB,EAAG,OAAgB,CAAC;AAExD,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAC1D,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,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"}
|
package/dist/manifest/types.js
CHANGED
|
@@ -1,44 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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
|
|
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"}
|
package/dist/manifest/utils.d.ts
CHANGED
|
@@ -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
|
|
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"}
|
package/dist/manifest/utils.js
CHANGED
|
@@ -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
|
|
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,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,MAAM,UAAU,eAAe,CAAC,KAAwB,EAAE,WAAoB;IAC5E,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED,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,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,WAAoB;IAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAwB,EAAE,WAAoB;IACpF,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"}
|
package/dist/manifest/write.d.ts
CHANGED
|
@@ -1,44 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Provides functionality to write and update the installation manifest.
|
|
2
|
+
* Kits manifest (intent) write operations.
|
|
5
3
|
*/
|
|
6
4
|
import type { InstallationScope } from "../core/types.js";
|
|
7
|
-
import type {
|
|
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
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/manifest/write.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,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,iBAAiB,EACzB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAgB,uBAAuB,CACrC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAER;AAED,wBAAgB,sBAAsB,CACpC,KAAK,GAAE,iBAA4B,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAER"}
|
package/dist/manifest/write.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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
|
-
|
|
43
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/manifest/write.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEhF,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,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAsB,EACtB,KAAyB,EACzB,WAAoB;IAEpB,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,MAAM,iBAAiB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACrD,QAAQ,CAAC,KAAK,GAAG,cAAc,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC5B,QAAQ,CAAC,aAAa,GAAG,uBAAuB,CAAC;QACnD,CAAC;QACD,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,CAAC,oCAAoC,YAAY,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1F,CAAC;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,OAAO,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,QAA2B,QAAQ,EACnC,WAAoB;IAEpB,OAAO,cAAc,CAAC,KAAK,EAAE,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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,2BAA2B,EAC3B,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,wBAAwB,EAClC,WAAW,EAAE,MAAM,
|
|
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,2BAA2B,EAC3B,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,wBAAwB,EAClC,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,mBAAmB,CAAC,CAoC9B;AA6WD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAQjE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAkB9F;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,EAAE,CAe5D"}
|