@tscgoods/antigravity-effort-discovery 0.3.1 → 0.4.3

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": "@tscgoods/antigravity-effort-discovery",
3
- "version": "0.3.1",
3
+ "version": "0.4.3",
4
4
  "description": "Antigravity CLI plugin: probe which reasoning-effort levels your gateway accepts, inject the result into sessions, and optionally generate customModels entries.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/scripts/probe.mjs CHANGED
@@ -87,13 +87,18 @@ for (const model of models) {
87
87
  headers: entry.headers ?? {},
88
88
  })
89
89
  const agy = args.agy ? agyAvailable(model) : undefined
90
+
91
+ // 网关不校验时,agy 自己的模型元数据是唯一可信来源
92
+ const gatewayLevels = Array.isArray(probed.levels) && probed.levels.length > 0 ? probed.levels : null
93
+ const authority = gatewayLevels ? "gateway" : Array.isArray(agy) && agy.length > 0 ? "agy" : null
94
+ const base = gatewayLevels ?? (Array.isArray(agy) && agy.length > 0 ? agy : null)
95
+
90
96
  result.models[model] = {
91
97
  ...probed,
92
98
  agyAvailable: agy ?? null,
93
- /// 只保留 agy 自己的枚举里存在的档位
94
- effective: Array.isArray(probed.levels)
95
- ? probed.levels.filter((level) => AGY_LEVELS.includes(level))
96
- : null,
99
+ authority,
100
+ /// 实际可用档位:网关证据优先,否则用 agy 自身元数据兜底
101
+ effective: base ? base.filter((level) => AGY_LEVELS.includes(level)) : null,
97
102
  }
98
103
  await new Promise((resolve) => setTimeout(resolve, 200))
99
104
  }