@hashimkarim/usagestat-darwin-arm64 2.0.0-alpha.4 → 2.3.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/native-manifest.json +873 -141
- package/package.json +124 -2
- package/plugins/abliteration/LICENSE +21 -0
- package/plugins/abliteration/icon.svg +5 -0
- package/plugins/abliteration/plugin.js +89 -0
- package/plugins/abliteration/plugin.json +24 -0
- package/plugins/aerostack/LICENSE +21 -0
- package/plugins/aerostack/icon.svg +1 -0
- package/plugins/aerostack/plugin.js +94 -0
- package/plugins/aerostack/plugin.json +24 -0
- package/plugins/aixy/icon.svg +1 -0
- package/plugins/aixy/plugin.js +5 -0
- package/plugins/aixy/plugin.json +9 -1
- package/plugins/antigravity/plugin.js +60 -26
- package/plugins/antigravity-cli/plugin.js +21 -5
- package/plugins/antigravity-ide/plugin.js +19 -7
- package/plugins/atlascloud/plugin.js +5 -0
- package/plugins/atlascloud/plugin.json +2 -1
- package/plugins/bifrost/icon.svg +3 -0
- package/plugins/bifrost/plugin.js +5 -0
- package/plugins/bifrost/plugin.json +9 -1
- package/plugins/chatbox/LICENSE +21 -0
- package/plugins/chatbox/icon.svg +4 -0
- package/plugins/chatbox/plugin.js +208 -0
- package/plugins/chatbox/plugin.json +24 -0
- package/plugins/claude/plugin.js +39 -2
- package/plugins/claudeplatform/LICENSE +21 -0
- package/plugins/claudeplatform/icon.svg +3 -0
- package/plugins/claudeplatform/plugin.js +244 -0
- package/plugins/claudeplatform/plugin.json +25 -0
- package/plugins/codex/plugin.js +14 -8
- package/plugins/codex/plugin.json +11 -2
- package/plugins/copilot/plugin.json +1 -0
- package/plugins/cosmic/LICENSE +21 -0
- package/plugins/cosmic/icon.svg +1 -0
- package/plugins/cosmic/plugin.js +134 -0
- package/plugins/cosmic/plugin.json +32 -0
- package/plugins/cursor/plugin.js +51 -14
- package/plugins/cursor-nightly/plugin.json +1 -1
- package/plugins/devpass/icon.svg +3 -0
- package/plugins/devpass/plugin.js +5 -0
- package/plugins/devpass/plugin.json +2 -1
- package/plugins/exa/LICENSE +21 -0
- package/plugins/exa/icon-color.svg +1 -0
- package/plugins/exa/icon.svg +1 -0
- package/plugins/exa/plugin.js +75 -0
- package/plugins/exa/plugin.json +32 -0
- package/plugins/fal/LICENSE +21 -0
- package/plugins/fal/icon-color.svg +1 -0
- package/plugins/fal/icon.svg +1 -0
- package/plugins/fal/plugin.js +74 -0
- package/plugins/fal/plugin.json +24 -0
- package/plugins/flora/LICENSE +21 -0
- package/plugins/flora/icon.svg +4 -0
- package/plugins/flora/plugin.js +93 -0
- package/plugins/flora/plugin.json +32 -0
- package/plugins/futureagi/LICENSE +21 -0
- package/plugins/futureagi/icon.svg +24 -0
- package/plugins/futureagi/plugin.js +139 -0
- package/plugins/futureagi/plugin.json +32 -0
- package/plugins/gemini-apps/LICENSE +1 -2
- package/plugins/gemini-apps/plugin.js +136 -465
- package/plugins/gemini-apps/plugin.json +13 -7
- package/plugins/gitkraken/icon.svg +2 -0
- package/plugins/gitkraken/plugin.js +5 -0
- package/plugins/gitkraken/plugin.json +9 -1
- package/plugins/googledeveloper/LICENSE +21 -0
- package/plugins/googledeveloper/icon.svg +3 -0
- package/plugins/googledeveloper/plugin.js +204 -0
- package/plugins/googledeveloper/plugin.json +25 -0
- package/plugins/helmcode/icon.svg +5 -0
- package/plugins/helmcode/plugin.js +121 -56
- package/plugins/helmcode/plugin.json +10 -2
- package/plugins/huggingface/plugin.js +6 -1
- package/plugins/huggingface/plugin.json +4 -3
- package/plugins/hyper/plugin.js +53 -47
- package/plugins/hyper/plugin.json +3 -2
- package/plugins/jetbrains-ai-assistant/LICENSE +22 -0
- package/plugins/jetbrains-ai-assistant/plugin.js +502 -16
- package/plugins/jetbrains-ai-assistant/plugin.json +27 -4
- package/plugins/kimi/plugin.js +54 -14
- package/plugins/kimi/plugin.json +46 -6
- package/plugins/langdock/LICENSE +21 -0
- package/plugins/langdock/icon.svg +4 -0
- package/plugins/langdock/plugin.js +106 -0
- package/plugins/langdock/plugin.json +25 -0
- package/plugins/linkup/LICENSE +21 -0
- package/plugins/linkup/icon.svg +10 -0
- package/plugins/linkup/plugin.js +46 -0
- package/plugins/linkup/plugin.json +24 -0
- package/plugins/lithosai/LICENSE +21 -0
- package/plugins/lithosai/icon.svg +1 -0
- package/plugins/lithosai/plugin.js +130 -0
- package/plugins/lithosai/plugin.json +26 -0
- package/plugins/llmman/icon.svg +4 -0
- package/plugins/llmman/plugin.js +5 -0
- package/plugins/llmman/plugin.json +9 -1
- package/plugins/mistral/plugin.js +54 -22
- package/plugins/munito/LICENSE +21 -0
- package/plugins/munito/icon.svg +7 -0
- package/plugins/munito/plugin.js +171 -0
- package/plugins/munito/plugin.json +24 -0
- package/plugins/muse/icon.svg +3 -0
- package/plugins/muse/plugin.js +98 -129
- package/plugins/muse/plugin.json +10 -2
- package/plugins/museai/LICENSE +21 -0
- package/plugins/museai/icon.svg +3 -0
- package/plugins/museai/plugin.js +161 -0
- package/plugins/museai/plugin.json +26 -0
- package/plugins/nous/plugin.js +5 -0
- package/plugins/nous/plugin.json +9 -1
- package/plugins/ollama/plugin.js +58 -0
- package/plugins/opencode-go/plugin.js +74 -25
- package/plugins/opendesign/LICENSE +21 -0
- package/plugins/opendesign/icon.svg +4 -0
- package/plugins/opendesign/plugin.js +108 -0
- package/plugins/opendesign/plugin.json +25 -0
- package/plugins/parallel/LICENSE +21 -0
- package/plugins/parallel/icon.svg +11 -0
- package/plugins/parallel/plugin.js +97 -0
- package/plugins/parallel/plugin.json +25 -0
- package/plugins/perplexity/LICENSE +22 -0
- package/plugins/perplexity/plugin.js +122 -0
- package/plugins/perplexity/plugin.json +36 -7
- package/plugins/qwencloud/LICENSE +21 -0
- package/plugins/qwencloud/plugin.js +197 -0
- package/plugins/qwencloud/plugin.json +17 -0
- package/plugins/raycast/icon.svg +4 -0
- package/plugins/raycast/plugin.js +6 -1
- package/plugins/raycast/plugin.json +10 -2
- package/plugins/replicate/plugin.js +5 -0
- package/plugins/replicate/plugin.json +2 -1
- package/plugins/sailresearch/LICENSE +21 -0
- package/plugins/sailresearch/icon.svg +4 -0
- package/plugins/sailresearch/plugin.js +104 -0
- package/plugins/sailresearch/plugin.json +24 -0
- package/plugins/siliconflow/LICENSE +21 -0
- package/plugins/siliconflow/icon.svg +3 -0
- package/plugins/siliconflow/plugin.js +87 -0
- package/plugins/siliconflow/plugin.json +32 -0
- package/plugins/sofya/LICENSE +21 -0
- package/plugins/sofya/icon.svg +3 -0
- package/plugins/sofya/plugin.js +86 -0
- package/plugins/sofya/plugin.json +24 -0
- package/plugins/soniox/LICENSE +21 -0
- package/plugins/soniox/icon.svg +3 -0
- package/plugins/soniox/plugin.js +103 -0
- package/plugins/soniox/plugin.json +24 -0
- package/plugins/synthetic/plugin.js +12 -0
- package/plugins/synthetic/plugin.json +51 -9
- package/plugins/tavily/LICENSE +21 -0
- package/plugins/tavily/icon.svg +3 -0
- package/plugins/tavily/plugin.js +61 -0
- package/plugins/tavily/plugin.json +24 -0
- package/plugins/tinyapi/LICENSE +21 -0
- package/plugins/tinyapi/icon.svg +4 -0
- package/plugins/tinyapi/plugin.js +73 -0
- package/plugins/tinyapi/plugin.json +25 -0
- package/plugins/traecn/LICENSE +21 -0
- package/plugins/traecn/icon.svg +3 -0
- package/plugins/traecn/plugin.js +103 -0
- package/plugins/traecn/plugin.json +25 -0
- package/plugins/tripo/LICENSE +21 -0
- package/plugins/tripo/icon.svg +4 -0
- package/plugins/tripo/plugin.js +60 -0
- package/plugins/tripo/plugin.json +24 -0
- package/plugins/typesafe/icon.svg +4 -0
- package/plugins/typesafe/plugin.js +85 -129
- package/plugins/typesafe/plugin.json +3 -2
- package/plugins/v0/plugin.js +5 -0
- package/plugins/v0/plugin.json +9 -1
- package/plugins/vercel/plugin.js +147 -0
- package/plugins/vercel/plugin.json +34 -3
- package/plugins/workbuddy/LICENSE +21 -0
- package/plugins/workbuddy/icon.svg +1 -0
- package/plugins/workbuddy/plugin.js +318 -0
- package/plugins/workbuddy/plugin.json +63 -0
- package/plugins/xai/plugin.js +9 -0
- package/plugins/xapi/LICENSE +21 -0
- package/plugins/xapi/icon.svg +1 -0
- package/plugins/xapi/plugin.js +90 -0
- package/plugins/xapi/plugin.json +25 -0
- package/plugins/xkiro/icon.svg +1 -0
- package/plugins/xkiro/plugin.js +5 -0
- package/plugins/xkiro/plugin.json +2 -1
- package/plugins/zai/plugin.js +5 -1
- package/usagestat +0 -0
- package/usagestatd +0 -0
- package/plugins/cursor-nightly/plugin.js +0 -1416
package/plugins/llmman/plugin.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
2
|
globalThis.__usagestat_bundled_options = {"labels":["Memory","Models","Additional"],"defaults":{"LLMMAN_HOST":"http://127.0.0.1:17434"},"autoMode":"api"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/llmman.js
|
|
3
5
|
function _optionalChain(ops) {
|
|
4
6
|
let lastAccessLHS = undefined;
|
|
5
7
|
let value = ops[0];
|
|
@@ -131,3 +133,6 @@ defineProvider({
|
|
|
131
133
|
};
|
|
132
134
|
},
|
|
133
135
|
});
|
|
136
|
+
|
|
137
|
+
// END UPSTREAM
|
|
138
|
+
})(globalThis.defineProvider);
|
|
@@ -13,9 +13,17 @@
|
|
|
13
13
|
"LLMMAN_API_KEY",
|
|
14
14
|
"LLMMAN_HOST"
|
|
15
15
|
],
|
|
16
|
+
"setupFields": [
|
|
17
|
+
{
|
|
18
|
+
"key": "LLMMAN_HOST",
|
|
19
|
+
"title": "Base URL",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Provider-specific account or source selection."
|
|
22
|
+
}
|
|
23
|
+
],
|
|
16
24
|
"upstream": {
|
|
17
25
|
"repository": "https://github.com/steipete/CodexBar",
|
|
18
|
-
"revision": "
|
|
26
|
+
"revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
|
|
19
27
|
"path": "Sources/CodexBarCore/Resources/Plugins/llmman.js",
|
|
20
28
|
"sha256": "eb48d35bb101fda0e3bf122eea358c6e16ea937ac72376e6e4ede52e7828d209",
|
|
21
29
|
"license": "MIT"
|
|
@@ -29,34 +29,51 @@
|
|
|
29
29
|
return { month: now.getUTCMonth() + 1, year: now.getUTCFullYear() }
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function aggregateModels(models, prices) {
|
|
32
|
+
function aggregateModels(models, prices, countsTokens) {
|
|
33
33
|
var total = 0
|
|
34
|
+
var complete = true
|
|
34
35
|
var inputTokens = 0
|
|
35
36
|
var outputTokens = 0
|
|
36
|
-
if (!models) return { cost: 0, inputTokens: 0, outputTokens: 0 }
|
|
37
|
+
if (!models) return { cost: 0, complete: true, inputTokens: 0, outputTokens: 0 }
|
|
37
38
|
var keys = Object.keys(models)
|
|
38
39
|
for (var i = 0; i < keys.length; i++) {
|
|
39
40
|
var data = models[keys[i]]
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
for (var entries of [data.input, data.output, data.cached]) {
|
|
42
|
+
var sum = sumEntries(entries, prices)
|
|
43
|
+
total += sum.cost
|
|
44
|
+
complete = complete && sum.complete
|
|
45
|
+
}
|
|
46
|
+
if (countsTokens !== false) {
|
|
47
|
+
inputTokens += countEntries(data.input)
|
|
48
|
+
outputTokens += countEntries(data.output)
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
|
-
|
|
51
|
+
if (!Number.isFinite(total)) throw new Error('Invalid Mistral billing total.')
|
|
52
|
+
return { cost: total, complete: complete, inputTokens: inputTokens, outputTokens: outputTokens }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function priceKey(entry, unqualified) {
|
|
56
|
+
return JSON.stringify([entry.event_type ?? null, entry.billing_metric ?? null, entry.billing_group ?? null,
|
|
57
|
+
unqualified ? null : entry.api_zone ?? null, unqualified ? null : entry.service_tier ?? null])
|
|
47
58
|
}
|
|
48
59
|
|
|
49
60
|
function sumEntries(entries, prices) {
|
|
50
|
-
if (!entries) return 0
|
|
61
|
+
if (!entries) return { cost: 0, complete: true }
|
|
51
62
|
var total = 0
|
|
63
|
+
var complete = true
|
|
52
64
|
for (var i = 0; i < entries.length; i++) {
|
|
53
65
|
var e = entries[i]
|
|
54
66
|
var paid = e.value_paid != null ? e.value_paid : (e.value || 0)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
if (typeof paid !== 'number' || !Number.isFinite(paid) || paid < 0)
|
|
68
|
+
throw new Error('Invalid Mistral billed quantity.')
|
|
69
|
+
if (paid === 0) continue
|
|
70
|
+
// A different event type, region or tier must never supply the price.
|
|
71
|
+
// Legacy unqualified rows are the only supported fallback.
|
|
72
|
+
var price = prices.get(priceKey(e, false)) ?? prices.get(priceKey(e, true))
|
|
73
|
+
if (price === undefined) complete = false
|
|
74
|
+
else total += paid * price
|
|
58
75
|
}
|
|
59
|
-
return total
|
|
76
|
+
return { cost: total, complete: complete }
|
|
60
77
|
}
|
|
61
78
|
|
|
62
79
|
function countEntries(entries) {
|
|
@@ -71,13 +88,14 @@
|
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
function buildPriceIndex(prices) {
|
|
74
|
-
var index =
|
|
91
|
+
var index = new Map()
|
|
75
92
|
if (!prices) return index
|
|
76
93
|
for (var i = 0; i < prices.length; i++) {
|
|
77
94
|
var p = prices[i]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
95
|
+
var validPrice = typeof p.price === 'number' || (typeof p.price === 'string' && p.price.trim() !== '')
|
|
96
|
+
var price = validPrice ? Number(p.price) : NaN
|
|
97
|
+
if (p.billing_metric && p.billing_group && Number.isFinite(price) && price >= 0) {
|
|
98
|
+
index.set(priceKey(p, false), price)
|
|
81
99
|
}
|
|
82
100
|
}
|
|
83
101
|
return index
|
|
@@ -217,6 +235,7 @@
|
|
|
217
235
|
var symbol = billing.currency_symbol || "€"
|
|
218
236
|
|
|
219
237
|
var totalCost = 0
|
|
238
|
+
var completeCost = true
|
|
220
239
|
var totalInput = 0
|
|
221
240
|
var totalOutput = 0
|
|
222
241
|
|
|
@@ -225,26 +244,39 @@
|
|
|
225
244
|
if (!completions[c] || !completions[c].models) continue
|
|
226
245
|
var r = aggregateModels(completions[c].models, prices)
|
|
227
246
|
totalCost += r.cost; totalInput += r.inputTokens; totalOutput += r.outputTokens
|
|
247
|
+
completeCost = completeCost && r.complete
|
|
228
248
|
}
|
|
229
249
|
|
|
230
250
|
var extras = [billing.ocr, billing.connectors, billing.audio]
|
|
231
251
|
for (var i = 0; i < extras.length; i++) {
|
|
232
252
|
if (extras[i] && extras[i].models) {
|
|
233
|
-
|
|
253
|
+
var extra = aggregateModels(extras[i].models, prices, false)
|
|
254
|
+
totalCost += extra.cost
|
|
255
|
+
completeCost = completeCost && extra.complete
|
|
234
256
|
}
|
|
235
257
|
}
|
|
236
258
|
|
|
237
259
|
if (billing.libraries_api) {
|
|
238
260
|
var lib = billing.libraries_api
|
|
239
|
-
|
|
240
|
-
|
|
261
|
+
for (var category of [lib.pages, lib.tokens]) {
|
|
262
|
+
var extra = aggregateModels(category && category.models, prices, false)
|
|
263
|
+
totalCost += extra.cost
|
|
264
|
+
completeCost = completeCost && extra.complete
|
|
265
|
+
}
|
|
241
266
|
}
|
|
242
267
|
|
|
243
|
-
|
|
268
|
+
if (billing.fine_tuning) for (var category of [billing.fine_tuning.training, billing.fine_tuning.storage]) {
|
|
269
|
+
var extra = aggregateModels(category, prices, false)
|
|
270
|
+
totalCost += extra.cost
|
|
271
|
+
completeCost = completeCost && extra.complete
|
|
272
|
+
}
|
|
273
|
+
if (!Number.isFinite(totalCost)) throw new Error('Invalid Mistral billing total.')
|
|
274
|
+
var costStr = symbol + totalCost.toFixed(4) + (completeCost ? "" : "+") + " this month (" + currency + ")"
|
|
244
275
|
var tokenDetail = totalInput + " in / " + totalOutput + " out tokens"
|
|
245
276
|
|
|
246
277
|
var lines = [
|
|
247
|
-
ctx.line.text({ label: "Monthly spend", value: costStr
|
|
278
|
+
ctx.line.text({ label: "Monthly spend", value: costStr,
|
|
279
|
+
subtitle: completeCost ? undefined : "Partial total: some billing rows have no matching price." }),
|
|
248
280
|
ctx.line.text({ label: "Tokens", value: tokenDetail }),
|
|
249
281
|
]
|
|
250
282
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Peter Steinberger
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg fill="currentColor" viewBox="-11.8 -11.8 55.6 55.6" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Munito</title>
|
|
3
|
+
<path d="M8 0h24v1h-24zM7 1h24v1h-24zM6 2h24v1h-24zM5 3h24v1h-24zM4 4h24v1h-24zM3 5h24v1h-24zM2 6h24v1h-24zM1 7h24v1h-24z" opacity=".55"/>
|
|
4
|
+
<path d="M0 8h24v1h-24zM0 9h24v1h-24zM0 10h24v1h-24zM0 11h24v1h-24zM0 12h24v1h-24zM0 13h24v1h-24zM0 14h24v1h-24zM0 15h24v1h-24zM0 16h6v1h-6zM10 16h4v1h-4zM18 16h6v1h-6zM0 17h6v1h-6zM10 17h4v1h-4zM18 17h6v1h-6zM0 18h6v1h-6zM10 18h4v1h-4zM18 18h6v1h-6zM0 19h6v1h-6zM10 19h4v1h-4zM18 19h6v1h-6zM0 20h6v1h-6zM10 20h4v1h-4zM18 20h6v1h-6zM0 21h6v1h-6zM10 21h4v1h-4zM18 21h6v1h-6zM0 22h24v1h-24zM0 23h24v1h-24zM0 24h24v1h-24zM0 25h24v1h-24zM0 26h24v1h-24zM0 27h24v1h-24zM0 28h24v1h-24zM0 29h24v1h-24zM0 30h24v1h-24zM0 31h24v1h-24z"/>
|
|
5
|
+
<path d="M31 1h1v1h-1zM30 2h2v1h-2zM29 3h3v1h-3zM28 4h4v1h-4zM27 5h5v1h-5zM26 6h6v1h-6zM25 7h7v1h-7zM24 8h6v1h-6zM31 8h1v1h-1zM24 9h6v1h-6zM31 9h1v1h-1zM24 10h4v1h-4zM29 10h1v1h-1zM31 10h1v1h-1zM24 11h3v1h-3zM29 11h1v1h-1zM31 11h1v1h-1zM24 12h2v1h-2zM29 12h1v1h-1zM31 12h1v1h-1zM24 13h2v1h-2zM27 13h1v1h-1zM29 13h1v1h-1zM31 13h1v1h-1zM24 14h2v1h-2zM27 14h1v1h-1zM29 14h1v1h-1zM31 14h1v1h-1zM24 15h2v1h-2zM29 15h1v1h-1zM31 15h1v1h-1zM24 16h2v1h-2zM29 16h1v1h-1zM31 16h1v1h-1zM24 17h2v1h-2zM27 17h1v1h-1zM29 17h1v1h-1zM31 17h1v1h-1zM24 18h2v1h-2zM27 18h1v1h-1zM29 18h3v1h-3zM24 19h2v1h-2zM27 19h1v1h-1zM29 19h3v1h-3zM24 20h2v1h-2zM27 20h5v1h-5zM24 21h2v1h-2zM27 21h5v1h-5zM24 22h8v1h-8zM24 23h8v1h-8zM24 24h7v1h-7zM24 25h6v1h-6zM24 26h5v1h-5zM24 27h4v1h-4zM24 28h3v1h-3zM24 29h2v1h-2zM24 30h1v1h-1z" opacity=".35"/>
|
|
6
|
+
<path d="M30 8h1v1h-1zM30 9h1v1h-1zM28 10h1v1h-1zM30 10h1v1h-1zM27 11h2v1h-2zM30 11h1v1h-1zM26 12h3v1h-3zM30 12h1v1h-1zM26 13h1v1h-1zM28 13h1v1h-1zM30 13h1v1h-1zM26 14h1v1h-1zM28 14h1v1h-1zM30 14h1v1h-1zM26 15h3v1h-3zM30 15h1v1h-1zM26 16h3v1h-3zM30 16h1v1h-1zM26 17h1v1h-1zM28 17h1v1h-1zM30 17h1v1h-1zM26 18h1v1h-1zM28 18h1v1h-1zM26 19h1v1h-1zM28 19h1v1h-1zM26 20h1v1h-1zM26 21h1v1h-1z" opacity=".8"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
|
+
globalThis.__usagestat_bundled_options = {"labels":["Daily spend limit","Monthly spend limit","Additional"],"defaults":{},"autoMode":"api"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/munito.js
|
|
5
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
6
|
+
if (lhs != null) {
|
|
7
|
+
return lhs;
|
|
8
|
+
} else {
|
|
9
|
+
return rhsFn();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
defineProvider({
|
|
13
|
+
id: "munito",
|
|
14
|
+
name: "Munito",
|
|
15
|
+
endpoints: ["https://api.munito.ai"],
|
|
16
|
+
auth: { type: "bearer", secret: "MUNITO_API_KEY" },
|
|
17
|
+
settings: [{ key: "MUNITO_API_KEY", title: "Munito admin API key", type: "secure" }],
|
|
18
|
+
capabilities: ["http-status"],
|
|
19
|
+
async fetchUsage(ctx) {
|
|
20
|
+
const base = "https://api.munito.ai/admin/v1";
|
|
21
|
+
const response = await ctx.http.getWithOptional(`${base}/limits`, `${base}/organization`, {
|
|
22
|
+
retryPolicy: "transientIdempotent",
|
|
23
|
+
});
|
|
24
|
+
const message = `Munito returned HTTP ${response.status}.`;
|
|
25
|
+
if (response.status === 401) throw ctx.fail.authenticationExpired(message);
|
|
26
|
+
if (response.status === 403) {
|
|
27
|
+
throw ctx.fail.permissionDenied(
|
|
28
|
+
"Munito rejected the key: the Admin API needs a key with Read account data permission.",
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
// The native transientIdempotent retry already honors Retry-After; an explicit retry hint
|
|
32
|
+
// here would schedule a second, outer retry cycle (docs/plugins.md plugin retry contract).
|
|
33
|
+
if (response.status === 429) throw ctx.fail.rateLimited(message);
|
|
34
|
+
if (response.status >= 500) throw ctx.fail.providerUnavailable(message);
|
|
35
|
+
if (response.status !== 200) throw ctx.fail.apiFailure(message);
|
|
36
|
+
const fail = () => {
|
|
37
|
+
throw ctx.fail.parseFailure("Munito returned an unrecognized spend limits response.");
|
|
38
|
+
};
|
|
39
|
+
let root;
|
|
40
|
+
try {
|
|
41
|
+
root = JSON.parse(response.bodyText);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
void error;
|
|
44
|
+
return fail();
|
|
45
|
+
}
|
|
46
|
+
if (!root || typeof root !== "object" || Array.isArray(root)) return fail();
|
|
47
|
+
const body = root;
|
|
48
|
+
const text = (value) => (typeof value === "string" && value.trim() ? value.trim() : undefined);
|
|
49
|
+
const money = (value, field) => {
|
|
50
|
+
const number =
|
|
51
|
+
typeof value === "number"
|
|
52
|
+
? value
|
|
53
|
+
: typeof value === "string" && /^\s*-?\d+(?:\.\d+)?\s*$/.test(value)
|
|
54
|
+
? Number(value)
|
|
55
|
+
: NaN;
|
|
56
|
+
if (!Number.isFinite(number) || number < 0) {
|
|
57
|
+
throw ctx.fail.parseFailure(`Munito returned an unusable ${field}.`);
|
|
58
|
+
}
|
|
59
|
+
return number;
|
|
60
|
+
};
|
|
61
|
+
const limit = (value, field) => (value == null ? undefined : money(value, field));
|
|
62
|
+
if (!Array.isArray(body.periods)) return fail();
|
|
63
|
+
|
|
64
|
+
const periods = [];
|
|
65
|
+
for (const raw of body.periods) {
|
|
66
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return fail();
|
|
67
|
+
const entry = raw;
|
|
68
|
+
const kind = text(entry.period);
|
|
69
|
+
if (kind !== "day" && kind !== "month") continue;
|
|
70
|
+
const stopped = text(entry.stopped_until);
|
|
71
|
+
let stoppedUntil;
|
|
72
|
+
if (stopped) {
|
|
73
|
+
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(stopped)) return fail();
|
|
74
|
+
try {
|
|
75
|
+
stoppedUntil = ctx.date.iso(stopped);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
void error;
|
|
78
|
+
return fail();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
periods.push({
|
|
82
|
+
period: kind,
|
|
83
|
+
spent: money(entry.spent_usd, `${kind} spend`),
|
|
84
|
+
limit: limit(entry.limit_usd, `${kind} limit`),
|
|
85
|
+
organizationLimit: limit(entry.organization_limit_usd, `${kind} organization limit`),
|
|
86
|
+
accountLimit: limit(entry.account_limit_usd, `${kind} account limit`),
|
|
87
|
+
stoppedUntil,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const find = (kind) => periods.find((entry) => entry.period === kind);
|
|
91
|
+
const day = find("day");
|
|
92
|
+
const month = find("month");
|
|
93
|
+
// The organization is a best-effort companion read; spend and limits stay authoritative.
|
|
94
|
+
let organization;
|
|
95
|
+
if (response.optional && response.optional.status === 200) {
|
|
96
|
+
try {
|
|
97
|
+
const parsed = JSON.parse(response.optional.bodyText);
|
|
98
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) organization = parsed;
|
|
99
|
+
} catch (error) {
|
|
100
|
+
void error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const usageTier = _nullishCoalesce(text(body.usage_tier), () =>
|
|
104
|
+
organization ? text(organization.usage_tier) : undefined,
|
|
105
|
+
);
|
|
106
|
+
const rows = [];
|
|
107
|
+
const moneyRow = (label, entry) => {
|
|
108
|
+
const spend = ctx.format.usd(entry.spent);
|
|
109
|
+
rows.push({
|
|
110
|
+
label,
|
|
111
|
+
value: entry.limit && entry.limit > 0 ? `${spend} of ${ctx.format.usd(entry.limit)}` : spend,
|
|
112
|
+
progress: entry.limit && entry.limit > 0 ? Math.min(1, entry.spent / entry.limit) : undefined,
|
|
113
|
+
usageValue: entry.spent,
|
|
114
|
+
});
|
|
115
|
+
const organizational =
|
|
116
|
+
entry.organizationLimit != null && entry.organizationLimit > 0 && entry.organizationLimit !== entry.limit
|
|
117
|
+
? entry.organizationLimit
|
|
118
|
+
: undefined;
|
|
119
|
+
const account =
|
|
120
|
+
entry.accountLimit != null && entry.accountLimit > 0 && entry.accountLimit !== entry.limit
|
|
121
|
+
? entry.accountLimit
|
|
122
|
+
: undefined;
|
|
123
|
+
if (organizational != null) {
|
|
124
|
+
rows.push({ label: `${label} organization limit`, value: ctx.format.usd(organizational) });
|
|
125
|
+
}
|
|
126
|
+
if (account != null) {
|
|
127
|
+
rows.push({ label: `${label} account limit`, value: ctx.format.usd(account) });
|
|
128
|
+
}
|
|
129
|
+
if (entry.stoppedUntil) rows.push({ label: `${label} stopped until`, value: entry.stoppedUntil.toISOString() });
|
|
130
|
+
};
|
|
131
|
+
if (day) moneyRow("Today", day);
|
|
132
|
+
if (month) moneyRow("This month", month);
|
|
133
|
+
if (usageTier) rows.push({ label: "Usage tier", value: usageTier });
|
|
134
|
+
const details = [];
|
|
135
|
+
if (rows.length) details.push({ title: "Spend limits", rows });
|
|
136
|
+
const organizationRows = [];
|
|
137
|
+
if (organization) {
|
|
138
|
+
const status = text(organization.status);
|
|
139
|
+
if (status) organizationRows.push({ label: "Status", value: status.charAt(0).toUpperCase() + status.slice(1) });
|
|
140
|
+
const region = text(organization.data_region);
|
|
141
|
+
if (region) organizationRows.push({ label: "Data region", value: region });
|
|
142
|
+
if (organizationRows.length) details.push({ title: "Organization", rows: organizationRows });
|
|
143
|
+
}
|
|
144
|
+
// The identity keeps the card visible even when every period is temporarily absent;
|
|
145
|
+
// spend windows and cost appear only while Munito reports them.
|
|
146
|
+
return {
|
|
147
|
+
primary:
|
|
148
|
+
day && day.limit && day.limit > 0 ? { usedPercent: ctx.pct(day.spent, day.limit), windowMinutes: 1440 } : null,
|
|
149
|
+
secondary: month && month.limit && month.limit > 0 ? { usedPercent: ctx.pct(month.spent, month.limit) } : null,
|
|
150
|
+
cost:
|
|
151
|
+
month != null || day != null
|
|
152
|
+
? {
|
|
153
|
+
used: _nullishCoalesce(month, () => day).spent,
|
|
154
|
+
limit: _nullishCoalesce(_nullishCoalesce(month, () => day).limit, () => 0),
|
|
155
|
+
currency: "USD",
|
|
156
|
+
period: month ? "This month" : "Today",
|
|
157
|
+
}
|
|
158
|
+
: null,
|
|
159
|
+
details,
|
|
160
|
+
identity: {
|
|
161
|
+
organization: organization ? text(organization.name) : undefined,
|
|
162
|
+
accountID: organization ? text(organization.id) : undefined,
|
|
163
|
+
loginMethod: "Admin API key",
|
|
164
|
+
},
|
|
165
|
+
dataConfidence: "exact",
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// END UPSTREAM
|
|
171
|
+
})(globalThis.defineProvider);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "munito",
|
|
4
|
+
"name": "Munito",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": [
|
|
9
|
+
"api"
|
|
10
|
+
],
|
|
11
|
+
"autoMode": "api",
|
|
12
|
+
"usageDashboardUrl": "https://app.munito.ai",
|
|
13
|
+
"envVars": [
|
|
14
|
+
"MUNITO_API_KEY"
|
|
15
|
+
],
|
|
16
|
+
"setupFields": [],
|
|
17
|
+
"upstream": {
|
|
18
|
+
"repository": "https://github.com/steipete/CodexBar",
|
|
19
|
+
"revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
|
|
20
|
+
"path": "Sources/CodexBarCore/Resources/Plugins/munito.js",
|
|
21
|
+
"sha256": "6feee407bd3765acb723bca995e660ee9dc8d556e51bfdff158686e3ffaf0ffe",
|
|
22
|
+
"license": "MIT"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill="currentColor" d="M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.667 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z"/>
|
|
3
|
+
</svg>
|