@aiready/cli 0.12.19 → 0.12.23
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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-lint.log +24 -5
- package/.turbo/turbo-test.log +66 -121
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +865 -0
- package/coverage/coverage-final.json +15 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +146 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/commands/agent-grounding.ts.html +271 -0
- package/coverage/src/commands/ai-signal-clarity.ts.html +253 -0
- package/coverage/src/commands/change-amplification.ts.html +94 -0
- package/coverage/src/commands/consistency.ts.html +781 -0
- package/coverage/src/commands/context.ts.html +871 -0
- package/coverage/src/commands/deps-health.ts.html +280 -0
- package/coverage/src/commands/doc-drift.ts.html +271 -0
- package/coverage/src/commands/index.html +281 -0
- package/coverage/src/commands/patterns.ts.html +745 -0
- package/coverage/src/commands/scan.ts.html +1393 -0
- package/coverage/src/commands/testability.ts.html +304 -0
- package/coverage/src/commands/upload.ts.html +466 -0
- package/coverage/src/commands/visualize.ts.html +1027 -0
- package/coverage/src/index.html +116 -0
- package/coverage/src/index.ts.html +1372 -0
- package/coverage/src/utils/helpers.ts.html +559 -0
- package/coverage/src/utils/index.html +116 -0
- package/dist/cli.js +249 -15
- package/dist/cli.mjs +247 -13
- package/package.json +13 -12
- package/src/.aiready/aiready-report-20260308-174006.json +29526 -0
- package/src/__tests__/unified.test.ts +95 -0
- package/src/cli.ts +86 -0
- package/src/commands/__tests__/agent-grounding.test.ts +24 -0
- package/src/commands/__tests__/ai-signal-clarity.test.ts +32 -0
- package/src/commands/__tests__/consistency.test.ts +97 -0
- package/src/commands/__tests__/deps-health.test.ts +26 -0
- package/src/commands/__tests__/doc-drift.test.ts +26 -0
- package/src/commands/__tests__/extra-commands.test.ts +177 -0
- package/src/commands/__tests__/scan.test.ts +147 -0
- package/src/commands/__tests__/testability.test.ts +36 -0
- package/src/commands/__tests__/upload.test.ts +51 -0
- package/src/commands/__tests__/visualize.test.ts +82 -0
- package/src/commands/clawmart.ts +162 -0
- package/src/commands/index.ts +8 -0
- package/src/commands/scan.ts +33 -11
- package/src/utils/__tests__/helpers.test.ts +35 -0
- package/vitest.config.ts +20 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/utils</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../../index.html">All files</a> src/utils</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">52.23% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>35/67</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">37.2% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>16/43</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">53.84% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>7/13</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">51.56% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>33/64</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
|
+
<div class="pad1">
|
|
66
|
+
<table class="coverage-summary">
|
|
67
|
+
<thead>
|
|
68
|
+
<tr>
|
|
69
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
70
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
71
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
72
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
74
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
75
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
76
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
77
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
78
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
79
|
+
</tr>
|
|
80
|
+
</thead>
|
|
81
|
+
<tbody><tr>
|
|
82
|
+
<td class="file medium" data-value="helpers.ts"><a href="helpers.ts.html">helpers.ts</a></td>
|
|
83
|
+
<td data-value="52.23" class="pic medium">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 52%"></div><div class="cover-empty" style="width: 48%"></div></div>
|
|
85
|
+
</td>
|
|
86
|
+
<td data-value="52.23" class="pct medium">52.23%</td>
|
|
87
|
+
<td data-value="67" class="abs medium">35/67</td>
|
|
88
|
+
<td data-value="37.2" class="pct low">37.2%</td>
|
|
89
|
+
<td data-value="43" class="abs low">16/43</td>
|
|
90
|
+
<td data-value="53.84" class="pct medium">53.84%</td>
|
|
91
|
+
<td data-value="13" class="abs medium">7/13</td>
|
|
92
|
+
<td data-value="51.56" class="pct medium">51.56%</td>
|
|
93
|
+
<td data-value="64" class="abs medium">33/64</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
</tbody>
|
|
97
|
+
</table>
|
|
98
|
+
</div>
|
|
99
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
100
|
+
</div><!-- /wrapper -->
|
|
101
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
|
+
Code coverage generated by
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at 2026-03-09T03:44:16.153Z
|
|
105
|
+
</div>
|
|
106
|
+
<script src="../../prettify.js"></script>
|
|
107
|
+
<script>
|
|
108
|
+
window.onload = function () {
|
|
109
|
+
prettyPrint();
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
112
|
+
<script src="../../sorter.js"></script>
|
|
113
|
+
<script src="../../block-navigation.js"></script>
|
|
114
|
+
</body>
|
|
115
|
+
</html>
|
|
116
|
+
|
package/dist/cli.js
CHANGED
|
@@ -25,8 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
|
|
26
26
|
// src/cli.ts
|
|
27
27
|
var import_commander = require("commander");
|
|
28
|
-
var
|
|
29
|
-
var
|
|
28
|
+
var import_fs7 = require("fs");
|
|
29
|
+
var import_path9 = require("path");
|
|
30
30
|
var import_url = require("url");
|
|
31
31
|
|
|
32
32
|
// src/commands/scan.ts
|
|
@@ -690,26 +690,46 @@ async function scanAction(directory, options) {
|
|
|
690
690
|
wastedTokens: {
|
|
691
691
|
duplication: totalWastedDuplication,
|
|
692
692
|
fragmentation: totalWastedFragmentation,
|
|
693
|
-
chattiness: 0
|
|
693
|
+
chattiness: totalContext * 0.1
|
|
694
|
+
// Default chattiness
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
const allIssues = [];
|
|
698
|
+
for (const toolId of results.summary.toolsRun) {
|
|
699
|
+
if (results[toolId]?.results) {
|
|
700
|
+
results[toolId].results.forEach((fileRes) => {
|
|
701
|
+
if (fileRes.issues) {
|
|
702
|
+
allIssues.push(...fileRes.issues);
|
|
703
|
+
}
|
|
704
|
+
});
|
|
694
705
|
}
|
|
706
|
+
}
|
|
707
|
+
const modelId = options.model || "claude-3-5-sonnet";
|
|
708
|
+
const roi = (await import("@aiready/core")).calculateBusinessROI({
|
|
709
|
+
tokenWaste: unifiedBudget.wastedTokens.total,
|
|
710
|
+
issues: allIssues,
|
|
711
|
+
modelId
|
|
695
712
|
});
|
|
696
|
-
|
|
697
|
-
const costEstimate = (0, import_core3.estimateCostFromBudget)(unifiedBudget, modelPreset);
|
|
698
|
-
console.log(import_chalk3.default.bold("\n\u{1F4CA} AI Token Budget Analysis"));
|
|
713
|
+
console.log(import_chalk3.default.bold("\n\u{1F4B0} Business Impact Analysis (Monthly)"));
|
|
699
714
|
console.log(
|
|
700
|
-
`
|
|
715
|
+
` Potential Savings: ${import_chalk3.default.green(import_chalk3.default.bold("$" + roi.monthlySavings.toLocaleString()))}`
|
|
701
716
|
);
|
|
702
717
|
console.log(
|
|
703
|
-
`
|
|
718
|
+
` Productivity Gain: ${import_chalk3.default.cyan(import_chalk3.default.bold(roi.productivityGainHours + "h"))} (est. dev time)`
|
|
704
719
|
);
|
|
705
720
|
console.log(
|
|
706
|
-
`
|
|
721
|
+
` Context Efficiency: ${import_chalk3.default.yellow((unifiedBudget.efficiencyRatio * 100).toFixed(0) + "%")}`
|
|
707
722
|
);
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
723
|
+
console.log(
|
|
724
|
+
` Annual Value: ${import_chalk3.default.bold("$" + roi.annualValue.toLocaleString())} (ROI Prediction)`
|
|
725
|
+
);
|
|
726
|
+
results.summary.businessImpact = {
|
|
727
|
+
estimatedMonthlyWaste: roi.monthlySavings,
|
|
728
|
+
potentialSavings: roi.monthlySavings,
|
|
729
|
+
productivityHours: roi.productivityGainHours
|
|
712
730
|
};
|
|
731
|
+
scoringResult.tokenBudget = unifiedBudget;
|
|
732
|
+
scoringResult.businessROI = roi;
|
|
713
733
|
}
|
|
714
734
|
if (scoringResult.breakdown) {
|
|
715
735
|
console.log(import_chalk3.default.bold("\nTool breakdown:"));
|
|
@@ -1585,18 +1605,213 @@ var import_core10 = require("@aiready/core");
|
|
|
1585
1605
|
// src/commands/testability.ts
|
|
1586
1606
|
var import_chalk10 = __toESM(require("chalk"));
|
|
1587
1607
|
var import_core11 = require("@aiready/core");
|
|
1608
|
+
async function testabilityAction(directory, options) {
|
|
1609
|
+
const { analyzeTestability, calculateTestabilityScore } = await import("@aiready/testability");
|
|
1610
|
+
const config = await (0, import_core11.loadConfig)(directory);
|
|
1611
|
+
const merged = (0, import_core11.mergeConfigWithDefaults)(config, {
|
|
1612
|
+
minCoverageRatio: 0.3
|
|
1613
|
+
});
|
|
1614
|
+
const report = await analyzeTestability({
|
|
1615
|
+
rootDir: directory,
|
|
1616
|
+
minCoverageRatio: options.minCoverageRatio ?? merged.minCoverageRatio,
|
|
1617
|
+
include: options.include,
|
|
1618
|
+
exclude: options.exclude
|
|
1619
|
+
});
|
|
1620
|
+
const scoring = calculateTestabilityScore(report);
|
|
1621
|
+
if (options.output === "json") {
|
|
1622
|
+
return scoring;
|
|
1623
|
+
}
|
|
1624
|
+
const safetyIcons = {
|
|
1625
|
+
safe: "\u2705",
|
|
1626
|
+
"moderate-risk": "\u26A0\uFE0F ",
|
|
1627
|
+
"high-risk": "\u{1F534}",
|
|
1628
|
+
"blind-risk": "\u{1F480}"
|
|
1629
|
+
};
|
|
1630
|
+
const safetyColors = {
|
|
1631
|
+
safe: import_chalk10.default.green,
|
|
1632
|
+
"moderate-risk": import_chalk10.default.yellow,
|
|
1633
|
+
"high-risk": import_chalk10.default.red,
|
|
1634
|
+
"blind-risk": import_chalk10.default.bgRed.white
|
|
1635
|
+
};
|
|
1636
|
+
const safety = report.summary.aiChangeSafetyRating;
|
|
1637
|
+
const icon = safetyIcons[safety] ?? "\u2753";
|
|
1638
|
+
const color = safetyColors[safety] ?? import_chalk10.default.white;
|
|
1639
|
+
console.log(
|
|
1640
|
+
` \u{1F9EA} Testability: ${import_chalk10.default.bold(scoring.score + "/100")} (${report.summary.rating})`
|
|
1641
|
+
);
|
|
1642
|
+
console.log(
|
|
1643
|
+
` AI Change Safety: ${color(`${icon} ${safety.toUpperCase()}`)}`
|
|
1644
|
+
);
|
|
1645
|
+
console.log(
|
|
1646
|
+
import_chalk10.default.dim(
|
|
1647
|
+
` Coverage: ${Math.round(report.summary.coverageRatio * 100)}% (${report.rawData.testFiles} test / ${report.rawData.sourceFiles} source files)`
|
|
1648
|
+
)
|
|
1649
|
+
);
|
|
1650
|
+
if (safety === "blind-risk") {
|
|
1651
|
+
console.log(
|
|
1652
|
+
import_chalk10.default.red.bold(
|
|
1653
|
+
"\n \u26A0\uFE0F NO TESTS \u2014 AI changes to this codebase are completely unverifiable!\n"
|
|
1654
|
+
)
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
return scoring;
|
|
1658
|
+
}
|
|
1588
1659
|
|
|
1589
1660
|
// src/commands/change-amplification.ts
|
|
1590
1661
|
var import_cli = require("@aiready/change-amplification/dist/cli.js");
|
|
1591
1662
|
|
|
1663
|
+
// src/commands/clawmart.ts
|
|
1664
|
+
var import_chalk11 = __toESM(require("chalk"));
|
|
1665
|
+
var import_fs6 = __toESM(require("fs"));
|
|
1666
|
+
var import_path8 = require("path");
|
|
1667
|
+
var import_clawmart = require("@aiready/clawmart");
|
|
1668
|
+
function getClient(options) {
|
|
1669
|
+
const apiKey = options.apiKey || process.env.CLAWMART_API_KEY;
|
|
1670
|
+
if (!apiKey) {
|
|
1671
|
+
console.error(import_chalk11.default.red("\u274C ClawMart API Key is required."));
|
|
1672
|
+
console.log(
|
|
1673
|
+
import_chalk11.default.dim(
|
|
1674
|
+
" Set CLAWMART_API_KEY environment variable or use --api-key flag."
|
|
1675
|
+
)
|
|
1676
|
+
);
|
|
1677
|
+
process.exit(1);
|
|
1678
|
+
}
|
|
1679
|
+
return new import_clawmart.ClawMartClient(apiKey, options.server);
|
|
1680
|
+
}
|
|
1681
|
+
async function clawmartMeAction(options) {
|
|
1682
|
+
const client = getClient(options);
|
|
1683
|
+
try {
|
|
1684
|
+
const me = await client.getMe();
|
|
1685
|
+
console.log(import_chalk11.default.blue("\n\u{1F464} ClawMart Profile:"));
|
|
1686
|
+
console.log(` Name: ${import_chalk11.default.bold(me.name)}`);
|
|
1687
|
+
console.log(` Email: ${me.email}`);
|
|
1688
|
+
console.log(` Role: ${me.isCreator ? "Creator" : "User"}`);
|
|
1689
|
+
console.log(
|
|
1690
|
+
` Sub: ${me.subscriptionActive ? import_chalk11.default.green("Active") : import_chalk11.default.red("Inactive")}`
|
|
1691
|
+
);
|
|
1692
|
+
} catch (error) {
|
|
1693
|
+
console.error(import_chalk11.default.red(`\u274C Failed to fetch profile: ${error.message}`));
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
async function clawmartListingsAction(options) {
|
|
1697
|
+
const client = getClient(options);
|
|
1698
|
+
try {
|
|
1699
|
+
let listings;
|
|
1700
|
+
if (options.query) {
|
|
1701
|
+
listings = await client.searchListings(
|
|
1702
|
+
options.query,
|
|
1703
|
+
options.type,
|
|
1704
|
+
options.limit
|
|
1705
|
+
);
|
|
1706
|
+
} else {
|
|
1707
|
+
listings = await client.getListings();
|
|
1708
|
+
}
|
|
1709
|
+
if (listings.length === 0) {
|
|
1710
|
+
console.log(import_chalk11.default.yellow("\n\u{1F4ED} No listings found."));
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1713
|
+
console.log(import_chalk11.default.blue(`
|
|
1714
|
+
\u{1F3E0} ClawMart Listings (${listings.length}):`));
|
|
1715
|
+
listings.forEach((l) => {
|
|
1716
|
+
const status = l.published ? import_chalk11.default.green("Published") : import_chalk11.default.yellow("Draft");
|
|
1717
|
+
console.log(` - ${import_chalk11.default.bold(l.name)} (${import_chalk11.default.dim(l.id)})`);
|
|
1718
|
+
console.log(` ${import_chalk11.default.italic(l.tagline)}`);
|
|
1719
|
+
console.log(
|
|
1720
|
+
` Price: $${l.price} | Type: ${l.productType} | Status: ${status}`
|
|
1721
|
+
);
|
|
1722
|
+
console.log("");
|
|
1723
|
+
});
|
|
1724
|
+
} catch (error) {
|
|
1725
|
+
console.error(import_chalk11.default.red(`\u274C Failed to fetch listings: ${error.message}`));
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
async function clawmartCreateAction(options) {
|
|
1729
|
+
const client = getClient(options);
|
|
1730
|
+
try {
|
|
1731
|
+
const data = {
|
|
1732
|
+
name: options.name,
|
|
1733
|
+
tagline: options.tagline,
|
|
1734
|
+
about: options.about || "",
|
|
1735
|
+
category: options.category || "Utility",
|
|
1736
|
+
capabilities: options.capabilities ? options.capabilities.split(",") : [],
|
|
1737
|
+
price: parseFloat(options.price) || 0,
|
|
1738
|
+
productType: options.type
|
|
1739
|
+
};
|
|
1740
|
+
const listing = await client.createListing(data);
|
|
1741
|
+
console.log(import_chalk11.default.green(`
|
|
1742
|
+
\u2705 Listing created successfully!`));
|
|
1743
|
+
console.log(` ID: ${listing.id}`);
|
|
1744
|
+
console.log(` Name: ${listing.name}`);
|
|
1745
|
+
} catch (error) {
|
|
1746
|
+
console.error(import_chalk11.default.red(`\u274C Failed to create listing: ${error.message}`));
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
async function clawmartUploadAction(id, files, options) {
|
|
1750
|
+
const client = getClient(options);
|
|
1751
|
+
try {
|
|
1752
|
+
const fileData = files.map((f) => {
|
|
1753
|
+
const path = (0, import_path8.resolve)(process.cwd(), f);
|
|
1754
|
+
if (!import_fs6.default.existsSync(path)) {
|
|
1755
|
+
throw new Error(`File not found: ${f}`);
|
|
1756
|
+
}
|
|
1757
|
+
return {
|
|
1758
|
+
path: f,
|
|
1759
|
+
content: import_fs6.default.readFileSync(path, "utf-8")
|
|
1760
|
+
};
|
|
1761
|
+
});
|
|
1762
|
+
await client.uploadVersion(id, fileData);
|
|
1763
|
+
console.log(
|
|
1764
|
+
import_chalk11.default.green(`
|
|
1765
|
+
\u2705 New version uploaded successfully to listing ${id}!`)
|
|
1766
|
+
);
|
|
1767
|
+
} catch (error) {
|
|
1768
|
+
console.error(import_chalk11.default.red(`\u274C Failed to upload version: ${error.message}`));
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
async function clawmartDownloadAction(idOrSlug, options) {
|
|
1772
|
+
const client = getClient(options);
|
|
1773
|
+
try {
|
|
1774
|
+
const pkg = await client.downloadPackage(idOrSlug);
|
|
1775
|
+
const outDir = options.outDir || `./clawmart-${pkg.slug}`;
|
|
1776
|
+
if (!import_fs6.default.existsSync(outDir)) {
|
|
1777
|
+
import_fs6.default.mkdirSync(outDir, { recursive: true });
|
|
1778
|
+
}
|
|
1779
|
+
pkg.files.forEach((f) => {
|
|
1780
|
+
const filePath = (0, import_path8.resolve)(outDir, f.path);
|
|
1781
|
+
const dir = (0, import_path8.resolve)(filePath, "..");
|
|
1782
|
+
if (!import_fs6.default.existsSync(dir)) {
|
|
1783
|
+
import_fs6.default.mkdirSync(dir, { recursive: true });
|
|
1784
|
+
}
|
|
1785
|
+
import_fs6.default.writeFileSync(filePath, f.content);
|
|
1786
|
+
});
|
|
1787
|
+
console.log(
|
|
1788
|
+
import_chalk11.default.green(`
|
|
1789
|
+
\u2705 Package ${idOrSlug} downloaded to ${outDir}`)
|
|
1790
|
+
);
|
|
1791
|
+
} catch (error) {
|
|
1792
|
+
console.error(import_chalk11.default.red(`\u274C Failed to download package: ${error.message}`));
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
var clawmartHelpText = `
|
|
1796
|
+
EXAMPLES:
|
|
1797
|
+
$ aiready clawmart me
|
|
1798
|
+
$ aiready clawmart listings --query "marketing"
|
|
1799
|
+
$ aiready clawmart create --name "SEO Booster" --tagline "Boost your SEO" --type skill --price 10
|
|
1800
|
+
$ aiready clawmart upload <listing-id> SKILL.md rules/
|
|
1801
|
+
$ aiready clawmart download <listing-id-or-slug> --outDir ./my-skill
|
|
1802
|
+
|
|
1803
|
+
ENVIRONMENT VARIABLES:
|
|
1804
|
+
CLAWMART_API_KEY Your ClawMart creator API key
|
|
1805
|
+
`;
|
|
1806
|
+
|
|
1592
1807
|
// src/cli.ts
|
|
1593
1808
|
var import_meta = {};
|
|
1594
1809
|
var getDirname = () => {
|
|
1595
1810
|
if (typeof __dirname !== "undefined") return __dirname;
|
|
1596
|
-
return (0,
|
|
1811
|
+
return (0, import_path9.dirname)((0, import_url.fileURLToPath)(import_meta.url));
|
|
1597
1812
|
};
|
|
1598
1813
|
var packageJson = JSON.parse(
|
|
1599
|
-
(0,
|
|
1814
|
+
(0, import_fs7.readFileSync)((0, import_path9.join)(getDirname(), "../package.json"), "utf8")
|
|
1600
1815
|
);
|
|
1601
1816
|
var program = new import_commander.Command();
|
|
1602
1817
|
program.name("aiready").description("AIReady - Assess and improve AI-readiness of codebases").version(packageJson.version).addHelpText(
|
|
@@ -1740,7 +1955,26 @@ program.command("visualize").description("Generate interactive visualization fro
|
|
|
1740
1955
|
program.command("change-amplification").description("Analyze graph metrics for change amplification").argument("[directory]", "Directory to analyze", ".").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) => {
|
|
1741
1956
|
await (0, import_cli.changeAmplificationAction)(directory, options);
|
|
1742
1957
|
});
|
|
1958
|
+
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) => {
|
|
1959
|
+
await testabilityAction(directory, options);
|
|
1960
|
+
});
|
|
1743
1961
|
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", uploadHelpText).action(async (file, options) => {
|
|
1744
1962
|
await uploadAction(file, options);
|
|
1745
1963
|
});
|
|
1964
|
+
var clawmart = program.command("clawmart").description("Manage ClawMart personas and skills").addHelpText("after", clawmartHelpText);
|
|
1965
|
+
clawmart.command("me").description("Show my ClawMart creator profile").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (options) => {
|
|
1966
|
+
await clawmartMeAction(options);
|
|
1967
|
+
});
|
|
1968
|
+
clawmart.command("listings").description("Show my ClawMart listings").option("-q, --query <string>", "Search query").option("-t, --type <type>", "Filter by type: skill, persona").option("-l, --limit <number>", "Limit results", "10").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (options) => {
|
|
1969
|
+
await clawmartListingsAction(options);
|
|
1970
|
+
});
|
|
1971
|
+
clawmart.command("create").description("Create a new listing on ClawMart").requiredOption("--name <string>", "Listing name").requiredOption("--tagline <string>", "Short tagline").option("--about <string>", "Full description").option("--category <string>", "Category", "Utility").option("--capabilities <string>", "Comma-separated list of capabilities").option("--price <number>", "Price in USD", "0").option("--type <type>", "Product type: skill, persona", "skill").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (options) => {
|
|
1972
|
+
await clawmartCreateAction(options);
|
|
1973
|
+
});
|
|
1974
|
+
clawmart.command("upload").description("Upload content to a listing").argument("<id>", "Listing ID").argument("<files...>", "Files or directories to upload").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (id, files, options) => {
|
|
1975
|
+
await clawmartUploadAction(id, files, options);
|
|
1976
|
+
});
|
|
1977
|
+
clawmart.command("download").description("Download a package from ClawMart").argument("<idOrSlug>", "Listing ID or Slug").option("--outDir <path>", "Output directory").option("--api-key <key>", "ClawMart API key").option("--server <url>", "Custom ClawMart API server").action(async (idOrSlug, options) => {
|
|
1978
|
+
await clawmartDownloadAction(idOrSlug, options);
|
|
1979
|
+
});
|
|
1746
1980
|
program.parse();
|