@hashimkarim/usagestat-darwin-arm64 2.0.0-alpha.3 → 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.
Files changed (284) hide show
  1. package/native-manifest.json +1532 -134
  2. package/package.json +235 -2
  3. package/plugins/UPSTREAM-LICENSES.md +6 -2
  4. package/plugins/_provider-icons/LICENSE +21 -0
  5. package/plugins/_provider-icons/NOTICE +12 -0
  6. package/plugins/_provider-icons/licenses/CodexBar-MIT.txt +21 -0
  7. package/plugins/_provider-icons/licenses/LobeHub-MIT.txt +21 -0
  8. package/plugins/_provider-icons/licenses/UsageStat-Bar-MIT.txt +21 -0
  9. package/plugins/_provider-icons/manifest.json +1219 -0
  10. package/plugins/_provider-icons/provenance.json +269 -0
  11. package/plugins/_provider-icons/source.json +4 -0
  12. package/plugins/abacus-ai/icon-color.svg +18 -0
  13. package/plugins/abliteration/LICENSE +21 -0
  14. package/plugins/abliteration/icon.svg +5 -0
  15. package/plugins/abliteration/plugin.js +89 -0
  16. package/plugins/abliteration/plugin.json +24 -0
  17. package/plugins/aerostack/LICENSE +21 -0
  18. package/plugins/aerostack/icon.svg +1 -0
  19. package/plugins/aerostack/plugin.js +94 -0
  20. package/plugins/aerostack/plugin.json +24 -0
  21. package/plugins/aixy/LICENSE +21 -0
  22. package/plugins/aixy/icon.svg +1 -0
  23. package/plugins/aixy/plugin.js +266 -0
  24. package/plugins/aixy/plugin.json +32 -0
  25. package/plugins/antigravity/plugin.js +189 -65
  26. package/plugins/antigravity-cli/icon-color.svg +1 -0
  27. package/plugins/antigravity-cli/icon.svg +1 -3
  28. package/plugins/antigravity-cli/plugin.js +32 -20
  29. package/plugins/antigravity-ide/icon-color.svg +1 -0
  30. package/plugins/antigravity-ide/icon.svg +1 -3
  31. package/plugins/antigravity-ide/plugin.js +19 -7
  32. package/plugins/atlascloud/LICENSE +21 -0
  33. package/plugins/atlascloud/icon-color.svg +1 -0
  34. package/plugins/atlascloud/icon.svg +1 -0
  35. package/plugins/atlascloud/plugin.js +54 -0
  36. package/plugins/atlascloud/plugin.json +24 -0
  37. package/plugins/augment/icon-color.svg +14 -0
  38. package/plugins/bifrost/LICENSE +21 -0
  39. package/plugins/bifrost/icon.svg +3 -0
  40. package/plugins/bifrost/plugin.js +366 -0
  41. package/plugins/bifrost/plugin.json +31 -0
  42. package/plugins/chatbox/LICENSE +21 -0
  43. package/plugins/chatbox/icon.svg +4 -0
  44. package/plugins/chatbox/plugin.js +208 -0
  45. package/plugins/chatbox/plugin.json +24 -0
  46. package/plugins/claude/plugin.js +340 -153
  47. package/plugins/claude/plugin.json +1 -1
  48. package/plugins/claudeplatform/LICENSE +21 -0
  49. package/plugins/claudeplatform/icon.svg +3 -0
  50. package/plugins/claudeplatform/plugin.js +244 -0
  51. package/plugins/claudeplatform/plugin.json +25 -0
  52. package/plugins/clinepass/plugin.js +19 -3
  53. package/plugins/codebuff/icon-color.svg +92 -0
  54. package/plugins/coderabbit/plugin.js +25 -0
  55. package/plugins/coderabbit/plugin.json +12 -0
  56. package/plugins/codex/plugin.js +15 -8
  57. package/plugins/codex/plugin.json +11 -2
  58. package/plugins/command-code/icon-color.svg +3 -0
  59. package/plugins/command-code/plugin.js +7 -3
  60. package/plugins/copilot/icon.svg +1 -1
  61. package/plugins/copilot/plugin.json +1 -0
  62. package/plugins/cosmic/LICENSE +21 -0
  63. package/plugins/cosmic/icon.svg +1 -0
  64. package/plugins/cosmic/plugin.js +134 -0
  65. package/plugins/cosmic/plugin.json +32 -0
  66. package/plugins/crof/icon-color.svg +3 -0
  67. package/plugins/crofai/icon-color.svg +3 -0
  68. package/plugins/crofai/icon.svg +2 -15
  69. package/plugins/cursor/icon-color.svg +1 -0
  70. package/plugins/cursor/plugin.js +51 -14
  71. package/plugins/cursor-nightly/plugin.json +1 -1
  72. package/plugins/deepinfra/icon-color.svg +1 -0
  73. package/plugins/deepinfra/icon.svg +1 -4
  74. package/plugins/deepseek/plugin.js +150 -59
  75. package/plugins/deepseek/plugin.json +3 -1
  76. package/plugins/devin/plugin.js +3 -0
  77. package/plugins/devpass/LICENSE +21 -0
  78. package/plugins/devpass/icon.svg +3 -0
  79. package/plugins/devpass/plugin.js +120 -0
  80. package/plugins/devpass/plugin.json +24 -0
  81. package/plugins/elevenlabs/icon-color.svg +4 -0
  82. package/plugins/exa/LICENSE +21 -0
  83. package/plugins/exa/icon-color.svg +1 -0
  84. package/plugins/exa/icon.svg +1 -0
  85. package/plugins/exa/plugin.js +75 -0
  86. package/plugins/exa/plugin.json +32 -0
  87. package/plugins/factory/icon-color.svg +1 -0
  88. package/plugins/fal/LICENSE +21 -0
  89. package/plugins/fal/icon-color.svg +1 -0
  90. package/plugins/fal/icon.svg +1 -0
  91. package/plugins/fal/plugin.js +74 -0
  92. package/plugins/fal/plugin.json +24 -0
  93. package/plugins/fireworks-ai/icon-color.svg +1 -0
  94. package/plugins/fireworks-ai/icon.svg +1 -6
  95. package/plugins/flora/LICENSE +21 -0
  96. package/plugins/flora/icon.svg +4 -0
  97. package/plugins/flora/plugin.js +93 -0
  98. package/plugins/flora/plugin.json +32 -0
  99. package/plugins/futureagi/LICENSE +21 -0
  100. package/plugins/futureagi/icon.svg +24 -0
  101. package/plugins/futureagi/plugin.js +139 -0
  102. package/plugins/futureagi/plugin.json +32 -0
  103. package/plugins/gemini-apps/LICENSE +21 -0
  104. package/plugins/gemini-apps/icon-color.svg +1 -0
  105. package/plugins/gemini-apps/icon.svg +1 -0
  106. package/plugins/gemini-apps/plugin.js +141 -0
  107. package/plugins/gemini-apps/plugin.json +25 -0
  108. package/plugins/gitkraken/LICENSE +21 -0
  109. package/plugins/gitkraken/icon.svg +2 -0
  110. package/plugins/gitkraken/plugin.js +158 -0
  111. package/plugins/gitkraken/plugin.json +32 -0
  112. package/plugins/googledeveloper/LICENSE +21 -0
  113. package/plugins/googledeveloper/icon.svg +3 -0
  114. package/plugins/googledeveloper/plugin.js +204 -0
  115. package/plugins/googledeveloper/plugin.json +25 -0
  116. package/plugins/grok/icon-color.svg +1 -0
  117. package/plugins/groqcloud/icon-color.svg +1 -0
  118. package/plugins/helmcode/LICENSE +21 -0
  119. package/plugins/helmcode/icon.svg +5 -0
  120. package/plugins/helmcode/plugin.js +253 -0
  121. package/plugins/helmcode/plugin.json +32 -0
  122. package/plugins/huggingface/LICENSE +21 -0
  123. package/plugins/huggingface/icon-color.svg +1 -0
  124. package/plugins/huggingface/icon.svg +1 -0
  125. package/plugins/huggingface/plugin.js +298 -0
  126. package/plugins/huggingface/plugin.json +26 -0
  127. package/plugins/hyper/LICENSE +21 -0
  128. package/plugins/hyper/plugin.js +137 -0
  129. package/plugins/hyper/plugin.json +27 -0
  130. package/plugins/jetbrains-ai-assistant/LICENSE +22 -0
  131. package/plugins/jetbrains-ai-assistant/plugin.js +502 -16
  132. package/plugins/jetbrains-ai-assistant/plugin.json +27 -4
  133. package/plugins/kilo/icon-color.svg +1 -0
  134. package/plugins/kimi/plugin.js +54 -14
  135. package/plugins/kimi/plugin.json +46 -6
  136. package/plugins/langdock/LICENSE +21 -0
  137. package/plugins/langdock/icon.svg +4 -0
  138. package/plugins/langdock/plugin.js +106 -0
  139. package/plugins/langdock/plugin.json +25 -0
  140. package/plugins/linkup/LICENSE +21 -0
  141. package/plugins/linkup/icon.svg +10 -0
  142. package/plugins/linkup/plugin.js +46 -0
  143. package/plugins/linkup/plugin.json +24 -0
  144. package/plugins/litellm/plugin.js +54 -3
  145. package/plugins/lithosai/LICENSE +21 -0
  146. package/plugins/lithosai/icon.svg +1 -0
  147. package/plugins/lithosai/plugin.js +130 -0
  148. package/plugins/lithosai/plugin.json +26 -0
  149. package/plugins/llmman/LICENSE +21 -0
  150. package/plugins/llmman/icon.svg +4 -0
  151. package/plugins/llmman/plugin.js +138 -0
  152. package/plugins/llmman/plugin.json +31 -0
  153. package/plugins/longcat/icon-color.svg +1 -0
  154. package/plugins/longcat/icon.svg +1 -4
  155. package/plugins/manus/icon-color.svg +6 -0
  156. package/plugins/mimo/icon-color.svg +4 -0
  157. package/plugins/mimo/icon.svg +4 -1
  158. package/plugins/mistral/plugin.js +164 -27
  159. package/plugins/moonshot/icon-color.svg +1 -0
  160. package/plugins/munito/LICENSE +21 -0
  161. package/plugins/munito/icon.svg +7 -0
  162. package/plugins/munito/plugin.js +171 -0
  163. package/plugins/munito/plugin.json +24 -0
  164. package/plugins/muse/LICENSE +21 -0
  165. package/plugins/muse/icon.svg +3 -0
  166. package/plugins/muse/plugin.js +288 -0
  167. package/plugins/muse/plugin.json +34 -0
  168. package/plugins/museai/LICENSE +21 -0
  169. package/plugins/museai/icon.svg +3 -0
  170. package/plugins/museai/plugin.js +161 -0
  171. package/plugins/museai/plugin.json +26 -0
  172. package/plugins/nous/LICENSE +21 -0
  173. package/plugins/nous/icon-color.svg +1 -0
  174. package/plugins/nous/icon.svg +1 -0
  175. package/plugins/nous/plugin.js +129 -0
  176. package/plugins/nous/plugin.json +32 -0
  177. package/plugins/ollama/icon-color.svg +1 -0
  178. package/plugins/ollama/plugin.js +58 -0
  179. package/plugins/openai-api/icon-color.svg +1 -0
  180. package/plugins/opencode/icon-color.svg +1 -0
  181. package/plugins/opencode-go/icon-color.svg +1 -0
  182. package/plugins/opencode-go/plugin.js +104 -37
  183. package/plugins/opendesign/LICENSE +21 -0
  184. package/plugins/opendesign/icon.svg +4 -0
  185. package/plugins/opendesign/plugin.js +108 -0
  186. package/plugins/opendesign/plugin.json +25 -0
  187. package/plugins/openrouter/icon-color.svg +1 -0
  188. package/plugins/parallel/LICENSE +21 -0
  189. package/plugins/parallel/icon.svg +11 -0
  190. package/plugins/parallel/plugin.js +97 -0
  191. package/plugins/parallel/plugin.json +25 -0
  192. package/plugins/perplexity/LICENSE +22 -0
  193. package/plugins/perplexity/plugin.js +122 -0
  194. package/plugins/perplexity/plugin.json +36 -7
  195. package/plugins/pi/plugin.js +113 -0
  196. package/plugins/pi/plugin.json +11 -0
  197. package/plugins/qwencloud/LICENSE +21 -0
  198. package/plugins/qwencloud/icon-color.svg +1 -0
  199. package/plugins/qwencloud/icon.svg +1 -4
  200. package/plugins/qwencloud/plugin.js +197 -0
  201. package/plugins/qwencloud/plugin.json +17 -0
  202. package/plugins/raycast/LICENSE +21 -0
  203. package/plugins/raycast/icon.svg +4 -0
  204. package/plugins/raycast/plugin.js +179 -0
  205. package/plugins/raycast/plugin.json +32 -0
  206. package/plugins/replicate/LICENSE +21 -0
  207. package/plugins/replicate/icon-color.svg +1 -0
  208. package/plugins/replicate/icon.svg +1 -0
  209. package/plugins/replicate/plugin.js +170 -0
  210. package/plugins/replicate/plugin.json +25 -0
  211. package/plugins/sailresearch/LICENSE +21 -0
  212. package/plugins/sailresearch/icon.svg +4 -0
  213. package/plugins/sailresearch/plugin.js +104 -0
  214. package/plugins/sailresearch/plugin.json +24 -0
  215. package/plugins/siliconflow/LICENSE +21 -0
  216. package/plugins/siliconflow/icon.svg +3 -0
  217. package/plugins/siliconflow/plugin.js +87 -0
  218. package/plugins/siliconflow/plugin.json +32 -0
  219. package/plugins/sofya/LICENSE +21 -0
  220. package/plugins/sofya/icon.svg +3 -0
  221. package/plugins/sofya/plugin.js +86 -0
  222. package/plugins/sofya/plugin.json +24 -0
  223. package/plugins/soniox/LICENSE +21 -0
  224. package/plugins/soniox/icon.svg +3 -0
  225. package/plugins/soniox/plugin.js +103 -0
  226. package/plugins/soniox/plugin.json +24 -0
  227. package/plugins/synthetic/icon-color.svg +14 -0
  228. package/plugins/synthetic/plugin.js +12 -0
  229. package/plugins/synthetic/plugin.json +51 -9
  230. package/plugins/tavily/LICENSE +21 -0
  231. package/plugins/tavily/icon.svg +3 -0
  232. package/plugins/tavily/plugin.js +61 -0
  233. package/plugins/tavily/plugin.json +24 -0
  234. package/plugins/tinyapi/LICENSE +21 -0
  235. package/plugins/tinyapi/icon.svg +4 -0
  236. package/plugins/tinyapi/plugin.js +73 -0
  237. package/plugins/tinyapi/plugin.json +25 -0
  238. package/plugins/traecn/LICENSE +21 -0
  239. package/plugins/traecn/icon.svg +3 -0
  240. package/plugins/traecn/plugin.js +103 -0
  241. package/plugins/traecn/plugin.json +25 -0
  242. package/plugins/tripo/LICENSE +21 -0
  243. package/plugins/tripo/icon.svg +4 -0
  244. package/plugins/tripo/plugin.js +60 -0
  245. package/plugins/tripo/plugin.json +24 -0
  246. package/plugins/typesafe/LICENSE +21 -0
  247. package/plugins/typesafe/icon.svg +4 -0
  248. package/plugins/typesafe/plugin.js +181 -0
  249. package/plugins/typesafe/plugin.json +25 -0
  250. package/plugins/v0/LICENSE +21 -0
  251. package/plugins/v0/icon-color.svg +1 -0
  252. package/plugins/v0/icon.svg +1 -0
  253. package/plugins/v0/plugin.js +219 -0
  254. package/plugins/v0/plugin.json +32 -0
  255. package/plugins/venice/plugin.js +50 -1
  256. package/plugins/venice/plugin.json +2 -1
  257. package/plugins/vercel/LICENSE +21 -0
  258. package/plugins/vercel/icon-color.svg +1 -0
  259. package/plugins/vercel/icon.svg +1 -0
  260. package/plugins/vercel/plugin.js +202 -0
  261. package/plugins/vercel/plugin.json +54 -0
  262. package/plugins/windsurf/icon-color.svg +1 -0
  263. package/plugins/workbuddy/LICENSE +21 -0
  264. package/plugins/workbuddy/icon.svg +1 -0
  265. package/plugins/workbuddy/plugin.js +318 -0
  266. package/plugins/workbuddy/plugin.json +63 -0
  267. package/plugins/xai/icon-color.svg +1 -0
  268. package/plugins/xai/icon.svg +1 -7
  269. package/plugins/xai/plugin.js +9 -0
  270. package/plugins/xapi/LICENSE +21 -0
  271. package/plugins/xapi/icon.svg +1 -0
  272. package/plugins/xapi/plugin.js +90 -0
  273. package/plugins/xapi/plugin.json +25 -0
  274. package/plugins/xkiro/LICENSE +21 -0
  275. package/plugins/xkiro/icon.svg +1 -0
  276. package/plugins/xkiro/plugin.js +104 -0
  277. package/plugins/xkiro/plugin.json +24 -0
  278. package/plugins/zai/icon-color.svg +1 -0
  279. package/plugins/zai/plugin.js +5 -1
  280. package/plugins/zenmux/icon-color.svg +1 -0
  281. package/plugins/zenmux/icon.svg +1 -3
  282. package/usagestat +0 -0
  283. package/usagestatd +0 -0
  284. package/plugins/cursor-nightly/plugin.js +0 -1416
@@ -0,0 +1,141 @@
1
+ // Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
2
+ globalThis.__usagestat_bundled_options = {"labels":["Current","Weekly","Additional"],"defaults":{},"autoMode":"web","providerId":"gemini-apps","displayName":"Gemini Apps","cookieEnv":"GEMINI_COOKIE"};
3
+ (function(defineProvider) {
4
+ // BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/gemini-web.js
5
+ function _optionalChain(ops) {
6
+ let lastAccessLHS = undefined;
7
+ let value = ops[0];
8
+ let i = 1;
9
+ while (i < ops.length) {
10
+ const op = ops[i];
11
+ const fn = ops[i + 1];
12
+ i += 2;
13
+ if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
14
+ return undefined;
15
+ }
16
+ if (op === "access" || op === "optionalAccess") {
17
+ lastAccessLHS = value;
18
+ value = fn(value);
19
+ } else if (op === "call" || op === "optionalCall") {
20
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
21
+ lastAccessLHS = undefined;
22
+ }
23
+ }
24
+ return value;
25
+ }
26
+ defineProvider({
27
+ id: "gemini",
28
+ name: "Gemini app",
29
+ endpoints: ["https://gemini.google.com"],
30
+ settings: [],
31
+ capabilities: ["browser-cookies", "http-status"],
32
+ cookieDomains: ["gemini.google.com", "google.com"],
33
+ cookiePolicy: { selection: "request-url", cache: "nonpersistent", imports: "access-gated" },
34
+ async fetchUsage(ctx) {
35
+ const domain = "gemini.google.com";
36
+ if (ctx.browser.availability(domain) === "off")
37
+ throw ctx.fail.missingCredential("Gemini app cookies are disabled.");
38
+ // UsagePageQuery from the public UsagePageSurface bundle; this is separate from Gemini CLI quotas.
39
+ const signature = "2/dWbCvkVB0X16r9NPnxifeOAAqdCqMf0xeWvau9yPy7g=";
40
+ const variables = JSON.stringify({
41
+ g1Request: { entrypoints: ["GEMINI_USAGE_SETTINGS_UPGRADE_BANNER"] },
42
+ workspaceRequest: { recommendationsForSurfaceRequests: [] },
43
+ });
44
+ const url =
45
+ `https://${domain}/_/BardChatUi/graphql/schemas/GEMINI_WEB_GRAPHQL/executeQuery` +
46
+ `?query_signature=${encodeURIComponent(signature)}&variables=${encodeURIComponent(variables)}`;
47
+ const invalid = () => {
48
+ throw ctx.fail.parseFailure("Gemini app usage response changed. Update CodexBar or report this.");
49
+ };
50
+ const object = (value) =>
51
+ value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
52
+ let rejected = false;
53
+ for await (const session of ctx.browser.sessions(domain)) {
54
+ const response = await ctx.http.get(url, {
55
+ cookieSession: session.id,
56
+ headers: { Accept: "application/json", Referer: `https://${domain}/usage` },
57
+ retryPolicy: "transientIdempotent",
58
+ });
59
+ if (
60
+ response.status === 401 ||
61
+ response.status === 403 ||
62
+ (response.status === 200 && response.bodyText.trimStart().startsWith("<"))
63
+ ) {
64
+ ctx.browser.rejectCookie(domain, session);
65
+ rejected = true;
66
+ continue;
67
+ }
68
+ if (response.status === 429) throw ctx.fail.rateLimited("Gemini app usage is rate limited.");
69
+ if (response.status >= 500) throw ctx.fail.providerUnavailable("Gemini app usage is temporarily unavailable.");
70
+ if (response.status !== 200) throw ctx.fail.apiFailure(`Gemini app returned HTTP ${response.status}.`);
71
+ let results;
72
+ try {
73
+ results = JSON.parse(response.bodyText.trim().replace(/^\)\]\}'\s*/, ""));
74
+ } catch (error) {
75
+ void error;
76
+ return invalid();
77
+ }
78
+ if (!Array.isArray(results)) return invalid();
79
+ const data = results
80
+ .map((result) => object(_optionalChain([object, "call", (_) => _(result), "optionalAccess", (_2) => _2.data])))
81
+ .filter((value) => value !== undefined);
82
+ if (data.length === 0) return invalid();
83
+ const result = data.find((value) => Object.prototype.hasOwnProperty.call(value, "viewer"));
84
+ if (!result) return invalid();
85
+ if (result.viewer === null) {
86
+ ctx.browser.rejectCookie(domain, session);
87
+ rejected = true;
88
+ continue;
89
+ }
90
+ const viewer = object(result.viewer);
91
+ if (!viewer) return invalid();
92
+ const usage = object(
93
+ _optionalChain([object, "call", (_3) => _3(viewer.rpcs), "optionalAccess", (_4) => _4.getUsageInfo]),
94
+ );
95
+ if (!usage || !Array.isArray(usage.pools)) return invalid();
96
+ const pools = usage.pools;
97
+ const window = (type, minutes) => {
98
+ const pool = pools
99
+ .map(object)
100
+ .find((pool) => _optionalChain([pool, "optionalAccess", (_5) => _5.poolType]) === type);
101
+ const percent = _optionalChain([pool, "optionalAccess", (_6) => _6.percentageUsed]);
102
+ if (typeof percent !== "number" || !Number.isFinite(percent) || percent < 0) return undefined;
103
+ const rawReset = _optionalChain([
104
+ object,
105
+ "call",
106
+ (_7) => _7(_optionalChain([pool, "optionalAccess", (_8) => _8.gxu])),
107
+ "optionalAccess",
108
+ (_9) => _9.windowRefreshesAt,
109
+ ]);
110
+ let resetsAt;
111
+ if (typeof rawReset === "string" && /^\d{4}-\d{2}-\d{2}T/.test(rawReset)) {
112
+ try {
113
+ const date = ctx.date.iso(rawReset);
114
+ if (Number.isFinite(date.getTime())) resetsAt = date;
115
+ } catch (error) {
116
+ void error;
117
+ }
118
+ }
119
+ return { usedPercent: Math.min(100, percent * 100), windowMinutes: minutes, resetsAt };
120
+ };
121
+ const primary = window("GXU_FIVE_HOURLY", 300);
122
+ const secondary = window("GXU_WEEKLY", 10080);
123
+ if (!primary && !secondary) {
124
+ throw ctx.fail.providerUnavailable("This Google account reports no Gemini app usage windows.");
125
+ }
126
+ return {
127
+ primary,
128
+ secondary,
129
+ identity: { loginMethod: usage.subscriptionTier === "TIER1" ? "Pro" : undefined },
130
+ dataConfidence: "exact",
131
+ };
132
+ }
133
+ if (rejected) throw ctx.fail.authenticationExpired("Sign in again at gemini.google.com/usage.");
134
+ throw ctx.fail.missingCredential(
135
+ `Sign in at gemini.google.com/usage. Supported browsers: ${ctx.browser.supportedBrowsers}. Or paste its Cookie header.`,
136
+ );
137
+ },
138
+ });
139
+
140
+ // END UPSTREAM
141
+ })(globalThis.defineProvider);
@@ -0,0 +1,25 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "gemini-apps",
4
+ "name": "Gemini app",
5
+ "version": "0.1.0",
6
+ "entry": "plugin.js",
7
+ "enabledByDefault": false,
8
+ "supportedModes": [
9
+ "web"
10
+ ],
11
+ "autoMode": "web",
12
+ "usageDashboardUrl": "https://gemini.google.com/usage",
13
+ "webUrl": "https://gemini.google.com",
14
+ "envVars": [
15
+ "GEMINI_COOKIE"
16
+ ],
17
+ "setupFields": [],
18
+ "upstream": {
19
+ "repository": "https://github.com/steipete/CodexBar",
20
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
21
+ "path": "Sources/CodexBarCore/Resources/Plugins/gemini-web.js",
22
+ "sha256": "7c71195603b2051ad74d85c0acc523546cf5ec62a600ae4900a1d7e54be7b02e",
23
+ "license": "MIT"
24
+ }
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,2 @@
1
+ <!-- GitKraken mark from GitKraken browser extension: https://github.com/gitkraken/gk-browser-extension/blob/main/src/hosts/github.ts -->
2
+ <svg role="img" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>GitKraken</title><path d="M0 16C0 7.177 7.177 0 16 0s16 7.177 16 16-7.177 16-16 16S0 24.823 0 16Zm28.226-4.714a.607.607 0 0 0-.269-.317l-.004-.001c-.123-.07-.268-.095-.409-.07a.613.613 0 0 0-.5.6c.002.073.014.144.04.214.502 1.337.757 2.741.756 4.17a11.835 11.835 0 0 1-10.188 11.729v-5.396c.284-.058.566-.134.84-.226v4.67l.111-.027a11.128 11.128 0 0 0 6.042-3.864 10.939 10.939 0 0 0 2.406-6.884 11.052 11.052 0 0 0-5.703-9.685.618.618 0 0 0-.476-.046.61.61 0 0 0-.113 1.113 9.846 9.846 0 0 1-1.031 17.733v-3.954a1.666 1.666 0 0 0 1.104-1.387 1.67 1.67 0 0 0-.768-1.606c.237-2.17.927-2.598 1.433-2.913.302-.186.561-.348.561-.817v-.668c0-.692-.687-2.307-2.224-4.353-2.127-2.834-3.34-3.13-3.659-3.153-.12-.012-.223-.007-.337 0h-.012c-.321.023-1.534.32-3.664 3.153-1.539 2.046-2.227 3.661-2.227 4.353v.666c0 .47.26.63.56.817.506.313 1.197.742 1.433 2.912a1.664 1.664 0 0 0-.779 1.423c0 .692.456 1.33 1.117 1.572v3.955a9.837 9.837 0 0 1-4.364-3.51 9.784 9.784 0 0 1-1.752-5.604c0-3.578 1.95-6.88 5.088-8.62a.609.609 0 0 0-.294-1.14h-.001a.593.593 0 0 0-.29.076 11.057 11.057 0 0 0-5.71 9.684c0 2.53.833 4.91 2.407 6.885a11.131 11.131 0 0 0 6.041 3.864l.111.027v-4.669c.275.092.557.168.84.226v5.395A11.834 11.834 0 0 1 4.154 15.884c0-1.43.255-2.833.76-4.17a.612.612 0 0 0-.017-.464.597.597 0 0 0-.34-.316.611.611 0 0 0-.655.155.61.61 0 0 0-.125.202 13.133 13.133 0 0 0-.744 6.067A13.135 13.135 0 0 0 5.128 23.1a13.134 13.134 0 0 0 4.477 4.162 13.14 13.14 0 0 0 5.88 1.672l.093.003v-6.565a17.775 17.775 0 0 0 .479.012c.08-.002.233-.006.362-.012v6.565l.093-.003a13.156 13.156 0 0 0 5.878-1.676 13.152 13.152 0 0 0 4.477-4.163 13.145 13.145 0 0 0 2.097-5.741 13.146 13.146 0 0 0-.738-6.068ZM13.664 20.01a.977.977 0 0 0-.436-1.442.978.978 0 0 0-1.329.71.978.978 0 0 0 .583 1.09.974.974 0 0 0 1.183-.357h-.002Zm6.343-.994a.971.971 0 0 0-1.14-.475.978.978 0 0 0-.69 1.025.975.975 0 0 0 .968.881.974.974 0 0 0 .861-1.431h.001Z"/></svg>
@@ -0,0 +1,158 @@
1
+ // Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
2
+ globalThis.__usagestat_bundled_options = {"labels":["Personal","Shared pool","Additional"],"defaults":{},"autoMode":"api"};
3
+ (function(defineProvider) {
4
+ // BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/gitkraken.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
+
34
+ defineProvider({
35
+ id: "gitkraken",
36
+ name: "GitKraken AI",
37
+ endpoints: ["https://api.gitkraken.dev"],
38
+ auth: { type: "bearer", secret: "GITKRAKEN_API_TOKEN" },
39
+ settings: [
40
+ { key: "GITKRAKEN_API_TOKEN", title: "GitKraken access token", type: "secure" },
41
+ { key: "GITKRAKEN_ORG_ID", title: "API organization ID", type: "plain" },
42
+ { key: "CLIENT_VERSION", title: "Client version", type: "plain" },
43
+ ],
44
+ capabilities: ["http-status"],
45
+ async fetchUsage(ctx) {
46
+ const token = ctx.settings.getSecret("GITKRAKEN_API_TOKEN");
47
+ if (!token) throw ctx.fail.missingCredential("Set a GitKraken access token in Settings or GITKRAKEN_API_TOKEN.");
48
+ if (!/^[\x21-\x7e]{1,16384}$/.test(token)) {
49
+ throw ctx.fail.authenticationExpired("Invalid GitKraken token. Paste only the value after Bearer.");
50
+ }
51
+ const organization = _optionalChain([
52
+ ctx,
53
+ "access",
54
+ (_) => _.settings,
55
+ "access",
56
+ (_2) => _2.get,
57
+ "call",
58
+ (_3) => _3("GITKRAKEN_ORG_ID"),
59
+ "optionalAccess",
60
+ (_4) => _4.trim,
61
+ "call",
62
+ (_5) => _5(),
63
+ ]);
64
+ if (organization && !/^[\x21-\x7e]{1,256}$/.test(organization)) {
65
+ throw ctx.fail.permissionDenied("Invalid GitKraken organization ID. Enter a single ID without whitespace.");
66
+ }
67
+ const headers = {
68
+ "Client-Name": "CodexBar",
69
+ "Client-Version": ctx.settings.get("CLIENT_VERSION") || "0.0.0",
70
+ "User-Agent": "CodexBar",
71
+ };
72
+ if (organization) headers["gk-org-id"] = organization;
73
+ const response = await ctx.http.get("https://api.gitkraken.dev/v1/ai-tasks/usage", { headers });
74
+ if (response.status === 401)
75
+ throw ctx.fail.authenticationExpired("GitKraken access token expired or was rejected.");
76
+ if (response.status === 403)
77
+ throw ctx.fail.permissionDenied("GitKraken denied access to this account or organization.");
78
+ if (response.status === 429) {
79
+ const delay = Number(_nullishCoalesce(response.headers["retry-after"], () => 1));
80
+ throw ctx.fail.rateLimited("GitKraken rate limited usage requests.", {
81
+ retryAfterSeconds: Number.isFinite(delay) && delay >= 0 ? Math.min(delay, 10) : 1,
82
+ });
83
+ }
84
+ if (response.status >= 500) throw ctx.fail.providerUnavailable("GitKraken usage is temporarily unavailable.");
85
+ if (response.status !== 200) throw ctx.fail.apiFailure(`GitKraken returned HTTP ${response.status}.`);
86
+
87
+ function fail() {
88
+ throw ctx.fail.parseFailure("GitKraken returned an unrecognized usage response.");
89
+ }
90
+ function quota(value) {
91
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
92
+ const { used, limit } = value;
93
+ if (
94
+ typeof used !== "number" ||
95
+ !Number.isFinite(used) ||
96
+ used < 0 ||
97
+ typeof limit !== "number" ||
98
+ !Number.isFinite(limit) ||
99
+ (limit < 0 && limit !== -1) ||
100
+ (limit > 0 && !Number.isFinite((used / limit) * 100))
101
+ )
102
+ return null;
103
+ return { used, limit };
104
+ }
105
+ let body;
106
+ try {
107
+ body = JSON.parse(response.bodyText);
108
+ } catch (error) {
109
+ void error;
110
+ return fail();
111
+ }
112
+ const data = _optionalChain([body, "optionalAccess", (_6) => _6.data]);
113
+ const personal = quota(data);
114
+ if (_optionalChain([body, "optionalAccess", (_7) => _7.error]) != null || !personal) return fail();
115
+ if (
116
+ typeof data.resetsOn !== "string" ||
117
+ !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(data.resetsOn)
118
+ )
119
+ return fail();
120
+ const resetsAt = new Date(data.resetsOn);
121
+ if (!Number.isFinite(resetsAt.getTime())) return fail();
122
+ const pool = quota(data.organization);
123
+ const number = (value) => ctx.format.number(value, { maximumFractionDigits: 2 });
124
+ function description(value) {
125
+ if (value.limit <= 0)
126
+ return `${number(value.used)} credits used · ${value.limit === -1 ? "Unlimited" : "No allowance"}`;
127
+ return `${number(value.used)} / ${number(value.limit)} credits used`;
128
+ }
129
+ const rows = [{ label: "Personal", value: description(personal) }];
130
+ if (pool) {
131
+ rows.push({ label: "Shared pool", value: description(pool) });
132
+ // sharedUsed is a slice of the pool, never additional personal usage.
133
+ const shared = data.sharedUsed;
134
+ if (typeof shared === "number" && Number.isFinite(shared) && shared >= 0 && shared <= pool.used) {
135
+ rows.push({ label: "Your shared usage", value: `${number(shared)} credits` });
136
+ rows.push({ label: "Rest of organization", value: `${number(pool.used - shared)} credits` });
137
+ }
138
+ }
139
+ if (personal.limit <= 0 && (!pool || pool.limit <= 0)) {
140
+ rows.push({ label: "Reset", value: resetsAt.toISOString() });
141
+ }
142
+ function window(value) {
143
+ return value && value.limit > 0
144
+ ? { usedPercent: ctx.pct(value.used, value.limit), windowMinutes: 10080, resetsAt }
145
+ : null;
146
+ }
147
+ return {
148
+ primary: window(personal),
149
+ secondary: window(pool),
150
+ details: [{ title: "Weekly usage", rows }],
151
+ identity: { loginMethod: "API" },
152
+ dataConfidence: "exact",
153
+ };
154
+ },
155
+ });
156
+
157
+ // END UPSTREAM
158
+ })(globalThis.defineProvider);
@@ -0,0 +1,32 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "gitkraken",
4
+ "name": "GitKraken AI",
5
+ "version": "0.1.0",
6
+ "entry": "plugin.js",
7
+ "enabledByDefault": false,
8
+ "supportedModes": [
9
+ "api"
10
+ ],
11
+ "autoMode": "api",
12
+ "usageDashboardUrl": "https://gitkraken.dev/account#ai-usage",
13
+ "envVars": [
14
+ "GITKRAKEN_API_TOKEN",
15
+ "GITKRAKEN_ORG_ID"
16
+ ],
17
+ "setupFields": [
18
+ {
19
+ "key": "GITKRAKEN_ORG_ID",
20
+ "title": "API organization ID",
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/gitkraken.js",
29
+ "sha256": "c583890b74fc4c054cd818e560b30a17dd716c7611b554bd5b559f533a824ca2",
30
+ "license": "MIT"
31
+ }
32
+ }
@@ -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 fill="currentColor" viewBox="0.25 -0.25 24 24" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M2.5 14.5a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0-9 0ZM6.5 10.5a6 6 0 1 0 12 0a6 6 0 1 0-12 0ZM13 14.5a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0-9 0ZM7 12v7h10.5v-7Z"/>
3
+ </svg>
@@ -0,0 +1,204 @@
1
+ // Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
2
+ globalThis.__usagestat_bundled_options = {"labels":["Credits","Additional","Additional"],"defaults":{},"autoMode":"web","balanceOnly":true};
3
+ (function(defineProvider) {
4
+ // BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/googledeveloper.js
5
+ function _nullishCoalesce(lhs, rhsFn) {
6
+ if (lhs != null) {
7
+ return lhs;
8
+ } else {
9
+ return rhsFn();
10
+ }
11
+ }
12
+ defineProvider({
13
+ id: "googledeveloper",
14
+ name: "Google Developer Program",
15
+ settings: [{ key: "MESSAGES", title: "Google Developer Program", type: "plain" }],
16
+ endpoints: ["https://me.developers.google.com"],
17
+ capabilities: ["browser-cookies", "http-status"],
18
+ cookieDomains: ["me.developers.google.com", "google.com"],
19
+ cookiePolicy: { selection: "request-url", cache: "nonpersistent", imports: "access-gated" },
20
+ async fetchUsage(ctx) {
21
+ const domain = "me.developers.google.com";
22
+ const origin = `https://${domain}`;
23
+ const messages = JSON.parse(ctx.settings.get("MESSAGES") || "{}");
24
+ const message = (key, ...values) => {
25
+ let text = messages[key] || key;
26
+ for (const value of values) text = text.replace("%@", () => value);
27
+ return text;
28
+ };
29
+ const signIn = message(
30
+ "No Google Developer Program session cookies found. Sign in at me.developers.google.com/benefits or paste a Cookie header.",
31
+ );
32
+ if (ctx.browser.availability(domain) === "off")
33
+ throw ctx.fail.missingCredential(message("%@ cookies are disabled.", "Google Developer Program"));
34
+ const invalid = () => {
35
+ throw ctx.fail.parseFailure(
36
+ message("Google Developer Program returned an unrecognized response. Update CodexBar and try again."),
37
+ );
38
+ };
39
+ const json = (text) => {
40
+ try {
41
+ return JSON.parse(text);
42
+ } catch (error) {
43
+ void error;
44
+ return invalid();
45
+ }
46
+ };
47
+ const array = (value) => (Array.isArray(value) ? value : invalid());
48
+ // Google Money arrays omit zero units and nanos.
49
+ const integer = (value) =>
50
+ value === null || value === undefined
51
+ ? 0
52
+ : typeof value === "number" && Number.isSafeInteger(value)
53
+ ? value
54
+ : invalid();
55
+ const money = (value) => {
56
+ const [currency, units, nanos] = array(value);
57
+ if (typeof currency !== "string" || !/^[A-Z]{3}$/.test(currency)) return invalid();
58
+ return { currency, amount: integer(units) + integer(nanos) / 1e9 };
59
+ };
60
+ // A malformed timestamp means an unknown date, never a failed refresh.
61
+ const date = (value) => {
62
+ const seconds = Array.isArray(value) ? value[0] : undefined;
63
+ return typeof seconds === "number" && Number.isSafeInteger(seconds) && seconds > 0
64
+ ? ctx.date.unixSeconds(seconds)
65
+ : undefined;
66
+ };
67
+ const day = (value) =>
68
+ `${value.getFullYear()}-${String(value.getMonth() + 1).padStart(2, "0")}-${String(value.getDate()).padStart(2, "0")}`;
69
+ // WIZ_global_data values are JSON string literals.
70
+ const pageValue = (html, key) => {
71
+ const literal = ctx.html.matchFirst(html, `"${key}":("(?:[^"\\\\]|\\\\.)*")`);
72
+ return literal ? json(literal) : undefined;
73
+ };
74
+ // Signed-out requests redirect to accounts.google.com, which the host refuses, or answer 401 or 403.
75
+ const denied = (response) => {
76
+ if ((response.status >= 300 && response.status < 400) || response.status === 401 || response.status === 403)
77
+ return true;
78
+ if (response.status === 429) {
79
+ throw ctx.fail.rateLimited(message("Google Developer Program is rate limiting requests. Try again later."));
80
+ }
81
+ if (response.status >= 500) {
82
+ throw ctx.fail.providerUnavailable(message("Google Developer Program request failed. Try refreshing later."));
83
+ }
84
+ if (response.status !== 200) {
85
+ throw ctx.fail.apiFailure(message("Google Developer Program request failed. Try refreshing later."));
86
+ }
87
+ return false;
88
+ };
89
+ let unapplied;
90
+ let signedIn = false;
91
+ let rejected = false;
92
+ for await (const session of ctx.browser.sessions(domain)) {
93
+ const emails = [];
94
+ // Each authuser index is one signed-in Google account, and only one of them may hold the credit.
95
+ for (let account = 0; account < 8; account += 1) {
96
+ const page = await ctx.http.get(`${origin}/benefits?authuser=${account}`, {
97
+ cookieSession: session.id,
98
+ headers: { Accept: "text/html" },
99
+ retryPolicy: "transientIdempotent",
100
+ });
101
+ if (denied(page)) break;
102
+ // Signed-out pages also omit the page tokens.
103
+ const token = pageValue(page.bodyText, "SNlM0e");
104
+ const email = pageValue(page.bodyText, "oPEP7c");
105
+ if (!token || !email || emails.includes(email)) break;
106
+
107
+ const response = await ctx.http.post(
108
+ `${origin}/_/GoogleDeveloperProfile/data/batchexecute` +
109
+ `?rpcids=Ro0AYc&source-path=%2Fbenefits&hl=en&authuser=${account}&rt=c`,
110
+ {
111
+ cookieSession: session.id,
112
+ form: { "f.req": JSON.stringify([[["Ro0AYc", "[]", null, "generic"]]]), at: token },
113
+ headers: { Origin: origin, Referer: `${origin}/benefits` },
114
+ },
115
+ );
116
+ if (denied(response)) break;
117
+ emails.push(email);
118
+ signedIn = true;
119
+ // The chunked envelope alternates length lines with JSON chunks. Only the Ro0AYc result matters.
120
+ const result = response.bodyText
121
+ .split("\n")
122
+ .filter((line) => line.startsWith("["))
123
+ .flatMap((line) => array(json(line)))
124
+ .find((entry) => Array.isArray(entry) && entry[0] === "wrb.fr" && entry[1] === "Ro0AYc");
125
+ if (!result) return invalid();
126
+ // A per-account RPC error has no string payload, so try the next account.
127
+ if (typeof result[2] !== "string") continue;
128
+ const list = array(json(result[2]))[0];
129
+ // Benefit type 19 is the monthly Gen AI & Cloud credit of Google AI Pro and Ultra.
130
+ const credit = array(_nullishCoalesce(list, () => []))
131
+ .map((benefit) => array(benefit))
132
+ .find((benefit) => benefit[0] === 19);
133
+ if (!credit) continue;
134
+ const offer = array(_nullishCoalesce(credit[9], () => []));
135
+ // A credit that is not applied to a billing account yet has no money fields.
136
+ if (offer[6] === null || offer[6] === undefined) {
137
+ unapplied ??= email;
138
+ continue;
139
+ }
140
+ const billing = array(offer[6]);
141
+ const granted = money(billing[0]);
142
+ const remaining = money(billing[1]);
143
+ if (granted.amount <= 0) return invalid();
144
+ if (remaining.currency !== granted.currency) return invalid();
145
+ const currency = granted.currency;
146
+ const left = Math.max(0, remaining.amount);
147
+ const expiresAt = date(offer[1]);
148
+ const grantedAt = date(offer[16]);
149
+ const amounts = message(
150
+ "%@ of %@ left",
151
+ ctx.format.currency(left, currency),
152
+ ctx.format.currency(granted.amount, currency),
153
+ );
154
+ // The billing account is display-only, so an unexpected format never fails the refresh.
155
+ const rows =
156
+ typeof billing[2] === "string"
157
+ ? [{ label: "Billing account", value: billing[2].replace(/^billingAccounts\//, "") }]
158
+ : [];
159
+ if (grantedAt) rows.push({ label: "Granted", value: day(grantedAt) });
160
+ return {
161
+ primary: {
162
+ usedPercent: ctx.pct(granted.amount - left, granted.amount),
163
+ resetDescription: expiresAt ? `${amounts} · ${message("Expires %@", day(expiresAt))}` : amounts,
164
+ },
165
+ cost: { used: left, currency, period: "Monthly credits", balance: left },
166
+ details: [{ title: "Billing", rows }],
167
+ identity: { email, loginMethod: message("Browser session") },
168
+ dataConfidence: "exact",
169
+ };
170
+ }
171
+ if (signedIn) break;
172
+ // A session whose first account fails the page or the RPC is signed out.
173
+ ctx.browser.rejectCookie(domain, session);
174
+ rejected = true;
175
+ }
176
+ if (unapplied) {
177
+ return {
178
+ details: [
179
+ {
180
+ title: "Cloud credits",
181
+ rows: [
182
+ {
183
+ label: "Status",
184
+ value: message("Not applied"),
185
+ secondaryValue: "me.developers.google.com/benefits",
186
+ },
187
+ ],
188
+ },
189
+ ],
190
+ identity: { email: unapplied, loginMethod: message("Browser session") },
191
+ dataConfidence: "exact",
192
+ };
193
+ }
194
+ if (signedIn)
195
+ throw ctx.fail.permissionDenied(message("No Cloud credit found. Check your Google Developer Program benefits."));
196
+ if (rejected) throw ctx.fail.authenticationExpired(`${message("Google session expired or invalid.")} ${signIn}`);
197
+ throw ctx.fail.missingCredential(
198
+ `${signIn} ${message("Supported browsers: %@. Use Manual for other browsers.", ctx.browser.supportedBrowsers)}`,
199
+ );
200
+ },
201
+ });
202
+
203
+ // END UPSTREAM
204
+ })(globalThis.defineProvider);
@@ -0,0 +1,25 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "googledeveloper",
4
+ "name": "Google Developer Program",
5
+ "version": "0.1.0",
6
+ "entry": "plugin.js",
7
+ "enabledByDefault": false,
8
+ "supportedModes": [
9
+ "web"
10
+ ],
11
+ "autoMode": "web",
12
+ "usageDashboardUrl": "https://me.developers.google.com/benefits",
13
+ "webUrl": "https://me.developers.google.com",
14
+ "envVars": [
15
+ "GOOGLEDEVELOPER_COOKIE"
16
+ ],
17
+ "setupFields": [],
18
+ "upstream": {
19
+ "repository": "https://github.com/steipete/CodexBar",
20
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
21
+ "path": "Sources/CodexBarCore/Resources/Plugins/googledeveloper.js",
22
+ "sha256": "16f97c5fa06d7f4b4255f1e0413af01fa9a0ee7af03243701a40b0f6294564c0",
23
+ "license": "MIT"
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ <svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>