agentloom 0.1.10 → 0.1.11
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 +1 -1
- package/dist/core/copy.js +1 -1
- package/dist/core/importer.js +2 -2
- package/dist/core/sources.js +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ Source path resolution is additive and priority-ordered:
|
|
|
72
72
|
- Agents: `.agents/agents` -> `agents`
|
|
73
73
|
- Commands: `.agents/commands` -> `commands` -> `prompts` -> provider fallbacks `.github/prompts` + `.gemini/commands`
|
|
74
74
|
- Rules: `.agents/rules` -> `rules`
|
|
75
|
-
- Skills: `.agents/skills` -> `skills` -> root `SKILL.md` fallback
|
|
75
|
+
- Skills: `.agents/skills` -> `skills` -> root `SKILL.md` -> root `<name>/SKILL.md` fallback
|
|
76
76
|
- MCP: `.agents/mcp.json` -> `mcp.json`
|
|
77
77
|
|
|
78
78
|
Aggregate `agentloom add <source>` can import command/skill/MCP-only repositories even when no `agents/` directory exists.
|
package/dist/core/copy.js
CHANGED
|
@@ -76,7 +76,7 @@ Source discovery:
|
|
|
76
76
|
agents: .agents/agents -> agents
|
|
77
77
|
commands: .agents/commands -> commands -> prompts -> (.github/prompts + .gemini/commands fallback)
|
|
78
78
|
rules: .agents/rules -> rules
|
|
79
|
-
skills: .agents/skills -> skills -> root SKILL.md
|
|
79
|
+
skills: .agents/skills -> skills -> root SKILL.md -> root <name>/SKILL.md
|
|
80
80
|
|
|
81
81
|
Usage:
|
|
82
82
|
agentloom add <source> [options]
|
package/dist/core/importer.js
CHANGED
|
@@ -121,7 +121,7 @@ export async function importSource(options) {
|
|
|
121
121
|
if (shouldImportSkills &&
|
|
122
122
|
options.requireSkills &&
|
|
123
123
|
sourceSkillsDirs.length === 0) {
|
|
124
|
-
throw new Error(`No source skills directory found under ${prepared.importRoot} (expected .agents/skills/, skills/, or root SKILL.md, including plugin sources declared in .claude-plugin/marketplace.json).`);
|
|
124
|
+
throw new Error(`No source skills directory found under ${prepared.importRoot} (expected .agents/skills/, skills/, root SKILL.md, or root <name>/SKILL.md directories, including plugin sources declared in .claude-plugin/marketplace.json).`);
|
|
125
125
|
}
|
|
126
126
|
if (shouldImportSkills &&
|
|
127
127
|
options.requireSkills &&
|
|
@@ -134,7 +134,7 @@ export async function importSource(options) {
|
|
|
134
134
|
sourceRules.length === 0 &&
|
|
135
135
|
sourceSkills.length === 0 &&
|
|
136
136
|
Object.keys(sourceMcp?.mcpServers ?? {}).length === 0) {
|
|
137
|
-
throw new Error(`No importable entities found in source "${sourceLocation}".\nExpected agents/, .agents/agents/, .github/agents/, commands/, .agents/commands/, prompts/, .gemini/commands/, .github/prompts/, mcp.json/.agents/mcp.json, rules/.agents/rules/, skills/, .agents/skills/, root SKILL.md, or plugin sources from .claude-plugin/marketplace.json.`);
|
|
137
|
+
throw new Error(`No importable entities found in source "${sourceLocation}".\nExpected agents/, .agents/agents/, .github/agents/, commands/, .agents/commands/, prompts/, .gemini/commands/, .github/prompts/, mcp.json/.agents/mcp.json, rules/.agents/rules/, skills/, .agents/skills/, root SKILL.md, root <name>/SKILL.md directories, or plugin sources from .claude-plugin/marketplace.json.`);
|
|
138
138
|
}
|
|
139
139
|
const shouldResolveAgents = shouldImportAgents &&
|
|
140
140
|
(sourceAgents.length > 0 ||
|
package/dist/core/sources.js
CHANGED
|
@@ -209,6 +209,9 @@ function discoverSourceSkillsDirsForRoot(importRoot) {
|
|
|
209
209
|
if (fs.existsSync(rootSkill) && fs.statSync(rootSkill).isFile()) {
|
|
210
210
|
return [importRoot];
|
|
211
211
|
}
|
|
212
|
+
if (hasImmediateRootSkillDirs(importRoot)) {
|
|
213
|
+
return [importRoot];
|
|
214
|
+
}
|
|
212
215
|
return [];
|
|
213
216
|
}
|
|
214
217
|
function discoverSourceRulesDirsForRoot(importRoot) {
|
|
@@ -225,6 +228,18 @@ function discoverSourceRulesDirsForRoot(importRoot) {
|
|
|
225
228
|
function dedupePaths(paths) {
|
|
226
229
|
return [...new Set(paths)];
|
|
227
230
|
}
|
|
231
|
+
function hasImmediateRootSkillDirs(importRoot) {
|
|
232
|
+
for (const entry of fs.readdirSync(importRoot, { withFileTypes: true })) {
|
|
233
|
+
if (!entry.isDirectory()) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
const skillFile = path.join(importRoot, entry.name, "SKILL.md");
|
|
237
|
+
if (fs.existsSync(skillFile) && fs.statSync(skillFile).isFile()) {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
228
243
|
function isPathWithinRoot(rootPath, targetPath) {
|
|
229
244
|
const relative = path.relative(rootPath, targetPath);
|
|
230
245
|
return (relative === "" ||
|