@rbbtsn0w/adg 0.5.0-beta.2 → 0.5.0-beta.4
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 +15 -5
- package/dist/bin/adg.js +18 -1
- package/dist/src/adapters/antigravity-hooks.js +6 -0
- package/dist/src/agents/codex.js +1 -1
- package/dist/src/cli/handlers.js +23 -0
- package/dist/src/cli/index.js +16 -1
- package/dist/src/commands/install.js +6 -2
- package/dist/src/commands/link.js +11 -1
- package/dist/src/commands/state.js +84 -0
- package/dist/src/commands/status.js +12 -4
- package/dist/src/commands/sync.js +15 -11
- package/dist/src/render/json.js +2 -1
- package/dist/src/render/plugins.js +25 -10
- package/dist/src/self-update.js +39 -0
- package/dist/src/types.js +3 -0
- package/dist/src/update-check.js +3 -7
- package/dist/vendor/skills/src/add.js +199 -24
- package/dist/vendor/skills/src/agents.js +49 -1
- package/dist/vendor/skills/src/blob.js +20 -2
- package/dist/vendor/skills/src/cli.js +5 -0
- package/dist/vendor/skills/src/find.js +62 -12
- package/dist/vendor/skills/src/installer.js +173 -30
- package/dist/vendor/skills/src/remove.js +12 -2
- package/dist/vendor/skills/src/update.js +6 -1
- package/docs/cli-json.md +13 -5
- package/docs/local-plugin-registration.md +19 -0
- package/package.json +1 -1
- package/schemas/plugin-lock.schema.json +4 -0
- package/vendor/skills/PROVENANCE.md +25 -3
- package/vendor/skills/package.json +2 -1
- package/vendor/skills/src/add.ts +247 -25
- package/vendor/skills/src/agents.ts +57 -1
- package/vendor/skills/src/blob.ts +23 -2
- package/vendor/skills/src/cli.ts +5 -0
- package/vendor/skills/src/find.ts +74 -12
- package/vendor/skills/src/installer.ts +247 -37
- package/vendor/skills/src/local-lock.ts +7 -0
- package/vendor/skills/src/remove.ts +12 -1
- package/vendor/skills/src/types.ts +1 -0
- package/vendor/skills/src/update.ts +6 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { mkdir, cp, access, readdir, symlink, lstat, rm, readlink, writeFile, stat, realpath, } from 'fs/promises';
|
|
1
|
+
import { mkdir, cp, access, readdir, symlink, lstat, rm, readlink, readFile, writeFile, stat, realpath, } from 'fs/promises';
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
|
-
import { join, basename, normalize, resolve, sep, relative, dirname } from 'path';
|
|
3
|
+
import { join, basename, normalize, resolve, sep, relative, dirname, extname } from 'path';
|
|
4
4
|
import { homedir, platform } from 'os';
|
|
5
|
-
import { agents, detectInstalledAgents, isUniversalAgent } from "./agents.js";
|
|
5
|
+
import { agents, detectInstalledAgents, isUniversalAgent, getEveSubagents, EVE_SUBAGENTS_DIR, } from "./agents.js";
|
|
6
6
|
import { AGENTS_DIR, SKILLS_SUBDIR } from "./constants.js";
|
|
7
|
+
import { parseFrontmatter } from "./frontmatter.js";
|
|
7
8
|
import { parseSkillMd } from "./skills.js";
|
|
8
9
|
/**
|
|
9
10
|
* Sanitizes a filename/directory name to prevent path traversal attacks
|
|
@@ -37,6 +38,9 @@ function isPathSafe(basePath, targetPath) {
|
|
|
37
38
|
const normalizedTarget = normalize(resolve(targetPath));
|
|
38
39
|
return normalizedTarget.startsWith(normalizedBase + sep) || normalizedTarget === normalizedBase;
|
|
39
40
|
}
|
|
41
|
+
function pathsOverlap(pathA, pathB) {
|
|
42
|
+
return isPathSafe(pathA, pathB) || isPathSafe(pathB, pathA);
|
|
43
|
+
}
|
|
40
44
|
// Dirent.isDirectory() is false for symlinks; follow and verify the target is a directory.
|
|
41
45
|
async function isDirEntryOrSymlinkToDir(entry, entryPath) {
|
|
42
46
|
if (entry.isDirectory())
|
|
@@ -54,15 +58,32 @@ export function getCanonicalSkillsDir(global, cwd) {
|
|
|
54
58
|
const baseDir = global ? homedir() : cwd || process.cwd();
|
|
55
59
|
return join(baseDir, AGENTS_DIR, SKILLS_SUBDIR);
|
|
56
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the skills directory for a specific Eve subagent, relative to the
|
|
63
|
+
* project root: `agent/subagents/<name>/skills`. The subagent name is
|
|
64
|
+
* sanitized to prevent directory traversal when it originates from user input.
|
|
65
|
+
*/
|
|
66
|
+
export function getEveSubagentSkillsDir(subagent, cwd) {
|
|
67
|
+
const baseDir = cwd || process.cwd();
|
|
68
|
+
return join(baseDir, EVE_SUBAGENTS_DIR, sanitizeName(subagent), 'skills');
|
|
69
|
+
}
|
|
57
70
|
/**
|
|
58
71
|
* Gets the base directory for an agent's skills, respecting universal agents.
|
|
59
72
|
* Universal agents always use the canonical directory, which prevents
|
|
60
73
|
* redundant symlinks and double-listing of skills.
|
|
74
|
+
*
|
|
75
|
+
* For Eve, an optional `eveSubagent` targets a subagent's skills directory
|
|
76
|
+
* (`agent/subagents/<name>/skills`) instead of the root agent's `agent/skills`.
|
|
61
77
|
*/
|
|
62
|
-
export function getAgentBaseDir(agentType, global, cwd) {
|
|
78
|
+
export function getAgentBaseDir(agentType, global, cwd, eveSubagent) {
|
|
63
79
|
if (isUniversalAgent(agentType)) {
|
|
64
80
|
return getCanonicalSkillsDir(global, cwd);
|
|
65
81
|
}
|
|
82
|
+
// Eve subagents are inherently project-scoped — they live under the project's
|
|
83
|
+
// agent/ directory, so the `global` flag does not apply here.
|
|
84
|
+
if (agentType === 'eve' && eveSubagent) {
|
|
85
|
+
return getEveSubagentSkillsDir(eveSubagent, cwd);
|
|
86
|
+
}
|
|
66
87
|
const agent = agents[agentType];
|
|
67
88
|
const baseDir = global ? homedir() : cwd || process.cwd();
|
|
68
89
|
if (global) {
|
|
@@ -174,7 +195,8 @@ async function createSymlink(target, linkPath) {
|
|
|
174
195
|
const realLinkDir = await resolveParentSymlinks(linkDir);
|
|
175
196
|
const relativePath = relative(realLinkDir, target);
|
|
176
197
|
const symlinkType = platform() === 'win32' ? 'junction' : undefined;
|
|
177
|
-
|
|
198
|
+
const symlinkTarget = symlinkType === 'junction' ? resolvedTarget : relativePath;
|
|
199
|
+
await symlink(symlinkTarget, linkPath, symlinkType);
|
|
178
200
|
return true;
|
|
179
201
|
}
|
|
180
202
|
catch {
|
|
@@ -185,6 +207,7 @@ export async function installSkillForAgent(skill, agentType, options = {}) {
|
|
|
185
207
|
const agent = agents[agentType];
|
|
186
208
|
const isGlobal = options.global ?? false;
|
|
187
209
|
const cwd = options.cwd || process.cwd();
|
|
210
|
+
const eveSubagent = options.eveSubagent;
|
|
188
211
|
// Check if agent supports global installation
|
|
189
212
|
if (isGlobal && agent.globalSkillsDir === undefined) {
|
|
190
213
|
return {
|
|
@@ -197,13 +220,15 @@ export async function installSkillForAgent(skill, agentType, options = {}) {
|
|
|
197
220
|
// Sanitize skill name to prevent directory traversal
|
|
198
221
|
const rawSkillName = skill.name || basename(skill.path);
|
|
199
222
|
const skillName = sanitizeName(rawSkillName);
|
|
223
|
+
const installMode = options.mode ?? 'symlink';
|
|
200
224
|
// Canonical location: .agents/skills/<skill-name>
|
|
201
|
-
const canonicalBase =
|
|
225
|
+
const canonicalBase = agentType === 'eve' && installMode === 'symlink'
|
|
226
|
+
? getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent)
|
|
227
|
+
: getCanonicalSkillsDir(isGlobal, cwd);
|
|
202
228
|
const canonicalDir = join(canonicalBase, skillName);
|
|
203
229
|
// Agent-specific location (for symlink)
|
|
204
|
-
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd);
|
|
230
|
+
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent);
|
|
205
231
|
const agentDir = join(agentBase, skillName);
|
|
206
|
-
const installMode = options.mode ?? 'symlink';
|
|
207
232
|
// Validate paths
|
|
208
233
|
if (!isPathSafe(canonicalBase, canonicalDir)) {
|
|
209
234
|
return {
|
|
@@ -222,19 +247,41 @@ export async function installSkillForAgent(skill, agentType, options = {}) {
|
|
|
222
247
|
};
|
|
223
248
|
}
|
|
224
249
|
try {
|
|
250
|
+
// Never install onto (or inside) the source directory. This can happen with
|
|
251
|
+
// agent-specific project directories like OpenClaw's "skills" when users run
|
|
252
|
+
// `skills add ./skills --all`: the source `./skills/<name>` and destination
|
|
253
|
+
// `./skills/<name>` are the same path. Cleaning the destination would delete
|
|
254
|
+
// the user's source skill before we can link or copy it.
|
|
255
|
+
if (pathsOverlap(skill.path, agentDir)) {
|
|
256
|
+
return {
|
|
257
|
+
success: true,
|
|
258
|
+
path: agentDir,
|
|
259
|
+
mode: installMode,
|
|
260
|
+
skipped: true,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
225
263
|
// For copy mode, skip canonical directory and copy directly to agent location
|
|
226
264
|
if (installMode === 'copy') {
|
|
227
265
|
await cleanAndCreateDirectory(agentDir);
|
|
228
|
-
await copyDirectory(skill.path, agentDir);
|
|
266
|
+
await copyDirectory(skill.path, agentDir, agentType);
|
|
229
267
|
return {
|
|
230
268
|
success: true,
|
|
231
269
|
path: agentDir,
|
|
232
270
|
mode: 'copy',
|
|
233
271
|
};
|
|
234
272
|
}
|
|
273
|
+
if (pathsOverlap(skill.path, canonicalDir)) {
|
|
274
|
+
return {
|
|
275
|
+
success: true,
|
|
276
|
+
path: canonicalDir,
|
|
277
|
+
canonicalPath: canonicalDir,
|
|
278
|
+
mode: 'symlink',
|
|
279
|
+
skipped: true,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
235
282
|
// Symlink mode: copy to canonical location and symlink to agent location
|
|
236
283
|
await cleanAndCreateDirectory(canonicalDir);
|
|
237
|
-
await copyDirectory(skill.path, canonicalDir);
|
|
284
|
+
await copyDirectory(skill.path, canonicalDir, agentType);
|
|
238
285
|
// For universal agents with global install, the skill is already in the canonical
|
|
239
286
|
// ~/.agents/skills directory. Skip creating a symlink to the agent-specific global dir
|
|
240
287
|
// (e.g. ~/.copilot/skills) to avoid duplicates.
|
|
@@ -266,7 +313,7 @@ export async function installSkillForAgent(skill, agentType, options = {}) {
|
|
|
266
313
|
if (!symlinkCreated) {
|
|
267
314
|
// Symlink failed, fall back to copy
|
|
268
315
|
await cleanAndCreateDirectory(agentDir);
|
|
269
|
-
await copyDirectory(skill.path, agentDir);
|
|
316
|
+
await copyDirectory(skill.path, agentDir, agentType);
|
|
270
317
|
return {
|
|
271
318
|
success: true,
|
|
272
319
|
path: agentDir,
|
|
@@ -300,7 +347,29 @@ const isExcluded = (name, isDirectory = false) => {
|
|
|
300
347
|
return true;
|
|
301
348
|
return false;
|
|
302
349
|
};
|
|
303
|
-
|
|
350
|
+
function stripIgnoredEveFrontmatter(raw) {
|
|
351
|
+
const { data, content } = parseFrontmatter(raw);
|
|
352
|
+
const eveData = {};
|
|
353
|
+
if (typeof data.description === 'string') {
|
|
354
|
+
eveData.description = data.description;
|
|
355
|
+
}
|
|
356
|
+
if (typeof data.license === 'string') {
|
|
357
|
+
eveData.license = data.license;
|
|
358
|
+
}
|
|
359
|
+
if (data.metadata && typeof data.metadata === 'object' && !Array.isArray(data.metadata)) {
|
|
360
|
+
const metadata = Object.fromEntries(Object.entries(data.metadata).filter((entry) => typeof entry[1] === 'string'));
|
|
361
|
+
if (Object.keys(metadata).length > 0) {
|
|
362
|
+
eveData.metadata = metadata;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const keys = Object.keys(eveData);
|
|
366
|
+
if (keys.length === 0) {
|
|
367
|
+
return content.replace(/^\r?\n/u, '');
|
|
368
|
+
}
|
|
369
|
+
const frontmatter = keys.map((key) => `${key}: ${JSON.stringify(eveData[key])}`).join('\n');
|
|
370
|
+
return `---\n${frontmatter}\n---\n${content.replace(/^\r?\n/u, '')}`;
|
|
371
|
+
}
|
|
372
|
+
async function copyDirectory(src, dest, agentType) {
|
|
304
373
|
await mkdir(dest, { recursive: true });
|
|
305
374
|
const entries = await readdir(src, { withFileTypes: true });
|
|
306
375
|
// Copy files and directories in parallel
|
|
@@ -310,10 +379,14 @@ async function copyDirectory(src, dest) {
|
|
|
310
379
|
const srcPath = join(src, entry.name);
|
|
311
380
|
const destPath = join(dest, entry.name);
|
|
312
381
|
if (entry.isDirectory()) {
|
|
313
|
-
await copyDirectory(srcPath, destPath);
|
|
382
|
+
await copyDirectory(srcPath, destPath, agentType);
|
|
314
383
|
}
|
|
315
384
|
else {
|
|
316
385
|
try {
|
|
386
|
+
if (agentType === 'eve' && entry.name.toLowerCase() === 'skill.md') {
|
|
387
|
+
await writeFile(destPath, stripIgnoredEveFrontmatter(await readFile(srcPath, 'utf-8')));
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
317
390
|
await cp(srcPath, destPath, {
|
|
318
391
|
// If the file is a symlink to elsewhere in a remote skill, it may not
|
|
319
392
|
// resolve correctly once it has been copied to the local location.
|
|
@@ -339,6 +412,19 @@ async function copyDirectory(src, dest) {
|
|
|
339
412
|
}
|
|
340
413
|
}));
|
|
341
414
|
}
|
|
415
|
+
function isEvePackagedSkill(files) {
|
|
416
|
+
return files.some((file) => basename(file.path).toLowerCase() === 'skill.md');
|
|
417
|
+
}
|
|
418
|
+
function toEveFlatSkillFileName(installName) {
|
|
419
|
+
return `${sanitizeName(installName)}.md`;
|
|
420
|
+
}
|
|
421
|
+
function getEveFlatSkillMarkdown(files) {
|
|
422
|
+
const skillFile = files.find((file) => basename(file.path).toLowerCase() === 'skill.md');
|
|
423
|
+
if (skillFile)
|
|
424
|
+
return stripIgnoredEveFrontmatter(skillFile.contents);
|
|
425
|
+
const markdownFile = files.find((file) => extname(file.path).toLowerCase() === '.md');
|
|
426
|
+
return markdownFile ? stripIgnoredEveFrontmatter(markdownFile.contents) : '';
|
|
427
|
+
}
|
|
342
428
|
export async function isSkillInstalled(skillName, agentType, options = {}) {
|
|
343
429
|
const agent = agents[agentType];
|
|
344
430
|
const sanitized = sanitizeName(skillName);
|
|
@@ -348,7 +434,9 @@ export async function isSkillInstalled(skillName, agentType, options = {}) {
|
|
|
348
434
|
}
|
|
349
435
|
const targetBase = options.global
|
|
350
436
|
? agent.globalSkillsDir
|
|
351
|
-
:
|
|
437
|
+
: agentType === 'eve' && options.eveSubagent
|
|
438
|
+
? getEveSubagentSkillsDir(options.eveSubagent, options.cwd)
|
|
439
|
+
: join(options.cwd || process.cwd(), agent.skillsDir);
|
|
352
440
|
const skillDir = join(targetBase, sanitized);
|
|
353
441
|
if (!isPathSafe(targetBase, skillDir)) {
|
|
354
442
|
return false;
|
|
@@ -365,7 +453,7 @@ export function getInstallPath(skillName, agentType, options = {}) {
|
|
|
365
453
|
const agent = agents[agentType];
|
|
366
454
|
const cwd = options.cwd || process.cwd();
|
|
367
455
|
const sanitized = sanitizeName(skillName);
|
|
368
|
-
const targetBase = getAgentBaseDir(agentType, options.global ?? false, options.cwd);
|
|
456
|
+
const targetBase = getAgentBaseDir(agentType, options.global ?? false, options.cwd, options.eveSubagent);
|
|
369
457
|
const installPath = join(targetBase, sanitized);
|
|
370
458
|
if (!isPathSafe(targetBase, installPath)) {
|
|
371
459
|
throw new Error('Invalid skill name: potential path traversal detected');
|
|
@@ -377,7 +465,9 @@ export function getInstallPath(skillName, agentType, options = {}) {
|
|
|
377
465
|
*/
|
|
378
466
|
export function getCanonicalPath(skillName, options = {}) {
|
|
379
467
|
const sanitized = sanitizeName(skillName);
|
|
380
|
-
const canonicalBase =
|
|
468
|
+
const canonicalBase = options.agent === 'eve'
|
|
469
|
+
? getAgentBaseDir('eve', options.global ?? false, options.cwd, options.eveSubagent)
|
|
470
|
+
: getCanonicalSkillsDir(options.global ?? false, options.cwd);
|
|
381
471
|
const canonicalPath = join(canonicalBase, sanitized);
|
|
382
472
|
if (!isPathSafe(canonicalBase, canonicalPath)) {
|
|
383
473
|
throw new Error('Invalid skill name: potential path traversal detected');
|
|
@@ -395,6 +485,7 @@ export async function installRemoteSkillForAgent(skill, agentType, options = {})
|
|
|
395
485
|
const isGlobal = options.global ?? false;
|
|
396
486
|
const cwd = options.cwd || process.cwd();
|
|
397
487
|
const installMode = options.mode ?? 'symlink';
|
|
488
|
+
const eveSubagent = options.eveSubagent;
|
|
398
489
|
// Check if agent supports global installation
|
|
399
490
|
if (isGlobal && agent.globalSkillsDir === undefined) {
|
|
400
491
|
return {
|
|
@@ -407,10 +498,12 @@ export async function installRemoteSkillForAgent(skill, agentType, options = {})
|
|
|
407
498
|
// Use installName as the skill directory name
|
|
408
499
|
const skillName = sanitizeName(skill.installName);
|
|
409
500
|
// Canonical location: .agents/skills/<skill-name>
|
|
410
|
-
const canonicalBase =
|
|
501
|
+
const canonicalBase = agentType === 'eve' && installMode === 'symlink'
|
|
502
|
+
? getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent)
|
|
503
|
+
: getCanonicalSkillsDir(isGlobal, cwd);
|
|
411
504
|
const canonicalDir = join(canonicalBase, skillName);
|
|
412
505
|
// Agent-specific location (for symlink)
|
|
413
|
-
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd);
|
|
506
|
+
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent);
|
|
414
507
|
const agentDir = join(agentBase, skillName);
|
|
415
508
|
// Validate paths
|
|
416
509
|
if (!isPathSafe(canonicalBase, canonicalDir)) {
|
|
@@ -433,8 +526,9 @@ export async function installRemoteSkillForAgent(skill, agentType, options = {})
|
|
|
433
526
|
// For copy mode, write directly to agent location
|
|
434
527
|
if (installMode === 'copy') {
|
|
435
528
|
await cleanAndCreateDirectory(agentDir);
|
|
436
|
-
const
|
|
437
|
-
|
|
529
|
+
const skillFileName = agentType === 'eve' ? toEveFlatSkillFileName(skill.installName) : 'SKILL.md';
|
|
530
|
+
const skillMdPath = join(agentDir, skillFileName);
|
|
531
|
+
await writeFile(skillMdPath, agentType === 'eve' ? stripIgnoredEveFrontmatter(skill.content) : skill.content, 'utf-8');
|
|
438
532
|
return {
|
|
439
533
|
success: true,
|
|
440
534
|
path: agentDir,
|
|
@@ -443,8 +537,9 @@ export async function installRemoteSkillForAgent(skill, agentType, options = {})
|
|
|
443
537
|
}
|
|
444
538
|
// Symlink mode: write to canonical location and symlink to agent location
|
|
445
539
|
await cleanAndCreateDirectory(canonicalDir);
|
|
446
|
-
const
|
|
447
|
-
|
|
540
|
+
const skillFileName = agentType === 'eve' ? toEveFlatSkillFileName(skill.installName) : 'SKILL.md';
|
|
541
|
+
const skillMdPath = join(canonicalDir, skillFileName);
|
|
542
|
+
await writeFile(skillMdPath, agentType === 'eve' ? stripIgnoredEveFrontmatter(skill.content) : skill.content, 'utf-8');
|
|
448
543
|
// For universal agents with global install, skip creating agent-specific symlink
|
|
449
544
|
if (isGlobal && isUniversalAgent(agentType)) {
|
|
450
545
|
return {
|
|
@@ -458,8 +553,9 @@ export async function installRemoteSkillForAgent(skill, agentType, options = {})
|
|
|
458
553
|
if (!symlinkCreated) {
|
|
459
554
|
// Symlink failed, fall back to copy
|
|
460
555
|
await cleanAndCreateDirectory(agentDir);
|
|
461
|
-
const
|
|
462
|
-
|
|
556
|
+
const agentSkillFileName = agentType === 'eve' ? toEveFlatSkillFileName(skill.installName) : 'SKILL.md';
|
|
557
|
+
const agentSkillMdPath = join(agentDir, agentSkillFileName);
|
|
558
|
+
await writeFile(agentSkillMdPath, agentType === 'eve' ? stripIgnoredEveFrontmatter(skill.content) : skill.content, 'utf-8');
|
|
463
559
|
return {
|
|
464
560
|
success: true,
|
|
465
561
|
path: agentDir,
|
|
@@ -496,6 +592,7 @@ export async function installWellKnownSkillForAgent(skill, agentType, options =
|
|
|
496
592
|
const isGlobal = options.global ?? false;
|
|
497
593
|
const cwd = options.cwd || process.cwd();
|
|
498
594
|
const installMode = options.mode ?? 'symlink';
|
|
595
|
+
const eveSubagent = options.eveSubagent;
|
|
499
596
|
// Check if agent supports global installation
|
|
500
597
|
if (isGlobal && agent.globalSkillsDir === undefined) {
|
|
501
598
|
return {
|
|
@@ -508,10 +605,12 @@ export async function installWellKnownSkillForAgent(skill, agentType, options =
|
|
|
508
605
|
// Use installName as the skill directory name
|
|
509
606
|
const skillName = sanitizeName(skill.installName);
|
|
510
607
|
// Canonical location: .agents/skills/<skill-name>
|
|
511
|
-
const canonicalBase =
|
|
608
|
+
const canonicalBase = agentType === 'eve' && installMode === 'symlink'
|
|
609
|
+
? getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent)
|
|
610
|
+
: getCanonicalSkillsDir(isGlobal, cwd);
|
|
512
611
|
const canonicalDir = join(canonicalBase, skillName);
|
|
513
612
|
// Agent-specific location (for symlink)
|
|
514
|
-
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd);
|
|
613
|
+
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent);
|
|
515
614
|
const agentDir = join(agentBase, skillName);
|
|
516
615
|
// Validate paths
|
|
517
616
|
if (!isPathSafe(canonicalBase, canonicalDir)) {
|
|
@@ -545,7 +644,11 @@ export async function installWellKnownSkillForAgent(skill, agentType, options =
|
|
|
545
644
|
if (parentDir !== targetDir) {
|
|
546
645
|
await mkdir(parentDir, { recursive: true });
|
|
547
646
|
}
|
|
548
|
-
await writeFile(fullPath,
|
|
647
|
+
await writeFile(fullPath, agentType === 'eve' &&
|
|
648
|
+
basename(filePath).toLowerCase() === 'skill.md' &&
|
|
649
|
+
typeof content === 'string'
|
|
650
|
+
? stripIgnoredEveFrontmatter(content)
|
|
651
|
+
: content);
|
|
549
652
|
}
|
|
550
653
|
}
|
|
551
654
|
try {
|
|
@@ -610,6 +713,7 @@ export async function installBlobSkillForAgent(skill, agentType, options = {}) {
|
|
|
610
713
|
const isGlobal = options.global ?? false;
|
|
611
714
|
const cwd = options.cwd || process.cwd();
|
|
612
715
|
const installMode = options.mode ?? 'symlink';
|
|
716
|
+
const eveSubagent = options.eveSubagent;
|
|
613
717
|
if (isGlobal && agent.globalSkillsDir === undefined) {
|
|
614
718
|
return {
|
|
615
719
|
success: false,
|
|
@@ -619,9 +723,36 @@ export async function installBlobSkillForAgent(skill, agentType, options = {}) {
|
|
|
619
723
|
};
|
|
620
724
|
}
|
|
621
725
|
const skillName = sanitizeName(skill.installName);
|
|
622
|
-
const
|
|
726
|
+
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent);
|
|
727
|
+
if (agentType === 'eve' && !isEvePackagedSkill(skill.files)) {
|
|
728
|
+
const flatSkillPath = join(agentBase, toEveFlatSkillFileName(skill.installName));
|
|
729
|
+
if (!isPathSafe(agentBase, flatSkillPath)) {
|
|
730
|
+
return {
|
|
731
|
+
success: false,
|
|
732
|
+
path: flatSkillPath,
|
|
733
|
+
mode: installMode,
|
|
734
|
+
error: 'Invalid skill name: potential path traversal detected',
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
try {
|
|
738
|
+
await mkdir(agentBase, { recursive: true });
|
|
739
|
+
await rm(flatSkillPath, { recursive: true, force: true });
|
|
740
|
+
await writeFile(flatSkillPath, getEveFlatSkillMarkdown(skill.files), 'utf-8');
|
|
741
|
+
return { success: true, path: flatSkillPath, mode: 'copy' };
|
|
742
|
+
}
|
|
743
|
+
catch (error) {
|
|
744
|
+
return {
|
|
745
|
+
success: false,
|
|
746
|
+
path: flatSkillPath,
|
|
747
|
+
mode: installMode,
|
|
748
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
const canonicalBase = agentType === 'eve' && installMode === 'symlink'
|
|
753
|
+
? getAgentBaseDir(agentType, isGlobal, cwd, eveSubagent)
|
|
754
|
+
: getCanonicalSkillsDir(isGlobal, cwd);
|
|
623
755
|
const canonicalDir = join(canonicalBase, skillName);
|
|
624
|
-
const agentBase = getAgentBaseDir(agentType, isGlobal, cwd);
|
|
625
756
|
const agentDir = join(agentBase, skillName);
|
|
626
757
|
if (!isPathSafe(canonicalBase, canonicalDir)) {
|
|
627
758
|
return {
|
|
@@ -648,7 +779,9 @@ export async function installBlobSkillForAgent(skill, agentType, options = {}) {
|
|
|
648
779
|
if (parentDir !== targetDir) {
|
|
649
780
|
await mkdir(parentDir, { recursive: true });
|
|
650
781
|
}
|
|
651
|
-
await writeFile(fullPath, file.
|
|
782
|
+
await writeFile(fullPath, agentType === 'eve' && basename(file.path).toLowerCase() === 'skill.md'
|
|
783
|
+
? stripIgnoredEveFrontmatter(file.contents)
|
|
784
|
+
: file.contents, 'utf-8');
|
|
652
785
|
}
|
|
653
786
|
}
|
|
654
787
|
try {
|
|
@@ -767,6 +900,16 @@ export async function listInstalledSkills(options = {}) {
|
|
|
767
900
|
if (!scopes.some((s) => s.path === agentDir && s.global === isGlobal)) {
|
|
768
901
|
scopes.push({ global: isGlobal, path: agentDir, agentType });
|
|
769
902
|
}
|
|
903
|
+
// Eve subagents keep their skills under agent/subagents/<name>/skills.
|
|
904
|
+
// These are project-scoped, so only scan them for the project scope.
|
|
905
|
+
if (agentType === 'eve' && !isGlobal) {
|
|
906
|
+
for (const subagent of getEveSubagents(cwd)) {
|
|
907
|
+
const subagentDir = getEveSubagentSkillsDir(subagent, cwd);
|
|
908
|
+
if (!scopes.some((s) => s.path === subagentDir && s.global === isGlobal)) {
|
|
909
|
+
scopes.push({ global: isGlobal, path: subagentDir, agentType });
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
770
913
|
}
|
|
771
914
|
// Also scan skill directories for agents NOT in agentsToCheck, in case
|
|
772
915
|
// skills were installed with `--agent <name>` but the agent is no longer
|
|
@@ -2,11 +2,11 @@ import * as p from '@clack/prompts';
|
|
|
2
2
|
import pc from 'picocolors';
|
|
3
3
|
import { readdir, rm, lstat } from 'fs/promises';
|
|
4
4
|
import { join } from 'path';
|
|
5
|
-
import { agents, detectInstalledAgents } from "./agents.js";
|
|
5
|
+
import { agents, detectInstalledAgents, getEveSubagents } from "./agents.js";
|
|
6
6
|
import { track } from "./telemetry.js";
|
|
7
7
|
import { detectAgent } from "./detect-agent.js";
|
|
8
8
|
import { removeSkillFromLock, getSkillFromLock } from "./skill-lock.js";
|
|
9
|
-
import { getInstallPath, getCanonicalPath, getCanonicalSkillsDir, sanitizeName, } from "./installer.js";
|
|
9
|
+
import { getInstallPath, getCanonicalPath, getCanonicalSkillsDir, getEveSubagentSkillsDir, sanitizeName, } from "./installer.js";
|
|
10
10
|
export async function removeCommand(skillNames, options) {
|
|
11
11
|
// Auto-enable non-interactive mode when running inside an AI agent
|
|
12
12
|
const agentResult = await detectAgent();
|
|
@@ -49,6 +49,10 @@ export async function removeCommand(skillNames, options) {
|
|
|
49
49
|
for (const agent of Object.values(agents)) {
|
|
50
50
|
await scanDir(join(cwd, agent.skillsDir));
|
|
51
51
|
}
|
|
52
|
+
// Eve subagents keep their skills under agent/subagents/<name>/skills.
|
|
53
|
+
for (const subagent of getEveSubagents(cwd)) {
|
|
54
|
+
await scanDir(getEveSubagentSkillsDir(subagent, cwd));
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
const installedSkills = Array.from(skillNamesSet).sort();
|
|
54
58
|
spinner.stop(`Found ${installedSkills.length} unique installed skill(s)`);
|
|
@@ -136,6 +140,12 @@ export async function removeCommand(skillNames, options) {
|
|
|
136
140
|
}
|
|
137
141
|
else {
|
|
138
142
|
pathsToCleanup.add(join(cwd, agent.skillsDir, sanitizedName));
|
|
143
|
+
// Eve skills may also live in subagent directories.
|
|
144
|
+
if (agentKey === 'eve') {
|
|
145
|
+
for (const subagent of getEveSubagents(cwd)) {
|
|
146
|
+
pathsToCleanup.add(join(getEveSubagentSkillsDir(subagent, cwd), sanitizedName));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
139
149
|
}
|
|
140
150
|
for (const pathToCleanup of pathsToCleanup) {
|
|
141
151
|
// Skip if this is the canonical path - we'll handle that after checking all agents
|
|
@@ -543,7 +543,12 @@ export async function updateProjectSkills(options = {}) {
|
|
|
543
543
|
console.log(`${TEXT}Updating ${safeName}...${RESET}`);
|
|
544
544
|
const installUrl = formatSourceInput(skill.entry.source, skill.entry.ref);
|
|
545
545
|
const tracer = getTracer();
|
|
546
|
-
|
|
546
|
+
// Preserve Eve subagent placement recorded at install time. The lock stores
|
|
547
|
+
// '' for the root agent, which maps to the `root` keyword for `add --subagent`.
|
|
548
|
+
const subagentArgs = skill.entry.subagents?.length
|
|
549
|
+
? ['--subagent', ...skill.entry.subagents.map((s) => (s === '' ? 'root' : s))]
|
|
550
|
+
: [];
|
|
551
|
+
const args = ['skills', 'add', installUrl, '--skill', skill.name, ...subagentArgs, '-y'];
|
|
547
552
|
const result = tracer.startActiveSpan("adg", { kind: SpanKind.CLIENT }, (span) => {
|
|
548
553
|
try {
|
|
549
554
|
span.setAttribute("process.executable.name", "adg");
|
package/docs/cli-json.md
CHANGED
|
@@ -55,7 +55,8 @@ Shape:
|
|
|
55
55
|
"hooks": 0,
|
|
56
56
|
"apps": 0
|
|
57
57
|
},
|
|
58
|
-
"partial": false
|
|
58
|
+
"partial": false,
|
|
59
|
+
"state": "enabled"
|
|
59
60
|
}
|
|
60
61
|
]
|
|
61
62
|
}
|
|
@@ -71,6 +72,8 @@ Field notes:
|
|
|
71
72
|
- `counts` mirrors `contents` lengths.
|
|
72
73
|
- `partial` is true when the installed plugin has a stored partial-install
|
|
73
74
|
selection.
|
|
75
|
+
- `state` is always normalized to `enabled` or `disabled`; legacy lock entries
|
|
76
|
+
without an explicit state are reported as `enabled`.
|
|
74
77
|
|
|
75
78
|
## `adg plugins status --json`
|
|
76
79
|
|
|
@@ -88,7 +91,9 @@ Shape:
|
|
|
88
91
|
"queryable": true,
|
|
89
92
|
"inSync": ["apple-skills"],
|
|
90
93
|
"missing": [],
|
|
91
|
-
"agentOnly": []
|
|
94
|
+
"agentOnly": [],
|
|
95
|
+
"disabled": [],
|
|
96
|
+
"unexpectedlyEnabled": []
|
|
92
97
|
}
|
|
93
98
|
]
|
|
94
99
|
}
|
|
@@ -105,6 +110,9 @@ Field notes:
|
|
|
105
110
|
query, `queryError` contains its diagnostic and `recoveryCommand` contains a
|
|
106
111
|
safe repair command when ADG recognizes the failure. Both fields are omitted
|
|
107
112
|
when unavailable.
|
|
108
|
-
- `inSync
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
- `inSync` and `missing` apply only to store-enabled plugins. `disabled` contains
|
|
114
|
+
store-disabled plugins absent from the runtime as intended;
|
|
115
|
+
`unexpectedlyEnabled` contains disabled plugins still active in that runtime.
|
|
116
|
+
`agentOnly` remains reserved for runtime plugins absent from the store.
|
|
117
|
+
Content drift is not represented; use `adg plugins sync` when a full runtime
|
|
118
|
+
refresh is required.
|
|
@@ -123,3 +123,22 @@ Repair drift with:
|
|
|
123
123
|
```bash
|
|
124
124
|
adg plugins sync --target <runtime> <plugin-name> --global
|
|
125
125
|
```
|
|
126
|
+
|
|
127
|
+
## Persistent Disablement
|
|
128
|
+
|
|
129
|
+
Use store-level disablement when a plugin should remain installed and updateable
|
|
130
|
+
without being loaded by any runtime:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
adg plugins disable <plugin-name> --global
|
|
134
|
+
adg plugins enable <plugin-name> --global
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`disable` keeps the payload and marketplace catalog entry in ADG's store, records
|
|
138
|
+
the desired state in `.plugin-lock.json`, and removes the plugin from every
|
|
139
|
+
registered runtime. `enable` restores disabled dependencies first, regenerates
|
|
140
|
+
runtime projections, and activates the plugin in each compatible runtime.
|
|
141
|
+
|
|
142
|
+
`unlink --target <runtime>` is different: it is a temporary per-runtime override
|
|
143
|
+
and does not change store state. A later `sync` restores the store's enabled or
|
|
144
|
+
disabled state. `remove` deletes the payload and catalog entry entirely.
|
package/package.json
CHANGED
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"installedAt": { "type": "string", "format": "date-time" },
|
|
34
34
|
"updatedAt": { "type": "string", "format": "date-time" },
|
|
35
|
+
"state": {
|
|
36
|
+
"enum": ["enabled", "disabled"],
|
|
37
|
+
"description": "Desired cross-agent projection state. Absent means enabled."
|
|
38
|
+
},
|
|
35
39
|
"dependencies": {
|
|
36
40
|
"type": "object",
|
|
37
41
|
"additionalProperties": { "type": "string" }
|
|
@@ -6,11 +6,33 @@ wrapped by `adg skills`.
|
|
|
6
6
|
| Field | Value |
|
|
7
7
|
|-------|-------|
|
|
8
8
|
| Upstream repo | https://github.com/vercel-labs/skills |
|
|
9
|
-
| npm package | `skills` (v1.5.
|
|
10
|
-
| Vendored commit | `
|
|
11
|
-
| Vendored on | 2026-
|
|
9
|
+
| npm package | `skills` (v1.5.14) |
|
|
10
|
+
| Vendored commit | `2adcfe5a4cce0ce5f4d5547a997b2a161ec5d127` (tag `v1.5.14`) |
|
|
11
|
+
| Vendored on | 2026-07-02 |
|
|
12
|
+
| Previous vendoring | `be0dd25` (v1.5.11), 2026-06-11 |
|
|
12
13
|
| What was copied | `src/` (excluding `*.test.ts`) and `ThirdPartyNoticeText.txt` |
|
|
13
14
|
|
|
15
|
+
## Re-sync notes (v1.5.11 → v1.5.14, 2026-07-02)
|
|
16
|
+
|
|
17
|
+
3-way merge (base `be0dd25`, ours = prior vendoring + ADG patches, theirs `2adcfe5`).
|
|
18
|
+
Upstream dependencies were unchanged. Resolution map:
|
|
19
|
+
|
|
20
|
+
- **Auto-merged clean** (upstream + ADG changes disjoint): `agents.ts`, `blob.ts`, `cli.ts`.
|
|
21
|
+
- **Took upstream** (ADG unmodified): `find.ts`, `installer.ts`, `local-lock.ts`, `remove.ts`, `types.ts`.
|
|
22
|
+
- **Kept ADG** (upstream unmodified): `telemetry.ts`, `git.ts`, `install.ts`, `skill-lock.ts`,
|
|
23
|
+
`skills.ts`, `source-parser.ts`, `use.ts`, `providers/wellknown.ts`, `git-tree.ts`, `self-cli.ts`.
|
|
24
|
+
- **Manual conflict resolutions** (2):
|
|
25
|
+
- `add.ts` — **openclaw source guard dropped to follow upstream.** 1.5.14 removed the
|
|
26
|
+
"block `openclaw/*` sources unless `--dangerously-accept-openclaw-risks`" gate from `add`
|
|
27
|
+
and reconceived `openclaw` as a first-class *agent*. We took upstream (removed the guard,
|
|
28
|
+
the `AddOptions.dangerouslyAcceptOpenclawRisks` field, and its arg parsing). The `use`
|
|
29
|
+
command keeps its own independent openclaw guard (upstream `use.ts` still has it).
|
|
30
|
+
- `update.ts` — carried upstream's new `--subagent` (Eve) forwarding **into** ADG's
|
|
31
|
+
`SELF_CLI_ENTRY`/OTel-CLIENT-span spawn: `subagentArgs` is now spliced into the
|
|
32
|
+
`adg skills add … --skill <name> [--subagent …] -y` args on the project-update path.
|
|
33
|
+
- **New upstream feature carried in full**: Eve subagents (`eve` agent, `--subagent` install
|
|
34
|
+
flag, subagent-aware project update) and `find --owner`.
|
|
35
|
+
|
|
14
36
|
## License — MIT
|
|
15
37
|
|
|
16
38
|
The upstream `skills` is **MIT-licensed**, declared in two places:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skills",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.14",
|
|
4
4
|
"description": "The open agent skills ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"devin",
|
|
62
62
|
"dexto",
|
|
63
63
|
"droid",
|
|
64
|
+
"eve",
|
|
64
65
|
"firebender",
|
|
65
66
|
"forgecode",
|
|
66
67
|
"gemini-cli",
|