clawculator 2.1.1 → 2.1.2
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/clawculator.js +1 -1
- package/package.json +10 -3
- package/src/htmlReport.js +4 -2
package/bin/clawculator.js
CHANGED
|
@@ -87,7 +87,7 @@ async function main() {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (flags.report) {
|
|
90
|
-
const outPath = flags.out || path.join(
|
|
90
|
+
const outPath = flags.out || path.join(process.cwd(), `clawculator-report.html`);
|
|
91
91
|
const { generateHTMLReport } = require('../src/htmlReport');
|
|
92
92
|
await generateHTMLReport(analysis, outPath);
|
|
93
93
|
const { exec } = require('child_process');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawculator",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "AI cost forensics for OpenClaw and multi-model setups. Your friendly penny pincher. 100% offline. Zero AI. Pure deterministic logic.",
|
|
5
5
|
"main": "src/analyzer.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,8 +11,15 @@
|
|
|
11
11
|
"test": "node -e \"const {runAnalysis} = require('./src/analyzer'); runAnalysis({configPath:'~/.openclaw/openclaw.json',sessionsPath:'',logsDir:''}).then(r => console.log('OK:', r.summary))\""
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
|
-
"openclaw",
|
|
15
|
-
"
|
|
14
|
+
"openclaw",
|
|
15
|
+
"claude",
|
|
16
|
+
"anthropic",
|
|
17
|
+
"ai-cost",
|
|
18
|
+
"token-usage",
|
|
19
|
+
"cost-optimization",
|
|
20
|
+
"llm-cost",
|
|
21
|
+
"ai-forensics",
|
|
22
|
+
"multi-model"
|
|
16
23
|
],
|
|
17
24
|
"author": "Ed Choudhry",
|
|
18
25
|
"license": "MIT",
|
package/src/htmlReport.js
CHANGED
|
@@ -23,7 +23,7 @@ const SOURCE_LABELS = {
|
|
|
23
23
|
workspace: '📁 Workspace', config: '📄 Config',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
async function generateHTMLReport(analysis) {
|
|
26
|
+
async function generateHTMLReport(analysis, outPath) {
|
|
27
27
|
const { summary, findings, sessions } = analysis;
|
|
28
28
|
const bleed = summary.estimatedMonthlyBleed;
|
|
29
29
|
|
|
@@ -150,7 +150,9 @@ async function generateHTMLReport(analysis) {
|
|
|
150
150
|
</body>
|
|
151
151
|
</html>`;
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
if (!outPath) {
|
|
154
|
+
outPath = path.join(os.tmpdir(), `clawculator-report-${Date.now()}.html`);
|
|
155
|
+
}
|
|
154
156
|
fs.writeFileSync(outPath, html, 'utf8');
|
|
155
157
|
return outPath;
|
|
156
158
|
}
|