@bonginkan/maria 4.3.43 → 4.3.44

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
@@ -1709,7 +1709,7 @@ var init_AuthenticationManager = __esm({
1709
1709
  const response = await fetch(`${this.apiBase}/api/user/profile`, {
1710
1710
  headers: {
1711
1711
  "Authorization": `Bearer ${tokens2.accessToken}`,
1712
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.43"}`
1712
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.44"}`
1713
1713
  }
1714
1714
  });
1715
1715
  if (response.status === 401) {
@@ -2434,7 +2434,7 @@ async function callApi(path65, init3 = {}) {
2434
2434
  "Authorization": `Bearer ${token}`,
2435
2435
  "X-Device-Id": getDeviceId(),
2436
2436
  "X-Session-Id": getSessionId() || "",
2437
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.43"}`,
2437
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.44"}`,
2438
2438
  "Content-Type": init3.headers?.["Content-Type"] || "application/json"
2439
2439
  });
2440
2440
  const doFetch = async (token) => {
@@ -16416,8 +16416,8 @@ var require_package = __commonJS({
16416
16416
  "package.json"(exports, module) {
16417
16417
  module.exports = {
16418
16418
  name: "@bonginkan/maria",
16419
- version: "4.3.43",
16420
- description: "\u{1F680} MARIA v4.3.43 - Enterprise AI Development Platform with identity system and character voice implementation. 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.",
16419
+ version: "4.3.44",
16420
+ description: "\u{1F680} MARIA v4.3.44 - Enterprise AI Development Platform with identity system and character voice implementation. 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.",
16421
16421
  keywords: [
16422
16422
  "ai",
16423
16423
  "cli",
@@ -26423,7 +26423,7 @@ var init_about_command = __esm({
26423
26423
  async execute(args2, context2) {
26424
26424
  const output3 = [];
26425
26425
  output3.push("");
26426
- output3.push(chalk40__default.default.cyan.bold("\u{1F916} About MARIA v4.3.43"));
26426
+ output3.push(chalk40__default.default.cyan.bold("\u{1F916} About MARIA v4.3.44"));
26427
26427
  output3.push(chalk40__default.default.gray("\u2550".repeat(40)));
26428
26428
  output3.push("");
26429
26429
  output3.push(chalk40__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
@@ -39996,47 +39996,68 @@ ${h2.head}`);
39996
39996
  return [];
39997
39997
  }
39998
39998
  }
39999
- async function llmMapBlockToFile(root, request, block, repoFiles) {
39999
+ async function llmMapBlocksBatch(root, request, blocks, repoFiles) {
40000
40000
  try {
40001
- const lang = (block.language || "").toLowerCase();
40002
- const extFilter = lang.includes("html") ? /\.html$/i : /(ts|tsx)/.test(lang) ? /\.(ts|tsx)$/i : /(js|jsx)/.test(lang) ? /\.(js|jsx)$/i : /\.css$/i;
40003
- const candidates = repoFiles.filter((p) => extFilter.test(p)).slice(0, 80);
40004
- const head2 = block.code.split(/\r?\n/).slice(0, 20).join("\n");
40001
+ const candidates = repoFiles.filter((p) => /\.(html|css|js|ts|tsx)$/i.test(p)).slice(0, 120);
40002
+ const blockSnippets = blocks.slice(0, 20).map((b, i2) => {
40003
+ const head2 = (b.code || "").split(/\r?\n/).slice(0, 20).join("\n");
40004
+ return `# block ${i2}
40005
+
40006
+ \`\`\`
40007
+ ${head2}
40008
+ \`\`\``;
40009
+ }).join("\n\n");
40005
40010
  const samples = [];
40006
- for (const p of candidates.slice(0, 40)) {
40011
+ for (const p of candidates.slice(0, 60)) {
40007
40012
  const h2 = await readHeadTail(root, p, 8);
40008
40013
  samples.push(`- ${p}
40009
40014
  ${h2.head}`);
40010
40015
  }
40011
40016
  const system = [
40012
- "Decide where to apply an EDIT vs CREATE for a code block within an existing repository.",
40013
- 'Return JSON: { "action": "modify"|"create", "path": string }.',
40014
- "If modify, path must be one of the candidate repo-relative paths. If create, propose a sensible repo-relative path."
40017
+ "For each provided code block, decide whether to MODIFY an existing repo file or CREATE a new file.",
40018
+ 'Return JSON array of objects: [{ "index": number, "action": "modify"|"create", "path": string }].',
40019
+ "When action is modify, path MUST be one of the candidate repo-relative paths listed."
40015
40020
  ].join("\n");
40016
40021
  const user = [
40017
40022
  `Request: ${request}`,
40018
- "Block:",
40019
- "```",
40020
- head2,
40021
- "```",
40023
+ "Blocks:",
40024
+ blockSnippets,
40022
40025
  "Candidates:",
40023
40026
  samples.join("\n\n")
40024
- ].join("\n");
40027
+ ].join("\n\n");
40028
+ const spin = new ProcessAnimation();
40029
+ spin.start();
40025
40030
  const resp = await executeChat([
40026
40031
  { role: "system", content: system },
40027
40032
  { role: "user", content: user }
40028
40033
  ]);
40034
+ try {
40035
+ spin.stop();
40036
+ } catch {
40037
+ }
40029
40038
  const raw = (resp?.output || "").trim();
40030
- const jsonText = extractJsonSafe(raw, "object") || raw;
40031
- const parsed = JSON.parse(jsonText);
40032
- if (parsed && (parsed.action === "modify" || parsed.action === "create") && typeof parsed.path === "string") {
40033
- return { action: parsed.action, path: parsed.path.replace(/^\/+/, "") };
40039
+ const jsonText = extractJsonSafe(raw, "array") || raw;
40040
+ const arr = JSON.parse(jsonText);
40041
+ const set = new Set(candidates.map((c) => c.toLowerCase()));
40042
+ const out = [];
40043
+ if (Array.isArray(arr)) {
40044
+ for (const item of arr) {
40045
+ const idx = typeof item?.index === "number" ? item.index : -1;
40046
+ const action = item?.action === "modify" ? "modify" : "create";
40047
+ const path65 = typeof item?.path === "string" ? String(item.path) : "";
40048
+ if (idx >= 0 && idx < blocks.length) {
40049
+ if (action === "modify" && set.has(path65.toLowerCase())) out[idx] = { action, path: path65.replace(/^\/+/, "") };
40050
+ else out[idx] = { action: "create", path: path65 || suggestName2(request, blocks[idx].language || "javascript", idx) };
40051
+ }
40052
+ }
40034
40053
  }
40054
+ for (let i2 = 0; i2 < blocks.length; i2++) {
40055
+ if (!out[i2]) out[i2] = { action: "create", path: suggestName2(request, blocks[i2].language || "javascript", i2) };
40056
+ }
40057
+ return out;
40035
40058
  } catch {
40059
+ return blocks.map((b, i2) => ({ action: "create", path: suggestName2(request, b.language || "javascript", i2) }));
40036
40060
  }
40037
- const desired = typeof block.filename === "string" && block.filename.trim() ? block.filename.trim() : null;
40038
- const fallback2 = desired || suggestName2(request, block.language, 0);
40039
- return { action: "create", path: fallback2 };
40040
40061
  }
40041
40062
  function tokenizeRequest(text) {
40042
40063
  return Array.from(new Set(text.toLowerCase().replace(/[^a-z0-9_-]+/g, " ").split(/\s+/).filter((t2) => t2.length >= 3)));
@@ -40306,15 +40327,16 @@ ${editContext}`;
40306
40327
  } else {
40307
40328
  try {
40308
40329
  const repoFiles = await getRepoFiles(opts.root);
40330
+ const decisions = await llmMapBlocksBatch(opts.root, request, blocks, repoFiles);
40309
40331
  for (let i2 = 0; i2 < blocks.length; i2++) {
40310
40332
  const b = blocks[i2];
40311
- const decision = await llmMapBlockToFile(opts.root, request, b, repoFiles);
40312
- if (decision.action === "modify" && repoFiles.includes(decision.path)) {
40313
- const lang = languageFromExt(decision.path.replace(/^.*(\.[a-z0-9]+)$/i, "$1"));
40314
- initial.push({ path: decision.path, kind: "source", action: "modify", description: "Modify existing file", language: lang, preview: b.code });
40333
+ const d = decisions[i2] || { action: "create", path: suggestName2(request, b.language, i2) };
40334
+ if (d.action === "modify" && repoFiles.includes(d.path)) {
40335
+ const lang = languageFromExt(d.path.replace(/^.*(\.[a-z0-9]+)$/i, "$1"));
40336
+ initial.push({ path: d.path, kind: "source", action: "modify", description: "Modify existing file", language: lang, preview: b.code });
40315
40337
  } else {
40316
- const path65 = decision.path || suggestName2(request, b.language, i2);
40317
- initial.push({ path: path65, kind: "source", action: "create", description: describe2(b.language, ""), language: b.language, preview: b.code });
40338
+ const pth = d.path || suggestName2(request, b.language, i2);
40339
+ initial.push({ path: pth, kind: "source", action: "create", description: describe2(b.language, ""), language: b.language, preview: b.code });
40318
40340
  }
40319
40341
  }
40320
40342
  } catch {