@agpm/core 0.0.2 → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kepler16
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Get the AGPM cache directory path.
3
+ * Cache stores immutable repo snapshots at specific SHAs.
4
+ */
5
+ export declare function getAgpmCacheDir(): string;
6
+ /**
7
+ * Get the path for a cached repo at a specific SHA.
8
+ */
9
+ export declare function getCachedRepoPath(sha: string): string;
10
+ /**
11
+ * Check if a SHA is already cached.
12
+ */
13
+ export declare function isCached(sha: string): Promise<boolean>;
14
+ /**
15
+ * Cache a repo at a specific SHA.
16
+ * Copies repo contents (excluding .git) to the cache directory.
17
+ *
18
+ * @param repoPath - Path to the git repo (should already be checked out at the SHA)
19
+ * @param sha - The SHA to cache under
20
+ * @returns Path to the cached repo
21
+ */
22
+ export declare function cacheRepo(repoPath: string, sha: string): Promise<string>;
23
+ /**
24
+ * Compute SHA256 integrity hash of a directory's contents.
25
+ *
26
+ * Algorithm:
27
+ * 1. Recursively list all files (sorted alphabetically by relative path)
28
+ * 2. For each file: update hash with relative path + file contents
29
+ * 3. Return hash as "sha256-<base64>"
30
+ *
31
+ * This produces a deterministic hash regardless of filesystem order.
32
+ */
33
+ export declare function hashDirectory(dirPath: string): Promise<string>;
34
+ /**
35
+ * Verify a directory matches an expected integrity hash.
36
+ */
37
+ export declare function verifyIntegrity(dirPath: string, expectedIntegrity: string): Promise<boolean>;
38
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAoCD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,OAAO,CAAC,CAGlB"}
package/dist/cache.js ADDED
@@ -0,0 +1,118 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readdir, readFile, stat, cp, mkdir } from "node:fs/promises";
3
+ import { join, relative } from "node:path";
4
+ import { homedir } from "node:os";
5
+ // ============================================================================
6
+ // Cache Directory Management
7
+ // ============================================================================
8
+ /**
9
+ * Get the AGPM cache directory path.
10
+ * Cache stores immutable repo snapshots at specific SHAs.
11
+ */
12
+ export function getAgpmCacheDir() {
13
+ return join(homedir(), ".agpm", "cache");
14
+ }
15
+ /**
16
+ * Get the path for a cached repo at a specific SHA.
17
+ */
18
+ export function getCachedRepoPath(sha) {
19
+ return join(getAgpmCacheDir(), sha);
20
+ }
21
+ /**
22
+ * Check if a SHA is already cached.
23
+ */
24
+ export async function isCached(sha) {
25
+ try {
26
+ await stat(getCachedRepoPath(sha));
27
+ return true;
28
+ }
29
+ catch {
30
+ return false;
31
+ }
32
+ }
33
+ /**
34
+ * Cache a repo at a specific SHA.
35
+ * Copies repo contents (excluding .git) to the cache directory.
36
+ *
37
+ * @param repoPath - Path to the git repo (should already be checked out at the SHA)
38
+ * @param sha - The SHA to cache under
39
+ * @returns Path to the cached repo
40
+ */
41
+ export async function cacheRepo(repoPath, sha) {
42
+ const cachePath = getCachedRepoPath(sha);
43
+ // Skip if already cached
44
+ if (await isCached(sha)) {
45
+ return cachePath;
46
+ }
47
+ await mkdir(cachePath, { recursive: true });
48
+ // Copy repo contents, excluding .git directory
49
+ await cp(repoPath, cachePath, {
50
+ recursive: true,
51
+ filter: (src) => !src.includes("/.git") && !src.endsWith(".git"),
52
+ });
53
+ return cachePath;
54
+ }
55
+ // ============================================================================
56
+ // Integrity Hashing
57
+ // ============================================================================
58
+ /**
59
+ * Recursively get all files in a directory.
60
+ */
61
+ async function getFilesRecursive(dirPath) {
62
+ const files = [];
63
+ async function walk(dir) {
64
+ const entries = await readdir(dir, { withFileTypes: true });
65
+ for (const entry of entries) {
66
+ const fullPath = join(dir, entry.name);
67
+ if (entry.isDirectory()) {
68
+ // Skip hidden directories
69
+ if (!entry.name.startsWith(".")) {
70
+ await walk(fullPath);
71
+ }
72
+ }
73
+ else if (entry.isFile()) {
74
+ // Skip hidden files
75
+ if (!entry.name.startsWith(".")) {
76
+ files.push(fullPath);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ await walk(dirPath);
82
+ return files;
83
+ }
84
+ /**
85
+ * Compute SHA256 integrity hash of a directory's contents.
86
+ *
87
+ * Algorithm:
88
+ * 1. Recursively list all files (sorted alphabetically by relative path)
89
+ * 2. For each file: update hash with relative path + file contents
90
+ * 3. Return hash as "sha256-<base64>"
91
+ *
92
+ * This produces a deterministic hash regardless of filesystem order.
93
+ */
94
+ export async function hashDirectory(dirPath) {
95
+ const files = await getFilesRecursive(dirPath);
96
+ // Sort by relative path for deterministic ordering
97
+ const relativePaths = files.map((f) => ({
98
+ absolute: f,
99
+ relative: relative(dirPath, f),
100
+ }));
101
+ relativePaths.sort((a, b) => a.relative.localeCompare(b.relative));
102
+ const hash = createHash("sha256");
103
+ for (const { absolute, relative: relPath } of relativePaths) {
104
+ const content = await readFile(absolute);
105
+ // Include path in hash to detect renames
106
+ hash.update(relPath);
107
+ hash.update(content);
108
+ }
109
+ return `sha256-${hash.digest("base64")}`;
110
+ }
111
+ /**
112
+ * Verify a directory matches an expected integrity hash.
113
+ */
114
+ export async function verifyIntegrity(dirPath, expectedIntegrity) {
115
+ const actualIntegrity = await hashDirectory(dirPath);
116
+ return actualIntegrity === expectedIntegrity;
117
+ }
118
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;;G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QAAQ,CAAC,CAAC,CAAC;IAEnE,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAElC,KAAK,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,aAAa,EAAE,CAAC;QAC5D,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzC,yCAAyC;QACzC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAAe,EACf,iBAAyB;IAEzB,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,eAAe,KAAK,iBAAiB,CAAC;AAC/C,CAAC"}
package/dist/config.d.ts CHANGED
@@ -1,21 +1,66 @@
1
1
  export interface TargetConfig {
2
2
  }
3
+ /** Source format for artifact discovery */
4
+ export type SourceFormat = "auto" | "claude-marketplace" | "claude-plugin" | "simple";
5
+ /** A normalized source configuration */
6
+ export interface Source {
7
+ /** Display name for the source (e.g., "anthropics/skills") */
8
+ name: string;
9
+ /** Full git URL (e.g., "https://github.com/anthropics/skills.git") */
10
+ url: string;
11
+ /** Format for artifact discovery. Defaults to "auto" if omitted. */
12
+ format?: SourceFormat;
13
+ /** Subdirectory within the repo to use as root */
14
+ subdir?: string;
15
+ }
3
16
  export interface AgpmConfig {
4
17
  $schema?: string;
5
18
  targets: Record<string, TargetConfig>;
6
- sources: string[];
19
+ sources: Source[];
20
+ /** Collection references (expand to their artifacts at install time) */
21
+ collections: string[];
22
+ /** Individual artifact references */
7
23
  artifacts: string[];
8
24
  }
9
25
  export interface LockedArtifact {
26
+ /** Full 40-character git SHA */
10
27
  sha: string;
28
+ /** Integrity hash: "sha256-<base64>" */
11
29
  integrity: string;
30
+ /** Path within the repo */
12
31
  path: string;
32
+ /** Original ref if specified (tag/branch), undefined means HEAD */
33
+ ref?: string;
13
34
  metadata: {
14
35
  name: string;
15
36
  description?: string;
16
37
  [key: string]: unknown;
17
38
  };
18
39
  }
40
+ /**
41
+ * Parsed artifact reference with optional version/ref.
42
+ */
43
+ export interface ArtifactRef {
44
+ /** Source name (e.g., "anthropics/skills") */
45
+ source: string;
46
+ /** Artifact name (e.g., "pdf") */
47
+ artifact: string;
48
+ /** Optional ref: tag, branch, or SHA (e.g., "v1.0.0", "main", "abc123") */
49
+ ref?: string;
50
+ }
51
+ /**
52
+ * Parse an artifact reference string.
53
+ *
54
+ * Formats:
55
+ * - "source/artifact" → { source: "source", artifact: "artifact", ref: undefined }
56
+ * - "source/artifact@ref" → { source: "source", artifact: "artifact", ref: "ref" }
57
+ *
58
+ * Examples:
59
+ * - "anthropics/skills/pdf" → { source: "anthropics/skills", artifact: "pdf" }
60
+ * - "anthropics/skills/pdf@v1.0.0" → { source: "anthropics/skills", artifact: "pdf", ref: "v1.0.0" }
61
+ * - "anthropics/skills/pdf@main" → { source: "anthropics/skills", artifact: "pdf", ref: "main" }
62
+ */
63
+ export declare function parseArtifactRef(refString: string): ArtifactRef | null;
19
64
  export interface AgpmLock {
20
65
  $schema?: string;
21
66
  version: number;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;CAE5B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,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MzE,eAAO,MAAM,cAAc,EAAE,UAM5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAI1B,CAAC;AASF,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAyBjE;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAM/E;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqB7D;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE"}
package/dist/config.js CHANGED
@@ -1,6 +1,37 @@
1
1
  import { readFile, writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { validateConfig, validateLock, formatValidationErrors } from "./validate.js";
4
+ /**
5
+ * Parse an artifact reference string.
6
+ *
7
+ * Formats:
8
+ * - "source/artifact" → { source: "source", artifact: "artifact", ref: undefined }
9
+ * - "source/artifact@ref" → { source: "source", artifact: "artifact", ref: "ref" }
10
+ *
11
+ * Examples:
12
+ * - "anthropics/skills/pdf" → { source: "anthropics/skills", artifact: "pdf" }
13
+ * - "anthropics/skills/pdf@v1.0.0" → { source: "anthropics/skills", artifact: "pdf", ref: "v1.0.0" }
14
+ * - "anthropics/skills/pdf@main" → { source: "anthropics/skills", artifact: "pdf", ref: "main" }
15
+ */
16
+ export function parseArtifactRef(refString) {
17
+ // Handle @ref suffix
18
+ const atIndex = refString.lastIndexOf("@");
19
+ const lastSlash = refString.lastIndexOf("/");
20
+ // @ must come after the last / to be a ref (not part of source name)
21
+ const hasRef = atIndex > lastSlash && atIndex !== -1;
22
+ const withoutRef = hasRef ? refString.slice(0, atIndex) : refString;
23
+ const ref = hasRef ? refString.slice(atIndex + 1) : undefined;
24
+ // Split into source and artifact
25
+ const slashIndex = withoutRef.lastIndexOf("/");
26
+ if (slashIndex === -1) {
27
+ return null;
28
+ }
29
+ return {
30
+ source: withoutRef.slice(0, slashIndex),
31
+ artifact: withoutRef.slice(slashIndex + 1),
32
+ ref,
33
+ };
34
+ }
4
35
  // ============================================================================
5
36
  // Schema URLs
6
37
  // ============================================================================
@@ -13,6 +44,7 @@ export const DEFAULT_CONFIG = {
13
44
  $schema: CONFIG_SCHEMA_URL,
14
45
  targets: {},
15
46
  sources: [],
47
+ collections: [],
16
48
  artifacts: [],
17
49
  };
18
50
  export const DEFAULT_LOCK = {
@@ -35,7 +67,11 @@ export async function loadConfig(dir) {
35
67
  if (!result.valid) {
36
68
  throw new Error(`Invalid ${CONFIG_FILE}:\n${formatValidationErrors(result.errors)}`);
37
69
  }
38
- return config;
70
+ // Provide defaults for optional fields
71
+ return {
72
+ ...config,
73
+ collections: config.collections ?? [],
74
+ };
39
75
  }
40
76
  catch (error) {
41
77
  if (error.code === "ENOENT") {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAkCrF,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AACtE,MAAM,CAAC,MAAM,eAAe,GAAG,yCAAyC,CAAC;AAEzE,+EAA+E;AAC/E,WAAW;AACX,+EAA+E;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,EAAE;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,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AC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,GAAW,EAAE,IAAc;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAClC,oCAAoC;IACpC,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,CAAC;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/D,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { SourceFormat } from "./config.js";
1
2
  export interface DiscoveredArtifact {
2
3
  /** Artifact name */
3
4
  name: string;
@@ -10,11 +11,55 @@ export interface DiscoveredArtifact {
10
11
  /** Full absolute path */
11
12
  absolutePath: string;
12
13
  /** Source format that was detected */
13
- format: "claude-marketplace" | "simple";
14
+ format: SourceFormat;
14
15
  /** Additional metadata */
15
16
  metadata?: Record<string, unknown>;
16
17
  }
17
- export interface ClaudePluginManifest {
18
+ export interface DiscoveredCollection {
19
+ /** Collection name (e.g., plugin name) */
20
+ name: string;
21
+ /** Description */
22
+ description?: string;
23
+ /** Names of artifacts in this collection */
24
+ artifacts: string[];
25
+ /** Path to collection root relative to repo */
26
+ path: string;
27
+ /** Additional metadata */
28
+ metadata?: Record<string, unknown>;
29
+ }
30
+ export interface DiscoveryResult {
31
+ /** Individual artifacts discovered */
32
+ artifacts: DiscoveredArtifact[];
33
+ /** Collections (groups of artifacts) discovered */
34
+ collections: DiscoveredCollection[];
35
+ /** Format that was detected/used */
36
+ format: RepoFormat;
37
+ }
38
+ /** Common plugin entry structure (shared between plugin.json and marketplace entries) */
39
+ export interface PluginEntry {
40
+ name: string;
41
+ version?: string;
42
+ description?: string;
43
+ author?: {
44
+ name: string;
45
+ email?: string;
46
+ url?: string;
47
+ };
48
+ /**
49
+ * Skills configuration:
50
+ * - In plugin.json: path(s) to directories containing skills (e.g., "./custom/skills/")
51
+ * - In marketplace: explicit paths to individual skill directories (e.g., ["./skills/pdf"])
52
+ */
53
+ skills?: string | string[];
54
+ commands?: string | string[];
55
+ agents?: string | string[];
56
+ /** Marketplace-only: source directory for the plugin */
57
+ source?: string;
58
+ /** Marketplace-only: if true, plugin must have its own plugin.json */
59
+ strict?: boolean;
60
+ }
61
+ /** Marketplace manifest (.claude-plugin/marketplace.json) - multiple plugins */
62
+ export interface ClaudeMarketplaceManifest {
18
63
  name: string;
19
64
  owner?: {
20
65
  name: string;
@@ -24,25 +69,32 @@ export interface ClaudePluginManifest {
24
69
  description?: string;
25
70
  version?: string;
26
71
  };
27
- plugins: Array<{
28
- name: string;
29
- description?: string;
30
- source?: string;
31
- skills?: string[];
32
- }>;
72
+ plugins: PluginEntry[];
33
73
  }
74
+ /** Plugin manifest (.claude-plugin/plugin.json) - single plugin */
75
+ export type ClaudePluginManifest = PluginEntry;
34
76
  export interface SkillMetadata {
35
77
  name: string;
36
78
  description?: string;
37
79
  [key: string]: unknown;
38
80
  }
39
- export type RepoFormat = "claude-marketplace" | "simple" | "unknown";
81
+ /** Detected format or unknown */
82
+ export type RepoFormat = SourceFormat | "unknown";
40
83
  /**
41
84
  * Detect the format of a repository.
85
+ * Checks in order of specificity: marketplace > plugin > simple
42
86
  */
43
87
  export declare function detectFormat(repoPath: string): Promise<RepoFormat>;
44
88
  /**
45
- * Discover all artifacts in a repository.
89
+ * Discover all artifacts and collections in a repository.
90
+ *
91
+ * @param repoPath - Path to the repository
92
+ * @param subdir - Optional subdirectory to search within
93
+ * @param explicitFormat - If provided, use this format instead of auto-detecting
94
+ */
95
+ export declare function discover(repoPath: string, subdir?: string, explicitFormat?: SourceFormat): Promise<DiscoveryResult>;
96
+ /**
97
+ * @deprecated Use `discover` instead. This is kept for backwards compatibility.
46
98
  */
47
- export declare function discoverArtifacts(repoPath: string, subpath?: string): Promise<DiscoveredArtifact[]>;
99
+ export declare function discoverArtifacts(repoPath: string, subdir?: string, explicitFormat?: SourceFormat): Promise<DiscoveredArtifact[]>;
48
100
  //# sourceMappingURL=discovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACnC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,MAAM,EAAE,oBAAoB,GAAG,QAAQ,CAAC;IACxC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAA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