ucn 3.8.8 → 3.8.9

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/cli/index.js CHANGED
@@ -760,7 +760,7 @@ function runProjectCommand(rootDir, command, arg) {
760
760
  }
761
761
 
762
762
  case 'entrypoints': {
763
- const { ok, result, error } = execute(index, 'entrypoints', { type: flags.type, framework: flags.framework, file: flags.file });
763
+ const { ok, result, error } = execute(index, 'entrypoints', { type: flags.type, framework: flags.framework, file: flags.file, exclude: flags.exclude });
764
764
  if (!ok) fail(error);
765
765
  printOutput(result,
766
766
  output.formatEntrypointsJson,
@@ -1389,7 +1389,7 @@ function executeInteractiveCommand(index, command, arg, iflags = {}, cache = nul
1389
1389
  }
1390
1390
 
1391
1391
  case 'entrypoints': {
1392
- const { ok, result, error } = execute(index, 'entrypoints', { type: iflags.type, framework: iflags.framework, file: iflags.file });
1392
+ const { ok, result, error } = execute(index, 'entrypoints', { type: iflags.type, framework: iflags.framework, file: iflags.file, exclude: iflags.exclude });
1393
1393
  if (!ok) { console.log(error); return; }
1394
1394
  console.log(output.formatEntrypoints(result));
1395
1395
  break;
@@ -476,6 +476,15 @@ function detectEntrypoints(index, options = {}) {
476
476
  filtered = filtered.filter(e => e.file.includes(options.file));
477
477
  }
478
478
 
479
+ if (options.exclude) {
480
+ const raw = Array.isArray(options.exclude) ? options.exclude : options.exclude.split(',');
481
+ const patterns = raw.map(s => s.trim()).filter(Boolean);
482
+ if (patterns.length > 0) {
483
+ const regexes = patterns.map(p => new RegExp(`(^|[/._-])${p}s?([/._-]|$)`, 'i'));
484
+ filtered = filtered.filter(e => !regexes.some(r => r.test(e.file)));
485
+ }
486
+ }
487
+
479
488
  // Sort by file, then line
480
489
  filtered.sort((a, b) => {
481
490
  if (a.file !== b.file) return a.file.localeCompare(b.file);
package/core/execute.js CHANGED
@@ -595,6 +595,7 @@ const HANDLERS = {
595
595
  type: p.type,
596
596
  framework: p.framework,
597
597
  file: p.file,
598
+ exclude: p.exclude,
598
599
  });
599
600
  return { ok: true, result };
600
601
  },
package/languages/go.js CHANGED
@@ -1017,6 +1017,25 @@ function findCallsInCode(code, parser, options = {}) {
1017
1017
  });
1018
1018
  }
1019
1019
  }
1020
+ // Inline closure: RunE: func(cmd *cobra.Command, args []string) { ... }
1021
+ // Mark the enclosing function as the entry point (the closure itself has no name)
1022
+ if (valueNode.type === 'func_literal' && compositeType && fieldName) {
1023
+ const enclosing = getCurrentEnclosingFunction();
1024
+ const enclosingName = typeof enclosing === 'string' ? enclosing : enclosing?.name;
1025
+ if (enclosingName) {
1026
+ calls.push({
1027
+ name: enclosingName,
1028
+ line: valueNode.startPosition.row + 1,
1029
+ isMethod: false,
1030
+ isFunctionReference: false,
1031
+ isPotentialCallback: true,
1032
+ enclosingFunction: enclosing,
1033
+ uncertain: false,
1034
+ compositeType,
1035
+ fieldName,
1036
+ });
1037
+ }
1038
+ }
1020
1039
  }
1021
1040
  }
1022
1041
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ucn",
3
- "version": "3.8.8",
3
+ "version": "3.8.9",
4
4
  "mcpName": "io.github.mleoca/ucn",
5
5
  "description": "Code intelligence toolkit for AI agents — extract functions, trace call chains, find callers, detect dead code without reading entire files. Works as MCP server, CLI, or agent skill. Supports JS/TS, Python, Go, Rust, Java.",
6
6
  "main": "index.js",