newmark-agent 0.6.0 → 0.6.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.
@@ -137297,9 +137297,12 @@ ${summary}`, segment, "local-summarize", true);
137297
137297
  const active = this.activeModelConfig();
137298
137298
  if (active) return active;
137299
137299
  }
137300
- const byName = this.config.findModel(modelName);
137300
+ const parsed = parseDeploymentSelectionValue2(modelName);
137301
+ const byName = parsed ? this.config.findDeployment(parsed) : this.config.findModel(modelName);
137301
137302
  if (byName) return byName;
137302
- return this.config.findModel(this.config.getStr("models", "default_model"));
137303
+ const configured = this.config.getStr("models", "default_model");
137304
+ const configuredRef = parseDeploymentSelectionValue2(configured);
137305
+ return configuredRef ? this.config.findDeployment(configuredRef) : this.config.findModel(configured);
137303
137306
  }
137304
137307
  contextMaxTokens(modelName = this.model) {
137305
137308
  const model = this.resolveWindowModel(modelName);
@@ -138021,7 +138024,9 @@ ${msg.content}
138021
138024
  if (provider) return provider.id;
138022
138025
  const active = this.activeModelConfig();
138023
138026
  if (active?.provider_id) return active.provider_id;
138024
- const fallback = this.config.findModel(this.config.getStr("models", "default_model"));
138027
+ const defaultSelection = this.config.getStr("models", "default_model");
138028
+ const defaultRef = parseDeploymentSelectionValue2(defaultSelection);
138029
+ const fallback = defaultRef ? this.config.findDeployment(defaultRef) : this.config.findModel(defaultSelection);
138025
138030
  return fallback?.provider_id || this.config.providers()[0]?.id || "";
138026
138031
  }
138027
138032
  autoSwitchSubset() {
@@ -138313,7 +138318,8 @@ ${msg.content}
138313
138318
  }
138314
138319
  scopedSwitchModels(currentModelName) {
138315
138320
  const all = this.config.allModels();
138316
- const current = currentModelName === "auto" ? this.activeModelConfig() : this.config.findModel(currentModelName);
138321
+ const currentRef = parseDeploymentSelectionValue2(currentModelName);
138322
+ const current = currentModelName === "auto" ? this.activeModelConfig() : currentRef ? this.config.findDeployment(currentRef) : this.config.findModel(currentModelName);
138317
138323
  const providerId = current?.provider_id || this.fixedDeployment?.providerId || (currentModelName !== "auto" ? this.activeDeployment()?.providerId : void 0);
138318
138324
  if (!providerId) return [];
138319
138325
  return all.filter((m) => m.provider_id === providerId);
@@ -6185,10 +6185,13 @@ class Agent {
6185
6185
  if (active)
6186
6186
  return active;
6187
6187
  }
6188
- const byName = this.config.findModel(modelName);
6188
+ const parsed = parseDeploymentSelectionValue(modelName);
6189
+ const byName = parsed ? this.config.findDeployment(parsed) : this.config.findModel(modelName);
6189
6190
  if (byName)
6190
6191
  return byName;
6191
- return this.config.findModel(this.config.getStr('models', 'default_model'));
6192
+ const configured = this.config.getStr('models', 'default_model');
6193
+ const configuredRef = parseDeploymentSelectionValue(configured);
6194
+ return configuredRef ? this.config.findDeployment(configuredRef) : this.config.findModel(configured);
6192
6195
  }
6193
6196
  contextMaxTokens(modelName = this.model) {
6194
6197
  const model = this.resolveWindowModel(modelName);
@@ -6980,7 +6983,9 @@ class Agent {
6980
6983
  const active = this.activeModelConfig();
6981
6984
  if (active?.provider_id)
6982
6985
  return active.provider_id;
6983
- const fallback = this.config.findModel(this.config.getStr('models', 'default_model'));
6986
+ const defaultSelection = this.config.getStr('models', 'default_model');
6987
+ const defaultRef = parseDeploymentSelectionValue(defaultSelection);
6988
+ const fallback = defaultRef ? this.config.findDeployment(defaultRef) : this.config.findModel(defaultSelection);
6984
6989
  return fallback?.provider_id || this.config.providers()[0]?.id || '';
6985
6990
  }
6986
6991
  autoSwitchSubset() {
@@ -7358,7 +7363,9 @@ class Agent {
7358
7363
  // which is exactly the same-name cross-provider leak this guard exists to
7359
7364
  // prevent. When no provider can be established unambiguously, return an
7360
7365
  // empty pool: failing the switch is safe, crossing providers is not.
7361
- const current = currentModelName === 'auto' ? this.activeModelConfig() : this.config.findModel(currentModelName);
7366
+ const currentRef = parseDeploymentSelectionValue(currentModelName);
7367
+ const current = currentModelName === 'auto' ? this.activeModelConfig()
7368
+ : (currentRef ? this.config.findDeployment(currentRef) : this.config.findModel(currentModelName));
7362
7369
  const providerId = current?.provider_id
7363
7370
  || this.fixedDeployment?.providerId
7364
7371
  || (currentModelName !== 'auto' ? this.activeDeployment()?.providerId : undefined);
@@ -137301,9 +137301,12 @@ ${summary}`, segment, "local-summarize", true);
137301
137301
  const active = this.activeModelConfig();
137302
137302
  if (active) return active;
137303
137303
  }
137304
- const byName = this.config.findModel(modelName);
137304
+ const parsed = parseDeploymentSelectionValue2(modelName);
137305
+ const byName = parsed ? this.config.findDeployment(parsed) : this.config.findModel(modelName);
137305
137306
  if (byName) return byName;
137306
- return this.config.findModel(this.config.getStr("models", "default_model"));
137307
+ const configured = this.config.getStr("models", "default_model");
137308
+ const configuredRef = parseDeploymentSelectionValue2(configured);
137309
+ return configuredRef ? this.config.findDeployment(configuredRef) : this.config.findModel(configured);
137307
137310
  }
137308
137311
  contextMaxTokens(modelName = this.model) {
137309
137312
  const model = this.resolveWindowModel(modelName);
@@ -138025,7 +138028,9 @@ ${msg.content}
138025
138028
  if (provider) return provider.id;
138026
138029
  const active = this.activeModelConfig();
138027
138030
  if (active?.provider_id) return active.provider_id;
138028
- const fallback = this.config.findModel(this.config.getStr("models", "default_model"));
138031
+ const defaultSelection = this.config.getStr("models", "default_model");
138032
+ const defaultRef = parseDeploymentSelectionValue2(defaultSelection);
138033
+ const fallback = defaultRef ? this.config.findDeployment(defaultRef) : this.config.findModel(defaultSelection);
138029
138034
  return fallback?.provider_id || this.config.providers()[0]?.id || "";
138030
138035
  }
138031
138036
  autoSwitchSubset() {
@@ -138317,7 +138322,8 @@ ${msg.content}
138317
138322
  }
138318
138323
  scopedSwitchModels(currentModelName) {
138319
138324
  const all = this.config.allModels();
138320
- const current = currentModelName === "auto" ? this.activeModelConfig() : this.config.findModel(currentModelName);
138325
+ const currentRef = parseDeploymentSelectionValue2(currentModelName);
138326
+ const current = currentModelName === "auto" ? this.activeModelConfig() : currentRef ? this.config.findDeployment(currentRef) : this.config.findModel(currentModelName);
138321
138327
  const providerId = current?.provider_id || this.fixedDeployment?.providerId || (currentModelName !== "auto" ? this.activeDeployment()?.providerId : void 0);
138322
138328
  if (!providerId) return [];
138323
138329
  return all.filter((m) => m.provider_id === providerId);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "newmark-agent",
3
3
  "productName": "Newmark Agent",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "description": "Newmark Agent — Portable AI coding agent with rich GUI and CLI (TypeScript)",
6
6
  "homepage": "https://github.com/positer/Newmark-Agent",
7
7
  "repository": {