oxe-cc 1.7.0 → 1.8.0

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/bin/oxe-cc.js CHANGED
@@ -1527,20 +1527,20 @@ function printOxeHealthDiagnostics(target, c, diagOpts = {}) {
1527
1527
  if (r.eventsSummary) {
1528
1528
  console.log(` ${c ? dim : ''}Tracing:${c ? reset : ''} ${r.eventsSummary.total} evento(s)`);
1529
1529
  }
1530
- if (r.planSelfEvaluation && r.planSelfEvaluation.hasSection) {
1531
- const best = r.planSelfEvaluation.bestPlan || '—';
1532
- const conf =
1533
- typeof r.planSelfEvaluation.confidence === 'number' ? `${r.planSelfEvaluation.confidence}%` : '—';
1534
- console.log(` ${c ? dim : ''}Plano (autoavaliação):${c ? reset : ''} melhor=${best} | confiança=${conf}`);
1535
- }
1536
- if (typeof r.executionRationalityReady === 'boolean') {
1537
- console.log(
1538
- ` ${c ? dim : ''}Prontidão racional:${c ? reset : ''} implementation=${r.implementationPackReady ? 'ok' : 'pendente'} | anchors=${r.referenceAnchorsReady ? 'ok' : 'pendente'} | fixtures=${r.fixturePackReady ? 'ok' : 'pendente'}`
1539
- );
1540
- }
1541
- if (r.contextQuality) {
1542
- console.log(
1543
- ` ${c ? dim : ''}Contexto:${c ? reset : ''} score=${r.contextQuality.primaryScore != null ? r.contextQuality.primaryScore : '—'} | workflow=${r.contextQuality.primaryWorkflow || '—'} | status=${r.contextQuality.primaryStatus || '—'}`
1530
+ if (r.planSelfEvaluation && r.planSelfEvaluation.hasSection) {
1531
+ const best = r.planSelfEvaluation.bestPlan || '—';
1532
+ const conf =
1533
+ typeof r.planSelfEvaluation.confidence === 'number' ? `${r.planSelfEvaluation.confidence}%` : '—';
1534
+ console.log(` ${c ? dim : ''}Plano (autoavaliação):${c ? reset : ''} melhor=${best} | confiança=${conf}`);
1535
+ }
1536
+ if (typeof r.executionRationalityReady === 'boolean') {
1537
+ console.log(
1538
+ ` ${c ? dim : ''}Prontidão racional:${c ? reset : ''} implementation=${r.implementationPackReady ? 'ok' : 'pendente'} | anchors=${r.referenceAnchorsReady ? 'ok' : 'pendente'} | fixtures=${r.fixturePackReady ? 'ok' : 'pendente'}`
1539
+ );
1540
+ }
1541
+ if (r.contextQuality) {
1542
+ console.log(
1543
+ ` ${c ? dim : ''}Contexto:${c ? reset : ''} score=${r.contextQuality.primaryScore != null ? r.contextQuality.primaryScore : '—'} | workflow=${r.contextQuality.primaryWorkflow || '—'} | status=${r.contextQuality.primaryStatus || '—'}`
1544
1544
  );
1545
1545
  }
1546
1546
  if (r.semanticsDrift) {
@@ -1668,11 +1668,11 @@ function runStatusFull(target) {
1668
1668
  sp = oxeHealth.scopedOxePaths(target, activeSession);
1669
1669
  }
1670
1670
 
1671
- printSection('OXE ▸ status --full');
1672
- console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1673
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
1674
- console.log(` ${c ? green : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1675
- console.log(` ${c ? green : ''}Fase:${c ? reset : ''} ${report.phase || '—'}`);
1671
+ printSection('OXE ▸ status --full');
1672
+ console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1673
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
1674
+ console.log(` ${c ? green : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1675
+ console.log(` ${c ? green : ''}Fase:${c ? reset : ''} ${report.phase || '—'}`);
1676
1676
 
1677
1677
  const healthColor = report.healthStatus === 'healthy' ? green : report.healthStatus === 'warning' ? yellow : red;
1678
1678
  console.log(` ${c ? green : ''}Saúde:${c ? reset : ''} ${c ? healthColor : ''}${report.healthStatus}${c ? reset : ''}`);
@@ -1687,6 +1687,14 @@ function runStatusFull(target) {
1687
1687
  console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1688
1688
  }
1689
1689
  }
1690
+ if (report.codex && (report.codex.detected || report.codex.warnings.length)) {
1691
+ console.log(`\n ${c ? yellow : ''}Codex${c ? reset : ''}`);
1692
+ console.log(` ${c ? dim : ''}Prompts:${c ? reset : ''} ${report.codex.commandsReady ? 'ok' : 'pendente'} · ${displayPathForUser(report.codex.promptsDir)}`);
1693
+ console.log(` ${c ? dim : ''}Skills:${c ? reset : ''} ${report.codex.skillsReady ? 'ok' : 'pendente'} · ${displayPathForUser(report.codex.skillsRoot)}`);
1694
+ for (const warning of report.codexWarn.slice(0, 3)) {
1695
+ console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1696
+ }
1697
+ }
1690
1698
 
1691
1699
  // Coverage matrix
1692
1700
  const specPath = activeSession && sp.spec ? sp.spec : p.spec;
@@ -1702,41 +1710,41 @@ function runStatusFull(target) {
1702
1710
  console.log(` ${coverageCell(codebaseExists, 'codebase scan')} ${coverageCell(specExists, 'SPEC.md')} ${coverageCell(planExists, 'PLAN.md')} ${coverageCell(verifyExists, 'VERIFY.md')} ${coverageCell(lessonsExists, 'LESSONS.md')}`);
1703
1711
 
1704
1712
  // Readiness gate
1705
- const packageMode = report.workspaceMode === 'product_package';
1706
- const ready = packageMode
1707
- ? Boolean(report.releaseReadiness && report.releaseReadiness.ok)
1708
- : specExists
1709
- && planExists
1710
- && report.executionRationalityReady
1711
- && !report.planWarn.length
1712
- && !report.runtimeWarn.length;
1713
- const gateColor = ready ? green : yellow;
1714
- console.log(`\n ${c ? yellow : ''}Readiness gate${c ? reset : ''}`);
1715
- console.log(` ${c ? gateColor : ''}${ready ? (packageMode ? '✓ Pronto para publicar' : '✓ Pronto para executar') : (packageMode ? '✗ Não pronto para publicar' : '✗ Não pronto para executar')}${c ? reset : ''}`);
1716
- if (packageMode) {
1717
- const releaseReadiness = report.releaseReadiness || { blockers: [], warnings: [] };
1718
- if (Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1719
- for (const blocker of releaseReadiness.blockers) {
1720
- console.log(` ${c ? red : ''} • ${blocker}${c ? reset : ''}`);
1721
- }
1722
- }
1723
- if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1724
- for (const warning of releaseReadiness.warnings) {
1725
- console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1726
- }
1727
- }
1728
- } else {
1729
- if (!specExists) console.log(` ${c ? dim : ''} • SPEC.md ausente — rode /oxe-spec${c ? reset : ''}`);
1730
- if (!planExists) console.log(` ${c ? dim : ''} • PLAN.md ausente — rode /oxe-plan${c ? reset : ''}`);
1731
- if (report.planWarn.length) {
1732
- for (const w of report.planWarn) {
1733
- console.log(` ${c ? yellow : ''} • ${w}${c ? reset : ''}`);
1734
- }
1735
- }
1736
- if (planExists) {
1737
- console.log(` ${c ? dim : ''} • Artefatos racionais:${c ? reset : ''} implementation=${report.implementationPackReady ? 'ok' : 'pendente'} · anchors=${report.referenceAnchorsReady ? 'ok' : 'pendente'} · fixtures=${report.fixturePackReady ? 'ok' : 'pendente'}`);
1738
- }
1739
- }
1713
+ const packageMode = report.workspaceMode === 'product_package';
1714
+ const ready = packageMode
1715
+ ? Boolean(report.releaseReadiness && report.releaseReadiness.ok)
1716
+ : specExists
1717
+ && planExists
1718
+ && report.executionRationalityReady
1719
+ && !report.planWarn.length
1720
+ && !report.runtimeWarn.length;
1721
+ const gateColor = ready ? green : yellow;
1722
+ console.log(`\n ${c ? yellow : ''}Readiness gate${c ? reset : ''}`);
1723
+ console.log(` ${c ? gateColor : ''}${ready ? (packageMode ? '✓ Pronto para publicar' : '✓ Pronto para executar') : (packageMode ? '✗ Não pronto para publicar' : '✗ Não pronto para executar')}${c ? reset : ''}`);
1724
+ if (packageMode) {
1725
+ const releaseReadiness = report.releaseReadiness || { blockers: [], warnings: [] };
1726
+ if (Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1727
+ for (const blocker of releaseReadiness.blockers) {
1728
+ console.log(` ${c ? red : ''} • ${blocker}${c ? reset : ''}`);
1729
+ }
1730
+ }
1731
+ if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1732
+ for (const warning of releaseReadiness.warnings) {
1733
+ console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1734
+ }
1735
+ }
1736
+ } else {
1737
+ if (!specExists) console.log(` ${c ? dim : ''} • SPEC.md ausente — rode /oxe-spec${c ? reset : ''}`);
1738
+ if (!planExists) console.log(` ${c ? dim : ''} • PLAN.md ausente — rode /oxe-plan${c ? reset : ''}`);
1739
+ if (report.planWarn.length) {
1740
+ for (const w of report.planWarn) {
1741
+ console.log(` ${c ? yellow : ''} • ${w}${c ? reset : ''}`);
1742
+ }
1743
+ }
1744
+ if (planExists) {
1745
+ console.log(` ${c ? dim : ''} • Artefatos racionais:${c ? reset : ''} implementation=${report.implementationPackReady ? 'ok' : 'pendente'} · anchors=${report.referenceAnchorsReady ? 'ok' : 'pendente'} · fixtures=${report.fixturePackReady ? 'ok' : 'pendente'}`);
1746
+ }
1747
+ }
1740
1748
 
1741
1749
  // Active run summary
1742
1750
  if (report.activeRun) {
@@ -1822,24 +1830,24 @@ function runStatusFull(target) {
1822
1830
  }
1823
1831
 
1824
1832
  // Plan self-evaluation
1825
- if (!packageMode && report.planSelfEvaluation) {
1826
- const pse = report.planSelfEvaluation;
1827
- const threshold = report.planConfidenceThreshold || 90;
1828
- console.log(`\n ${c ? yellow : ''}Autoavaliação do plano${c ? reset : ''}`);
1829
- if (pse.best_plan_current != null) {
1830
- const bestColor = pse.best_plan_current ? green : red;
1831
- console.log(` ${c ? dim : ''}Melhor plano atual:${c ? reset : ''} ${c ? bestColor : ''}${pse.best_plan_current ? 'sim' : 'não'}${c ? reset : ''}`);
1832
- }
1833
- if (pse.confidence != null) {
1834
- const confColor = report.planConfidenceExecutable
1835
- ? green
1836
- : Number(pse.confidence) >= Math.max(80, threshold - 10)
1837
- ? yellow
1838
- : red;
1839
- console.log(` ${c ? dim : ''}Confiança:${c ? reset : ''} ${c ? confColor : ''}${pse.confidence}%${c ? reset : ''}`);
1840
- console.log(` ${c ? dim : ''}Gate executável:${c ? reset : ''} > ${threshold}%${pse.executable ? ' (atingido)' : ' (ainda não atingido)'}`);
1841
- }
1842
- }
1833
+ if (!packageMode && report.planSelfEvaluation) {
1834
+ const pse = report.planSelfEvaluation;
1835
+ const threshold = report.planConfidenceThreshold || 90;
1836
+ console.log(`\n ${c ? yellow : ''}Autoavaliação do plano${c ? reset : ''}`);
1837
+ if (pse.best_plan_current != null) {
1838
+ const bestColor = pse.best_plan_current ? green : red;
1839
+ console.log(` ${c ? dim : ''}Melhor plano atual:${c ? reset : ''} ${c ? bestColor : ''}${pse.best_plan_current ? 'sim' : 'não'}${c ? reset : ''}`);
1840
+ }
1841
+ if (pse.confidence != null) {
1842
+ const confColor = report.planConfidenceExecutable
1843
+ ? green
1844
+ : Number(pse.confidence) >= Math.max(80, threshold - 10)
1845
+ ? yellow
1846
+ : red;
1847
+ console.log(` ${c ? dim : ''}Confiança:${c ? reset : ''} ${c ? confColor : ''}${pse.confidence}%${c ? reset : ''}`);
1848
+ console.log(` ${c ? dim : ''}Gate executável:${c ? reset : ''} > ${threshold}%${pse.executable ? ' (atingido)' : ' (ainda não atingido)'}`);
1849
+ }
1850
+ }
1843
1851
 
1844
1852
  console.log(`\n ${c ? dim : ''}Próximo passo:${c ? reset : ''} ${c ? cyan : ''}${report.next && report.next.cursorCmd ? report.next.cursorCmd : '—'}${c ? reset : ''}`);
1845
1853
  console.log(` ${c ? dim : ''}Motivo:${c ? reset : ''} ${report.next && report.next.reason ? report.next.reason : '—'}`);
@@ -1858,13 +1866,13 @@ function runStatus(target, opts = {}) {
1858
1866
  const next = report.next;
1859
1867
 
1860
1868
  if (opts.json) {
1861
- /** @type {Record<string, unknown>} */
1862
- const payload = {
1863
- oxeStatusSchema: 5,
1864
- projectRoot: path.resolve(target),
1865
- workspaceMode: report.workspaceMode || 'oxe_project',
1866
- releaseReadiness: report.releaseReadiness || null,
1867
- nextStep: report.next.step,
1869
+ /** @type {Record<string, unknown>} */
1870
+ const payload = {
1871
+ oxeStatusSchema: 5,
1872
+ projectRoot: path.resolve(target),
1873
+ workspaceMode: report.workspaceMode || 'oxe_project',
1874
+ releaseReadiness: report.releaseReadiness || null,
1875
+ nextStep: report.next.step,
1868
1876
  cursorCmd: report.next.cursorCmd,
1869
1877
  reason: report.next.reason,
1870
1878
  artifacts: report.next.artifacts,
@@ -1873,18 +1881,18 @@ function runStatus(target, opts = {}) {
1873
1881
  activeSession: report.activeSession,
1874
1882
  scanDate: report.scanDate,
1875
1883
  staleScan: report.stale,
1876
- compactDate: report.compactDate,
1877
- staleCompact: report.staleCompact,
1878
- planSelfEvaluation: report.planSelfEvaluation,
1879
- planConfidenceThreshold: report.planConfidenceThreshold,
1880
- planConfidenceExecutable: report.planConfidenceExecutable,
1881
- implementationPackReady: report.implementationPackReady,
1882
- referenceAnchorsReady: report.referenceAnchorsReady,
1883
- fixturePackReady: report.fixturePackReady,
1884
- executionRationalityReady: report.executionRationalityReady,
1885
- criticalExecutionGaps: report.criticalExecutionGaps,
1886
- executionRationality: report.executionRationality,
1887
- planReviewStatus: report.planReviewStatus,
1884
+ compactDate: report.compactDate,
1885
+ staleCompact: report.staleCompact,
1886
+ planSelfEvaluation: report.planSelfEvaluation,
1887
+ planConfidenceThreshold: report.planConfidenceThreshold,
1888
+ planConfidenceExecutable: report.planConfidenceExecutable,
1889
+ implementationPackReady: report.implementationPackReady,
1890
+ referenceAnchorsReady: report.referenceAnchorsReady,
1891
+ fixturePackReady: report.fixturePackReady,
1892
+ executionRationalityReady: report.executionRationalityReady,
1893
+ criticalExecutionGaps: report.criticalExecutionGaps,
1894
+ executionRationality: report.executionRationality,
1895
+ planReviewStatus: report.planReviewStatus,
1888
1896
  activeRun: report.activeRun,
1889
1897
  eventsSummary: report.eventsSummary,
1890
1898
  runtimeMode: report.runtimeMode,
@@ -1909,6 +1917,7 @@ function runStatus(target, opts = {}) {
1909
1917
  azureActive: report.azureActive,
1910
1918
  azure: report.azure,
1911
1919
  copilot: report.copilot,
1920
+ codex: report.codex,
1912
1921
  contextPacks: report.contextPacks,
1913
1922
  contextQuality: report.contextQuality,
1914
1923
  semanticsDrift: report.semanticsDrift,
@@ -1927,6 +1936,7 @@ function runStatus(target, opts = {}) {
1927
1936
  sessionWarnings: report.sessionWarn,
1928
1937
  installWarnings: report.installWarn,
1929
1938
  copilotWarnings: report.copilotWarn,
1939
+ codexWarnings: report.codexWarn,
1930
1940
  contextWarnings: report.contextWarn,
1931
1941
  semanticsWarnings: report.semanticsWarn,
1932
1942
  summaryGapWarning: report.summaryGapWarn,
@@ -1941,10 +1951,10 @@ function runStatus(target, opts = {}) {
1941
1951
  return;
1942
1952
  }
1943
1953
 
1944
- printSection('OXE ▸ status');
1945
- const c = useAnsiColors();
1946
- console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1947
- console.log(` ${c ? dim : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1954
+ printSection('OXE ▸ status');
1955
+ const c = useAnsiColors();
1956
+ console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1957
+ console.log(` ${c ? dim : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1948
1958
 
1949
1959
  const wfTgt = oxeWorkflows.resolveWorkflowsDir(target);
1950
1960
  if (!wfTgt) {
@@ -1962,6 +1972,8 @@ function runStatus(target, opts = {}) {
1962
1972
  const _claudeLocal = path.join(target, 'commands', 'oxe');
1963
1973
  const _claudeGlobal = path.join(require('os').homedir(), '.claude', 'commands');
1964
1974
  ideStatusLines.push(`Claude Code ${fs.existsSync(_claudeLocal) || fs.existsSync(_claudeGlobal) ? (c ? green + '✓' + reset : '✓') : (c ? dim + '✗' + reset : '✗')}`);
1975
+ const _codex = report.codex || oxeHealth.codexIntegrationReport(target);
1976
+ ideStatusLines.push(`Codex ${_codex.commandsReady ? (c ? green + '✓' + reset : '✓') : (c ? dim + '✗' + reset : '✗')}`);
1965
1977
  console.log(`\n ${c ? dim : ''}IDEs:${c ? reset : ''} ${ideStatusLines.join(' ')}`);
1966
1978
 
1967
1979
  // Gates pending in default view
@@ -1975,24 +1987,24 @@ function runStatus(target, opts = {}) {
1975
1987
  }
1976
1988
 
1977
1989
  // Explicit blockage diagnosis
1978
- const packageMode = report.workspaceMode === 'product_package';
1979
- const specMissing = !fs.existsSync(path.join(target, '.oxe', 'SPEC.md'));
1980
- const planMissing = !fs.existsSync(path.join(target, '.oxe', 'PLAN.md'));
1981
- const verifyMissing = !fs.existsSync(path.join(target, '.oxe', 'VERIFY.md'));
1982
- if (packageMode) {
1983
- const releaseReadiness = report.releaseReadiness || { ok: false, blockers: [], warnings: [] };
1984
- if (!releaseReadiness.ok && Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1985
- console.log(` ${c ? yellow : ''}⚠ Release blockers:${c ? reset : ''} ${releaseReadiness.blockers[0]}`);
1986
- } else if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1987
- console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} release warnings ativas — ${releaseReadiness.warnings[0]}`);
1988
- }
1989
- } else if (specMissing) {
1990
- console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} SPEC.md ausente — rode ${c ? cyan : ''}/oxe-spec${c ? reset : ''} antes de planejar`);
1991
- } else if (planMissing) {
1992
- console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} PLAN.md ausente — rode ${c ? cyan : ''}/oxe-plan${c ? reset : ''}`);
1993
- } else if (verifyMissing && !planMissing) {
1994
- console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} VERIFY.md ainda não gerado — rode ${c ? cyan : ''}/oxe-verify${c ? reset : ''} após executar`);
1995
- }
1990
+ const packageMode = report.workspaceMode === 'product_package';
1991
+ const specMissing = !fs.existsSync(path.join(target, '.oxe', 'SPEC.md'));
1992
+ const planMissing = !fs.existsSync(path.join(target, '.oxe', 'PLAN.md'));
1993
+ const verifyMissing = !fs.existsSync(path.join(target, '.oxe', 'VERIFY.md'));
1994
+ if (packageMode) {
1995
+ const releaseReadiness = report.releaseReadiness || { ok: false, blockers: [], warnings: [] };
1996
+ if (!releaseReadiness.ok && Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1997
+ console.log(` ${c ? yellow : ''}⚠ Release blockers:${c ? reset : ''} ${releaseReadiness.blockers[0]}`);
1998
+ } else if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1999
+ console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} release warnings ativas — ${releaseReadiness.warnings[0]}`);
2000
+ }
2001
+ } else if (specMissing) {
2002
+ console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} SPEC.md ausente — rode ${c ? cyan : ''}/oxe-spec${c ? reset : ''} antes de planejar`);
2003
+ } else if (planMissing) {
2004
+ console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} PLAN.md ausente — rode ${c ? cyan : ''}/oxe-plan${c ? reset : ''}`);
2005
+ } else if (verifyMissing && !planMissing) {
2006
+ console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} VERIFY.md ainda não gerado — rode ${c ? cyan : ''}/oxe-verify${c ? reset : ''} após executar`);
2007
+ }
1996
2008
 
1997
2009
  if (opts.hints) {
1998
2010
  console.log(`\n ${c ? cyan : ''}Lembretes (rotina OXE)${reset}`);
@@ -2195,6 +2207,9 @@ function runDoctor(target, options = {}) {
2195
2207
  const claudeReady = fs.existsSync(claudeLocalDir) || fs.existsSync(claudeGlobalDir);
2196
2208
  ideChecks.push({ label: 'Claude Code', ready: claudeReady, hint: 'commands/oxe/ ou ~/.claude/commands/' });
2197
2209
 
2210
+ const codexReport = oxeHealth.codexIntegrationReport(target);
2211
+ ideChecks.push({ label: 'Codex', ready: codexReport.commandsReady, hint: '~/.codex/prompts/oxe.md' });
2212
+
2198
2213
  for (const ide of ideChecks) {
2199
2214
  if (ide.ready) {
2200
2215
  console.log(`${c ? green : ''}OK${c ? reset : ''} ${ide.label} pronto (${ide.hint})`);
@@ -2730,14 +2745,14 @@ function runInstall(opts) {
2730
2745
  copyDir(path.join(PKG_ROOT, 'oxe', 'templates'), path.join(nested, 'templates'), copyOpts, true);
2731
2746
  // Personas: copiar para .oxe/personas/ (não sobrescreve personalizações do projeto)
2732
2747
  const personasSrc = path.join(PKG_ROOT, 'oxe', 'personas');
2733
- if (fs.existsSync(personasSrc)) {
2734
- copyDir(personasSrc, path.join(nested, 'personas'), copyOpts, false);
2735
- }
2736
- const agentsSrc = path.join(PKG_ROOT, 'oxe', 'agents');
2737
- if (fs.existsSync(agentsSrc)) {
2738
- copyDir(agentsSrc, path.join(nested, 'agents'), copyOpts, false);
2739
- }
2740
- // Schemas: copiar para .oxe/schemas/ (ex.: plan-agents.schema.json para validação local)
2748
+ if (fs.existsSync(personasSrc)) {
2749
+ copyDir(personasSrc, path.join(nested, 'personas'), copyOpts, false);
2750
+ }
2751
+ const agentsSrc = path.join(PKG_ROOT, 'oxe', 'agents');
2752
+ if (fs.existsSync(agentsSrc)) {
2753
+ copyDir(agentsSrc, path.join(nested, 'agents'), copyOpts, false);
2754
+ }
2755
+ // Schemas: copiar para .oxe/schemas/ (ex.: plan-agents.schema.json para validação local)
2741
2756
  const schemasSrc = path.join(PKG_ROOT, 'oxe', 'schemas');
2742
2757
  if (fs.existsSync(schemasSrc)) {
2743
2758
  copyDir(schemasSrc, path.join(nested, 'schemas'), copyOpts, false);
@@ -2752,11 +2767,11 @@ function runInstall(opts) {
2752
2767
  if (fs.existsSync(cRules)) copyDir(cRules, path.join(cursorBase, 'rules'), copyOpts, idePathRewrite);
2753
2768
  }
2754
2769
 
2755
- const doAgentClis = opts.copilotCli || opts.allAgents;
2756
- if (doAgentClis) {
2757
- const cCmd = path.join(PKG_ROOT, '.cursor', 'commands');
2758
- const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2759
- const clBase = installClaudeBase(opts);
2770
+ const doAgentClis = opts.copilotCli || opts.allAgents;
2771
+ if (doAgentClis) {
2772
+ const cCmd = path.join(PKG_ROOT, '.cursor', 'commands');
2773
+ const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2774
+ const clBase = installClaudeBase(opts);
2760
2775
  const cpHome = installCopilotCliHome(opts);
2761
2776
  const clDest = path.join(clBase, 'commands');
2762
2777
  const cpCmdDest = path.join(cpHome, 'commands');
@@ -2765,24 +2780,24 @@ function runInstall(opts) {
2765
2780
  console.log(
2766
2781
  ` ${c ? green : ''}cli${c ? reset : ''} ${c ? dim : ''}Claude/Copilot: skills em${c ? reset : ''} ${c ? cyan : ''}${cpSkills}${c ? reset : ''} ${c ? dim : ''}(/oxe, /oxe-scan, …); comandos .md:${c ? reset : ''} ${c ? cyan : ''}${clDest}${c ? reset : ''} ${c ? dim : ''}+${c ? reset : ''} ${c ? cyan : ''}${cpCmdDest}${c ? reset : ''}`
2767
2782
  );
2768
- installOxeCopilotCliSkills(cCmd, cpHome, copyOpts, idePathRewrite);
2769
- copyDir(cCmd, clDest, copyOpts, idePathRewrite);
2770
- copyDir(cCmd, cpCmdDest, copyOpts, idePathRewrite);
2771
- if (fs.existsSync(canonicalAgents)) {
2772
- oxeAgentInstall.installCanonicalAgentMarkdowns(
2773
- canonicalAgents,
2774
- agentPaths.claudeAgentsDir,
2775
- copyOpts
2776
- );
2777
- }
2778
- } else {
2783
+ installOxeCopilotCliSkills(cCmd, cpHome, copyOpts, idePathRewrite);
2784
+ copyDir(cCmd, clDest, copyOpts, idePathRewrite);
2785
+ copyDir(cCmd, cpCmdDest, copyOpts, idePathRewrite);
2786
+ if (fs.existsSync(canonicalAgents)) {
2787
+ oxeAgentInstall.installCanonicalAgentMarkdowns(
2788
+ canonicalAgents,
2789
+ agentPaths.claudeAgentsDir,
2790
+ copyOpts
2791
+ );
2792
+ }
2793
+ } else {
2779
2794
  console.warn(`${yellow}aviso:${reset} pasta ausente ${cCmd} — ignorando comandos CLI`);
2780
2795
  }
2781
2796
  }
2782
2797
 
2783
- const cCmdAgents = path.join(PKG_ROOT, '.cursor', 'commands');
2784
- const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2785
- if (fs.existsSync(cCmdAgents) && (opts.allAgents || anyGranularAgent(opts))) {
2798
+ const cCmdAgents = path.join(PKG_ROOT, '.cursor', 'commands');
2799
+ const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2800
+ if (fs.existsSync(cCmdAgents) && (opts.allAgents || anyGranularAgent(opts))) {
2786
2801
  const logO = (d) => console.log(`${dim}omitido${reset} ${d} (já existe — use --force)`);
2787
2802
  const logW = (msg) => console.log(`${dim}agents${reset} ${msg}`);
2788
2803
  console.log(
@@ -2800,41 +2815,41 @@ function runInstall(opts) {
2800
2815
  if (opts.agentCodex || opts.allAgents) {
2801
2816
  oxeAgentInstall.installCodexPrompts(cCmdAgents, agentPaths, copyOpts, idePathRewrite, logO, logW);
2802
2817
  }
2803
- if (opts.agentAntigravity || opts.allAgents) {
2804
- oxeAgentInstall.installSkillTreeFromCursorCommands(
2818
+ if (opts.agentAntigravity || opts.allAgents) {
2819
+ oxeAgentInstall.installSkillTreeFromCursorCommands(
2805
2820
  cCmdAgents,
2806
2821
  agentPaths.antigravitySkillsRoot,
2807
2822
  copyOpts,
2808
2823
  idePathRewrite,
2809
2824
  logO,
2810
- logW
2811
- );
2812
- oxeAgentInstall.installCanonicalAgentSkills(
2813
- canonicalAgents,
2814
- agentPaths.antigravitySkillsRoot,
2815
- copyOpts,
2816
- logO,
2817
- logW
2818
- );
2819
- }
2820
- if (opts.agentCodex || opts.allAgents) {
2821
- oxeAgentInstall.installSkillTreeFromCursorCommands(
2825
+ logW
2826
+ );
2827
+ oxeAgentInstall.installCanonicalAgentSkills(
2828
+ canonicalAgents,
2829
+ agentPaths.antigravitySkillsRoot,
2830
+ copyOpts,
2831
+ logO,
2832
+ logW
2833
+ );
2834
+ }
2835
+ if (opts.agentCodex || opts.allAgents) {
2836
+ oxeAgentInstall.installSkillTreeFromCursorCommands(
2822
2837
  cCmdAgents,
2823
2838
  agentPaths.codexAgentsSkillsRoot,
2824
2839
  copyOpts,
2825
2840
  idePathRewrite,
2826
2841
  logO,
2827
- logW
2828
- );
2829
- oxeAgentInstall.installCanonicalAgentSkills(
2830
- canonicalAgents,
2831
- agentPaths.codexAgentsSkillsRoot,
2832
- copyOpts,
2833
- logO,
2834
- logW
2835
- );
2836
- }
2837
- }
2842
+ logW
2843
+ );
2844
+ oxeAgentInstall.installCanonicalAgentSkills(
2845
+ canonicalAgents,
2846
+ agentPaths.codexAgentsSkillsRoot,
2847
+ copyOpts,
2848
+ logO,
2849
+ logW
2850
+ );
2851
+ }
2852
+ }
2838
2853
 
2839
2854
  if (opts.copilot) {
2840
2855
  const gh = path.join(PKG_ROOT, '.github');
@@ -2924,11 +2939,11 @@ function runInstall(opts) {
2924
2939
  addTracked(copilotPromptsDirPath(opts), (n) => n.startsWith('oxe-'));
2925
2940
  trackFile(copilotWorkspaceManifestPath(opts));
2926
2941
  }
2927
- trackFile(runtimeSemanticsManifestPath(opts));
2928
- if (opts.copilotCli || opts.allAgents) {
2929
- addTracked(path.join(installClaudeBase(opts), 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2930
- addTracked(agentPaths.claudeAgentsDir, (n) => oxeAgentInstall.isOxeAgentMarkdownName(n));
2931
- addTracked(path.join(cpCliHome, 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2942
+ trackFile(runtimeSemanticsManifestPath(opts));
2943
+ if (opts.copilotCli || opts.allAgents) {
2944
+ addTracked(path.join(installClaudeBase(opts), 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2945
+ addTracked(agentPaths.claudeAgentsDir, (n) => oxeAgentInstall.isOxeAgentMarkdownName(n));
2946
+ addTracked(path.join(cpCliHome, 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2932
2947
  const skRoot = path.join(cpCliHome, 'skills');
2933
2948
  if (fs.existsSync(skRoot)) {
2934
2949
  for (const sub of fs.readdirSync(skRoot, { withFileTypes: true })) {
@@ -3064,8 +3079,8 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
3064
3079
  track(manifest);
3065
3080
  }
3066
3081
 
3067
- if (u.copilotCli || u.allAgents) {
3068
- for (const base of [path.join(proj, '.claude'), path.join(proj, '.copilot')]) {
3082
+ if (u.copilotCli || u.allAgents) {
3083
+ for (const base of [path.join(proj, '.claude'), path.join(proj, '.copilot')]) {
3069
3084
  const cmdDir = path.join(base, 'commands');
3070
3085
  if (!fs.existsSync(cmdDir)) continue;
3071
3086
  for (const name of fs.readdirSync(cmdDir)) {
@@ -3074,19 +3089,19 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
3074
3089
  unlinkQuiet(p, u);
3075
3090
  track(p);
3076
3091
  }
3077
- }
3078
- }
3079
- const claudeAgentsDir = path.join(proj, '.claude', 'agents');
3080
- if (fs.existsSync(claudeAgentsDir)) {
3081
- for (const name of fs.readdirSync(claudeAgentsDir)) {
3082
- if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3083
- const p = path.join(claudeAgentsDir, name);
3084
- unlinkQuiet(p, u);
3085
- track(p);
3086
- }
3087
- }
3088
- }
3089
- const skillsRoot = path.join(proj, '.copilot', 'skills');
3092
+ }
3093
+ }
3094
+ const claudeAgentsDir = path.join(proj, '.claude', 'agents');
3095
+ if (fs.existsSync(claudeAgentsDir)) {
3096
+ for (const name of fs.readdirSync(claudeAgentsDir)) {
3097
+ if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3098
+ const p = path.join(claudeAgentsDir, name);
3099
+ unlinkQuiet(p, u);
3100
+ track(p);
3101
+ }
3102
+ }
3103
+ }
3104
+ const skillsRoot = path.join(proj, '.copilot', 'skills');
3090
3105
  if (fs.existsSync(skillsRoot)) {
3091
3106
  for (const ent of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
3092
3107
  if (!ent.isDirectory() || !/^oxe($|-)/.test(ent.name)) continue;
@@ -3409,8 +3424,8 @@ function runUninstall(u) {
3409
3424
  cleanupLegacyCopilotVsCode(ideOpts, u, removedPaths);
3410
3425
  }
3411
3426
 
3412
- if (u.copilotCli) {
3413
- for (const base of [claudeUserDir(ideOpts), copilotUserDir(ideOpts)]) {
3427
+ if (u.copilotCli) {
3428
+ for (const base of [claudeUserDir(ideOpts), copilotUserDir(ideOpts)]) {
3414
3429
  const cmdDir = path.join(base, 'commands');
3415
3430
  if (!fs.existsSync(cmdDir)) continue;
3416
3431
  for (const name of fs.readdirSync(cmdDir)) {
@@ -3419,19 +3434,19 @@ function runUninstall(u) {
3419
3434
  unlinkQuiet(p, u);
3420
3435
  removedPaths.push(p);
3421
3436
  }
3422
- }
3423
- }
3424
- const claudeAgentsDir = path.join(claudeUserDir(ideOpts), 'agents');
3425
- if (fs.existsSync(claudeAgentsDir)) {
3426
- for (const name of fs.readdirSync(claudeAgentsDir)) {
3427
- if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3428
- const p = path.join(claudeAgentsDir, name);
3429
- unlinkQuiet(p, u);
3430
- removedPaths.push(p);
3431
- }
3432
- }
3433
- }
3434
- const skillsRoot = path.join(copilotUserDir(ideOpts), 'skills');
3437
+ }
3438
+ }
3439
+ const claudeAgentsDir = path.join(claudeUserDir(ideOpts), 'agents');
3440
+ if (fs.existsSync(claudeAgentsDir)) {
3441
+ for (const name of fs.readdirSync(claudeAgentsDir)) {
3442
+ if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3443
+ const p = path.join(claudeAgentsDir, name);
3444
+ unlinkQuiet(p, u);
3445
+ removedPaths.push(p);
3446
+ }
3447
+ }
3448
+ }
3449
+ const skillsRoot = path.join(copilotUserDir(ideOpts), 'skills');
3435
3450
  if (fs.existsSync(skillsRoot)) {
3436
3451
  for (const ent of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
3437
3452
  if (!ent.isDirectory() || !/^oxe($|-)/.test(ent.name)) continue;
@@ -4581,6 +4596,35 @@ async function runRuntime(opts) {
4581
4596
  }
4582
4597
  }
4583
4598
 
4599
+ if (opts.action === 'execute') {
4600
+ try {
4601
+ const result = await oxeOperational.runRuntimeExecute(opts.dir, activeSession, {
4602
+ runId: opts.runId || undefined,
4603
+ heartbeatTimeoutMs: opts.heartbeatTimeoutMs || undefined,
4604
+ });
4605
+ if (opts.jsonOutput) {
4606
+ console.log(JSON.stringify(result, null, 2));
4607
+ if (result.result && result.result.failed && result.result.failed.length > 0) process.exitCode = 1;
4608
+ return;
4609
+ }
4610
+ const r = result.result || {};
4611
+ const completed = Array.isArray(r.completed) ? r.completed : [];
4612
+ const failed = Array.isArray(r.failed) ? r.failed : [];
4613
+ const blocked = Array.isArray(r.blocked) ? r.blocked : [];
4614
+ console.log(` ${c ? green : ''}✓${c ? reset : ''} Runtime execute concluído (modo: ${result.mode})`);
4615
+ console.log(` ${c ? green : ''}Completados:${c ? reset : ''} ${completed.length}`);
4616
+ if (failed.length > 0)
4617
+ console.log(` ${c ? red : ''}Falhos:${c ? reset : ''} ${failed.length} — ${failed.join(', ')}`);
4618
+ if (blocked.length > 0)
4619
+ console.log(` ${c ? '\x1b[33m' : ''}Bloqueados:${c ? reset : ''} ${blocked.length} — ${blocked.join(', ')}`);
4620
+ if (failed.length > 0) process.exitCode = 1;
4621
+ return;
4622
+ } catch (err) {
4623
+ console.error(`${red}${err && err.message ? err.message : 'Falha ao executar runtime.'}${reset}`);
4624
+ process.exit(1);
4625
+ }
4626
+ }
4627
+
4584
4628
  if (opts.action === 'ci') {
4585
4629
  try {
4586
4630
  const report = await oxeOperational.runRuntimeCiChecks(opts.dir, activeSession, {