@helix3/helix-cli 0.1.14-helix3.192 → 0.1.14-helix3.193

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/index.js CHANGED
@@ -4580,7 +4580,52 @@ function registerUnrealValidationCommand(name, description) {
4580
4580
  process.exitCode = 1;
4581
4581
  });
4582
4582
  }
4583
- registerUnrealValidationCommand('doctor', 'Check publish readiness plus safe editor-only Unreal MCP authoring setup');
4583
+ unreal
4584
+ .command('doctor')
4585
+ .description('Check publish readiness; with --engine or --fix, also run the in-editor HELIX Project Doctor')
4586
+ .argument('[project]', 'project directory or .uproject file', '.')
4587
+ .option('--engine', 'additionally run the SDK Project Doctor commandlet (needs UE_ROOT)')
4588
+ .option('--fix', 'apply every automatable in-editor fix, then re-scan (implies --engine)')
4589
+ .option('--json', 'machine-readable report')
4590
+ .action(async (project, opts) => {
4591
+ // Layer 1 — static validation, no editor required: the existing check.
4592
+ const staticReport = (0, unreal_1.validateUnrealProject)(project, { includeMcp: true });
4593
+ // Layer 2 — the SDK's in-editor Doctor, the same single implementation the
4594
+ // Creator Kit panel calls (helix-unreal-runtime -run=HelixProjectDoctor).
4595
+ let engineResult;
4596
+ if (opts.engine || opts.fix) {
4597
+ try {
4598
+ const { runUnrealDoctor } = await Promise.resolve().then(() => __importStar(require('./unreal/doctor')));
4599
+ const projectDir = project.endsWith('.uproject') ? (0, node_path_1.dirname)((0, node_path_1.resolve)(project)) : project;
4600
+ engineResult = runUnrealDoctor({ projectDir, fix: opts.fix });
4601
+ }
4602
+ catch (error) {
4603
+ fail(`✖ ${error instanceof Error ? error.message : String(error)}`);
4604
+ }
4605
+ }
4606
+ if (opts.json) {
4607
+ console.log(JSON.stringify({ static: staticReport, engine: engineResult?.report ?? null }, null, 2));
4608
+ }
4609
+ else {
4610
+ console.log((0, unreal_1.formatUnrealValidationReport)(staticReport));
4611
+ if (engineResult) {
4612
+ if (engineResult.processExitMismatch !== undefined) {
4613
+ console.error(`(editor process exited ${engineResult.processExitMismatch}; the report is authoritative — engine exit codes are polluted by error-logged asset loads)`);
4614
+ }
4615
+ const mark = { pass: '✔', fixable: '△', 'creator-action': '✖', unsupported: '⛔' };
4616
+ for (const finding of engineResult.report.findings) {
4617
+ console.log(` ${mark[finding.status] ?? '?'} ${finding.checkId}: ${finding.message}${finding.fix ? ` Fix: ${finding.fix}` : ''}`);
4618
+ }
4619
+ console.log(`Project Doctor verdict: ${engineResult.report.verdict}`);
4620
+ }
4621
+ }
4622
+ // Who-must-act ordinal end to end: static failure is a 1 at minimum, the
4623
+ // engine verdict can only raise it.
4624
+ const staticCode = staticReport.ok ? 0 : 1;
4625
+ const code = Math.max(staticCode, engineResult?.exitCode ?? 0);
4626
+ if (code !== 0)
4627
+ process.exitCode = code;
4628
+ });
4584
4629
  registerUnrealValidationCommand('validate', 'Validate the project and HELIX publish manifest without requiring editor MCP');
4585
4630
  unreal
4586
4631
  .command('package')