agentpacks 0.2.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.
Files changed (172) hide show
  1. package/dist/api.d.ts +32 -0
  2. package/dist/api.js +2852 -0
  3. package/dist/cli/export-cmd.d.ts +12 -0
  4. package/dist/cli/export-cmd.js +786 -0
  5. package/dist/cli/generate.d.ts +13 -0
  6. package/dist/cli/generate.js +2018 -0
  7. package/dist/cli/import-cmd.d.ts +9 -0
  8. package/dist/cli/import-cmd.js +691 -0
  9. package/dist/cli/init.d.ts +5 -0
  10. package/dist/cli/init.js +214 -0
  11. package/dist/cli/install.d.ts +11 -0
  12. package/dist/cli/install.js +610 -0
  13. package/dist/cli/pack/create.d.ts +4 -0
  14. package/dist/cli/pack/create.js +175 -0
  15. package/dist/cli/pack/enable.d.ts +8 -0
  16. package/dist/cli/pack/enable.js +96 -0
  17. package/dist/cli/pack/list.d.ts +4 -0
  18. package/dist/cli/pack/list.js +699 -0
  19. package/dist/cli/pack/validate.d.ts +4 -0
  20. package/dist/cli/pack/validate.js +364 -0
  21. package/dist/core/config.d.ts +77 -0
  22. package/dist/core/config.js +181 -0
  23. package/dist/core/dependency-resolver.d.ts +38 -0
  24. package/dist/core/dependency-resolver.js +151 -0
  25. package/dist/core/feature-merger.d.ts +61 -0
  26. package/dist/core/feature-merger.js +139 -0
  27. package/dist/core/index.d.ts +5 -0
  28. package/dist/core/index.js +924 -0
  29. package/dist/core/lockfile.d.ts +50 -0
  30. package/dist/core/lockfile.js +72 -0
  31. package/dist/core/metarepo.d.ts +26 -0
  32. package/dist/core/metarepo.js +218 -0
  33. package/dist/core/pack-loader.d.ts +61 -0
  34. package/dist/core/pack-loader.js +646 -0
  35. package/dist/exporters/cursor-plugin.d.ts +29 -0
  36. package/dist/exporters/cursor-plugin.js +258 -0
  37. package/dist/exporters/index.d.ts +1 -0
  38. package/dist/exporters/index.js +258 -0
  39. package/dist/features/agents.d.ts +48 -0
  40. package/dist/features/agents.js +190 -0
  41. package/dist/features/commands.d.ts +33 -0
  42. package/dist/features/commands.js +190 -0
  43. package/dist/features/hooks.d.ts +33 -0
  44. package/dist/features/hooks.js +182 -0
  45. package/dist/features/ignore.d.ts +21 -0
  46. package/dist/features/ignore.js +72 -0
  47. package/dist/features/index.d.ts +8 -0
  48. package/dist/features/index.js +426 -0
  49. package/dist/features/mcp.d.ts +34 -0
  50. package/dist/features/mcp.js +172 -0
  51. package/dist/features/plugins.d.ts +23 -0
  52. package/dist/features/plugins.js +168 -0
  53. package/dist/features/rules.d.ts +53 -0
  54. package/dist/features/rules.js +198 -0
  55. package/dist/features/skills.d.ts +42 -0
  56. package/dist/features/skills.js +198 -0
  57. package/dist/importers/claude-code.d.ts +5 -0
  58. package/dist/importers/claude-code.js +224 -0
  59. package/dist/importers/cursor.d.ts +5 -0
  60. package/dist/importers/cursor.js +288 -0
  61. package/dist/importers/opencode.d.ts +5 -0
  62. package/dist/importers/opencode.js +261 -0
  63. package/dist/importers/rulesync.d.ts +14 -0
  64. package/dist/importers/rulesync.js +280 -0
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.js +3464 -0
  67. package/dist/node/api.js +2852 -0
  68. package/dist/node/cli/export-cmd.js +786 -0
  69. package/dist/node/cli/generate.js +2018 -0
  70. package/dist/node/cli/import-cmd.js +691 -0
  71. package/dist/node/cli/init.js +214 -0
  72. package/dist/node/cli/install.js +610 -0
  73. package/dist/node/cli/pack/create.js +175 -0
  74. package/dist/node/cli/pack/enable.js +96 -0
  75. package/dist/node/cli/pack/list.js +699 -0
  76. package/dist/node/cli/pack/validate.js +364 -0
  77. package/dist/node/core/config.js +181 -0
  78. package/dist/node/core/dependency-resolver.js +151 -0
  79. package/dist/node/core/feature-merger.js +139 -0
  80. package/dist/node/core/index.js +924 -0
  81. package/dist/node/core/lockfile.js +72 -0
  82. package/dist/node/core/metarepo.js +218 -0
  83. package/dist/node/core/pack-loader.js +646 -0
  84. package/dist/node/exporters/cursor-plugin.js +258 -0
  85. package/dist/node/exporters/index.js +258 -0
  86. package/dist/node/features/agents.js +190 -0
  87. package/dist/node/features/commands.js +190 -0
  88. package/dist/node/features/hooks.js +182 -0
  89. package/dist/node/features/ignore.js +72 -0
  90. package/dist/node/features/index.js +426 -0
  91. package/dist/node/features/mcp.js +172 -0
  92. package/dist/node/features/plugins.js +168 -0
  93. package/dist/node/features/rules.js +198 -0
  94. package/dist/node/features/skills.js +198 -0
  95. package/dist/node/importers/claude-code.js +224 -0
  96. package/dist/node/importers/cursor.js +288 -0
  97. package/dist/node/importers/opencode.js +261 -0
  98. package/dist/node/importers/rulesync.js +280 -0
  99. package/dist/node/index.js +3464 -0
  100. package/dist/node/sources/git-ref.js +79 -0
  101. package/dist/node/sources/git.js +245 -0
  102. package/dist/node/sources/index.js +416 -0
  103. package/dist/node/sources/local.js +52 -0
  104. package/dist/node/sources/npm-ref.js +84 -0
  105. package/dist/node/sources/npm.js +211 -0
  106. package/dist/node/targets/additional-targets.js +428 -0
  107. package/dist/node/targets/agents-md.js +239 -0
  108. package/dist/node/targets/base-target.js +51 -0
  109. package/dist/node/targets/claude-code.js +490 -0
  110. package/dist/node/targets/codex-cli.js +297 -0
  111. package/dist/node/targets/copilot.js +390 -0
  112. package/dist/node/targets/cursor.js +441 -0
  113. package/dist/node/targets/gemini-cli.js +352 -0
  114. package/dist/node/targets/generic-md-target.js +319 -0
  115. package/dist/node/targets/index.js +1351 -0
  116. package/dist/node/targets/opencode.js +556 -0
  117. package/dist/node/targets/registry.js +1343 -0
  118. package/dist/node/utils/diff.js +144 -0
  119. package/dist/node/utils/filesystem.js +152 -0
  120. package/dist/node/utils/frontmatter.js +52 -0
  121. package/dist/node/utils/global.js +81 -0
  122. package/dist/node/utils/markdown.js +62 -0
  123. package/dist/sources/git-ref.d.ts +27 -0
  124. package/dist/sources/git-ref.js +79 -0
  125. package/dist/sources/git.d.ts +29 -0
  126. package/dist/sources/git.js +245 -0
  127. package/dist/sources/index.d.ts +5 -0
  128. package/dist/sources/index.js +416 -0
  129. package/dist/sources/local.d.ts +8 -0
  130. package/dist/sources/local.js +52 -0
  131. package/dist/sources/npm-ref.d.ts +30 -0
  132. package/dist/sources/npm-ref.js +84 -0
  133. package/dist/sources/npm.d.ts +20 -0
  134. package/dist/sources/npm.js +211 -0
  135. package/dist/targets/additional-targets.d.ts +65 -0
  136. package/dist/targets/additional-targets.js +428 -0
  137. package/dist/targets/agents-md.d.ts +13 -0
  138. package/dist/targets/agents-md.js +239 -0
  139. package/dist/targets/base-target.d.ts +61 -0
  140. package/dist/targets/base-target.js +51 -0
  141. package/dist/targets/claude-code.d.ts +13 -0
  142. package/dist/targets/claude-code.js +490 -0
  143. package/dist/targets/codex-cli.d.ts +12 -0
  144. package/dist/targets/codex-cli.js +297 -0
  145. package/dist/targets/copilot.d.ts +12 -0
  146. package/dist/targets/copilot.js +390 -0
  147. package/dist/targets/cursor.d.ts +13 -0
  148. package/dist/targets/cursor.js +441 -0
  149. package/dist/targets/gemini-cli.d.ts +12 -0
  150. package/dist/targets/gemini-cli.js +352 -0
  151. package/dist/targets/generic-md-target.d.ts +25 -0
  152. package/dist/targets/generic-md-target.js +319 -0
  153. package/dist/targets/index.d.ts +9 -0
  154. package/dist/targets/index.js +1351 -0
  155. package/dist/targets/opencode.d.ts +13 -0
  156. package/dist/targets/opencode.js +556 -0
  157. package/dist/targets/registry.d.ts +17 -0
  158. package/dist/targets/registry.js +1343 -0
  159. package/dist/utils/diff.d.ts +13 -0
  160. package/dist/utils/diff.js +144 -0
  161. package/dist/utils/filesystem.d.ts +49 -0
  162. package/dist/utils/filesystem.js +152 -0
  163. package/dist/utils/frontmatter.d.ts +19 -0
  164. package/dist/utils/frontmatter.js +52 -0
  165. package/dist/utils/global.d.ts +17 -0
  166. package/dist/utils/global.js +81 -0
  167. package/dist/utils/markdown.d.ts +20 -0
  168. package/dist/utils/markdown.js +62 -0
  169. package/package.json +808 -0
  170. package/templates/pack/pack.json +10 -0
  171. package/templates/pack/rules/overview.md +22 -0
  172. package/templates/workspace/agentpacks.jsonc +34 -0
@@ -0,0 +1,52 @@
1
+ // @bun
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
7
+ var __toCommonJS = (from) => {
8
+ var entry = __moduleCache.get(from), desc;
9
+ if (entry)
10
+ return entry;
11
+ entry = __defProp({}, "__esModule", { value: true });
12
+ if (from && typeof from === "object" || typeof from === "function")
13
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ }));
17
+ __moduleCache.set(from, entry);
18
+ return entry;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, {
23
+ get: all[name],
24
+ enumerable: true,
25
+ configurable: true,
26
+ set: (newValue) => all[name] = () => newValue
27
+ });
28
+ };
29
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
+ var __require = import.meta.require;
31
+
32
+ // src/sources/local.ts
33
+ import { existsSync } from "fs";
34
+ import { resolve, isAbsolute } from "path";
35
+ function resolveLocalPack(packRef, projectRoot) {
36
+ let resolved;
37
+ if (isAbsolute(packRef)) {
38
+ resolved = packRef;
39
+ } else {
40
+ resolved = resolve(projectRoot, packRef);
41
+ }
42
+ if (!existsSync(resolved))
43
+ return null;
44
+ return resolved;
45
+ }
46
+ function isLocalPackRef(packRef) {
47
+ return packRef.startsWith("./") || packRef.startsWith("../") || isAbsolute(packRef);
48
+ }
49
+ export {
50
+ resolveLocalPack,
51
+ isLocalPackRef
52
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * npm pack source — reference parsing and detection utilities.
3
+ * Pure functions, no I/O.
4
+ */
5
+ /**
6
+ * Parsed npm source reference.
7
+ * Formats:
8
+ * npm:package-name[@version][:path]
9
+ * @scope/package-name[@version][:path]
10
+ */
11
+ export interface NpmSourceRef {
12
+ /** Full package name (e.g. "@acme/agent-rules" or "my-rules") */
13
+ packageName: string;
14
+ /** Requested version/tag (default: "latest") */
15
+ version: string;
16
+ /** Optional subpath within the package (e.g. "packs/security") */
17
+ path: string;
18
+ }
19
+ /**
20
+ * Parse an npm source reference string.
21
+ */
22
+ export declare function parseNpmSourceRef(source: string): NpmSourceRef;
23
+ /**
24
+ * Check if a pack reference is an npm source.
25
+ */
26
+ export declare function isNpmPackRef(packRef: string): boolean;
27
+ /**
28
+ * Build a canonical source key for lockfile entries.
29
+ */
30
+ export declare function npmSourceKey(parsed: NpmSourceRef): string;
@@ -0,0 +1,84 @@
1
+ // @bun
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
7
+ var __toCommonJS = (from) => {
8
+ var entry = __moduleCache.get(from), desc;
9
+ if (entry)
10
+ return entry;
11
+ entry = __defProp({}, "__esModule", { value: true });
12
+ if (from && typeof from === "object" || typeof from === "function")
13
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ }));
17
+ __moduleCache.set(from, entry);
18
+ return entry;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, {
23
+ get: all[name],
24
+ enumerable: true,
25
+ configurable: true,
26
+ set: (newValue) => all[name] = () => newValue
27
+ });
28
+ };
29
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
+ var __require = import.meta.require;
31
+
32
+ // src/sources/npm-ref.ts
33
+ function parseNpmSourceRef(source) {
34
+ let s = source;
35
+ if (s.startsWith("npm:")) {
36
+ s = s.slice(4);
37
+ }
38
+ let path = "";
39
+ const pathColonIdx = findPathColon(s);
40
+ if (pathColonIdx > -1) {
41
+ path = s.slice(pathColonIdx + 1);
42
+ s = s.slice(0, pathColonIdx);
43
+ }
44
+ let version = "latest";
45
+ const versionAtIdx = findVersionAt(s);
46
+ if (versionAtIdx > -1) {
47
+ version = s.slice(versionAtIdx + 1);
48
+ s = s.slice(0, versionAtIdx);
49
+ }
50
+ if (!s) {
51
+ throw new Error(`Invalid npm source reference: "${source}". Expected package name.`);
52
+ }
53
+ return { packageName: s, version, path };
54
+ }
55
+ function findPathColon(s) {
56
+ const startAfter = s.startsWith("@") ? s.indexOf("/") + 1 : 0;
57
+ const vAt = findVersionAt(s);
58
+ const searchFrom = vAt > -1 ? vAt : startAfter;
59
+ return s.indexOf(":", searchFrom);
60
+ }
61
+ function findVersionAt(s) {
62
+ if (s.startsWith("@")) {
63
+ const slashIdx = s.indexOf("/");
64
+ if (slashIdx === -1)
65
+ return -1;
66
+ return s.indexOf("@", slashIdx + 1);
67
+ }
68
+ return s.indexOf("@");
69
+ }
70
+ function isNpmPackRef(packRef) {
71
+ if (packRef.startsWith("npm:"))
72
+ return true;
73
+ if (packRef.startsWith("@") && packRef.includes("/"))
74
+ return true;
75
+ return false;
76
+ }
77
+ function npmSourceKey(parsed) {
78
+ return `npm:${parsed.packageName}`;
79
+ }
80
+ export {
81
+ parseNpmSourceRef,
82
+ npmSourceKey,
83
+ isNpmPackRef
84
+ };
@@ -0,0 +1,20 @@
1
+ import { type Lockfile } from '../core/lockfile.js';
2
+ import { type NpmSourceRef } from './npm-ref.js';
3
+ /**
4
+ * Resolve an npm package version to exact version + tarball URL.
5
+ */
6
+ export declare function resolveNpmVersion(parsed: NpmSourceRef): Promise<{
7
+ version: string;
8
+ tarball: string;
9
+ }>;
10
+ /**
11
+ * Install an npm-based pack source using `npm pack` + tar extraction.
12
+ * Falls back to tarball download if npm CLI is unavailable.
13
+ */
14
+ export declare function installNpmSource(projectRoot: string, source: string, lockfile: Lockfile, options?: {
15
+ update?: boolean;
16
+ frozen?: boolean;
17
+ }): Promise<{
18
+ installed: string[];
19
+ warnings: string[];
20
+ }>;
@@ -0,0 +1,211 @@
1
+ // @bun
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
7
+ var __toCommonJS = (from) => {
8
+ var entry = __moduleCache.get(from), desc;
9
+ if (entry)
10
+ return entry;
11
+ entry = __defProp({}, "__esModule", { value: true });
12
+ if (from && typeof from === "object" || typeof from === "function")
13
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ }));
17
+ __moduleCache.set(from, entry);
18
+ return entry;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, {
23
+ get: all[name],
24
+ enumerable: true,
25
+ configurable: true,
26
+ set: (newValue) => all[name] = () => newValue
27
+ });
28
+ };
29
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
+ var __require = import.meta.require;
31
+
32
+ // src/core/lockfile.ts
33
+ import { existsSync, readFileSync, writeFileSync } from "fs";
34
+ import { resolve } from "path";
35
+ import { createHash } from "crypto";
36
+ var LOCKFILE_VERSION = 1;
37
+ var LOCKFILE_NAME = "agentpacks.lock";
38
+ function loadLockfile(projectRoot) {
39
+ const filepath = resolve(projectRoot, LOCKFILE_NAME);
40
+ if (!existsSync(filepath)) {
41
+ return { lockfileVersion: LOCKFILE_VERSION, sources: {} };
42
+ }
43
+ const raw = readFileSync(filepath, "utf-8");
44
+ return JSON.parse(raw);
45
+ }
46
+ function saveLockfile(projectRoot, lockfile) {
47
+ const filepath = resolve(projectRoot, LOCKFILE_NAME);
48
+ writeFileSync(filepath, JSON.stringify(lockfile, null, 2) + `
49
+ `);
50
+ }
51
+ function getLockedSource(lockfile, sourceKey) {
52
+ return lockfile.sources[sourceKey];
53
+ }
54
+ function setLockedSource(lockfile, sourceKey, entry) {
55
+ lockfile.sources[sourceKey] = entry;
56
+ }
57
+ function computeIntegrity(content) {
58
+ const hash = createHash("sha256").update(content).digest("hex");
59
+ return `sha256-${hash}`;
60
+ }
61
+ function isLockfileFrozenValid(lockfile, sourceKeys) {
62
+ const missing = sourceKeys.filter((key) => !(key in lockfile.sources));
63
+ return { valid: missing.length === 0, missing };
64
+ }
65
+
66
+ // src/sources/npm-ref.ts
67
+ function parseNpmSourceRef(source) {
68
+ let s = source;
69
+ if (s.startsWith("npm:")) {
70
+ s = s.slice(4);
71
+ }
72
+ let path = "";
73
+ const pathColonIdx = findPathColon(s);
74
+ if (pathColonIdx > -1) {
75
+ path = s.slice(pathColonIdx + 1);
76
+ s = s.slice(0, pathColonIdx);
77
+ }
78
+ let version = "latest";
79
+ const versionAtIdx = findVersionAt(s);
80
+ if (versionAtIdx > -1) {
81
+ version = s.slice(versionAtIdx + 1);
82
+ s = s.slice(0, versionAtIdx);
83
+ }
84
+ if (!s) {
85
+ throw new Error(`Invalid npm source reference: "${source}". Expected package name.`);
86
+ }
87
+ return { packageName: s, version, path };
88
+ }
89
+ function findPathColon(s) {
90
+ const startAfter = s.startsWith("@") ? s.indexOf("/") + 1 : 0;
91
+ const vAt = findVersionAt(s);
92
+ const searchFrom = vAt > -1 ? vAt : startAfter;
93
+ return s.indexOf(":", searchFrom);
94
+ }
95
+ function findVersionAt(s) {
96
+ if (s.startsWith("@")) {
97
+ const slashIdx = s.indexOf("/");
98
+ if (slashIdx === -1)
99
+ return -1;
100
+ return s.indexOf("@", slashIdx + 1);
101
+ }
102
+ return s.indexOf("@");
103
+ }
104
+ function isNpmPackRef(packRef) {
105
+ if (packRef.startsWith("npm:"))
106
+ return true;
107
+ if (packRef.startsWith("@") && packRef.includes("/"))
108
+ return true;
109
+ return false;
110
+ }
111
+ function npmSourceKey(parsed) {
112
+ return `npm:${parsed.packageName}`;
113
+ }
114
+
115
+ // src/sources/npm.ts
116
+ import { mkdirSync, existsSync as existsSync2 } from "fs";
117
+ import { resolve as resolve2, join } from "path";
118
+ import { execSync } from "child_process";
119
+ var NPM_REGISTRY = "https://registry.npmjs.org";
120
+ async function resolveNpmVersion(parsed) {
121
+ const url = `${NPM_REGISTRY}/${encodeURIComponent(parsed.packageName)}/${parsed.version}`;
122
+ const res = await fetch(url, {
123
+ headers: { Accept: "application/json" }
124
+ });
125
+ if (!res.ok) {
126
+ throw new Error(`Could not resolve npm package "${parsed.packageName}@${parsed.version}": ${res.status}`);
127
+ }
128
+ const data = await res.json();
129
+ return { version: data.version, tarball: data.dist.tarball };
130
+ }
131
+ async function installNpmSource(projectRoot, source, lockfile, options = {}) {
132
+ const parsed = parseNpmSourceRef(source);
133
+ const sourceKey = npmSourceKey(parsed);
134
+ const installed = [];
135
+ const warnings = [];
136
+ const locked = getLockedSource(lockfile, sourceKey);
137
+ if (options.frozen && !locked) {
138
+ throw new Error(`Frozen mode: no lockfile entry for source "${sourceKey}".`);
139
+ }
140
+ let resolvedVersion;
141
+ let tarballUrl;
142
+ if (locked && !options.update) {
143
+ resolvedVersion = locked.resolvedRef;
144
+ tarballUrl = "";
145
+ } else {
146
+ const resolved = await resolveNpmVersion(parsed);
147
+ resolvedVersion = resolved.version;
148
+ tarballUrl = resolved.tarball;
149
+ }
150
+ const curatedDir = resolve2(projectRoot, ".agentpacks", ".curated");
151
+ mkdirSync(curatedDir, { recursive: true });
152
+ const packDir = extractNpmPack(parsed, resolvedVersion, curatedDir, installed, warnings);
153
+ const newEntry = {
154
+ requestedRef: parsed.version,
155
+ resolvedRef: resolvedVersion,
156
+ resolvedAt: new Date().toISOString(),
157
+ skills: {},
158
+ packs: {}
159
+ };
160
+ setLockedSource(lockfile, sourceKey, newEntry);
161
+ return { installed, warnings };
162
+ }
163
+ function extractNpmPack(parsed, version, curatedDir, installed, warnings) {
164
+ const pkgSpec = `${parsed.packageName}@${version}`;
165
+ const packName = parsed.packageName.replace(/^@/, "").replace(/\//g, "-");
166
+ const packOutDir = resolve2(curatedDir, packName);
167
+ try {
168
+ const tmpDir = resolve2(curatedDir, ".tmp-npm");
169
+ mkdirSync(tmpDir, { recursive: true });
170
+ execSync(`npm pack ${pkgSpec} --pack-destination "${tmpDir}"`, {
171
+ stdio: "pipe",
172
+ timeout: 30000
173
+ });
174
+ const tgzFiles = __require("fs").readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
175
+ if (tgzFiles.length === 0) {
176
+ warnings.push(`No tarball found for ${pkgSpec}`);
177
+ return packOutDir;
178
+ }
179
+ const tgzPath = join(tmpDir, tgzFiles[0]);
180
+ mkdirSync(packOutDir, { recursive: true });
181
+ execSync(`tar xzf "${tgzPath}" -C "${packOutDir}" --strip-components=1`, {
182
+ stdio: "pipe",
183
+ timeout: 15000
184
+ });
185
+ execSync(`rm -rf "${tmpDir}"`, { stdio: "pipe" });
186
+ const subpath = parsed.path || "";
187
+ const targetDir = subpath ? join(packOutDir, subpath) : packOutDir;
188
+ if (existsSync2(targetDir)) {
189
+ collectFiles(targetDir, installed);
190
+ }
191
+ } catch (err) {
192
+ warnings.push(`Failed to extract npm pack ${pkgSpec}: ${err instanceof Error ? err.message : String(err)}`);
193
+ }
194
+ return packOutDir;
195
+ }
196
+ function collectFiles(dir, out) {
197
+ const fs = __require("fs");
198
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
199
+ for (const entry of entries) {
200
+ const full = join(dir, entry.name);
201
+ if (entry.isDirectory()) {
202
+ collectFiles(full, out);
203
+ } else {
204
+ out.push(full);
205
+ }
206
+ }
207
+ }
208
+ export {
209
+ resolveNpmVersion,
210
+ installNpmSource
211
+ };
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Cline — VS Code AI extension.
3
+ * Config: .cline/rules/*.md, .cline/mcp.json
4
+ */
5
+ export declare const ClineTarget: import("./base-target.js").BaseTarget;
6
+ /**
7
+ * Kilo Code — AI coding assistant (Cline fork).
8
+ * Config: .kilo/rules/*.md
9
+ */
10
+ export declare const KiloTarget: import("./base-target.js").BaseTarget;
11
+ /**
12
+ * Roo Code — AI coding assistant (Cline fork).
13
+ * Config: .roo/rules/*.md
14
+ */
15
+ export declare const RooTarget: import("./base-target.js").BaseTarget;
16
+ /**
17
+ * Qwen Code — Alibaba's AI coding assistant.
18
+ * Config: .qwencode/rules/*.md
19
+ */
20
+ export declare const QwenCodeTarget: import("./base-target.js").BaseTarget;
21
+ /**
22
+ * Kiro — AWS AI coding assistant.
23
+ * Config: .kiro/rules/*.md
24
+ */
25
+ export declare const KiroTarget: import("./base-target.js").BaseTarget;
26
+ /**
27
+ * Factory Droid — AI coding assistant.
28
+ * Config: .factorydroid/rules/*.md
29
+ */
30
+ export declare const FactoryDroidTarget: import("./base-target.js").BaseTarget;
31
+ /**
32
+ * AntiGravity — AI coding assistant.
33
+ * Config: .antigravity/rules/*.md
34
+ */
35
+ export declare const AntiGravityTarget: import("./base-target.js").BaseTarget;
36
+ /**
37
+ * JetBrains Junie — AI coding assistant.
38
+ * Config: .junie/rules/*.md
39
+ */
40
+ export declare const JunieTarget: import("./base-target.js").BaseTarget;
41
+ /**
42
+ * Augment Code — AI coding assistant.
43
+ * Config: .augmentcode/rules/*.md
44
+ */
45
+ export declare const AugmentCodeTarget: import("./base-target.js").BaseTarget;
46
+ /**
47
+ * Windsurf — AI coding IDE.
48
+ * Config: .windsurf/rules/*.md, .windsurfrules
49
+ */
50
+ export declare const WindsurfTarget: import("./base-target.js").BaseTarget;
51
+ /**
52
+ * Warp — AI-native terminal.
53
+ * Config: .warp/rules/*.md
54
+ */
55
+ export declare const WarpTarget: import("./base-target.js").BaseTarget;
56
+ /**
57
+ * Replit Agent — cloud IDE AI.
58
+ * Config: .replit/rules/*.md
59
+ */
60
+ export declare const ReplitTarget: import("./base-target.js").BaseTarget;
61
+ /**
62
+ * Zed — high-performance editor with AI.
63
+ * Config: .zed/rules/*.md
64
+ */
65
+ export declare const ZedTarget: import("./base-target.js").BaseTarget;