@rbbtsn0w/adg 0.10.1-dev.pr150.a0bbc4c → 0.10.1-dev.pr152.b8c43a6

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.
@@ -3,7 +3,7 @@ import { readFileSync, existsSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { getTracer as getAdgTracer, shutdownTelemetry } from "../../../src/telemetry.js";
6
- const AUDIT_URL = "https://add-skill.vercel.sh/audit";
6
+ const AUDIT_URL = "https://www.skills.sh/tele/audit";
7
7
  let detectedAgentName = null;
8
8
  export function setDetectedAgent(agentName) {
9
9
  detectedAgentName = agentName;
@@ -1,4 +1,4 @@
1
- import { execFileSync } from 'child_process';
1
+ import { execFileSync, spawnSync } from 'child_process';
2
2
  import { mkdtempSync, rmSync } from 'fs';
3
3
  import { tmpdir } from 'os';
4
4
  import { join } from 'path';
@@ -79,20 +79,17 @@ function createIsolatedTestEnvironment(overrides) {
79
79
  export function runCli(args, cwd, env, timeout) {
80
80
  const { env: testEnv, temporaryHome } = createIsolatedTestEnvironment(env);
81
81
  try {
82
- const output = execFileSync(process.execPath, [CLI_PATH, ...args], {
82
+ const result = spawnSync(process.execPath, [CLI_PATH, ...args], {
83
83
  encoding: 'utf-8',
84
84
  cwd,
85
85
  stdio: ['pipe', 'pipe', 'pipe'],
86
86
  env: testEnv,
87
87
  timeout: timeout ?? 30000,
88
88
  });
89
- return { stdout: stripAnsi(output), stderr: '', exitCode: 0 };
90
- }
91
- catch (error) {
92
89
  return {
93
- stdout: stripAnsi(error.stdout || ''),
94
- stderr: stripAnsi(error.stderr || ''),
95
- exitCode: error.status || 1,
90
+ stdout: stripAnsi(result.stdout || ''),
91
+ stderr: stripAnsi(result.stderr || ''),
92
+ exitCode: result.status ?? 1,
96
93
  };
97
94
  }
98
95
  finally {
@@ -1,15 +1,16 @@
1
- import { existsSync, readdirSync } from 'fs';
1
+ import { existsSync, readFileSync, readdirSync } from 'fs';
2
2
  import { spawnSync } from 'child_process';
3
3
  import { join, dirname, relative, sep } from 'path';
4
4
  import { fileURLToPath } from 'url';
5
5
  import * as p from '@clack/prompts';
6
6
  import pc from 'picocolors';
7
7
  import { readSkillLock, writeSkillLock, getGitHubToken } from './skill-lock.js';
8
- import { computeSkillFolderHash, readLocalLock } from './local-lock.js';
8
+ import { computeSkillFolderHash, computeSingleFileSkillHash, readLocalLock } from './local-lock.js';
9
9
  import { formatSourceInput, buildUpdateInstallSource, buildLocalUpdateSource, buildLocalCloneSource, shouldUseFullDepthForUpdate, } from './update-source.js';
10
10
  import { cloneRepo, cleanupTempDir, getGitTreeHash } from './git.js';
11
11
  import { discoverSkills } from './skills.js';
12
12
  import { fetchRepoTree, getSkillFolderHashFromTree } from './blob.js';
13
+ import { resolveSkillLocations, } from './skill-relocation.js';
13
14
  import { wellKnownProvider, computeWellKnownSkillDigest } from './providers/index.js';
14
15
  import { removeCommand } from './remove.js';
15
16
  import { sanitizeMetadata } from './sanitize.js';
@@ -58,6 +59,19 @@ const RESET = '\x1b[0m';
58
59
  const BOLD = '\x1b[1m';
59
60
  const DIM = '\x1b[38;5;102m';
60
61
  const TEXT = '\x1b[38;5;145m';
62
+ // ADG patch: source progress overwrites one line on a TTY and stays plain in logs.
63
+ function writeSourceStatus(source) {
64
+ if (process.stdout.isTTY) {
65
+ process.stdout.write(`\r${DIM}Checking skills from source: ${source}${RESET}\x1b[K`);
66
+ }
67
+ else {
68
+ process.stdout.write(`Checking skills from source: ${source}\n`);
69
+ }
70
+ }
71
+ function clearSourceStatus() {
72
+ if (process.stdout.isTTY)
73
+ process.stdout.write('\r\x1b[K');
74
+ }
61
75
  /**
62
76
  * Public GitHub lock entries use owner/repo shorthand to preserve the exact
63
77
  * skill subpath. Pin that shorthand to github.com so an ambient GH_HOST for a
@@ -244,6 +258,7 @@ export async function getProjectSkillsForUpdate(skillFilter) {
244
258
  return skills;
245
259
  }
246
260
  export async function promptDeletions(source, deletedSkills, isGlobal, options) {
261
+ clearSourceStatus();
247
262
  if (deletedSkills.length === 0)
248
263
  return;
249
264
  console.log();
@@ -266,15 +281,18 @@ export async function promptDeletions(source, deletedSkills, isGlobal, options)
266
281
  }
267
282
  }
268
283
  }
269
- export async function checkAndPromptForDeletions(source, allLockedForSource, lockSkills, isGlobal, options, discoveredPaths) {
270
- const deletedSkills = allLockedForSource.filter((name) => {
271
- const entry = lockSkills[name];
272
- if (!entry?.skillPath)
273
- return false;
274
- return !discoveredPaths.includes(entry.skillPath);
275
- });
276
- await promptDeletions(source, deletedSkills, isGlobal, options);
277
- return deletedSkills;
284
+ export async function checkAndPromptForDeletions(source, allLockedForSource, lockSkills, isGlobal, options, discovered, locationOptions = {}) {
285
+ const resolution = resolveSkillLocations(allLockedForSource, lockSkills, discovered, locationOptions);
286
+ if (resolution.ambiguousSkills.length > 0) {
287
+ clearSourceStatus();
288
+ console.log();
289
+ console.log(`${DIM}Warning:${RESET} Multiple current paths match these skills from ${DIM}${source}${RESET}; skipping them rather than deleting or migrating the wrong skill:`);
290
+ for (const name of resolution.ambiguousSkills) {
291
+ console.log(` ${DIM}•${RESET} ${sanitizeMetadata(name)}`);
292
+ }
293
+ }
294
+ await promptDeletions(source, resolution.deletedSkills, isGlobal, options);
295
+ return resolution;
278
296
  }
279
297
  export async function checkWellKnownForUpdates(baseUrl, items) {
280
298
  let indexResult;
@@ -339,8 +357,9 @@ export async function processWellKnownUpdates(groups, isGlobal, options) {
339
357
  let failCount = 0;
340
358
  let changed = false;
341
359
  for (const [baseUrl, items] of groups) {
342
- process.stdout.write(`\r${DIM}Checking skills from source: ${baseUrl}${RESET}\x1b[K\n`);
360
+ writeSourceStatus(baseUrl);
343
361
  const result = await checkWellKnownForUpdates(baseUrl, items);
362
+ clearSourceStatus();
344
363
  if (result.status === 'error') {
345
364
  console.log(` ${DIM}✗ Failed to check skills from ${baseUrl}${RESET}`);
346
365
  failCount += items.length;
@@ -358,6 +377,7 @@ export async function processWellKnownUpdates(groups, isGlobal, options) {
358
377
  const cliEntry = SELF_CLI_ENTRY;
359
378
  if (!existsSync(cliEntry)) {
360
379
  failCount += result.changedSkills.length;
380
+ recordSelfCliEntrypointMissing();
361
381
  console.log(` ${DIM}✗ CLI entrypoint not found at ${cliEntry}${RESET}`);
362
382
  continue;
363
383
  }
@@ -458,7 +478,7 @@ export async function updateGlobalSkills(options = {}) {
458
478
  const source = firstEntry.source;
459
479
  const sourceUrl = firstEntry.sourceUrl || firstEntry.source;
460
480
  let tempDir = null;
461
- process.stdout.write(`\r${DIM}Checking skills from source: ${source}${RESET}\x1b[K\n`);
481
+ writeSourceStatus(source);
462
482
  try {
463
483
  const isGitHubSource = firstEntry.sourceType === 'github';
464
484
  if (isGitHubSource) {
@@ -470,52 +490,67 @@ export async function updateGlobalSkills(options = {}) {
470
490
  const allLockedForSource = Object.entries(lock.skills)
471
491
  .filter(([_, entry]) => entry.source === source && entry.ref === firstEntry.ref)
472
492
  .map(([name, _]) => name);
473
- const deletedSkills = await checkAndPromptForDeletions(source, allLockedForSource, lock.skills, true, options, discoveredPaths);
474
- const deletedSkillSet = new Set(deletedSkills);
475
- for (const { name: skillName, entry } of itemsForSource) {
476
- if (deletedSkillSet.has(skillName))
477
- continue;
478
- const latestHash = getSkillFolderHashFromTree(tree, entry.skillPath);
479
- // Older lockfiles stored a SHA-256 content hash. Only normalize that
480
- // legacy shape; arbitrary values must still be compared and updated.
481
- if (latestHash && /^[0-9a-f]{64}$/i.test(entry.skillFolderHash)) {
482
- entry.skillFolderHash = latestHash;
483
- healed = true;
484
- continue;
485
- }
486
- if (latestHash && latestHash !== entry.skillFolderHash) {
487
- updates.push({ name: skillName, source, entry });
493
+ const hasMissingLockedPath = allLockedForSource.some((name) => lock.skills[name]?.skillPath &&
494
+ !discoveredPaths.includes(lock.skills[name].skillPath));
495
+ if (!hasMissingLockedPath) {
496
+ for (const { name: skillName, entry } of itemsForSource) {
497
+ const latestHash = getSkillFolderHashFromTree(tree, entry.skillPath);
498
+ // ADG patch: heal legacy SHA-256 locks without reporting a false update.
499
+ if (latestHash && /^[0-9a-f]{64}$/i.test(entry.skillFolderHash)) {
500
+ entry.skillFolderHash = latestHash;
501
+ healed = true;
502
+ continue;
503
+ }
504
+ if (latestHash && latestHash !== entry.skillFolderHash) {
505
+ updates.push({ name: skillName, source, entry });
506
+ }
488
507
  }
508
+ continue;
489
509
  }
490
- continue;
510
+ clearSourceStatus();
511
+ console.log(` ${DIM}Skill paths changed; resolving via Git clone${RESET}`);
512
+ }
513
+ else {
514
+ clearSourceStatus();
515
+ console.log(` ${DIM}GitHub API unavailable; checking via Git clone${RESET}`);
491
516
  }
492
- console.log(` ${DIM}GitHub API unavailable; checking via Git clone${RESET}`);
493
517
  }
494
518
  tempDir = await cloneRepo(sourceUrl, firstEntry.ref);
495
- const discoveredPaths = (await discoverSkills(tempDir, undefined, { fullDepth: true })).map((skill) => {
496
- return join(relative(tempDir, skill.path), 'SKILL.md').split(sep).join('/');
519
+ const discovered = await discoverSkills(tempDir, undefined, {
520
+ fullDepth: true,
521
+ includeDuplicateNames: true,
497
522
  });
523
+ const discoveredLocations = discovered.map((skill) => ({
524
+ name: skill.name,
525
+ skillPath: join(relative(tempDir, skill.path), 'SKILL.md').split(sep).join('/'),
526
+ }));
498
527
  const allLockedForSource = Object.entries(lock.skills)
499
528
  .filter(([_, entry]) => entry.source === source && entry.ref === firstEntry.ref)
500
529
  .map(([name, _]) => name);
501
- const deletedSkills = await checkAndPromptForDeletions(source, allLockedForSource, lock.skills, true, options, discoveredPaths);
502
- const deletedSkillSet = new Set(deletedSkills);
530
+ const resolution = await checkAndPromptForDeletions(source, allLockedForSource, lock.skills, true, options, discoveredLocations,
531
+ // Path-addressable sources reinstall only the locked directory, so a
532
+ // same-name mirror elsewhere in the repo is not ambiguous. Generic Git
533
+ // sources reinstall from the whole repo and remain fail-closed.
534
+ { exactPathDisambiguates: !shouldUseFullDepthForUpdate(firstEntry) });
535
+ const deletedSkillSet = new Set(resolution.deletedSkills);
503
536
  for (const { name: skillName, entry } of itemsForSource) {
504
537
  if (deletedSkillSet.has(skillName))
505
538
  continue;
506
- const skillPath = entry.skillPath;
507
- if (!discoveredPaths.includes(skillPath))
539
+ const skillPath = resolution.resolvedPaths.get(skillName);
540
+ if (!skillPath)
508
541
  continue;
509
542
  const usesGitTreeHash = isGitHubSource && /^[0-9a-f]{40}$/i.test(entry.skillFolderHash);
510
543
  const latestHash = usesGitTreeHash
511
544
  ? await getGitTreeHash(tempDir, skillPath)
512
545
  : await computeSkillFolderHash(join(tempDir, dirname(skillPath)));
513
- if (latestHash && latestHash !== entry.skillFolderHash) {
514
- updates.push({ name: skillName, source, entry });
546
+ const relocated = skillPath !== entry.skillPath;
547
+ if (relocated || (latestHash && latestHash !== entry.skillFolderHash)) {
548
+ updates.push({ name: skillName, source, entry: { ...entry, skillPath } });
515
549
  }
516
550
  }
517
551
  }
518
552
  catch (error) {
553
+ clearSourceStatus();
519
554
  console.log(` ${DIM}✗ Failed to check skills from ${source}${RESET}`);
520
555
  failedSources.push(source);
521
556
  }
@@ -525,7 +560,7 @@ export async function updateGlobalSkills(options = {}) {
525
560
  }
526
561
  }
527
562
  if (checkable.length > 0) {
528
- process.stdout.write('\r\x1b[K');
563
+ clearSourceStatus();
529
564
  }
530
565
  if (healed) {
531
566
  try {
@@ -536,6 +571,8 @@ export async function updateGlobalSkills(options = {}) {
536
571
  }
537
572
  }
538
573
  const checkedCount = checkable.length + skipped.length + wellKnownCount;
574
+ // ADG patch: a successful update must not hide another source's check failure.
575
+ failCount += failedSources.length;
539
576
  if (checkable.length === 0 && skipped.length === 0 && wellKnownCount === 0) {
540
577
  if (!options.skills) {
541
578
  console.log(`${DIM}No global skills to check.${RESET}`);
@@ -545,7 +582,7 @@ export async function updateGlobalSkills(options = {}) {
545
582
  if (checkable.length === 0 && skipped.length === 0) {
546
583
  if (failedSources.length > 0) {
547
584
  console.log(`${DIM}Some skill sources could not be verified.${RESET}`);
548
- return { successCount, failCount: failCount + failedSources.length, checkedCount };
585
+ return { successCount, failCount, checkedCount };
549
586
  }
550
587
  if (!wkChanged) {
551
588
  console.log(`${TEXT}✓ All global skills are up to date${RESET}`);
@@ -559,7 +596,7 @@ export async function updateGlobalSkills(options = {}) {
559
596
  if (updates.length === 0) {
560
597
  if (failedSources.length > 0) {
561
598
  console.log(`${DIM}Some skill sources could not be verified.${RESET}`);
562
- return { successCount, failCount: failCount + failedSources.length, checkedCount };
599
+ return { successCount, failCount, checkedCount };
563
600
  }
564
601
  if (!wkChanged) {
565
602
  console.log(`${TEXT}✓ All global skills are up to date${RESET}`);
@@ -580,6 +617,7 @@ export async function updateGlobalSkills(options = {}) {
580
617
  const cliEntry = SELF_CLI_ENTRY;
581
618
  if (!existsSync(cliEntry)) {
582
619
  failCount++;
620
+ recordSelfCliEntrypointMissing();
583
621
  console.log(` ${DIM}✗ Failed to update ${safeName}: CLI entrypoint not found at ${cliEntry}${RESET}`);
584
622
  continue;
585
623
  }
@@ -675,7 +713,7 @@ export async function updateProjectSkills(options = {}) {
675
713
  if (targetParts.length > 0) {
676
714
  console.log(`${TEXT}Updating for: ${targetParts.join(', ')}${RESET}`);
677
715
  }
678
- console.log(`${TEXT}Refreshing ${updatable.length + wellKnownCount} skill(s)…${RESET}`);
716
+ console.log(`${TEXT}Checking ${updatable.length + wellKnownCount} skill(s)…${RESET}`);
679
717
  console.log();
680
718
  const { successCount: wkSuccessCount, failCount: wkFailCount } = await processWellKnownUpdates(wellKnownGroups, false, options);
681
719
  successCount += wkSuccessCount;
@@ -692,7 +730,9 @@ export async function updateProjectSkills(options = {}) {
692
730
  }
693
731
  const localLock = await readLocalLock();
694
732
  const cliEntry = SELF_CLI_ENTRY;
733
+ let upToDateCount = 0;
695
734
  if (updatable.length > 0 && !existsSync(cliEntry)) {
735
+ recordSelfCliEntrypointMissing();
696
736
  console.log(`${DIM}✗ CLI entrypoint not found at ${cliEntry}${RESET}`);
697
737
  return {
698
738
  successCount,
@@ -710,6 +750,8 @@ export async function updateProjectSkills(options = {}) {
710
750
  .map(([name, _]) => name);
711
751
  let tempDir = null;
712
752
  let deletedSkills = [];
753
+ let resolvedPaths = null;
754
+ const latestHashes = new Map();
713
755
  if (cloneSource === null) {
714
756
  failCount += skillsForSource.length;
715
757
  console.log(`${DIM}✗ Cannot update ${source}: skills-lock.json is missing sourceUrl for this generic Git source${RESET}`);
@@ -717,12 +759,32 @@ export async function updateProjectSkills(options = {}) {
717
759
  }
718
760
  try {
719
761
  tempDir = await cloneRepo(cloneSource, ref);
720
- const discovered = await discoverSkills(tempDir, undefined, { fullDepth: true });
721
- const discoveredPaths = discovered.map((s) => {
722
- const relPath = relative(tempDir, s.path);
723
- return join(relPath, 'SKILL.md').split(sep).join('/');
762
+ const discovered = await discoverSkills(tempDir, undefined, {
763
+ fullDepth: true,
764
+ includeDuplicateNames: true,
724
765
  });
725
- deletedSkills = await checkAndPromptForDeletions(source, allLockedForSource, localLock.skills, false, options, discoveredPaths);
766
+ const discoveredLocations = discovered.map((skill) => ({
767
+ name: skill.name,
768
+ skillPath: join(relative(tempDir, skill.path), 'SKILL.md').split(sep).join('/'),
769
+ }));
770
+ const resolution = await checkAndPromptForDeletions(source, allLockedForSource, localLock.skills, false, options, discoveredLocations, { exactPathDisambiguates: !shouldUseFullDepthForUpdate(firstEntry) });
771
+ deletedSkills = resolution.deletedSkills;
772
+ resolvedPaths = resolution.resolvedPaths;
773
+ // Hash each remaining skill in the clone the same way `add` records
774
+ // computedHash, so unchanged skills are not reinstalled.
775
+ for (const [name, skillPath] of resolution.resolvedPaths) {
776
+ try {
777
+ // ADG patch: root skills install only SKILL.md, so use that same hash boundary.
778
+ const hash = skillPath === 'SKILL.md'
779
+ ? computeSingleFileSkillHash(readFileSync(join(tempDir, skillPath), 'utf8'))
780
+ : await computeSkillFolderHash(join(tempDir, dirname(skillPath)));
781
+ if (hash)
782
+ latestHashes.set(name, hash);
783
+ }
784
+ catch {
785
+ // Unknown hash: fall through to reinstalling the skill.
786
+ }
787
+ }
726
788
  }
727
789
  catch (error) {
728
790
  console.log(`${DIM}✗ Failed to check for deleted skills from ${source}${RESET}`);
@@ -732,11 +794,26 @@ export async function updateProjectSkills(options = {}) {
732
794
  await cleanupTempDir(tempDir);
733
795
  }
734
796
  }
797
+ if (resolvedPaths === null) {
798
+ failCount += skillsForSource.length;
799
+ continue;
800
+ }
735
801
  const remainingSkills = skillsForSource.filter((s) => !deletedSkills.includes(s.name));
736
802
  for (const skill of remainingSkills) {
737
803
  const safeName = sanitizeMetadata(skill.name);
804
+ const resolvedPath = resolvedPaths?.get(skill.name);
805
+ if (resolvedPaths && !resolvedPath) {
806
+ continue;
807
+ }
808
+ const entry = resolvedPath ? { ...skill.entry, skillPath: resolvedPath } : skill.entry;
809
+ const relocated = entry.skillPath !== skill.entry.skillPath;
810
+ const latestHash = latestHashes.get(skill.name);
811
+ if (!relocated && latestHash && latestHash === skill.entry.computedHash) {
812
+ upToDateCount++;
813
+ continue;
814
+ }
738
815
  console.log(`${TEXT}Updating ${safeName}…${RESET}`);
739
- const installUrl = buildLocalUpdateSource(skill.entry);
816
+ const installUrl = buildLocalUpdateSource(entry);
740
817
  if (!installUrl) {
741
818
  failCount++;
742
819
  console.log(` ${DIM}✗ Cannot update ${safeName}: skills-lock.json is missing sourceUrl for this generic Git source${RESET}`);
@@ -747,7 +824,7 @@ export async function updateProjectSkills(options = {}) {
747
824
  const subagentArgs = skill.entry.subagents?.length
748
825
  ? ['--subagent', ...skill.entry.subagents.map((s) => (s === '' ? 'root' : s))]
749
826
  : [];
750
- const fullDepthArgs = shouldUseFullDepthForUpdate(skill.entry) ? ['--full-depth'] : [];
827
+ const fullDepthArgs = shouldUseFullDepthForUpdate(entry) ? ['--full-depth'] : [];
751
828
  const result = runUpdateChild(selfCliArgv(cliEntry, [
752
829
  'skills',
753
830
  'add',
@@ -760,7 +837,7 @@ export async function updateProjectSkills(options = {}) {
760
837
  ]), {
761
838
  stdio: ['inherit', 'pipe', 'pipe'],
762
839
  encoding: 'utf-8',
763
- env: getUpdateChildEnv(skill.entry.sourceType),
840
+ env: getUpdateChildEnv(entry.sourceType),
764
841
  // Never spawn through a shell — same reasoning as updateGlobalSkills:
765
842
  // execPath is absolute (no shell resolution needed) and installUrl/ref
766
843
  // come from the lock file, so a shell would allow command injection on
@@ -777,6 +854,14 @@ export async function updateProjectSkills(options = {}) {
777
854
  }
778
855
  }
779
856
  }
857
+ if (upToDateCount > 0) {
858
+ if (upToDateCount === updatable.length && wkSuccessCount === 0 && wkFailCount === 0) {
859
+ console.log(`${TEXT}✓ All project skills are up to date${RESET}`);
860
+ }
861
+ else {
862
+ console.log(`${DIM}${upToDateCount} project skill(s) already up to date${RESET}`);
863
+ }
864
+ }
780
865
  printLegacyProjectSkills(legacy);
781
866
  return { successCount, failCount, foundCount: projectSkills.length };
782
867
  }
@@ -22,12 +22,13 @@ export function agentCloseResult(code, signal) {
22
22
  exitCode: code ?? 1,
23
23
  };
24
24
  }
25
- const BLOB_ALLOWED_OWNERS = ['vercel', 'vercel-labs', 'heygen-com'];
25
+ const BLOB_ALLOWED_OWNERS = ['vercel', 'vercel-labs', 'heygen-com', 'remotion-dev'];
26
26
  const EXCLUDE_FILES = new Set(['metadata.json']);
27
27
  const EXCLUDE_DIRS = new Set(['.git', '__pycache__', '__pypackages__']);
28
28
  const USE_AGENT_CONFIGS = {
29
29
  'claude-code': { command: 'claude', args: [] },
30
30
  codex: { command: 'codex', args: [] },
31
+ 'sarvam-code': { command: 'sarvam-code', args: [] },
31
32
  };
32
33
  const SUPPORTED_USE_AGENTS = Object.keys(USE_AGENT_CONFIGS);
33
34
  export function parseUseOptions(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.10.1-dev.pr150.a0bbc4c",
3
+ "version": "0.10.1-dev.pr152.b8c43a6",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,18 +1,133 @@
1
1
  # Vendored: skills CLI
2
2
 
3
- This directory is a **fork (verbatim vendoring) of the `skills` CLI source**,
3
+ This directory is a **vendored fork of the `skills` CLI source**,
4
4
  wrapped by `adg skills`.
5
5
 
6
6
  | Field | Value |
7
7
  |-------|-------|
8
8
  | Upstream repo | https://github.com/vercel-labs/skills |
9
- | npm package | `skills` (v1.5.23) |
10
- | Vendored commit | `c1755dd49618b02a4181495ee7404eec3d744c81` (tag `v1.5.23`) |
11
- | Vendored on | 2026-09-03 |
12
- | Previous vendoring | `be0dd25` (v1.5.11), 2026-06-11 |
9
+ | npm package | `skills` (v1.7.4) |
10
+ | Vendored commit | `31b74517250aec1d2a4be7801fa70b08535ad0e5` (tag `v1.7.4`) |
11
+ | Vendored on | 2026-10-27 |
12
+ | Previous vendoring | `c1755dd49618b02a4181495ee7404eec3d744c81` (v1.5.23), 2026-09-03 |
13
13
  | What was copied | `src/` (excluding `*.test.ts`) and `ThirdPartyNoticeText.txt` |
14
14
 
15
- ## Re-sync notes (v1.5.14 → v1.5.23, 2026-09-03)
15
+ ## Re-sync notes (v1.5.23 → v1.7.4, 2026-10-27)
16
+
17
+ Three-way merge using the original v1.5.23 source (`c1755dd`) as the base,
18
+ ADG's current vendored source as ours, and the latest upstream release v1.7.4
19
+ (`31b7451`) as theirs. The previous re-sync notes and patch inventory below
20
+ remain part of the upgrade contract; replacing entire overlapping files with
21
+ the old ADG implementation would discard upstream fixes again.
22
+
23
+ - Carried upstream JSON install output, commit-SHA installs, Azure Repos URL
24
+ parsing, BOM-prefixed frontmatter, Notion skill sources, source-based removal,
25
+ relocation-aware updates, and project update hash checks.
26
+ - Carried dependency sync's direct/optional/peer dependencies, package `skills`
27
+ fields (`npm:` and Git sources), workspace recursion, include/exclude filters,
28
+ dry runs, ownership-aware cleanup, symlink installation, and saved agents.
29
+ `experimental_sync` remains the advertised command; `sync` is an alias.
30
+ - Merged agent roots and added fx/Sarvam Code support. Codex follows upstream's
31
+ move to `~/.agents/skills`; the ADG universal agent and global lock retain their
32
+ existing XDG-state contract. No installed directories are moved by this source
33
+ upgrade itself.
34
+ - Reapplied ADG's Git environment sanitization, fixed SSH BatchMode command,
35
+ simple-git 4 compatibility, private-repository auth retries, shared OTel
36
+ provider, bounded telemetry fields, ADG self-CLI entrypoint/Node flags,
37
+ transient progress output, and legacy GitHub SHA-256 lock healing.
38
+ - `add.ts` was reconciled against the new shared install primitives rather than
39
+ preserving its obsolete implementation. ADG's installed-skill badges/grouped
40
+ picker, remote-root single-file installation/hash, and GitHub clone tree-SHA
41
+ fallback now live alongside the new programmatic install path and JSON mode.
42
+ - The new `ntn` subprocess uses ADG's shared CLIENT-span annotation, preserving
43
+ exit/error attributes while excluding raw page identifiers, output, and paths.
44
+ The security audit endpoint follows upstream's new `skills.sh/tele/audit` URL;
45
+ upstream raw event telemetry remains replaced by ADG OTel.
46
+ - Replaced `Map.groupBy` locally with equivalent map accumulation to preserve
47
+ ADG's ES2023 TypeScript target. Runtime dependency floors are unchanged; the
48
+ root dependency manifest and lockfile need no update.
49
+ - Kept upstream's path-level discovery deduplication alongside ADG's parser and
50
+ lock filtering: same-name skills at distinct locations remain visible to
51
+ relocation checks, while repeated scans of the same location do not create
52
+ false ambiguity. The remote-root single-file hash is shared by install and
53
+ update so an unchanged root skill is not reinstalled on every update.
54
+
55
+ ### Review follow-up and historical patch audit
56
+
57
+ Reviewing the original patches as well as the current baseline uncovered two
58
+ older regressions from the v1.5.23 re-sync: #86's transient TTY progress helpers
59
+ had been removed, and #60's missing-entrypoint span helper remained defined but
60
+ was never called. Both are restored, including well-known updates. A mixed
61
+ result now also counts a failed source when another skill updates successfully.
62
+ `test/skills-update.test.ts` covers these observable contracts.
63
+
64
+ Running the previously excluded upstream tests also exposed retained old code
65
+ that was not an ADG policy: missing blob discovery prefixes/depth, omitted
66
+ explicit-ref snapshot bypass, missing early `ext::` rejection, and loose array
67
+ metadata parsing. These now follow upstream. Disk discovery/frontmatter parsing
68
+ is byte-identical to v1.7.4, including record-only metadata, parse diagnostics,
69
+ three-level container walking, and path deduplication.
70
+
71
+ The remaining historical contracts were checked against their owning code and
72
+ regression coverage: XDG `.agents` roots, lazy authenticated private-tree retries,
73
+ sanitized Git environments and fixed SSH BatchMode, simple-git 4's allowlist,
74
+ ADG self-invocation/Node flags, shared bounded OTel, GitHub tree-SHA fallback and
75
+ legacy hash healing, direct/well-known metadata, Eve placement, restricted
76
+ interactive agent launches, installed-skill badges, and the remote-root
77
+ single-file installation boundary. Anonymous branch fallback now finishes
78
+ before requesting credentials; 401/403/404 auth retries are all covered.
79
+
80
+ ### Upstream test exclusions and fixture adaptations
81
+
82
+ The old 21-file exclusion list is replaced by one excluded artifact-build test
83
+ file and ten exact, anchored test names. All other upstream assertions run.
84
+ The runner does not exclude a whole behavior suite to accommodate one mismatch.
85
+
86
+ | Excluded upstream assertion(s) | Why ADG differs | Replacement evidence |
87
+ | --- | --- | --- |
88
+ | `tests/dist.test.ts` (one assertion) | Builds the upstream obuild artifact; ADG builds the enclosing CLI and shared root modules | `npm run build`, `npm run check:package-smoke` install and run the actual ADG artifact |
89
+ | `git clone fallbacks` / `allows the hard-coded LFS filter overrides required for clone` | The assertion also requires enabling every inherited command-capable helper; ADG permits only its fixed filter/SSH configuration and sanitizes inherited environment hooks | `test/vendor-skills-git.test.ts` clones with real simple-git 4, inherited hook/config injection, and a pinned commit |
90
+ | `getGitHubToken` / `does not extract credentials from external tools` | ADG retains its one-time warning and explicit `gh auth token` fallback | `test/skills-auth.test.ts` stubs the subprocess, verifies warning count and privacy-safe CLIENT spans; no real credential is read |
91
+ | `fetchRepoTree lazy auth fallback` / `does not invoke the token resolver on a non-rate-limit 403` | ADG retries anonymous permission-denied 403 responses as well as 401/404 | `test/skills-private-repo.test.ts` checks each status, unavailable credentials, and anonymous branch fallback before auth |
92
+ | `Pi agent support` / `accepts pi as a valid --agent for skills use` | Pi remains installable; ADG's interactive launcher supports only its explicit launch map | `test/use.test.ts` rejects Pi/unsupported launch targets and tests supported agent subprocesses |
93
+ | `private repository installs` / `installs from another Git host and preserves opted-in non-GitHub telemetry`; all three `direct telemetry endpoints` assertions | ADG emits bounded OTel events instead of raw source/query telemetry requests. The security-audit request remains independent of event opt-outs, matching the existing ADG contract | `test/skills-telemetry.test.ts` verifies the new audit endpoint, opt-outs, shared in-memory spans, bounded fields, and zero raw event HTTP requests |
94
+ | `root-level disk install (issue #1603)` / full-directory installation; `root-level lock hash covers the whole directory (issue #1603)` / supporting-file hash changes | ADG retains `SKILL.md`-only installation for a remote repository-root skill, avoiding copying an entire repository. Supporting files should live in a dedicated skill directory | `test/skills-add.test.ts` exercises the real ADG CLI, verifies the single-file boundary and stable unchanged updates |
95
+
96
+ The temporary upstream test checkout receives explicit fixture adaptations:
97
+ three global-lock fixtures use ADG's `.agents` path; help expects the retained
98
+ OpenClaw `use` warning; `use --agent` tests use ADG's single-value/repeated-flag
99
+ syntax and diagnostic label; the Git mock exposes the named `simpleGit` export
100
+ and Node's real `execFile` custom-promisifier shape. The original outcome
101
+ assertions remain. Exact replacement counts fail the check if upstream fixtures
102
+ drift, so these adaptations cannot silently disappear during another upgrade.
103
+
104
+ ### Validation (2026-10-27)
105
+
106
+ Verified locally on macOS with Node v25.8.2:
107
+
108
+ - `npm ci`, `npm run typecheck`, `npm run build`, and
109
+ `npm run check:vendor-deps` passed with the unchanged root lockfile.
110
+ - `npm test`: 641 passed, zero failures or skips. The OTLP transport test used
111
+ a temporary loopback server; no production telemetry was sent.
112
+ - `npm run check:vendor-upstream`: 967 passed, ten exact assertions skipped;
113
+ only the upstream artifact-build file is excluded. The table above records
114
+ every difference and its replacement coverage.
115
+ - `npm run check:docs`, `npm run check:test-isolation`, and
116
+ `npm run check:package-smoke` passed. The packed package was installed in a
117
+ temporary directory and both CLI domains were exercised.
118
+ - Source inventory: all 37 upstream production TypeScript files are present;
119
+ 22 remain byte-identical, 15 carry ADG integration patches, and the two
120
+ existing ADG-only helpers (`git-tree.ts`, `self-cli.ts`) remain present.
121
+
122
+ No Windows CI, live Notion authentication/download, or real installed-skill
123
+ migration was exercised. Root dependency/release configuration and lockfiles
124
+ were not changed; no package was published.
125
+
126
+ `npm audit --omit=dev --json` reported zero production vulnerabilities. The
127
+ full `npm ci` audit still reports five existing development-tool advisories
128
+ (two moderate, three high); this upgrade does not change their dependency lock.
129
+
130
+ ### Historical re-sync notes (v1.5.14 → v1.5.23, 2026-09-03)
16
131
 
17
132
  3-way merge (base `2adcfe5`, ours = prior vendoring + ADG patches, theirs `c1755dd`).
18
133
  The first pass accidentally retained old implementations in several overlapping
@@ -71,8 +186,9 @@ directory.
71
186
 
72
187
  ## Local patches (re-apply after any re-sync)
73
188
 
74
- These intentional deviations from upstream must be carried forward when
75
- re-vendoring. Each is marked inline with an `ADG patch:` comment.
189
+ These integration contracts must be carried forward when re-vendoring. Some
190
+ are now provided directly by upstream; retained local deviations are marked
191
+ inline with an `ADG patch:` comment where practical.
76
192
 
77
193
  | File | Change | Why |
78
194
  |------|--------|-----|
@@ -88,7 +204,7 @@ re-vendoring. Each is marked inline with an `ADG patch:` comment.
88
204
  | `src/git.ts` → `import simpleGit from 'simple-git'` | Default → named import `import { simpleGit } from 'simple-git'` | The default import is not callable under ADG's strict root tsconfig (NodeNext + verbatimModuleSyntax, no esModuleInterop); the named export is. Needed for `git.ts` to typecheck when a test imports it (e.g. via `use.ts`). |
89
205
  | `src/git.ts` → `createGitClient` env | Pass env via `.env({...})` instead of as a `simpleGit(...)` constructor option | **Latent runtime bug**: simple-git's factory only reads `baseDir`/`maxConcurrentProcesses`/`config`/`trimmed`/plugins from the options object and silently drops `env`, so `GIT_TERMINAL_PROMPT`/`GIT_LFS_SKIP_SMUDGE`/`GIT_SSH_COMMAND` never reached the spawned git (it inherited the full parent env). `.env(object)` is the documented API and sets the executor env actually used at spawn. |
90
206
  | `src/git.ts` → `createGitClient` inherited env sanitization | Case-insensitively remove executable/redirecting Git environment hooks and `GIT_CONFIG_PARAMETERS` before constructing the clone client; allow only ADG's fixed SSH BatchMode override | IDEs can inject `GIT_ASKPASS`, `GIT_PAGER`, config overrides, and similar helpers even for users with no GitHub account. simple-git >=3.36 rejects known hooks before an anonymous public clone can run, while mixed-case Windows keys or config parameters could bypass exact-key deletion. Sanitizing them preserves non-interactive public installs without opting arbitrary parent-process commands into execution. |
91
- | `src/skills.ts` → `parseSkillMd` | Narrow `data.metadata` (frontmatter `unknown`) to `Record<string, unknown> \| undefined` before reading `.internal` / returning it | Behavior-preserving type fix so `skills.ts` typechecks under ADG's strict root tsconfig when reached via `use.ts`/tests. |
207
+ | `src/skills.ts` → `parseSkillMd` (now upstream-supplied) | Narrow metadata to a non-array record before reading `.internal` or returning it | Upstream's `isRecord` now satisfies ADG's strict type contract and rejects array metadata; the old loose local cast is no longer needed. |
92
208
  | `src/update.ts` → both `spawnSync` self-CLI re-invokes (+ new `src/self-cli.ts`) | Forward `process.execArgv`, call `skills add` instead of `add`, and wrap in OpenTelemetry CLIENT spans | The child process runs `adg skills add` inside the spawned Node context, ensuring type-stripping flags inherit properly, and OTel spans capture subprocess execution metadata. |
93
209
  | `package.json` → `@vercel/detect-agent` dependency (not a vendored-source change) | `^0.1.0` → `^1.2.3` | `src/detect-agent.ts` (upstream, unpatched) imports `AgentResult` and expects `determineAgent(): Promise<AgentResult>` (object API). The stale `0.1.0` pin only exported `determineAgent(): Promise<string \| false>` and no `AgentResult`, which broke typecheck and left `cachedResult.isAgent` always `undefined` at runtime — agent auto-detection (non-interactive mode in `add`/`sync`/`remove`/`find`/`cli`) silently never fired. The `1.x` line restores the API the fork targets, so `detect-agent.ts` needs **no** local patch. Keep this dependency on `1.x` across re-vendoring. |
94
210
  | `src/git-tree.ts` (**new ADG file**) + `src/add.ts` clone-fallback branch | github source that falls back to a `git clone` now records the git **tree SHA** (`git rev-parse HEAD:<folder>`), not a sha256 content hash | Install and update must use ONE hash scheme per source. Update-check always uses the git tree SHA; the old clone fallback stored a sha256 content hash, so those skills were re-flagged on **every** update (a collection repo appeared to "fully update" each run). `git-tree.ts` is standalone (uses `child_process`, no simple-git) so it typechecks under ADG's strict tsconfig when a test imports it. |
@@ -100,4 +216,8 @@ re-vendoring. Each is marked inline with an `ADG patch:` comment.
100
216
  | `src/skill-lock.ts`, `src/update.ts`, `src/use.ts` | Route GitHub auth, self-update, and interactive agent subprocesses through the root OTel CLIENT-span runner | Enforces required exit/error attributes and privacy-safe command arguments consistently across the vendored CLI. |
101
217
  | `src/skill-lock.ts` → `getGitHubToken` auth warning | Prefix the one-shot stderr warning with `\r\x1b[K` on a TTY | The warning lands on the same physical terminal line as `update.ts`'s transient stdout status line, which carries no trailing newline — without rewinding, the two are rendered concatenated. |
102
218
  | `src/update.ts` → `updateGlobalSkills` per-source status line | Drop the trailing `\n` from the transient "Checking skills from source" line on a TTY (plain line off a TTY); gate the paired `\r\x1b[K` cleanup on TTY | The line opened with `\r` + `\x1b[K`, clearly intended to overwrite in place, but ended with `\n` — so each source **accumulated** a permanent line and the cleanup ran against an already-blank line (a no-op). Off a TTY the escapes were pure noise in CI logs. |
103
- | `src/update.ts` → `updateGlobalSkills` self-heal | A github entry whose stored hash isn't a 40-hex tree SHA (legacy clone-fallback) is normalized to the current tree SHA and NOT flagged; lock rewritten once | Heals locks written before the fix above without a version bump / lock wipe, and stops the perpetual false "update". |
219
+ | `src/update.ts` → `updateGlobalSkills` self-heal | A GitHub entry with a legacy 64-hex SHA-256 content hash is normalized to the current tree SHA and NOT flagged; lock rewritten once | Heals locks written before the fix above without a version bump / lock wipe, and stops the perpetual false "update". Other hash shapes are still compared normally. |
220
+ | `src/add.ts` → shared install/hash primitives | Preserve remote-root `SKILL.md`-only installs and matching single-file content hashes in both interactive and programmatic installs | Carries ADG's existing root-skill boundary through upstream's install refactor. |
221
+ | `src/git.ts` → simple-git 4 options and SHA fallback | Keep the explicit environment allowlist, sanitized environment and fixed SSH command in the new fetch-by-commit path | Root uses simple-git 4; the upstream 3.x environment configuration cannot safely replace ADG's wrapper. |
222
+ | `src/notion-test.ts` → `runNtnApi` | Add a CLIENT span through the shared tracer and `annotateSubprocess`, including launch/exit/signal/timeout/output-limit outcomes | New external commands must obey the same CLI semantic conventions and privacy contract as existing Git and agent wrappers. |
223
+ | `src/sync.ts` → conflict grouping | Replace `Map.groupBy` with a typed map loop | Preserve ADG's ES2023 compile contract without changing the upstream grouping behavior. |
@@ -9,14 +9,14 @@ Third Party Code Components
9
9
  --------------------------------------------
10
10
 
11
11
  ================================================================================
12
- Package: @clack/prompts@0.11.0
12
+ Package: @clack/prompts@1.7.0
13
13
  License: MIT
14
14
  Repository: https://github.com/bombshell-dev/clack
15
15
  --------------------------------------------------------------------------------
16
16
 
17
17
  MIT License
18
18
 
19
- Copyright (c) Nate Moore
19
+ MIT License Copyright (c) 2025-Present [Bombshell contributors](https://bomb.sh/team)
20
20
 
21
21
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
22
22
 
@@ -49,7 +49,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
49
49
 
50
50
 
51
51
  ================================================================================
52
- Package: simple-git@3.30.0
52
+ Package: simple-git@3.36.0
53
53
  License: MIT
54
54
  Repository: https://github.com/steveukx/git-js
55
55
  --------------------------------------------------------------------------------
@@ -93,7 +93,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
93
93
 
94
94
 
95
95
  ================================================================================
96
- Package: yaml@2.8.3
96
+ Package: yaml@2.9.0
97
97
  License: ISC
98
98
  Repository: https://github.com/eemeli/yaml
99
99
  --------------------------------------------------------------------------------