@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 +2 -1
- package/dist/plugin.js +5 -4
- package/package.json +1 -1
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
|
|
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.
|
|
3772
|
+
input.client.tui.showToast({
|
|
3773
3773
|
body: {
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
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
|
}
|