@neurcode-ai/cli 0.20.2 → 0.20.4
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/dist/commands/brain.d.ts.map +1 -1
- package/dist/commands/brain.js +120 -3
- package/dist/commands/brain.js.map +1 -1
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +6 -100
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/onboard.d.ts.map +1 -1
- package/dist/commands/onboard.js +3 -2
- package/dist/commands/onboard.js.map +1 -1
- package/dist/commands/pilot.d.ts +6 -0
- package/dist/commands/pilot.d.ts.map +1 -0
- package/dist/commands/pilot.js +110 -0
- package/dist/commands/pilot.js.map +1 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +1 -1
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/session-hook.d.ts +1 -0
- package/dist/commands/session-hook.d.ts.map +1 -1
- package/dist/commands/session-hook.js +187 -2
- package/dist/commands/session-hook.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +106 -83
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime-build.json +5 -5
- package/dist/utils/admission-artifact.d.ts.map +1 -1
- package/dist/utils/admission-artifact.js +10 -0
- package/dist/utils/admission-artifact.js.map +1 -1
- package/dist/utils/agent-session-launcher.d.ts +12 -0
- package/dist/utils/agent-session-launcher.d.ts.map +1 -1
- package/dist/utils/agent-session-launcher.js +74 -22
- package/dist/utils/agent-session-launcher.js.map +1 -1
- package/dist/utils/atomic-runtime-bootstrap.d.ts +24 -0
- package/dist/utils/atomic-runtime-bootstrap.d.ts.map +1 -0
- package/dist/utils/atomic-runtime-bootstrap.js +115 -0
- package/dist/utils/atomic-runtime-bootstrap.js.map +1 -0
- package/dist/utils/brain-lifecycle.d.ts.map +1 -1
- package/dist/utils/brain-lifecycle.js +14 -3
- package/dist/utils/brain-lifecycle.js.map +1 -1
- package/dist/utils/cli-startup.d.ts.map +1 -1
- package/dist/utils/cli-startup.js +25 -1
- package/dist/utils/cli-startup.js.map +1 -1
- package/dist/utils/enterprise-eval-report.d.ts +31 -0
- package/dist/utils/enterprise-eval-report.d.ts.map +1 -1
- package/dist/utils/enterprise-eval-report.js +41 -1
- package/dist/utils/enterprise-eval-report.js.map +1 -1
- package/dist/utils/eval-demo-command.d.ts +27 -0
- package/dist/utils/eval-demo-command.d.ts.map +1 -0
- package/dist/utils/eval-demo-command.js +137 -0
- package/dist/utils/eval-demo-command.js.map +1 -0
- package/dist/utils/eval-demo.d.ts.map +1 -1
- package/dist/utils/eval-demo.js +57 -0
- package/dist/utils/eval-demo.js.map +1 -1
- package/dist/utils/gitignore.d.ts +12 -3
- package/dist/utils/gitignore.d.ts.map +1 -1
- package/dist/utils/gitignore.js +59 -22
- package/dist/utils/gitignore.js.map +1 -1
- package/dist/utils/local-repo-brain.d.ts +1 -0
- package/dist/utils/local-repo-brain.d.ts.map +1 -1
- package/dist/utils/local-repo-brain.js +33 -4
- package/dist/utils/local-repo-brain.js.map +1 -1
- package/dist/utils/pilot-setup-commands.d.ts +13 -0
- package/dist/utils/pilot-setup-commands.d.ts.map +1 -0
- package/dist/utils/pilot-setup-commands.js +48 -0
- package/dist/utils/pilot-setup-commands.js.map +1 -0
- package/dist/utils/pilot-setup-contract.d.ts +11 -0
- package/dist/utils/pilot-setup-contract.d.ts.map +1 -0
- package/dist/utils/pilot-setup-contract.js +131 -0
- package/dist/utils/pilot-setup-contract.js.map +1 -0
- package/dist/utils/replay-runtime.d.ts.map +1 -1
- package/dist/utils/replay-runtime.js +0 -1
- package/dist/utils/replay-runtime.js.map +1 -1
- package/dist/utils/repo-brain-impact.d.ts +11 -1
- package/dist/utils/repo-brain-impact.d.ts.map +1 -1
- package/dist/utils/repo-brain-impact.js +75 -5
- package/dist/utils/repo-brain-impact.js.map +1 -1
- package/dist/utils/repo-graph-impact.d.ts +60 -0
- package/dist/utils/repo-graph-impact.d.ts.map +1 -0
- package/dist/utils/repo-graph-impact.js +330 -0
- package/dist/utils/repo-graph-impact.js.map +1 -0
- package/dist/utils/repo-intelligence-v2.d.ts.map +1 -1
- package/dist/utils/repo-intelligence-v2.js +5 -0
- package/dist/utils/repo-intelligence-v2.js.map +1 -1
- package/dist/utils/runtime-safety-check.d.ts +24 -0
- package/dist/utils/runtime-safety-check.d.ts.map +1 -0
- package/dist/utils/runtime-safety-check.js +50 -0
- package/dist/utils/runtime-safety-check.js.map +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/commands/brain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/commands/brain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuhBpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqsEnD"}
|
package/dist/commands/brain.js
CHANGED
|
@@ -50,6 +50,7 @@ const cli_runtime_1 = require("@neurcode-ai/cli-runtime");
|
|
|
50
50
|
const brain_cache_1 = require("../utils/brain-cache");
|
|
51
51
|
const local_repo_brain_1 = require("../utils/local-repo-brain");
|
|
52
52
|
const repo_brain_impact_1 = require("../utils/repo-brain-impact");
|
|
53
|
+
const repo_graph_impact_1 = require("../utils/repo-graph-impact");
|
|
53
54
|
const config_1 = require("../config");
|
|
54
55
|
const project_root_1 = require("../utils/project-root");
|
|
55
56
|
const state_1 = require("../utils/state");
|
|
@@ -632,6 +633,111 @@ function brainCommand(program) {
|
|
|
632
633
|
console.log(chalk.dim('Architecture memory not found yet (it will be created automatically on plan runs).'));
|
|
633
634
|
}
|
|
634
635
|
});
|
|
636
|
+
brain
|
|
637
|
+
.command('readiness')
|
|
638
|
+
.description('Repository Brain readiness: languages, parser depth, storage, caps, enforcement posture, and next command')
|
|
639
|
+
.option('--json', 'Output as JSON')
|
|
640
|
+
.action(async (options) => {
|
|
641
|
+
const scope = getBrainScope();
|
|
642
|
+
const graph = (0, brain_1.readRepositoryGraph)(scope.cwd);
|
|
643
|
+
const metadata = (0, brain_1.readRepositoryGraphMetadata)(scope.cwd);
|
|
644
|
+
const graphMeta = (0, repo_graph_impact_1.readGraphMetadataOnly)(scope.cwd);
|
|
645
|
+
const freshness = graph ? await (0, brain_1.repositoryGraphStatus)(scope.cwd) : null;
|
|
646
|
+
const storeMode = process.env.NEURCODE_GRAPH_STORE?.trim() || 'portable (default)';
|
|
647
|
+
const portableBackend = graphMeta.backend === 'portable';
|
|
648
|
+
const languages = graph?.coverage.languages ?? [];
|
|
649
|
+
const caps = metadata?.limits ?? graph?.limits ?? null;
|
|
650
|
+
const omitted = metadata?.coverageAuthority?.omittedPathPrefixes?.slice(0, 12)
|
|
651
|
+
?? graph?.coverageAuthority?.omittedPathPrefixes?.slice(0, 12)
|
|
652
|
+
?? [];
|
|
653
|
+
const nextCommands = graph
|
|
654
|
+
? ['neurcode brain impact --path <file>', 'neurcode brain repo-query --help']
|
|
655
|
+
: ['neurcode brain repo-index', 'neurcode brain readiness --json'];
|
|
656
|
+
const enforcementPosture = {
|
|
657
|
+
claude: 'hard_pre_write_deny_when_hook_installed',
|
|
658
|
+
copilot: 'hard_pre_write_deny_when_hook_installed',
|
|
659
|
+
cursor: 'cooperative_advisory_mcp_checks',
|
|
660
|
+
codex: 'cooperative_advisory_mcp_checks',
|
|
661
|
+
};
|
|
662
|
+
const payload = {
|
|
663
|
+
repoRoot: scope.cwd,
|
|
664
|
+
brainState: graph ? (freshness?.state ?? 'unknown') : 'not_indexed',
|
|
665
|
+
storage: {
|
|
666
|
+
mode: storeMode,
|
|
667
|
+
backend: graphMeta.backend,
|
|
668
|
+
bytes: graphMeta.bytes,
|
|
669
|
+
impactAuthority: graphMeta.impactAuthority,
|
|
670
|
+
enterpriseScale: !portableBackend,
|
|
671
|
+
incrementalPosture: portableBackend
|
|
672
|
+
? 'portable_json_rewrites_full_graph_on_each_index_not_enterprise_scale'
|
|
673
|
+
: 'sqlite_row_incremental_when_native_probe_succeeds',
|
|
674
|
+
recommendation: portableBackend
|
|
675
|
+
? (graphMeta.bytes && graphMeta.bytes > 32 * 1024 * 1024
|
|
676
|
+
? 'Set NEURCODE_GRAPH_STORE=auto or sqlite after authority proves native probe on this machine'
|
|
677
|
+
: 'Portable JSON is fine for small repos; use sqlite/auto before large-repo pilots')
|
|
678
|
+
: null,
|
|
679
|
+
},
|
|
680
|
+
languages: languages.map((item) => ({
|
|
681
|
+
language: item.language,
|
|
682
|
+
parserDepth: item.depth,
|
|
683
|
+
filesAnalyzed: item.filesAnalyzed,
|
|
684
|
+
parserId: item.parserId,
|
|
685
|
+
})),
|
|
686
|
+
capabilityMatrix: {
|
|
687
|
+
typescript_javascript: { imports: 'deterministic_structural', references: 'bounded_inference', calls: 'bounded_inference' },
|
|
688
|
+
python: {
|
|
689
|
+
imports: languages.some((l) => l.language === 'python' && l.depth === 'syntax_tree')
|
|
690
|
+
? 'deterministic_structural'
|
|
691
|
+
: 'regex_degraded_or_unavailable',
|
|
692
|
+
references: 'not_evaluated',
|
|
693
|
+
calls: 'not_evaluated',
|
|
694
|
+
},
|
|
695
|
+
other: 'path_owner_policy_only',
|
|
696
|
+
},
|
|
697
|
+
caps: caps ? {
|
|
698
|
+
maxFiles: caps.maxFiles,
|
|
699
|
+
maxNodes: caps.maxNodes,
|
|
700
|
+
maxEdges: caps.maxEdges,
|
|
701
|
+
omittedPathPrefixes: omitted,
|
|
702
|
+
coverageComplete: metadata?.coverageAuthority?.coverageComplete ?? graph?.coverageAuthority?.coverageComplete ?? null,
|
|
703
|
+
} : null,
|
|
704
|
+
enforcementPosture,
|
|
705
|
+
privacy: { metadataOnly: true, sourceUploaded: false, sourceIncluded: false },
|
|
706
|
+
nextRecommendedCommands: nextCommands,
|
|
707
|
+
recoveryCommand: graph ? 'neurcode brain repo-refresh' : 'neurcode brain repo-index',
|
|
708
|
+
};
|
|
709
|
+
if (options.json) {
|
|
710
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
await (0, messages_1.printSuccessBanner)('Repository Brain Readiness');
|
|
714
|
+
console.log(chalk.dim(`Repo: ${scope.cwd}`));
|
|
715
|
+
console.log(chalk.white(`State: ${payload.brainState}`));
|
|
716
|
+
console.log(chalk.white(`Storage: ${payload.storage.backend} (${graphMeta.bytes != null ? formatBytes(graphMeta.bytes) : 'n/a'})`));
|
|
717
|
+
if (payload.storage.recommendation) {
|
|
718
|
+
(0, messages_1.printInfo)('Scale recommendation', payload.storage.recommendation);
|
|
719
|
+
}
|
|
720
|
+
(0, messages_1.printSection)('Storage posture', '🗄️');
|
|
721
|
+
if (portableBackend) {
|
|
722
|
+
console.log(chalk.yellow('Portable JSON backend — not enterprise-scale incremental; full graph rewrite on index'));
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
console.log(chalk.dim(`SQLite backend — queryable segmented store`));
|
|
726
|
+
}
|
|
727
|
+
(0, messages_1.printSection)('Languages', '🌐');
|
|
728
|
+
for (const lang of payload.languages) {
|
|
729
|
+
console.log(chalk.dim(`- ${lang.language}: ${lang.parserDepth} (${lang.filesAnalyzed} files)`));
|
|
730
|
+
}
|
|
731
|
+
if (payload.languages.length === 0) {
|
|
732
|
+
console.log(chalk.dim('No indexed languages — run neurcode brain repo-index'));
|
|
733
|
+
}
|
|
734
|
+
(0, messages_1.printSection)('Enforcement posture', '🛡️');
|
|
735
|
+
console.log(chalk.dim('Cursor/Codex: cooperative MCP checks (not hard pre-write deny)'));
|
|
736
|
+
console.log(chalk.dim('Claude/Copilot: hard deny when host hooks are installed'));
|
|
737
|
+
(0, messages_1.printSection)('Next', '▶️');
|
|
738
|
+
for (const cmd of nextCommands)
|
|
739
|
+
console.log(chalk.cyan(` ${cmd}`));
|
|
740
|
+
});
|
|
635
741
|
// -- brain index ------------------------------------------------------------
|
|
636
742
|
brain
|
|
637
743
|
.command('index')
|
|
@@ -838,6 +944,8 @@ function brainCommand(program) {
|
|
|
838
944
|
edgeCount: metadata.edgeCount,
|
|
839
945
|
graphBytes: metadata.graphBytes,
|
|
840
946
|
storageFormat: metadata.storageFormat,
|
|
947
|
+
coverageAuthority: metadata.coverageAuthority ?? null,
|
|
948
|
+
limits: metadata.limits,
|
|
841
949
|
} : null,
|
|
842
950
|
};
|
|
843
951
|
if (options.json) {
|
|
@@ -930,7 +1038,7 @@ function brainCommand(program) {
|
|
|
930
1038
|
const matches = (0, brain_1.explainRepositoryGraph)(graph, query, options.limit);
|
|
931
1039
|
const matchIds = new Set(matches.map((node) => node.id));
|
|
932
1040
|
const edges = graph.edges.filter((edge) => matchIds.has(edge.fromId) || matchIds.has(edge.toId));
|
|
933
|
-
const payload = { ok: true, query, matches, edges, freshness: graph.freshness };
|
|
1041
|
+
const payload = { ok: true, query, matches, edges, freshness: graph.freshness, coverageAuthority: graph.coverageAuthority ?? null };
|
|
934
1042
|
if (options.json) {
|
|
935
1043
|
console.log(JSON.stringify(payload, null, 2));
|
|
936
1044
|
return;
|
|
@@ -982,7 +1090,13 @@ function brainCommand(program) {
|
|
|
982
1090
|
direction,
|
|
983
1091
|
limit: options.limit,
|
|
984
1092
|
});
|
|
985
|
-
const payload = {
|
|
1093
|
+
const payload = {
|
|
1094
|
+
ok: true,
|
|
1095
|
+
query: options,
|
|
1096
|
+
coverageAuthority: graph.coverageAuthority ?? null,
|
|
1097
|
+
...result,
|
|
1098
|
+
freshness: graph.freshness,
|
|
1099
|
+
};
|
|
986
1100
|
if (options.json) {
|
|
987
1101
|
console.log(JSON.stringify(payload, null, 2));
|
|
988
1102
|
return;
|
|
@@ -1326,7 +1440,8 @@ function brainCommand(program) {
|
|
|
1326
1440
|
await (0, brain_1.indexRepositoryGraph)({ repoRoot: scope.cwd });
|
|
1327
1441
|
}
|
|
1328
1442
|
const report = (0, repo_brain_impact_1.buildRepoBrainImpactForRepo)(scope.cwd, paths, { autoBuild: options.index !== false });
|
|
1329
|
-
const
|
|
1443
|
+
const graphProjection = (0, repo_graph_impact_1.computeGraphImpactProjection)({ repoRoot: scope.cwd, changedPaths: paths });
|
|
1444
|
+
const summary = (0, repo_brain_impact_1.summarizeImpact)(report, graphProjection);
|
|
1330
1445
|
const canonicalGraph = (0, brain_1.readRepositoryGraph)(scope.cwd);
|
|
1331
1446
|
const canonicalFreshness = canonicalGraph ? await (0, brain_1.repositoryGraphStatus)(scope.cwd) : null;
|
|
1332
1447
|
if (options.json) {
|
|
@@ -1342,7 +1457,9 @@ function brainCommand(program) {
|
|
|
1342
1457
|
schemaVersion: canonicalGraph.schemaVersion,
|
|
1343
1458
|
freshness: canonicalFreshness,
|
|
1344
1459
|
coverage: canonicalGraph.coverage,
|
|
1460
|
+
coverageAuthority: canonicalGraph.coverageAuthority ?? null,
|
|
1345
1461
|
} : null,
|
|
1462
|
+
graphProjection,
|
|
1346
1463
|
report,
|
|
1347
1464
|
summary,
|
|
1348
1465
|
}, null, 2));
|