@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.
- package/native-manifest.json +1532 -134
- package/package.json +235 -2
- package/plugins/UPSTREAM-LICENSES.md +6 -2
- package/plugins/_provider-icons/LICENSE +21 -0
- package/plugins/_provider-icons/NOTICE +12 -0
- package/plugins/_provider-icons/licenses/CodexBar-MIT.txt +21 -0
- package/plugins/_provider-icons/licenses/LobeHub-MIT.txt +21 -0
- package/plugins/_provider-icons/licenses/UsageStat-Bar-MIT.txt +21 -0
- package/plugins/_provider-icons/manifest.json +1219 -0
- package/plugins/_provider-icons/provenance.json +269 -0
- package/plugins/_provider-icons/source.json +4 -0
- package/plugins/abacus-ai/icon-color.svg +18 -0
- 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/LICENSE +21 -0
- package/plugins/aixy/icon.svg +1 -0
- package/plugins/aixy/plugin.js +266 -0
- package/plugins/aixy/plugin.json +32 -0
- package/plugins/antigravity/plugin.js +189 -65
- package/plugins/antigravity-cli/icon-color.svg +1 -0
- package/plugins/antigravity-cli/icon.svg +1 -3
- package/plugins/antigravity-cli/plugin.js +32 -20
- package/plugins/antigravity-ide/icon-color.svg +1 -0
- package/plugins/antigravity-ide/icon.svg +1 -3
- package/plugins/antigravity-ide/plugin.js +19 -7
- package/plugins/atlascloud/LICENSE +21 -0
- package/plugins/atlascloud/icon-color.svg +1 -0
- package/plugins/atlascloud/icon.svg +1 -0
- package/plugins/atlascloud/plugin.js +54 -0
- package/plugins/atlascloud/plugin.json +24 -0
- package/plugins/augment/icon-color.svg +14 -0
- package/plugins/bifrost/LICENSE +21 -0
- package/plugins/bifrost/icon.svg +3 -0
- package/plugins/bifrost/plugin.js +366 -0
- package/plugins/bifrost/plugin.json +31 -0
- 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 +340 -153
- package/plugins/claude/plugin.json +1 -1
- 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/clinepass/plugin.js +19 -3
- package/plugins/codebuff/icon-color.svg +92 -0
- package/plugins/coderabbit/plugin.js +25 -0
- package/plugins/coderabbit/plugin.json +12 -0
- package/plugins/codex/plugin.js +15 -8
- package/plugins/codex/plugin.json +11 -2
- package/plugins/command-code/icon-color.svg +3 -0
- package/plugins/command-code/plugin.js +7 -3
- package/plugins/copilot/icon.svg +1 -1
- package/plugins/copilot/plugin.json +1 -0
- package/plugins/cosmic/LICENSE +21 -0
- package/plugins/cosmic/icon.svg +1 -0
- package/plugins/cosmic/plugin.js +134 -0
- package/plugins/cosmic/plugin.json +32 -0
- package/plugins/crof/icon-color.svg +3 -0
- package/plugins/crofai/icon-color.svg +3 -0
- package/plugins/crofai/icon.svg +2 -15
- package/plugins/cursor/icon-color.svg +1 -0
- package/plugins/cursor/plugin.js +51 -14
- package/plugins/cursor-nightly/plugin.json +1 -1
- package/plugins/deepinfra/icon-color.svg +1 -0
- package/plugins/deepinfra/icon.svg +1 -4
- package/plugins/deepseek/plugin.js +150 -59
- package/plugins/deepseek/plugin.json +3 -1
- package/plugins/devin/plugin.js +3 -0
- package/plugins/devpass/LICENSE +21 -0
- package/plugins/devpass/icon.svg +3 -0
- package/plugins/devpass/plugin.js +120 -0
- package/plugins/devpass/plugin.json +24 -0
- package/plugins/elevenlabs/icon-color.svg +4 -0
- 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/factory/icon-color.svg +1 -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/fireworks-ai/icon-color.svg +1 -0
- package/plugins/fireworks-ai/icon.svg +1 -6
- 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 +21 -0
- package/plugins/gemini-apps/icon-color.svg +1 -0
- package/plugins/gemini-apps/icon.svg +1 -0
- package/plugins/gemini-apps/plugin.js +141 -0
- package/plugins/gemini-apps/plugin.json +25 -0
- package/plugins/gitkraken/LICENSE +21 -0
- package/plugins/gitkraken/icon.svg +2 -0
- package/plugins/gitkraken/plugin.js +158 -0
- package/plugins/gitkraken/plugin.json +32 -0
- package/plugins/googledeveloper/LICENSE +21 -0
- package/plugins/googledeveloper/icon.svg +3 -0
- package/plugins/googledeveloper/plugin.js +204 -0
- package/plugins/googledeveloper/plugin.json +25 -0
- package/plugins/grok/icon-color.svg +1 -0
- package/plugins/groqcloud/icon-color.svg +1 -0
- package/plugins/helmcode/LICENSE +21 -0
- package/plugins/helmcode/icon.svg +5 -0
- package/plugins/helmcode/plugin.js +253 -0
- package/plugins/helmcode/plugin.json +32 -0
- package/plugins/huggingface/LICENSE +21 -0
- package/plugins/huggingface/icon-color.svg +1 -0
- package/plugins/huggingface/icon.svg +1 -0
- package/plugins/huggingface/plugin.js +298 -0
- package/plugins/huggingface/plugin.json +26 -0
- package/plugins/hyper/LICENSE +21 -0
- package/plugins/hyper/plugin.js +137 -0
- package/plugins/hyper/plugin.json +27 -0
- package/plugins/jetbrains-ai-assistant/LICENSE +22 -0
- package/plugins/jetbrains-ai-assistant/plugin.js +502 -16
- package/plugins/jetbrains-ai-assistant/plugin.json +27 -4
- package/plugins/kilo/icon-color.svg +1 -0
- package/plugins/kimi/plugin.js +54 -14
- package/plugins/kimi/plugin.json +46 -6
- package/plugins/langdock/LICENSE +21 -0
- package/plugins/langdock/icon.svg +4 -0
- package/plugins/langdock/plugin.js +106 -0
- package/plugins/langdock/plugin.json +25 -0
- package/plugins/linkup/LICENSE +21 -0
- package/plugins/linkup/icon.svg +10 -0
- package/plugins/linkup/plugin.js +46 -0
- package/plugins/linkup/plugin.json +24 -0
- package/plugins/litellm/plugin.js +54 -3
- package/plugins/lithosai/LICENSE +21 -0
- package/plugins/lithosai/icon.svg +1 -0
- package/plugins/lithosai/plugin.js +130 -0
- package/plugins/lithosai/plugin.json +26 -0
- package/plugins/llmman/LICENSE +21 -0
- package/plugins/llmman/icon.svg +4 -0
- package/plugins/llmman/plugin.js +138 -0
- package/plugins/llmman/plugin.json +31 -0
- package/plugins/longcat/icon-color.svg +1 -0
- package/plugins/longcat/icon.svg +1 -4
- package/plugins/manus/icon-color.svg +6 -0
- package/plugins/mimo/icon-color.svg +4 -0
- package/plugins/mimo/icon.svg +4 -1
- package/plugins/mistral/plugin.js +164 -27
- package/plugins/moonshot/icon-color.svg +1 -0
- 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/LICENSE +21 -0
- package/plugins/muse/icon.svg +3 -0
- package/plugins/muse/plugin.js +288 -0
- package/plugins/muse/plugin.json +34 -0
- package/plugins/museai/LICENSE +21 -0
- package/plugins/museai/icon.svg +3 -0
- package/plugins/museai/plugin.js +161 -0
- package/plugins/museai/plugin.json +26 -0
- package/plugins/nous/LICENSE +21 -0
- package/plugins/nous/icon-color.svg +1 -0
- package/plugins/nous/icon.svg +1 -0
- package/plugins/nous/plugin.js +129 -0
- package/plugins/nous/plugin.json +32 -0
- package/plugins/ollama/icon-color.svg +1 -0
- package/plugins/ollama/plugin.js +58 -0
- package/plugins/openai-api/icon-color.svg +1 -0
- package/plugins/opencode/icon-color.svg +1 -0
- package/plugins/opencode-go/icon-color.svg +1 -0
- package/plugins/opencode-go/plugin.js +104 -37
- package/plugins/opendesign/LICENSE +21 -0
- package/plugins/opendesign/icon.svg +4 -0
- package/plugins/opendesign/plugin.js +108 -0
- package/plugins/opendesign/plugin.json +25 -0
- package/plugins/openrouter/icon-color.svg +1 -0
- package/plugins/parallel/LICENSE +21 -0
- package/plugins/parallel/icon.svg +11 -0
- package/plugins/parallel/plugin.js +97 -0
- package/plugins/parallel/plugin.json +25 -0
- package/plugins/perplexity/LICENSE +22 -0
- package/plugins/perplexity/plugin.js +122 -0
- package/plugins/perplexity/plugin.json +36 -7
- package/plugins/pi/plugin.js +113 -0
- package/plugins/pi/plugin.json +11 -0
- package/plugins/qwencloud/LICENSE +21 -0
- package/plugins/qwencloud/icon-color.svg +1 -0
- package/plugins/qwencloud/icon.svg +1 -4
- package/plugins/qwencloud/plugin.js +197 -0
- package/plugins/qwencloud/plugin.json +17 -0
- package/plugins/raycast/LICENSE +21 -0
- package/plugins/raycast/icon.svg +4 -0
- package/plugins/raycast/plugin.js +179 -0
- package/plugins/raycast/plugin.json +32 -0
- package/plugins/replicate/LICENSE +21 -0
- package/plugins/replicate/icon-color.svg +1 -0
- package/plugins/replicate/icon.svg +1 -0
- package/plugins/replicate/plugin.js +170 -0
- package/plugins/replicate/plugin.json +25 -0
- package/plugins/sailresearch/LICENSE +21 -0
- package/plugins/sailresearch/icon.svg +4 -0
- package/plugins/sailresearch/plugin.js +104 -0
- package/plugins/sailresearch/plugin.json +24 -0
- package/plugins/siliconflow/LICENSE +21 -0
- package/plugins/siliconflow/icon.svg +3 -0
- package/plugins/siliconflow/plugin.js +87 -0
- package/plugins/siliconflow/plugin.json +32 -0
- package/plugins/sofya/LICENSE +21 -0
- package/plugins/sofya/icon.svg +3 -0
- package/plugins/sofya/plugin.js +86 -0
- package/plugins/sofya/plugin.json +24 -0
- package/plugins/soniox/LICENSE +21 -0
- package/plugins/soniox/icon.svg +3 -0
- package/plugins/soniox/plugin.js +103 -0
- package/plugins/soniox/plugin.json +24 -0
- package/plugins/synthetic/icon-color.svg +14 -0
- package/plugins/synthetic/plugin.js +12 -0
- package/plugins/synthetic/plugin.json +51 -9
- package/plugins/tavily/LICENSE +21 -0
- package/plugins/tavily/icon.svg +3 -0
- package/plugins/tavily/plugin.js +61 -0
- package/plugins/tavily/plugin.json +24 -0
- package/plugins/tinyapi/LICENSE +21 -0
- package/plugins/tinyapi/icon.svg +4 -0
- package/plugins/tinyapi/plugin.js +73 -0
- package/plugins/tinyapi/plugin.json +25 -0
- package/plugins/traecn/LICENSE +21 -0
- package/plugins/traecn/icon.svg +3 -0
- package/plugins/traecn/plugin.js +103 -0
- package/plugins/traecn/plugin.json +25 -0
- package/plugins/tripo/LICENSE +21 -0
- package/plugins/tripo/icon.svg +4 -0
- package/plugins/tripo/plugin.js +60 -0
- package/plugins/tripo/plugin.json +24 -0
- package/plugins/typesafe/LICENSE +21 -0
- package/plugins/typesafe/icon.svg +4 -0
- package/plugins/typesafe/plugin.js +181 -0
- package/plugins/typesafe/plugin.json +25 -0
- package/plugins/v0/LICENSE +21 -0
- package/plugins/v0/icon-color.svg +1 -0
- package/plugins/v0/icon.svg +1 -0
- package/plugins/v0/plugin.js +219 -0
- package/plugins/v0/plugin.json +32 -0
- package/plugins/venice/plugin.js +50 -1
- package/plugins/venice/plugin.json +2 -1
- package/plugins/vercel/LICENSE +21 -0
- package/plugins/vercel/icon-color.svg +1 -0
- package/plugins/vercel/icon.svg +1 -0
- package/plugins/vercel/plugin.js +202 -0
- package/plugins/vercel/plugin.json +54 -0
- package/plugins/windsurf/icon-color.svg +1 -0
- package/plugins/workbuddy/LICENSE +21 -0
- package/plugins/workbuddy/icon.svg +1 -0
- package/plugins/workbuddy/plugin.js +318 -0
- package/plugins/workbuddy/plugin.json +63 -0
- package/plugins/xai/icon-color.svg +1 -0
- package/plugins/xai/icon.svg +1 -7
- 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/LICENSE +21 -0
- package/plugins/xkiro/icon.svg +1 -0
- package/plugins/xkiro/plugin.js +104 -0
- package/plugins/xkiro/plugin.json +24 -0
- package/plugins/zai/icon-color.svg +1 -0
- package/plugins/zai/plugin.js +5 -1
- package/plugins/zenmux/icon-color.svg +1 -0
- package/plugins/zenmux/icon.svg +1 -3
- package/usagestat +0 -0
- package/usagestatd +0 -0
- package/plugins/cursor-nightly/plugin.js +0 -1416
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
{ "label": "Status", "url": "https://status.anthropic.com/" },
|
|
11
11
|
{ "label": "Console", "url": "https://console.anthropic.com/" }
|
|
12
12
|
],
|
|
13
|
-
"supportedModes": ["oauth", "web", "local", "api"],
|
|
13
|
+
"supportedModes": ["oauth", "cli", "web", "local", "api"],
|
|
14
14
|
"autoMode": "oauth",
|
|
15
15
|
"webUrl": "https://claude.ai",
|
|
16
16
|
"usageDashboardUrl": "https://claude.ai/settings/usage",
|
|
@@ -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="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M25.7146 63.2153L41.4393 54.3917L41.7025 53.6226L41.4393 53.1976H40.6705L38.0394 53.0359L29.054 52.7929L21.2624 52.4691L13.7134 52.0644L11.8111 51.6594L10.0303 49.3118L10.2123 48.138L11.8111 47.0657L14.0981 47.2681L19.1574 47.6119L26.7467 48.138L32.2516 48.4618L40.4073 49.3118H41.7025L41.8846 48.7857L41.4393 48.4618L41.0955 48.138L33.243 42.8155L24.7432 37.1894L20.2909 33.9513L17.8824 32.3119L16.6684 30.774L16.1422 27.4147L18.328 25.0062L21.2624 25.2088L22.0112 25.4112L24.9861 27.6979L31.3407 32.616L39.6381 38.7273L40.8525 39.7391L41.3381 39.395L41.399 39.1523L40.8525 38.2415L36.3394 30.0858L31.5227 21.7883L29.3775 18.3478L28.811 16.2837C28.6087 15.4334 28.4669 14.7252 28.4669 13.8549L30.9563 10.4753L32.3321 10.0303L35.6515 10.4756L37.0479 11.6897L39.112 16.4052L42.4513 23.8327L47.6321 33.9313L49.15 36.9265L49.9594 39.6991L50.2632 40.5491H50.7894V40.0632L51.2141 34.3766L52.0035 27.3944L52.7726 18.4087L53.0358 15.8793L54.2905 12.8435L56.7795 11.2041L58.7224 12.135L60.3212 14.422L60.0986 15.899L59.1474 22.0718L57.2857 31.7458L56.0713 38.2218H56.7795L57.5892 37.4121L60.8677 33.061L66.3723 26.18L68.801 23.448L71.6342 20.4325L73.4556 18.9957H76.8962L79.4255 22.7601L78.2926 26.6456L74.7509 31.1384L71.8163 34.943L67.607 40.6097L64.9758 45.1431L65.2188 45.5072L65.8464 45.4466L75.358 43.4228L80.4984 42.4917L86.6304 41.4393L89.4033 42.7346L89.7065 44.0502L88.6135 46.7419L82.0566 48.3607L74.3662 49.8989L62.9118 52.6109L62.77 52.7121L62.9321 52.9144L68.0925 53.4L70.2987 53.5214H75.7021L85.7601 54.2702L88.3912 56.0108L89.9697 58.1358L89.7065 59.7545L85.6589 61.8189L80.1949 60.5236L67.4452 57.4881L63.0735 56.3952H62.4665V56.7596L66.1093 60.3213L72.7877 66.3523L81.1461 74.1236L81.5707 76.0462L80.4984 77.5638L79.3649 77.4021L72.0186 71.8772L69.1854 69.3879L62.77 63.9844H62.3453V64.5509L63.8223 66.7164L71.6342 78.4544L72.0389 82.0567L71.4725 83.2308L69.4487 83.939L67.2222 83.534L62.6485 77.1189L57.9333 69.8937L54.1284 63.4177L53.6631 63.6809L51.4167 87.8651L50.3644 89.0995L47.9356 90.0303L45.9121 88.4924L44.8392 86.0031L45.9118 81.0852L47.2071 74.6701L48.2594 69.5699L49.2106 63.2356L49.7773 61.131L49.7367 60.9892L49.2715 61.0498L44.4954 67.607L37.23 77.4224L31.4825 83.5746L30.1063 84.1211L27.7181 82.8864L27.9408 80.6805L29.2763 78.7177L37.2297 68.5988L42.026 62.3248L45.1227 58.7025L45.1024 58.176H44.9204L23.7917 71.8975L20.0274 72.3831L18.4083 70.8655L18.6106 68.3761L19.3798 67.5664L25.7343 63.195L25.7146 63.2153Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,244 @@
|
|
|
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/claudeplatform.js
|
|
5
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
6
|
+
if (lhs != null) {
|
|
7
|
+
return lhs;
|
|
8
|
+
} else {
|
|
9
|
+
return rhsFn();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
defineProvider({
|
|
13
|
+
id: "claudeplatform",
|
|
14
|
+
name: "Claude Platform",
|
|
15
|
+
settings: [],
|
|
16
|
+
endpoints: ["https://platform.claude.com"],
|
|
17
|
+
capabilities: ["browser-cookies", "http-status"],
|
|
18
|
+
cookieDomains: ["platform.claude.com"],
|
|
19
|
+
cookiePolicy: {
|
|
20
|
+
selection: "request-url",
|
|
21
|
+
cache: "nonpersistent",
|
|
22
|
+
imports: "access-gated",
|
|
23
|
+
requiredCookies: ["sessionKey"],
|
|
24
|
+
},
|
|
25
|
+
async fetchUsage(ctx) {
|
|
26
|
+
const domain = "platform.claude.com";
|
|
27
|
+
if (ctx.browser.availability(domain) === "off")
|
|
28
|
+
throw ctx.fail.missingCredential("Claude Platform cookies are disabled.");
|
|
29
|
+
|
|
30
|
+
const invalid = (field) => {
|
|
31
|
+
throw ctx.fail.parseFailure(
|
|
32
|
+
`Could not parse Claude Console ${field}. The Console response format may have changed; update CodexBar or report this.`,
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
const object = (value, field) =>
|
|
36
|
+
value !== null && typeof value === "object" && !Array.isArray(value) ? value : invalid(field);
|
|
37
|
+
const minorUnits = (value, field) =>
|
|
38
|
+
typeof value === "number" && Number.isSafeInteger(value) ? value : invalid(field);
|
|
39
|
+
const text = (value) => (typeof value === "string" && value.trim() ? value.trim() : undefined);
|
|
40
|
+
// A malformed date means an unknown expiry, never a failed refresh.
|
|
41
|
+
const timestamp = (value) => {
|
|
42
|
+
const raw = text(value);
|
|
43
|
+
if (!raw || !/^\d{4}-\d{2}-\d{2}T/.test(raw) || !Number.isFinite(Date.parse(raw))) return undefined;
|
|
44
|
+
try {
|
|
45
|
+
const date = ctx.date.iso(raw);
|
|
46
|
+
return Number.isFinite(date.getTime()) ? date : undefined;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
void error;
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
53
|
+
const now = ctx.date.now();
|
|
54
|
+
// Console grants expire at UTC midnight; show that UTC calendar date instead of shifting it into the local zone.
|
|
55
|
+
const expiry = (date) => {
|
|
56
|
+
const [year, month, day] = date.toISOString().slice(0, 10).split("-").map(Number);
|
|
57
|
+
const label = `${months[month - 1]} ${day}`;
|
|
58
|
+
return `Expires ${year === now.getUTCFullYear() ? label : `${label}, ${year}`} (UTC)`;
|
|
59
|
+
};
|
|
60
|
+
const sessionRejected = ctx.fail.authenticationExpired("Claude Console session expired.");
|
|
61
|
+
const billingDenied = ctx.fail.permissionDenied(
|
|
62
|
+
"Claude Console billing access was denied. Ask the organization owner for billing access.",
|
|
63
|
+
);
|
|
64
|
+
let rejected = false;
|
|
65
|
+
for await (const session of ctx.browser.sessions(domain)) {
|
|
66
|
+
const request = async (path, forbidden) => {
|
|
67
|
+
const response = await ctx.http.get(`https://${domain}${path}`, {
|
|
68
|
+
cookieSession: session.id,
|
|
69
|
+
headers: { Accept: "application/json" },
|
|
70
|
+
});
|
|
71
|
+
if (response.status === 401) throw sessionRejected;
|
|
72
|
+
if (response.status === 403) throw forbidden;
|
|
73
|
+
if (response.status === 429) {
|
|
74
|
+
throw ctx.fail.rateLimited("Claude Console requests are rate limited. Try again in a few minutes.");
|
|
75
|
+
}
|
|
76
|
+
if (response.status >= 500) {
|
|
77
|
+
throw ctx.fail.providerUnavailable("Claude Console is unavailable. Try again later.");
|
|
78
|
+
}
|
|
79
|
+
if (response.status !== 200) {
|
|
80
|
+
throw ctx.fail.apiFailure(`Claude Console returned HTTP ${response.status}. Try again later or report this.`);
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
return JSON.parse(response.bodyText);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
void error;
|
|
86
|
+
return invalid("JSON response");
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
// The organizations list doubles as the session check; a rejected cookie answers 403.
|
|
91
|
+
const organizations = await request("/api/organizations", sessionRejected);
|
|
92
|
+
if (!Array.isArray(organizations)) return invalid("organizations");
|
|
93
|
+
// Claude.ai chat organizations share this list; only API organizations own Console billing.
|
|
94
|
+
const candidates = organizations
|
|
95
|
+
.map((value) => object(value, "organization"))
|
|
96
|
+
.filter((value) => Array.isArray(value.capabilities) && value.capabilities.some((item) => item === "api"))
|
|
97
|
+
.map((organization) => {
|
|
98
|
+
const id = text(organization.uuid);
|
|
99
|
+
if (!id || !/^[A-Za-z0-9-]{1,64}$/.test(id)) return invalid("organization ID");
|
|
100
|
+
return { id, name: text(organization.name) };
|
|
101
|
+
});
|
|
102
|
+
if (candidates.length === 0)
|
|
103
|
+
throw ctx.fail.permissionDenied(
|
|
104
|
+
"This Claude account has no Claude Console API organization. Create one at platform.claude.com.",
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// Try API organizations in listed order; the first one whose billing this member can read wins.
|
|
108
|
+
let selected;
|
|
109
|
+
for (const candidate of candidates) {
|
|
110
|
+
try {
|
|
111
|
+
const credits = object(
|
|
112
|
+
await request(`/api/organizations/${candidate.id}/prepaid/credits`, billingDenied),
|
|
113
|
+
"credit balance",
|
|
114
|
+
);
|
|
115
|
+
selected = { ...candidate, credits };
|
|
116
|
+
break;
|
|
117
|
+
} catch (error) {
|
|
118
|
+
if (error !== billingDenied) throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (!selected) throw billingDenied;
|
|
122
|
+
const credits = selected.credits;
|
|
123
|
+
const currency = _nullishCoalesce(text(credits.currency), () => "USD");
|
|
124
|
+
if (!/^[A-Z]{3}$/.test(currency)) return invalid("currency");
|
|
125
|
+
let exponent = 2;
|
|
126
|
+
if (credits.balance !== undefined && credits.balance !== null) {
|
|
127
|
+
const reported = object(
|
|
128
|
+
_nullishCoalesce(object(credits.balance, "balance").credits, () => ({})),
|
|
129
|
+
"balance credits",
|
|
130
|
+
).exponent;
|
|
131
|
+
if (reported !== undefined && reported !== null) {
|
|
132
|
+
if (typeof reported !== "number" || !Number.isInteger(reported) || reported < 0 || reported > 4)
|
|
133
|
+
return invalid("currency exponent");
|
|
134
|
+
exponent = reported;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const scale = 10 ** exponent;
|
|
138
|
+
const money = (minor) => ctx.format.currency(minor / scale, currency);
|
|
139
|
+
const balance = minorUnits(credits.amount, "credit balance") / scale;
|
|
140
|
+
|
|
141
|
+
const grants = [];
|
|
142
|
+
for (const [field, purchased] of [
|
|
143
|
+
["promo_tranches", false],
|
|
144
|
+
["tranches", true],
|
|
145
|
+
]) {
|
|
146
|
+
const list = credits[field];
|
|
147
|
+
if (list === undefined || list === null) continue;
|
|
148
|
+
if (!Array.isArray(list)) return invalid(field);
|
|
149
|
+
for (const raw of list) {
|
|
150
|
+
const tranche = object(raw, "credit grant");
|
|
151
|
+
const granted = minorUnits(tranche.granted_amount_minor_units, "granted credit");
|
|
152
|
+
const remaining = minorUnits(tranche.remaining_amount_minor_units, "remaining credit");
|
|
153
|
+
const expiresAt = timestamp(tranche.expires_at);
|
|
154
|
+
if (granted <= 0 || (expiresAt && expiresAt.getTime() <= now.getTime())) continue;
|
|
155
|
+
grants.push({
|
|
156
|
+
label: _nullishCoalesce(text(tranche.name), () => (purchased ? "Purchased credit" : "API credit")),
|
|
157
|
+
program: text(tranche.program_id),
|
|
158
|
+
purchased,
|
|
159
|
+
remaining: Math.max(0, remaining),
|
|
160
|
+
granted,
|
|
161
|
+
expiresAt,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
grants.sort((lhs, rhs) => {
|
|
166
|
+
if (!lhs.expiresAt && !rhs.expiresAt) return 0;
|
|
167
|
+
if (!lhs.expiresAt) return 1;
|
|
168
|
+
if (!rhs.expiresAt) return -1;
|
|
169
|
+
return lhs.expiresAt.getTime() - rhs.expiresAt.getTime();
|
|
170
|
+
});
|
|
171
|
+
// The soonest-expiring grant that still has credit is the one about to be lost. An exhausted subscription
|
|
172
|
+
// grant is not a lane: the menu bar falls back to purchased credit and the grant moves to the detail list.
|
|
173
|
+
const subscription = grants.find((grant) => grant.program === "subscription_api_credit" && grant.remaining > 0);
|
|
174
|
+
const purchasedGrants = grants.filter((grant) => grant.purchased);
|
|
175
|
+
const purchased = _nullishCoalesce(
|
|
176
|
+
purchasedGrants.find((grant) => grant.remaining > 0),
|
|
177
|
+
() => purchasedGrants[0],
|
|
178
|
+
);
|
|
179
|
+
const amounts = (grant) => `${money(grant.remaining)} of ${money(grant.granted)} left`;
|
|
180
|
+
const [primary, secondary] = [subscription, purchased].map((grant) =>
|
|
181
|
+
grant
|
|
182
|
+
? {
|
|
183
|
+
usedPercent: ctx.pct(grant.granted - grant.remaining, grant.granted),
|
|
184
|
+
resetDescription: grant.expiresAt ? `${amounts(grant)} · ${expiry(grant.expiresAt)}` : amounts(grant),
|
|
185
|
+
}
|
|
186
|
+
: undefined,
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
const details = [];
|
|
190
|
+
const otherGrants = grants.filter((grant) => grant !== subscription && grant !== purchased);
|
|
191
|
+
if (otherGrants.length > 0) {
|
|
192
|
+
details.push({
|
|
193
|
+
title: "Other credit grants",
|
|
194
|
+
rows: otherGrants.map((grant) => ({
|
|
195
|
+
label: grant.label,
|
|
196
|
+
value: amounts(grant),
|
|
197
|
+
secondaryValue: grant.expiresAt ? expiry(grant.expiresAt) : null,
|
|
198
|
+
progress: (grant.granted - Math.min(grant.remaining, grant.granted)) / grant.granted,
|
|
199
|
+
})),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Spend is optional: a broken report must not discard an authenticated balance.
|
|
204
|
+
let spendRow;
|
|
205
|
+
try {
|
|
206
|
+
const spend = object(
|
|
207
|
+
await request(`/api/organizations/${selected.id}/current_spend`, billingDenied),
|
|
208
|
+
"spend",
|
|
209
|
+
);
|
|
210
|
+
const amount = minorUnits(spend.amount, "spend");
|
|
211
|
+
if (amount < 0) return invalid("spend");
|
|
212
|
+
spendRow = { label: "This month (UTC)", value: money(amount) };
|
|
213
|
+
} catch (error) {
|
|
214
|
+
if (error.transportClass === "cancelled") throw error;
|
|
215
|
+
spendRow = { label: "Spend", value: "Unavailable" };
|
|
216
|
+
}
|
|
217
|
+
details.push({ title: "Billing", rows: [spendRow] });
|
|
218
|
+
|
|
219
|
+
return {
|
|
220
|
+
primary,
|
|
221
|
+
secondary,
|
|
222
|
+
cost: { used: balance, currency, period: "Prepaid credits", balance },
|
|
223
|
+
details,
|
|
224
|
+
identity: { organization: selected.name, loginMethod: "Console session" },
|
|
225
|
+
dataConfidence: "exact",
|
|
226
|
+
};
|
|
227
|
+
} catch (error) {
|
|
228
|
+
if (error !== sessionRejected) throw error;
|
|
229
|
+
ctx.browser.rejectCookie(domain, session);
|
|
230
|
+
rejected = true;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (rejected)
|
|
234
|
+
throw ctx.fail.authenticationExpired(
|
|
235
|
+
"Claude Console session expired. Sign in at platform.claude.com or paste a fresh Cookie header.",
|
|
236
|
+
);
|
|
237
|
+
throw ctx.fail.missingCredential(
|
|
238
|
+
`Sign in at platform.claude.com. Supported browsers: ${ctx.browser.supportedBrowsers}. Or paste its Cookie header.`,
|
|
239
|
+
);
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// END UPSTREAM
|
|
244
|
+
})(globalThis.defineProvider);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "claudeplatform",
|
|
4
|
+
"name": "Claude Platform",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": [
|
|
9
|
+
"web"
|
|
10
|
+
],
|
|
11
|
+
"autoMode": "web",
|
|
12
|
+
"usageDashboardUrl": "https://platform.claude.com/settings/billing",
|
|
13
|
+
"webUrl": "https://platform.claude.com",
|
|
14
|
+
"envVars": [
|
|
15
|
+
"CLAUDEPLATFORM_COOKIE"
|
|
16
|
+
],
|
|
17
|
+
"setupFields": [],
|
|
18
|
+
"upstream": {
|
|
19
|
+
"repository": "https://github.com/steipete/CodexBar",
|
|
20
|
+
"revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
|
|
21
|
+
"path": "Sources/CodexBarCore/Resources/Plugins/claudeplatform.js",
|
|
22
|
+
"sha256": "d3c61855621fd4e5b5b753bdd223524e0ee7f4b55cfd63f24f23516ac33027e8",
|
|
23
|
+
"license": "MIT"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -14,7 +14,23 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function apiKey(ctx) {
|
|
17
|
-
|
|
17
|
+
const provider = ctx.provider || {};
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(provider, "apiKey")) return clean(provider.apiKey);
|
|
19
|
+
const scoped = provider.instanceId && provider.instanceId !== 'clinepass';
|
|
20
|
+
if (scoped) return null;
|
|
21
|
+
const explicit = env(ctx, "CLINEPASS_API_KEY") || env(ctx, "CLINE_API_KEY");
|
|
22
|
+
if (explicit) return explicit;
|
|
23
|
+
const settings = provider.settings || {};
|
|
24
|
+
const dir = env(ctx, 'CLINE_DATA_DIR') || (env(ctx, 'CLINE_DIR') || ctx.host.fs.homeDir + '/.cline') + '/data';
|
|
25
|
+
const file = clean(settings.authPath) || env(ctx, 'CLINE_PROVIDER_SETTINGS_PATH') || dir + '/settings/providers.json';
|
|
26
|
+
let saved;
|
|
27
|
+
try { saved = JSON.parse(ctx.host.fs.readText(file))?.providers?.cline?.settings; } catch (_) { return null; }
|
|
28
|
+
const access = clean(saved?.auth?.accessToken);
|
|
29
|
+
if (access) {
|
|
30
|
+
ctx.clineAuthSource = 'oauth';
|
|
31
|
+
return access.startsWith('workos:') ? access : 'workos:' + access;
|
|
32
|
+
}
|
|
33
|
+
return clean(saved?.apiKey) || clean(saved?.auth?.apiKey);
|
|
18
34
|
}
|
|
19
35
|
|
|
20
36
|
function windowFor(ctx, entry) {
|
|
@@ -39,7 +55,7 @@
|
|
|
39
55
|
|
|
40
56
|
function probe(ctx) {
|
|
41
57
|
var key = apiKey(ctx);
|
|
42
|
-
if (!key) throw "ClinePass API key
|
|
58
|
+
if (!key) throw "ClinePass credentials missing. Set an API key or run cline auth to sign in.";
|
|
43
59
|
|
|
44
60
|
var result = ctx.util.requestJson({
|
|
45
61
|
method: "GET",
|
|
@@ -64,7 +80,7 @@
|
|
|
64
80
|
}
|
|
65
81
|
}
|
|
66
82
|
if (!metrics.length) throw "ClinePass response missing five_hour window.";
|
|
67
|
-
return { displayName: "ClinePass", source: "api", plan: "API key", lines: metrics };
|
|
83
|
+
return { displayName: "ClinePass", source: ctx.clineAuthSource || "api", plan: ctx.clineAuthSource ? "Browser" : "API key", lines: metrics };
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
globalThis.__openusage_plugin = { id: "clinepass", probe: probe };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 128.00 128.00">
|
|
4
|
+
<g stroke-width="2.00" fill="none" stroke-linecap="butt">
|
|
5
|
+
<path stroke="currentColor" vector-effect="non-scaling-stroke" d="
|
|
6
|
+
M 27.46 27.54
|
|
7
|
+
C 23.31 31.70 16.50 34.46 10.57 34.99
|
|
8
|
+
Q 10.24 35.02 10.04 35.39
|
|
9
|
+
Q 9.90 35.65 9.90 36.04
|
|
10
|
+
Q 9.90 36.43 10.04 36.69
|
|
11
|
+
Q 10.24 37.06 10.57 37.09
|
|
12
|
+
C 16.50 37.62 23.31 40.38 27.46 44.54
|
|
13
|
+
C 31.62 48.69 34.38 55.50 34.91 61.43
|
|
14
|
+
Q 34.94 61.76 35.31 61.97
|
|
15
|
+
Q 35.57 62.11 35.96 62.11
|
|
16
|
+
Q 36.36 62.11 36.62 61.97
|
|
17
|
+
Q 36.98 61.76 37.02 61.43
|
|
18
|
+
C 37.54 55.50 40.31 48.69 44.46 44.54
|
|
19
|
+
C 48.62 40.38 55.43 37.62 61.36 37.09
|
|
20
|
+
Q 61.69 37.06 61.89 36.69
|
|
21
|
+
Q 62.03 36.43 62.03 36.04
|
|
22
|
+
Q 62.03 35.65 61.89 35.39
|
|
23
|
+
Q 61.69 35.02 61.36 34.99
|
|
24
|
+
C 55.43 34.46 48.62 31.70 44.46 27.54
|
|
25
|
+
C 40.31 23.38 37.54 16.58 37.02 10.65
|
|
26
|
+
Q 36.98 10.32 36.62 10.11
|
|
27
|
+
Q 36.36 9.97 35.96 9.97
|
|
28
|
+
Q 35.57 9.97 35.31 10.11
|
|
29
|
+
Q 34.94 10.32 34.91 10.65
|
|
30
|
+
C 34.38 16.58 31.62 23.38 27.46 27.54"
|
|
31
|
+
/>
|
|
32
|
+
<path stroke="currentColor" vector-effect="non-scaling-stroke" d="
|
|
33
|
+
M 103.9557 64.7548
|
|
34
|
+
A 0.70 0.70 0.0 0 0 103.2569 64.0536
|
|
35
|
+
L 64.7970 63.9864
|
|
36
|
+
A 0.70 0.70 0.0 0 0 64.0958 64.6852
|
|
37
|
+
L 64.0843 75.2652
|
|
38
|
+
A 0.70 0.70 0.0 0 0 64.7831 75.9664
|
|
39
|
+
L 103.2430 76.0336
|
|
40
|
+
A 0.70 0.70 0.0 0 0 103.9442 75.3348
|
|
41
|
+
L 103.9557 64.7548"
|
|
42
|
+
/>
|
|
43
|
+
</g>
|
|
44
|
+
<path fill="currentColor" d="
|
|
45
|
+
M 113.99 0.00
|
|
46
|
+
Q 125.60 2.32 128.00 13.94
|
|
47
|
+
L 128.00 113.98
|
|
48
|
+
Q 125.72 125.58 114.06 128.00
|
|
49
|
+
L 14.00 128.00
|
|
50
|
+
Q 2.44 125.69 0.00 114.05
|
|
51
|
+
L 0.00 14.01
|
|
52
|
+
Q 2.33 2.42 13.95 0.00
|
|
53
|
+
L 113.99 0.00
|
|
54
|
+
Z
|
|
55
|
+
M 27.46 27.54
|
|
56
|
+
C 23.31 31.70 16.50 34.46 10.57 34.99
|
|
57
|
+
Q 10.24 35.02 10.04 35.39
|
|
58
|
+
Q 9.90 35.65 9.90 36.04
|
|
59
|
+
Q 9.90 36.43 10.04 36.69
|
|
60
|
+
Q 10.24 37.06 10.57 37.09
|
|
61
|
+
C 16.50 37.62 23.31 40.38 27.46 44.54
|
|
62
|
+
C 31.62 48.69 34.38 55.50 34.91 61.43
|
|
63
|
+
Q 34.94 61.76 35.31 61.97
|
|
64
|
+
Q 35.57 62.11 35.96 62.11
|
|
65
|
+
Q 36.36 62.11 36.62 61.97
|
|
66
|
+
Q 36.98 61.76 37.02 61.43
|
|
67
|
+
C 37.54 55.50 40.31 48.69 44.46 44.54
|
|
68
|
+
C 48.62 40.38 55.43 37.62 61.36 37.09
|
|
69
|
+
Q 61.69 37.06 61.89 36.69
|
|
70
|
+
Q 62.03 36.43 62.03 36.04
|
|
71
|
+
Q 62.03 35.65 61.89 35.39
|
|
72
|
+
Q 61.69 35.02 61.36 34.99
|
|
73
|
+
C 55.43 34.46 48.62 31.70 44.46 27.54
|
|
74
|
+
C 40.31 23.38 37.54 16.58 37.02 10.65
|
|
75
|
+
Q 36.98 10.32 36.62 10.11
|
|
76
|
+
Q 36.36 9.97 35.96 9.97
|
|
77
|
+
Q 35.57 9.97 35.31 10.11
|
|
78
|
+
Q 34.94 10.32 34.91 10.65
|
|
79
|
+
C 34.38 16.58 31.62 23.38 27.46 27.54
|
|
80
|
+
Z
|
|
81
|
+
M 103.9557 64.7548
|
|
82
|
+
A 0.70 0.70 0.0 0 0 103.2569 64.0536
|
|
83
|
+
L 64.7970 63.9864
|
|
84
|
+
A 0.70 0.70 0.0 0 0 64.0958 64.6852
|
|
85
|
+
L 64.0843 75.2652
|
|
86
|
+
A 0.70 0.70 0.0 0 0 64.7831 75.9664
|
|
87
|
+
L 103.2430 76.0336
|
|
88
|
+
A 0.70 0.70 0.0 0 0 103.9442 75.3348
|
|
89
|
+
L 103.9557 64.7548
|
|
90
|
+
Z"
|
|
91
|
+
/>
|
|
92
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
function probe(ctx) {
|
|
3
|
+
const response = ctx.host.command.run({program: 'coderabbit', args: ['usage'], timeoutMs: 15000});
|
|
4
|
+
const text = (response.stdout + '\n' + response.stderr).replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, '');
|
|
5
|
+
if (/not authenticated|please log in|auth login|authentication required|unauthorized|no session found/i.test(text))
|
|
6
|
+
throw {code: 'missing-auth', message: 'Run coderabbit auth login to sign in.'};
|
|
7
|
+
if (response.status !== 0) throw 'CodeRabbit usage command failed (exit ' + response.status + ').';
|
|
8
|
+
const fields = Object.create(null);
|
|
9
|
+
for (const line of text.split(/\r?\n/)) {
|
|
10
|
+
const colon = line.indexOf(':');
|
|
11
|
+
if (colon < 0) continue;
|
|
12
|
+
const label = line.slice(0, colon).trim().toLowerCase(), value = line.slice(colon + 1).trim();
|
|
13
|
+
if (value && !fields[label]) fields[label] = value;
|
|
14
|
+
}
|
|
15
|
+
const lines = [];
|
|
16
|
+
if (/^\d+$/.test(fields['your reviews'] || '') && Number.isSafeInteger(Number(fields['your reviews'])))
|
|
17
|
+
lines.push(ctx.line.text({label: 'Reviews', value: fields['your reviews']}));
|
|
18
|
+
for (const [key, label] of [['usage billing', 'Usage billing'], ['period resets', 'Period resets']])
|
|
19
|
+
if (fields[key]) lines.push(ctx.line.text({label, value: fields[key]}));
|
|
20
|
+
if (!lines.length) throw 'CodeRabbit did not report review counts or billing information.';
|
|
21
|
+
if (fields.organization) lines.push(ctx.line.text({label: 'Organization', value: fields.organization}));
|
|
22
|
+
return {displayName: 'CodeRabbit', source: 'cli', plan: fields.plan, lines};
|
|
23
|
+
}
|
|
24
|
+
globalThis.__usagestat_plugin = {id: 'coderabbit', probe};
|
|
25
|
+
})();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "coderabbit",
|
|
4
|
+
"name": "CodeRabbit",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"entry": "plugin.js",
|
|
7
|
+
"enabledByDefault": false,
|
|
8
|
+
"supportedModes": ["cli"],
|
|
9
|
+
"autoMode": "cli",
|
|
10
|
+
"usageDashboardUrl": "https://app.coderabbit.ai",
|
|
11
|
+
"envVars": ["CODERABBIT_CLI_PATH"]
|
|
12
|
+
}
|
package/plugins/codex/plugin.js
CHANGED
|
@@ -375,11 +375,18 @@
|
|
|
375
375
|
function formatCodexPlan(ctx, planType) {
|
|
376
376
|
const rawPlan = typeof planType === "string" ? planType.trim() : ""
|
|
377
377
|
if (!rawPlan) return null
|
|
378
|
-
if (rawPlan.toLowerCase() === "prolite") return "Pro
|
|
379
|
-
if (rawPlan.toLowerCase() === "pro") return "Pro
|
|
378
|
+
if (rawPlan.toLowerCase() === "prolite") return "Pro 100"
|
|
379
|
+
if (rawPlan.toLowerCase() === "pro") return "Pro 200"
|
|
380
|
+
if (rawPlan.toLowerCase() === "promax") return "Pro 500"
|
|
381
|
+
if (rawPlan.toLowerCase() === "self_serve_business_prolite") return "Business Premium"
|
|
380
382
|
return ctx.fmt.planLabel(rawPlan) || null
|
|
381
383
|
}
|
|
382
384
|
|
|
385
|
+
function reportedPeriod(window, fallback) {
|
|
386
|
+
const seconds = window && window.limit_window_seconds
|
|
387
|
+
return typeof seconds === "number" && Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : fallback
|
|
388
|
+
}
|
|
389
|
+
|
|
383
390
|
function getResetsAtIso(ctx, nowSec, window) {
|
|
384
391
|
if (!window) return null
|
|
385
392
|
if (typeof window.reset_at === "number") {
|
|
@@ -778,12 +785,12 @@
|
|
|
778
785
|
|
|
779
786
|
if (headerPrimary !== null) {
|
|
780
787
|
lines.push(ctx.line.progress({
|
|
781
|
-
label: "Session",
|
|
788
|
+
label: reportedPeriod(primaryWindow, PERIOD_SESSION_MS) === 30*86400000 ? "Monthly" : "Session",
|
|
782
789
|
used: headerPrimary,
|
|
783
790
|
limit: 100,
|
|
784
791
|
format: { kind: "percent" },
|
|
785
792
|
resetsAt: getResetsAtIso(ctx, nowSec, primaryWindow),
|
|
786
|
-
periodDurationMs: PERIOD_SESSION_MS
|
|
793
|
+
periodDurationMs: reportedPeriod(primaryWindow, PERIOD_SESSION_MS)
|
|
787
794
|
}))
|
|
788
795
|
}
|
|
789
796
|
if (headerSecondary !== null) {
|
|
@@ -793,19 +800,19 @@
|
|
|
793
800
|
limit: 100,
|
|
794
801
|
format: { kind: "percent" },
|
|
795
802
|
resetsAt: getResetsAtIso(ctx, nowSec, secondaryWindow),
|
|
796
|
-
periodDurationMs: PERIOD_WEEKLY_MS
|
|
803
|
+
periodDurationMs: reportedPeriod(secondaryWindow, PERIOD_WEEKLY_MS)
|
|
797
804
|
}))
|
|
798
805
|
}
|
|
799
806
|
|
|
800
807
|
if (lines.length === 0 && data.rate_limit) {
|
|
801
808
|
if (data.rate_limit.primary_window && typeof data.rate_limit.primary_window.used_percent === "number") {
|
|
802
809
|
lines.push(ctx.line.progress({
|
|
803
|
-
label: "Session",
|
|
810
|
+
label: reportedPeriod(primaryWindow, PERIOD_SESSION_MS) === 30*86400000 ? "Monthly" : "Session",
|
|
804
811
|
used: data.rate_limit.primary_window.used_percent,
|
|
805
812
|
limit: 100,
|
|
806
813
|
format: { kind: "percent" },
|
|
807
814
|
resetsAt: getResetsAtIso(ctx, nowSec, primaryWindow),
|
|
808
|
-
periodDurationMs: PERIOD_SESSION_MS
|
|
815
|
+
periodDurationMs: reportedPeriod(primaryWindow, PERIOD_SESSION_MS)
|
|
809
816
|
}))
|
|
810
817
|
}
|
|
811
818
|
if (data.rate_limit.secondary_window && typeof data.rate_limit.secondary_window.used_percent === "number") {
|
|
@@ -815,7 +822,7 @@
|
|
|
815
822
|
limit: 100,
|
|
816
823
|
format: { kind: "percent" },
|
|
817
824
|
resetsAt: getResetsAtIso(ctx, nowSec, secondaryWindow),
|
|
818
|
-
periodDurationMs: PERIOD_WEEKLY_MS
|
|
825
|
+
periodDurationMs: reportedPeriod(secondaryWindow, PERIOD_WEEKLY_MS)
|
|
819
826
|
}))
|
|
820
827
|
}
|
|
821
828
|
}
|
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"label": "Usage dashboard",
|
|
16
|
-
"url": "https://chatgpt.com/
|
|
16
|
+
"url": "https://chatgpt.com/settings/usage?tab=overview"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
19
|
-
"supportedModes": [
|
|
19
|
+
"supportedModes": [
|
|
20
|
+
"oauth",
|
|
21
|
+
"local",
|
|
22
|
+
"web"
|
|
23
|
+
],
|
|
20
24
|
"autoMode": "oauth",
|
|
21
25
|
"webUrl": "https://chatgpt.com",
|
|
22
26
|
"lines": [
|
|
@@ -77,6 +81,11 @@
|
|
|
77
81
|
"type": "barChart",
|
|
78
82
|
"label": "Usage Trend",
|
|
79
83
|
"scope": "detail"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "progress",
|
|
87
|
+
"label": "Monthly",
|
|
88
|
+
"scope": "overview"
|
|
80
89
|
}
|
|
81
90
|
]
|
|
82
91
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M38 38H27C20.925 38 16 33.075 16 27C16 20.925 20.925 16 27 16C33.075 16 38 20.925 38 27V73C38 79.075 33.075 84 27 84C20.925 84 16 79.075 16 73C16 66.925 20.925 62 27 62H73C79.075 62 84 66.925 84 73C84 79.075 79.075 84 73 84C66.925 84 62 79.075 62 73V27C62 20.925 66.925 16 73 16C79.075 16 84 20.925 84 27C84 33.075 79.075 38 73 38H38V62" stroke="currentColor" stroke-width="9" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -146,9 +146,11 @@
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
var lines = [];
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
var grants = { 'individual-go':10, 'individual-goat':70, 'individual-pro':30, 'individual-pro-v1':80, 'individual-max':150, 'individual-ultra':300 };
|
|
150
|
+
var totalPlan = readNumber(creditsResp && creditsResp.credits && creditsResp.credits.monthlyCreditsGranted);
|
|
151
|
+
if (!(totalPlan > 0)) totalPlan = subResp && subResp.success && subResp.data ? grants[subResp.data.planId] : null;
|
|
152
|
+
if (creditsRemaining !== null && totalPlan > 0) {
|
|
153
|
+
var usedPercent = Math.max(0, totalPlan - creditsRemaining) / totalPlan * 100;
|
|
152
154
|
lines.push(ctx.line.progress({
|
|
153
155
|
label: "Monthly credits",
|
|
154
156
|
used: Math.max(0, Math.min(100, Math.round(usedPercent * 10) / 10)),
|
|
@@ -156,6 +158,8 @@
|
|
|
156
158
|
format: { kind: "percent" },
|
|
157
159
|
periodDurationMs: 30 * 24 * 60 * 60 * 1000,
|
|
158
160
|
}));
|
|
161
|
+
} else if (creditsRemaining !== null) {
|
|
162
|
+
lines.push(ctx.line.text({label:'Monthly credits',value:'$'+Math.max(0,creditsRemaining).toFixed(2)+' remaining'}));
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
if (totalCost !== null && totalCost > 0) {
|
package/plugins/copilot/icon.svg
CHANGED
|
@@ -1 +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>
|
|
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>Copilot</title><path d="M9 23l.073-.001a2.53 2.53 0 01-2.347-1.838l-.697-2.433a2.529 2.529 0 00-2.426-1.839h-.497l-.104-.002c-4.485 0-2.935-5.278-1.75-9.225l.162-.525C2.412 3.99 3.883 1 6.25 1h8.86c1.12 0 2.106.745 2.422 1.829l.715 2.453a2.53 2.53 0 002.247 1.823l.147.005.534.001c3.557.115 3.088 3.745 2.156 7.206l-.113.413c-.154.548-.315 1.089-.47 1.607l-.163.525C21.588 20.01 20.116 23 17.75 23h-8.75zm8.22-15.89l-3.856.001a2.526 2.526 0 00-2.35 1.615L9.21 15.04a2.529 2.529 0 01-2.43 1.847l3.853.002c1.056 0 1.992-.661 2.361-1.644l1.796-6.287a2.529 2.529 0 012.43-1.848z"></path></svg>
|