@veewo/gitnexus 1.3.8 → 1.3.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/README.md +5 -0
- package/dist/benchmark/runner.test.js +1 -1
- package/dist/benchmark/u2-e2e/analyze-parser.d.ts +22 -0
- package/dist/benchmark/u2-e2e/analyze-parser.js +89 -0
- package/dist/benchmark/u2-e2e/analyze-parser.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/analyze-parser.test.js +13 -0
- package/dist/benchmark/u2-e2e/characterlist-assetref.d.ts +19 -0
- package/dist/benchmark/u2-e2e/characterlist-assetref.js +80 -0
- package/dist/benchmark/u2-e2e/characterlist-assetref.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/characterlist-assetref.test.js +108 -0
- package/dist/benchmark/u2-e2e/config.d.ts +25 -0
- package/dist/benchmark/u2-e2e/config.js +86 -0
- package/dist/benchmark/u2-e2e/config.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/config.test.js +29 -0
- package/dist/benchmark/u2-e2e/metrics.d.ts +20 -0
- package/dist/benchmark/u2-e2e/metrics.js +34 -0
- package/dist/benchmark/u2-e2e/metrics.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/metrics.test.js +13 -0
- package/dist/benchmark/u2-e2e/neonspark-full-e2e.d.ts +33 -0
- package/dist/benchmark/u2-e2e/neonspark-full-e2e.js +439 -0
- package/dist/benchmark/u2-e2e/neonspark-full-e2e.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/neonspark-full-e2e.test.js +40 -0
- package/dist/benchmark/u2-e2e/report.d.ts +58 -0
- package/dist/benchmark/u2-e2e/report.js +130 -0
- package/dist/benchmark/u2-e2e/report.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/report.test.js +58 -0
- package/dist/benchmark/u2-e2e/retrieval-runner.d.ts +21 -0
- package/dist/benchmark/u2-e2e/retrieval-runner.js +166 -0
- package/dist/benchmark/u2-e2e/retrieval-runner.test.d.ts +1 -0
- package/dist/benchmark/u2-e2e/retrieval-runner.test.js +145 -0
- package/dist/benchmark/u2-performance-sampler.d.ts +33 -0
- package/dist/benchmark/u2-performance-sampler.js +178 -0
- package/dist/benchmark/u2-performance-sampler.test.d.ts +1 -0
- package/dist/benchmark/u2-performance-sampler.test.js +34 -0
- package/dist/cli/analyze-multi-scope-regression.test.js +10 -0
- package/dist/cli/analyze-summary.d.ts +7 -0
- package/dist/cli/analyze-summary.js +37 -0
- package/dist/cli/analyze-summary.test.d.ts +1 -0
- package/dist/cli/analyze-summary.test.js +58 -0
- package/dist/cli/analyze.js +11 -6
- package/dist/cli/benchmark-u2-e2e.d.ts +9 -0
- package/dist/cli/benchmark-u2-e2e.js +35 -0
- package/dist/cli/benchmark-u2-e2e.test.d.ts +1 -0
- package/dist/cli/benchmark-u2-e2e.test.js +7 -0
- package/dist/cli/index.js +20 -0
- package/dist/cli/tool.d.ts +3 -0
- package/dist/cli/tool.js +2 -0
- package/dist/cli/unity-bindings.d.ts +8 -0
- package/dist/cli/unity-bindings.js +33 -0
- package/dist/cli/unity-bindings.test.d.ts +1 -0
- package/dist/cli/unity-bindings.test.js +24 -0
- package/dist/core/graph/types.d.ts +1 -1
- package/dist/core/ingestion/pipeline.d.ts +2 -4
- package/dist/core/ingestion/pipeline.js +12 -0
- package/dist/core/ingestion/unity-resource-processor.d.ts +26 -0
- package/dist/core/ingestion/unity-resource-processor.js +363 -0
- package/dist/core/ingestion/unity-resource-processor.test.d.ts +1 -0
- package/dist/core/ingestion/unity-resource-processor.test.js +599 -0
- package/dist/core/kuzu/kuzu-adapter.d.ts +6 -0
- package/dist/core/kuzu/kuzu-adapter.js +18 -7
- package/dist/core/kuzu/schema.d.ts +2 -2
- package/dist/core/kuzu/schema.js +22 -1
- package/dist/core/kuzu/schema.test.d.ts +1 -0
- package/dist/core/kuzu/schema.test.js +17 -0
- package/dist/core/unity/meta-index.d.ts +5 -0
- package/dist/core/unity/meta-index.js +113 -0
- package/dist/core/unity/meta-index.test.d.ts +1 -0
- package/dist/core/unity/meta-index.test.js +11 -0
- package/dist/core/unity/options.d.ts +2 -0
- package/dist/core/unity/options.js +9 -0
- package/dist/core/unity/options.test.d.ts +1 -0
- package/dist/core/unity/options.test.js +10 -0
- package/dist/core/unity/override-merger.d.ts +27 -0
- package/dist/core/unity/override-merger.js +35 -0
- package/dist/core/unity/override-merger.test.d.ts +1 -0
- package/dist/core/unity/override-merger.test.js +47 -0
- package/dist/core/unity/resolver.d.ts +79 -0
- package/dist/core/unity/resolver.js +384 -0
- package/dist/core/unity/resolver.test.d.ts +1 -0
- package/dist/core/unity/resolver.test.js +244 -0
- package/dist/core/unity/resource-hit-scanner.d.ts +10 -0
- package/dist/core/unity/resource-hit-scanner.js +60 -0
- package/dist/core/unity/resource-hit-scanner.test.d.ts +1 -0
- package/dist/core/unity/resource-hit-scanner.test.js +20 -0
- package/dist/core/unity/scan-context.d.ts +23 -0
- package/dist/core/unity/scan-context.js +318 -0
- package/dist/core/unity/scan-context.test.d.ts +1 -0
- package/dist/core/unity/scan-context.test.js +118 -0
- package/dist/core/unity/serialized-type-index.d.ts +10 -0
- package/dist/core/unity/serialized-type-index.js +105 -0
- package/dist/core/unity/serialized-type-index.test.d.ts +1 -0
- package/dist/core/unity/serialized-type-index.test.js +34 -0
- package/dist/core/unity/u2-thresholds.test.d.ts +1 -0
- package/dist/core/unity/u2-thresholds.test.js +71 -0
- package/dist/core/unity/yaml-object-graph.d.ts +9 -0
- package/dist/core/unity/yaml-object-graph.js +92 -0
- package/dist/core/unity/yaml-object-graph.test.d.ts +1 -0
- package/dist/core/unity/yaml-object-graph.test.js +49 -0
- package/dist/mcp/local/local-backend.js +12 -1
- package/dist/mcp/local/unity-enrichment.d.ts +6 -0
- package/dist/mcp/local/unity-enrichment.js +91 -0
- package/dist/mcp/local/unity-enrichment.test.d.ts +1 -0
- package/dist/mcp/local/unity-enrichment.test.js +130 -0
- package/dist/mcp/tools.js +12 -0
- package/dist/types/pipeline.d.ts +7 -0
- package/dist/types/pipeline.js +2 -0
- package/hooks/check-release-path-hygiene.mjs +108 -0
- package/package.json +14 -7
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function formatUnityDiagnosticsSummary(diagnostics, previewLimit = 3) {
|
|
2
|
+
if (!diagnostics || diagnostics.length === 0) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
const limit = previewLimit > 0 ? previewLimit : diagnostics.length;
|
|
6
|
+
const preview = diagnostics.slice(0, limit);
|
|
7
|
+
const lines = [`Unity Diagnostics: ${diagnostics.length} message(s)`];
|
|
8
|
+
for (const message of preview) {
|
|
9
|
+
lines.push(`- ${message}`);
|
|
10
|
+
}
|
|
11
|
+
if (diagnostics.length > preview.length) {
|
|
12
|
+
lines.push(`... ${diagnostics.length - preview.length} more`);
|
|
13
|
+
}
|
|
14
|
+
return lines;
|
|
15
|
+
}
|
|
16
|
+
export function formatFallbackSummary(warnings, stats, previewLimit = 5) {
|
|
17
|
+
if (!warnings || warnings.length === 0) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
const safeStats = stats ?? {
|
|
21
|
+
attempted: 0,
|
|
22
|
+
succeeded: 0,
|
|
23
|
+
failed: 0,
|
|
24
|
+
};
|
|
25
|
+
const limit = previewLimit > 0 ? previewLimit : warnings.length;
|
|
26
|
+
const preview = warnings.slice(0, limit);
|
|
27
|
+
const lines = [
|
|
28
|
+
`Fallback edges: attempted=${safeStats.attempted}, succeeded=${safeStats.succeeded}, failed=${safeStats.failed}, pairTypes=${warnings.length}`,
|
|
29
|
+
];
|
|
30
|
+
for (const warning of preview) {
|
|
31
|
+
lines.push(`- ${warning}`);
|
|
32
|
+
}
|
|
33
|
+
if (warnings.length > preview.length) {
|
|
34
|
+
lines.push(`... ${warnings.length - preview.length} more`);
|
|
35
|
+
}
|
|
36
|
+
return lines;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { formatFallbackSummary, formatUnityDiagnosticsSummary } from './analyze-summary.js';
|
|
4
|
+
test('formatUnityDiagnosticsSummary returns empty when diagnostics are missing', () => {
|
|
5
|
+
const lines = formatUnityDiagnosticsSummary([]);
|
|
6
|
+
assert.deepEqual(lines, []);
|
|
7
|
+
});
|
|
8
|
+
test('formatUnityDiagnosticsSummary renders diagnostics with count and bullets', () => {
|
|
9
|
+
const lines = formatUnityDiagnosticsSummary([
|
|
10
|
+
'scanContext: scripts=4, guids=4, resources=0',
|
|
11
|
+
]);
|
|
12
|
+
assert.deepEqual(lines, [
|
|
13
|
+
'Unity Diagnostics: 1 message(s)',
|
|
14
|
+
'- scanContext: scripts=4, guids=4, resources=0',
|
|
15
|
+
]);
|
|
16
|
+
});
|
|
17
|
+
test('formatUnityDiagnosticsSummary truncates output after max preview items', () => {
|
|
18
|
+
const lines = formatUnityDiagnosticsSummary([
|
|
19
|
+
'diag-a',
|
|
20
|
+
'diag-b',
|
|
21
|
+
'diag-c',
|
|
22
|
+
'diag-d',
|
|
23
|
+
]);
|
|
24
|
+
assert.deepEqual(lines, [
|
|
25
|
+
'Unity Diagnostics: 4 message(s)',
|
|
26
|
+
'- diag-a',
|
|
27
|
+
'- diag-b',
|
|
28
|
+
'- diag-c',
|
|
29
|
+
'... 1 more',
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
test('formatFallbackSummary returns empty when no warnings exist', () => {
|
|
33
|
+
const lines = formatFallbackSummary([], {
|
|
34
|
+
attempted: 0,
|
|
35
|
+
succeeded: 0,
|
|
36
|
+
failed: 0,
|
|
37
|
+
});
|
|
38
|
+
assert.deepEqual(lines, []);
|
|
39
|
+
});
|
|
40
|
+
test('formatFallbackSummary renders attempted/succeeded/failed with warning preview', () => {
|
|
41
|
+
const lines = formatFallbackSummary([
|
|
42
|
+
'Method->Delegate (1233 edges): missing rel pair in schema',
|
|
43
|
+
'Class->Property (200 edges): missing rel pair in schema',
|
|
44
|
+
'Constructor->Property (97 edges): missing rel pair in schema',
|
|
45
|
+
'Function->Property (17 edges): missing rel pair in schema',
|
|
46
|
+
], {
|
|
47
|
+
attempted: 1547,
|
|
48
|
+
succeeded: 0,
|
|
49
|
+
failed: 1547,
|
|
50
|
+
}, 3);
|
|
51
|
+
assert.deepEqual(lines, [
|
|
52
|
+
'Fallback edges: attempted=1547, succeeded=0, failed=1547, pairTypes=4',
|
|
53
|
+
'- Method->Delegate (1233 edges): missing rel pair in schema',
|
|
54
|
+
'- Class->Property (200 edges): missing rel pair in schema',
|
|
55
|
+
'- Constructor->Property (97 edges): missing rel pair in schema',
|
|
56
|
+
'... 1 more',
|
|
57
|
+
]);
|
|
58
|
+
});
|
package/dist/cli/analyze.js
CHANGED
|
@@ -19,6 +19,7 @@ import { generateAIContextFiles } from './ai-context.js';
|
|
|
19
19
|
import fs from 'fs/promises';
|
|
20
20
|
import { registerClaudeHook } from './claude-hooks.js';
|
|
21
21
|
import { normalizeRepoAlias, parseExtensionList, resolveAnalyzeScopeRules } from './analyze-options.js';
|
|
22
|
+
import { formatFallbackSummary, formatUnityDiagnosticsSummary } from './analyze-summary.js';
|
|
22
23
|
const HEAP_MB = 8192;
|
|
23
24
|
const HEAP_FLAG = `--max-old-space-size=${HEAP_MB}`;
|
|
24
25
|
/** Re-exec the process with an 8GB heap if we're currently below that. */
|
|
@@ -350,6 +351,10 @@ export const analyzeCommand = async (inputPath, options) => {
|
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
353
|
}
|
|
354
|
+
const unitySummaryLines = formatUnityDiagnosticsSummary(pipelineResult.unityResult?.diagnostics);
|
|
355
|
+
for (const line of unitySummaryLines) {
|
|
356
|
+
console.log(` ${line}`);
|
|
357
|
+
}
|
|
353
358
|
console.log(` ${stats.nodes.toLocaleString()} nodes | ${stats.edges.toLocaleString()} edges | ${pipelineResult.communityResult?.stats.totalCommunities || 0} clusters | ${pipelineResult.processResult?.stats.totalProcesses || 0} flows`);
|
|
354
359
|
console.log(` KuzuDB ${kuzuTime}s | FTS ${ftsTime}s | Embeddings ${embeddingSkipped ? embeddingSkipReason : embeddingTime + 's'}`);
|
|
355
360
|
if (includeExtensions.length > 0) {
|
|
@@ -362,13 +367,13 @@ export const analyzeCommand = async (inputPath, options) => {
|
|
|
362
367
|
if (hookResult.registered) {
|
|
363
368
|
console.log(` Hooks: ${hookResult.message}`);
|
|
364
369
|
}
|
|
365
|
-
// Show
|
|
370
|
+
// Show fallback summary with pair-level preview and explicit outcomes
|
|
366
371
|
if (kuzuWarnings.length > 0) {
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
console.log(
|
|
372
|
+
const fallbackLines = formatFallbackSummary(kuzuWarnings, kuzuResult.fallbackStats);
|
|
373
|
+
for (const line of fallbackLines) {
|
|
374
|
+
console.log(` ${line}`);
|
|
375
|
+
}
|
|
376
|
+
console.log(' Note: schema pair coverage should be updated when fallback failures are non-zero');
|
|
372
377
|
}
|
|
373
378
|
try {
|
|
374
379
|
await fs.access(getGlobalRegistryPath());
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface U2E2EArgs {
|
|
2
|
+
configPath: string;
|
|
3
|
+
reportDir?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function resolveU2E2EArgs(argv: string[]): U2E2EArgs;
|
|
6
|
+
export declare function benchmarkU2E2ECommand(options: {
|
|
7
|
+
config?: string;
|
|
8
|
+
reportDir?: string;
|
|
9
|
+
}): Promise<import("../benchmark/u2-e2e/neonspark-full-e2e.js").E2ERunFailure | import("../benchmark/u2-e2e/neonspark-full-e2e.js").E2ERunSuccess>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { runNeonsparkU2E2E } from '../benchmark/u2-e2e/neonspark-full-e2e.js';
|
|
3
|
+
export function resolveU2E2EArgs(argv) {
|
|
4
|
+
const findValue = (name) => {
|
|
5
|
+
const index = argv.indexOf(name);
|
|
6
|
+
if (index === -1 || index + 1 >= argv.length)
|
|
7
|
+
return undefined;
|
|
8
|
+
return argv[index + 1];
|
|
9
|
+
};
|
|
10
|
+
const config = findValue('--config') || '../benchmarks/u2-e2e/neonspark-full-u2-e2e.config.json';
|
|
11
|
+
const reportDir = findValue('--report-dir');
|
|
12
|
+
return {
|
|
13
|
+
configPath: path.resolve(config),
|
|
14
|
+
...(reportDir ? { reportDir: path.resolve(reportDir) } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export async function benchmarkU2E2ECommand(options) {
|
|
18
|
+
const result = await runNeonsparkU2E2E({
|
|
19
|
+
configPath: path.resolve(options.config || '../benchmarks/u2-e2e/neonspark-full-u2-e2e.config.json'),
|
|
20
|
+
reportDir: options.reportDir ? path.resolve(options.reportDir) : undefined,
|
|
21
|
+
});
|
|
22
|
+
if (result.status === 'failed') {
|
|
23
|
+
process.stderr.write(`FAIL\n`);
|
|
24
|
+
process.stderr.write(`Run ID: ${result.runId}\n`);
|
|
25
|
+
process.stderr.write(`Failed Gate: ${result.failedGate}\n`);
|
|
26
|
+
process.stderr.write(`Report: ${result.reportDir}\n`);
|
|
27
|
+
process.stderr.write(`Error: ${result.error}\n`);
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
process.stderr.write('PASS\n');
|
|
32
|
+
process.stderr.write(`Run ID: ${result.runId}\n`);
|
|
33
|
+
process.stderr.write(`Report: ${result.reportDir}\n`);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { resolveU2E2EArgs } from './benchmark-u2-e2e.js';
|
|
4
|
+
test('benchmark-u2-e2e resolves config and report directory', () => {
|
|
5
|
+
const out = resolveU2E2EArgs(['--config', 'benchmarks/u2-e2e/neonspark-full-u2-e2e.config.json']);
|
|
6
|
+
assert.match(out.configPath, /neonspark-full-u2-e2e\.config\.json$/);
|
|
7
|
+
});
|
package/dist/cli/index.js
CHANGED
|
@@ -36,6 +36,8 @@ import { queryCommand, contextCommand, impactCommand, cypherCommand } from './to
|
|
|
36
36
|
import { evalServerCommand } from './eval-server.js';
|
|
37
37
|
import { benchmarkUnityCommand } from './benchmark-unity.js';
|
|
38
38
|
import { benchmarkAgentContextCommand } from './benchmark-agent-context.js';
|
|
39
|
+
import { unityBindingsCommand } from './unity-bindings.js';
|
|
40
|
+
import { benchmarkU2E2ECommand } from './benchmark-u2-e2e.js';
|
|
39
41
|
function resolveCliVersion() {
|
|
40
42
|
try {
|
|
41
43
|
const currentFile = fileURLToPath(import.meta.url);
|
|
@@ -121,6 +123,7 @@ program
|
|
|
121
123
|
.option('-g, --goal <text>', 'What you want to find')
|
|
122
124
|
.option('-l, --limit <n>', 'Max processes to return (default: 5)')
|
|
123
125
|
.option('--content', 'Include full symbol source code')
|
|
126
|
+
.option('--unity-resources <mode>', 'Unity resource retrieval mode: off|on|auto', 'off')
|
|
124
127
|
.action(queryCommand);
|
|
125
128
|
program
|
|
126
129
|
.command('context [name]')
|
|
@@ -129,7 +132,16 @@ program
|
|
|
129
132
|
.option('-u, --uid <uid>', 'Direct symbol UID (zero-ambiguity lookup)')
|
|
130
133
|
.option('-f, --file <path>', 'File path to disambiguate common names')
|
|
131
134
|
.option('--content', 'Include full symbol source code')
|
|
135
|
+
.option('--unity-resources <mode>', 'Unity resource retrieval mode: off|on|auto', 'off')
|
|
132
136
|
.action(contextCommand);
|
|
137
|
+
program
|
|
138
|
+
.command('unity-bindings <symbol>')
|
|
139
|
+
.description('Experimental: inspect Unity resource bindings for a C# symbol')
|
|
140
|
+
.option('--target-path <path>', 'Unity project root (default: cwd)')
|
|
141
|
+
.option('--json', 'Output JSON')
|
|
142
|
+
.action(async (symbol, options) => {
|
|
143
|
+
await unityBindingsCommand(symbol, options);
|
|
144
|
+
});
|
|
133
145
|
program
|
|
134
146
|
.command('impact <target>')
|
|
135
147
|
.description('Blast radius analysis: what breaks if you change a symbol')
|
|
@@ -181,4 +193,12 @@ program
|
|
|
181
193
|
.action(async (dataset, options) => {
|
|
182
194
|
await benchmarkAgentContextCommand(dataset, options);
|
|
183
195
|
});
|
|
196
|
+
program
|
|
197
|
+
.command('benchmark-u2-e2e')
|
|
198
|
+
.description('Run fail-fast full neonspark U2 E2E benchmark and emit evidence reports')
|
|
199
|
+
.option('--config <path>', 'Path to E2E config JSON')
|
|
200
|
+
.option('--report-dir <path>', 'Output directory for reports')
|
|
201
|
+
.action(async (options) => {
|
|
202
|
+
await benchmarkU2E2ECommand(options);
|
|
203
|
+
});
|
|
184
204
|
program.parse(process.argv);
|
package/dist/cli/tool.d.ts
CHANGED
|
@@ -13,18 +13,21 @@
|
|
|
13
13
|
* Note: Output goes to stderr because KuzuDB's native module captures stdout
|
|
14
14
|
* at the OS level during init. This is consistent with augment.ts.
|
|
15
15
|
*/
|
|
16
|
+
import type { UnityResourcesMode } from '../core/unity/options.js';
|
|
16
17
|
export declare function queryCommand(queryText: string, options?: {
|
|
17
18
|
repo?: string;
|
|
18
19
|
context?: string;
|
|
19
20
|
goal?: string;
|
|
20
21
|
limit?: string;
|
|
21
22
|
content?: boolean;
|
|
23
|
+
unityResources?: UnityResourcesMode;
|
|
22
24
|
}): Promise<void>;
|
|
23
25
|
export declare function contextCommand(name: string, options?: {
|
|
24
26
|
repo?: string;
|
|
25
27
|
file?: string;
|
|
26
28
|
uid?: string;
|
|
27
29
|
content?: boolean;
|
|
30
|
+
unityResources?: UnityResourcesMode;
|
|
28
31
|
}): Promise<void>;
|
|
29
32
|
export declare function impactCommand(target: string, options?: {
|
|
30
33
|
direction?: string;
|
package/dist/cli/tool.js
CHANGED
|
@@ -43,6 +43,7 @@ export async function queryCommand(queryText, options) {
|
|
|
43
43
|
goal: options?.goal,
|
|
44
44
|
limit: options?.limit ? parseInt(options.limit) : undefined,
|
|
45
45
|
include_content: options?.content ?? false,
|
|
46
|
+
unity_resources: options?.unityResources,
|
|
46
47
|
repo: options?.repo,
|
|
47
48
|
});
|
|
48
49
|
output(result);
|
|
@@ -58,6 +59,7 @@ export async function contextCommand(name, options) {
|
|
|
58
59
|
uid: options?.uid,
|
|
59
60
|
file_path: options?.file,
|
|
60
61
|
include_content: options?.content ?? false,
|
|
62
|
+
unity_resources: options?.unityResources,
|
|
61
63
|
repo: options?.repo,
|
|
62
64
|
});
|
|
63
65
|
output(result);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolveUnityBindings } from '../core/unity/resolver.js';
|
|
2
|
+
export declare function unityBindingsCommand(symbol: string, options: {
|
|
3
|
+
targetPath?: string;
|
|
4
|
+
json?: boolean;
|
|
5
|
+
}, deps?: {
|
|
6
|
+
resolver?: typeof resolveUnityBindings;
|
|
7
|
+
writeLine?: (line: string) => void;
|
|
8
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { resolveUnityBindings } from '../core/unity/resolver.js';
|
|
3
|
+
export async function unityBindingsCommand(symbol, options, deps) {
|
|
4
|
+
const resolver = deps?.resolver || resolveUnityBindings;
|
|
5
|
+
const writeLine = deps?.writeLine || ((line) => process.stderr.write(`${line}\n`));
|
|
6
|
+
const repoRoot = path.resolve(options.targetPath || process.cwd());
|
|
7
|
+
const result = await resolver({ repoRoot, symbol });
|
|
8
|
+
if (options.json) {
|
|
9
|
+
writeLine(JSON.stringify(result, null, 2));
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
writeLine(`Unity bindings for ${result.symbol}`);
|
|
13
|
+
writeLine(`Script: ${result.scriptPath}`);
|
|
14
|
+
writeLine(`GUID: ${result.scriptGuid}`);
|
|
15
|
+
writeLine(`Resource bindings: ${result.resourceBindings.length}`);
|
|
16
|
+
for (const binding of result.resourceBindings) {
|
|
17
|
+
writeLine(`- ${binding.resourceType} ${binding.resourcePath} [${binding.bindingKind}] component=${binding.componentObjectId}`);
|
|
18
|
+
}
|
|
19
|
+
writeLine(`Scalar fields: ${result.serializedFields.scalarFields.length}`);
|
|
20
|
+
for (const field of result.serializedFields.scalarFields) {
|
|
21
|
+
writeLine(`- ${field.name} = ${field.value} (${field.sourceLayer})`);
|
|
22
|
+
}
|
|
23
|
+
writeLine(`Reference fields: ${result.serializedFields.referenceFields.length}`);
|
|
24
|
+
for (const field of result.serializedFields.referenceFields) {
|
|
25
|
+
writeLine(`- ${field.name} -> ${field.guid || field.fileId || 'unresolved'} (${field.sourceLayer})`);
|
|
26
|
+
}
|
|
27
|
+
if (result.unityDiagnostics.length > 0) {
|
|
28
|
+
writeLine(`Diagnostics: ${result.unityDiagnostics.length}`);
|
|
29
|
+
for (const diagnostic of result.unityDiagnostics) {
|
|
30
|
+
writeLine(`- ${diagnostic}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { unityBindingsCommand } from './unity-bindings.js';
|
|
6
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const fixtureRoot = path.resolve(here, '../../src/core/unity/__fixtures__/mini-unity');
|
|
8
|
+
test('prints human readable summary by default', async () => {
|
|
9
|
+
const lines = [];
|
|
10
|
+
await unityBindingsCommand('MainUIManager', { targetPath: fixtureRoot }, { writeLine: (line) => lines.push(line) });
|
|
11
|
+
const output = lines.join('\n');
|
|
12
|
+
assert.match(output, /resource bindings/i);
|
|
13
|
+
assert.match(output, /MainUIManager/);
|
|
14
|
+
assert.match(output, /needPause/);
|
|
15
|
+
});
|
|
16
|
+
test('prints JSON when --json is enabled', async () => {
|
|
17
|
+
const lines = [];
|
|
18
|
+
await unityBindingsCommand('MainUIManager', { targetPath: fixtureRoot, json: true }, { writeLine: (line) => lines.push(line) });
|
|
19
|
+
const payload = JSON.parse(lines.join('\n'));
|
|
20
|
+
assert.equal(payload.symbol, 'MainUIManager');
|
|
21
|
+
assert.ok(Array.isArray(payload.resourceBindings));
|
|
22
|
+
assert.ok(Array.isArray(payload.serializedFields.scalarFields));
|
|
23
|
+
assert.ok(Array.isArray(payload.serializedFields.referenceFields));
|
|
24
|
+
});
|
|
@@ -20,7 +20,7 @@ export type NodeProperties = {
|
|
|
20
20
|
entryPointScore?: number;
|
|
21
21
|
entryPointReason?: string;
|
|
22
22
|
};
|
|
23
|
-
export type RelationshipType = 'CONTAINS' | 'CALLS' | 'INHERITS' | 'OVERRIDES' | 'IMPORTS' | 'USES' | 'DEFINES' | 'DECORATES' | 'IMPLEMENTS' | 'EXTENDS' | 'MEMBER_OF' | 'STEP_IN_PROCESS';
|
|
23
|
+
export type RelationshipType = 'CONTAINS' | 'CALLS' | 'INHERITS' | 'OVERRIDES' | 'IMPORTS' | 'USES' | 'DEFINES' | 'DECORATES' | 'IMPLEMENTS' | 'EXTENDS' | 'MEMBER_OF' | 'STEP_IN_PROCESS' | 'UNITY_COMPONENT_IN' | 'UNITY_COMPONENT_INSTANCE' | 'UNITY_SERIALIZED_TYPE_IN';
|
|
24
24
|
export interface GraphNode {
|
|
25
25
|
id: string;
|
|
26
26
|
label: NodeLabel;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { PipelineProgress, PipelineResult } from '../../types/pipeline.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
scopeRules?: string[];
|
|
5
|
-
}) => Promise<PipelineResult>;
|
|
2
|
+
import type { PipelineRunOptions } from '../../types/pipeline.js';
|
|
3
|
+
export declare const runPipelineFromRepo: (repoPath: string, onProgress: (progress: PipelineProgress) => void, options?: PipelineRunOptions) => Promise<PipelineResult>;
|
|
@@ -6,6 +6,7 @@ import { processCalls, processCallsFromExtracted } from './call-processor.js';
|
|
|
6
6
|
import { processHeritage, processHeritageFromExtracted } from './heritage-processor.js';
|
|
7
7
|
import { processCommunities } from './community-processor.js';
|
|
8
8
|
import { processProcesses } from './process-processor.js';
|
|
9
|
+
import { processUnityResources } from './unity-resource-processor.js';
|
|
9
10
|
import { createSymbolTable } from './symbol-table.js';
|
|
10
11
|
import { createASTCache } from './ast-cache.js';
|
|
11
12
|
import { walkRepositoryPaths, readFileContents } from './filesystem-walker.js';
|
|
@@ -74,6 +75,9 @@ export const runPipelineFromRepo = async (repoPath, onProgress, options) => {
|
|
|
74
75
|
stats: { filesProcessed: 0, totalFiles, nodesCreated: graph.nodeCount },
|
|
75
76
|
});
|
|
76
77
|
const allPaths = extensionFiltered.map(f => f.path);
|
|
78
|
+
const unityScopedPaths = (options?.scopeRules && options.scopeRules.length > 0)
|
|
79
|
+
? scopedFiles.map(f => f.path)
|
|
80
|
+
: allPaths;
|
|
77
81
|
processStructure(graph, allPaths);
|
|
78
82
|
onProgress({
|
|
79
83
|
phase: 'structure',
|
|
@@ -296,6 +300,13 @@ export const runPipelineFromRepo = async (repoPath, onProgress, options) => {
|
|
|
296
300
|
step: step.step,
|
|
297
301
|
});
|
|
298
302
|
});
|
|
303
|
+
onProgress({
|
|
304
|
+
phase: 'enriching',
|
|
305
|
+
percent: 99,
|
|
306
|
+
message: 'Extracting Unity resource bindings...',
|
|
307
|
+
stats: { filesProcessed: totalFiles, totalFiles, nodesCreated: graph.nodeCount },
|
|
308
|
+
});
|
|
309
|
+
const unityResult = await processUnityResources(graph, { repoPath, scopedPaths: unityScopedPaths });
|
|
299
310
|
onProgress({
|
|
300
311
|
phase: 'complete',
|
|
301
312
|
percent: 100,
|
|
@@ -313,6 +324,7 @@ export const runPipelineFromRepo = async (repoPath, onProgress, options) => {
|
|
|
313
324
|
totalFileCount: totalFiles,
|
|
314
325
|
communityResult,
|
|
315
326
|
processResult,
|
|
327
|
+
unityResult,
|
|
316
328
|
scopeDiagnostics: scopeSelection.diagnostics,
|
|
317
329
|
};
|
|
318
330
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { KnowledgeGraph } from '../graph/types.js';
|
|
2
|
+
import { buildUnityScanContext } from '../unity/scan-context.js';
|
|
3
|
+
import { resolveUnityBindings } from '../unity/resolver.js';
|
|
4
|
+
export interface UnityResourceProcessingResult {
|
|
5
|
+
processedSymbols: number;
|
|
6
|
+
bindingCount: number;
|
|
7
|
+
componentCount: number;
|
|
8
|
+
diagnostics: string[];
|
|
9
|
+
timingsMs: {
|
|
10
|
+
scanContext: number;
|
|
11
|
+
resolve: number;
|
|
12
|
+
graphWrite: number;
|
|
13
|
+
total: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type UnityPayloadMode = 'compact' | 'full';
|
|
17
|
+
export interface UnityResourceProcessingOptions {
|
|
18
|
+
repoPath: string;
|
|
19
|
+
scopedPaths?: string[];
|
|
20
|
+
payloadMode?: UnityPayloadMode;
|
|
21
|
+
}
|
|
22
|
+
export interface UnityResourceProcessingDeps {
|
|
23
|
+
buildScanContext?: typeof buildUnityScanContext;
|
|
24
|
+
resolveBindings?: typeof resolveUnityBindings;
|
|
25
|
+
}
|
|
26
|
+
export declare function processUnityResources(graph: KnowledgeGraph, options: UnityResourceProcessingOptions, deps?: UnityResourceProcessingDeps): Promise<UnityResourceProcessingResult>;
|