@bonginkan/maria 3.1.0 โ 3.1.2
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/README.md +14 -17
- package/dist/bin/maria.cjs +207 -198
- package/dist/bin/maria.cjs.map +1 -1
- package/dist/cli.cjs +204 -195
- package/dist/cli.cjs.map +1 -1
- package/package.json +83 -81
- package/npm-shrinkwrap.json +0 -11053
package/README.md
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
# ๐ MARIA v3.
|
|
1
|
+
# ๐ MARIA v3.1.1
|
|
2
2
|
|
|
3
3
|
**Minimal API, Maximum Power** - Enterprise-ready AI development platform with 3 core services, beautiful CLI experience, and dynamic configuration.
|
|
4
4
|
|
|
5
|
+
๐ **Homepage**: [https://bonginkan.ai/](https://bonginkan.ai/)
|
|
6
|
+
|
|
5
7
|
[](https://www.typescriptlang.org/)
|
|
6
8
|
[](https://nodejs.org/)
|
|
7
|
-
[](https://www.npmjs.com/package/@bonginkan/maria)
|
|
8
10
|
[](https://github.com/bonginkan/maria)
|
|
9
11
|
[](https://github.com/bonginkan/maria)
|
|
10
12
|
|
|
11
13
|
## โก 3-Minute Quickstart
|
|
12
14
|
|
|
13
|
-
### ๐ฏ What is MARIA v3.
|
|
15
|
+
### ๐ฏ What is MARIA v3.1.1?
|
|
14
16
|
|
|
15
|
-
MARIA v3.
|
|
17
|
+
MARIA v3.1.1 revolutionizes AI development with **3 powerful services**, **beautiful CLI experience**, and **rock-solid stability**:
|
|
16
18
|
|
|
17
19
|
- ๐ง **IntelligentRouterService** - Smart command routing and analysis
|
|
18
20
|
- ๐งฉ **DualMemoryEngine** - System 1 & System 2 cognitive memory
|
|
19
21
|
- ๐ **FileSystemService** - Safe, atomic file operations
|
|
20
22
|
|
|
21
|
-
### ๐ What's New in v3.
|
|
22
|
-
|
|
23
|
-
#### Critical Fixes
|
|
24
|
-
- โ
**Fixed `/help` Command** - Completely resolved all help command issues
|
|
25
|
-
- โ
**Variable Consistency** - Fixed all variable name mismatches
|
|
26
|
-
- โ
**Error Messages** - Clearer, more helpful error output
|
|
27
|
-
- โ
**Build Warnings** - Eliminated all build warnings
|
|
23
|
+
### ๐ What's New in v3.1.1
|
|
28
24
|
|
|
29
|
-
#### Improvements
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
25
|
+
#### CLI Cleanup & Production Improvements
|
|
26
|
+
- ๐งน **Removed Duplicate CLI Files** - Consolidated `cli-fixed.ts` and `cli-backup.ts` into single `cli.ts`
|
|
27
|
+
- ๐ฏ **Cleaner Startup** - Removed all debug output and development messages
|
|
28
|
+
- โจ **Professional Experience** - Clean, unified startup process without duplicates
|
|
29
|
+
- ๐ฆ **Better Maintainability** - Single source of truth for CLI functionality
|
|
30
|
+
- โก **Faster Performance** - Improved startup and build times with fewer files
|
|
34
31
|
|
|
35
32
|
### ๐ฆ Installation
|
|
36
33
|
|
|
@@ -74,7 +71,7 @@ When you run `maria`, you'll see:
|
|
|
74
71
|
โ (c) 2025 Bonginkan Inc. โ
|
|
75
72
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
76
73
|
|
|
77
|
-
MARIA CODE v3.
|
|
74
|
+
MARIA CODE v3.1.1 โ Ready
|
|
78
75
|
/help for commands | Providers: 8/8 OK
|
|
79
76
|
|
|
80
77
|
Available AI Providers:
|
package/dist/bin/maria.cjs
CHANGED
|
@@ -11351,181 +11351,20 @@ var init_chat_context_fixed_service = __esm({
|
|
|
11351
11351
|
}
|
|
11352
11352
|
});
|
|
11353
11353
|
|
|
11354
|
-
// src/services/ai-response.
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
"
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
* Generate intelligent AI response using actual providers
|
|
11369
|
-
* Replaces the hard-coded template system
|
|
11370
|
-
*/
|
|
11371
|
-
async generateResponse(request2, options2 = {}) {
|
|
11372
|
-
try {
|
|
11373
|
-
await this.chatContext.addMessage({
|
|
11374
|
-
role: "user",
|
|
11375
|
-
content: request2.userInput
|
|
11376
|
-
});
|
|
11377
|
-
const context2 = this.buildContextForAI(request2);
|
|
11378
|
-
const aiResponse = await this.callAIProvider(context2, options2);
|
|
11379
|
-
await this.chatContext.addMessage({
|
|
11380
|
-
role: "assistant",
|
|
11381
|
-
content: aiResponse
|
|
11382
|
-
});
|
|
11383
|
-
return aiResponse;
|
|
11384
|
-
} catch (error2) {
|
|
11385
|
-
console.error("AI Response generation failed:", error2);
|
|
11386
|
-
return this.generateFallbackResponse(request2.userInput);
|
|
11387
|
-
}
|
|
11388
|
-
}
|
|
11389
|
-
/**
|
|
11390
|
-
* Build context for AI provider
|
|
11391
|
-
*/
|
|
11392
|
-
buildContextForAI(request2) {
|
|
11393
|
-
const recentContext = request2.sessionMemory.slice(-5);
|
|
11394
|
-
return {
|
|
11395
|
-
messages: recentContext.map((msg2) => ({
|
|
11396
|
-
role: msg2.role,
|
|
11397
|
-
content: msg2.content
|
|
11398
|
-
})),
|
|
11399
|
-
currentInput: request2.userInput,
|
|
11400
|
-
contextStats: this.chatContext.getStats()
|
|
11401
|
-
};
|
|
11402
|
-
}
|
|
11403
|
-
/**
|
|
11404
|
-
* Call actual AI provider with intelligent intent recognition
|
|
11405
|
-
*/
|
|
11406
|
-
async callAIProvider(context2, _options) {
|
|
11407
|
-
const userInput2 = context2.currentInput.toLowerCase();
|
|
11408
|
-
const hasContext = context2.messages.length > 0;
|
|
11409
|
-
const intent2 = this.analyzeIntent(userInput2, context2);
|
|
11410
|
-
switch (intent2.type) {
|
|
11411
|
-
case "TETRIS_REQUEST":
|
|
11412
|
-
return this.generateTetrisGame(userInput2);
|
|
11413
|
-
case "CODE_REQUEST":
|
|
11414
|
-
return this.generateCodeResponse(userInput2, context2);
|
|
11415
|
-
case "QUESTION":
|
|
11416
|
-
return this.generateQuestionResponse(userInput2, context2);
|
|
11417
|
-
case "CONTINUATION":
|
|
11418
|
-
return this.generateContinuationResponse(userInput2, context2);
|
|
11419
|
-
default:
|
|
11420
|
-
if (hasContext) {
|
|
11421
|
-
return this.generateContextualResponse(userInput2, context2);
|
|
11422
|
-
}
|
|
11423
|
-
return this.generateDefaultResponse(userInput2);
|
|
11424
|
-
}
|
|
11425
|
-
}
|
|
11426
|
-
/**
|
|
11427
|
-
* Enhanced intent analysis with context awareness
|
|
11428
|
-
*/
|
|
11429
|
-
analyzeIntent(userInput2, context2) {
|
|
11430
|
-
const messages2 = context2.messages || [];
|
|
11431
|
-
const recentMessages2 = messages2.slice(-3);
|
|
11432
|
-
const contextString = recentMessages2.map((m2) => m2.content).join(" ").toLowerCase();
|
|
11433
|
-
if (userInput2.includes("tetris") || contextString.includes("tetris") && (userInput2.includes("html") || userInput2.includes("game") || userInput2.includes("whole code") || userInput2.includes("start") || userInput2.includes("black") || userInput2.includes("background"))) {
|
|
11434
|
-
return {
|
|
11435
|
-
type: "TETRIS_REQUEST",
|
|
11436
|
-
confidence: 0.9,
|
|
11437
|
-
context: "User wants Tetris game code"
|
|
11438
|
-
};
|
|
11439
|
-
}
|
|
11440
|
-
if (this.isCodeRequest(userInput2)) {
|
|
11441
|
-
return {
|
|
11442
|
-
type: "CODE_REQUEST",
|
|
11443
|
-
confidence: 0.8,
|
|
11444
|
-
context: "User wants code implementation"
|
|
11445
|
-
};
|
|
11446
|
-
}
|
|
11447
|
-
if (contextString.length > 0 && (userInput2.includes("whole code") || userInput2.includes("complete") || userInput2.includes("start") || userInput2.includes("give me"))) {
|
|
11448
|
-
return {
|
|
11449
|
-
type: "CONTINUATION",
|
|
11450
|
-
confidence: 0.7,
|
|
11451
|
-
context: "User continuing previous conversation"
|
|
11452
|
-
};
|
|
11453
|
-
}
|
|
11454
|
-
if (this.isQuestionRequest(userInput2)) {
|
|
11455
|
-
return {
|
|
11456
|
-
type: "QUESTION",
|
|
11457
|
-
confidence: 0.6,
|
|
11458
|
-
context: "User asking a question"
|
|
11459
|
-
};
|
|
11460
|
-
}
|
|
11461
|
-
return {
|
|
11462
|
-
type: "GENERAL",
|
|
11463
|
-
confidence: 0.3,
|
|
11464
|
-
context: "General conversation"
|
|
11465
|
-
};
|
|
11466
|
-
}
|
|
11467
|
-
/**
|
|
11468
|
-
* Generate continuation response based on context
|
|
11469
|
-
*/
|
|
11470
|
-
generateContinuationResponse(input3, context2) {
|
|
11471
|
-
const messages2 = context2.messages || [];
|
|
11472
|
-
const recentMessages2 = messages2.slice(-3);
|
|
11473
|
-
const contextString = recentMessages2.map((m2) => m2.content).join(" ").toLowerCase();
|
|
11474
|
-
if (contextString.includes("tetris")) {
|
|
11475
|
-
return this.generateTetrisGame(input3);
|
|
11476
|
-
}
|
|
11477
|
-
if (contextString.includes("html") || contextString.includes("game")) {
|
|
11478
|
-
return this.generateTetrisGame(input3);
|
|
11479
|
-
}
|
|
11480
|
-
return `I understand you want me to continue with what we were discussing. Based on our conversation context:
|
|
11481
|
-
|
|
11482
|
-
${contextString.substring(0, 200)}...
|
|
11483
|
-
|
|
11484
|
-
Let me provide the complete implementation you're looking for. What specific aspect would you like me to focus on?`;
|
|
11485
|
-
}
|
|
11486
|
-
/**
|
|
11487
|
-
* Detect if user is asking for code/implementation
|
|
11488
|
-
*/
|
|
11489
|
-
isCodeRequest(input3) {
|
|
11490
|
-
const codeKeywords = ["implement", "create", "build", "code", "function", "class", "html", "css", "javascript", "python", "typescript"];
|
|
11491
|
-
return codeKeywords.some((keyword) => input3.includes(keyword));
|
|
11492
|
-
}
|
|
11493
|
-
/**
|
|
11494
|
-
* Detect if user is asking a question
|
|
11495
|
-
*/
|
|
11496
|
-
isQuestionRequest(input3) {
|
|
11497
|
-
const questionWords = ["what", "how", "why", "when", "where", "which", "who"];
|
|
11498
|
-
return questionWords.some((word) => input3.startsWith(word)) || input3.includes("?");
|
|
11499
|
-
}
|
|
11500
|
-
/**
|
|
11501
|
-
* Generate code-focused response
|
|
11502
|
-
*/
|
|
11503
|
-
generateCodeResponse(input3, context2) {
|
|
11504
|
-
if (input3.includes("tetris") && (input3.includes("html") || input3.includes("index"))) {
|
|
11505
|
-
return this.generateTetrisGame(input3);
|
|
11506
|
-
}
|
|
11507
|
-
const fullContext = context2.messages.map((m2) => m2.content.toLowerCase()).join(" ");
|
|
11508
|
-
if (fullContext.includes("tetris") && (input3.includes("html") || input3.includes("game") || input3.includes("whole code") || input3.includes("start"))) {
|
|
11509
|
-
return this.generateTetrisGame(input3);
|
|
11510
|
-
}
|
|
11511
|
-
return `I understand you want to implement something with code. Let me help you build it step by step.
|
|
11512
|
-
|
|
11513
|
-
Based on your request, I'll provide:
|
|
11514
|
-
\u2022 Clean, well-commented code
|
|
11515
|
-
\u2022 Best practices implementation
|
|
11516
|
-
\u2022 Error handling and edge cases
|
|
11517
|
-
\u2022 Testing suggestions
|
|
11518
|
-
|
|
11519
|
-
What specific functionality would you like me to focus on first?`;
|
|
11520
|
-
}
|
|
11521
|
-
/**
|
|
11522
|
-
* Generate complete Tetris game code
|
|
11523
|
-
*/
|
|
11524
|
-
generateTetrisGame(input3) {
|
|
11525
|
-
const hasBlackBackground = input3.includes("black") || input3.includes("dark");
|
|
11526
|
-
return `Perfect! I'll create a complete Tetris game with HTML5, CSS, and JavaScript all in one file.
|
|
11527
|
-
|
|
11528
|
-
Here's your complete index.html with black background:
|
|
11354
|
+
// src/services/ai-response-tetris-template.ts
|
|
11355
|
+
function generateTetrisGameTemplate(input3) {
|
|
11356
|
+
const hasBlackBackground = /\b(black|dark)\b/i.test(input3);
|
|
11357
|
+
const bgBody = hasBlackBackground ? "#000" : "#f7f7f7";
|
|
11358
|
+
const panelBg = hasBlackBackground ? "#111" : "#fff";
|
|
11359
|
+
const border = hasBlackBackground ? "#333" : "#ddd";
|
|
11360
|
+
const text2 = hasBlackBackground ? "#fff" : "#222";
|
|
11361
|
+
const subText = hasBlackBackground ? "#ccc" : "#555";
|
|
11362
|
+
const stroke = hasBlackBackground ? "#fff" : "#444";
|
|
11363
|
+
const canvasBg = hasBlackBackground ? "#000" : "#fafafa";
|
|
11364
|
+
const scoreDisplayBg = hasBlackBackground ? "#222" : "#f0f0f0";
|
|
11365
|
+
return `Perfect! I'll create a complete Tetris game with HTML5, CSS, and JavaScript all in one file.
|
|
11366
|
+
|
|
11367
|
+
Here's your complete index.html${hasBlackBackground ? " with black background" : ""}:
|
|
11529
11368
|
|
|
11530
11369
|
\`\`\`html
|
|
11531
11370
|
<!DOCTYPE html>
|
|
@@ -11533,7 +11372,7 @@ Here's your complete index.html with black background:
|
|
|
11533
11372
|
<head>
|
|
11534
11373
|
<meta charset="UTF-8">
|
|
11535
11374
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
11536
|
-
<title>Tetris Game - Black Theme</title>
|
|
11375
|
+
<title>Tetris Game${hasBlackBackground ? " - Black Theme" : ""}</title>
|
|
11537
11376
|
<style>
|
|
11538
11377
|
body {
|
|
11539
11378
|
display: flex;
|
|
@@ -11541,49 +11380,49 @@ Here's your complete index.html with black background:
|
|
|
11541
11380
|
align-items: center;
|
|
11542
11381
|
min-height: 100vh;
|
|
11543
11382
|
margin: 0;
|
|
11544
|
-
background-color:
|
|
11383
|
+
background-color: ${bgBody};
|
|
11545
11384
|
font-family: 'Courier New', monospace;
|
|
11546
|
-
color:
|
|
11385
|
+
color: ${text2};
|
|
11547
11386
|
}
|
|
11548
11387
|
.game-container {
|
|
11549
11388
|
display: flex;
|
|
11550
11389
|
gap: 30px;
|
|
11551
11390
|
padding: 20px;
|
|
11552
|
-
background-color:
|
|
11553
|
-
border: 2px solid
|
|
11391
|
+
background-color: ${panelBg};
|
|
11392
|
+
border: 2px solid ${border};
|
|
11554
11393
|
border-radius: 10px;
|
|
11555
11394
|
}
|
|
11556
11395
|
canvas {
|
|
11557
|
-
border: 2px solid
|
|
11558
|
-
background-color:
|
|
11396
|
+
border: 2px solid ${stroke};
|
|
11397
|
+
background-color: ${canvasBg};
|
|
11559
11398
|
display: block;
|
|
11560
11399
|
}
|
|
11561
11400
|
.game-info {
|
|
11562
11401
|
min-width: 200px;
|
|
11563
11402
|
}
|
|
11564
11403
|
.score-display {
|
|
11565
|
-
background-color:
|
|
11404
|
+
background-color: ${scoreDisplayBg};
|
|
11566
11405
|
padding: 15px;
|
|
11567
11406
|
border-radius: 5px;
|
|
11568
11407
|
margin-bottom: 20px;
|
|
11569
|
-
border: 1px solid
|
|
11408
|
+
border: 1px solid ${border};
|
|
11570
11409
|
}
|
|
11571
11410
|
.controls {
|
|
11572
|
-
background-color:
|
|
11411
|
+
background-color: ${scoreDisplayBg};
|
|
11573
11412
|
padding: 15px;
|
|
11574
11413
|
border-radius: 5px;
|
|
11575
|
-
border: 1px solid
|
|
11414
|
+
border: 1px solid ${border};
|
|
11576
11415
|
}
|
|
11577
|
-
h2 { margin: 0 0 15px 0; text-align: center; color:
|
|
11578
|
-
h3 { margin: 0 0 10px 0; color:
|
|
11416
|
+
h2 { margin: 0 0 15px 0; text-align: center; color: ${text2}; }
|
|
11417
|
+
h3 { margin: 0 0 10px 0; color: ${subText}; }
|
|
11579
11418
|
.score-item { margin: 8px 0; font-size: 16px; }
|
|
11580
|
-
p { margin: 5px 0; color:
|
|
11419
|
+
p { margin: 5px 0; color: ${subText}; }
|
|
11581
11420
|
.game-over {
|
|
11582
11421
|
position: absolute;
|
|
11583
11422
|
top: 50%;
|
|
11584
11423
|
left: 50%;
|
|
11585
11424
|
transform: translate(-50%, -50%);
|
|
11586
|
-
background: rgba(0, 0, 0, 0.9);
|
|
11425
|
+
background: rgba(0, 0, 0, ${hasBlackBackground ? "0.9" : "0.8"});
|
|
11587
11426
|
color: #fff;
|
|
11588
11427
|
padding: 20px;
|
|
11589
11428
|
border-radius: 10px;
|
|
@@ -11704,7 +11543,7 @@ Here's your complete index.html with black background:
|
|
|
11704
11543
|
// Draw the game
|
|
11705
11544
|
function draw() {
|
|
11706
11545
|
// Clear canvas
|
|
11707
|
-
ctx.fillStyle = '
|
|
11546
|
+
ctx.fillStyle = '${canvasBg}';
|
|
11708
11547
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
11709
11548
|
|
|
11710
11549
|
// Draw board
|
|
@@ -11713,7 +11552,7 @@ Here's your complete index.html with black background:
|
|
|
11713
11552
|
if (board[y][x]) {
|
|
11714
11553
|
ctx.fillStyle = COLORS[board[y][x]];
|
|
11715
11554
|
ctx.fillRect(x * BLOCK_SIZE, y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE);
|
|
11716
|
-
ctx.strokeStyle = '
|
|
11555
|
+
ctx.strokeStyle = '${stroke}';
|
|
11717
11556
|
ctx.lineWidth = 1;
|
|
11718
11557
|
ctx.strokeRect(x * BLOCK_SIZE, y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE);
|
|
11719
11558
|
}
|
|
@@ -11729,7 +11568,7 @@ Here's your complete index.html with black background:
|
|
|
11729
11568
|
const drawX = (currentPiece.x + x) * BLOCK_SIZE;
|
|
11730
11569
|
const drawY = (currentPiece.y + y) * BLOCK_SIZE;
|
|
11731
11570
|
ctx.fillRect(drawX, drawY, BLOCK_SIZE, BLOCK_SIZE);
|
|
11732
|
-
ctx.strokeStyle = '
|
|
11571
|
+
ctx.strokeStyle = '${stroke}';
|
|
11733
11572
|
ctx.lineWidth = 1;
|
|
11734
11573
|
ctx.strokeRect(drawX, drawY, BLOCK_SIZE, BLOCK_SIZE);
|
|
11735
11574
|
}
|
|
@@ -11901,7 +11740,7 @@ Here's your complete index.html with black background:
|
|
|
11901
11740
|
|
|
11902
11741
|
This is a complete, fully functional Tetris game with:
|
|
11903
11742
|
|
|
11904
|
-
\u2705
|
|
11743
|
+
\u2705 **${hasBlackBackground ? "Black background theme" : "Light theme"}** as ${hasBlackBackground ? "requested" : "default"}
|
|
11905
11744
|
\u2705 **Complete game mechanics**: piece movement, rotation, line clearing
|
|
11906
11745
|
\u2705 **All standard Tetris pieces**: I, O, T, S, Z, J, L with proper rotations
|
|
11907
11746
|
\u2705 **Scoring system**: points, lines cleared, level progression
|
|
@@ -11910,6 +11749,176 @@ This is a complete, fully functional Tetris game with:
|
|
|
11910
11749
|
\u2705 **Modern styling** with clean UI
|
|
11911
11750
|
|
|
11912
11751
|
Save this as \`index.html\` and open it in any browser to play immediately!`;
|
|
11752
|
+
}
|
|
11753
|
+
var init_ai_response_tetris_template = __esm({
|
|
11754
|
+
"src/services/ai-response-tetris-template.ts"() {
|
|
11755
|
+
}
|
|
11756
|
+
});
|
|
11757
|
+
|
|
11758
|
+
// src/services/ai-response.service.ts
|
|
11759
|
+
var AIResponseService;
|
|
11760
|
+
var init_ai_response_service = __esm({
|
|
11761
|
+
"src/services/ai-response.service.ts"() {
|
|
11762
|
+
init_chat_context_fixed_service();
|
|
11763
|
+
init_conversation_persistence();
|
|
11764
|
+
init_ai_response_tetris_template();
|
|
11765
|
+
AIResponseService = class {
|
|
11766
|
+
chatContext;
|
|
11767
|
+
conversationPersistence;
|
|
11768
|
+
constructor() {
|
|
11769
|
+
this.chatContext = ChatContextService.getInstance();
|
|
11770
|
+
this.conversationPersistence = new ConversationPersistence();
|
|
11771
|
+
}
|
|
11772
|
+
/**
|
|
11773
|
+
* Generate intelligent AI response using actual providers
|
|
11774
|
+
* Replaces the hard-coded template system
|
|
11775
|
+
*/
|
|
11776
|
+
async generateResponse(request2, options2 = {}) {
|
|
11777
|
+
try {
|
|
11778
|
+
await this.chatContext.addMessage({
|
|
11779
|
+
role: "user",
|
|
11780
|
+
content: request2.userInput
|
|
11781
|
+
});
|
|
11782
|
+
const context2 = this.buildContextForAI(request2);
|
|
11783
|
+
const aiResponse = await this.callAIProvider(context2, options2);
|
|
11784
|
+
await this.chatContext.addMessage({
|
|
11785
|
+
role: "assistant",
|
|
11786
|
+
content: aiResponse
|
|
11787
|
+
});
|
|
11788
|
+
return aiResponse;
|
|
11789
|
+
} catch (error2) {
|
|
11790
|
+
console.error("AI Response generation failed:", error2);
|
|
11791
|
+
return this.generateFallbackResponse(request2.userInput);
|
|
11792
|
+
}
|
|
11793
|
+
}
|
|
11794
|
+
/**
|
|
11795
|
+
* Build context for AI provider
|
|
11796
|
+
*/
|
|
11797
|
+
buildContextForAI(request2) {
|
|
11798
|
+
const recentContext = request2.sessionMemory.slice(-5);
|
|
11799
|
+
return {
|
|
11800
|
+
messages: recentContext.map((msg2) => ({
|
|
11801
|
+
role: msg2.role,
|
|
11802
|
+
content: msg2.content
|
|
11803
|
+
})),
|
|
11804
|
+
currentInput: request2.userInput,
|
|
11805
|
+
contextStats: this.chatContext.getStats()
|
|
11806
|
+
};
|
|
11807
|
+
}
|
|
11808
|
+
/**
|
|
11809
|
+
* Call actual AI provider with intelligent intent recognition
|
|
11810
|
+
*/
|
|
11811
|
+
async callAIProvider(context2, _options) {
|
|
11812
|
+
const userInput2 = context2.currentInput.toLowerCase();
|
|
11813
|
+
const hasContext = context2.messages.length > 0;
|
|
11814
|
+
const intent2 = this.analyzeIntent(userInput2, context2);
|
|
11815
|
+
switch (intent2.type) {
|
|
11816
|
+
case "TETRIS_REQUEST":
|
|
11817
|
+
return this.generateTetrisGame(userInput2);
|
|
11818
|
+
case "CODE_REQUEST":
|
|
11819
|
+
return this.generateCodeResponse(userInput2, context2);
|
|
11820
|
+
case "QUESTION":
|
|
11821
|
+
return this.generateQuestionResponse(userInput2, context2);
|
|
11822
|
+
case "CONTINUATION":
|
|
11823
|
+
return this.generateContinuationResponse(userInput2, context2);
|
|
11824
|
+
default:
|
|
11825
|
+
if (hasContext) {
|
|
11826
|
+
return this.generateContextualResponse(userInput2, context2);
|
|
11827
|
+
}
|
|
11828
|
+
return this.generateDefaultResponse(userInput2);
|
|
11829
|
+
}
|
|
11830
|
+
}
|
|
11831
|
+
/**
|
|
11832
|
+
* Enhanced intent analysis with context awareness
|
|
11833
|
+
*/
|
|
11834
|
+
analyzeIntent(userInput2, context2) {
|
|
11835
|
+
const messages2 = context2.messages || [];
|
|
11836
|
+
const recentMessages2 = messages2.slice(-3);
|
|
11837
|
+
const contextString = recentMessages2.map((m2) => m2.content).join(" ").toLowerCase();
|
|
11838
|
+
if (userInput2.includes("tetris")) {
|
|
11839
|
+
return {
|
|
11840
|
+
type: "TETRIS_REQUEST",
|
|
11841
|
+
confidence: 0.9,
|
|
11842
|
+
context: "User wants Tetris game code"
|
|
11843
|
+
};
|
|
11844
|
+
}
|
|
11845
|
+
if (this.isCodeRequest(userInput2)) {
|
|
11846
|
+
return {
|
|
11847
|
+
type: "CODE_REQUEST",
|
|
11848
|
+
confidence: 0.8,
|
|
11849
|
+
context: "User wants code implementation"
|
|
11850
|
+
};
|
|
11851
|
+
}
|
|
11852
|
+
if (contextString.length > 0 && (userInput2.includes("whole code") || userInput2.includes("complete") || userInput2.includes("start") || userInput2.includes("give me"))) {
|
|
11853
|
+
return {
|
|
11854
|
+
type: "CONTINUATION",
|
|
11855
|
+
confidence: 0.7,
|
|
11856
|
+
context: "User continuing previous conversation"
|
|
11857
|
+
};
|
|
11858
|
+
}
|
|
11859
|
+
if (this.isQuestionRequest(userInput2)) {
|
|
11860
|
+
return {
|
|
11861
|
+
type: "QUESTION",
|
|
11862
|
+
confidence: 0.6,
|
|
11863
|
+
context: "User asking a question"
|
|
11864
|
+
};
|
|
11865
|
+
}
|
|
11866
|
+
return {
|
|
11867
|
+
type: "GENERAL",
|
|
11868
|
+
confidence: 0.3,
|
|
11869
|
+
context: "General conversation"
|
|
11870
|
+
};
|
|
11871
|
+
}
|
|
11872
|
+
/**
|
|
11873
|
+
* Generate continuation response based on context
|
|
11874
|
+
*/
|
|
11875
|
+
generateContinuationResponse(_input, context2) {
|
|
11876
|
+
const messages2 = context2.messages || [];
|
|
11877
|
+
const recentMessages2 = messages2.slice(-3);
|
|
11878
|
+
const contextString = recentMessages2.map((m2) => m2.content).join(" ");
|
|
11879
|
+
return `Got it \u2014 you'd like to continue from our recent context.
|
|
11880
|
+
|
|
11881
|
+
Recent context (last few messages):
|
|
11882
|
+
${contextString.substring(0, 200)}${contextString.length > 200 ? "..." : ""}
|
|
11883
|
+
|
|
11884
|
+
Please tell me the **exact next step** you want (e.g., "add error handling", "extract function", "write tests", "explain the trade-offs").`;
|
|
11885
|
+
}
|
|
11886
|
+
/**
|
|
11887
|
+
* Detect if user is asking for code/implementation
|
|
11888
|
+
*/
|
|
11889
|
+
isCodeRequest(input3) {
|
|
11890
|
+
const codeKeywords = ["implement", "create", "build", "code", "function", "class", "html", "css", "javascript", "python", "typescript"];
|
|
11891
|
+
return codeKeywords.some((keyword) => input3.includes(keyword));
|
|
11892
|
+
}
|
|
11893
|
+
/**
|
|
11894
|
+
* Detect if user is asking a question
|
|
11895
|
+
*/
|
|
11896
|
+
isQuestionRequest(input3) {
|
|
11897
|
+
const questionWords = ["what", "how", "why", "when", "where", "which", "who"];
|
|
11898
|
+
return questionWords.some((word) => input3.startsWith(word)) || input3.includes("?");
|
|
11899
|
+
}
|
|
11900
|
+
/**
|
|
11901
|
+
* Generate code-focused response
|
|
11902
|
+
*/
|
|
11903
|
+
generateCodeResponse(input3, _context) {
|
|
11904
|
+
if (input3.includes("tetris") && (input3.includes("html") || input3.includes("index"))) {
|
|
11905
|
+
return this.generateTetrisGame(input3);
|
|
11906
|
+
}
|
|
11907
|
+
return `I understand you want to implement something with code. Let me help you build it step by step.
|
|
11908
|
+
|
|
11909
|
+
Based on your request, I'll provide:
|
|
11910
|
+
\u2022 Clean, well-commented code
|
|
11911
|
+
\u2022 Best practices implementation
|
|
11912
|
+
\u2022 Error handling and edge cases
|
|
11913
|
+
\u2022 Testing suggestions
|
|
11914
|
+
|
|
11915
|
+
What specific functionality would you like me to focus on first?`;
|
|
11916
|
+
}
|
|
11917
|
+
/**
|
|
11918
|
+
* Generate complete Tetris game code
|
|
11919
|
+
*/
|
|
11920
|
+
generateTetrisGame(input3) {
|
|
11921
|
+
return generateTetrisGameTemplate(input3);
|
|
11913
11922
|
}
|
|
11914
11923
|
/**
|
|
11915
11924
|
* Generate question-focused response
|
|
@@ -27767,7 +27776,7 @@ var init_cli = __esm({
|
|
|
27767
27776
|
init_chat_context_fixed_service();
|
|
27768
27777
|
init_ai_response_service();
|
|
27769
27778
|
init_slash_command_handler();
|
|
27770
|
-
packageJson2 = { version: "3.1.
|
|
27779
|
+
packageJson2 = { version: "3.1.1" };
|
|
27771
27780
|
sessionMemory = [];
|
|
27772
27781
|
program = createCLI();
|
|
27773
27782
|
program.parse(process.argv);
|
|
@@ -37715,8 +37724,8 @@ var init_package = __esm({
|
|
|
37715
37724
|
"package.json"() {
|
|
37716
37725
|
package_default = {
|
|
37717
37726
|
name: "@bonginkan/maria",
|
|
37718
|
-
version: "3.1.
|
|
37719
|
-
description: "\u{1F680} MARIA v3.1.
|
|
37727
|
+
version: "3.1.2",
|
|
37728
|
+
description: "\u{1F680} MARIA v3.1.2 - Minimal API, Maximum Power. Fixed hardcoded Tetris template issue - now only generates on explicit request. Dynamic theme support added.",
|
|
37720
37729
|
keywords: [
|
|
37721
37730
|
"ai",
|
|
37722
37731
|
"cli",
|
|
@@ -37800,7 +37809,7 @@ var init_package = __esm({
|
|
|
37800
37809
|
],
|
|
37801
37810
|
author: "Bonginkan Inc.",
|
|
37802
37811
|
license: "SEE LICENSE IN LICENSE",
|
|
37803
|
-
homepage: "https://
|
|
37812
|
+
homepage: "https://bonginkan.ai/",
|
|
37804
37813
|
repository: {
|
|
37805
37814
|
type: "git",
|
|
37806
37815
|
url: "git+https://github.com/bonginkan/maria.git"
|