@howaboua/opencode-usage-plugin 0.0.8 → 0.0.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAWjD,eAAO,MAAM,WAAW,EAAE,MAsDzB,CAAA;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAWjD,eAAO,MAAM,WAAW,EAAE,MAoDzB,CAAA;AAED,eAAe,WAAW,CAAA"}
package/dist/index.js CHANGED
@@ -22,13 +22,11 @@ export const UsagePlugin = async ({ client }) => {
22
22
  state.availableProviders.proxy =
23
23
  usageConfig?.providers?.proxy !== undefined ? usageConfig.providers.proxy : Boolean(usageConfig?.endpoint);
24
24
  const authRecord = auths;
25
- state.availableProviders.copilot =
26
- usageConfig?.providers?.copilot !== undefined
27
- ? usageConfig.providers.copilot
28
- : Boolean(authRecord["github-copilot"] ||
29
- authRecord["copilot"] ||
30
- existsSync(getQuotaConfigPath()) ||
31
- existsSync(getUsageTokenPath()));
25
+ const hasCopilotAuth = Boolean(authRecord["github-copilot"] ||
26
+ authRecord["copilot"] ||
27
+ existsSync(getQuotaConfigPath()) ||
28
+ existsSync(getUsageTokenPath()));
29
+ state.availableProviders.copilot = usageConfig?.providers?.copilot === false ? false : hasCopilotAuth;
32
30
  }
33
31
  catch (err) { }
34
32
  async function sendStatusMessage(sessionID, text) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howaboua/opencode-usage-plugin",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "opencode plugin for tracking AI provider usage, rate limits, and quotas",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",