@rbbtsn0w/adg 0.6.0-beta.10 → 0.6.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +10 -7
  2. package/dist/bin/adg.js +4 -3
  3. package/dist/src/agents/base.js +2 -1
  4. package/dist/src/cli/core-plugin-handlers.js +97 -0
  5. package/dist/src/cli/handlers.js +4 -82
  6. package/dist/src/manifest.js +56 -3
  7. package/dist/src/subprocess.js +53 -0
  8. package/dist/vendor/skills/src/add.js +0 -15
  9. package/dist/vendor/skills/src/git-tree.js +4 -4
  10. package/dist/vendor/skills/src/skill-lock.js +4 -3
  11. package/dist/vendor/skills/src/update.js +9 -73
  12. package/dist/vendor/skills/src/use.js +28 -4
  13. package/docs/branching-and-release.md +52 -0
  14. package/package.json +7 -2
  15. package/schemas/adg-plugin.schema.json +1 -0
  16. package/vendor/skills/PROVENANCE.md +2 -0
  17. package/vendor/skills/package.json +0 -144
  18. package/vendor/skills/src/add.ts +0 -2213
  19. package/vendor/skills/src/agents.ts +0 -811
  20. package/vendor/skills/src/blob.ts +0 -588
  21. package/vendor/skills/src/cli.ts +0 -396
  22. package/vendor/skills/src/constants.ts +0 -3
  23. package/vendor/skills/src/detect-agent.ts +0 -62
  24. package/vendor/skills/src/find.ts +0 -419
  25. package/vendor/skills/src/frontmatter.ts +0 -16
  26. package/vendor/skills/src/git-tree.ts +0 -36
  27. package/vendor/skills/src/git.ts +0 -277
  28. package/vendor/skills/src/install.ts +0 -91
  29. package/vendor/skills/src/installer.ts +0 -1307
  30. package/vendor/skills/src/list.ts +0 -231
  31. package/vendor/skills/src/local-lock.ts +0 -189
  32. package/vendor/skills/src/plugin-manifest.ts +0 -183
  33. package/vendor/skills/src/prompts/search-multiselect.ts +0 -387
  34. package/vendor/skills/src/providers/index.ts +0 -14
  35. package/vendor/skills/src/providers/registry.ts +0 -51
  36. package/vendor/skills/src/providers/types.ts +0 -97
  37. package/vendor/skills/src/providers/wellknown.ts +0 -812
  38. package/vendor/skills/src/remove.ts +0 -335
  39. package/vendor/skills/src/sanitize.ts +0 -65
  40. package/vendor/skills/src/self-cli.ts +0 -20
  41. package/vendor/skills/src/skill-lock.ts +0 -329
  42. package/vendor/skills/src/skills.ts +0 -316
  43. package/vendor/skills/src/source-parser.ts +0 -449
  44. package/vendor/skills/src/sync.ts +0 -478
  45. package/vendor/skills/src/telemetry.ts +0 -226
  46. package/vendor/skills/src/test-utils.ts +0 -73
  47. package/vendor/skills/src/types.ts +0 -129
  48. package/vendor/skills/src/update-source.ts +0 -90
  49. package/vendor/skills/src/update.ts +0 -849
  50. package/vendor/skills/src/use.ts +0 -682
@@ -1,4 +1,3 @@
1
- import { spawnSync } from 'child_process';
2
1
  import { existsSync, readdirSync } from 'fs';
3
2
  import { join, dirname, relative, sep } from 'path';
4
3
  import { fileURLToPath } from 'url';
@@ -16,6 +15,7 @@ import { track, getTracer } from "./telemetry.js";
16
15
  import { agents, isUniversalAgent } from "./agents.js";
17
16
  import { selfCliArgv } from "./self-cli.js";
18
17
  import { SpanKind, SpanStatusCode } from '@opentelemetry/api';
18
+ import { runSubprocessSync } from "../../../src/subprocess.js";
19
19
  const __dirname = dirname(fileURLToPath(import.meta.url));
20
20
  /**
21
21
  * ADG patch: upstream re-invokes its *built* `bin/cli.mjs` to perform an update,
@@ -429,42 +429,10 @@ export async function updateGlobalSkills(options = {}) {
429
429
  console.log(` ${DIM}✗ Failed to update ${safeName}: CLI entrypoint not found at ${cliEntry}${RESET}`);
430
430
  continue;
431
431
  }
432
- const tracer = getTracer();
433
- const result = tracer.startActiveSpan("adg", { kind: SpanKind.CLIENT }, (span) => {
434
- try {
435
- span.setAttribute("process.executable.name", "adg");
436
- span.setAttribute("process.command_args", ["adg", ...args]);
437
- const r = spawnSync(process.execPath, selfCliArgv(cliEntry, args), {
438
- stdio: ['inherit', 'pipe', 'pipe'],
439
- encoding: 'utf-8',
440
- shell: process.platform === 'win32',
441
- });
442
- if (r.pid !== undefined)
443
- span.setAttribute("process.pid", r.pid);
444
- if (r.status !== null) {
445
- span.setAttribute("process.exit.code", r.status);
446
- if (r.status !== 0) {
447
- span.setAttribute("error.type", `EXIT_CODE_${r.status}`);
448
- span.setStatus({
449
- code: SpanStatusCode.ERROR,
450
- message: `Subprocess exited with status ${r.status}`,
451
- });
452
- }
453
- }
454
- else if (r.error) {
455
- span.setAttribute("process.exit.code", -1);
456
- span.setAttribute("error.type", r.error.code || r.error.name || "SpawnError");
457
- span.recordException(r.error);
458
- span.setStatus({
459
- code: SpanStatusCode.ERROR,
460
- message: r.error.message,
461
- });
462
- }
463
- return r;
464
- }
465
- finally {
466
- span.end();
467
- }
432
+ const result = runSubprocessSync(process.execPath, selfCliArgv(cliEntry, args), {
433
+ stdio: ['inherit', 'pipe', 'pipe'],
434
+ encoding: 'utf-8',
435
+ shell: process.platform === 'win32',
468
436
  });
469
437
  if (result.status === 0) {
470
438
  successCount++;
@@ -566,48 +534,16 @@ export async function updateProjectSkills(options = {}) {
566
534
  const safeName = sanitizeMetadata(skill.name);
567
535
  console.log(`${TEXT}Updating ${safeName}...${RESET}`);
568
536
  const installUrl = formatSourceInput(skill.entry.source, skill.entry.ref);
569
- const tracer = getTracer();
570
537
  // Preserve Eve subagent placement recorded at install time. The lock stores
571
538
  // '' for the root agent, which maps to the `root` keyword for `add --subagent`.
572
539
  const subagentArgs = skill.entry.subagents?.length
573
540
  ? ['--subagent', ...skill.entry.subagents.map((s) => (s === '' ? 'root' : s))]
574
541
  : [];
575
542
  const args = ['skills', 'add', installUrl, '--skill', skill.name, ...subagentArgs, '-y'];
576
- const result = tracer.startActiveSpan("adg", { kind: SpanKind.CLIENT }, (span) => {
577
- try {
578
- span.setAttribute("process.executable.name", "adg");
579
- span.setAttribute("process.command_args", ["adg", ...args]);
580
- const r = spawnSync(process.execPath, selfCliArgv(cliEntry, args), {
581
- stdio: ['inherit', 'pipe', 'pipe'],
582
- encoding: 'utf-8',
583
- shell: process.platform === 'win32',
584
- });
585
- if (r.pid !== undefined)
586
- span.setAttribute("process.pid", r.pid);
587
- if (r.status !== null) {
588
- span.setAttribute("process.exit.code", r.status);
589
- if (r.status !== 0) {
590
- span.setAttribute("error.type", `EXIT_CODE_${r.status}`);
591
- span.setStatus({
592
- code: SpanStatusCode.ERROR,
593
- message: `Subprocess exited with status ${r.status}`,
594
- });
595
- }
596
- }
597
- else if (r.error) {
598
- span.setAttribute("process.exit.code", -1);
599
- span.setAttribute("error.type", r.error.code || r.error.name || "SpawnError");
600
- span.recordException(r.error);
601
- span.setStatus({
602
- code: SpanStatusCode.ERROR,
603
- message: r.error.message,
604
- });
605
- }
606
- return r;
607
- }
608
- finally {
609
- span.end();
610
- }
543
+ const result = runSubprocessSync(process.execPath, selfCliArgv(cliEntry, args), {
544
+ stdio: ['inherit', 'pipe', 'pipe'],
545
+ encoding: 'utf-8',
546
+ shell: process.platform === 'win32',
611
547
  });
612
548
  if (result.status === 0) {
613
549
  successCount++;
@@ -3,6 +3,9 @@ import { existsSync } from 'fs';
3
3
  import { cp, mkdir, mkdtemp, readdir, readFile, realpath, stat, writeFile } from 'fs/promises';
4
4
  import { dirname, join, normalize, relative, resolve, sep } from 'path';
5
5
  import { tmpdir } from 'os';
6
+ import { SpanKind } from '@opentelemetry/api';
7
+ import { annotateSubprocess } from "../../../src/subprocess.js";
8
+ import { getTracer } from "../../../src/telemetry.js";
6
9
  import { agents } from "./agents.js";
7
10
  import { tryBlobInstall } from "./blob.js";
8
11
  import { cloneRepo, cleanupTempDir, GitCloneError } from "./git.js";
@@ -11,6 +14,13 @@ import { getGitHubToken } from "./skill-lock.js";
11
14
  import { discoverSkills, filterSkills, getSkillDisplayName } from "./skills.js";
12
15
  import { getOwnerRepo, parseSource } from "./source-parser.js";
13
16
  import { wellKnownProvider, } from "./providers/wellknown.js";
17
+ export function agentCloseResult(code, signal) {
18
+ return {
19
+ status: code ?? (signal ? null : 1),
20
+ signal,
21
+ exitCode: code ?? 1,
22
+ };
23
+ }
14
24
  const BLOB_ALLOWED_OWNERS = ['vercel', 'vercel-labs', 'heygen-com'];
15
25
  const EXCLUDE_FILES = new Set(['metadata.json']);
16
26
  const EXCLUDE_DIRS = new Set(['.git', '__pycache__', '__pypackages__']);
@@ -259,7 +269,7 @@ export async function launchAgentInteractively(agent, prompt, spawnImpl = spawnA
259
269
  if (!config) {
260
270
  throw new UseCommandError(formatUnsupportedAgentError(agent));
261
271
  }
262
- return new Promise((resolve, reject) => {
272
+ return getTracer().startActiveSpan(config.command, { kind: SpanKind.CLIENT }, (span) => new Promise((resolve, reject) => {
263
273
  const child = spawnImpl(config.command, [...config.args, prompt], {
264
274
  stdio: 'inherit',
265
275
  });
@@ -268,19 +278,33 @@ export async function launchAgentInteractively(agent, prompt, spawnImpl = spawnA
268
278
  if (settled)
269
279
  return;
270
280
  settled = true;
281
+ annotateSubprocess(span, config.command, [...config.args, prompt], {
282
+ pid: child.pid,
283
+ status: null,
284
+ signal: null,
285
+ error,
286
+ });
287
+ span.end();
271
288
  if (error.code === 'ENOENT') {
272
289
  reject(new UseCommandError(`Could not launch ${agents[agent].displayName}: command not found: ${config.command}`));
273
290
  return;
274
291
  }
275
292
  reject(error);
276
293
  });
277
- child.on('close', (code) => {
294
+ child.on('close', (code, signal) => {
278
295
  if (settled)
279
296
  return;
280
297
  settled = true;
281
- resolve(code ?? 1);
298
+ const result = agentCloseResult(code, signal);
299
+ annotateSubprocess(span, config.command, [...config.args, prompt], {
300
+ pid: child.pid,
301
+ status: result.status,
302
+ signal: result.signal,
303
+ });
304
+ span.end();
305
+ resolve(result.exitCode);
282
306
  });
283
- });
307
+ }));
284
308
  }
285
309
  function spawnAgent(command, args) {
286
310
  return spawn(command, args, { stdio: 'inherit' });
@@ -0,0 +1,52 @@
1
+ # Branching and release
2
+
3
+ ADG uses `beta` as the integration branch and `main` as the stable release
4
+ branch. Feature and fix pull requests always target `beta`; the only pull
5
+ request allowed to target `main` is the maintainer promotion from `beta`.
6
+
7
+ ## Contribution flow
8
+
9
+ 1. Branch from the latest `beta`.
10
+ 2. Open a pull request back to `beta`.
11
+ 3. Pass the repository checks and review.
12
+ 4. Merge through branch protection; never push directly to `beta` or `main`.
13
+
14
+ Merges to `beta` are published by semantic-release under the `beta` npm
15
+ dist-tag. Maintainers promote a tested release set with a `beta -> main` pull
16
+ request; merging that pull request publishes the stable `latest` dist-tag.
17
+
18
+ ## Back-merge after a stable release
19
+
20
+ The release commit created on `main` must be merged back into `beta` so both
21
+ branches share the same release ancestry. The `Sync main to beta` workflow opens
22
+ a `main -> beta` pull request after successful main CI:
23
+
24
+ - A conflict-free pull request is merged automatically with a merge commit.
25
+ - A conflicting pull request receives `manual-sync-needed` and must be resolved
26
+ by a maintainer before further promotion work.
27
+ - Resolve version and changelog conflicts in favor of the stable `main` release
28
+ commit while preserving subsequent integration changes from `beta`.
29
+
30
+ The workflow never pushes directly to a protected branch. An open
31
+ `manual-sync-needed` pull request is an operational action item, not a successful
32
+ sync.
33
+
34
+ ## Local release checks
35
+
36
+ Run the same checks used by CI before opening a pull request:
37
+
38
+ ```bash
39
+ npm ci
40
+ npm run check:vendor-deps
41
+ npm run check:vendor-upstream
42
+ npm run audit:prod
43
+ npm run check:docs
44
+ npm run typecheck
45
+ npm run build
46
+ npm test
47
+ npm run check:package-smoke
48
+ ```
49
+
50
+ Release automation is defined in `.github/workflows/ci.yml` and
51
+ `.releaserc.json`. Optional Homebrew publication only runs for stable releases
52
+ when the release-bot GitHub App is configured.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.6.0-beta.10",
3
+ "version": "0.6.0-beta.11",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,7 +27,10 @@
27
27
  "test": "node scripts/run-tests.mjs \"test/**/*.test.ts\" test/cache-sandbox.test.mjs",
28
28
  "test:codex-sandbox": "node --test test/codex-sandbox.test.mjs",
29
29
  "test:cache-sandbox": "node --test test/cache-sandbox.test.mjs",
30
+ "check:docs": "node scripts/check-doc-links.mjs",
31
+ "check:package-smoke": "node scripts/check-package-smoke.mjs",
30
32
  "check:vendor-deps": "node scripts/check-vendor-deps.mjs",
33
+ "check:vendor-upstream": "node scripts/check-vendor-upstream.mjs",
31
34
  "audit:prod": "npm audit --omit=dev",
32
35
  "typecheck": "tsc --noEmit",
33
36
  "prepare": "npm run typecheck",
@@ -36,7 +39,9 @@
36
39
  "files": [
37
40
  "dist",
38
41
  "schemas",
39
- "vendor",
42
+ "vendor/skills/LICENSE",
43
+ "vendor/skills/PROVENANCE.md",
44
+ "vendor/skills/ThirdPartyNoticeText.txt",
40
45
  "docs"
41
46
  ],
42
47
  "comment:dependencies": "Runtime deps below are required only by the vendored skills CLI (vendor/skills); ADG's own plugins code has zero runtime deps. Root is the single source of truth: each range MUST be >= the floor declared in vendor/skills/package.json, since that is the version the vendored source was authored against. `npm run check:vendor-deps` enforces this and fails on drift.",
@@ -25,6 +25,7 @@
25
25
  "description": { "type": "string", "minLength": 1 },
26
26
  "author": {
27
27
  "type": "object",
28
+ "required": ["name"],
28
29
  "properties": {
29
30
  "name": { "type": "string" },
30
31
  "url": { "type": "string" },
@@ -80,4 +80,6 @@ re-vendoring. Each is marked inline with an `ADG patch:` comment.
80
80
  | `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. |
81
81
  | `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. |
82
82
  | `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. |
83
+ | `src/git-tree.ts` → `gitTreeShaForFolder` | Route the ADG-added `git rev-parse` subprocess through the root OTel CLIENT-span runner | Keeps the local fallback compliant with ADG's CLI semantic-convention policy without duplicating instrumentation inside the vendored fork. |
84
+ | `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. |
83
85
  | `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". |
@@ -1,144 +0,0 @@
1
- {
2
- "name": "skills",
3
- "version": "1.5.14",
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
- "eve",
65
- "firebender",
66
- "forgecode",
67
- "gemini-cli",
68
- "github-copilot",
69
- "goose",
70
- "hermes-agent",
71
- "inference-sh",
72
- "jazz",
73
- "junie",
74
- "iflow-cli",
75
- "kilo",
76
- "kimi-code-cli",
77
- "kiro-cli",
78
- "kode",
79
- "lingma",
80
- "loaf",
81
- "mcpjam",
82
- "mistral-vibe",
83
- "moxby",
84
- "mux",
85
- "opencode",
86
- "openhands",
87
- "ona",
88
- "pi",
89
- "qoder",
90
- "qoder-cn",
91
- "qwen-code",
92
- "replit",
93
- "reasonix",
94
- "rovodev",
95
- "roo",
96
- "tabnine-cli",
97
- "terramind",
98
- "tinycloud",
99
- "trae",
100
- "trae-cn",
101
- "warp",
102
- "windsurf",
103
- "zed",
104
- "zencoder",
105
- "zenflow",
106
- "neovate",
107
- "pochi",
108
- "promptscript",
109
- "adal",
110
- "universal"
111
- ],
112
- "repository": {
113
- "type": "git",
114
- "url": "git+https://github.com/vercel-labs/skills.git"
115
- },
116
- "homepage": "https://github.com/vercel-labs/skills#readme",
117
- "bugs": {
118
- "url": "https://github.com/vercel-labs/skills/issues"
119
- },
120
- "author": "",
121
- "license": "MIT",
122
- "devDependencies": {
123
- "@clack/prompts": "^0.11.0",
124
- "@types/bun": "latest",
125
- "@types/node": "^22.10.0",
126
- "@vercel/detect-agent": "^1.2.1",
127
- "husky": "^9.1.7",
128
- "lint-staged": "^16.2.7",
129
- "obuild": "^0.4.22",
130
- "picocolors": "^1.1.1",
131
- "prettier": "^3.8.1",
132
- "simple-git": "^3.27.0",
133
- "typescript": "^5.9.3",
134
- "vitest": "^4.0.17",
135
- "xdg-basedir": "^5.1.0"
136
- },
137
- "engines": {
138
- "node": ">=18"
139
- },
140
- "packageManager": "pnpm@10.17.1",
141
- "dependencies": {
142
- "yaml": "^2.8.3"
143
- }
144
- }