ucn 3.8.8 → 3.8.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.
- package/.claude/skills/ucn/SKILL.md +1 -1
- package/cli/index.js +5 -5
- package/core/entrypoints.js +9 -0
- package/core/execute.js +1 -0
- package/languages/go.js +19 -0
- package/mcp/server.js +4 -4
- package/package.json +1 -1
|
@@ -184,7 +184,7 @@ ucn [target] <command> [name] [--flags]
|
|
|
184
184
|
| `--case-sensitive` | Case-sensitive text search (default: case-insensitive) |
|
|
185
185
|
| `--exact` | Exact name match only in `find`/`typedef` (no substring) |
|
|
186
186
|
| `--include-uncertain` | Include ambiguous/uncertain matches in `context`/`smart`/`about` |
|
|
187
|
-
| `--
|
|
187
|
+
| `--no-confidence` | Hide confidence scores (shown by default) in `context`/`about` |
|
|
188
188
|
| `--min-confidence=N` | Filter edges below confidence threshold (e.g., `--min-confidence=0.7` keeps only high-confidence edges) |
|
|
189
189
|
| `--calls-only` | Only show call/test-case matches in `tests` (skip file-level results) |
|
|
190
190
|
| `--add-param=<name>` | Add a parameter (`plan` command). Combine with `--default=<value>` |
|
package/cli/index.js
CHANGED
|
@@ -112,7 +112,7 @@ function parseFlags(tokens) {
|
|
|
112
112
|
decorator: getValueFlag('--decorator'),
|
|
113
113
|
exported: tokens.includes('--exported'),
|
|
114
114
|
unused: tokens.includes('--unused'),
|
|
115
|
-
showConfidence: tokens.includes('--
|
|
115
|
+
showConfidence: !tokens.includes('--no-confidence'),
|
|
116
116
|
minConfidence: parseFloat(getValueFlag('--min-confidence') || '0') || 0,
|
|
117
117
|
framework: getValueFlag('--framework'),
|
|
118
118
|
};
|
|
@@ -141,7 +141,7 @@ const knownFlags = new Set([
|
|
|
141
141
|
'--regex', '--no-regex', '--functions',
|
|
142
142
|
'--max-lines', '--class-name', '--limit', '--max-files',
|
|
143
143
|
'--type', '--param', '--receiver', '--returns', '--decorator', '--exported', '--unused',
|
|
144
|
-
'--show-confidence', '--min-confidence',
|
|
144
|
+
'--show-confidence', '--no-confidence', '--min-confidence',
|
|
145
145
|
'--framework'
|
|
146
146
|
]);
|
|
147
147
|
|
|
@@ -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,
|
|
@@ -1127,7 +1127,7 @@ Common Flags:
|
|
|
1127
1127
|
--class-name=X Scope to specific class (e.g., --class-name=Repository)
|
|
1128
1128
|
--include-methods Include method calls (obj.fn) in caller/callee analysis
|
|
1129
1129
|
--include-uncertain Include ambiguous/uncertain matches
|
|
1130
|
-
--
|
|
1130
|
+
--no-confidence Hide confidence scores (shown by default)
|
|
1131
1131
|
--min-confidence=N Filter edges below confidence threshold (0.0-1.0)
|
|
1132
1132
|
--include-exported Include exported symbols in deadcode
|
|
1133
1133
|
--no-regex Force plain text search (regex is default)
|
|
@@ -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;
|
package/core/entrypoints.js
CHANGED
|
@@ -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
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/mcp/server.js
CHANGED
|
@@ -114,7 +114,7 @@ const server = new McpServer({
|
|
|
114
114
|
// TOOL HELPERS
|
|
115
115
|
// ============================================================================
|
|
116
116
|
|
|
117
|
-
const DEFAULT_OUTPUT_CHARS =
|
|
117
|
+
const DEFAULT_OUTPUT_CHARS = 10000; // ~2.5K tokens — compact default for AI agents
|
|
118
118
|
const MAX_OUTPUT_CHARS = 100000; // hard ceiling even with max_chars override
|
|
119
119
|
|
|
120
120
|
function toolResult(text, command, maxChars) {
|
|
@@ -253,7 +253,7 @@ server.registerTool(
|
|
|
253
253
|
include_methods: z.boolean().optional().describe('Include obj.method() calls (default: true for about/trace)'),
|
|
254
254
|
include_uncertain: z.boolean().optional().describe('Include uncertain/ambiguous matches'),
|
|
255
255
|
min_confidence: z.number().optional().describe('Minimum confidence threshold (0.0-1.0) to filter caller/callee edges'),
|
|
256
|
-
show_confidence: z.boolean().optional().describe('Show confidence scores
|
|
256
|
+
show_confidence: z.boolean().optional().describe('Show confidence scores per edge (default: true). Set false to hide.'),
|
|
257
257
|
with_types: z.boolean().optional().describe('Include related type definitions in output'),
|
|
258
258
|
detailed: z.boolean().optional().describe('Show full symbol listing per file'),
|
|
259
259
|
exact: z.boolean().optional().describe('Exact name match only (no substring matching)'),
|
|
@@ -327,7 +327,7 @@ server.registerTool(
|
|
|
327
327
|
return tr(output.formatAbout(result, {
|
|
328
328
|
allHint: 'Repeat with all=true to show all.',
|
|
329
329
|
methodsHint: 'Note: obj.method() callers/callees excluded. Use include_methods=true to include them.',
|
|
330
|
-
showConfidence: ep.showConfidence,
|
|
330
|
+
showConfidence: ep.showConfidence !== false,
|
|
331
331
|
}));
|
|
332
332
|
}
|
|
333
333
|
|
|
@@ -337,7 +337,7 @@ server.registerTool(
|
|
|
337
337
|
if (!ok) return tr(error); // context uses soft error (not toolError)
|
|
338
338
|
const { text, expandable } = output.formatContext(ctx, {
|
|
339
339
|
expandHint: 'Use expand command with item number to see code for any item.',
|
|
340
|
-
showConfidence: ep.showConfidence,
|
|
340
|
+
showConfidence: ep.showConfidence !== false,
|
|
341
341
|
});
|
|
342
342
|
expandCacheInstance.save(index.root, ep.name, ep.file, expandable);
|
|
343
343
|
return tr(text);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ucn",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.10",
|
|
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",
|