agentpacks 1.7.6 → 1.7.8
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 +69 -742
- package/dist/api.d.ts +15 -15
- package/dist/api.js +2706 -2706
- package/dist/cli/export-cmd.js +364 -364
- package/dist/cli/generate.js +1409 -1409
- package/dist/cli/import-cmd.js +249 -249
- package/dist/cli/info.js +31 -31
- package/dist/cli/init.js +6 -6
- package/dist/cli/install.js +141 -141
- package/dist/cli/login.js +31 -31
- package/dist/cli/models-explain.js +514 -514
- package/dist/cli/pack/create.js +6 -6
- package/dist/cli/pack/enable.js +2 -2
- package/dist/cli/pack/list.js +362 -362
- package/dist/cli/pack/validate.js +119 -119
- package/dist/cli/publish.js +42 -42
- package/dist/cli/search.js +31 -31
- package/dist/core/config.js +3 -3
- package/dist/core/feature-merger.d.ts +5 -5
- package/dist/core/feature-merger.js +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +633 -633
- package/dist/core/lockfile.js +1 -1
- package/dist/core/metarepo.js +3 -3
- package/dist/core/pack-loader.d.ts +6 -6
- package/dist/core/pack-loader.js +362 -362
- package/dist/core/profile-resolver.d.ts +1 -1
- package/dist/exporters/cursor-plugin.d.ts +12 -0
- package/dist/exporters/cursor-plugin.js +46 -46
- package/dist/exporters/index.d.ts +1 -1
- package/dist/exporters/index.js +46 -46
- package/dist/features/agents.js +4 -4
- package/dist/features/commands.js +4 -4
- package/dist/features/hooks.js +4 -4
- package/dist/features/index.d.ts +8 -8
- package/dist/features/index.js +350 -350
- package/dist/features/mcp.js +4 -4
- package/dist/features/models.js +4 -4
- package/dist/features/plugins.js +5 -5
- package/dist/features/rules.js +4 -4
- package/dist/features/skills.js +5 -5
- package/dist/importers/claude-code.js +6 -6
- package/dist/importers/cursor.js +7 -7
- package/dist/importers/opencode.js +7 -7
- package/dist/importers/rulesync.js +7 -7
- package/dist/index.js +2674 -2674
- package/dist/node/api.js +2706 -2706
- package/dist/node/cli/export-cmd.js +364 -364
- package/dist/node/cli/generate.js +1409 -1409
- package/dist/node/cli/import-cmd.js +249 -249
- package/dist/node/cli/info.js +31 -31
- package/dist/node/cli/init.js +6 -6
- package/dist/node/cli/install.js +141 -141
- package/dist/node/cli/login.js +31 -31
- package/dist/node/cli/models-explain.js +514 -514
- package/dist/node/cli/pack/create.js +6 -6
- package/dist/node/cli/pack/enable.js +2 -2
- package/dist/node/cli/pack/list.js +362 -362
- package/dist/node/cli/pack/validate.js +119 -119
- package/dist/node/cli/publish.js +42 -42
- package/dist/node/cli/search.js +31 -31
- package/dist/node/core/config.js +3 -3
- package/dist/node/core/feature-merger.js +4 -4
- package/dist/node/core/index.js +633 -633
- package/dist/node/core/lockfile.js +1 -1
- package/dist/node/core/metarepo.js +3 -3
- package/dist/node/core/pack-loader.js +362 -362
- package/dist/node/exporters/cursor-plugin.js +46 -46
- package/dist/node/exporters/index.js +46 -46
- package/dist/node/features/agents.js +4 -4
- package/dist/node/features/commands.js +4 -4
- package/dist/node/features/hooks.js +4 -4
- package/dist/node/features/index.js +350 -350
- package/dist/node/features/mcp.js +4 -4
- package/dist/node/features/models.js +4 -4
- package/dist/node/features/plugins.js +5 -5
- package/dist/node/features/rules.js +4 -4
- package/dist/node/features/skills.js +5 -5
- package/dist/node/importers/claude-code.js +6 -6
- package/dist/node/importers/cursor.js +7 -7
- package/dist/node/importers/opencode.js +7 -7
- package/dist/node/importers/rulesync.js +7 -7
- package/dist/node/index.js +2674 -2674
- package/dist/node/sources/git.js +2 -2
- package/dist/node/sources/index.js +138 -138
- package/dist/node/sources/local.js +1 -1
- package/dist/node/sources/npm.js +3 -3
- package/dist/node/sources/registry.js +35 -35
- package/dist/node/targets/additional-targets.js +43 -43
- package/dist/node/targets/agents-md.js +4 -4
- package/dist/node/targets/claude-code.js +86 -86
- package/dist/node/targets/codex-cli.js +6 -6
- package/dist/node/targets/copilot.js +46 -46
- package/dist/node/targets/cursor.js +68 -68
- package/dist/node/targets/gemini-cli.js +25 -25
- package/dist/node/targets/generic-md-target.js +43 -43
- package/dist/node/targets/index.js +911 -911
- package/dist/node/targets/mistral-vibe.js +46 -46
- package/dist/node/targets/opencode.js +68 -68
- package/dist/node/targets/registry.js +911 -911
- package/dist/node/utils/credentials.js +2 -2
- package/dist/node/utils/filesystem.js +4 -4
- package/dist/node/utils/global.js +1 -1
- package/dist/node/utils/tarball.js +2 -2
- package/dist/sources/git.js +2 -2
- package/dist/sources/index.d.ts +6 -6
- package/dist/sources/index.js +138 -138
- package/dist/sources/local.js +1 -1
- package/dist/sources/npm.d.ts +3 -0
- package/dist/sources/npm.js +3 -3
- package/dist/sources/registry.js +35 -35
- package/dist/targets/additional-targets.js +43 -43
- package/dist/targets/agents-md.js +4 -4
- package/dist/targets/claude-code.js +86 -86
- package/dist/targets/codex-cli.js +6 -6
- package/dist/targets/copilot.js +46 -46
- package/dist/targets/cursor.js +68 -68
- package/dist/targets/gemini-cli.js +25 -25
- package/dist/targets/generic-md-target.js +43 -43
- package/dist/targets/index.d.ts +6 -6
- package/dist/targets/index.js +911 -911
- package/dist/targets/mistral-vibe.js +46 -46
- package/dist/targets/opencode.js +68 -68
- package/dist/targets/registry.js +911 -911
- package/dist/utils/credentials.js +2 -2
- package/dist/utils/filesystem.js +4 -4
- package/dist/utils/global.d.ts +3 -0
- package/dist/utils/global.js +1 -1
- package/dist/utils/tarball.js +2 -2
- package/package.json +5 -5
- package/templates/pack/models.json +36 -36
- package/templates/pack/pack.json +8 -8
- package/templates/workspace/agentpacks.jsonc +24 -24
|
@@ -5,13 +5,13 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
5
5
|
import {
|
|
6
6
|
existsSync,
|
|
7
7
|
mkdirSync,
|
|
8
|
-
readFileSync,
|
|
9
|
-
writeFileSync,
|
|
10
8
|
readdirSync,
|
|
9
|
+
readFileSync,
|
|
11
10
|
rmSync,
|
|
12
|
-
statSync
|
|
11
|
+
statSync,
|
|
12
|
+
writeFileSync
|
|
13
13
|
} from "fs";
|
|
14
|
-
import { dirname,
|
|
14
|
+
import { dirname, join, relative } from "path";
|
|
15
15
|
var GENERATED_HEADER_MD = "<!-- Generated by agentpacks. DO NOT EDIT. -->";
|
|
16
16
|
var GENERATED_HEADER_JSON = "// Generated by agentpacks. DO NOT EDIT.";
|
|
17
17
|
var GENERATED_HEADER_JS = "// Generated by agentpacks. DO NOT EDIT.";
|
|
@@ -129,14 +129,14 @@ function serializeFrontmatter(data, content) {
|
|
|
129
129
|
return matter.stringify(content, filtered);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
// src/features/
|
|
132
|
+
// src/features/commands.ts
|
|
133
133
|
import { readFileSync as readFileSync2 } from "fs";
|
|
134
134
|
import { basename } from "path";
|
|
135
|
-
function
|
|
136
|
-
const files = listFiles(
|
|
137
|
-
return files.map((filepath) =>
|
|
135
|
+
function parseCommands(commandsDir, packName) {
|
|
136
|
+
const files = listFiles(commandsDir, { extension: ".md" });
|
|
137
|
+
return files.map((filepath) => parseCommandFile(filepath, packName));
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function parseCommandFile(filepath, packName) {
|
|
140
140
|
const raw = readFileSync2(filepath, "utf-8");
|
|
141
141
|
const { data, content } = parseFrontmatter(raw);
|
|
142
142
|
return {
|
|
@@ -147,29 +147,23 @@ function parseRuleFile(filepath, packName) {
|
|
|
147
147
|
content
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const { targets } =
|
|
150
|
+
function commandMatchesTarget(cmd, targetId) {
|
|
151
|
+
const { targets } = cmd.meta;
|
|
152
152
|
if (!targets || targets === "*")
|
|
153
153
|
return true;
|
|
154
154
|
if (Array.isArray(targets) && targets.includes("*"))
|
|
155
155
|
return true;
|
|
156
156
|
return Array.isArray(targets) && targets.includes(targetId);
|
|
157
157
|
}
|
|
158
|
-
function getRootRules(rules) {
|
|
159
|
-
return rules.filter((r) => r.meta.root === true);
|
|
160
|
-
}
|
|
161
|
-
function getDetailRules(rules) {
|
|
162
|
-
return rules.filter((r) => r.meta.root !== true);
|
|
163
|
-
}
|
|
164
158
|
|
|
165
|
-
// src/features/
|
|
159
|
+
// src/features/rules.ts
|
|
166
160
|
import { readFileSync as readFileSync3 } from "fs";
|
|
167
161
|
import { basename as basename2 } from "path";
|
|
168
|
-
function
|
|
169
|
-
const files = listFiles(
|
|
170
|
-
return files.map((filepath) =>
|
|
162
|
+
function parseRules(rulesDir, packName) {
|
|
163
|
+
const files = listFiles(rulesDir, { extension: ".md" });
|
|
164
|
+
return files.map((filepath) => parseRuleFile(filepath, packName));
|
|
171
165
|
}
|
|
172
|
-
function
|
|
166
|
+
function parseRuleFile(filepath, packName) {
|
|
173
167
|
const raw = readFileSync3(filepath, "utf-8");
|
|
174
168
|
const { data, content } = parseFrontmatter(raw);
|
|
175
169
|
return {
|
|
@@ -180,14 +174,20 @@ function parseCommandFile(filepath, packName) {
|
|
|
180
174
|
content
|
|
181
175
|
};
|
|
182
176
|
}
|
|
183
|
-
function
|
|
184
|
-
const { targets } =
|
|
177
|
+
function ruleMatchesTarget(rule, targetId) {
|
|
178
|
+
const { targets } = rule.meta;
|
|
185
179
|
if (!targets || targets === "*")
|
|
186
180
|
return true;
|
|
187
181
|
if (Array.isArray(targets) && targets.includes("*"))
|
|
188
182
|
return true;
|
|
189
183
|
return Array.isArray(targets) && targets.includes(targetId);
|
|
190
184
|
}
|
|
185
|
+
function getRootRules(rules) {
|
|
186
|
+
return rules.filter((r) => r.meta.root === true);
|
|
187
|
+
}
|
|
188
|
+
function getDetailRules(rules) {
|
|
189
|
+
return rules.filter((r) => r.meta.root !== true);
|
|
190
|
+
}
|
|
191
191
|
|
|
192
192
|
// src/targets/base-target.ts
|
|
193
193
|
class BaseTarget {
|
|
@@ -208,7 +208,7 @@ class BaseTarget {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
// src/targets/gemini-cli.ts
|
|
211
|
-
import {
|
|
211
|
+
import { join as join2, resolve } from "path";
|
|
212
212
|
var TARGET_ID = "geminicli";
|
|
213
213
|
|
|
214
214
|
class GeminiCliTarget extends BaseTarget {
|
|
@@ -5,13 +5,13 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
5
5
|
import {
|
|
6
6
|
existsSync,
|
|
7
7
|
mkdirSync,
|
|
8
|
-
readFileSync,
|
|
9
|
-
writeFileSync,
|
|
10
8
|
readdirSync,
|
|
9
|
+
readFileSync,
|
|
11
10
|
rmSync,
|
|
12
|
-
statSync
|
|
11
|
+
statSync,
|
|
12
|
+
writeFileSync
|
|
13
13
|
} from "fs";
|
|
14
|
-
import { dirname,
|
|
14
|
+
import { dirname, join, relative } from "path";
|
|
15
15
|
var GENERATED_HEADER_MD = "<!-- Generated by agentpacks. DO NOT EDIT. -->";
|
|
16
16
|
var GENERATED_HEADER_JSON = "// Generated by agentpacks. DO NOT EDIT.";
|
|
17
17
|
var GENERATED_HEADER_JS = "// Generated by agentpacks. DO NOT EDIT.";
|
|
@@ -129,14 +129,14 @@ function serializeFrontmatter(data, content) {
|
|
|
129
129
|
return matter.stringify(content, filtered);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
// src/features/
|
|
132
|
+
// src/features/commands.ts
|
|
133
133
|
import { readFileSync as readFileSync2 } from "fs";
|
|
134
134
|
import { basename } from "path";
|
|
135
|
-
function
|
|
136
|
-
const files = listFiles(
|
|
137
|
-
return files.map((filepath) =>
|
|
135
|
+
function parseCommands(commandsDir, packName) {
|
|
136
|
+
const files = listFiles(commandsDir, { extension: ".md" });
|
|
137
|
+
return files.map((filepath) => parseCommandFile(filepath, packName));
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function parseCommandFile(filepath, packName) {
|
|
140
140
|
const raw = readFileSync2(filepath, "utf-8");
|
|
141
141
|
const { data, content } = parseFrontmatter(raw);
|
|
142
142
|
return {
|
|
@@ -147,29 +147,23 @@ function parseRuleFile(filepath, packName) {
|
|
|
147
147
|
content
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const { targets } =
|
|
150
|
+
function commandMatchesTarget(cmd, targetId) {
|
|
151
|
+
const { targets } = cmd.meta;
|
|
152
152
|
if (!targets || targets === "*")
|
|
153
153
|
return true;
|
|
154
154
|
if (Array.isArray(targets) && targets.includes("*"))
|
|
155
155
|
return true;
|
|
156
156
|
return Array.isArray(targets) && targets.includes(targetId);
|
|
157
157
|
}
|
|
158
|
-
function getRootRules(rules) {
|
|
159
|
-
return rules.filter((r) => r.meta.root === true);
|
|
160
|
-
}
|
|
161
|
-
function getDetailRules(rules) {
|
|
162
|
-
return rules.filter((r) => r.meta.root !== true);
|
|
163
|
-
}
|
|
164
158
|
|
|
165
|
-
// src/features/
|
|
159
|
+
// src/features/rules.ts
|
|
166
160
|
import { readFileSync as readFileSync3 } from "fs";
|
|
167
161
|
import { basename as basename2 } from "path";
|
|
168
|
-
function
|
|
169
|
-
const files = listFiles(
|
|
170
|
-
return files.map((filepath) =>
|
|
162
|
+
function parseRules(rulesDir, packName) {
|
|
163
|
+
const files = listFiles(rulesDir, { extension: ".md" });
|
|
164
|
+
return files.map((filepath) => parseRuleFile(filepath, packName));
|
|
171
165
|
}
|
|
172
|
-
function
|
|
166
|
+
function parseRuleFile(filepath, packName) {
|
|
173
167
|
const raw = readFileSync3(filepath, "utf-8");
|
|
174
168
|
const { data, content } = parseFrontmatter(raw);
|
|
175
169
|
return {
|
|
@@ -180,14 +174,20 @@ function parseCommandFile(filepath, packName) {
|
|
|
180
174
|
content
|
|
181
175
|
};
|
|
182
176
|
}
|
|
183
|
-
function
|
|
184
|
-
const { targets } =
|
|
177
|
+
function ruleMatchesTarget(rule, targetId) {
|
|
178
|
+
const { targets } = rule.meta;
|
|
185
179
|
if (!targets || targets === "*")
|
|
186
180
|
return true;
|
|
187
181
|
if (Array.isArray(targets) && targets.includes("*"))
|
|
188
182
|
return true;
|
|
189
183
|
return Array.isArray(targets) && targets.includes(targetId);
|
|
190
184
|
}
|
|
185
|
+
function getRootRules(rules) {
|
|
186
|
+
return rules.filter((r) => r.meta.root === true);
|
|
187
|
+
}
|
|
188
|
+
function getDetailRules(rules) {
|
|
189
|
+
return rules.filter((r) => r.meta.root !== true);
|
|
190
|
+
}
|
|
191
191
|
|
|
192
192
|
// src/core/profile-resolver.ts
|
|
193
193
|
function resolveModels(merged, modelProfile, targetId) {
|
|
@@ -293,24 +293,6 @@ function resolveProfileChain(name, profiles, visited, depth) {
|
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
// src/targets/base-target.ts
|
|
297
|
-
class BaseTarget {
|
|
298
|
-
supportsFeature(feature) {
|
|
299
|
-
return this.supportedFeatures.includes(feature);
|
|
300
|
-
}
|
|
301
|
-
getEffectiveFeatures(enabledFeatures) {
|
|
302
|
-
return enabledFeatures.filter((f) => this.supportsFeature(f));
|
|
303
|
-
}
|
|
304
|
-
createResult(filesWritten = [], filesDeleted = [], warnings = []) {
|
|
305
|
-
return {
|
|
306
|
-
targetId: this.id,
|
|
307
|
-
filesWritten,
|
|
308
|
-
filesDeleted,
|
|
309
|
-
warnings
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
296
|
// src/utils/model-guidance.ts
|
|
315
297
|
function generateModelGuidanceMarkdown(resolved) {
|
|
316
298
|
if (!resolved.default && !resolved.small && Object.keys(resolved.agents).length === 0 && Object.keys(resolved.profiles).length === 0) {
|
|
@@ -384,8 +366,26 @@ function generateModelGuidanceMarkdown(resolved) {
|
|
|
384
366
|
`);
|
|
385
367
|
}
|
|
386
368
|
|
|
369
|
+
// src/targets/base-target.ts
|
|
370
|
+
class BaseTarget {
|
|
371
|
+
supportsFeature(feature) {
|
|
372
|
+
return this.supportedFeatures.includes(feature);
|
|
373
|
+
}
|
|
374
|
+
getEffectiveFeatures(enabledFeatures) {
|
|
375
|
+
return enabledFeatures.filter((f) => this.supportsFeature(f));
|
|
376
|
+
}
|
|
377
|
+
createResult(filesWritten = [], filesDeleted = [], warnings = []) {
|
|
378
|
+
return {
|
|
379
|
+
targetId: this.id,
|
|
380
|
+
filesWritten,
|
|
381
|
+
filesDeleted,
|
|
382
|
+
warnings
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
387
|
// src/targets/generic-md-target.ts
|
|
388
|
-
import {
|
|
388
|
+
import { join as join2, resolve } from "path";
|
|
389
389
|
function createGenericMdTarget(config) {
|
|
390
390
|
return new GenericMdTarget(config);
|
|
391
391
|
}
|