@oevortex/opencode-qwen-auth 0.1.1 → 0.1.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/dist/index.cjs CHANGED
@@ -1060,10 +1060,10 @@ async function QwenOAuthPlugin({
1060
1060
  return {};
1061
1061
  }
1062
1062
  log6.debug("Loading Qwen provider configuration");
1063
- if (provider.models) {
1063
+ if (provider && provider.models) {
1064
1064
  for (const model of Object.values(provider.models)) {
1065
- if (model) {
1066
- model.cost = { input: 0, output: 0 };
1065
+ if (model && typeof model === "object" && "cost" in model) {
1066
+ model.cost = { input: 0, output: 0, cache: { read: 0, write: 0 } };
1067
1067
  }
1068
1068
  }
1069
1069
  }
package/dist/index.d.cts CHANGED
@@ -114,12 +114,7 @@ interface LoaderResult {
114
114
  fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
115
115
  }
116
116
  interface Provider {
117
- models?: Record<string, {
118
- cost?: {
119
- input: number;
120
- output: number;
121
- };
122
- } | undefined>;
117
+ models?: Record<string, any>;
123
118
  }
124
119
  type GetAuth = () => Promise<AuthDetails>;
125
120
  interface PluginContext {
package/dist/index.d.ts CHANGED
@@ -114,12 +114,7 @@ interface LoaderResult {
114
114
  fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
115
115
  }
116
116
  interface Provider {
117
- models?: Record<string, {
118
- cost?: {
119
- input: number;
120
- output: number;
121
- };
122
- } | undefined>;
117
+ models?: Record<string, any>;
123
118
  }
124
119
  type GetAuth = () => Promise<AuthDetails>;
125
120
  interface PluginContext {
package/dist/index.js CHANGED
@@ -994,10 +994,10 @@ async function QwenOAuthPlugin({
994
994
  return {};
995
995
  }
996
996
  log6.debug("Loading Qwen provider configuration");
997
- if (provider.models) {
997
+ if (provider && provider.models) {
998
998
  for (const model of Object.values(provider.models)) {
999
- if (model) {
1000
- model.cost = { input: 0, output: 0 };
999
+ if (model && typeof model === "object" && "cost" in model) {
1000
+ model.cost = { input: 0, output: 0, cache: { read: 0, write: 0 } };
1001
1001
  }
1002
1002
  }
1003
1003
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./dist/index.cjs",
4
4
  "module": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
- "version": "0.1.1",
6
+ "version": "0.1.2",
7
7
  "scripts": {
8
8
  "build": "tsup index.ts --format cjs,esm --dts --clean",
9
9
  "dev": "tsup index.ts --format cjs,esm --watch --dts",