@xingjisoft/neutrino 0.5.0 → 0.5.1

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.
@@ -170,16 +170,20 @@ export function loadProModels() {
170
170
  throw new Error(`Pro model.json is missing; it is downloaded from ${PRO_MODELS_URL} on first use`);
171
171
  }
172
172
  const { tier } = readProModels(PRO_MODEL_FILE, "model.json");
173
- // Presets the user keeps in model-custom.json are merged in: a same-named entry
174
- // replaces the one from model.json in place, new ones are appended.
173
+ // Presets the user keeps in model-custom.json are merged in. Their place in the
174
+ // list is read as strength (the slider runs from weak to strong), so entries that
175
+ // are not official rungs lead it: a preset named after an official one edits that
176
+ // rung in place, every other one sits left of the graded presets.
175
177
  if (fs.existsSync(PRO_CUSTOM_MODEL_FILE)) {
178
+ const own = [];
176
179
  for (const preset of readProModels(PRO_CUSTOM_MODEL_FILE, "model-custom.json").tier) {
177
180
  const index = tier.findIndex((entry) => entry.name === preset.name);
178
181
  if (index === -1)
179
- tier.push(preset);
182
+ own.push(preset);
180
183
  else
181
184
  tier[index] = preset;
182
185
  }
186
+ tier.unshift(...own);
183
187
  }
184
188
  if (tier.length === 0)
185
189
  throw new Error("Pro model.json must contain a nonempty tier array");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingjisoft/neutrino",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "XINGJI Neutrino - a CLI coding agent in the terminal.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",