openclaw-smartmeter 0.3.0 → 0.4.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 +2 -2
- package/canvas-template/analysis.public.json +77 -16
- package/canvas-template/app.js +1050 -682
- package/canvas-template/index.html +334 -155
- package/canvas-template/styles.css +1428 -1227
- package/package.json +1 -1
- package/src/analyzer/aggregator.js +4 -2
- package/src/analyzer/openrouter-client.js +15 -6
- package/src/analyzer/recommender.js +129 -0
- package/src/canvas/api-server.js +87 -4
- package/src/cli/commands.js +342 -37
- package/src/cli/index.js +29 -0
package/README.md
CHANGED
|
@@ -395,7 +395,7 @@ src/
|
|
|
395
395
|
index.js # Commander.js entry point (8 commands)
|
|
396
396
|
commands.js # Command handlers
|
|
397
397
|
utils.js # Formatting helpers
|
|
398
|
-
tests/ #
|
|
398
|
+
tests/ # 94 tests across all modules
|
|
399
399
|
canvas-template/ # Dashboard HTML/JS/CSS
|
|
400
400
|
docs/ # SPEC alignment, backlog, dashboard docs
|
|
401
401
|
```
|
|
@@ -413,7 +413,7 @@ node --test tests/parser.test.js
|
|
|
413
413
|
node --test --reporter spec tests/*.test.js
|
|
414
414
|
```
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
94 tests covering parser, classifier, aggregator, recommender, storage, config generator, CLI commands, and SPEC compliance.
|
|
417
417
|
|
|
418
418
|
## Documentation
|
|
419
419
|
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"monthly_projected_current": 59.97,
|
|
12
12
|
"monthly_projected_optimized": 31.14,
|
|
13
13
|
"cache_hit_rate": 0.192,
|
|
14
|
-
"model_breakdown": [
|
|
15
|
-
{
|
|
14
|
+
"model_breakdown": [{
|
|
16
15
|
"model": "DeepSeek Chat",
|
|
17
16
|
"tasks": 65,
|
|
18
17
|
"cost": 1.20,
|
|
@@ -34,8 +33,7 @@
|
|
|
34
33
|
"percentage": 10.0
|
|
35
34
|
}
|
|
36
35
|
],
|
|
37
|
-
"task_breakdown": [
|
|
38
|
-
{
|
|
36
|
+
"task_breakdown": [{
|
|
39
37
|
"type": "Code",
|
|
40
38
|
"count": 74,
|
|
41
39
|
"percentage": 78.7,
|
|
@@ -54,8 +52,7 @@
|
|
|
54
52
|
"avg_cost": 0.080
|
|
55
53
|
}
|
|
56
54
|
],
|
|
57
|
-
"recommendations": [
|
|
58
|
-
{
|
|
55
|
+
"recommendations": [{
|
|
59
56
|
"type": "model_switch",
|
|
60
57
|
"title": "Switch Primary Model to DeepSeek Chat",
|
|
61
58
|
"description": "DeepSeek Chat handles 69% of your tasks at 1/5th the cost of Claude Sonnet 4.5. This model is ideal for your code-heavy workload.",
|
|
@@ -111,8 +108,7 @@
|
|
|
111
108
|
"hit_rate": 0.192,
|
|
112
109
|
"savings_from_cache": 0.80
|
|
113
110
|
},
|
|
114
|
-
"cost_timeline": [
|
|
115
|
-
{
|
|
111
|
+
"cost_timeline": [{
|
|
116
112
|
"date": "2026-01-20",
|
|
117
113
|
"cost": 2.10,
|
|
118
114
|
"tasks": 47
|
|
@@ -123,19 +119,84 @@
|
|
|
123
119
|
"tasks": 47
|
|
124
120
|
}
|
|
125
121
|
],
|
|
126
|
-
"agent_suggestions": [
|
|
122
|
+
"agent_suggestions": [{
|
|
123
|
+
"name": "code-reviewer",
|
|
124
|
+
"purpose": "Code reviews, debugging, refactoring",
|
|
125
|
+
"primary_model": "deepseek/deepseek-chat",
|
|
126
|
+
"fallback_chain": ["anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4.5"],
|
|
127
|
+
"estimated_tasks_per_month": 74,
|
|
128
|
+
"estimated_monthly_savings": 12.00
|
|
129
|
+
}],
|
|
130
|
+
"model_alternatives": [{
|
|
131
|
+
"id": "deepseek/deepseek-chat",
|
|
132
|
+
"name": "DeepSeek Chat",
|
|
133
|
+
"input_cost_per_1k": 0.00014,
|
|
134
|
+
"output_cost_per_1k": 0.00028,
|
|
135
|
+
"avg_cost_per_task": 0.018,
|
|
136
|
+
"quality_score": 82,
|
|
137
|
+
"speed": "fast",
|
|
138
|
+
"best_for": ["code", "debugging", "quick tasks"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "anthropic/claude-sonnet-4.5",
|
|
142
|
+
"name": "Claude Sonnet 4.5",
|
|
143
|
+
"input_cost_per_1k": 0.003,
|
|
144
|
+
"output_cost_per_1k": 0.015,
|
|
145
|
+
"avg_cost_per_task": 0.086,
|
|
146
|
+
"quality_score": 93,
|
|
147
|
+
"speed": "medium",
|
|
148
|
+
"best_for": ["complex code", "writing", "research"]
|
|
149
|
+
},
|
|
127
150
|
{
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
151
|
+
"id": "anthropic/claude-opus-4.5",
|
|
152
|
+
"name": "Claude Opus 4.5",
|
|
153
|
+
"input_cost_per_1k": 0.015,
|
|
154
|
+
"output_cost_per_1k": 0.075,
|
|
155
|
+
"avg_cost_per_task": 0.400,
|
|
156
|
+
"quality_score": 98,
|
|
157
|
+
"speed": "slow",
|
|
158
|
+
"best_for": ["architecture", "complex reasoning", "research"]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "google/gemini-2.0-flash",
|
|
162
|
+
"name": "Gemini 2.0 Flash",
|
|
163
|
+
"input_cost_per_1k": 0.0001,
|
|
164
|
+
"output_cost_per_1k": 0.0004,
|
|
165
|
+
"avg_cost_per_task": 0.012,
|
|
166
|
+
"quality_score": 78,
|
|
167
|
+
"speed": "very fast",
|
|
168
|
+
"best_for": ["code", "quick tasks", "simple queries"]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "openai/gpt-4o-mini",
|
|
172
|
+
"name": "GPT-4o Mini",
|
|
173
|
+
"input_cost_per_1k": 0.00015,
|
|
174
|
+
"output_cost_per_1k": 0.0006,
|
|
175
|
+
"avg_cost_per_task": 0.022,
|
|
176
|
+
"quality_score": 80,
|
|
177
|
+
"speed": "fast",
|
|
178
|
+
"best_for": ["code", "writing", "quick tasks"]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "openai/gpt-4o",
|
|
182
|
+
"name": "GPT-4o",
|
|
183
|
+
"input_cost_per_1k": 0.005,
|
|
184
|
+
"output_cost_per_1k": 0.015,
|
|
185
|
+
"avg_cost_per_task": 0.095,
|
|
186
|
+
"quality_score": 94,
|
|
187
|
+
"speed": "medium",
|
|
188
|
+
"best_for": ["complex code", "writing", "research"]
|
|
134
189
|
}
|
|
135
190
|
],
|
|
191
|
+
"budget_defaults": {
|
|
192
|
+
"daily_cap": 2.40,
|
|
193
|
+
"weekly_alert_pct": 75,
|
|
194
|
+
"monthly_budget": 40.00,
|
|
195
|
+
"auto_pause_pct": 95
|
|
196
|
+
},
|
|
136
197
|
"warnings": [
|
|
137
198
|
"Only 2 days of data analyzed - confidence is optimistic",
|
|
138
199
|
"Run analysis again after 14+ days for production-grade recommendations",
|
|
139
200
|
"Cache hit rate is below optimal (19% vs 60%+ target)"
|
|
140
201
|
]
|
|
141
|
-
}
|
|
202
|
+
}
|