@rbbtsn0w/adg 0.5.0 → 0.6.0-beta.10

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 (42) hide show
  1. package/README.md +67 -2
  2. package/dist/bin/adg.js +0 -1
  3. package/dist/src/adapters/codex.js +12 -0
  4. package/dist/src/adapters/reverse.js +22 -1
  5. package/dist/src/agents/claude.js +52 -6
  6. package/dist/src/agents/codex.js +94 -14
  7. package/dist/src/cli/handlers.js +164 -141
  8. package/dist/src/cli/index.js +14 -4
  9. package/dist/src/codex-marketplace-migration.js +139 -0
  10. package/dist/src/commands/cache.js +92 -15
  11. package/dist/src/commands/inspect.js +41 -0
  12. package/dist/src/commands/install.js +140 -73
  13. package/dist/src/commands/link.js +4 -16
  14. package/dist/src/commands/marketplace.js +74 -20
  15. package/dist/src/commands/migrate.js +15 -3
  16. package/dist/src/commands/projection.js +15 -0
  17. package/dist/src/commands/select-components.js +12 -0
  18. package/dist/src/commands/state.js +4 -2
  19. package/dist/src/commands/sync.js +9 -15
  20. package/dist/src/commands/update.js +51 -10
  21. package/dist/src/commands/validate.js +9 -2
  22. package/dist/src/components.js +3 -0
  23. package/dist/src/default-dsl.js +142 -0
  24. package/dist/src/lock.js +25 -7
  25. package/dist/src/manifest.js +29 -1
  26. package/dist/src/materialize.js +5 -1
  27. package/dist/src/mcp.js +59 -0
  28. package/dist/src/paths.js +31 -4
  29. package/dist/src/render/plugins.js +7 -1
  30. package/dist/src/source-cache.js +140 -0
  31. package/dist/src/sources.js +76 -5
  32. package/dist/src/telemetry.js +28 -21
  33. package/dist/src/types.js +5 -1
  34. package/dist/vendor/skills/src/cli.js +6 -1
  35. package/dist/vendor/skills/src/update.js +29 -4
  36. package/docs/agents-spec.md +27 -4
  37. package/docs/authoring.md +19 -2
  38. package/package.json +8 -2
  39. package/schemas/adg-plugin.schema.json +1 -0
  40. package/schemas/plugin-lock.schema.json +23 -1
  41. package/vendor/skills/src/cli.ts +6 -1
  42. package/vendor/skills/src/update.ts +32 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-beta.10",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,7 +24,9 @@
24
24
  "scripts": {
25
25
  "adg": "node ./bin/adg.ts",
26
26
  "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --noCheck && node -e \"require('fs').chmodSync('dist/bin/adg.js',0o755)\"",
27
- "test": "node --test 'test/**/*.test.ts'",
27
+ "test": "node scripts/run-tests.mjs \"test/**/*.test.ts\" test/cache-sandbox.test.mjs",
28
+ "test:codex-sandbox": "node --test test/codex-sandbox.test.mjs",
29
+ "test:cache-sandbox": "node --test test/cache-sandbox.test.mjs",
28
30
  "check:vendor-deps": "node scripts/check-vendor-deps.mjs",
29
31
  "audit:prod": "npm audit --omit=dev",
30
32
  "typecheck": "tsc --noEmit",
@@ -63,5 +65,9 @@
63
65
  "conventional-changelog-conventionalcommits": "^8.0.0",
64
66
  "semantic-release": "^25.0.5",
65
67
  "typescript": "^5.6.0"
68
+ },
69
+ "comment:overrides": "Security floor: npm 11 before 11.18.0 bundles vulnerable undici 6.26.0; keep npm on patched 11.x until @semantic-release/npm supports a newer major.",
70
+ "overrides": {
71
+ "npm": "^11.18.0"
66
72
  }
67
73
  }
@@ -38,6 +38,7 @@
38
38
  "type": "object",
39
39
  "properties": {
40
40
  "displayName": { "type": "string" },
41
+ "shortDescription": { "type": "string" },
41
42
  "icon": { "type": "string" }
42
43
  },
43
44
  "additionalProperties": true
@@ -7,7 +7,7 @@
7
7
  "required": ["version", "plugins"],
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
- "version": { "type": "integer", "description": "Lock file format version.", "const": 3 },
10
+ "version": { "type": "integer", "description": "Lock file format version.", "enum": [3, 4, 5] },
11
11
  "plugins": {
12
12
  "type": "object",
13
13
  "additionalProperties": { "$ref": "#/$defs/lockEntry" }
@@ -30,6 +30,10 @@
30
30
  "description": "Digest of the complete cached source payload.",
31
31
  "pattern": "^[a-z0-9]+-[0-9a-f]+$"
32
32
  },
33
+ "resolvedRevision": {
34
+ "type": "string",
35
+ "description": "Immutable remote commit that produced the cached source payload."
36
+ },
33
37
  "installedHash": {
34
38
  "type": "string",
35
39
  "description": "Digest of the effective runtime installation.",
@@ -41,6 +45,24 @@
41
45
  "enum": ["enabled", "disabled"],
42
46
  "description": "Desired cross-agent projection state. Absent means enabled."
43
47
  },
48
+ "definition": {
49
+ "type": "object",
50
+ "required": ["kind", "root", "description", "fingerprint"],
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "kind": { "const": "default-dsl/v1" },
54
+ "root": { "const": "." },
55
+ "as": { "type": "string" },
56
+ "description": { "type": "string" },
57
+ "fingerprint": { "type": "string" },
58
+ "authorizedComponents": {
59
+ "type": "array",
60
+ "items": { "enum": ["skills", "agents", "commands", "mcp", "hooks", "apps"] },
61
+ "uniqueItems": true,
62
+ "description": "Structural components explicitly authorized at install time."
63
+ }
64
+ }
65
+ },
44
66
  "dependencies": {
45
67
  "type": "object",
46
68
  "additionalProperties": { "type": "string" }
@@ -388,4 +388,9 @@ async function main(): Promise<void> {
388
388
  }
389
389
  }
390
390
 
391
- main().finally(() => flushTelemetry().then(() => process.exit(0)));
391
+ main()
392
+ .catch((error) => {
393
+ console.error(error instanceof Error ? error.message : String(error));
394
+ process.exitCode = 1;
395
+ })
396
+ .finally(() => flushTelemetry().then(() => process.exit(process.exitCode ?? 0)));
@@ -32,9 +32,34 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
32
32
  * our actual TS entry, run via Node's type-stripping (Node >= 22.6), exactly how
33
33
  * `adg skills` launches the CLI. See vendor/skills/PROVENANCE.md.
34
34
  */
35
- const SELF_CLI_ENTRY = existsSync(join(__dirname, '../../../bin/adg.ts'))
36
- ? join(__dirname, '../../../bin/adg.ts')
37
- : join(__dirname, '../../../dist/bin/adg.js');
35
+ export function resolveSelfCliEntry(
36
+ moduleDir: string = __dirname,
37
+ exists: (path: string) => boolean = existsSync
38
+ ): string {
39
+ const sourceEntry = join(moduleDir, '../../../bin/adg.ts');
40
+ if (exists(sourceEntry)) return sourceEntry;
41
+ return join(moduleDir, '../../../bin/adg.js');
42
+ }
43
+
44
+ const SELF_CLI_ENTRY = resolveSelfCliEntry();
45
+
46
+ function recordSelfCliEntrypointMissing(): void {
47
+ const tracer = getTracer();
48
+ const span = tracer.startSpan("adg", { kind: SpanKind.CLIENT });
49
+ try {
50
+ span.setAttribute("process.executable.name", "adg");
51
+ span.setAttribute("process.command_args", ["adg", "skills", "add"]);
52
+ span.setAttribute("process.exit.code", -1);
53
+ span.setAttribute("error.type", "CLI_ENTRYPOINT_NOT_FOUND");
54
+ span.recordException(new Error("CLI entrypoint not found"));
55
+ span.setStatus({
56
+ code: SpanStatusCode.ERROR,
57
+ message: "CLI entrypoint not found",
58
+ });
59
+ } finally {
60
+ span.end();
61
+ }
62
+ }
38
63
 
39
64
  const RESET = '\x1b[0m';
40
65
  const BOLD = '\x1b[1m';
@@ -507,15 +532,16 @@ export async function updateGlobalSkills(
507
532
  const installUrl = buildUpdateInstallSource(update.entry);
508
533
 
509
534
  const cliEntry = SELF_CLI_ENTRY;
535
+ const args = ['skills', 'add', installUrl, '-g', '-y'];
510
536
  if (!existsSync(cliEntry)) {
511
537
  failCount++;
538
+ recordSelfCliEntrypointMissing();
512
539
  console.log(
513
540
  ` ${DIM}✗ Failed to update ${safeName}: CLI entrypoint not found at ${cliEntry}${RESET}`
514
541
  );
515
542
  continue;
516
543
  }
517
544
  const tracer = getTracer();
518
- const args = ['skills', 'add', installUrl, '-g', '-y'];
519
545
  const result = tracer.startActiveSpan("adg", { kind: SpanKind.CLIENT }, (span) => {
520
546
  try {
521
547
  span.setAttribute("process.executable.name", "adg");
@@ -635,6 +661,7 @@ export async function updateProjectSkills(
635
661
  const cliEntry = SELF_CLI_ENTRY;
636
662
 
637
663
  if (!existsSync(cliEntry)) {
664
+ recordSelfCliEntrypointMissing();
638
665
  console.log(`${DIM}✗ CLI entrypoint not found at ${cliEntry}${RESET}`);
639
666
  return { successCount, failCount: updatable.length, foundCount: projectSkills.length };
640
667
  }
@@ -807,6 +834,7 @@ export async function runUpdate(args: string[] = []): Promise<void> {
807
834
  }
808
835
  if (totalFail > 0) {
809
836
  console.log(`${DIM}Failed to update ${totalFail} skill(s)${RESET}`);
837
+ process.exitCode = 1;
810
838
  }
811
839
 
812
840
  track({