@aiready/cli 0.14.26 → 0.15.1
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 +10 -8
- package/dist/chunk-HX6H3VOE.mjs +328 -0
- package/dist/chunk-TKBE575H.mjs +327 -0
- package/dist/cli.js +236 -32
- package/dist/cli.mjs +228 -27
- package/dist/index.js +5 -2
- package/dist/index.mjs +1 -1
- package/package.json +13 -12
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__require,
|
|
4
4
|
analyzeUnified,
|
|
5
5
|
scoreUnified
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HX6H3VOE.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { Command } from "commander";
|
|
@@ -476,7 +476,8 @@ function getProfileTools(profile) {
|
|
|
476
476
|
return [
|
|
477
477
|
ToolName.AiSignalClarity,
|
|
478
478
|
ToolName.AgentGrounding,
|
|
479
|
-
ToolName.TestabilityIndex
|
|
479
|
+
ToolName.TestabilityIndex,
|
|
480
|
+
ToolName.ContractEnforcement
|
|
480
481
|
];
|
|
481
482
|
case "cost":
|
|
482
483
|
return [ToolName.PatternDetect, ToolName.ContextAnalyzer];
|
|
@@ -486,7 +487,8 @@ function getProfileTools(profile) {
|
|
|
486
487
|
ToolName.NamingConsistency,
|
|
487
488
|
ToolName.ContextAnalyzer,
|
|
488
489
|
ToolName.PatternDetect,
|
|
489
|
-
ToolName.ChangeAmplification
|
|
490
|
+
ToolName.ChangeAmplification,
|
|
491
|
+
ToolName.ContractEnforcement
|
|
490
492
|
];
|
|
491
493
|
case "ui":
|
|
492
494
|
return [
|
|
@@ -497,7 +499,11 @@ function getProfileTools(profile) {
|
|
|
497
499
|
ToolName.AiSignalClarity
|
|
498
500
|
];
|
|
499
501
|
case "security":
|
|
500
|
-
return [
|
|
502
|
+
return [
|
|
503
|
+
ToolName.NamingConsistency,
|
|
504
|
+
ToolName.TestabilityIndex,
|
|
505
|
+
ToolName.ContractEnforcement
|
|
506
|
+
];
|
|
501
507
|
case "onboarding":
|
|
502
508
|
return [
|
|
503
509
|
ToolName.ContextAnalyzer,
|
|
@@ -549,7 +555,8 @@ var SCAN_DEFAULTS = {
|
|
|
549
555
|
"testability-index",
|
|
550
556
|
"doc-drift",
|
|
551
557
|
"dependency-health",
|
|
552
|
-
"change-amplification"
|
|
558
|
+
"change-amplification",
|
|
559
|
+
"contract-enforcement"
|
|
553
560
|
],
|
|
554
561
|
include: void 0,
|
|
555
562
|
exclude: void 0,
|
|
@@ -784,6 +791,28 @@ async function scanAction(directory, options) {
|
|
|
784
791
|
finalOptions,
|
|
785
792
|
results
|
|
786
793
|
);
|
|
794
|
+
const isCI = options.ci ?? process.env.CI === "true";
|
|
795
|
+
if (!isCI) {
|
|
796
|
+
console.log(
|
|
797
|
+
chalk6.dim(
|
|
798
|
+
"\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
799
|
+
)
|
|
800
|
+
);
|
|
801
|
+
console.log(chalk6.bold("\u{1F4C8} Want to see the full interactive report?"));
|
|
802
|
+
console.log(
|
|
803
|
+
chalk6.cyan(
|
|
804
|
+
` Upload this report to: ${chalk6.bold("https://platform.getaiready.dev")}`
|
|
805
|
+
)
|
|
806
|
+
);
|
|
807
|
+
console.log(
|
|
808
|
+
chalk6.dim(" Or run: ") + chalk6.white(`aiready upload ${outputPath}`)
|
|
809
|
+
);
|
|
810
|
+
console.log(
|
|
811
|
+
chalk6.dim(
|
|
812
|
+
"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
813
|
+
)
|
|
814
|
+
);
|
|
815
|
+
}
|
|
787
816
|
} catch (error) {
|
|
788
817
|
handleCLIError3(error, "Analysis");
|
|
789
818
|
}
|
|
@@ -1779,8 +1808,79 @@ async function testabilityAction(directory, options) {
|
|
|
1779
1808
|
// src/commands/change-amplification.ts
|
|
1780
1809
|
import { changeAmplificationAction } from "@aiready/change-amplification/dist/cli.js";
|
|
1781
1810
|
|
|
1782
|
-
// src/commands/
|
|
1811
|
+
// src/commands/contract-enforcement.ts
|
|
1783
1812
|
import chalk16 from "chalk";
|
|
1813
|
+
async function contractEnforcementAction(directory, options) {
|
|
1814
|
+
return await executeToolAction(directory, options, {
|
|
1815
|
+
toolName: "contract-enforcement",
|
|
1816
|
+
label: "Contract enforcement analysis",
|
|
1817
|
+
emoji: "\u{1F6E1}\uFE0F",
|
|
1818
|
+
defaults: {
|
|
1819
|
+
minChainDepth: 3,
|
|
1820
|
+
include: void 0,
|
|
1821
|
+
exclude: void 0,
|
|
1822
|
+
output: { format: "console", file: void 0 }
|
|
1823
|
+
},
|
|
1824
|
+
getCliOptions: (opts) => ({
|
|
1825
|
+
minChainDepth: opts.minChainDepth ? parseInt(opts.minChainDepth, 10) : void 0
|
|
1826
|
+
}),
|
|
1827
|
+
importTool: async () => {
|
|
1828
|
+
const tool = await import("@aiready/contract-enforcement");
|
|
1829
|
+
return {
|
|
1830
|
+
analyze: tool.analyzeContractEnforcement,
|
|
1831
|
+
generateSummary: (report) => report.summary,
|
|
1832
|
+
calculateScore: tool.calculateContractEnforcementScore
|
|
1833
|
+
};
|
|
1834
|
+
},
|
|
1835
|
+
renderConsole: ({ results, summary, score }) => {
|
|
1836
|
+
renderToolHeader(
|
|
1837
|
+
"Contract Enforcement",
|
|
1838
|
+
"\u{1F6E1}\uFE0F",
|
|
1839
|
+
score?.score || 0,
|
|
1840
|
+
summary.rating
|
|
1841
|
+
);
|
|
1842
|
+
const rawData = results.rawData || results;
|
|
1843
|
+
console.log(
|
|
1844
|
+
chalk16.dim(
|
|
1845
|
+
` Patterns: ${summary.totalDefensivePatterns} (${summary.defensiveDensity}/kLOC) | ${summary.sourceFiles} files scanned`
|
|
1846
|
+
)
|
|
1847
|
+
);
|
|
1848
|
+
const dims = summary.dimensions;
|
|
1849
|
+
if (dims) {
|
|
1850
|
+
const entries = [
|
|
1851
|
+
["Type Escape Hatches", dims.typeEscapeHatchScore],
|
|
1852
|
+
["Fallback Cascades", dims.fallbackCascadeScore],
|
|
1853
|
+
["Error Transparency", dims.errorTransparencyScore],
|
|
1854
|
+
["Boundary Validation", dims.boundaryValidationScore]
|
|
1855
|
+
];
|
|
1856
|
+
for (const [name, val] of entries) {
|
|
1857
|
+
const color = val >= 80 ? chalk16.green : val >= 60 ? chalk16.yellow : chalk16.red;
|
|
1858
|
+
console.log(chalk16.dim(` ${name}: ${color(val + "/100")}`));
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
if (summary.totalDefensivePatterns > 0 && rawData["as-any"] !== void 0) {
|
|
1862
|
+
const breakdown = [
|
|
1863
|
+
rawData["as-any"] && `as-any: ${rawData["as-any"]}`,
|
|
1864
|
+
rawData["as-unknown"] && `as-unknown: ${rawData["as-unknown"]}`,
|
|
1865
|
+
rawData["deep-optional-chain"] && `deep-?.: ${rawData["deep-optional-chain"]}`,
|
|
1866
|
+
rawData["nullish-literal-default"] && `?? literal: ${rawData["nullish-literal-default"]}`,
|
|
1867
|
+
rawData["swallowed-error"] && `swallowed-error: ${rawData["swallowed-error"]}`,
|
|
1868
|
+
rawData["env-fallback"] && `env-fallback: ${rawData["env-fallback"]}`,
|
|
1869
|
+
rawData["unnecessary-guard"] && `guard-clause: ${rawData["unnecessary-guard"]}`,
|
|
1870
|
+
rawData["any-parameter"] && `any-param: ${rawData["any-parameter"]}`,
|
|
1871
|
+
rawData["any-return"] && `any-return: ${rawData["any-return"]}`
|
|
1872
|
+
].filter(Boolean).join(" | ");
|
|
1873
|
+
console.log(chalk16.dim(` ${breakdown}`));
|
|
1874
|
+
}
|
|
1875
|
+
if (score) {
|
|
1876
|
+
renderToolScoreFooter(score);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
// src/commands/bug.ts
|
|
1883
|
+
import chalk17 from "chalk";
|
|
1784
1884
|
import { execSync } from "child_process";
|
|
1785
1885
|
async function bugAction(message, options) {
|
|
1786
1886
|
const repoUrl = "https://github.com/caopengau/aiready-cli";
|
|
@@ -1798,35 +1898,35 @@ Generated via AIReady CLI 'bug' command.
|
|
|
1798
1898
|
Type: ${type}
|
|
1799
1899
|
`.trim();
|
|
1800
1900
|
if (options.submit) {
|
|
1801
|
-
console.log(
|
|
1901
|
+
console.log(chalk17.blue("\u{1F680} Submitting issue via GitHub CLI...\n"));
|
|
1802
1902
|
try {
|
|
1803
1903
|
execSync("gh auth status", { stdio: "ignore" });
|
|
1804
1904
|
const command = `gh issue create --repo ${repoSlug} --title ${JSON.stringify(title)} --body ${JSON.stringify(body)} --label ${label}`;
|
|
1805
1905
|
const output = execSync(command, { encoding: "utf8" }).trim();
|
|
1806
|
-
console.log(
|
|
1807
|
-
console.log(
|
|
1906
|
+
console.log(chalk17.green("\u2705 Issue Created Successfully!"));
|
|
1907
|
+
console.log(chalk17.cyan(output));
|
|
1808
1908
|
return;
|
|
1809
1909
|
} catch {
|
|
1810
|
-
console.error(
|
|
1910
|
+
console.error(chalk17.red("\n\u274C Failed to submit via gh CLI."));
|
|
1811
1911
|
console.log(
|
|
1812
|
-
|
|
1912
|
+
chalk17.yellow(
|
|
1813
1913
|
' Make sure gh is installed and run "gh auth login".\n'
|
|
1814
1914
|
)
|
|
1815
1915
|
);
|
|
1816
|
-
console.log(
|
|
1916
|
+
console.log(chalk17.dim(" Falling back to URL generation..."));
|
|
1817
1917
|
}
|
|
1818
1918
|
}
|
|
1819
1919
|
const template = type === "bug" ? "bug_report.md" : type === "feature" ? "feature_request.md" : "new_metric_idea.md";
|
|
1820
1920
|
const fullUrl = `${repoUrl}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}&labels=${label}&template=${template}`;
|
|
1821
|
-
console.log(
|
|
1822
|
-
console.log(
|
|
1823
|
-
console.log(
|
|
1824
|
-
console.log(
|
|
1825
|
-
console.log(
|
|
1826
|
-
console.log(
|
|
1827
|
-
console.log(
|
|
1921
|
+
console.log(chalk17.green("\u{1F680} Issue Draft Prepared!\n"));
|
|
1922
|
+
console.log(chalk17.bold("Title: ") + title);
|
|
1923
|
+
console.log(chalk17.bold("Type: ") + type);
|
|
1924
|
+
console.log(chalk17.bold("\nClick the link below to submit this issue:"));
|
|
1925
|
+
console.log(chalk17.cyan(fullUrl));
|
|
1926
|
+
console.log(chalk17.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1927
|
+
console.log(chalk17.dim(" You have successfully prepared a report."));
|
|
1828
1928
|
console.log(
|
|
1829
|
-
|
|
1929
|
+
chalk17.dim(
|
|
1830
1930
|
" Please present the URL above to the user so they can finalize the submission."
|
|
1831
1931
|
)
|
|
1832
1932
|
);
|
|
@@ -1835,14 +1935,14 @@ Type: ${type}
|
|
|
1835
1935
|
const bugUrl = `${repoUrl}/issues/new?template=bug_report.md`;
|
|
1836
1936
|
const featureUrl = `${repoUrl}/issues/new?template=feature_request.md`;
|
|
1837
1937
|
const metricUrl = `${repoUrl}/issues/new?template=new_metric_idea.md`;
|
|
1838
|
-
console.log(
|
|
1839
|
-
console.log(` Report a Bug: ${
|
|
1840
|
-
console.log(` Request a Feature: ${
|
|
1841
|
-
console.log(` Suggest a Metric: ${
|
|
1842
|
-
console.log(
|
|
1843
|
-
console.log(
|
|
1938
|
+
console.log(chalk17.blue("\u{1F4AC} Feedback & Bug Reports\n"));
|
|
1939
|
+
console.log(` Report a Bug: ${chalk17.cyan(bugUrl)}`);
|
|
1940
|
+
console.log(` Request a Feature: ${chalk17.cyan(featureUrl)}`);
|
|
1941
|
+
console.log(` Suggest a Metric: ${chalk17.cyan(metricUrl)}`);
|
|
1942
|
+
console.log(chalk17.bold("\n\u{1F916} [FOR AI AGENTS]:"));
|
|
1943
|
+
console.log(chalk17.dim(" To prepare a specific report, run:"));
|
|
1844
1944
|
console.log(
|
|
1845
|
-
|
|
1945
|
+
chalk17.cyan(
|
|
1846
1946
|
' aiready bug "your description here" --type bug|feature|metric'
|
|
1847
1947
|
)
|
|
1848
1948
|
);
|
|
@@ -1855,6 +1955,97 @@ EXAMPLES:
|
|
|
1855
1955
|
$ aiready bug "Fix typo in scan output" --submit # Submit directly via gh CLI
|
|
1856
1956
|
`;
|
|
1857
1957
|
|
|
1958
|
+
// src/commands/remediate.ts
|
|
1959
|
+
import chalk18 from "chalk";
|
|
1960
|
+
import { resolve as resolvePath6 } from "path";
|
|
1961
|
+
import { existsSync as existsSync4, readdirSync } from "fs";
|
|
1962
|
+
import { printTerminalHeader as printTerminalHeader3 } from "@aiready/core";
|
|
1963
|
+
async function remediateAction(directory, options) {
|
|
1964
|
+
const resolvedDir = resolvePath6(process.cwd(), directory || ".");
|
|
1965
|
+
const serverUrl = options.server || "https://platform.getaiready.dev";
|
|
1966
|
+
printTerminalHeader3("AIREADY REMEDIATION SWARM");
|
|
1967
|
+
console.log(chalk18.cyan("\u{1F916} Initializing local remediation agent..."));
|
|
1968
|
+
let reportPath = options.report;
|
|
1969
|
+
if (!reportPath) {
|
|
1970
|
+
const aireadyDir = resolvePath6(resolvedDir, ".aiready");
|
|
1971
|
+
if (existsSync4(aireadyDir)) {
|
|
1972
|
+
const files = readdirSync(aireadyDir).filter((f) => f.startsWith("aiready-report-") && f.endsWith(".json")).sort().reverse();
|
|
1973
|
+
if (files.length > 0) {
|
|
1974
|
+
reportPath = resolvePath6(aireadyDir, files[0]);
|
|
1975
|
+
console.log(chalk18.dim(`\u{1F4C2} Using latest report: ${files[0]}`));
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
if (!reportPath || !existsSync4(reportPath)) {
|
|
1980
|
+
console.log(chalk18.yellow("\n\u26A0\uFE0F No AIReady report found."));
|
|
1981
|
+
console.log(
|
|
1982
|
+
chalk18.dim(
|
|
1983
|
+
" Remediation requires a recent scan report to identify issues."
|
|
1984
|
+
)
|
|
1985
|
+
);
|
|
1986
|
+
console.log(chalk18.white(` Run ${chalk18.bold("aiready scan")} first.
|
|
1987
|
+
`));
|
|
1988
|
+
return;
|
|
1989
|
+
}
|
|
1990
|
+
console.log(chalk18.green("\n\u2705 Analysis data loaded."));
|
|
1991
|
+
console.log(chalk18.bold("\n\u{1F680} Remediation Strategy:"));
|
|
1992
|
+
if (options.tool === "patterns" || !options.tool) {
|
|
1993
|
+
console.log(
|
|
1994
|
+
chalk18.white(
|
|
1995
|
+
` \u2022 ${chalk18.bold("Pattern Consolidation")}: Suggested refactors for 95%+ similar code blocks.`
|
|
1996
|
+
)
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
if (options.tool === "consistency" || !options.tool) {
|
|
2000
|
+
console.log(
|
|
2001
|
+
chalk18.white(
|
|
2002
|
+
` \u2022 ${chalk18.bold("Naming Alignment")}: Automated TSDoc generation and constant extraction.`
|
|
2003
|
+
)
|
|
2004
|
+
);
|
|
2005
|
+
}
|
|
2006
|
+
if (options.tool === "context" || !options.tool) {
|
|
2007
|
+
console.log(
|
|
2008
|
+
chalk18.white(
|
|
2009
|
+
` \u2022 ${chalk18.bold("Context Optimization")}: Barrel file cleanup and import flattening.`
|
|
2010
|
+
)
|
|
2011
|
+
);
|
|
2012
|
+
}
|
|
2013
|
+
console.log(
|
|
2014
|
+
chalk18.dim(
|
|
2015
|
+
"\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
2016
|
+
)
|
|
2017
|
+
);
|
|
2018
|
+
console.log(chalk18.bold("\u2728 Use the Platform Swarm for Automated Fixes"));
|
|
2019
|
+
console.log(
|
|
2020
|
+
chalk18.cyan(` The high-performance Remediation Swarm is available at:`)
|
|
2021
|
+
);
|
|
2022
|
+
console.log(chalk18.white(` ${chalk18.bold(`${serverUrl}/remediate`)}`));
|
|
2023
|
+
console.log(
|
|
2024
|
+
chalk18.dim(
|
|
2025
|
+
"\n The swarm uses specialized agents to safely refactor your code,"
|
|
2026
|
+
)
|
|
2027
|
+
);
|
|
2028
|
+
console.log(
|
|
2029
|
+
chalk18.dim(" ensuring every change improves your AI-readiness score.")
|
|
2030
|
+
);
|
|
2031
|
+
console.log(
|
|
2032
|
+
chalk18.dim(
|
|
2033
|
+
"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
2034
|
+
)
|
|
2035
|
+
);
|
|
2036
|
+
console.log(
|
|
2037
|
+
chalk18.dim(
|
|
2038
|
+
'\n\u{1F4A1} Next Version: Local "aiready fix" command for minor documentation issues.'
|
|
2039
|
+
)
|
|
2040
|
+
);
|
|
2041
|
+
}
|
|
2042
|
+
var REMEDIATE_HELP_TEXT = `
|
|
2043
|
+
EXAMPLES:
|
|
2044
|
+
$ aiready remediate # See remediation options for latest report
|
|
2045
|
+
$ aiready remediate --tool patterns # Focus on pattern consolidation
|
|
2046
|
+
$ aiready remediate --report ./custom-report.json
|
|
2047
|
+
`;
|
|
2048
|
+
|
|
1858
2049
|
// src/cli.ts
|
|
1859
2050
|
var getDirname = () => {
|
|
1860
2051
|
if (typeof __dirname !== "undefined") return __dirname;
|
|
@@ -2005,9 +2196,19 @@ program.command("change-amplification").description("Analyze graph metrics for c
|
|
|
2005
2196
|
program.command("testability").description("Analyze test coverage and AI readiness").argument("[directory]", "Directory to analyze", ".").option("--min-coverage <ratio>", "Minimum acceptable coverage ratio", "0.3").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").action(async (directory, options) => {
|
|
2006
2197
|
await testabilityAction(directory, options);
|
|
2007
2198
|
});
|
|
2199
|
+
program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument("[directory]", "Directory to analyze", ".").option(
|
|
2200
|
+
"--min-chain-depth <depth>",
|
|
2201
|
+
"Minimum optional chain depth to flag",
|
|
2202
|
+
"3"
|
|
2203
|
+
).option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").action(async (directory, options) => {
|
|
2204
|
+
await contractEnforcementAction(directory, options);
|
|
2205
|
+
});
|
|
2008
2206
|
program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option("--api-key <key>", "Platform API key").option("--repo-id <id>", "Platform repository ID (optional)").option("--server <url>", "Custom platform URL").addHelpText("after", UPLOAD_HELP_TEXT).action(async (file, options) => {
|
|
2009
2207
|
await uploadAction(file, options);
|
|
2010
2208
|
});
|
|
2209
|
+
program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument("[directory]", "Directory to remediate", ".").option("-r, --report <path>", "AIReady report JSON file").option("-t, --tool <name>", "Filter by tool: patterns, context, consistency").option("--server <url>", "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
|
|
2210
|
+
await remediateAction(directory, options);
|
|
2211
|
+
});
|
|
2011
2212
|
program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option("-t, --type <type>", "Issue type: bug, feature, metric", "bug").option("--submit", "Submit the issue directly using the GitHub CLI (gh)").addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
|
|
2012
2213
|
await bugAction(message, options);
|
|
2013
2214
|
});
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ var TOOL_PACKAGE_MAP = {
|
|
|
41
41
|
[import_core.ToolName.DocDrift]: "@aiready/doc-drift",
|
|
42
42
|
[import_core.ToolName.DependencyHealth]: "@aiready/deps",
|
|
43
43
|
[import_core.ToolName.ChangeAmplification]: "@aiready/change-amplification",
|
|
44
|
+
[import_core.ToolName.ContractEnforcement]: "@aiready/contract-enforcement",
|
|
44
45
|
// Aliases handled by registry
|
|
45
46
|
patterns: "@aiready/pattern-detect",
|
|
46
47
|
duplicates: "@aiready/pattern-detect",
|
|
@@ -51,7 +52,8 @@ var TOOL_PACKAGE_MAP = {
|
|
|
51
52
|
grounding: "@aiready/agent-grounding",
|
|
52
53
|
testability: "@aiready/testability",
|
|
53
54
|
"deps-health": "@aiready/deps",
|
|
54
|
-
"change-amp": "@aiready/change-amplification"
|
|
55
|
+
"change-amp": "@aiready/change-amplification",
|
|
56
|
+
contract: "@aiready/contract-enforcement"
|
|
55
57
|
};
|
|
56
58
|
var UnifiedOrchestrator = class {
|
|
57
59
|
/**
|
|
@@ -200,7 +202,8 @@ var UnifiedOrchestrator = class {
|
|
|
200
202
|
"testability-index": ["testabilityIndex", "testability"],
|
|
201
203
|
"doc-drift": ["docDrift"],
|
|
202
204
|
"dependency-health": ["dependencyHealth", "deps"],
|
|
203
|
-
"change-amplification": ["changeAmplification"]
|
|
205
|
+
"change-amplification": ["changeAmplification"],
|
|
206
|
+
"contract-enforcement": ["contractEnforcement", "contract"]
|
|
204
207
|
};
|
|
205
208
|
for (const [kebabKey, aliases] of Object.entries(keyMappings)) {
|
|
206
209
|
if (result[kebabKey]) {
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Assess and improve your codebase's AI-readiness. Get an AI Readiness Score (0-100) and detect semantic duplicates, context fragmentation, and naming inconsistencies.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -24,17 +24,18 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"chalk": "^5.3.0",
|
|
26
26
|
"commander": "^14.0.0",
|
|
27
|
-
"@aiready/agent-grounding": "0.
|
|
28
|
-
"@aiready/
|
|
29
|
-
"@aiready/
|
|
30
|
-
"@aiready/core": "0.
|
|
31
|
-
"@aiready/deps": "0.
|
|
32
|
-
"@aiready/doc-drift": "0.
|
|
33
|
-
"@aiready/
|
|
34
|
-
"@aiready/
|
|
35
|
-
"@aiready/
|
|
36
|
-
"@aiready/
|
|
37
|
-
"@aiready/testability": "0.
|
|
27
|
+
"@aiready/agent-grounding": "0.14.1",
|
|
28
|
+
"@aiready/consistency": "0.21.1",
|
|
29
|
+
"@aiready/context-analyzer": "0.22.1",
|
|
30
|
+
"@aiready/core": "0.24.1",
|
|
31
|
+
"@aiready/deps": "0.14.1",
|
|
32
|
+
"@aiready/doc-drift": "0.14.1",
|
|
33
|
+
"@aiready/ai-signal-clarity": "0.14.1",
|
|
34
|
+
"@aiready/change-amplification": "0.14.1",
|
|
35
|
+
"@aiready/pattern-detect": "0.17.1",
|
|
36
|
+
"@aiready/visualizer": "0.7.1",
|
|
37
|
+
"@aiready/testability": "0.7.1",
|
|
38
|
+
"@aiready/contract-enforcement": "0.2.1"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@types/node": "^24.0.0",
|