omp-config-crypt 0.9.8 → 0.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-config-crypt",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "description": "Universal cross-platform encrypted portability for omp config, extensions, and instructions",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -151,32 +151,7 @@ export default async function (pi) {
151
151
  }
152
152
 
153
153
  // 异步在后台静默刷新 OpenRouter 权威模型规格并落盘缓存
154
- (async () => {
155
- try {
156
- const controller = new AbortController();
157
- const timer = setTimeout(() => controller.abort(), 6000);
158
- const res = await fetch("https://openrouter.ai/api/v1/models", { signal: controller.signal });
159
- clearTimeout(timer);
160
- if (!res.ok) return;
161
- const json = await res.json();
162
- const updatedSpecs = {};
163
- for (const m of json.data || []) {
164
- if (!m.id) continue;
165
- const shortName = m.id.split("/").pop().toLowerCase();
166
- const spec = {
167
- contextWindow: m.context_length || DEFAULT_CONTEXT_WINDOW,
168
- maxTokens: m.top_provider?.max_completion_tokens || DEFAULT_MAX_TOKENS,
169
- hasImage: m.architecture?.modality?.includes("image") || false
170
- };
171
- updatedSpecs[shortName] = spec;
172
- updatedSpecs[m.id.toLowerCase()] = spec;
173
- }
174
- if (!fs.existsSync(cacheDir)) {
175
- fs.mkdirSync(cacheDir, { recursive: true });
176
- }
177
- fs.writeFileSync(cachePath, JSON.stringify(updatedSpecs, null, 2), "utf8");
178
- } catch {}
179
- })();
154
+ // 已移除:OpenRouter 规格改为添加 provider 时一次性查询并写死,启动不再联网刷新。
180
155
 
181
156
  // 注册 /models-optimize 治理命令
182
157
  pi.registerCommand("models-optimize", {