@rbbtsn0w/adg 0.5.0-beta.1 → 0.5.0-beta.3
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/dist/bin/adg.js +1 -0
- package/dist/src/adapters/antigravity-hooks.js +24 -9
- package/dist/vendor/skills/src/add.js +205 -36
- 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 +6 -2
- package/dist/vendor/skills/src/find.js +62 -12
- package/dist/vendor/skills/src/install.js +1 -1
- package/dist/vendor/skills/src/installer.js +173 -30
- package/dist/vendor/skills/src/remove.js +12 -2
- package/dist/vendor/skills/src/telemetry.js +25 -14
- package/dist/vendor/skills/src/update.js +10 -5
- package/package.json +1 -1
- package/vendor/skills/PROVENANCE.md +25 -3
- package/vendor/skills/package.json +2 -1
- package/vendor/skills/src/add.ts +252 -38
- package/vendor/skills/src/agents.ts +57 -1
- package/vendor/skills/src/blob.ts +23 -2
- package/vendor/skills/src/cli.ts +6 -2
- package/vendor/skills/src/find.ts +74 -12
- package/vendor/skills/src/install.ts +1 -1
- 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/telemetry.ts +76 -25
- package/vendor/skills/src/types.ts +1 -0
- package/vendor/skills/src/update.ts +12 -7
- package/dist/vendor/skills/package.json +0 -143
|
@@ -189,7 +189,7 @@ export function printSkippedSkills(skipped) {
|
|
|
189
189
|
const names = skills.map((s) => sanitizeMetadata(s.name)).join(', ');
|
|
190
190
|
console.log(` ${TEXT}•${RESET} ${names} ${DIM}(${reason})${RESET}`);
|
|
191
191
|
}
|
|
192
|
-
console.log(` ${DIM}To update: ${TEXT}
|
|
192
|
+
console.log(` ${DIM}To update: ${TEXT}adg skills add ${source} -g -y${RESET}`);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
export async function getProjectSkillsForUpdate(skillFilter) {
|
|
@@ -244,7 +244,7 @@ export async function updateGlobalSkills(options = {}) {
|
|
|
244
244
|
if (skillNames.length === 0) {
|
|
245
245
|
if (!options.skills) {
|
|
246
246
|
console.log(`${DIM}No global skills tracked in lock file.${RESET}`);
|
|
247
|
-
console.log(`${DIM}Install skills with${RESET} ${TEXT}
|
|
247
|
+
console.log(`${DIM}Install skills with${RESET} ${TEXT}adg skills add <package> -g${RESET}`);
|
|
248
248
|
}
|
|
249
249
|
return { successCount, failCount, checkedCount: 0 };
|
|
250
250
|
}
|
|
@@ -462,7 +462,7 @@ export async function updateProjectSkills(options = {}) {
|
|
|
462
462
|
if (projectSkills.length === 0) {
|
|
463
463
|
if (!options.skills) {
|
|
464
464
|
console.log(`${DIM}No project skills to update.${RESET}`);
|
|
465
|
-
console.log(`${DIM}Install project skills with${RESET} ${TEXT}
|
|
465
|
+
console.log(`${DIM}Install project skills with${RESET} ${TEXT}adg skills add <package>${RESET}`);
|
|
466
466
|
}
|
|
467
467
|
return { successCount, failCount, foundCount: 0 };
|
|
468
468
|
}
|
|
@@ -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");
|
|
@@ -601,7 +606,7 @@ export function printLegacyProjectSkills(legacy) {
|
|
|
601
606
|
for (const skill of legacy) {
|
|
602
607
|
const reinstall = formatSourceInput(skill.entry.source, skill.entry.ref);
|
|
603
608
|
console.log(` ${TEXT}•${RESET} ${sanitizeMetadata(skill.name)}`);
|
|
604
|
-
console.log(` ${DIM}To refresh: ${TEXT}
|
|
609
|
+
console.log(` ${DIM}To refresh: ${TEXT}adg skills add ${reinstall} -y${RESET}`);
|
|
605
610
|
}
|
|
606
611
|
}
|
|
607
612
|
export async function runUpdate(args = []) {
|
package/package.json
CHANGED
|
@@ -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",
|
package/vendor/skills/src/add.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import * as p from '@clack/prompts';
|
|
2
3
|
import pc from 'picocolors';
|
|
3
4
|
import { existsSync } from 'fs';
|
|
@@ -9,6 +10,7 @@ import { searchMultiselect } from './prompts/search-multiselect.ts';
|
|
|
9
10
|
|
|
10
11
|
// Helper to check if a value is a cancel symbol (works with both clack and our custom prompts)
|
|
11
12
|
const isCancelled = (value: unknown): value is symbol => typeof value === 'symbol';
|
|
13
|
+
const EVE_AGENT_LABEL = 'eve agent';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Check if a source identifier (owner/repo format) represents a private GitHub repo.
|
|
@@ -48,10 +50,10 @@ import {
|
|
|
48
50
|
getVisibleUniversalAgents,
|
|
49
51
|
getNonUniversalAgents,
|
|
50
52
|
isUniversalAgent,
|
|
53
|
+
getEveSubagents,
|
|
51
54
|
} from './agents.ts';
|
|
52
55
|
import {
|
|
53
56
|
track,
|
|
54
|
-
setVersion,
|
|
55
57
|
fetchAuditData,
|
|
56
58
|
type AuditResponse,
|
|
57
59
|
type PartnerAudit,
|
|
@@ -77,10 +79,6 @@ import {
|
|
|
77
79
|
type BlobSkill,
|
|
78
80
|
type BlobInstallResult,
|
|
79
81
|
} from './blob.ts';
|
|
80
|
-
import packageJson from '../package.json' with { type: 'json' };
|
|
81
|
-
export function initTelemetry(version: string): void {
|
|
82
|
-
setVersion(version);
|
|
83
|
-
}
|
|
84
82
|
|
|
85
83
|
// ─── Security Advisory ───
|
|
86
84
|
|
|
@@ -183,6 +181,13 @@ function shortenPath(fullPath: string, cwd: string): string {
|
|
|
183
181
|
return fullPath;
|
|
184
182
|
}
|
|
185
183
|
|
|
184
|
+
function computeSingleFileSkillHash(contents: string): string {
|
|
185
|
+
const hash = createHash('sha256');
|
|
186
|
+
hash.update('SKILL.md');
|
|
187
|
+
hash.update(contents);
|
|
188
|
+
return hash.digest('hex');
|
|
189
|
+
}
|
|
190
|
+
|
|
186
191
|
/**
|
|
187
192
|
* Formats a list of items, truncating if too many
|
|
188
193
|
*/
|
|
@@ -195,6 +200,18 @@ function formatList(items: string[], maxShow: number = 5): string {
|
|
|
195
200
|
return `${shown.join(', ')} +${remaining} more`;
|
|
196
201
|
}
|
|
197
202
|
|
|
203
|
+
function formatSkillPromptSubject(skills: Skill[]): string {
|
|
204
|
+
const names = skills.map((skill) => pc.cyan(getSkillDisplayName(skill)));
|
|
205
|
+
const namedSubject = formatList(names, 3);
|
|
206
|
+
return stripTerminalEscapes(namedSubject).length <= 80
|
|
207
|
+
? namedSubject
|
|
208
|
+
: `${skills.length} selected skills`;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function formatEveInstallPromptMessage(skills: Skill[]): string {
|
|
212
|
+
return `Detected an eve project. Install ${formatSkillPromptSubject(skills)} for your ${EVE_AGENT_LABEL} to use?`;
|
|
213
|
+
}
|
|
214
|
+
|
|
198
215
|
/**
|
|
199
216
|
* Splits agents into universal and non-universal (symlinked) groups.
|
|
200
217
|
* Returns display names for each group.
|
|
@@ -240,6 +257,76 @@ function buildAgentSummaryLines(targetAgents: AgentType[], installMode: InstallM
|
|
|
240
257
|
return lines;
|
|
241
258
|
}
|
|
242
259
|
|
|
260
|
+
/**
|
|
261
|
+
* A concrete install destination. For Eve, `subagent` optionally targets a
|
|
262
|
+
* subagent's skills directory (`agent/subagents/<name>/skills`); when omitted
|
|
263
|
+
* the skill installs to the root agent (`agent/skills`). Other agents never set
|
|
264
|
+
* `subagent`.
|
|
265
|
+
*/
|
|
266
|
+
interface InstallTarget {
|
|
267
|
+
agent: AgentType;
|
|
268
|
+
subagent?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Human-readable label for an install target, e.g. "Eve (research)". */
|
|
272
|
+
function targetDisplayName(target: InstallTarget): string {
|
|
273
|
+
const base = agents[target.agent].displayName;
|
|
274
|
+
return target.subagent ? `${base} (${target.subagent})` : base;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Stable key used to deduplicate / index per-target state. */
|
|
278
|
+
function targetKey(target: InstallTarget): string {
|
|
279
|
+
return target.subagent ? `${target.agent}:${target.subagent}` : target.agent;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Expand the selected agents into concrete install targets, fanning Eve out
|
|
284
|
+
* across the chosen subagents (root and/or named subagents).
|
|
285
|
+
*/
|
|
286
|
+
function buildInstallTargets(
|
|
287
|
+
targetAgents: AgentType[],
|
|
288
|
+
eveSubagentTargets: Array<string | undefined>
|
|
289
|
+
): InstallTarget[] {
|
|
290
|
+
const targets: InstallTarget[] = [];
|
|
291
|
+
for (const agent of targetAgents) {
|
|
292
|
+
if (agent === 'eve') {
|
|
293
|
+
for (const subagent of eveSubagentTargets) {
|
|
294
|
+
targets.push({ agent, subagent });
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
targets.push({ agent });
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return targets;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Builds summary lines showing universal vs symlinked agents and Eve subagents.
|
|
305
|
+
*/
|
|
306
|
+
function buildTargetSummaryLines(targets: InstallTarget[], installMode: InstallMode): string[] {
|
|
307
|
+
const lines: string[] = [];
|
|
308
|
+
const rootAgents = targets.filter((t) => !t.subagent).map((t) => t.agent);
|
|
309
|
+
const subagentNames = targets.filter((t) => t.subagent).map(targetDisplayName);
|
|
310
|
+
const { universal, symlinked } = splitAgentsByType(rootAgents);
|
|
311
|
+
|
|
312
|
+
if (installMode === 'symlink') {
|
|
313
|
+
if (universal.length > 0) {
|
|
314
|
+
lines.push(` ${pc.green('universal:')} ${formatList(universal)}`);
|
|
315
|
+
}
|
|
316
|
+
if (symlinked.length > 0) {
|
|
317
|
+
lines.push(` ${pc.dim('symlink →')} ${formatList(symlinked)}`);
|
|
318
|
+
}
|
|
319
|
+
if (subagentNames.length > 0) {
|
|
320
|
+
lines.push(` ${pc.dim('copy →')} ${formatList(subagentNames)}`);
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
const allNames = targets.map(targetDisplayName);
|
|
324
|
+
lines.push(` ${pc.dim('copy →')} ${formatList(allNames)}`);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return lines;
|
|
328
|
+
}
|
|
329
|
+
|
|
243
330
|
/**
|
|
244
331
|
* Ensures universal agents are always included in the target agents list.
|
|
245
332
|
* Used when -y flag is passed or when auto-selecting agents.
|
|
@@ -377,7 +464,9 @@ async function selectAgentsInteractive(options: {
|
|
|
377
464
|
|
|
378
465
|
const universalAgents = getUniversalAgents().filter(supportsGlobalFilter);
|
|
379
466
|
const visibleUniversalAgents = getVisibleUniversalAgents().filter(supportsGlobalFilter);
|
|
380
|
-
const otherAgents = getNonUniversalAgents().filter(
|
|
467
|
+
const otherAgents = getNonUniversalAgents().filter(
|
|
468
|
+
(agent) => agent !== 'eve' && supportsGlobalFilter(agent)
|
|
469
|
+
);
|
|
381
470
|
|
|
382
471
|
// Universal agents shown as locked section
|
|
383
472
|
const universalSection = {
|
|
@@ -429,9 +518,6 @@ async function selectAgentsInteractive(options: {
|
|
|
429
518
|
return selected as AgentType[] | symbol;
|
|
430
519
|
}
|
|
431
520
|
|
|
432
|
-
const version = packageJson.version;
|
|
433
|
-
setVersion(version);
|
|
434
|
-
|
|
435
521
|
export interface AddOptions {
|
|
436
522
|
global?: boolean;
|
|
437
523
|
agent?: string[];
|
|
@@ -441,6 +527,11 @@ export interface AddOptions {
|
|
|
441
527
|
all?: boolean;
|
|
442
528
|
fullDepth?: boolean;
|
|
443
529
|
copy?: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Eve subagent targets. Each value is a subagent name; `root` (or `.`)
|
|
532
|
+
* selects the root agent. Implies installing for Eve.
|
|
533
|
+
*/
|
|
534
|
+
subagent?: string[];
|
|
444
535
|
dangerouslyAcceptOpenclawRisks?: boolean;
|
|
445
536
|
}
|
|
446
537
|
|
|
@@ -927,10 +1018,10 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
927
1018
|
);
|
|
928
1019
|
console.log();
|
|
929
1020
|
console.log(pc.dim(' Usage:'));
|
|
930
|
-
console.log(` ${pc.cyan('
|
|
1021
|
+
console.log(` ${pc.cyan('adg skills add')} ${pc.yellow('<source>')} ${pc.dim('[options]')}`);
|
|
931
1022
|
console.log();
|
|
932
1023
|
console.log(pc.dim(' Example:'));
|
|
933
|
-
console.log(` ${pc.cyan('
|
|
1024
|
+
console.log(` ${pc.cyan('adg skills add')} ${pc.yellow('vercel-labs/agent-skills')}`);
|
|
934
1025
|
console.log();
|
|
935
1026
|
process.exit(1);
|
|
936
1027
|
}
|
|
@@ -1005,7 +1096,7 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1005
1096
|
p.log.message(pc.yellow('Skills run with full agent permissions and could be malicious.'));
|
|
1006
1097
|
console.log();
|
|
1007
1098
|
p.log.message(
|
|
1008
|
-
`If you understand the risks, re-run with:\n\n ${pc.cyan(`
|
|
1099
|
+
`If you understand the risks, re-run with:\n\n ${pc.cyan(`adg skills add ${source} --dangerously-accept-openclaw-risks`)}\n`
|
|
1009
1100
|
);
|
|
1010
1101
|
p.outro(pc.red('Installation blocked'));
|
|
1011
1102
|
process.exit(1);
|
|
@@ -1314,17 +1405,47 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1314
1405
|
const totalAgents = Object.keys(agents).length;
|
|
1315
1406
|
spinner.stop(`${totalAgents} agents`);
|
|
1316
1407
|
|
|
1317
|
-
if (installedAgents.
|
|
1408
|
+
if (installedAgents.includes('eve') && (options.yes || !agentResult.isAgent)) {
|
|
1409
|
+
const useEve = options.yes
|
|
1410
|
+
? true
|
|
1411
|
+
: await p.confirm({
|
|
1412
|
+
message: formatEveInstallPromptMessage(selectedSkills),
|
|
1413
|
+
initialValue: true,
|
|
1414
|
+
});
|
|
1415
|
+
|
|
1416
|
+
if (p.isCancel(useEve)) {
|
|
1417
|
+
p.cancel('Installation cancelled');
|
|
1418
|
+
await cleanup(tempDir);
|
|
1419
|
+
process.exit(0);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
if (useEve) {
|
|
1423
|
+
targetAgents = ['eve'];
|
|
1424
|
+
p.log.info(`Installing to: ${pc.cyan(EVE_AGENT_LABEL)}`);
|
|
1425
|
+
} else {
|
|
1426
|
+
const selected = await selectAgentsInteractive({ global: options.global });
|
|
1427
|
+
|
|
1428
|
+
if (p.isCancel(selected)) {
|
|
1429
|
+
p.cancel('Installation cancelled');
|
|
1430
|
+
await cleanup(tempDir);
|
|
1431
|
+
process.exit(0);
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
targetAgents = selected as AgentType[];
|
|
1435
|
+
}
|
|
1436
|
+
} else if (installedAgents.length === 0) {
|
|
1318
1437
|
if (options.yes) {
|
|
1319
1438
|
targetAgents = validAgents as AgentType[];
|
|
1320
1439
|
p.log.info('Installing to all agents');
|
|
1321
1440
|
} else {
|
|
1322
1441
|
p.log.info('Select agents to install skills to');
|
|
1323
1442
|
|
|
1324
|
-
const allAgentChoices = Object.entries(agents)
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1443
|
+
const allAgentChoices = Object.entries(agents)
|
|
1444
|
+
.filter(([key]) => key !== 'eve')
|
|
1445
|
+
.map(([key, config]) => ({
|
|
1446
|
+
value: key as AgentType,
|
|
1447
|
+
label: config.displayName,
|
|
1448
|
+
}));
|
|
1328
1449
|
|
|
1329
1450
|
// Use helper to prompt with search
|
|
1330
1451
|
const selected = await promptForAgents(
|
|
@@ -1364,6 +1485,52 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1364
1485
|
}
|
|
1365
1486
|
}
|
|
1366
1487
|
|
|
1488
|
+
// An explicit --subagent flag implies the user wants to target Eve.
|
|
1489
|
+
if (options.subagent && options.subagent.length > 0 && !targetAgents.includes('eve')) {
|
|
1490
|
+
targetAgents = [...targetAgents, 'eve'];
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
// Eve supports subagents, each with their own skills directory at
|
|
1494
|
+
// agent/subagents/<name>/skills in addition to the root agent/skills.
|
|
1495
|
+
// When Eve is a target, choose which of those to install into.
|
|
1496
|
+
let eveSubagentTargets: Array<string | undefined> = [undefined];
|
|
1497
|
+
if (targetAgents.includes('eve')) {
|
|
1498
|
+
const availableSubagents = getEveSubagents(process.cwd());
|
|
1499
|
+
|
|
1500
|
+
if (options.subagent && options.subagent.length > 0) {
|
|
1501
|
+
// Non-interactive: 'root' or '.' selects the root agent.
|
|
1502
|
+
eveSubagentTargets = options.subagent.map((s) =>
|
|
1503
|
+
s === 'root' || s === '.' ? undefined : s
|
|
1504
|
+
);
|
|
1505
|
+
} else if (availableSubagents.length > 0 && !options.yes) {
|
|
1506
|
+
const subagentChoices = [
|
|
1507
|
+
{ value: '', label: 'Root agent', hint: 'agent/skills' },
|
|
1508
|
+
...availableSubagents.map((name) => ({
|
|
1509
|
+
value: name,
|
|
1510
|
+
label: name,
|
|
1511
|
+
hint: `agent/subagents/${name}/skills`,
|
|
1512
|
+
})),
|
|
1513
|
+
];
|
|
1514
|
+
|
|
1515
|
+
const selectedSubagents = await p.multiselect({
|
|
1516
|
+
message: 'Where should Eve skills be installed?',
|
|
1517
|
+
options: subagentChoices,
|
|
1518
|
+
initialValues: [''],
|
|
1519
|
+
required: true,
|
|
1520
|
+
});
|
|
1521
|
+
|
|
1522
|
+
if (p.isCancel(selectedSubagents)) {
|
|
1523
|
+
p.cancel('Installation cancelled');
|
|
1524
|
+
await cleanup(tempDir);
|
|
1525
|
+
process.exit(0);
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
eveSubagentTargets = (selectedSubagents as string[]).map((s) => (s === '' ? undefined : s));
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
const installTargets = buildInstallTargets(targetAgents, eveSubagentTargets);
|
|
1533
|
+
|
|
1367
1534
|
let installGlobally = options.global ?? false;
|
|
1368
1535
|
|
|
1369
1536
|
// Check if any selected agents support global installation
|
|
@@ -1399,10 +1566,17 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1399
1566
|
let installMode: InstallMode = options.copy ? 'copy' : 'symlink';
|
|
1400
1567
|
|
|
1401
1568
|
// Only prompt for install mode when there are multiple unique target directories.
|
|
1402
|
-
// When all selected
|
|
1403
|
-
|
|
1569
|
+
// When all selected targets share the same skillsDir, symlink vs copy is meaningless.
|
|
1570
|
+
// Eve writes skill files directly into each (sub)agent dir, so a symlink prompt is
|
|
1571
|
+
// never meaningful when every target is Eve.
|
|
1572
|
+
const allEve = installTargets.every((t) => t.agent === 'eve');
|
|
1573
|
+
const uniqueDirs = new Set(
|
|
1574
|
+
installTargets.map((t) =>
|
|
1575
|
+
t.subagent ? `eve:subagent:${t.subagent}` : agents[t.agent].skillsDir
|
|
1576
|
+
)
|
|
1577
|
+
);
|
|
1404
1578
|
|
|
1405
|
-
if (!options.copy && !options.yes && uniqueDirs.size > 1) {
|
|
1579
|
+
if (!options.copy && !options.yes && uniqueDirs.size > 1 && !allEve) {
|
|
1406
1580
|
const modeChoice = await p.select({
|
|
1407
1581
|
message: 'Installation method',
|
|
1408
1582
|
options: [
|
|
@@ -1422,8 +1596,8 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1422
1596
|
}
|
|
1423
1597
|
|
|
1424
1598
|
installMode = modeChoice as InstallMode;
|
|
1425
|
-
} else if (uniqueDirs.size <= 1) {
|
|
1426
|
-
// Single target directory — default to copy (no symlink needed)
|
|
1599
|
+
} else if (uniqueDirs.size <= 1 || allEve) {
|
|
1600
|
+
// Single target directory (or all-Eve) — default to copy (no symlink needed)
|
|
1427
1601
|
installMode = 'copy';
|
|
1428
1602
|
}
|
|
1429
1603
|
|
|
@@ -1431,24 +1605,27 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1431
1605
|
|
|
1432
1606
|
// Build installation summary
|
|
1433
1607
|
const summaryLines: string[] = [];
|
|
1434
|
-
const agentNames = targetAgents.map((a) => agents[a].displayName);
|
|
1435
1608
|
|
|
1436
1609
|
// Check if any skill will be overwritten (parallel)
|
|
1437
1610
|
const overwriteChecks = await Promise.all(
|
|
1438
1611
|
selectedSkills.flatMap((skill) =>
|
|
1439
|
-
|
|
1612
|
+
installTargets.map(async (target) => ({
|
|
1440
1613
|
skillName: skill.name,
|
|
1441
|
-
|
|
1442
|
-
installed: await isSkillInstalled(skill.name, agent, {
|
|
1614
|
+
target,
|
|
1615
|
+
installed: await isSkillInstalled(skill.name, target.agent, {
|
|
1616
|
+
global: installGlobally,
|
|
1617
|
+
eveSubagent: target.subagent,
|
|
1618
|
+
}),
|
|
1443
1619
|
}))
|
|
1444
1620
|
)
|
|
1445
1621
|
);
|
|
1622
|
+
// Keyed by skill name → target key → installed?
|
|
1446
1623
|
const overwriteStatus = new Map<string, Map<string, boolean>>();
|
|
1447
|
-
for (const { skillName,
|
|
1624
|
+
for (const { skillName, target, installed } of overwriteChecks) {
|
|
1448
1625
|
if (!overwriteStatus.has(skillName)) {
|
|
1449
1626
|
overwriteStatus.set(skillName, new Map());
|
|
1450
1627
|
}
|
|
1451
|
-
overwriteStatus.get(skillName)!.set(
|
|
1628
|
+
overwriteStatus.get(skillName)!.set(targetKey(target), installed);
|
|
1452
1629
|
}
|
|
1453
1630
|
|
|
1454
1631
|
// Group selected skills for summary
|
|
@@ -1470,15 +1647,22 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1470
1647
|
for (const skill of skills) {
|
|
1471
1648
|
if (summaryLines.length > 0) summaryLines.push('');
|
|
1472
1649
|
|
|
1473
|
-
const canonicalPath =
|
|
1650
|
+
const canonicalPath =
|
|
1651
|
+
installTargets.length === 1
|
|
1652
|
+
? getCanonicalPath(skill.name, {
|
|
1653
|
+
global: installGlobally,
|
|
1654
|
+
agent: installTargets[0]!.agent,
|
|
1655
|
+
eveSubagent: installTargets[0]!.subagent,
|
|
1656
|
+
})
|
|
1657
|
+
: getCanonicalPath(skill.name, { global: installGlobally });
|
|
1474
1658
|
const shortCanonical = shortenPath(canonicalPath, cwd);
|
|
1475
1659
|
summaryLines.push(`${pc.cyan(shortCanonical)}`);
|
|
1476
|
-
summaryLines.push(...
|
|
1660
|
+
summaryLines.push(...buildTargetSummaryLines(installTargets, installMode));
|
|
1477
1661
|
|
|
1478
1662
|
const skillOverwrites = overwriteStatus.get(skill.name);
|
|
1479
|
-
const overwriteAgents =
|
|
1480
|
-
.filter((
|
|
1481
|
-
.map(
|
|
1663
|
+
const overwriteAgents = installTargets
|
|
1664
|
+
.filter((t) => skillOverwrites?.get(targetKey(t)))
|
|
1665
|
+
.map(targetDisplayName);
|
|
1482
1666
|
|
|
1483
1667
|
if (overwriteAgents.length > 0) {
|
|
1484
1668
|
summaryLines.push(` ${pc.yellow('overwrites:')} ${formatList(overwriteAgents)}`);
|
|
@@ -1557,7 +1741,8 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1557
1741
|
}[] = [];
|
|
1558
1742
|
|
|
1559
1743
|
for (const skill of selectedSkills) {
|
|
1560
|
-
for (const
|
|
1744
|
+
for (const target of installTargets) {
|
|
1745
|
+
const { agent, subagent } = target;
|
|
1561
1746
|
let result;
|
|
1562
1747
|
if (blobResult && 'files' in skill) {
|
|
1563
1748
|
// Blob-based install: write files from snapshot
|
|
@@ -1565,6 +1750,13 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1565
1750
|
result = await installBlobSkillForAgent(
|
|
1566
1751
|
{ installName: blobSkill.name, files: blobSkill.files },
|
|
1567
1752
|
agent,
|
|
1753
|
+
{ global: installGlobally, mode: installMode, eveSubagent: subagent }
|
|
1754
|
+
);
|
|
1755
|
+
} else if (tempDir && skill.path === tempDir && skill.rawContent) {
|
|
1756
|
+
// Remote root-level SKILL.md: install the skill file, not the whole repository.
|
|
1757
|
+
result = await installBlobSkillForAgent(
|
|
1758
|
+
{ installName: skill.name, files: [{ path: 'SKILL.md', contents: skill.rawContent }] },
|
|
1759
|
+
agent,
|
|
1568
1760
|
{ global: installGlobally, mode: installMode }
|
|
1569
1761
|
);
|
|
1570
1762
|
} else {
|
|
@@ -1572,11 +1764,12 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1572
1764
|
result = await installSkillForAgent(skill, agent, {
|
|
1573
1765
|
global: installGlobally,
|
|
1574
1766
|
mode: installMode,
|
|
1767
|
+
eveSubagent: subagent,
|
|
1575
1768
|
});
|
|
1576
1769
|
}
|
|
1577
1770
|
results.push({
|
|
1578
1771
|
skill: getSkillDisplayName(skill),
|
|
1579
|
-
agent:
|
|
1772
|
+
agent: targetDisplayName(target),
|
|
1580
1773
|
pluginName: skill.pluginName,
|
|
1581
1774
|
...result,
|
|
1582
1775
|
});
|
|
@@ -1709,6 +1902,14 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1709
1902
|
// Add to local lock file for project-scoped installs
|
|
1710
1903
|
if (successful.length > 0 && !installGlobally) {
|
|
1711
1904
|
const successfulSkillNames = new Set(successful.map((r) => r.skill));
|
|
1905
|
+
// Record Eve subagent placement (root = '') so `update` can restore it.
|
|
1906
|
+
// Only meaningful when Eve is among the targets and a non-root subagent
|
|
1907
|
+
// was selected; otherwise omit for a clean, minimal lock entry.
|
|
1908
|
+
const eveSubagents = targetAgents.includes('eve')
|
|
1909
|
+
? eveSubagentTargets.map((s) => s ?? '')
|
|
1910
|
+
: undefined;
|
|
1911
|
+
const recordSubagents =
|
|
1912
|
+
eveSubagents && (eveSubagents.length > 1 || eveSubagents.some((s) => s !== ''));
|
|
1712
1913
|
for (const skill of selectedSkills) {
|
|
1713
1914
|
const skillDisplayName = getSkillDisplayName(skill);
|
|
1714
1915
|
if (successfulSkillNames.has(skillDisplayName)) {
|
|
@@ -1717,7 +1918,9 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1717
1918
|
const computedHash =
|
|
1718
1919
|
blobResult && 'snapshotHash' in skill
|
|
1719
1920
|
? (skill as BlobSkill).snapshotHash
|
|
1720
|
-
:
|
|
1921
|
+
: tempDir && skill.path === tempDir && skill.rawContent
|
|
1922
|
+
? computeSingleFileSkillHash(skill.rawContent)
|
|
1923
|
+
: await computeSkillFolderHash(skill.path);
|
|
1721
1924
|
const skillPathValue = skillFiles[skill.name];
|
|
1722
1925
|
await addSkillToLocalLock(
|
|
1723
1926
|
skill.name,
|
|
@@ -1727,6 +1930,7 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1727
1930
|
sourceType: parsed.type,
|
|
1728
1931
|
...(skillPathValue && { skillPath: skillPathValue }),
|
|
1729
1932
|
computedHash,
|
|
1933
|
+
...(recordSubagents && { subagents: eveSubagents }),
|
|
1730
1934
|
},
|
|
1731
1935
|
cwd
|
|
1732
1936
|
);
|
|
@@ -1934,13 +2138,13 @@ async function promptForFindSkills(
|
|
|
1934
2138
|
});
|
|
1935
2139
|
} catch {
|
|
1936
2140
|
p.log.warn('Failed to install find-skills. You can try again with:');
|
|
1937
|
-
p.log.message(pc.dim('
|
|
2141
|
+
p.log.message(pc.dim(' adg skills add vercel-labs/skills@find-skills -g -y --all'));
|
|
1938
2142
|
}
|
|
1939
2143
|
} else {
|
|
1940
2144
|
// User declined - dismiss the prompt
|
|
1941
2145
|
await dismissPrompt('findSkillsPrompt');
|
|
1942
2146
|
p.log.message(
|
|
1943
|
-
pc.dim('You can install it later with:
|
|
2147
|
+
pc.dim('You can install it later with: adg skills add vercel-labs/skills@find-skills')
|
|
1944
2148
|
);
|
|
1945
2149
|
}
|
|
1946
2150
|
} catch {
|
|
@@ -1990,6 +2194,16 @@ export function parseAddOptions(args: string[]): { source: string[]; options: Ad
|
|
|
1990
2194
|
options.copy = true;
|
|
1991
2195
|
} else if (arg === '--dangerously-accept-openclaw-risks') {
|
|
1992
2196
|
options.dangerouslyAcceptOpenclawRisks = true;
|
|
2197
|
+
} else if (arg === '--subagent') {
|
|
2198
|
+
options.subagent = options.subagent || [];
|
|
2199
|
+
i++;
|
|
2200
|
+
let nextArg = args[i];
|
|
2201
|
+
while (i < args.length && nextArg && !nextArg.startsWith('-')) {
|
|
2202
|
+
options.subagent.push(nextArg);
|
|
2203
|
+
i++;
|
|
2204
|
+
nextArg = args[i];
|
|
2205
|
+
}
|
|
2206
|
+
i--; // Back up one since the loop will increment
|
|
1993
2207
|
} else if (arg && !arg.startsWith('-')) {
|
|
1994
2208
|
source.push(arg);
|
|
1995
2209
|
}
|