@bonginkan/maria 4.2.26 → 4.2.27

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.26"}`
1896
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.2.27"}`
1897
1897
  }
1898
1898
  });
1899
1899
  if (response2.status === 401) {
@@ -12104,26 +12104,22 @@ var init_continuation = __esm({
12104
12104
 
12105
12105
  // src/services/ai-response/responders/question.ts
12106
12106
  function buildQuestionResponse(options2) {
12107
- const { question, isJapanese, topics = [], includeExample = true } = options2;
12107
+ const { question, topics = [], includeExample = true } = options2;
12108
+ const isJapanese = false;
12108
12109
  const parts = [];
12109
12110
  if (process.env.MARIA_PLAIN_OUTPUT === "1" || process.env.MARIA_DISABLE_GUIDED_FLOW === "1") {
12110
12111
  return "";
12111
12112
  }
12112
12113
  const cleanQuestion = cleanUserInput(question);
12113
12114
  parts.push(
12114
- isJapanese ? `\u3054\u8CEA\u554F\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002\u300C${cleanQuestion}\u300D\u306B\u3064\u3044\u3066\u8AAC\u660E\u3057\u307E\u3059\u3002` : `Great question about "${cleanQuestion}". Let me explain.`
12115
+ `Great question about "${cleanQuestion}". Let me explain.`
12115
12116
  );
12116
12117
  parts.push("");
12117
12118
  parts.push(
12118
- createSectionHeader(isJapanese ? "\u56DE\u7B54\u306E\u69CB\u6210" : "Answer Structure", 3)
12119
+ createSectionHeader("Answer Structure", 3)
12119
12120
  );
12120
12121
  parts.push("");
12121
- const structure = isJapanese ? [
12122
- "\u80CC\u666F\u3068\u57FA\u672C\u6982\u5FF5",
12123
- "\u5B9F\u88C5\u65B9\u6CD5(\u6700\u5C0F\u4F8B)",
12124
- "\u30D9\u30B9\u30C8\u30D7\u30E9\u30AF\u30C6\u30A3\u30B9\u3068\u6CE8\u610F\u70B9",
12125
- "\u5B9F\u969B\u306E\u4F7F\u7528\u4F8B"
12126
- ] : [
12122
+ const structure = [
12127
12123
  "Background & Concepts",
12128
12124
  "Implementation (minimal example)",
12129
12125
  "Best practices & pitfalls",
@@ -12132,14 +12128,14 @@ function buildQuestionResponse(options2) {
12132
12128
  parts.push(formatList(structure, true));
12133
12129
  parts.push("");
12134
12130
  parts.push(
12135
- createSectionHeader(isJapanese ? "\u7C21\u6F54\u306A\u56DE\u7B54" : "Quick Answer", 3)
12131
+ createSectionHeader("Quick Answer", 3)
12136
12132
  );
12137
12133
  parts.push("");
12138
12134
  parts.push(generateQuickAnswer(question, isJapanese, topics));
12139
12135
  parts.push("");
12140
12136
  if (includeExample && shouldIncludeCode(question)) {
12141
12137
  parts.push(
12142
- createSectionHeader(isJapanese ? "\u30B3\u30FC\u30C9\u4F8B" : "Code Example", 3)
12138
+ createSectionHeader("Code Example", 3)
12143
12139
  );
12144
12140
  parts.push("");
12145
12141
  parts.push(generateExampleCode(topics));
@@ -12147,17 +12143,12 @@ function buildQuestionResponse(options2) {
12147
12143
  }
12148
12144
  parts.push(
12149
12145
  createSectionHeader(
12150
- isJapanese ? "\u8A73\u7D30\u3092\u77E5\u308A\u305F\u3044\u5834\u5408" : "Want to know more?",
12146
+ "Want to know more?",
12151
12147
  3
12152
12148
  )
12153
12149
  );
12154
12150
  parts.push("");
12155
- const detailOptions = isJapanese ? [
12156
- "\u8A73\u7D30\u306A\u5B9F\u88C5\u4F8B\u3092\u898B\u308B",
12157
- "\u95A2\u9023\u3059\u308B\u6982\u5FF5\u3092\u5B66\u3076",
12158
- "\u30C8\u30E9\u30D6\u30EB\u30B7\u30E5\u30FC\u30C6\u30A3\u30F3\u30B0",
12159
- "\u5B9F\u969B\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3078\u306E\u9069\u7528"
12160
- ] : [
12151
+ const detailOptions = [
12161
12152
  "See detailed implementation",
12162
12153
  "Learn related concepts",
12163
12154
  "Troubleshooting guide",
@@ -12166,7 +12157,7 @@ function buildQuestionResponse(options2) {
12166
12157
  parts.push(formatList(detailOptions, true));
12167
12158
  parts.push("");
12168
12159
  parts.push(
12169
- isJapanese ? "\u756A\u53F7\u3092\u9078\u3093\u3067\u8A73\u7D30\u3092\u78BA\u8A8D\u3059\u308B\u304B\u3001\u8FFD\u52A0\u306E\u8CEA\u554F\u3092\u3057\u3066\u304F\u3060\u3055\u3044\u3002" : "Choose a number for details or ask a follow-up question."
12160
+ "Choose a number for details or ask a follow-up question."
12170
12161
  );
12171
12162
  return parts.join("\n");
12172
12163
  }
@@ -12247,7 +12238,6 @@ function solution(input: string): string {
12247
12238
  function buildComprehensiveAnswer(question, detectedTopics, isJapanese) {
12248
12239
  return buildQuestionResponse({
12249
12240
  question,
12250
- isJapanese,
12251
12241
  topics: detectedTopics,
12252
12242
  includeExample: true
12253
12243
  });
@@ -12598,7 +12588,7 @@ ${prompt}`,
12598
12588
  return generateNextAPITemplate(isJapanese);
12599
12589
  return "";
12600
12590
  case "QUESTION":
12601
- return buildComprehensiveAnswer(userInput, topics, isJapanese);
12591
+ return buildComprehensiveAnswer(userInput, topics);
12602
12592
  case "CONTINUATION": {
12603
12593
  const contextPreview = context2.recentMessages.slice(-3).map((m2) => m2.content).join(" ");
12604
12594
  return buildSmartContinuation(contextPreview, topics, isJapanese);
@@ -13091,6 +13081,10 @@ var init_interactive_cli = __esm({
13091
13081
  isWaitingForInput = false;
13092
13082
  // Added: prevent duplicate enter handling
13093
13083
  segmenter = null;
13084
+ lastRenderLines = 0;
13085
+ // Track how many terminal lines the last render occupied
13086
+ lastCursorRowOffset = 0;
13087
+ // Row offset within the last rendered block where cursor ended
13094
13088
  constructor(options2 = {}) {
13095
13089
  this.options = {
13096
13090
  maxSuggestions: options2.maxSuggestions || 5,
@@ -13297,11 +13291,11 @@ var init_interactive_cli = __esm({
13297
13291
  this.dropdown.hide();
13298
13292
  this.isShowingSuggestions = false;
13299
13293
  this.suggestions = [];
13300
- const promptLength = 2;
13301
- readline__namespace.cursorTo(process.stdout, this.cursorPosition + promptLength);
13294
+ this.render();
13302
13295
  } else {
13303
13296
  this.currentInput = "";
13304
13297
  this.cursorPosition = 0;
13298
+ this.lastRenderLines = 0;
13305
13299
  this.render();
13306
13300
  }
13307
13301
  }
@@ -13371,16 +13365,45 @@ var init_interactive_cli = __esm({
13371
13365
  if (this.overlaysSuspended) {
13372
13366
  return;
13373
13367
  }
13374
- readline__namespace.cursorTo(process.stdout, 0);
13375
- readline__namespace.clearLine(process.stdout, 0);
13368
+ const stdout2 = process.stdout;
13369
+ const columns = Math.max(1, stdout2.columns || 80);
13370
+ readline__namespace.cursorTo(stdout2, 0);
13371
+ if (this.lastRenderLines > 0) {
13372
+ if (this.lastCursorRowOffset > 0) {
13373
+ readline__namespace.moveCursor(stdout2, 0, -this.lastCursorRowOffset);
13374
+ }
13375
+ if (this.lastRenderLines > 1) {
13376
+ readline__namespace.moveCursor(stdout2, 0, this.lastRenderLines - 1);
13377
+ }
13378
+ for (let i2 = 0; i2 < this.lastRenderLines; i2++) {
13379
+ readline__namespace.clearLine(stdout2, 0);
13380
+ if (i2 < this.lastRenderLines - 1) {
13381
+ readline__namespace.moveCursor(stdout2, 0, -1);
13382
+ }
13383
+ }
13384
+ readline__namespace.cursorTo(stdout2, 0);
13385
+ }
13376
13386
  const prompt = chalk29__default.default.cyan("> ");
13377
13387
  const displayInput = this.currentInput;
13378
- process.stdout.write(prompt + displayInput);
13388
+ stdout2.write(prompt + displayInput);
13379
13389
  const promptColumns = 2;
13390
+ const totalColumns = promptColumns + stringWidth(displayInput);
13391
+ const newRenderLines = Math.max(1, Math.ceil(totalColumns / columns));
13380
13392
  const leftText = this.sliceByGraphemes(displayInput, 0, this.cursorPosition);
13381
13393
  const leftColumns = stringWidth(leftText);
13382
- const actualCursorPos = promptColumns + leftColumns;
13383
- readline__namespace.cursorTo(process.stdout, actualCursorPos);
13394
+ const cursorAbsolute = promptColumns + leftColumns;
13395
+ const targetRowOffset = Math.floor(cursorAbsolute / columns);
13396
+ const targetCol = cursorAbsolute % columns;
13397
+ if (newRenderLines > 1) {
13398
+ readline__namespace.moveCursor(stdout2, 0, -(newRenderLines - 1));
13399
+ }
13400
+ readline__namespace.cursorTo(stdout2, 0);
13401
+ if (targetRowOffset > 0) {
13402
+ readline__namespace.moveCursor(stdout2, 0, targetRowOffset);
13403
+ }
13404
+ readline__namespace.cursorTo(stdout2, targetCol);
13405
+ this.lastRenderLines = newRenderLines;
13406
+ this.lastCursorRowOffset = targetRowOffset;
13384
13407
  }
13385
13408
  /**
13386
13409
  * Count graphemes (visible characters)
@@ -13490,6 +13513,7 @@ var init_interactive_cli = __esm({
13490
13513
  this.suggestions = [];
13491
13514
  this.selectedIndex = 0;
13492
13515
  this.previousSuggestionsCount = 0;
13516
+ this.lastRenderLines = 0;
13493
13517
  readline__namespace.cursorTo(process.stdout, 0);
13494
13518
  readline__namespace.clearLine(process.stdout, 0);
13495
13519
  }
@@ -13503,6 +13527,7 @@ var init_interactive_cli = __esm({
13503
13527
  this.selectedIndex = 0;
13504
13528
  this.isShowingSuggestions = false;
13505
13529
  this.isWaitingForInput = true;
13530
+ this.lastRenderLines = 0;
13506
13531
  process.stdout.write(prompt);
13507
13532
  return new Promise((resolve8) => {
13508
13533
  const handler = (input3) => {
@@ -13519,6 +13544,7 @@ var init_interactive_cli = __esm({
13519
13544
  prompt() {
13520
13545
  this.currentInput = "";
13521
13546
  this.cursorPosition = 0;
13547
+ this.lastRenderLines = 0;
13522
13548
  this.render();
13523
13549
  }
13524
13550
  /**
@@ -13532,6 +13558,7 @@ var init_interactive_cli = __esm({
13532
13558
  process.stdin.setRawMode(false);
13533
13559
  }
13534
13560
  this.rl.close();
13561
+ this.lastRenderLines = 0;
13535
13562
  }
13536
13563
  /**
13537
13564
  * Get readline interface
@@ -19896,8 +19923,8 @@ var require_package = __commonJS({
19896
19923
  "package.json"(exports, module) {
19897
19924
  module.exports = {
19898
19925
  name: "@bonginkan/maria",
19899
- version: "4.2.26",
19900
- description: "\u{1F680} MARIA v4.2.26 - 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.",
19926
+ version: "4.2.27",
19927
+ description: "\u{1F680} MARIA v4.2.27 - 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.",
19901
19928
  keywords: [
19902
19929
  "ai",
19903
19930
  "cli",
@@ -32358,7 +32385,7 @@ var init_about_command = __esm({
32358
32385
  async execute(args2, context2) {
32359
32386
  const output3 = [];
32360
32387
  output3.push("");
32361
- output3.push(chalk29__default.default.cyan.bold("\u{1F916} About MARIA v4.2.26"));
32388
+ output3.push(chalk29__default.default.cyan.bold("\u{1F916} About MARIA v4.2.27"));
32362
32389
  output3.push(chalk29__default.default.gray("\u2550".repeat(40)));
32363
32390
  output3.push("");
32364
32391
  output3.push(chalk29__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
@@ -59966,8 +59993,7 @@ async function startInteractiveSession() {
59966
59993
  if (interactiveCLI) {
59967
59994
  while (true) {
59968
59995
  try {
59969
- const prompt = chalk29__default.default.gray("> ");
59970
- process.stdout.write(prompt);
59996
+ interactiveCLI.prompt();
59971
59997
  const line = await interactiveCLI.question("");
59972
59998
  console.log();
59973
59999
  if (line.toLowerCase() === "exit" || line.toLowerCase() === "quit") {