opencode-statboard 2.0.1 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-statboard",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Real-time dashboard for opencode token usage and cost statistics",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/index.html CHANGED
@@ -298,7 +298,7 @@ function render(d, models, trend) {
298
298
  $('tool-bars').innerHTML = d.tools.map((tool) => barRow(tool.name, tool.count, d.tools[0].count, 'var(--tool)')).join('');
299
299
  }
300
300
 
301
- const modelList = (models && models.length ? models : (d.models || []));
301
+ const modelList = (models && models.length ? models : (d.models || [])).slice().sort((a, b) => b.cost - a.cost || b.messages - a.messages);
302
302
  if (modelList.length) {
303
303
  const total = modelList.reduce((s, m) => s + m.input, 0);
304
304
  $('model-rows').innerHTML = modelList.map((m) => {