@bonginkan/maria 2.0.5 → 2.0.6

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/cli.js CHANGED
@@ -152,8 +152,8 @@ var init_openai_provider = __esm({
152
152
  }
153
153
  name = "OpenAI";
154
154
  models = [
155
- "gpt-5-2025-08-07",
156
- "gpt-5-mini-2025-08-07",
155
+ "gpt-5",
156
+ "gpt-5-mini",
157
157
  "gpt-4o",
158
158
  "gpt-4o-mini",
159
159
  "gpt-4-turbo",
@@ -281,7 +281,7 @@ var init_anthropic_provider = __esm({
281
281
  }
282
282
  name = "Anthropic";
283
283
  models = [
284
- "claude-opus-4.1",
284
+ "claude-4.1",
285
285
  "claude-3-5-sonnet-20241022",
286
286
  "claude-3-5-haiku-20241022",
287
287
  "claude-3-opus-20240229",
@@ -6132,7 +6132,9 @@ var GrokProvider = class extends BaseAIProvider {
6132
6132
  }
6133
6133
  name = "Grok";
6134
6134
  models = [
6135
- "grok-4-0709",
6135
+ "grok-4",
6136
+ "grok-beta",
6137
+ "grok-2",
6136
6138
  "llama-3.3-70b-versatile",
6137
6139
  "llama-3.1-70b-versatile",
6138
6140
  "llama-3.1-8b-instant",
@@ -6983,6 +6985,30 @@ var AIProviderManager = class {
6983
6985
  }
6984
6986
  }
6985
6987
  }
6988
+ const cloudProviders = ["openai", "anthropic", "google", "grok"];
6989
+ const defaultCloudModels = {
6990
+ openai: ["gpt-5", "gpt-5-mini", "gpt-4o", "gpt-4o-mini", "o1-preview", "o1-mini"],
6991
+ anthropic: ["claude-4.1", "claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022", "claude-3-opus-20240229"],
6992
+ google: ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-1.5-pro", "gemini-1.5-flash"],
6993
+ grok: ["grok-4", "grok-beta", "grok-2"]
6994
+ };
6995
+ for (const providerName of cloudProviders) {
6996
+ if (!this.availableProviders.has(providerName)) {
6997
+ const models = defaultCloudModels[providerName] || [];
6998
+ const modelInfos = models.map((modelName) => ({
6999
+ id: `${providerName}-${modelName}`,
7000
+ name: modelName,
7001
+ provider: providerName,
7002
+ description: `${modelName} from ${providerName}`,
7003
+ contextLength: 8192,
7004
+ capabilities: ["text", "code", "vision"],
7005
+ available: false,
7006
+ // Mark as unavailable (need API key)
7007
+ recommendedFor: ["general"]
7008
+ }));
7009
+ allModels.push(...modelInfos);
7010
+ }
7011
+ }
6986
7012
  return allModels;
6987
7013
  }
6988
7014
  selectOptimalProvider(_taskType, priorityMode = "auto") {
@@ -7631,7 +7657,9 @@ var ConfigManager = class _ConfigManager {
7631
7657
  autoStart: true,
7632
7658
  healthMonitoring: true,
7633
7659
  language: "auto",
7634
- offlineMode: false
7660
+ offlineMode: false,
7661
+ model: "gpt-5-mini",
7662
+ provider: "openai"
7635
7663
  };
7636
7664
  }
7637
7665
  mergeConfig(newConfig) {
@@ -7844,6 +7872,50 @@ Context from memory:
7844
7872
  this.config.set("priority", mode);
7845
7873
  this.router.updatePriorityMode(mode);
7846
7874
  }
7875
+ /**
7876
+ * Switch to a specific model
7877
+ */
7878
+ async switchModel(modelId) {
7879
+ try {
7880
+ const models = await this.getModels();
7881
+ const targetModel = models.find((m) => m.id === modelId || m.name === modelId);
7882
+ if (!targetModel) {
7883
+ return {
7884
+ success: false,
7885
+ message: `Model not found: ${modelId}`
7886
+ };
7887
+ }
7888
+ if (!targetModel.available) {
7889
+ return {
7890
+ success: false,
7891
+ message: `Model ${targetModel.name} is not available. Please check API keys.`
7892
+ };
7893
+ }
7894
+ this.config.set("model", targetModel.name);
7895
+ this.config.set("provider", targetModel.provider);
7896
+ this.router.updatePreferredProvider(targetModel.provider, targetModel.name);
7897
+ return {
7898
+ success: true,
7899
+ message: `Switched to ${targetModel.name} (${targetModel.provider})`
7900
+ };
7901
+ } catch (error) {
7902
+ return {
7903
+ success: false,
7904
+ message: `Failed to switch model: ${error instanceof Error ? error.message : "Unknown error"}`
7905
+ };
7906
+ }
7907
+ }
7908
+ /**
7909
+ * Get current active model
7910
+ */
7911
+ getCurrentModel() {
7912
+ const currentModel = this.config.get("model");
7913
+ const currentProvider = this.config.get("provider");
7914
+ if (currentModel && currentProvider) {
7915
+ return { name: currentModel, provider: currentProvider };
7916
+ }
7917
+ return null;
7918
+ }
7847
7919
  /**
7848
7920
  * Get current configuration
7849
7921
  */
@@ -25651,17 +25723,36 @@ async function showModels(maria) {
25651
25723
  try {
25652
25724
  const models = await maria.getModels();
25653
25725
  const available = models.filter((m) => m.available);
25654
- if (available.length === 0) {
25655
- console.log(chalk13__default.default.yellow("No models available"));
25726
+ const unavailable = models.filter((m) => !m.available);
25727
+ if (available.length === 0 && unavailable.length === 0) {
25728
+ console.log(chalk13__default.default.yellow("No models found"));
25656
25729
  return;
25657
25730
  }
25658
- for (const model of available) {
25659
- const provider = chalk13__default.default.gray(`[${model.provider}]`);
25660
- const capabilities = model.capabilities ? model.capabilities.join(", ") : "No capabilities listed";
25661
- console.log(`\u2705 ${chalk13__default.default.bold(model.name)} ${provider}`);
25662
- console.log(` ${chalk13__default.default.gray(capabilities)}`);
25731
+ if (available.length > 0) {
25732
+ console.log(chalk13__default.default.green("\u2705 Available Models:"));
25733
+ for (const model of available) {
25734
+ const provider = chalk13__default.default.gray(`[${model.provider}]`);
25735
+ const capabilities = model.capabilities ? model.capabilities.join(", ") : "No capabilities listed";
25736
+ console.log(` \u2705 ${chalk13__default.default.bold(model.name)} ${provider}`);
25737
+ console.log(` ${chalk13__default.default.gray(capabilities)}`);
25738
+ }
25739
+ console.log("");
25740
+ }
25741
+ if (unavailable.length > 0) {
25742
+ console.log(chalk13__default.default.yellow("\u26A0\uFE0F Cloud Models (Require API Keys):"));
25743
+ for (const model of unavailable) {
25744
+ const provider = chalk13__default.default.gray(`[${model.provider}]`);
25745
+ const capabilities = model.capabilities ? model.capabilities.join(", ") : "No capabilities listed";
25746
+ console.log(` \u274C ${chalk13__default.default.white(model.name)} ${provider}`);
25747
+ console.log(` ${chalk13__default.default.gray(capabilities)}`);
25748
+ }
25749
+ console.log("");
25750
+ console.log(chalk13__default.default.gray("\u{1F4A1} To use cloud models, set environment variables:"));
25751
+ console.log(chalk13__default.default.cyan(" export OPENAI_API_KEY=your_key"));
25752
+ console.log(chalk13__default.default.cyan(" export ANTHROPIC_API_KEY=your_key"));
25753
+ console.log(chalk13__default.default.cyan(" export GOOGLE_API_KEY=your_key"));
25754
+ console.log("");
25663
25755
  }
25664
- console.log("");
25665
25756
  } catch (error) {
25666
25757
  console.error(chalk13__default.default.red("\u274C Failed to get models:"), error);
25667
25758
  }
@@ -25728,26 +25819,34 @@ async function showModelSelector(maria, args) {
25728
25819
  try {
25729
25820
  const models = await maria.getModels();
25730
25821
  const available = models.filter((m) => m.available);
25822
+ const allModels = models;
25731
25823
  if (args.length > 0) {
25732
25824
  const modelName = args.join(" ");
25733
- const targetModel = available.find(
25825
+ const targetModel = allModels.find(
25734
25826
  (m) => m.name.toLowerCase().includes(modelName.toLowerCase()) || m.provider.toLowerCase().includes(modelName.toLowerCase())
25735
25827
  );
25736
25828
  if (targetModel) {
25737
- console.log(
25738
- chalk13__default.default.green(`\u2705 Target model found: ${targetModel.name} (${targetModel.provider})`)
25739
- );
25740
- console.log(chalk13__default.default.yellow("Note: Model switching will be implemented in a future version"));
25741
- console.log(
25742
- chalk13__default.default.gray("Currently, you can switch models using environment variables or CLI options")
25743
- );
25829
+ if (targetModel.available) {
25830
+ console.log(
25831
+ chalk13__default.default.green(`\u2705 Target model found: ${targetModel.name} (${targetModel.provider})`)
25832
+ );
25833
+ console.log(chalk13__default.default.yellow("Note: Model switching will be implemented in a future version"));
25834
+ console.log(
25835
+ chalk13__default.default.gray("Currently, you can switch models using environment variables or CLI options")
25836
+ );
25837
+ } else {
25838
+ console.log(
25839
+ chalk13__default.default.yellow(`\u26A0\uFE0F Target model found but unavailable: ${targetModel.name} (${targetModel.provider})`)
25840
+ );
25841
+ console.log(chalk13__default.default.gray(`This model requires API key for ${targetModel.provider}`));
25842
+ }
25744
25843
  } else {
25745
25844
  console.log(chalk13__default.default.red(`\u274C Model not found: ${modelName}`));
25746
25845
  console.log(chalk13__default.default.gray("Available models listed below:"));
25747
25846
  }
25748
25847
  return;
25749
25848
  }
25750
- await showInteractiveModelSelector(available);
25849
+ await showInteractiveModelSelector(allModels);
25751
25850
  } catch (error) {
25752
25851
  console.error(chalk13__default.default.red("\u274C Failed to access model selector:"), error);
25753
25852
  }
@@ -25769,25 +25868,33 @@ async function showInteractiveModelSelector(models) {
25769
25868
  console.log(chalk13__default.default.gray("Use \u2191/\u2193 to navigate, Enter to select, Esc to cancel\n"));
25770
25869
  console.log(chalk13__default.default.yellow("\u{1F4CB} Available AI Models:\n"));
25771
25870
  models.forEach((model, index) => {
25772
- const status = model.available ? "\u2705" : "\u26A0\uFE0F";
25871
+ const status = model.available ? "\u2705" : "\u274C";
25773
25872
  const pricing = model.pricing ? ` ($${model.pricing.input}/${model.pricing.output})` : "";
25774
25873
  const isSelected = index === selectedIndex;
25874
+ const availabilityNote = model.available ? "" : " (API key required)";
25775
25875
  if (isSelected) {
25776
25876
  console.log(
25777
- chalk13__default.default.bgBlue.white(` \u25B6 ${status} ${model.name} [${model.provider}]${pricing}`)
25877
+ chalk13__default.default.bgBlue.white(` \u25B6 ${status} ${model.name} [${model.provider}]${pricing}${availabilityNote}`)
25778
25878
  );
25779
25879
  console.log(chalk13__default.default.bgBlue.white(` ${model.description}`));
25780
25880
  if (model.capabilities && model.capabilities.length > 0) {
25781
25881
  console.log(chalk13__default.default.bgBlue.white(` Capabilities: ${model.capabilities.join(", ")}`));
25782
25882
  }
25883
+ if (!model.available) {
25884
+ console.log(chalk13__default.default.bgBlue.white(` Status: Requires ${model.provider.toUpperCase()}_API_KEY environment variable`));
25885
+ }
25783
25886
  } else {
25887
+ const nameColor = model.available ? chalk13__default.default.bold : chalk13__default.default.white;
25784
25888
  console.log(
25785
- ` ${status} ${chalk13__default.default.bold(model.name)} ${chalk13__default.default.gray(`[${model.provider}]`)}${pricing}`
25889
+ ` ${status} ${nameColor(model.name)} ${chalk13__default.default.gray(`[${model.provider}]`)}${pricing}${availabilityNote}`
25786
25890
  );
25787
25891
  console.log(` ${chalk13__default.default.gray(model.description)}`);
25788
25892
  if (model.capabilities && model.capabilities.length > 0) {
25789
25893
  console.log(` ${chalk13__default.default.cyan("Capabilities:")} ${model.capabilities.join(", ")}`);
25790
25894
  }
25895
+ if (!model.available) {
25896
+ console.log(` ${chalk13__default.default.yellow("Status:")} Requires ${model.provider.toUpperCase()}_API_KEY environment variable`);
25897
+ }
25791
25898
  }
25792
25899
  console.log("");
25793
25900
  });
@@ -25810,7 +25917,6 @@ async function showInteractiveModelSelector(models) {
25810
25917
  renderModels();
25811
25918
  break;
25812
25919
  case "\r":
25813
- isSelecting = false;
25814
25920
  cleanup();
25815
25921
  const selectedModel = models[selectedIndex];
25816
25922
  console.log(
@@ -25828,13 +25934,11 @@ async function showInteractiveModelSelector(models) {
25828
25934
  resolve();
25829
25935
  break;
25830
25936
  case "\x1B":
25831
- isSelecting = false;
25832
25937
  cleanup();
25833
25938
  console.log(chalk13__default.default.gray("\n\u{1F4CB} Model selection cancelled\n"));
25834
25939
  resolve();
25835
25940
  break;
25836
25941
  case "":
25837
- isSelecting = false;
25838
25942
  cleanup();
25839
25943
  console.log(chalk13__default.default.gray("\n\u{1F4CB} Model selection cancelled\n"));
25840
25944
  resolve();
@@ -28372,7 +28476,7 @@ __name(handleApprovalShow, "handleApprovalShow");
28372
28476
 
28373
28477
  // package.json
28374
28478
  var package_default = {
28375
- version: "2.0.4"};
28479
+ version: "2.0.5"};
28376
28480
 
28377
28481
  // src/cli.ts
28378
28482
  function createCLI() {