@bonginkan/maria 4.2.29 → 4.2.31

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.cjs CHANGED
@@ -1893,7 +1893,7 @@ var init_AuthenticationManager = __esm({
1893
1893
  const response2 = await fetch(`${this.apiBase}/api/user/profile`, {
1894
1894
  headers: {
1895
1895
  "Authorization": `Bearer ${tokens.accessToken}`,
1896
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.2.29"}`
1896
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.2.31"}`
1897
1897
  }
1898
1898
  });
1899
1899
  if (response2.status === 401) {
@@ -3814,7 +3814,7 @@ var DEFAULT_PROVIDER2, DEFAULT_MODEL2;
3814
3814
  var init_config = __esm({
3815
3815
  "src/providers/config.ts"() {
3816
3816
  DEFAULT_PROVIDER2 = process.env.DEFAULT_PROVIDER || "openai";
3817
- DEFAULT_MODEL2 = process.env.MARIA_DEFAULT_MODEL || process.env.LMSTUDIO_MODEL || "gpt-5-mini-2025-08-07";
3817
+ DEFAULT_MODEL2 = process.env.OPENAI_MODEL || process.env.MARIA_DEFAULT_MODEL || "gpt-5-mini";
3818
3818
  }
3819
3819
  });
3820
3820
 
@@ -11010,13 +11010,16 @@ var init_manager = __esm({
11010
11010
  if (h2.ok) return p;
11011
11011
  }
11012
11012
  const order = [
11013
+ // Prefer cloud OpenAI when configured
11013
11014
  "openai",
11015
+ // Prioritize local providers next for offline/dev environments
11016
+ "lmstudio",
11017
+ "ollama",
11018
+ "vllm",
11019
+ // Other clouds after local options
11014
11020
  "anthropic",
11015
11021
  "google",
11016
11022
  "grok",
11017
- "ollama",
11018
- "lmstudio",
11019
- "vllm",
11020
11023
  "groq"
11021
11024
  ];
11022
11025
  for (const id of order) {
@@ -11064,8 +11067,8 @@ var init_manager = __esm({
11064
11067
  /** Legacy sync method kept for backward compatibility (minimal) */
11065
11068
  getAvailableModels() {
11066
11069
  const out = [];
11067
- if (this.available.has("openai")) out.push("gpt-4o", "gpt-4o-mini", "gpt-3.5-turbo");
11068
- if (this.available.has("anthropic")) out.push("claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022");
11070
+ if (this.available.has("openai")) out.push("gpt-5", "gpt-5-mini", "gpt-4o", "gpt-4o-mini");
11071
+ if (this.available.has("anthropic")) out.push("claude-opus-4-1-20250805", "claude-opus-4-20250514", "claude-sonnet-4-20250514");
11069
11072
  if (this.available.has("google")) out.push("gemini-2.5-pro", "gemini-2.5-flash");
11070
11073
  if (this.available.has("grok")) out.push("grok-4", "grok-beta");
11071
11074
  return out;
@@ -11191,12 +11194,15 @@ var init_manager = __esm({
11191
11194
  if (!apiKey) throw new Error("OpenAI API key not configured");
11192
11195
  const controller = new AbortController();
11193
11196
  const timeout = setTimeout(() => controller.abort(), 3e5);
11194
- const modelName = req.model || "gpt-5-mini-2025-08-07";
11195
- const isGPT5 = modelName.includes("gpt-5");
11197
+ const modelName = req.model || process.env.OPENAI_MODEL || "gpt-5-mini";
11198
+ const isGPT5 = /\bgpt-5\b/i.test(modelName) || modelName.toLowerCase().startsWith("gpt-5");
11196
11199
  const bodyParams = {
11197
11200
  model: modelName,
11198
11201
  messages: [
11199
- { role: "system", content: "You are a helpful assistant. Provide direct, clear answers without menus or numbered options." },
11202
+ {
11203
+ role: "system",
11204
+ content: "You are a helpful assistant. Always respond in English. Provide direct, clear answers without menus or numbered options."
11205
+ },
11200
11206
  { role: "user", content: prompt }
11201
11207
  ]
11202
11208
  };
@@ -11221,7 +11227,7 @@ var init_manager = __esm({
11221
11227
  throw new Error(`OpenAI ${res.status}: ${txt}`);
11222
11228
  }
11223
11229
  const json = await res.json();
11224
- return { content: json.choices?.[0]?.message?.content ?? "" };
11230
+ return { content: json.choices?.[0]?.message?.content ?? "", model: json.model };
11225
11231
  } catch (error2) {
11226
11232
  clearTimeout(timeout);
11227
11233
  if (error2.name === "AbortError" || error2.message?.includes("abort")) {
@@ -12425,6 +12431,17 @@ var init_ai_response_service = __esm({
12425
12431
  try {
12426
12432
  await this.providerManager.initialize();
12427
12433
  this.initialized = true;
12434
+ try {
12435
+ const noOpenAI = !process.env.OPENAI_API_KEY;
12436
+ const isMac = process.platform === "darwin";
12437
+ if (isMac && noOpenAI) {
12438
+ const available = new Set(this.providerManager.getAvailableProviders());
12439
+ if (available.has("lmstudio")) {
12440
+ this.providerManager.setActiveProvider("lmstudio");
12441
+ }
12442
+ }
12443
+ } catch {
12444
+ }
12428
12445
  } catch {
12429
12446
  this.initialized = false;
12430
12447
  }
@@ -12443,13 +12460,19 @@ var init_ai_response_service = __esm({
12443
12460
  */
12444
12461
  async callLLM(prompt, opts = {}) {
12445
12462
  const {
12446
- system = PLAIN_OUTPUT ? "Return ONLY the answer (or ONLY code). No menus, no lists, no guided flows." : "You are a helpful senior engineer. Provide direct, production-quality answers.",
12463
+ system = PLAIN_OUTPUT ? "Return ONLY the answer (or ONLY code). No menus, no lists, no guided flows. Always respond in English." : "You are a helpful senior engineer. Always respond in English. Provide direct, production-quality answers.",
12447
12464
  model = DEFAULT_MODEL2,
12448
12465
  provider = DEFAULT_PROVIDER2,
12449
12466
  temperature = 0.2,
12450
12467
  maxTokens = 32e3
12451
12468
  } = opts;
12452
12469
  try {
12470
+ if (provider) {
12471
+ try {
12472
+ this.providerManager.setCurrentProvider(provider);
12473
+ } catch {
12474
+ }
12475
+ }
12453
12476
  const res = await this.providerManager.complete({
12454
12477
  prompt: `${system}
12455
12478
 
@@ -19127,8 +19150,8 @@ var require_package = __commonJS({
19127
19150
  "package.json"(exports, module) {
19128
19151
  module.exports = {
19129
19152
  name: "@bonginkan/maria",
19130
- version: "4.2.29",
19131
- description: "\u{1F680} MARIA v4.2.29 - Enterprise AI Development Platform with 100% Command Availability. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
19153
+ version: "4.2.31",
19154
+ description: "\u{1F680} MARIA v4.2.31 - Enterprise AI Development Platform with 100% Command Availability. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
19132
19155
  keywords: [
19133
19156
  "ai",
19134
19157
  "cli",
@@ -31589,7 +31612,7 @@ var init_about_command = __esm({
31589
31612
  async execute(args2, context2) {
31590
31613
  const output3 = [];
31591
31614
  output3.push("");
31592
- output3.push(chalk28__default.default.cyan.bold("\u{1F916} About MARIA v4.2.29"));
31615
+ output3.push(chalk28__default.default.cyan.bold("\u{1F916} About MARIA v4.2.31"));
31593
31616
  output3.push(chalk28__default.default.gray("\u2550".repeat(40)));
31594
31617
  output3.push("");
31595
31618
  output3.push(chalk28__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
@@ -58937,17 +58960,17 @@ async function handleCodeCommand(prompt) {
58937
58960
  const response2 = await generateStrictCode(prompt);
58938
58961
  spinner.stop();
58939
58962
  if (response2) {
58940
- console.log(response2);
58963
+ console.log(chalk28__default.default.green(response2));
58941
58964
  const { language, code, extension } = extractCodeInfo(response2);
58942
58965
  const filename = generateCodeFilename(prompt, language, extension);
58943
58966
  const filepath = path8__namespace.resolve(process.cwd(), filename);
58944
58967
  await fsp__namespace.writeFile(filepath, code, "utf-8");
58945
58968
  console.log(
58946
- chalk28__default.default.green("\n\u2705 **Code Saved**\n") + chalk28__default.default.white(`\u{1F4C1} **File (Click to open):**
58947
- `) + chalk28__default.default.cyan(`\u2022 [${filename}](file://${filepath})
58948
- `) + chalk28__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
58949
- `) + chalk28__default.default.white(` \u{1F4DD} Language: ${language}
58950
- `) + chalk28__default.default.dim(`
58969
+ chalk28__default.default.green("\n\u2705 Code Saved\n") + chalk28__default.default.green(`\u{1F4C1} File (Click to open):
58970
+ `) + chalk28__default.default.green(`\u2022 [${filename}](file://${filepath})
58971
+ `) + chalk28__default.default.green(` \u{1F4CD} Path: \`${filepath}\`
58972
+ `) + chalk28__default.default.green(` \u{1F4DD} Language: ${language}
58973
+ `) + chalk28__default.default.green(`
58951
58974
  \u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
58952
58975
  );
58953
58976
  } else {
@@ -58962,17 +58985,18 @@ async function handleCodeCommand(prompt) {
58962
58985
  console.log(
58963
58986
  chalk28__default.default.yellow("\u26A0 AI unavailable, using template fallback:\n")
58964
58987
  );
58965
- console.log(fallbackCode);
58988
+ console.log(chalk28__default.default.green(fallbackCode));
58966
58989
  try {
58967
58990
  const { language, code, extension } = extractCodeInfo(fallbackCode);
58968
58991
  const filename = generateCodeFilename(prompt, language, extension);
58969
58992
  const filepath = path8__namespace.resolve(process.cwd(), filename);
58970
58993
  await fsp__namespace.writeFile(filepath, code, "utf-8");
58971
58994
  console.log(
58972
- chalk28__default.default.green("\n\u2705 **Template Code Saved**\n") + chalk28__default.default.white(`\u{1F4C1} **File (Click to open):**
58973
- `) + chalk28__default.default.cyan(`\u2022 [${filename}](file://${filepath})
58974
- `) + chalk28__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
58975
- `) + chalk28__default.default.dim(`
58995
+ chalk28__default.default.green("\n\u2705 Template Code Saved\n") + chalk28__default.default.green(`\u{1F4C1} File (Click to open):
58996
+ `) + chalk28__default.default.green(`\u2022 [${filename}](file://${filepath})
58997
+ `) + chalk28__default.default.green(` \u{1F4CD} Path: \`${filepath}\`
58998
+ `) + chalk28__default.default.green(` \u{1F4DD} Language: ${language}
58999
+ `) + chalk28__default.default.green(`
58976
59000
  \u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
58977
59001
  );
58978
59002
  } catch (saveError) {
@@ -59191,9 +59215,9 @@ async function streamAnswer(text) {
59191
59215
  });
59192
59216
  animation.stop();
59193
59217
  if (ai.streamResponse) {
59194
- await ai.streamResponse(resp, (line) => console.log(line));
59218
+ await ai.streamResponse(resp, (line) => console.log(chalk28__default.default.green(line)));
59195
59219
  } else {
59196
- console.log(resp);
59220
+ console.log(chalk28__default.default.green(resp));
59197
59221
  }
59198
59222
  const msg = { role: "assistant", content: resp, timestamp: /* @__PURE__ */ new Date() };
59199
59223
  session.push(msg);