@rbbtsn0w/adg 0.5.0-beta.1 → 0.5.0-beta.2
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 +18 -9
- package/dist/vendor/skills/src/add.js +6 -12
- package/dist/vendor/skills/src/cli.js +1 -2
- package/dist/vendor/skills/src/install.js +1 -1
- package/dist/vendor/skills/src/telemetry.js +25 -14
- package/dist/vendor/skills/src/update.js +4 -4
- package/package.json +1 -1
- package/vendor/skills/src/add.ts +5 -13
- package/vendor/skills/src/cli.ts +1 -2
- package/vendor/skills/src/install.ts +1 -1
- package/vendor/skills/src/telemetry.ts +76 -25
- package/vendor/skills/src/update.ts +6 -6
- package/dist/vendor/skills/package.json +0 -143
package/dist/bin/adg.js
CHANGED
|
@@ -96,6 +96,7 @@ async function main(argv) {
|
|
|
96
96
|
// network refresh when the cache is stale — the refresh uses an unreffed
|
|
97
97
|
// socket so it cannot delay process exit).
|
|
98
98
|
const currentVersion = getVersion();
|
|
99
|
+
span.setAttribute("cli.version", currentVersion);
|
|
99
100
|
const latestVersion = checkForUpdate(currentVersion);
|
|
100
101
|
if (latestVersion) {
|
|
101
102
|
process.stderr.write(formatUpdateNotice(currentVersion, latestVersion));
|
|
@@ -174,17 +174,26 @@ function translateToolMatcher(matcher) {
|
|
|
174
174
|
if (typeof matcher !== "string")
|
|
175
175
|
return undefined;
|
|
176
176
|
const tokens = matcher.split("|");
|
|
177
|
-
if (tokens.some((token) => !/^[A-Za-z0-9_]+$/.test(token)))
|
|
178
|
-
return undefined;
|
|
179
177
|
const translated = [];
|
|
180
178
|
for (const token of tokens) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
translated.push(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
179
|
+
if (token.startsWith("mcp__")) {
|
|
180
|
+
const mapped = "mcp_" + token.slice(5).replaceAll("__", "_");
|
|
181
|
+
translated.push(mapped);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
if (!/^[A-Za-z0-9_]+$/.test(token))
|
|
185
|
+
return undefined;
|
|
186
|
+
const alias = TOOL_ALIASES[token];
|
|
187
|
+
if (alias) {
|
|
188
|
+
translated.push(alias);
|
|
189
|
+
}
|
|
190
|
+
else if (ANTIGRAVITY_TOOL_NAMES.has(token)) {
|
|
191
|
+
translated.push(token);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
188
197
|
}
|
|
189
198
|
return translated.join("|");
|
|
190
199
|
}
|
|
@@ -32,16 +32,12 @@ import { gitTreeShaForFolder } from "./git-tree.js";
|
|
|
32
32
|
import { discoverSkills, getSkillDisplayName, filterSkills } from "./skills.js";
|
|
33
33
|
import { installSkillForAgent, installBlobSkillForAgent, isSkillInstalled, getCanonicalPath, installWellKnownSkillForAgent, } from "./installer.js";
|
|
34
34
|
import { detectInstalledAgents, agents, getUniversalAgents, getVisibleUniversalAgents, getNonUniversalAgents, isUniversalAgent, } from "./agents.js";
|
|
35
|
-
import { track,
|
|
35
|
+
import { track, fetchAuditData, } from "./telemetry.js";
|
|
36
36
|
import { detectAgent, getAgentType } from "./detect-agent.js";
|
|
37
37
|
import { wellKnownProvider } from "./providers/index.js";
|
|
38
38
|
import { addSkillToLock, fetchSkillFolderHash, getGitHubToken, isPromptDismissed, dismissPrompt, getLastSelectedAgents, saveSelectedAgents, } from "./skill-lock.js";
|
|
39
39
|
import { addSkillToLocalLock, computeSkillFolderHash } from "./local-lock.js";
|
|
40
40
|
import { tryBlobInstall, BLOB_ALLOWED_REPOS, getSkillFolderHashFromTree, fetchRepoTree, } from "./blob.js";
|
|
41
|
-
import packageJson from '../package.json' with { type: 'json' };
|
|
42
|
-
export function initTelemetry(version) {
|
|
43
|
-
setVersion(version);
|
|
44
|
-
}
|
|
45
41
|
// ─── Security Advisory ───
|
|
46
42
|
function riskLabel(risk) {
|
|
47
43
|
switch (risk) {
|
|
@@ -322,8 +318,6 @@ async function selectAgentsInteractive(options) {
|
|
|
322
318
|
}
|
|
323
319
|
return selected;
|
|
324
320
|
}
|
|
325
|
-
const version = packageJson.version;
|
|
326
|
-
setVersion(version);
|
|
327
321
|
/**
|
|
328
322
|
* Handle skills from a well-known endpoint (RFC 8615).
|
|
329
323
|
* Discovers skills from /.well-known/agent-skills/index.json (preferred)
|
|
@@ -714,10 +708,10 @@ export async function runAdd(args, options = {}) {
|
|
|
714
708
|
console.log(pc.bgRed(pc.white(pc.bold(' ERROR '))) + ' ' + pc.red('Missing required argument: source'));
|
|
715
709
|
console.log();
|
|
716
710
|
console.log(pc.dim(' Usage:'));
|
|
717
|
-
console.log(` ${pc.cyan('
|
|
711
|
+
console.log(` ${pc.cyan('adg skills add')} ${pc.yellow('<source>')} ${pc.dim('[options]')}`);
|
|
718
712
|
console.log();
|
|
719
713
|
console.log(pc.dim(' Example:'));
|
|
720
|
-
console.log(` ${pc.cyan('
|
|
714
|
+
console.log(` ${pc.cyan('adg skills add')} ${pc.yellow('vercel-labs/agent-skills')}`);
|
|
721
715
|
console.log();
|
|
722
716
|
process.exit(1);
|
|
723
717
|
}
|
|
@@ -777,7 +771,7 @@ export async function runAdd(args, options = {}) {
|
|
|
777
771
|
p.log.message(pc.yellow('This source contains user-submitted skills that have not been reviewed for safety or quality.'));
|
|
778
772
|
p.log.message(pc.yellow('Skills run with full agent permissions and could be malicious.'));
|
|
779
773
|
console.log();
|
|
780
|
-
p.log.message(`If you understand the risks, re-run with:\n\n ${pc.cyan(`
|
|
774
|
+
p.log.message(`If you understand the risks, re-run with:\n\n ${pc.cyan(`adg skills add ${source} --dangerously-accept-openclaw-risks`)}\n`);
|
|
781
775
|
p.outro(pc.red('Installation blocked'));
|
|
782
776
|
process.exit(1);
|
|
783
777
|
}
|
|
@@ -1593,13 +1587,13 @@ async function promptForFindSkills(options, targetAgents) {
|
|
|
1593
1587
|
}
|
|
1594
1588
|
catch {
|
|
1595
1589
|
p.log.warn('Failed to install find-skills. You can try again with:');
|
|
1596
|
-
p.log.message(pc.dim('
|
|
1590
|
+
p.log.message(pc.dim(' adg skills add vercel-labs/skills@find-skills -g -y --all'));
|
|
1597
1591
|
}
|
|
1598
1592
|
}
|
|
1599
1593
|
else {
|
|
1600
1594
|
// User declined - dismiss the prompt
|
|
1601
1595
|
await dismissPrompt('findSkillsPrompt');
|
|
1602
|
-
p.log.message(pc.dim('You can install it later with:
|
|
1596
|
+
p.log.message(pc.dim('You can install it later with: adg skills add vercel-labs/skills@find-skills'));
|
|
1603
1597
|
}
|
|
1604
1598
|
}
|
|
1605
1599
|
catch {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
3
|
import { basename, join, dirname } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
|
-
import { runAdd, parseAddOptions
|
|
5
|
+
import { runAdd, parseAddOptions } from "./add.js";
|
|
6
6
|
import { runFind } from "./find.js";
|
|
7
7
|
import { runInstallFromLock } from "./install.js";
|
|
8
8
|
import { runList } from "./list.js";
|
|
@@ -24,7 +24,6 @@ function getVersion() {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const VERSION = getVersion();
|
|
27
|
-
initTelemetry(VERSION);
|
|
28
27
|
const RESET = '\x1b[0m';
|
|
29
28
|
const BOLD = '\x1b[1m';
|
|
30
29
|
// 256-color grays - visible on both light and dark backgrounds
|
|
@@ -19,7 +19,7 @@ export async function runInstallFromLock(args) {
|
|
|
19
19
|
const skillEntries = Object.entries(lock.skills);
|
|
20
20
|
if (skillEntries.length === 0) {
|
|
21
21
|
p.log.warn('No project skills found in skills-lock.json');
|
|
22
|
-
p.log.info(`Add project-level skills with ${pc.cyan('
|
|
22
|
+
p.log.info(`Add project-level skills with ${pc.cyan('adg skills add <package>')} (without ${pc.cyan('-g')})`);
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
// Only install to .agents/skills/ (universal agents)
|
|
@@ -13,6 +13,7 @@ const TELEMETRY_URL = process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||
|
|
|
13
13
|
(baseEndpoint
|
|
14
14
|
? `${baseEndpoint.replace(/\/$/, "")}/v1/traces`
|
|
15
15
|
: "https://telemetry-gateway.hamiltonsnow.workers.dev/v1/traces");
|
|
16
|
+
const AUDIT_URL = "https://add-skill.vercel.sh/audit";
|
|
16
17
|
let provider = null;
|
|
17
18
|
let activeTracer = null;
|
|
18
19
|
let detectedAgentName = null;
|
|
@@ -34,7 +35,13 @@ function getCliVersion() {
|
|
|
34
35
|
try {
|
|
35
36
|
const self = fileURLToPath(import.meta.url);
|
|
36
37
|
const here = dirname(self);
|
|
37
|
-
|
|
38
|
+
// Resolve adg's top-level package.json (name "@rbbtsn0w/adg"), not the
|
|
39
|
+
// vendored skills-cli package.json. This module lives at
|
|
40
|
+
// vendor/skills/src/telemetry.ts (dev) or dist/vendor/skills/src/
|
|
41
|
+
// telemetry.js (built), so the adg root is 3 levels up for .ts, 4 for .js.
|
|
42
|
+
const up = self.endsWith(".ts")
|
|
43
|
+
? join("..", "..", "..")
|
|
44
|
+
: join("..", "..", "..", "..");
|
|
38
45
|
const pkgPath = join(here, up, "package.json");
|
|
39
46
|
if (!existsSync(pkgPath))
|
|
40
47
|
return null;
|
|
@@ -46,23 +53,27 @@ function getCliVersion() {
|
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
const cliVersion = getCliVersion();
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Fetch security audit results for skills from the audit API.
|
|
58
|
+
* Returns null on any error or timeout — never blocks installation.
|
|
59
|
+
*/
|
|
60
|
+
export async function fetchAuditData(source, skillSlugs, timeoutMs = 3000) {
|
|
61
|
+
if (skillSlugs.length === 0)
|
|
51
62
|
return null;
|
|
52
63
|
try {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
const params = new URLSearchParams({
|
|
65
|
+
source,
|
|
66
|
+
skills: skillSlugs.join(","),
|
|
67
|
+
});
|
|
68
|
+
const controller = new AbortController();
|
|
69
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
70
|
+
const response = await fetch(`${AUDIT_URL}?${params.toString()}`, {
|
|
71
|
+
signal: controller.signal,
|
|
60
72
|
});
|
|
61
|
-
|
|
73
|
+
clearTimeout(timeout);
|
|
74
|
+
if (!response.ok)
|
|
62
75
|
return null;
|
|
63
|
-
|
|
64
|
-
const data = (await res.json());
|
|
65
|
-
return data.warning || null;
|
|
76
|
+
return (await response.json());
|
|
66
77
|
}
|
|
67
78
|
catch {
|
|
68
79
|
return null;
|
|
@@ -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
|
}
|
|
@@ -601,7 +601,7 @@ export function printLegacyProjectSkills(legacy) {
|
|
|
601
601
|
for (const skill of legacy) {
|
|
602
602
|
const reinstall = formatSourceInput(skill.entry.source, skill.entry.ref);
|
|
603
603
|
console.log(` ${TEXT}•${RESET} ${sanitizeMetadata(skill.name)}`);
|
|
604
|
-
console.log(` ${DIM}To refresh: ${TEXT}
|
|
604
|
+
console.log(` ${DIM}To refresh: ${TEXT}adg skills add ${reinstall} -y${RESET}`);
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
export async function runUpdate(args = []) {
|
package/package.json
CHANGED
package/vendor/skills/src/add.ts
CHANGED
|
@@ -51,7 +51,6 @@ import {
|
|
|
51
51
|
} from './agents.ts';
|
|
52
52
|
import {
|
|
53
53
|
track,
|
|
54
|
-
setVersion,
|
|
55
54
|
fetchAuditData,
|
|
56
55
|
type AuditResponse,
|
|
57
56
|
type PartnerAudit,
|
|
@@ -77,10 +76,6 @@ import {
|
|
|
77
76
|
type BlobSkill,
|
|
78
77
|
type BlobInstallResult,
|
|
79
78
|
} from './blob.ts';
|
|
80
|
-
import packageJson from '../package.json' with { type: 'json' };
|
|
81
|
-
export function initTelemetry(version: string): void {
|
|
82
|
-
setVersion(version);
|
|
83
|
-
}
|
|
84
79
|
|
|
85
80
|
// ─── Security Advisory ───
|
|
86
81
|
|
|
@@ -429,9 +424,6 @@ async function selectAgentsInteractive(options: {
|
|
|
429
424
|
return selected as AgentType[] | symbol;
|
|
430
425
|
}
|
|
431
426
|
|
|
432
|
-
const version = packageJson.version;
|
|
433
|
-
setVersion(version);
|
|
434
|
-
|
|
435
427
|
export interface AddOptions {
|
|
436
428
|
global?: boolean;
|
|
437
429
|
agent?: string[];
|
|
@@ -927,10 +919,10 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
927
919
|
);
|
|
928
920
|
console.log();
|
|
929
921
|
console.log(pc.dim(' Usage:'));
|
|
930
|
-
console.log(` ${pc.cyan('
|
|
922
|
+
console.log(` ${pc.cyan('adg skills add')} ${pc.yellow('<source>')} ${pc.dim('[options]')}`);
|
|
931
923
|
console.log();
|
|
932
924
|
console.log(pc.dim(' Example:'));
|
|
933
|
-
console.log(` ${pc.cyan('
|
|
925
|
+
console.log(` ${pc.cyan('adg skills add')} ${pc.yellow('vercel-labs/agent-skills')}`);
|
|
934
926
|
console.log();
|
|
935
927
|
process.exit(1);
|
|
936
928
|
}
|
|
@@ -1005,7 +997,7 @@ export async function runAdd(args: string[], options: AddOptions = {}): Promise<
|
|
|
1005
997
|
p.log.message(pc.yellow('Skills run with full agent permissions and could be malicious.'));
|
|
1006
998
|
console.log();
|
|
1007
999
|
p.log.message(
|
|
1008
|
-
`If you understand the risks, re-run with:\n\n ${pc.cyan(`
|
|
1000
|
+
`If you understand the risks, re-run with:\n\n ${pc.cyan(`adg skills add ${source} --dangerously-accept-openclaw-risks`)}\n`
|
|
1009
1001
|
);
|
|
1010
1002
|
p.outro(pc.red('Installation blocked'));
|
|
1011
1003
|
process.exit(1);
|
|
@@ -1934,13 +1926,13 @@ async function promptForFindSkills(
|
|
|
1934
1926
|
});
|
|
1935
1927
|
} catch {
|
|
1936
1928
|
p.log.warn('Failed to install find-skills. You can try again with:');
|
|
1937
|
-
p.log.message(pc.dim('
|
|
1929
|
+
p.log.message(pc.dim(' adg skills add vercel-labs/skills@find-skills -g -y --all'));
|
|
1938
1930
|
}
|
|
1939
1931
|
} else {
|
|
1940
1932
|
// User declined - dismiss the prompt
|
|
1941
1933
|
await dismissPrompt('findSkillsPrompt');
|
|
1942
1934
|
p.log.message(
|
|
1943
|
-
pc.dim('You can install it later with:
|
|
1935
|
+
pc.dim('You can install it later with: adg skills add vercel-labs/skills@find-skills')
|
|
1944
1936
|
);
|
|
1945
1937
|
}
|
|
1946
1938
|
} catch {
|
package/vendor/skills/src/cli.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
|
|
4
4
|
import { basename, join, dirname } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
-
import { runAdd, parseAddOptions
|
|
6
|
+
import { runAdd, parseAddOptions } from './add.ts';
|
|
7
7
|
import { runFind } from './find.ts';
|
|
8
8
|
import { runInstallFromLock } from './install.ts';
|
|
9
9
|
import { runList } from './list.ts';
|
|
@@ -27,7 +27,6 @@ function getVersion(): string {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const VERSION = getVersion();
|
|
30
|
-
initTelemetry(VERSION);
|
|
31
30
|
|
|
32
31
|
const RESET = '\x1b[0m';
|
|
33
32
|
const BOLD = '\x1b[1m';
|
|
@@ -22,7 +22,7 @@ export async function runInstallFromLock(args: string[]): Promise<void> {
|
|
|
22
22
|
if (skillEntries.length === 0) {
|
|
23
23
|
p.log.warn('No project skills found in skills-lock.json');
|
|
24
24
|
p.log.info(
|
|
25
|
-
`Add project-level skills with ${pc.cyan('
|
|
25
|
+
`Add project-level skills with ${pc.cyan('adg skills add <package>')} (without ${pc.cyan('-g')})`
|
|
26
26
|
);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
@@ -16,30 +16,55 @@ const TELEMETRY_URL =
|
|
|
16
16
|
? `${baseEndpoint.replace(/\/$/, "")}/v1/traces`
|
|
17
17
|
: "https://telemetry-gateway.hamiltonsnow.workers.dev/v1/traces");
|
|
18
18
|
|
|
19
|
+
const AUDIT_URL = "https://add-skill.vercel.sh/audit";
|
|
20
|
+
|
|
19
21
|
interface InstallTelemetryData {
|
|
20
22
|
event: "install";
|
|
21
23
|
source: string;
|
|
22
24
|
skills: string;
|
|
23
25
|
agents: string;
|
|
24
26
|
global?: "1";
|
|
25
|
-
skillFiles?: string;
|
|
27
|
+
skillFiles?: string; // JSON stringified { skillName: relativePath }
|
|
28
|
+
sourceType?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface RemoveTelemetryData {
|
|
32
|
+
event: "remove";
|
|
33
|
+
source?: string;
|
|
34
|
+
skills: string;
|
|
35
|
+
agents: string;
|
|
36
|
+
global?: "1";
|
|
37
|
+
sourceType?: string;
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
interface UpdateTelemetryData {
|
|
29
41
|
event: "update";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
scope?: string;
|
|
43
|
+
skillCount: string;
|
|
44
|
+
successCount: string;
|
|
45
|
+
failCount: string;
|
|
34
46
|
}
|
|
35
47
|
|
|
36
|
-
interface
|
|
37
|
-
event: "
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
interface FindTelemetryData {
|
|
49
|
+
event: "find";
|
|
50
|
+
query: string;
|
|
51
|
+
resultCount: string;
|
|
52
|
+
interactive?: "1";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface SyncTelemetryData {
|
|
56
|
+
event: "experimental_sync";
|
|
57
|
+
skillCount: string;
|
|
58
|
+
successCount: string;
|
|
59
|
+
agents: string;
|
|
40
60
|
}
|
|
41
61
|
|
|
42
|
-
type TelemetryData =
|
|
62
|
+
type TelemetryData =
|
|
63
|
+
| InstallTelemetryData
|
|
64
|
+
| RemoveTelemetryData
|
|
65
|
+
| UpdateTelemetryData
|
|
66
|
+
| FindTelemetryData
|
|
67
|
+
| SyncTelemetryData;
|
|
43
68
|
|
|
44
69
|
let provider: NodeTracerProvider | null = null;
|
|
45
70
|
let activeTracer: Tracer | null = null;
|
|
@@ -70,7 +95,13 @@ function getCliVersion(): string | null {
|
|
|
70
95
|
try {
|
|
71
96
|
const self = fileURLToPath(import.meta.url);
|
|
72
97
|
const here = dirname(self);
|
|
73
|
-
|
|
98
|
+
// Resolve adg's top-level package.json (name "@rbbtsn0w/adg"), not the
|
|
99
|
+
// vendored skills-cli package.json. This module lives at
|
|
100
|
+
// vendor/skills/src/telemetry.ts (dev) or dist/vendor/skills/src/
|
|
101
|
+
// telemetry.js (built), so the adg root is 3 levels up for .ts, 4 for .js.
|
|
102
|
+
const up = self.endsWith(".ts")
|
|
103
|
+
? join("..", "..", "..")
|
|
104
|
+
: join("..", "..", "..", "..");
|
|
74
105
|
const pkgPath = join(here, up, "package.json");
|
|
75
106
|
if (!existsSync(pkgPath)) return null;
|
|
76
107
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
@@ -82,25 +113,45 @@ function getCliVersion(): string | null {
|
|
|
82
113
|
|
|
83
114
|
const cliVersion = getCliVersion();
|
|
84
115
|
|
|
85
|
-
|
|
86
|
-
|
|
116
|
+
// ─── Security audit data ───
|
|
117
|
+
|
|
118
|
+
export interface PartnerAudit {
|
|
119
|
+
risk: "safe" | "low" | "medium" | "high" | "critical" | "unknown";
|
|
120
|
+
alerts?: number;
|
|
121
|
+
score?: number;
|
|
122
|
+
analyzedAt: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type SkillAuditData = Record<string, PartnerAudit>;
|
|
126
|
+
export type AuditResponse = Record<string, SkillAuditData>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Fetch security audit results for skills from the audit API.
|
|
130
|
+
* Returns null on any error or timeout — never blocks installation.
|
|
131
|
+
*/
|
|
132
|
+
export async function fetchAuditData(
|
|
133
|
+
source: string,
|
|
134
|
+
skillSlugs: string[],
|
|
135
|
+
timeoutMs = 3000
|
|
136
|
+
): Promise<AuditResponse | null> {
|
|
137
|
+
if (skillSlugs.length === 0) return null;
|
|
87
138
|
|
|
88
139
|
try {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"Content-Type": "application/json",
|
|
93
|
-
"User-Agent": `skills-cli/${cliVersion || "unknown"}`,
|
|
94
|
-
},
|
|
95
|
-
body: JSON.stringify({ source }),
|
|
140
|
+
const params = new URLSearchParams({
|
|
141
|
+
source,
|
|
142
|
+
skills: skillSlugs.join(","),
|
|
96
143
|
});
|
|
97
144
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
145
|
+
const controller = new AbortController();
|
|
146
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
147
|
+
|
|
148
|
+
const response = await fetch(`${AUDIT_URL}?${params.toString()}`, {
|
|
149
|
+
signal: controller.signal,
|
|
150
|
+
});
|
|
151
|
+
clearTimeout(timeout);
|
|
101
152
|
|
|
102
|
-
|
|
103
|
-
return
|
|
153
|
+
if (!response.ok) return null;
|
|
154
|
+
return (await response.json()) as AuditResponse;
|
|
104
155
|
} catch {
|
|
105
156
|
return null;
|
|
106
157
|
}
|
|
@@ -230,7 +230,7 @@ export function printSkippedSkills(skipped: SkippedSkill[]): void {
|
|
|
230
230
|
const names = skills.map((s) => sanitizeMetadata(s.name)).join(', ');
|
|
231
231
|
console.log(` ${TEXT}•${RESET} ${names} ${DIM}(${reason})${RESET}`);
|
|
232
232
|
}
|
|
233
|
-
console.log(` ${DIM}To update: ${TEXT}
|
|
233
|
+
console.log(` ${DIM}To update: ${TEXT}adg skills add ${source} -g -y${RESET}`);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -305,7 +305,7 @@ export async function updateGlobalSkills(
|
|
|
305
305
|
if (skillNames.length === 0) {
|
|
306
306
|
if (!options.skills) {
|
|
307
307
|
console.log(`${DIM}No global skills tracked in lock file.${RESET}`);
|
|
308
|
-
console.log(`${DIM}Install skills with${RESET} ${TEXT}
|
|
308
|
+
console.log(`${DIM}Install skills with${RESET} ${TEXT}adg skills add <package> -g${RESET}`);
|
|
309
309
|
}
|
|
310
310
|
return { successCount, failCount, checkedCount: 0 };
|
|
311
311
|
}
|
|
@@ -543,7 +543,7 @@ export async function updateGlobalSkills(
|
|
|
543
543
|
}
|
|
544
544
|
} else if (r.error) {
|
|
545
545
|
span.setAttribute("process.exit.code", -1);
|
|
546
|
-
span.setAttribute("error.type", r.error.code || r.error.name || "SpawnError");
|
|
546
|
+
span.setAttribute("error.type", (r.error as NodeJS.ErrnoException).code || r.error.name || "SpawnError");
|
|
547
547
|
span.recordException(r.error);
|
|
548
548
|
span.setStatus({
|
|
549
549
|
code: SpanStatusCode.ERROR,
|
|
@@ -580,7 +580,7 @@ export async function updateProjectSkills(
|
|
|
580
580
|
if (!options.skills) {
|
|
581
581
|
console.log(`${DIM}No project skills to update.${RESET}`);
|
|
582
582
|
console.log(
|
|
583
|
-
`${DIM}Install project skills with${RESET} ${TEXT}
|
|
583
|
+
`${DIM}Install project skills with${RESET} ${TEXT}adg skills add <package>${RESET}`
|
|
584
584
|
);
|
|
585
585
|
}
|
|
586
586
|
return { successCount, failCount, foundCount: 0 };
|
|
@@ -712,7 +712,7 @@ export async function updateProjectSkills(
|
|
|
712
712
|
}
|
|
713
713
|
} else if (r.error) {
|
|
714
714
|
span.setAttribute("process.exit.code", -1);
|
|
715
|
-
span.setAttribute("error.type", r.error.code || r.error.name || "SpawnError");
|
|
715
|
+
span.setAttribute("error.type", (r.error as NodeJS.ErrnoException).code || r.error.name || "SpawnError");
|
|
716
716
|
span.recordException(r.error);
|
|
717
717
|
span.setStatus({
|
|
718
718
|
code: SpanStatusCode.ERROR,
|
|
@@ -750,7 +750,7 @@ export function printLegacyProjectSkills(
|
|
|
750
750
|
for (const skill of legacy) {
|
|
751
751
|
const reinstall = formatSourceInput(skill.entry.source, skill.entry.ref);
|
|
752
752
|
console.log(` ${TEXT}•${RESET} ${sanitizeMetadata(skill.name)}`);
|
|
753
|
-
console.log(` ${DIM}To refresh: ${TEXT}
|
|
753
|
+
console.log(` ${DIM}To refresh: ${TEXT}adg skills add ${reinstall} -y${RESET}`);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "skills",
|
|
3
|
-
"version": "1.5.11",
|
|
4
|
-
"description": "The open agent skills ecosystem",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"skills": "./bin/cli.mjs",
|
|
8
|
-
"add-skill": "./bin/cli.mjs"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"bin",
|
|
13
|
-
"README.md",
|
|
14
|
-
"ThirdPartyNoticeText.txt"
|
|
15
|
-
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "node scripts/generate-licenses.ts && obuild",
|
|
18
|
-
"generate-licenses": "node scripts/generate-licenses.ts",
|
|
19
|
-
"dev": "node src/cli.ts",
|
|
20
|
-
"exec:test": "node scripts/execute-tests.ts",
|
|
21
|
-
"prepublishOnly": "npm run build",
|
|
22
|
-
"format": "prettier --write \"src/**/*.ts\" \"scripts/**/*.ts\"",
|
|
23
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"scripts/**/*.ts\"",
|
|
24
|
-
"prepare": "husky",
|
|
25
|
-
"test": "vitest",
|
|
26
|
-
"type-check": "tsc --noEmit",
|
|
27
|
-
"publish:snapshot": "npm version prerelease --preid=snapshot --no-git-tag-version && npm publish --tag snapshot"
|
|
28
|
-
},
|
|
29
|
-
"lint-staged": {
|
|
30
|
-
"src/**/*.ts": "prettier --write",
|
|
31
|
-
"scripts/**/*.ts": "prettier --write",
|
|
32
|
-
"tests/**/*.ts": "prettier --write"
|
|
33
|
-
},
|
|
34
|
-
"keywords": [
|
|
35
|
-
"cli",
|
|
36
|
-
"agent-skills",
|
|
37
|
-
"skills",
|
|
38
|
-
"ai-agents",
|
|
39
|
-
"aider-desk",
|
|
40
|
-
"amp",
|
|
41
|
-
"antigravity",
|
|
42
|
-
"antigravity-cli",
|
|
43
|
-
"astrbot",
|
|
44
|
-
"autohand-code",
|
|
45
|
-
"augment",
|
|
46
|
-
"bob",
|
|
47
|
-
"claude-code",
|
|
48
|
-
"openclaw",
|
|
49
|
-
"cline",
|
|
50
|
-
"codearts-agent",
|
|
51
|
-
"codebuddy",
|
|
52
|
-
"codemaker",
|
|
53
|
-
"codestudio",
|
|
54
|
-
"codex",
|
|
55
|
-
"command-code",
|
|
56
|
-
"continue",
|
|
57
|
-
"cortex",
|
|
58
|
-
"crush",
|
|
59
|
-
"cursor",
|
|
60
|
-
"deepagents",
|
|
61
|
-
"devin",
|
|
62
|
-
"dexto",
|
|
63
|
-
"droid",
|
|
64
|
-
"firebender",
|
|
65
|
-
"forgecode",
|
|
66
|
-
"gemini-cli",
|
|
67
|
-
"github-copilot",
|
|
68
|
-
"goose",
|
|
69
|
-
"hermes-agent",
|
|
70
|
-
"inference-sh",
|
|
71
|
-
"jazz",
|
|
72
|
-
"junie",
|
|
73
|
-
"iflow-cli",
|
|
74
|
-
"kilo",
|
|
75
|
-
"kimi-code-cli",
|
|
76
|
-
"kiro-cli",
|
|
77
|
-
"kode",
|
|
78
|
-
"lingma",
|
|
79
|
-
"loaf",
|
|
80
|
-
"mcpjam",
|
|
81
|
-
"mistral-vibe",
|
|
82
|
-
"moxby",
|
|
83
|
-
"mux",
|
|
84
|
-
"opencode",
|
|
85
|
-
"openhands",
|
|
86
|
-
"ona",
|
|
87
|
-
"pi",
|
|
88
|
-
"qoder",
|
|
89
|
-
"qoder-cn",
|
|
90
|
-
"qwen-code",
|
|
91
|
-
"replit",
|
|
92
|
-
"reasonix",
|
|
93
|
-
"rovodev",
|
|
94
|
-
"roo",
|
|
95
|
-
"tabnine-cli",
|
|
96
|
-
"terramind",
|
|
97
|
-
"tinycloud",
|
|
98
|
-
"trae",
|
|
99
|
-
"trae-cn",
|
|
100
|
-
"warp",
|
|
101
|
-
"windsurf",
|
|
102
|
-
"zed",
|
|
103
|
-
"zencoder",
|
|
104
|
-
"zenflow",
|
|
105
|
-
"neovate",
|
|
106
|
-
"pochi",
|
|
107
|
-
"promptscript",
|
|
108
|
-
"adal",
|
|
109
|
-
"universal"
|
|
110
|
-
],
|
|
111
|
-
"repository": {
|
|
112
|
-
"type": "git",
|
|
113
|
-
"url": "git+https://github.com/vercel-labs/skills.git"
|
|
114
|
-
},
|
|
115
|
-
"homepage": "https://github.com/vercel-labs/skills#readme",
|
|
116
|
-
"bugs": {
|
|
117
|
-
"url": "https://github.com/vercel-labs/skills/issues"
|
|
118
|
-
},
|
|
119
|
-
"author": "",
|
|
120
|
-
"license": "MIT",
|
|
121
|
-
"devDependencies": {
|
|
122
|
-
"@clack/prompts": "^0.11.0",
|
|
123
|
-
"@types/bun": "latest",
|
|
124
|
-
"@types/node": "^22.10.0",
|
|
125
|
-
"@vercel/detect-agent": "^1.2.1",
|
|
126
|
-
"husky": "^9.1.7",
|
|
127
|
-
"lint-staged": "^16.2.7",
|
|
128
|
-
"obuild": "^0.4.22",
|
|
129
|
-
"picocolors": "^1.1.1",
|
|
130
|
-
"prettier": "^3.8.1",
|
|
131
|
-
"simple-git": "^3.27.0",
|
|
132
|
-
"typescript": "^5.9.3",
|
|
133
|
-
"vitest": "^4.0.17",
|
|
134
|
-
"xdg-basedir": "^5.1.0"
|
|
135
|
-
},
|
|
136
|
-
"engines": {
|
|
137
|
-
"node": ">=18"
|
|
138
|
-
},
|
|
139
|
-
"packageManager": "pnpm@10.17.1",
|
|
140
|
-
"dependencies": {
|
|
141
|
-
"yaml": "^2.8.3"
|
|
142
|
-
}
|
|
143
|
-
}
|