@hashimkarim/usagestat-linux-x64-gnu 2.0.2 → 2.1.0
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 +685 -133
- package/package.json +94 -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 +19 -10
- package/plugins/antigravity-cli/plugin.js +8 -3
- package/plugins/antigravity-ide/plugin.js +8 -5
- 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 +3 -2
- package/plugins/codex/plugin.json +1 -1
- 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 +9 -2
- 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/helmcode/icon.svg +5 -0
- package/plugins/helmcode/plugin.js +48 -40
- 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/kimi/plugin.js +39 -14
- 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/plugin.js +5 -0
- package/plugins/lithosai/plugin.json +2 -1
- package/plugins/llmman/icon.svg +4 -0
- package/plugins/llmman/plugin.js +5 -0
- package/plugins/llmman/plugin.json +9 -1
- 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 +5 -0
- package/plugins/muse/plugin.json +9 -1
- package/plugins/museai/plugin.js +5 -0
- package/plugins/museai/plugin.json +2 -1
- 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 +17 -6
- 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/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 +5 -0
- package/plugins/raycast/plugin.json +9 -1
- 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/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/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 +104 -0
- package/plugins/traecn/plugin.json +25 -0
- package/plugins/typesafe/icon.svg +4 -0
- package/plugins/typesafe/plugin.js +30 -25
- 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/icon.svg +1 -1
- package/plugins/workbuddy/plugin.js +9 -4
- package/plugins/workbuddy/plugin.json +20 -2
- 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/usagestat +0 -0
- package/usagestatd +0 -0
- package/plugins/cursor-nightly/plugin.js +0 -1416
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
|
+
globalThis.__usagestat_bundled_options = {"labels":["Balance","Additional","Additional"],"defaults":{},"autoMode":"api"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/sailresearch.js
|
|
5
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
6
|
+
if (lhs != null) {
|
|
7
|
+
return lhs;
|
|
8
|
+
} else {
|
|
9
|
+
return rhsFn();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _optionalChain(ops) {
|
|
13
|
+
let lastAccessLHS = undefined;
|
|
14
|
+
let value = ops[0];
|
|
15
|
+
let i = 1;
|
|
16
|
+
while (i < ops.length) {
|
|
17
|
+
const op = ops[i];
|
|
18
|
+
const fn = ops[i + 1];
|
|
19
|
+
i += 2;
|
|
20
|
+
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (op === "access" || op === "optionalAccess") {
|
|
24
|
+
lastAccessLHS = value;
|
|
25
|
+
value = fn(value);
|
|
26
|
+
} else if (op === "call" || op === "optionalCall") {
|
|
27
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
28
|
+
lastAccessLHS = undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
defineProvider({
|
|
34
|
+
id: "sailresearch",
|
|
35
|
+
name: "Sail Research",
|
|
36
|
+
endpoints: ["https://api.sailresearch.com"],
|
|
37
|
+
auth: { type: "bearer", secret: "SAIL_API_KEY" },
|
|
38
|
+
settings: [{ key: "SAIL_API_KEY", title: "Sail Research API key", type: "secure" }],
|
|
39
|
+
capabilities: ["http-status"],
|
|
40
|
+
async fetchUsage(ctx) {
|
|
41
|
+
const response = await ctx.http.get("https://api.sailresearch.com/v2/usage/summary?range=30d");
|
|
42
|
+
const message = `Sail Research returned HTTP ${response.status}.`;
|
|
43
|
+
if (response.status === 401) throw ctx.fail.authenticationExpired(message);
|
|
44
|
+
if (response.status === 402)
|
|
45
|
+
throw ctx.fail.apiFailure("Sail Research disabled this API key because credits are exhausted.");
|
|
46
|
+
if (response.status === 403) throw ctx.fail.permissionDenied("Sail Research API key has no organization access.");
|
|
47
|
+
if (response.status === 429) {
|
|
48
|
+
const delay = Number(_nullishCoalesce(response.headers["retry-after"], () => 1));
|
|
49
|
+
throw ctx.fail.rateLimited(message, {
|
|
50
|
+
retryAfterSeconds: Number.isFinite(delay) && delay >= 0 ? Math.min(delay, 10) : 1,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (response.status >= 500) throw ctx.fail.providerUnavailable(message);
|
|
54
|
+
if (response.status !== 200) throw ctx.fail.apiFailure(message);
|
|
55
|
+
function fail() {
|
|
56
|
+
throw ctx.fail.parseFailure("Sail Research returned an unrecognized billing summary.");
|
|
57
|
+
}
|
|
58
|
+
let data;
|
|
59
|
+
try {
|
|
60
|
+
data = JSON.parse(response.bodyText);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
void error;
|
|
63
|
+
return fail();
|
|
64
|
+
}
|
|
65
|
+
if (
|
|
66
|
+
_optionalChain([data, "optionalAccess", (_) => _.object]) !== "usage.summary" ||
|
|
67
|
+
typeof data.available !== "boolean"
|
|
68
|
+
)
|
|
69
|
+
return fail();
|
|
70
|
+
if (!data.available) throw ctx.fail.providerUnavailable("Sail Research billing data is unavailable.");
|
|
71
|
+
if (typeof data.has_metronome_customer !== "boolean") return fail();
|
|
72
|
+
if (!data.has_metronome_customer) throw ctx.fail.apiFailure("Sail Research organization has no billing account.");
|
|
73
|
+
if (typeof data.balance_unavailable !== "boolean") return fail();
|
|
74
|
+
function dollars(key) {
|
|
75
|
+
const value = data[key];
|
|
76
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return fail();
|
|
77
|
+
return value / 100;
|
|
78
|
+
}
|
|
79
|
+
const spend = dollars("period_spend");
|
|
80
|
+
if (spend < 0) return fail();
|
|
81
|
+
const rangeLabels = {
|
|
82
|
+
"1h": "Last hour spend",
|
|
83
|
+
"6h": "Last 6 hours spend",
|
|
84
|
+
"24h": "Last 24 hours spend",
|
|
85
|
+
"7d": "Last 7 days spend",
|
|
86
|
+
"30d": "Last 30 days spend",
|
|
87
|
+
period: "Billing-period spend",
|
|
88
|
+
};
|
|
89
|
+
const rangeLabel = typeof data.effective_range === "string" ? rangeLabels[data.effective_range] : null;
|
|
90
|
+
if (typeof rangeLabel !== "string") return fail();
|
|
91
|
+
const rows = [
|
|
92
|
+
{ label: "Credit balance", value: data.balance_unavailable ? "Unavailable" : ctx.format.usd(dollars("balance")) },
|
|
93
|
+
{ label: rangeLabel, value: ctx.format.usd(spend) },
|
|
94
|
+
];
|
|
95
|
+
return {
|
|
96
|
+
details: [{ title: "Organization billing", rows }],
|
|
97
|
+
identity: { loginMethod: "API key" },
|
|
98
|
+
dataConfidence: "exact",
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// END UPSTREAM
|
|
104
|
+
})(globalThis.defineProvider);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "sailresearch",
|
|
4
|
+
"name": "Sail Research",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": [
|
|
9
|
+
"api"
|
|
10
|
+
],
|
|
11
|
+
"autoMode": "api",
|
|
12
|
+
"usageDashboardUrl": "https://sailresearch.com",
|
|
13
|
+
"envVars": [
|
|
14
|
+
"SAIL_API_KEY"
|
|
15
|
+
],
|
|
16
|
+
"setupFields": [],
|
|
17
|
+
"upstream": {
|
|
18
|
+
"repository": "https://github.com/steipete/CodexBar",
|
|
19
|
+
"revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
|
|
20
|
+
"path": "Sources/CodexBarCore/Resources/Plugins/sailresearch.js",
|
|
21
|
+
"sha256": "3823be0a067659d6ae8dc4691e1b346cc7c7656e7f57134c12d898babcebb809",
|
|
22
|
+
"license": "MIT"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -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,86 @@
|
|
|
1
|
+
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
|
+
globalThis.__usagestat_bundled_options = {"labels":["Credits","Additional","Additional"],"defaults":{},"autoMode":"api"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/sofya.js
|
|
5
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
6
|
+
if (lhs != null) {
|
|
7
|
+
return lhs;
|
|
8
|
+
} else {
|
|
9
|
+
return rhsFn();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
defineProvider({
|
|
13
|
+
id: "sofya",
|
|
14
|
+
name: "Sofya",
|
|
15
|
+
endpoints: ["https://sofya.co"],
|
|
16
|
+
auth: { type: "bearer", secret: "SOFYA_API_KEY" },
|
|
17
|
+
settings: [{ key: "SOFYA_API_KEY", title: "Sofya API key", type: "secure" }],
|
|
18
|
+
capabilities: ["http-status"],
|
|
19
|
+
async fetchUsage(ctx) {
|
|
20
|
+
const response = await ctx.http.get("https://sofya.co/v1/auth/me");
|
|
21
|
+
const message = `Sofya returned HTTP ${response.status}.`;
|
|
22
|
+
if (response.status === 401) throw ctx.fail.authenticationExpired(message);
|
|
23
|
+
if (response.status === 403) throw ctx.fail.permissionDenied(message);
|
|
24
|
+
if (response.status === 429) {
|
|
25
|
+
const delay = Number(_nullishCoalesce(response.headers["retry-after"], () => 1));
|
|
26
|
+
throw ctx.fail.rateLimited(message, {
|
|
27
|
+
retryAfterSeconds: Number.isFinite(delay) && delay >= 0 ? Math.min(delay, 10) : 1,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (response.status >= 500) throw ctx.fail.providerUnavailable(message);
|
|
31
|
+
if (response.status !== 200) throw ctx.fail.apiFailure(message);
|
|
32
|
+
function fail() {
|
|
33
|
+
throw ctx.fail.parseFailure("Sofya returned an unrecognized account credit response.");
|
|
34
|
+
}
|
|
35
|
+
let data;
|
|
36
|
+
try {
|
|
37
|
+
data = JSON.parse(response.bodyText);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
void error;
|
|
40
|
+
return fail();
|
|
41
|
+
}
|
|
42
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return fail();
|
|
43
|
+
const rows = [];
|
|
44
|
+
for (const [key, label] of [
|
|
45
|
+
["credits", "Available credits"],
|
|
46
|
+
["plan_credits", "Plan credits"],
|
|
47
|
+
["purchased_credits", "Purchased credits"],
|
|
48
|
+
]) {
|
|
49
|
+
const value = data[key];
|
|
50
|
+
if (value === null || value === undefined) continue;
|
|
51
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) return fail();
|
|
52
|
+
rows.push({ label, value: ctx.format.number(value, { maximumFractionDigits: 6 }) });
|
|
53
|
+
}
|
|
54
|
+
if (!rows.length) return fail();
|
|
55
|
+
const eligible = data.is_free_tier;
|
|
56
|
+
if (eligible !== undefined && eligible !== null && typeof eligible !== "boolean") return fail();
|
|
57
|
+
const reset = data.credits_reset_at;
|
|
58
|
+
if (reset !== undefined && reset !== null) {
|
|
59
|
+
if (
|
|
60
|
+
typeof reset !== "string" ||
|
|
61
|
+
!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(reset)
|
|
62
|
+
)
|
|
63
|
+
return fail();
|
|
64
|
+
const date = new Date(reset);
|
|
65
|
+
const [year, month, day] = reset.slice(0, 10).split("-").map(Number);
|
|
66
|
+
if (!Number.isFinite(date.getTime()) || day > new Date(Date.UTC(year, month, 0)).getUTCDate()) return fail();
|
|
67
|
+
if (eligible === true) {
|
|
68
|
+
rows.push({
|
|
69
|
+
label: "Monthly reset",
|
|
70
|
+
value: date
|
|
71
|
+
.toISOString()
|
|
72
|
+
.replace("T", " ")
|
|
73
|
+
.replace(/(?:\.000)?Z$/, " UTC"),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
details: [{ title: "Account credits", rows }],
|
|
79
|
+
identity: { loginMethod: eligible === true ? "Free tier" : eligible === false ? "Pay as you go" : "API" },
|
|
80
|
+
dataConfidence: "exact",
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// END UPSTREAM
|
|
86
|
+
})(globalThis.defineProvider);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "sofya",
|
|
4
|
+
"name": "Sofya",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": [
|
|
9
|
+
"api"
|
|
10
|
+
],
|
|
11
|
+
"autoMode": "api",
|
|
12
|
+
"usageDashboardUrl": "https://sofya.co",
|
|
13
|
+
"envVars": [
|
|
14
|
+
"SOFYA_API_KEY"
|
|
15
|
+
],
|
|
16
|
+
"setupFields": [],
|
|
17
|
+
"upstream": {
|
|
18
|
+
"repository": "https://github.com/steipete/CodexBar",
|
|
19
|
+
"revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
|
|
20
|
+
"path": "Sources/CodexBarCore/Resources/Plugins/sofya.js",
|
|
21
|
+
"sha256": "4190c42d42a1b70b6ed284821ef7803420564b4b020e939e60d79e4b0991c281",
|
|
22
|
+
"license": "MIT"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -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,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-4 -3 23 23" fill="currentColor">
|
|
2
|
+
<path d="m0 14.866 2.1606-3.5214c1.8927 1.2576 3.9669 1.8995 5.6694 1.8995 1.0025 0 1.4606-0.3036 1.4606-0.8847v-0.0607c0-0.6419-0.9161-0.9194-2.6532-1.4138-3.2582-0.8587-5.8509-1.9602-5.8509-5.2995v-0.06938c0-3.5214 2.8088-5.4903 6.6114-5.4903 2.4112 0 4.9089 0.70255 6.8016 1.9342l-1.9791 3.6775c-1.7112-0.95408-3.5693-1.5352-4.8744-1.5352-0.88152 0-1.3396 0.33827-1.3396 0.79796v0.06071c0 0.64184 0.94202 0.95409 2.6792 1.4745 3.2582 0.91939 5.8509 2.0556 5.8509 5.2735v0.0607c0 3.6515-2.7137 5.551-6.741 5.551-2.7656-0.0087-5.5052-0.798-7.7955-2.4546z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
|
+
globalThis.__usagestat_bundled_options = {"labels":["Monthly budget","Additional","Additional"],"defaults":{},"autoMode":"api"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/soniox.js
|
|
5
|
+
defineProvider({
|
|
6
|
+
id: "soniox",
|
|
7
|
+
name: "Soniox",
|
|
8
|
+
endpoints: ["https://api.soniox.com"],
|
|
9
|
+
auth: { type: "bearer", secret: "SONIOX_ORG_API_KEY" },
|
|
10
|
+
settings: [{ key: "SONIOX_ORG_API_KEY", title: "Organization API key", type: "secure" }],
|
|
11
|
+
async fetchUsage(ctx) {
|
|
12
|
+
const invalid = (field) => {
|
|
13
|
+
throw ctx.fail.parseFailure(
|
|
14
|
+
`Soniox returned invalid billing data: ${field}. Refresh to try again. If this persists, update CodexBar or report the issue.`,
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
const money = (value, field, signed = false) => {
|
|
18
|
+
if (typeof value !== "string" || !/^-?\d+(?:\.\d+)?$/.test(value.trim())) return invalid(field);
|
|
19
|
+
const amount = Number(value);
|
|
20
|
+
if (!Number.isFinite(amount) || (!signed && amount < 0)) return invalid(field);
|
|
21
|
+
return amount;
|
|
22
|
+
};
|
|
23
|
+
const get = async (path) => {
|
|
24
|
+
const response = await ctx.http.get(`https://api.soniox.com/v1/organization/${path}`);
|
|
25
|
+
if (response.status === 401) {
|
|
26
|
+
throw ctx.fail.authenticationExpired(
|
|
27
|
+
"Soniox rejected the organization API key. Check that it has not been revoked.",
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
if (response.status === 403) {
|
|
31
|
+
throw ctx.fail.permissionDenied(
|
|
32
|
+
"Soniox requires an organization API key with Balance and spend and Usage and limits access. Project API keys are not supported.",
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
if (response.status === 429) {
|
|
36
|
+
throw ctx.fail.rateLimited("Soniox rate limit reached (HTTP 429). Wait a moment, then refresh.");
|
|
37
|
+
}
|
|
38
|
+
if (response.status >= 500) {
|
|
39
|
+
throw ctx.fail.providerUnavailable(
|
|
40
|
+
`Soniox is temporarily unavailable (HTTP ${response.status}). Try again later or check https://status.soniox.com.`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if (response.status !== 200) {
|
|
44
|
+
throw ctx.fail.apiFailure(
|
|
45
|
+
`Soniox billing request failed (HTTP ${response.status}). Refresh to try again. If this persists, update CodexBar or report the issue.`,
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
let data;
|
|
49
|
+
try {
|
|
50
|
+
data = JSON.parse(response.bodyText);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
void error;
|
|
53
|
+
return invalid("invalid JSON");
|
|
54
|
+
}
|
|
55
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return invalid("expected an object");
|
|
56
|
+
return data;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const billing = await get("balance");
|
|
60
|
+
const available = money(billing.available_balance_usd, "available_balance_usd", true);
|
|
61
|
+
if (typeof billing.invoice_billing_enabled !== "boolean") return invalid("invoice_billing_enabled");
|
|
62
|
+
const monthly = await get("usage/monthly");
|
|
63
|
+
const used = money(monthly.usage_usd, "usage_usd");
|
|
64
|
+
const budget = money(monthly.monthly_budget_usd, "monthly_budget_usd");
|
|
65
|
+
if (typeof monthly.month !== "string" || !/^\d{4}-(0[1-9]|1[0-2])$/.test(monthly.month)) {
|
|
66
|
+
return invalid("month");
|
|
67
|
+
}
|
|
68
|
+
const resetsAt = new Date(`${monthly.month}-01T00:00:00Z`);
|
|
69
|
+
resetsAt.setUTCMonth(resetsAt.getUTCMonth() + 1);
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
primary:
|
|
73
|
+
budget > 0
|
|
74
|
+
? {
|
|
75
|
+
usedPercent: ctx.pct(used, budget),
|
|
76
|
+
resetsAt,
|
|
77
|
+
resetDescription: `${ctx.format.usd(used)} / ${ctx.format.usd(budget)}`,
|
|
78
|
+
}
|
|
79
|
+
: undefined,
|
|
80
|
+
cost: {
|
|
81
|
+
used,
|
|
82
|
+
limit: budget,
|
|
83
|
+
currency: "USD",
|
|
84
|
+
period: "This month",
|
|
85
|
+
resetsAt,
|
|
86
|
+
balance: billing.invoice_billing_enabled ? undefined : available,
|
|
87
|
+
},
|
|
88
|
+
details: [
|
|
89
|
+
{
|
|
90
|
+
title: "Billing",
|
|
91
|
+
rows: [
|
|
92
|
+
{ label: billing.invoice_billing_enabled ? "Invoice billing" : "Prepaid", value: "USD" },
|
|
93
|
+
...(budget === 0 ? [{ label: "Monthly budget", value: ctx.format.usd(budget) }] : []),
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
dataConfidence: "exact",
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// END UPSTREAM
|
|
103
|
+
})(globalThis.defineProvider);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "soniox",
|
|
4
|
+
"name": "Soniox",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": [
|
|
9
|
+
"api"
|
|
10
|
+
],
|
|
11
|
+
"autoMode": "api",
|
|
12
|
+
"usageDashboardUrl": "https://console.soniox.com",
|
|
13
|
+
"envVars": [
|
|
14
|
+
"SONIOX_ORG_API_KEY"
|
|
15
|
+
],
|
|
16
|
+
"setupFields": [],
|
|
17
|
+
"upstream": {
|
|
18
|
+
"repository": "https://github.com/steipete/CodexBar",
|
|
19
|
+
"revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
|
|
20
|
+
"path": "Sources/CodexBarCore/Resources/Plugins/soniox.js",
|
|
21
|
+
"sha256": "205af76549b697bc66a8d1a16008463310c2ee218e4d9c5f44edbb7b2ceed0b0",
|
|
22
|
+
"license": "MIT"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -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,3 @@
|
|
|
1
|
+
<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.8088 0C44.4762 0 47.3101 9.1895e-05 49.4748 1.10306C51.3788 2.07326 52.927 3.62135 53.8971 5.52544C55.0001 7.69013 55 10.524 55 16.1914V38.8088C55 44.4761 55.0001 47.3099 53.8971 49.4746C52.927 51.3786 51.3788 52.9267 49.4748 53.8969C47.3101 54.9999 44.4762 55 38.8088 55H16.1914C10.5239 55 7.69014 54.9999 5.52544 53.8969C3.62133 52.9267 2.07325 51.3787 1.10306 49.4746C0.000109958 47.3099 0 44.4762 0 38.8088V16.1912C0 10.5238 0.000107614 7.69012 1.10306 5.52544C2.07325 3.62133 3.62133 2.07326 5.52544 1.10306C7.69014 8.88436e-05 10.5239 0 16.1914 0H38.8088ZM23.3863 30.405C23.0885 30.405 22.7934 30.4638 22.5183 30.5782C22.2433 30.6926 21.9933 30.8603 21.7827 31.0716L17.4534 35.4188L16.3029 34.2638C15.4573 33.415 14.0099 33.8346 13.7471 35.0064L12.1073 42.3023C12.0498 42.5532 12.0568 42.8148 12.128 43.0621C12.199 43.3085 12.3313 43.5327 12.5123 43.7136L12.5108 43.7159C12.6915 43.8987 12.9155 44.0321 13.1619 44.1037C13.4083 44.1752 13.6688 44.1824 13.9188 44.1246L21.1862 42.4776C22.3527 42.2137 22.7715 40.7614 21.9259 39.9124L20.7754 38.7574L25.1056 34.411C25.5306 33.9842 25.7695 33.4049 25.7695 32.8013C25.7695 32.1977 25.5306 31.6185 25.1056 31.1916L25.0476 31.1334L25.0497 31.1319L24.9896 31.0716C24.7791 30.8603 24.529 30.6926 24.254 30.5782C23.979 30.4638 23.684 30.4051 23.3863 30.405ZM39.0054 27.6663C37.9941 27.0245 36.6768 27.7546 36.6766 28.9556V30.5884H27.3981C27.7081 31.1832 27.8847 31.8596 27.8847 32.5774C27.8846 33.6152 27.5181 34.5672 26.908 35.3099L36.6758 35.3096L36.6752 36.9424C36.6753 38.1434 37.9941 38.8736 39.0054 38.2319L45.3045 34.2387C45.7757 33.9384 46.0114 33.443 46.0115 32.948C46.0109 32.4536 45.7752 31.9592 45.303 31.6601L39.0054 27.6663ZM23.6104 10.2206C23.3539 10.2194 23.101 10.2839 22.8763 10.4081C22.6514 10.5325 22.4614 10.7132 22.3253 10.9318L18.3472 17.2549H18.3458C17.7067 18.2701 18.4346 19.5933 19.6307 19.5936H21.2578V28.9869C21.9327 28.5406 22.7403 28.2801 23.609 28.2801C24.4781 28.2801 25.2864 28.5407 25.9615 28.9875V19.5936H27.5884C28.7849 19.5936 29.5112 18.2702 28.8728 17.2541L24.8939 10.9318C24.5951 10.4584 24.1029 10.2212 23.6104 10.2206Z" fill="#1F1E1E"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
|
+
globalThis.__usagestat_bundled_options = {"labels":["Account plan","API key","Additional"],"defaults":{},"autoMode":"api"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/tavily.js
|
|
5
|
+
defineProvider({
|
|
6
|
+
id: "tavily",
|
|
7
|
+
name: "Tavily",
|
|
8
|
+
endpoints: ["https://api.tavily.com"],
|
|
9
|
+
auth: { type: "bearer", secret: "TAVILY_API_KEY" },
|
|
10
|
+
settings: [{ key: "TAVILY_API_KEY", title: "Tavily API key", type: "secure" }],
|
|
11
|
+
capabilities: ["http-status"],
|
|
12
|
+
async fetchUsage(ctx) {
|
|
13
|
+
const response = await ctx.http.get("https://api.tavily.com/usage");
|
|
14
|
+
const message = `Tavily returned HTTP ${response.status}.`;
|
|
15
|
+
if (response.status === 401) throw ctx.fail.authenticationExpired(message);
|
|
16
|
+
if (response.status === 403) throw ctx.fail.permissionDenied(message);
|
|
17
|
+
// The usage endpoint allows only ten requests per ten minutes; do not replay a throttled request.
|
|
18
|
+
if (response.status === 429) throw ctx.fail.rateLimited(message);
|
|
19
|
+
if (response.status >= 500) throw ctx.fail.providerUnavailable(message);
|
|
20
|
+
if (response.status !== 200) throw ctx.fail.apiFailure(message);
|
|
21
|
+
const fail = () => {
|
|
22
|
+
throw ctx.fail.parseFailure("Tavily returned an unrecognized credit usage response.");
|
|
23
|
+
};
|
|
24
|
+
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
25
|
+
const count = (value) => (Number.isSafeInteger(value) && value >= 0 ? value : fail());
|
|
26
|
+
let data;
|
|
27
|
+
try {
|
|
28
|
+
data = JSON.parse(response.bodyText);
|
|
29
|
+
} catch {
|
|
30
|
+
return fail();
|
|
31
|
+
}
|
|
32
|
+
if (!record(data) || !record(data.account) || !record(data.key)) return fail();
|
|
33
|
+
const { account, key } = data;
|
|
34
|
+
const format = (value) => `${ctx.format.number(count(value))} credits`;
|
|
35
|
+
const rows = (usage, cap, unlimited = false) =>
|
|
36
|
+
[
|
|
37
|
+
{ label: "Used", value: format(usage) },
|
|
38
|
+
{ label: "Limit", value: cap === null ? (unlimited ? "Unlimited" : null) : format(cap) },
|
|
39
|
+
{ label: "Remaining", value: cap === null ? null : format(Math.max(0, cap - usage)) },
|
|
40
|
+
].filter((row) => row.value !== null);
|
|
41
|
+
const details = [
|
|
42
|
+
{ title: "Account plan", rows: rows(account.plan_usage, count(account.plan_limit)) },
|
|
43
|
+
{ title: "API key", rows: rows(key.usage, key.limit, true) },
|
|
44
|
+
];
|
|
45
|
+
if (account.paygo_usage !== undefined || account.paygo_limit !== undefined) {
|
|
46
|
+
details.push({ title: "Pay as you go", rows: rows(account.paygo_usage, account.paygo_limit) });
|
|
47
|
+
}
|
|
48
|
+
const plan = account.current_plan;
|
|
49
|
+
if (plan !== undefined && (typeof plan !== "string" || !plan.trim() || plan.length > 120)) return fail();
|
|
50
|
+
return {
|
|
51
|
+
primary: account.plan_limit > 0 ? { usedPercent: ctx.pct(account.plan_usage, account.plan_limit) } : undefined,
|
|
52
|
+
secondary: key.limit > 0 ? { usedPercent: ctx.pct(key.usage, key.limit) } : undefined,
|
|
53
|
+
details,
|
|
54
|
+
identity: { loginMethod: plan === undefined ? "API key" : plan.trim() },
|
|
55
|
+
dataConfidence: "exact",
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// END UPSTREAM
|
|
61
|
+
})(globalThis.defineProvider);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "tavily",
|
|
4
|
+
"name": "Tavily",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": [
|
|
9
|
+
"api"
|
|
10
|
+
],
|
|
11
|
+
"autoMode": "api",
|
|
12
|
+
"usageDashboardUrl": "https://app.tavily.com",
|
|
13
|
+
"envVars": [
|
|
14
|
+
"TAVILY_API_KEY"
|
|
15
|
+
],
|
|
16
|
+
"setupFields": [],
|
|
17
|
+
"upstream": {
|
|
18
|
+
"repository": "https://github.com/steipete/CodexBar",
|
|
19
|
+
"revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
|
|
20
|
+
"path": "Sources/CodexBarCore/Resources/Plugins/tavily.js",
|
|
21
|
+
"sha256": "2859e56104c9e73d2650b87e034c5f2955c09ea7507e128a22e1ab42b5ae35a0",
|
|
22
|
+
"license": "MIT"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -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,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 106 81" aria-label="TinyApi">
|
|
2
|
+
<path fill="currentColor" transform="translate(-9.626586 49.746547)" d="M 77.953125 -23.203125 L 87.640625 -15.109375 L 59.203125 18.90625 C 57.003906 21.539062 54.429688 23.601562 51.484375 25.09375 C 48.546875 26.582031 45.460938 27.46875 42.234375 27.75 C 39.015625 28.03125 35.835938 27.707031 32.703125 26.78125 C 29.578125 25.863281 26.691406 24.300781 24.046875 22.09375 L 22.75 21.015625 C 20.101562 18.796875 18.035156 16.21875 16.546875 13.28125 C 15.066406 10.351562 14.179688 7.273438 13.890625 4.046875 C 13.609375 0.828125 13.941406 -2.351562 14.890625 -5.5 C 15.835938 -8.65625 17.410156 -11.550781 19.609375 -14.1875 L 48.046875 -48.203125 L 57.78125 -40.0625 L 29.34375 -6.046875 C 27.894531 -4.316406 26.988281 -2.367188 26.625 -0.203125 C 26.257812 1.953125 26.441406 4.046875 27.171875 6.078125 C 27.898438 8.117188 29.128906 9.863281 30.859375 11.3125 L 32.15625 12.390625 C 33.894531 13.835938 35.828125 14.738281 37.953125 15.09375 C 40.085938 15.457031 42.1875 15.265625 44.25 14.515625 C 46.3125 13.773438 48.066406 12.539062 49.515625 10.8125 Z M 77.953125 -23.203125"/>
|
|
3
|
+
<path fill="currentColor" transform="translate(115.142795 30.459118)" d="M -77.953125 23.203125 L -87.640625 15.109375 L -59.203125 -18.90625 C -57.003906 -21.539062 -54.429688 -23.601562 -51.484375 -25.09375 C -48.546875 -26.582031 -45.460938 -27.46875 -42.234375 -27.75 C -39.015625 -28.03125 -35.835938 -27.707031 -32.703125 -26.78125 C -29.578125 -25.863281 -26.691406 -24.300781 -24.046875 -22.09375 L -22.75 -21.015625 C -20.101562 -18.796875 -18.035156 -16.21875 -16.546875 -13.28125 C -15.066406 -10.351562 -14.179688 -7.273438 -13.890625 -4.046875 C -13.609375 -0.828125 -13.941406 2.351562 -14.890625 5.5 C -15.835938 8.65625 -17.410156 11.550781 -19.609375 14.1875 L -48.046875 48.203125 L -57.78125 40.0625 L -29.34375 6.046875 C -27.894531 4.316406 -26.988281 2.367188 -26.625 0.203125 C -26.257812 -1.953125 -26.441406 -4.046875 -27.171875 -6.078125 C -27.898438 -8.117188 -29.128906 -9.863281 -30.859375 -11.3125 L -32.15625 -12.390625 C -33.894531 -13.835938 -35.828125 -14.738281 -37.953125 -15.09375 C -40.085938 -15.457031 -42.1875 -15.265625 -44.25 -14.515625 C -46.3125 -13.773438 -48.066406 -12.539062 -49.515625 -10.8125 Z M -77.953125 23.203125"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
|
|
2
|
+
globalThis.__usagestat_bundled_options = {"labels":["Credits","Additional","Additional"],"defaults":{},"autoMode":"web"};
|
|
3
|
+
(function(defineProvider) {
|
|
4
|
+
// BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/tinyapi.js
|
|
5
|
+
defineProvider({
|
|
6
|
+
id: "tinyapi",
|
|
7
|
+
name: "TinyApi",
|
|
8
|
+
endpoints: ["https://tinyapi.rest"],
|
|
9
|
+
settings: [],
|
|
10
|
+
capabilities: ["browser-cookies", "http-status"],
|
|
11
|
+
cookieDomains: ["tinyapi.rest"],
|
|
12
|
+
async fetchUsage(ctx) {
|
|
13
|
+
const domain = "tinyapi.rest";
|
|
14
|
+
const policy = ctx.browser.availability(domain);
|
|
15
|
+
if (policy === "off") throw ctx.fail.missingCredential("TinyApi cookies are disabled.");
|
|
16
|
+
let response;
|
|
17
|
+
let rejected = false;
|
|
18
|
+
for await (const session of ctx.browser.sessions(domain)) {
|
|
19
|
+
const candidate = await ctx.http.get(`https://${domain}/api/user/credits`, {
|
|
20
|
+
headers: { Cookie: session.header },
|
|
21
|
+
timeoutSeconds: 15,
|
|
22
|
+
});
|
|
23
|
+
if (candidate.status === 401 || candidate.status === 403) {
|
|
24
|
+
rejected = true;
|
|
25
|
+
ctx.browser.rejectCookie(domain, session);
|
|
26
|
+
if (policy === "manual") break;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
response = candidate;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
if (!response) {
|
|
33
|
+
throw rejected
|
|
34
|
+
? ctx.fail.authenticationExpired("TinyApi session expired. Sign in again or paste a fresh Cookie header.")
|
|
35
|
+
: ctx.fail.missingCredential(
|
|
36
|
+
`Sign in to tinyapi.rest. Supported browsers: ${ctx.browser.supportedBrowsers}. Or set a manual Cookie header.`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
if (response.status === 429) throw ctx.fail.rateLimited("TinyApi credits requests are rate limited.");
|
|
40
|
+
if (response.status >= 500)
|
|
41
|
+
throw ctx.fail.providerUnavailable(`TinyApi credits service returned HTTP ${response.status}.`);
|
|
42
|
+
if (response.status !== 200) throw ctx.fail.apiFailure(`TinyApi credits request returned HTTP ${response.status}.`);
|
|
43
|
+
let payload;
|
|
44
|
+
try {
|
|
45
|
+
payload = JSON.parse(response.bodyText);
|
|
46
|
+
} catch {
|
|
47
|
+
throw ctx.fail.parseFailure("TinyApi credits response is not valid JSON.");
|
|
48
|
+
}
|
|
49
|
+
const balance = payload?.data?.totalAvailable;
|
|
50
|
+
if (payload?.success !== true || typeof balance !== "number" || !Number.isFinite(balance) || balance < 0) {
|
|
51
|
+
throw ctx.fail.parseFailure("TinyApi credits response is missing a valid available balance.");
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
details: [
|
|
55
|
+
{
|
|
56
|
+
title: "Credits",
|
|
57
|
+
rows: [
|
|
58
|
+
{
|
|
59
|
+
label: "Available credits",
|
|
60
|
+
value: `${ctx.format.number(balance, { maximumFractionDigits: 2 })} credits`,
|
|
61
|
+
usageValue: balance,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
identity: { loginMethod: "Browser session" },
|
|
67
|
+
dataConfidence: "exact",
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// END UPSTREAM
|
|
73
|
+
})(globalThis.defineProvider);
|