@hashimkarim/usagestat-linux-x64-gnu 2.1.0 → 2.2.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.
Files changed (81) hide show
  1. package/native-manifest.json +197 -89
  2. package/package.json +19 -1
  3. package/plugins/abliteration/plugin.json +1 -1
  4. package/plugins/aerostack/plugin.json +1 -1
  5. package/plugins/aixy/plugin.json +1 -1
  6. package/plugins/atlascloud/plugin.json +1 -1
  7. package/plugins/bifrost/plugin.json +1 -1
  8. package/plugins/chatbox/plugin.json +1 -1
  9. package/plugins/claudeplatform/plugin.json +1 -1
  10. package/plugins/codex/plugin.js +11 -6
  11. package/plugins/codex/plugin.json +10 -1
  12. package/plugins/cosmic/plugin.json +1 -1
  13. package/plugins/cursor/plugin.js +18 -6
  14. package/plugins/devpass/plugin.json +1 -1
  15. package/plugins/exa/plugin.json +1 -1
  16. package/plugins/fal/plugin.json +1 -1
  17. package/plugins/flora/plugin.json +1 -1
  18. package/plugins/futureagi/plugin.json +1 -1
  19. package/plugins/gemini-apps/plugin.json +1 -1
  20. package/plugins/gitkraken/plugin.json +1 -1
  21. package/plugins/googledeveloper/LICENSE +21 -0
  22. package/plugins/googledeveloper/icon.svg +3 -0
  23. package/plugins/googledeveloper/plugin.js +204 -0
  24. package/plugins/googledeveloper/plugin.json +25 -0
  25. package/plugins/helmcode/plugin.js +80 -23
  26. package/plugins/helmcode/plugin.json +2 -2
  27. package/plugins/huggingface/plugin.json +1 -1
  28. package/plugins/hyper/plugin.json +1 -1
  29. package/plugins/jetbrains-ai-assistant/LICENSE +22 -0
  30. package/plugins/jetbrains-ai-assistant/plugin.js +502 -16
  31. package/plugins/jetbrains-ai-assistant/plugin.json +27 -4
  32. package/plugins/kimi/plugin.js +16 -1
  33. package/plugins/kimi/plugin.json +46 -6
  34. package/plugins/langdock/plugin.json +1 -1
  35. package/plugins/linkup/plugin.json +1 -1
  36. package/plugins/lithosai/plugin.json +1 -1
  37. package/plugins/llmman/plugin.json +1 -1
  38. package/plugins/munito/plugin.json +1 -1
  39. package/plugins/muse/plugin.json +1 -1
  40. package/plugins/museai/plugin.js +5 -3
  41. package/plugins/museai/plugin.json +2 -2
  42. package/plugins/nous/plugin.json +1 -1
  43. package/plugins/opencode-go/plugin.js +4 -3
  44. package/plugins/opendesign/LICENSE +21 -0
  45. package/plugins/opendesign/icon.svg +4 -0
  46. package/plugins/opendesign/plugin.js +108 -0
  47. package/plugins/opendesign/plugin.json +25 -0
  48. package/plugins/parallel/plugin.json +1 -1
  49. package/plugins/perplexity/LICENSE +22 -0
  50. package/plugins/perplexity/plugin.js +122 -0
  51. package/plugins/perplexity/plugin.json +36 -7
  52. package/plugins/qwencloud/plugin.json +1 -1
  53. package/plugins/raycast/plugin.json +1 -1
  54. package/plugins/replicate/plugin.json +1 -1
  55. package/plugins/sailresearch/plugin.json +1 -1
  56. package/plugins/siliconflow/LICENSE +21 -0
  57. package/plugins/siliconflow/icon.svg +3 -0
  58. package/plugins/siliconflow/plugin.js +87 -0
  59. package/plugins/siliconflow/plugin.json +32 -0
  60. package/plugins/sofya/plugin.json +1 -1
  61. package/plugins/soniox/plugin.json +1 -1
  62. package/plugins/synthetic/plugin.js +12 -0
  63. package/plugins/synthetic/plugin.json +51 -9
  64. package/plugins/tavily/plugin.json +1 -1
  65. package/plugins/tinyapi/plugin.json +1 -1
  66. package/plugins/traecn/plugin.js +10 -11
  67. package/plugins/traecn/plugin.json +2 -2
  68. package/plugins/tripo/LICENSE +21 -0
  69. package/plugins/tripo/icon.svg +4 -0
  70. package/plugins/tripo/plugin.js +60 -0
  71. package/plugins/tripo/plugin.json +24 -0
  72. package/plugins/typesafe/plugin.js +63 -112
  73. package/plugins/typesafe/plugin.json +2 -2
  74. package/plugins/v0/plugin.json +1 -1
  75. package/plugins/vercel/plugin.json +2 -2
  76. package/plugins/workbuddy/plugin.js +103 -17
  77. package/plugins/workbuddy/plugin.json +14 -2
  78. package/plugins/xapi/plugin.json +1 -1
  79. package/plugins/xkiro/plugin.json +1 -1
  80. package/usagestat +0 -0
  81. package/usagestatd +0 -0
@@ -17,7 +17,7 @@
17
17
  "setupFields": [],
18
18
  "upstream": {
19
19
  "repository": "https://github.com/steipete/CodexBar",
20
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
20
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
21
21
  "path": "Sources/CodexBarCore/Resources/Plugins/replicate.js",
22
22
  "sha256": "d240c36fa142ee91ce90ae52a2c6814613d2d5533a00c8a4c7ecec2f9386006c",
23
23
  "license": "MIT"
@@ -16,7 +16,7 @@
16
16
  "setupFields": [],
17
17
  "upstream": {
18
18
  "repository": "https://github.com/steipete/CodexBar",
19
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
19
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
20
20
  "path": "Sources/CodexBarCore/Resources/Plugins/sailresearch.js",
21
21
  "sha256": "3823be0a067659d6ae8dc4691e1b346cc7c7656e7f57134c12d898babcebb809",
22
22
  "license": "MIT"
@@ -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="-3 -17 59 59">
2
+ <path d="M50.7172 0H27.6622C26.3877 0 25.3586 1.03397 25.3586 2.30358V9.21911C25.3586 10.4935 24.3294 11.5227 23.055 11.5227H2.30357C1.02914 11.5227 0 12.5567 0 13.8263V23.0502C0 24.3246 1.03395 25.3538 2.30357 25.3538H25.3586C26.633 25.3538 27.6622 24.3198 27.6622 23.0502V16.1347C27.6622 14.8602 28.6913 13.8311 29.9657 13.8311H50.7172C51.9916 13.8311 53.0207 12.7971 53.0207 11.5275V2.30358C53.0207 1.02916 51.9868 0 50.7172 0Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,87 @@
1
+ // Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
2
+ globalThis.__usagestat_bundled_options = {"labels":["Balance","Additional","Additional"],"defaults":{"SILICONFLOW_BASE_URL":"https://api.siliconflow.com"},"autoMode":"api"};
3
+ (function(defineProvider) {
4
+ // BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/siliconflow.js
5
+ defineProvider({
6
+ id: "siliconflow",
7
+ name: "SiliconFlow",
8
+ endpoints: ["https://api.siliconflow.cn", "https://api.siliconflow.com"],
9
+ auth: { type: "bearer", secret: "SILICONFLOW_API_KEY" },
10
+ settings: [
11
+ { key: "SILICONFLOW_API_KEY", title: "API key", type: "secure" },
12
+ { key: "SILICONFLOW_BASE_URL", title: "API URL", type: "plain" },
13
+ { key: "MESSAGES", title: "SiliconFlow", type: "plain" },
14
+ ],
15
+ capabilities: ["http-status"],
16
+ async fetchUsage(ctx) {
17
+ const messages = JSON.parse(ctx.settings.get("MESSAGES") || "{}");
18
+ const message = (key) => messages[key] || key;
19
+ const origin = ctx.settings.get("SILICONFLOW_BASE_URL");
20
+ const currency =
21
+ origin === "https://api.siliconflow.cn" ? "CNY" : origin === "https://api.siliconflow.com" ? "USD" : "";
22
+ if (!currency) {
23
+ throw ctx.fail.apiFailure(
24
+ message("SiliconFlow API origin must be https://api.siliconflow.cn or https://api.siliconflow.com."),
25
+ );
26
+ }
27
+ const response = await ctx.http.get(`${origin}/v1/user/info`, {
28
+ headers: { Accept: "application/json" },
29
+ });
30
+ // The China balance API was retired on 2026-08-14; its balance is read from the console web source instead.
31
+ const retired = message(
32
+ currency === "CNY"
33
+ ? "The SiliconFlow China balance API was retired. Switch SiliconFlow to Web and sign in to cloud.siliconflow.cn."
34
+ : "SiliconFlow refused the balance query. Check the balance in the SiliconFlow console.",
35
+ );
36
+ const checkKey = message("Check your API key in Settings.");
37
+ const tryLater = message("SiliconFlow request failed. Try refreshing later.");
38
+ if (response.status === 410) throw ctx.fail.providerUnavailable(retired);
39
+ if (response.status === 401 || response.status === 403) throw ctx.fail.authenticationExpired(checkKey);
40
+ if (response.status === 429)
41
+ throw ctx.fail.rateLimited(message("SiliconFlow is rate limiting requests. Try again later."));
42
+ if (response.status >= 500) throw ctx.fail.providerUnavailable(tryLater);
43
+ if (response.status !== 200) throw ctx.fail.apiFailure(tryLater);
44
+ const fail = () => {
45
+ throw ctx.fail.parseFailure(
46
+ message("SiliconFlow returned an unrecognized response. Update CodexBar and try again."),
47
+ );
48
+ };
49
+ const record = (value) => (value && typeof value === "object" && !Array.isArray(value) ? value : undefined);
50
+ let decoded;
51
+ try {
52
+ decoded = JSON.parse(response.bodyText);
53
+ } catch (error) {
54
+ void error;
55
+ return fail();
56
+ }
57
+ const root = record(decoded);
58
+ if (!root || typeof root.code !== "number" || !Number.isInteger(root.code)) return fail();
59
+ if (root.code === 20092) throw ctx.fail.providerUnavailable(retired);
60
+ if (root.code === 30014) throw ctx.fail.authenticationExpired(checkKey);
61
+ if (root.code !== 20000 || root.status !== true) return fail();
62
+ const data = record(root.data);
63
+ if (!data) return fail();
64
+ const money = (value) => {
65
+ if (typeof value === "number" && Number.isFinite(value)) return value;
66
+ if (typeof value !== "string" || !/^-?(?:\d+|\d+\.\d+)$/.test(value)) return fail();
67
+ const amount = Number(value);
68
+ return Number.isFinite(amount) ? amount : fail();
69
+ };
70
+ const rows = [{ label: "Balance", value: ctx.format.currency(money(data.totalBalance), currency) }];
71
+ if (data.chargeBalance !== undefined && data.chargeBalance !== null) {
72
+ rows.push({ label: "Purchased", value: ctx.format.currency(money(data.chargeBalance), currency) });
73
+ }
74
+ if (data.balance !== undefined && data.balance !== null) {
75
+ rows.push({ label: "Bonus", value: ctx.format.currency(money(data.balance), currency) });
76
+ }
77
+ const status = data.status;
78
+ if (status !== undefined && status !== null) {
79
+ if (typeof status !== "string" || !/^[A-Za-z0-9_-]{1,32}$/.test(status)) return fail();
80
+ if (status !== "normal") rows.push({ label: "Status", value: status });
81
+ }
82
+ return { details: [{ title: "Balance", rows }], dataConfidence: "exact" };
83
+ },
84
+ });
85
+
86
+ // END UPSTREAM
87
+ })(globalThis.defineProvider);
@@ -0,0 +1,32 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "siliconflow",
4
+ "name": "SiliconFlow",
5
+ "version": "0.1.0",
6
+ "entry": "plugin.js",
7
+ "enabledByDefault": false,
8
+ "supportedModes": [
9
+ "api"
10
+ ],
11
+ "autoMode": "api",
12
+ "usageDashboardUrl": "https://cloud.siliconflow.com",
13
+ "envVars": [
14
+ "SILICONFLOW_API_KEY",
15
+ "SILICONFLOW_BASE_URL"
16
+ ],
17
+ "setupFields": [
18
+ {
19
+ "key": "SILICONFLOW_BASE_URL",
20
+ "title": "API URL",
21
+ "type": "string",
22
+ "description": "Provider-specific account or source selection."
23
+ }
24
+ ],
25
+ "upstream": {
26
+ "repository": "https://github.com/steipete/CodexBar",
27
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
28
+ "path": "Sources/CodexBarCore/Resources/Plugins/siliconflow.js",
29
+ "sha256": "8525a5a8f02749119930b9d814e987ccdab308827de016355c8ae34136325a86",
30
+ "license": "MIT"
31
+ }
32
+ }
@@ -16,7 +16,7 @@
16
16
  "setupFields": [],
17
17
  "upstream": {
18
18
  "repository": "https://github.com/steipete/CodexBar",
19
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
19
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
20
20
  "path": "Sources/CodexBarCore/Resources/Plugins/sofya.js",
21
21
  "sha256": "4190c42d42a1b70b6ed284821ef7803420564b4b020e939e60d79e4b0991c281",
22
22
  "license": "MIT"
@@ -16,7 +16,7 @@
16
16
  "setupFields": [],
17
17
  "upstream": {
18
18
  "repository": "https://github.com/steipete/CodexBar",
19
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
19
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
20
20
  "path": "Sources/CodexBarCore/Resources/Plugins/soniox.js",
21
21
  "sha256": "205af76549b697bc66a8d1a16008463310c2ee218e4d9c5f44edbb7b2ceed0b0",
22
22
  "license": "MIT"
@@ -207,6 +207,18 @@
207
207
 
208
208
  json = unwrapQuotasJson(json);
209
209
 
210
+ var weekly = json.planWeeklyLimit
211
+ if (weekly && typeof weekly === "object") {
212
+ var remaining = toFiniteNumber(weekly.percentRemaining)
213
+ var used = toFiniteNumber(weekly.percentUsed)
214
+ if (used === null && remaining !== null) used = 100 - remaining
215
+ if (used === null || used < 0 || used > 100) throw "Synthetic weekly usage is invalid."
216
+ var line = {label:"Weekly plan limit",used,limit:100,format:{kind:"percent"},periodDurationMs:7*86400000}
217
+ var reset = ctx.util.toIso(weekly.resetsAt || weekly.renewsAt || weekly.resetAt)
218
+ if (reset) line.resetsAt = reset
219
+ return {lines:[ctx.line.progress(line)]}
220
+ }
221
+
210
222
  var rfl = pickRollingFiveHour(json);
211
223
  var wtl = pickWeeklyToken(json);
212
224
 
@@ -7,17 +7,59 @@
7
7
  "icon": "icon.svg",
8
8
  "brandColor": "#000000",
9
9
  "lines": [
10
- { "type": "progress", "label": "5h Rate Limit", "scope": "overview", "primaryOrder": 1 },
11
- { "type": "progress", "label": "Mana Bar", "scope": "overview" },
12
- { "type": "badge", "label": "Rate Limited", "scope": "overview" },
13
- { "type": "badge", "label": "Quotas", "scope": "overview" },
14
- { "type": "progress", "label": "Subscription", "scope": "overview", "primaryOrder": 2 },
15
- { "type": "progress", "label": "Free Tool Calls", "scope": "detail" },
16
- { "type": "progress", "label": "Search", "scope": "overview" }
10
+ {
11
+ "type": "progress",
12
+ "label": "Weekly plan limit",
13
+ "scope": "overview",
14
+ "primaryOrder": 0
15
+ },
16
+ {
17
+ "type": "progress",
18
+ "label": "5h Rate Limit",
19
+ "scope": "overview",
20
+ "primaryOrder": 1
21
+ },
22
+ {
23
+ "type": "progress",
24
+ "label": "Mana Bar",
25
+ "scope": "overview"
26
+ },
27
+ {
28
+ "type": "badge",
29
+ "label": "Rate Limited",
30
+ "scope": "overview"
31
+ },
32
+ {
33
+ "type": "badge",
34
+ "label": "Quotas",
35
+ "scope": "overview"
36
+ },
37
+ {
38
+ "type": "progress",
39
+ "label": "Subscription",
40
+ "scope": "overview",
41
+ "primaryOrder": 2
42
+ },
43
+ {
44
+ "type": "progress",
45
+ "label": "Free Tool Calls",
46
+ "scope": "detail"
47
+ },
48
+ {
49
+ "type": "progress",
50
+ "label": "Search",
51
+ "scope": "overview"
52
+ }
53
+ ],
54
+ "supportedModes": [
55
+ "api",
56
+ "local"
17
57
  ],
18
- "supportedModes": ["api", "local"],
19
58
  "autoMode": "local",
20
59
  "links": [
21
- { "label": "Dashboard", "url": "https://synthetic.new/billing" }
60
+ {
61
+ "label": "Dashboard",
62
+ "url": "https://synthetic.new/billing"
63
+ }
22
64
  ]
23
65
  }
@@ -16,7 +16,7 @@
16
16
  "setupFields": [],
17
17
  "upstream": {
18
18
  "repository": "https://github.com/steipete/CodexBar",
19
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
19
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
20
20
  "path": "Sources/CodexBarCore/Resources/Plugins/tavily.js",
21
21
  "sha256": "2859e56104c9e73d2650b87e034c5f2955c09ea7507e128a22e1ab42b5ae35a0",
22
22
  "license": "MIT"
@@ -17,7 +17,7 @@
17
17
  "setupFields": [],
18
18
  "upstream": {
19
19
  "repository": "https://github.com/steipete/CodexBar",
20
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
20
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
21
21
  "path": "Sources/CodexBarCore/Resources/Plugins/tinyapi.js",
22
22
  "sha256": "14f874b433198e9bfb9f1d689a0822f35ac8d97945cab015c039f836eed4ef17",
23
23
  "license": "MIT"
@@ -59,26 +59,25 @@ defineProvider({
59
59
  continue;
60
60
  }
61
61
  const payload = read(usageResponse);
62
- const summary = payload?.usage_summary;
62
+ const { total_amount: total, consumed_amount: used } = payload?.usage_summary ?? {};
63
63
  if (payload?.code === 1001) {
64
64
  sessionRejected = true;
65
65
  ctx.browser.rejectCookie(domain, session);
66
66
  continue;
67
67
  }
68
- if (
69
- payload?.is_credits_billing !== true ||
70
- !summary ||
71
- !finite(summary.total_amount) ||
72
- !finite(summary.consumed_amount)
73
- )
74
- return malformed();
75
- const { total_amount: total, consumed_amount: used } = summary;
68
+ if (payload?.is_credits_billing !== true || !finite(total) || !finite(used)) return malformed();
76
69
  const packs = Array.isArray(payload.user_entitlement_pack_list) ? payload.user_entitlement_pack_list : [];
77
70
  const subscription = packs.find(
78
71
  (pack) => pack && pack.group_type === 0 && (pack.status === undefined || pack.status === 1),
79
72
  );
80
73
  const plan = typeof subscription?.display_desc === "string" ? subscription.display_desc.trim() : undefined;
81
- const number = (value) => ctx.format.number(value, { maximumFractionDigits: 2 });
74
+ const remaining = Math.max(0, total - used);
75
+ const hasFraction = [used, total, remaining].some((value) => !Number.isInteger(value));
76
+ const number = (value) =>
77
+ ctx.format.number(value, {
78
+ minimumFractionDigits: hasFraction ? 2 : 0,
79
+ maximumFractionDigits: 2,
80
+ });
82
81
  // Pack expiry and billing timestamps do not establish an aggregate reset or subscription renewal.
83
82
  return {
84
83
  primary: total > 0 ? { usedPercent: Math.min(100, (used / total) * 100) } : undefined,
@@ -89,7 +88,7 @@ defineProvider({
89
88
  rows: [
90
89
  { label: "Used", value: number(used) },
91
90
  { label: "Total", value: number(total) },
92
- { label: "Remaining", value: number(Math.max(0, total - used)) },
91
+ { label: "Remaining", value: number(remaining) },
93
92
  ],
94
93
  },
95
94
  ],
@@ -17,9 +17,9 @@
17
17
  "setupFields": [],
18
18
  "upstream": {
19
19
  "repository": "https://github.com/steipete/CodexBar",
20
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
20
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
21
21
  "path": "Sources/CodexBarCore/Resources/Plugins/traecn.js",
22
- "sha256": "045bf8cbba44d779fc69a1ddbd14598a1d1178f265be875336b36b261af5604a",
22
+ "sha256": "a41123c0e7220f6c5577abd64c7ce3c2854d59ffdd4a7e92a439099dc7068042",
23
23
  "license": "MIT"
24
24
  }
25
25
  }
@@ -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="11.5 0 100 100">
2
+ <path d="M91.473 8.51074H33.043L41.3462 22.6625H65.4259L53.3138 43.2764L58.7833 52.5905C59.3789 53.6014 60.4439 54.2151 61.6172 54.2151C62.7905 54.2151 63.8555 53.6014 64.4512 52.5905L82.0325 22.6625H107.195C106.311 14.5758 99.5958 8.51074 91.4549 8.51074H91.473Z" fill="currentColor"/>
3
+ <path d="M61.6539 73.4931C59.4337 73.4931 57.4482 72.3559 56.3291 70.4425L21.5273 11.2002C15.7511 15.5143 12.5019 24.4494 17.0146 32.139L47.755 84.4679C50.6792 89.4499 55.8777 92.4283 61.672 92.4283C67.4482 92.4283 72.6649 89.4499 75.5891 84.4679L105.084 34.2329H88.2606L66.997 70.4245C65.8778 72.3378 63.8742 73.475 61.672 73.475L61.6539 73.4931Z" fill="currentColor"/>
4
+ </svg>
@@ -0,0 +1,60 @@
1
+ // Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
2
+ globalThis.__usagestat_bundled_options = {"labels":["Credits","Reserved","Additional"],"defaults":{},"autoMode":"api"};
3
+ (function(defineProvider) {
4
+ // BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/tripo.js
5
+ defineProvider({
6
+ id: "tripo",
7
+ name: "Tripo",
8
+ endpoints: ["https://openapi.tripo3d.ai"],
9
+ auth: { type: "bearer", secret: "TRIPO_API_KEY" },
10
+ settings: [
11
+ { key: "TRIPO_API_KEY", title: "API key", type: "secure" },
12
+ { key: "MESSAGES", title: "Tripo", type: "plain" },
13
+ ],
14
+ capabilities: ["http-status"],
15
+ async fetchUsage(ctx) {
16
+ const messages = JSON.parse(ctx.settings.get("MESSAGES") || "{}");
17
+ const message = (key) => messages[key] || key;
18
+ const response = await ctx.http.get("https://openapi.tripo3d.ai/v3/account/balance");
19
+ if (response.status === 401) throw ctx.fail.authenticationExpired(message("Check your API key in Settings."));
20
+ if (response.status === 403) throw ctx.fail.permissionDenied(message("Check your API key in Settings."));
21
+ if (response.status === 429)
22
+ throw ctx.fail.rateLimited(message("Tripo is rate limiting requests. Try again later."));
23
+ if (response.status >= 500)
24
+ throw ctx.fail.providerUnavailable(message("Tripo request failed. Try refreshing later."));
25
+ if (response.status !== 200) throw ctx.fail.apiFailure(message("Tripo request failed. Try refreshing later."));
26
+ const fail = () => {
27
+ throw ctx.fail.parseFailure(message("Tripo returned an unrecognized response. Update CodexBar and try again."));
28
+ };
29
+ let body;
30
+ try {
31
+ body = JSON.parse(response.bodyText);
32
+ } catch (error) {
33
+ void error;
34
+ return fail();
35
+ }
36
+ if (!body || typeof body !== "object" || Array.isArray(body) || !Number.isInteger(body.code)) return fail();
37
+ if (body.code !== 0) throw ctx.fail.apiFailure(message("Tripo request failed. Try refreshing later."));
38
+ if (!body.data || typeof body.data !== "object" || Array.isArray(body.data)) return fail();
39
+ const credits = (value) =>
40
+ typeof value === "number" && Number.isFinite(value) && value >= 0
41
+ ? ctx.format.number(value, { maximumFractionDigits: 2 })
42
+ : fail();
43
+ return {
44
+ details: [
45
+ {
46
+ title: "Credits",
47
+ rows: [
48
+ // The API balance is already available credits; frozen credits are a separate reservation.
49
+ { label: "Balance", value: credits(body.data.balance) },
50
+ { label: "Reserved", value: credits(body.data.frozen) },
51
+ ],
52
+ },
53
+ ],
54
+ dataConfidence: "exact",
55
+ };
56
+ },
57
+ });
58
+
59
+ // END UPSTREAM
60
+ })(globalThis.defineProvider);
@@ -0,0 +1,24 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "tripo",
4
+ "name": "Tripo",
5
+ "version": "0.1.0",
6
+ "entry": "plugin.js",
7
+ "enabledByDefault": false,
8
+ "supportedModes": [
9
+ "api"
10
+ ],
11
+ "autoMode": "api",
12
+ "usageDashboardUrl": "https://platform.tripo3d.ai",
13
+ "envVars": [
14
+ "TRIPO_API_KEY"
15
+ ],
16
+ "setupFields": [],
17
+ "upstream": {
18
+ "repository": "https://github.com/steipete/CodexBar",
19
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
20
+ "path": "Sources/CodexBarCore/Resources/Plugins/tripo.js",
21
+ "sha256": "78325930a28ec25a2a5164c0f596d8e003fdae966aa53c52c0f761e7d19dfb21",
22
+ "license": "MIT"
23
+ }
24
+ }