@rbbtsn0w/adg 0.6.0-beta.4 → 0.6.0-beta.5

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.
@@ -341,4 +341,9 @@ async function main() {
341
341
  console.log(`Run ${BOLD}skills --help${RESET} for usage.`);
342
342
  }
343
343
  }
344
- main().finally(() => flushTelemetry().then(() => process.exit(0)));
344
+ main()
345
+ .catch((error) => {
346
+ console.error(error instanceof Error ? error.message : String(error));
347
+ process.exitCode = 1;
348
+ })
349
+ .finally(() => flushTelemetry().then(() => process.exit(process.exitCode ?? 0)));
@@ -24,9 +24,31 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
24
24
  * our actual TS entry, run via Node's type-stripping (Node >= 22.6), exactly how
25
25
  * `adg skills` launches the CLI. See vendor/skills/PROVENANCE.md.
26
26
  */
27
- const SELF_CLI_ENTRY = existsSync(join(__dirname, '../../../bin/adg.ts'))
28
- ? join(__dirname, '../../../bin/adg.ts')
29
- : join(__dirname, '../../../dist/bin/adg.js');
27
+ export function resolveSelfCliEntry(moduleDir = __dirname, exists = existsSync) {
28
+ const sourceEntry = join(moduleDir, '../../../bin/adg.ts');
29
+ if (exists(sourceEntry))
30
+ return sourceEntry;
31
+ return join(moduleDir, '../../../bin/adg.js');
32
+ }
33
+ const SELF_CLI_ENTRY = resolveSelfCliEntry();
34
+ function recordSelfCliEntrypointMissing() {
35
+ const tracer = getTracer();
36
+ const span = tracer.startSpan("adg", { kind: SpanKind.CLIENT });
37
+ try {
38
+ span.setAttribute("process.executable.name", "adg");
39
+ span.setAttribute("process.command_args", ["adg", "skills", "add"]);
40
+ span.setAttribute("process.exit.code", -1);
41
+ span.setAttribute("error.type", "CLI_ENTRYPOINT_NOT_FOUND");
42
+ span.recordException(new Error("CLI entrypoint not found"));
43
+ span.setStatus({
44
+ code: SpanStatusCode.ERROR,
45
+ message: "CLI entrypoint not found",
46
+ });
47
+ }
48
+ finally {
49
+ span.end();
50
+ }
51
+ }
30
52
  const RESET = '\x1b[0m';
31
53
  const BOLD = '\x1b[1m';
32
54
  const DIM = '\x1b[38;5;102m';
@@ -400,13 +422,14 @@ export async function updateGlobalSkills(options = {}) {
400
422
  console.log(`${TEXT}Updating ${safeName}...${RESET}`);
401
423
  const installUrl = buildUpdateInstallSource(update.entry);
402
424
  const cliEntry = SELF_CLI_ENTRY;
425
+ const args = ['skills', 'add', installUrl, '-g', '-y'];
403
426
  if (!existsSync(cliEntry)) {
404
427
  failCount++;
428
+ recordSelfCliEntrypointMissing();
405
429
  console.log(` ${DIM}✗ Failed to update ${safeName}: CLI entrypoint not found at ${cliEntry}${RESET}`);
406
430
  continue;
407
431
  }
408
432
  const tracer = getTracer();
409
- const args = ['skills', 'add', installUrl, '-g', '-y'];
410
433
  const result = tracer.startActiveSpan("adg", { kind: SpanKind.CLIENT }, (span) => {
411
434
  try {
412
435
  span.setAttribute("process.executable.name", "adg");
@@ -508,6 +531,7 @@ export async function updateProjectSkills(options = {}) {
508
531
  const localLock = await readLocalLock();
509
532
  const cliEntry = SELF_CLI_ENTRY;
510
533
  if (!existsSync(cliEntry)) {
534
+ recordSelfCliEntrypointMissing();
511
535
  console.log(`${DIM}✗ CLI entrypoint not found at ${cliEntry}${RESET}`);
512
536
  return { successCount, failCount: updatable.length, foundCount: projectSkills.length };
513
537
  }
@@ -652,6 +676,7 @@ export async function runUpdate(args = []) {
652
676
  }
653
677
  if (totalFail > 0) {
654
678
  console.log(`${DIM}Failed to update ${totalFail} skill(s)${RESET}`);
679
+ process.exitCode = 1;
655
680
  }
656
681
  track({
657
682
  event: 'update',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.6.0-beta.4",
3
+ "version": "0.6.0-beta.5",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -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({