@kapishdima/ai-ledger 0.0.2 → 0.0.4

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/dist/cli.js CHANGED
@@ -4307,7 +4307,8 @@ async function detectProvidersFromOpenCode() {
4307
4307
  });
4308
4308
  if (res.ok) {
4309
4309
  const data = await res.json();
4310
- const ids = data.filter((p2) => p2.source === "env" || p2.source === "config").map((p2) => p2.id);
4310
+ const all = data.all ?? data;
4311
+ const ids = all.filter((p2) => p2.source === "api").map((p2) => p2.id);
4311
4312
  if (ids.length > 0)
4312
4313
  return ids;
4313
4314
  }
package/dist/plugin.js CHANGED
@@ -3769,11 +3769,12 @@ var plugin_default = async (input) => {
3769
3769
  created_at: new Date().toISOString(),
3770
3770
  synced: 0
3771
3771
  });
3772
- input.client.app.log({
3772
+ input.client.tui.showToast({
3773
3773
  body: {
3774
- service: "ai-ledger",
3775
- level: "info",
3776
- message: `${msg.providerID} (${msg.modelID}): -$${msg.cost.toFixed(4)} | balance: $${newBalance.toFixed(2)}`
3774
+ title: `ai-ledger \xB7 ${msg.providerID}`,
3775
+ message: `-$${msg.cost.toFixed(4)} | balance: $${newBalance.toFixed(2)}`,
3776
+ variant: newBalance < 0 ? "warning" : "info",
3777
+ duration: 4000
3777
3778
  }
3778
3779
  });
3779
3780
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapishdima/ai-ledger",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "AI provider balance and spending tracker for OpenCode",
5
5
  "type": "module",
6
6
  "main": "dist/plugin.js",