@bonginkan/maria 4.3.39 → 4.3.41
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 +9 -4
- package/dist/READY.manifest.json +1 -1
- package/dist/bin/maria.cjs +225 -95
- package/dist/bin/maria.cjs.map +1 -1
- package/dist/cli.cjs +225 -95
- package/dist/cli.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server/express-server.cjs +1 -1
- package/dist/server/express-server.js +1 -1
- package/dist/server-express.cjs +1 -1
- package/dist/server-express.cjs.map +1 -1
- package/package.json +2 -2
- package/src/slash-commands/READY.manifest.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MARIA - AI Development Platform v4.3.
|
|
1
|
+
# MARIA - AI Development Platform v4.3.41
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@bonginkan/maria)
|
|
4
4
|
[](LICENSE)
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
> **Enterprise-grade AI development platform with 100% command availability and comprehensive fallback support**
|
|
12
12
|
|
|
13
|
-
## 🚀 What's New in v4.3.
|
|
13
|
+
## 🚀 What's New in v4.3.41 (October, 2025)
|
|
14
|
+
|
|
15
|
+
### Functinal enhancements
|
|
16
|
+
- **Enhanced Natural Language Support**: Main commands called automatically by natural language input
|
|
17
|
+
- **Research and novel**: Research and novel generation now fully functional
|
|
18
|
+
- **Improved coding**
|
|
14
19
|
|
|
15
20
|
### 🎯 Interactive Improvements & Choice Memory
|
|
16
21
|
- **Choice Memory System**: Smart persistence of user selections across sessions
|
|
@@ -922,7 +927,7 @@ await secureWorkflow.executeWithAuth(workflowDefinition, securityContext);
|
|
|
922
927
|
### Quick Installation
|
|
923
928
|
```bash
|
|
924
929
|
# Install globally (recommended)
|
|
925
|
-
npm install -g @bonginkan/maria@4.3.
|
|
930
|
+
npm install -g @bonginkan/maria@4.3.41
|
|
926
931
|
|
|
927
932
|
# Verify installation
|
|
928
933
|
maria --version # Should show v4.3.9
|
|
@@ -1126,7 +1131,7 @@ MARIA CODE is distributed under a comprehensive licensing system designed for in
|
|
|
1126
1131
|
|
|
1127
1132
|
*MARIA v4.1.4 represents the pinnacle of multimodal AI development platform evolution - combining revolutionary voice-to-code capabilities, advanced memory systems, and comprehensive command ecosystems with enterprise-grade security and performance. This release establishes MARIA as the definitive choice for developers and Fortune 500 enterprises seeking intelligent, multimodal development experiences with GraphRAG intelligence, multilingual support, and zero-anxiety coding workflows.*
|
|
1128
1133
|
|
|
1129
|
-
**Transform your development experience today**: `npm install -g @bonginkan/maria@4.3.
|
|
1134
|
+
**Transform your development experience today**: `npm install -g @bonginkan/maria@4.3.41`
|
|
1130
1135
|
|
|
1131
1136
|
🌐 **Official Website**: [https://maria-code.ai](https://maria-code.ai)
|
|
1132
1137
|
💬 **Community**: [https://discord.gg/SMSmSGcEQy](https://discord.gg/SMSmSGcEQy)
|
package/dist/READY.manifest.json
CHANGED
package/dist/bin/maria.cjs
CHANGED
|
@@ -26066,8 +26066,8 @@ var require_package = __commonJS({
|
|
|
26066
26066
|
"package.json"(exports, module) {
|
|
26067
26067
|
module.exports = {
|
|
26068
26068
|
name: "@bonginkan/maria",
|
|
26069
|
-
version: "4.3.
|
|
26070
|
-
description: "\u{1F680} MARIA v4.3.
|
|
26069
|
+
version: "4.3.41",
|
|
26070
|
+
description: "\u{1F680} MARIA v4.3.41 - 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.",
|
|
26071
26071
|
keywords: [
|
|
26072
26072
|
"ai",
|
|
26073
26073
|
"cli",
|
|
@@ -28104,7 +28104,7 @@ var init_AuthenticationManager = __esm({
|
|
|
28104
28104
|
const response = await fetch(`${this.apiBase}/api/user/profile`, {
|
|
28105
28105
|
headers: {
|
|
28106
28106
|
"Authorization": `Bearer ${tokens2.accessToken}`,
|
|
28107
|
-
"User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.
|
|
28107
|
+
"User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.41"}`
|
|
28108
28108
|
}
|
|
28109
28109
|
});
|
|
28110
28110
|
if (response.status === 401) {
|
|
@@ -28758,7 +28758,7 @@ async function callApi(path65, init3 = {}) {
|
|
|
28758
28758
|
"Authorization": `Bearer ${token}`,
|
|
28759
28759
|
"X-Device-Id": getDeviceId(),
|
|
28760
28760
|
"X-Session-Id": getSessionId() || "",
|
|
28761
|
-
"User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.
|
|
28761
|
+
"User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.41"}`,
|
|
28762
28762
|
"Content-Type": init3.headers?.["Content-Type"] || "application/json"
|
|
28763
28763
|
});
|
|
28764
28764
|
const doFetch = async (token) => {
|
|
@@ -51261,7 +51261,7 @@ var init_about_command = __esm({
|
|
|
51261
51261
|
async execute(args2, context2) {
|
|
51262
51262
|
const output3 = [];
|
|
51263
51263
|
output3.push("");
|
|
51264
|
-
output3.push(chalk14__default.default.cyan.bold("\u{1F916} About MARIA v4.3.
|
|
51264
|
+
output3.push(chalk14__default.default.cyan.bold("\u{1F916} About MARIA v4.3.41"));
|
|
51265
51265
|
output3.push(chalk14__default.default.gray("\u2550".repeat(40)));
|
|
51266
51266
|
output3.push("");
|
|
51267
51267
|
output3.push(chalk14__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
|
|
@@ -55955,20 +55955,6 @@ var init_policy = __esm({
|
|
|
55955
55955
|
}
|
|
55956
55956
|
});
|
|
55957
55957
|
|
|
55958
|
-
// src/utils/esm-compat.ts
|
|
55959
|
-
var esm_compat_exports = {};
|
|
55960
|
-
__export(esm_compat_exports, {
|
|
55961
|
-
loadGlobby: () => loadGlobby
|
|
55962
|
-
});
|
|
55963
|
-
async function loadGlobby() {
|
|
55964
|
-
const mod = await import('globby');
|
|
55965
|
-
return mod?.globby ?? mod?.default ?? mod;
|
|
55966
|
-
}
|
|
55967
|
-
var init_esm_compat = __esm({
|
|
55968
|
-
"src/utils/esm-compat.ts"() {
|
|
55969
|
-
}
|
|
55970
|
-
});
|
|
55971
|
-
|
|
55972
55958
|
// src/services/code-orchestrator/Orchestrator.ts
|
|
55973
55959
|
var Orchestrator_exports = {};
|
|
55974
55960
|
__export(Orchestrator_exports, {
|
|
@@ -56028,6 +56014,122 @@ function languageFromExt(ext2) {
|
|
|
56028
56014
|
if (e2 === "yaml" || e2 === "yml") return "yaml";
|
|
56029
56015
|
return void 0;
|
|
56030
56016
|
}
|
|
56017
|
+
async function readHeadTail(root, rel, n) {
|
|
56018
|
+
try {
|
|
56019
|
+
const fs52 = await import('fs/promises');
|
|
56020
|
+
const pathMod = await import('path');
|
|
56021
|
+
const full = pathMod.join(root, rel);
|
|
56022
|
+
const buf = await fs52.readFile(full, "utf8");
|
|
56023
|
+
const lines = buf.split(/\r?\n/);
|
|
56024
|
+
const head2 = lines.slice(0, n).join("\n");
|
|
56025
|
+
const tail = lines.slice(Math.max(0, lines.length - n)).join("\n");
|
|
56026
|
+
return { head: head2, tail };
|
|
56027
|
+
} catch {
|
|
56028
|
+
return { head: "", tail: "" };
|
|
56029
|
+
}
|
|
56030
|
+
}
|
|
56031
|
+
function extractJsonSafe(text, kind) {
|
|
56032
|
+
if (!text) return null;
|
|
56033
|
+
const fenceRegex = /```\s*(json)?\s*\r?\n([\s\S]*?)```/i;
|
|
56034
|
+
const fence = fenceRegex.exec(text);
|
|
56035
|
+
if (fence && fence[2]) text = fence[2];
|
|
56036
|
+
const match2 = kind === "object" ? text.match(/\{[\s\S]*\}/) : text.match(/\[[\s\S]*\]/);
|
|
56037
|
+
return match2 ? match2[0] : null;
|
|
56038
|
+
}
|
|
56039
|
+
async function llmSelectEditTargets(root, request, repoFiles) {
|
|
56040
|
+
try {
|
|
56041
|
+
const candidates = repoFiles.filter((p) => /\.(html|css|js|ts|tsx)$/i.test(p)).slice(0, 150);
|
|
56042
|
+
const samples = [];
|
|
56043
|
+
for (const p of candidates.slice(0, 60)) {
|
|
56044
|
+
const h2 = await readHeadTail(root, p, 5);
|
|
56045
|
+
samples.push(`- ${p}
|
|
56046
|
+
${h2.head}`);
|
|
56047
|
+
}
|
|
56048
|
+
const system = [
|
|
56049
|
+
"You select existing repository files that should be EDITED to satisfy a user request.",
|
|
56050
|
+
"Consider path names and the first lines. Return JSON array of repo-relative paths to edit.",
|
|
56051
|
+
"If none are relevant, return []. Do not invent paths."
|
|
56052
|
+
].join("\n");
|
|
56053
|
+
const user = [`Request: ${request}`, "Candidates:", samples.join("\n\n")].join("\n\n");
|
|
56054
|
+
const resp = await executeChat([
|
|
56055
|
+
{ role: "system", content: system },
|
|
56056
|
+
{ role: "user", content: user }
|
|
56057
|
+
]);
|
|
56058
|
+
const raw = (resp?.output || "").trim();
|
|
56059
|
+
const jsonText = (() => {
|
|
56060
|
+
try {
|
|
56061
|
+
const m2 = raw.match(/\[[\s\S]*\]/);
|
|
56062
|
+
return m2 ? m2[0] : raw;
|
|
56063
|
+
} catch {
|
|
56064
|
+
return raw;
|
|
56065
|
+
}
|
|
56066
|
+
})();
|
|
56067
|
+
const arr = JSON.parse(jsonText);
|
|
56068
|
+
const set = new Set(candidates.map((c) => c.toLowerCase()));
|
|
56069
|
+
const out = [];
|
|
56070
|
+
if (Array.isArray(arr)) {
|
|
56071
|
+
for (const v of arr) {
|
|
56072
|
+
if (typeof v === "string" && set.has(v.toLowerCase())) out.push(v);
|
|
56073
|
+
if (out.length >= 10) break;
|
|
56074
|
+
}
|
|
56075
|
+
}
|
|
56076
|
+
return out;
|
|
56077
|
+
} catch {
|
|
56078
|
+
return [];
|
|
56079
|
+
}
|
|
56080
|
+
}
|
|
56081
|
+
async function llmMapBlockToFile(root, request, block, repoFiles) {
|
|
56082
|
+
try {
|
|
56083
|
+
const lang = (block.language || "").toLowerCase();
|
|
56084
|
+
const extFilter = lang.includes("html") ? /\.html$/i : /(ts|tsx)/.test(lang) ? /\.(ts|tsx)$/i : /(js|jsx)/.test(lang) ? /\.(js|jsx)$/i : /\.css$/i;
|
|
56085
|
+
const candidates = repoFiles.filter((p) => extFilter.test(p)).slice(0, 80);
|
|
56086
|
+
const head2 = block.code.split(/\r?\n/).slice(0, 20).join("\n");
|
|
56087
|
+
const samples = [];
|
|
56088
|
+
for (const p of candidates.slice(0, 40)) {
|
|
56089
|
+
const h2 = await readHeadTail(root, p, 8);
|
|
56090
|
+
samples.push(`- ${p}
|
|
56091
|
+
${h2.head}`);
|
|
56092
|
+
}
|
|
56093
|
+
const system = [
|
|
56094
|
+
"Decide where to apply an EDIT vs CREATE for a code block within an existing repository.",
|
|
56095
|
+
'Return JSON: { "action": "modify"|"create", "path": string }.',
|
|
56096
|
+
"If modify, path must be one of the candidate repo-relative paths. If create, propose a sensible repo-relative path."
|
|
56097
|
+
].join("\n");
|
|
56098
|
+
const user = [
|
|
56099
|
+
`Request: ${request}`,
|
|
56100
|
+
"Block:",
|
|
56101
|
+
"```",
|
|
56102
|
+
head2,
|
|
56103
|
+
"```",
|
|
56104
|
+
"Candidates:",
|
|
56105
|
+
samples.join("\n\n")
|
|
56106
|
+
].join("\n");
|
|
56107
|
+
const resp = await executeChat([
|
|
56108
|
+
{ role: "system", content: system },
|
|
56109
|
+
{ role: "user", content: user }
|
|
56110
|
+
]);
|
|
56111
|
+
const raw = (resp?.output || "").trim();
|
|
56112
|
+
const jsonText = (() => {
|
|
56113
|
+
try {
|
|
56114
|
+
const m2 = raw.match(/\{[\s\S]*\}/);
|
|
56115
|
+
return m2 ? m2[0] : raw;
|
|
56116
|
+
} catch {
|
|
56117
|
+
return raw;
|
|
56118
|
+
}
|
|
56119
|
+
})();
|
|
56120
|
+
const parsed = JSON.parse(jsonText);
|
|
56121
|
+
if (parsed && (parsed.action === "modify" || parsed.action === "create") && typeof parsed.path === "string") {
|
|
56122
|
+
return { action: parsed.action, path: parsed.path.replace(/^\/+/, "") };
|
|
56123
|
+
}
|
|
56124
|
+
} catch {
|
|
56125
|
+
}
|
|
56126
|
+
const desired = typeof block.filename === "string" && block.filename.trim() ? block.filename.trim() : null;
|
|
56127
|
+
const fallback2 = desired || suggestName2(request, block.language, 0);
|
|
56128
|
+
return { action: "create", path: fallback2 };
|
|
56129
|
+
}
|
|
56130
|
+
function tokenizeRequest(text) {
|
|
56131
|
+
return Array.from(new Set(text.toLowerCase().replace(/[^a-z0-9_-]+/g, " ").split(/\s+/).filter((t2) => t2.length >= 3)));
|
|
56132
|
+
}
|
|
56031
56133
|
async function ensureCodeFallbackManager() {
|
|
56032
56134
|
const policy = await loadFallbackPolicy().catch(() => getDefaultFallbackPolicy());
|
|
56033
56135
|
const signature = JSON.stringify(policy);
|
|
@@ -56066,15 +56168,16 @@ async function orchestrate(request, opts) {
|
|
|
56066
56168
|
explicitAbsMap[rel] = pathMod.join(opts.root, rel);
|
|
56067
56169
|
}
|
|
56068
56170
|
}
|
|
56069
|
-
const isEditIntent = await
|
|
56070
|
-
|
|
56071
|
-
|
|
56171
|
+
const isEditIntent = await detectEditIntentLLM(opts.root, request, {
|
|
56172
|
+
explicitFiles,
|
|
56173
|
+
attachmentsCount: Array.isArray(opts.attachedFiles) ? opts.attachedFiles.length : 0
|
|
56174
|
+
});
|
|
56072
56175
|
let editTargets = explicitFiles;
|
|
56073
56176
|
if (isEditIntent && editTargets.length === 0) {
|
|
56074
56177
|
try {
|
|
56075
56178
|
const repoFiles = await getRepoFiles(opts.root);
|
|
56076
|
-
const
|
|
56077
|
-
editTargets =
|
|
56179
|
+
const llmTargets = await llmSelectEditTargets(opts.root, request, repoFiles);
|
|
56180
|
+
editTargets = llmTargets;
|
|
56078
56181
|
} catch {
|
|
56079
56182
|
}
|
|
56080
56183
|
}
|
|
@@ -56135,6 +56238,7 @@ ${editContext}`;
|
|
|
56135
56238
|
data_base64: f3.content ? Buffer.from(f3.content, "utf8").toString("base64") : void 0
|
|
56136
56239
|
})).map((a) => a.data_base64 ? a : { ...a, data_base64: void 0 }) : [];
|
|
56137
56240
|
const pathAttachments = [];
|
|
56241
|
+
const attachedPathSet = /* @__PURE__ */ new Set();
|
|
56138
56242
|
if (explicitFiles.length > 0) {
|
|
56139
56243
|
try {
|
|
56140
56244
|
const fs52 = await import('fs/promises');
|
|
@@ -56153,6 +56257,32 @@ ${editContext}`;
|
|
|
56153
56257
|
mime,
|
|
56154
56258
|
data_base64: buf.toString("base64")
|
|
56155
56259
|
});
|
|
56260
|
+
attachedPathSet.add(full.toLowerCase());
|
|
56261
|
+
} catch {
|
|
56262
|
+
}
|
|
56263
|
+
}
|
|
56264
|
+
} catch {
|
|
56265
|
+
}
|
|
56266
|
+
}
|
|
56267
|
+
if (isEditIntent && Array.isArray(editTargets) && editTargets.length > 0) {
|
|
56268
|
+
try {
|
|
56269
|
+
const fs52 = await import('fs/promises');
|
|
56270
|
+
const pathMod = await import('path');
|
|
56271
|
+
for (const rel of editTargets) {
|
|
56272
|
+
try {
|
|
56273
|
+
const full = pathMod.isAbsolute(rel) ? rel : pathMod.join(opts.root, rel);
|
|
56274
|
+
const key = full.toLowerCase();
|
|
56275
|
+
if (attachedPathSet.has(key)) continue;
|
|
56276
|
+
const stat13 = await fs52.stat(full).catch(() => null);
|
|
56277
|
+
if (!stat13 || !stat13.isFile()) continue;
|
|
56278
|
+
const buf = await fs52.readFile(full);
|
|
56279
|
+
pathAttachments.push({
|
|
56280
|
+
name: pathMod.basename(full),
|
|
56281
|
+
path: full,
|
|
56282
|
+
mime: "text/plain",
|
|
56283
|
+
data_base64: buf.toString("base64")
|
|
56284
|
+
});
|
|
56285
|
+
attachedPathSet.add(key);
|
|
56156
56286
|
} catch {
|
|
56157
56287
|
}
|
|
56158
56288
|
}
|
|
@@ -56257,21 +56387,31 @@ ${editContext}`;
|
|
|
56257
56387
|
return m2 >= 0 ? f3.slice(m2) : "";
|
|
56258
56388
|
})();
|
|
56259
56389
|
const lang = languageFromExt(ext2);
|
|
56260
|
-
|
|
56390
|
+
const strongMatch = /pong|retro|game|index\.(html)$|script\.(js|ts)$|style\.css/i.test(f3) || tokenizeRequest(request).some((t2) => f3.toLowerCase().includes(t2));
|
|
56391
|
+
if (strongMatch) {
|
|
56392
|
+
initial.push({ path: f3, absPath: absMap[f3], noNormalize: true, kind: "source", action: "modify", description: "Edit target", language: lang, preview: "" });
|
|
56393
|
+
}
|
|
56261
56394
|
}
|
|
56262
56395
|
} else {
|
|
56263
|
-
|
|
56264
|
-
const
|
|
56265
|
-
|
|
56266
|
-
|
|
56267
|
-
|
|
56268
|
-
path
|
|
56269
|
-
|
|
56270
|
-
|
|
56271
|
-
|
|
56272
|
-
|
|
56273
|
-
|
|
56274
|
-
|
|
56396
|
+
try {
|
|
56397
|
+
const repoFiles = await getRepoFiles(opts.root);
|
|
56398
|
+
for (let i2 = 0; i2 < blocks.length; i2++) {
|
|
56399
|
+
const b = blocks[i2];
|
|
56400
|
+
const decision = await llmMapBlockToFile(opts.root, request, b, repoFiles);
|
|
56401
|
+
if (decision.action === "modify" && repoFiles.includes(decision.path)) {
|
|
56402
|
+
const lang = languageFromExt(decision.path.replace(/^.*(\.[a-z0-9]+)$/i, "$1"));
|
|
56403
|
+
initial.push({ path: decision.path, kind: "source", action: "modify", description: "Modify existing file", language: lang, preview: b.code });
|
|
56404
|
+
} else {
|
|
56405
|
+
const path65 = decision.path || suggestName2(request, b.language, i2);
|
|
56406
|
+
initial.push({ path: path65, kind: "source", action: "create", description: describe2(b.language, ""), language: b.language, preview: b.code });
|
|
56407
|
+
}
|
|
56408
|
+
}
|
|
56409
|
+
} catch {
|
|
56410
|
+
for (let i2 = 0; i2 < blocks.length; i2++) {
|
|
56411
|
+
const b = blocks[i2];
|
|
56412
|
+
const path65 = suggestName2(request, b.language, i2);
|
|
56413
|
+
initial.push({ path: path65, kind: "source", action: "create", description: describe2(b.language, ""), language: b.language, preview: b.code });
|
|
56414
|
+
}
|
|
56275
56415
|
}
|
|
56276
56416
|
}
|
|
56277
56417
|
}
|
|
@@ -56311,6 +56451,9 @@ ${editContext}`;
|
|
|
56311
56451
|
} catch {
|
|
56312
56452
|
p.action = "create";
|
|
56313
56453
|
}
|
|
56454
|
+
if (p.action === "modify" && (!p.preview || p.preview.length === 0)) {
|
|
56455
|
+
p.action = "skip";
|
|
56456
|
+
}
|
|
56314
56457
|
}
|
|
56315
56458
|
} catch {
|
|
56316
56459
|
}
|
|
@@ -56387,7 +56530,7 @@ ${editContext}`;
|
|
|
56387
56530
|
}
|
|
56388
56531
|
}
|
|
56389
56532
|
const allowOverwrite = opts.flags.overwriteAllowed === true || !!opts.flags.yes || isEditIntent;
|
|
56390
|
-
const applyRes = await applyPlans(approved, { root: opts.root, overwriteAllowed: allowOverwrite, rollback: opts.flags.rollback !== false, signal: opts.abortSignal, onProgress: (
|
|
56533
|
+
const applyRes = await applyPlans(approved, { root: opts.root, overwriteAllowed: allowOverwrite, rollback: opts.flags.rollback !== false, signal: opts.abortSignal, onProgress: () => {
|
|
56391
56534
|
}, eol: profile.eol });
|
|
56392
56535
|
appliedCount = applyRes.appliedCount;
|
|
56393
56536
|
durationMs = applyRes.durationMs;
|
|
@@ -56667,73 +56810,50 @@ function parseExplicitFilenames(request) {
|
|
|
56667
56810
|
}
|
|
56668
56811
|
return out;
|
|
56669
56812
|
}
|
|
56670
|
-
function
|
|
56671
|
-
const r2 = request.toLowerCase();
|
|
56672
|
-
const editKeywords = ["modify", "edit", "update", "fix", "refactor", "change", "patch", "\u5DEE\u5206", "\u4FEE\u6B63", "\u5909\u66F4", "\u65E2\u5B58", "\u8FFD\u8A18"];
|
|
56673
|
-
const mentionsEdit = editKeywords.some((k) => r2.includes(k));
|
|
56674
|
-
return ctx2.hasAttachments || ctx2.explicitFilesCount > 0 || mentionsEdit;
|
|
56675
|
-
}
|
|
56676
|
-
async function detectEditIntentEnhanced(root, request, ctx2) {
|
|
56677
|
-
const baseline = detectEditIntent(request, { hasAttachments: ctx2.hasAttachments, explicitFilesCount: ctx2.explicitFiles.length });
|
|
56678
|
-
if (baseline) return true;
|
|
56679
|
-
const r2 = request.toLowerCase();
|
|
56680
|
-
const softHints = ["improve", "enhance", "make it", "change the", "adjust", "tweak", "rework", "revamp", "retro", "modernize", "clean up", "polish"];
|
|
56681
|
-
const hasSoftHint = softHints.some((k) => r2.includes(k));
|
|
56682
|
-
if (!hasSoftHint) return false;
|
|
56683
|
-
try {
|
|
56684
|
-
const fs52 = await import('fs/promises');
|
|
56685
|
-
const pathMod = await import('path');
|
|
56686
|
-
const { loadGlobby: loadGlobby2 } = await Promise.resolve().then(() => (init_esm_compat(), esm_compat_exports));
|
|
56687
|
-
const globby = await loadGlobby2();
|
|
56688
|
-
const ignore = [
|
|
56689
|
-
"**/node_modules/**",
|
|
56690
|
-
"**/.git/**",
|
|
56691
|
-
"**/dist/**",
|
|
56692
|
-
"**/build/**",
|
|
56693
|
-
"**/.maria/**",
|
|
56694
|
-
"**/.next/**",
|
|
56695
|
-
"**/coverage/**",
|
|
56696
|
-
"**/.DS_Store/**",
|
|
56697
|
-
"**/.DS_Store",
|
|
56698
|
-
"**/.Spotlight-V100/**",
|
|
56699
|
-
"**/.Spotlight-V100",
|
|
56700
|
-
"**/.Trashes/**",
|
|
56701
|
-
"**/.Trashes",
|
|
56702
|
-
"**/.fseventsd/**",
|
|
56703
|
-
"**/.fseventsd",
|
|
56704
|
-
"**/.TemporaryItems/**",
|
|
56705
|
-
"**/.TemporaryItems"
|
|
56706
|
-
];
|
|
56707
|
-
const candidates = await globby(["**/*.{html,css,js,ts,tsx}"], { cwd: root, absolute: true, gitignore: true, ignore, deep: 3 });
|
|
56708
|
-
if (candidates && candidates.length > 0) return true;
|
|
56709
|
-
} catch {
|
|
56710
|
-
}
|
|
56813
|
+
async function detectEditIntentLLM(root, request, ctx2) {
|
|
56711
56814
|
try {
|
|
56712
|
-
const
|
|
56713
|
-
|
|
56815
|
+
const repoFiles = await getRepoFiles(root);
|
|
56816
|
+
const candidates = repoFiles;
|
|
56817
|
+
const headSnippets = [];
|
|
56818
|
+
for (const p of candidates) {
|
|
56819
|
+
const h2 = await readHeadTail(root, p, 5);
|
|
56820
|
+
headSnippets.push(`- ${p}
|
|
56821
|
+
${h2.head}`);
|
|
56822
|
+
}
|
|
56714
56823
|
const system = [
|
|
56715
|
-
"
|
|
56716
|
-
|
|
56824
|
+
"Classify the user intent for the MARIA code orchestrator.",
|
|
56825
|
+
"Decide strictly between EDIT_EXISTING (modify existing files) or CREATE_NEW (generate new project/files).",
|
|
56826
|
+
"User is likely to have EDIT_EXITING intent when:",
|
|
56827
|
+
"- the coding language is not specified",
|
|
56828
|
+
"- it has a clear and/or relevant path of the file/directory exists",
|
|
56829
|
+
"- it has attachments",
|
|
56830
|
+
"- the wording implies modifying existing files (ex. fix, improve, update, change, patch, make it, clean up, etc.)",
|
|
56831
|
+
'Return JSON: { "intent": "EDIT_EXISTING" | "CREATE_NEW" } only. No commentary.'
|
|
56717
56832
|
].join("\n");
|
|
56718
|
-
const user =
|
|
56833
|
+
const user = [
|
|
56834
|
+
`Request: ${request}`,
|
|
56835
|
+
`ExplicitFiles: ${JSON.stringify(ctx2.explicitFiles || [])}`,
|
|
56836
|
+
`AttachmentsCount: ${ctx2.attachmentsCount}`,
|
|
56837
|
+
"Repo snapshot (paths with file heads):",
|
|
56838
|
+
headSnippets.join("\n\n")
|
|
56839
|
+
].join("\n\n");
|
|
56840
|
+
const spin1 = new ProcessAnimation();
|
|
56841
|
+
spin1.start();
|
|
56719
56842
|
const resp = await executeChat([
|
|
56720
56843
|
{ role: "system", content: system },
|
|
56721
56844
|
{ role: "user", content: user }
|
|
56722
56845
|
]);
|
|
56846
|
+
try {
|
|
56847
|
+
spin1.stop();
|
|
56848
|
+
} catch {
|
|
56849
|
+
}
|
|
56723
56850
|
const raw = (resp?.output || "").trim();
|
|
56724
|
-
const jsonText = (
|
|
56725
|
-
try {
|
|
56726
|
-
const m2 = raw.match(/\{[\s\S]*\}/);
|
|
56727
|
-
return m2 ? m2[0] : raw;
|
|
56728
|
-
} catch {
|
|
56729
|
-
return raw;
|
|
56730
|
-
}
|
|
56731
|
-
})();
|
|
56851
|
+
const jsonText = extractJsonSafe(raw, "object") || raw;
|
|
56732
56852
|
const parsed = JSON.parse(jsonText);
|
|
56733
|
-
|
|
56853
|
+
return parsed?.intent === "EDIT_EXISTING";
|
|
56734
56854
|
} catch {
|
|
56855
|
+
return ctx2.explicitFiles && ctx2.explicitFiles.length > 0 || ctx2.attachmentsCount > 0;
|
|
56735
56856
|
}
|
|
56736
|
-
return false;
|
|
56737
56857
|
}
|
|
56738
56858
|
function sanitizeFolderName(name2) {
|
|
56739
56859
|
const base = name2.toLowerCase().replace(/[`~!@#$%^&*()+=\[\]{}|;:'",<>/?\\]/g, " ").replace(/\s+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
|
|
@@ -56855,7 +56975,6 @@ async function resolveExplicitPaths(root, files, hintText) {
|
|
|
56855
56975
|
const lowerRel = normalized.toLowerCase();
|
|
56856
56976
|
const ext2 = (pathMod.extname(normalized) || "").toLowerCase();
|
|
56857
56977
|
const base = pathMod.basename(normalized);
|
|
56858
|
-
base.replace(/\.[^.]+$/, "").toLowerCase();
|
|
56859
56978
|
const parentPath = pathMod.dirname(normalized);
|
|
56860
56979
|
const parent = parentPath.split("/").pop() || "";
|
|
56861
56980
|
const dirParts = parentPath === "." ? [] : parentPath.split("/").filter(Boolean).map((s2) => s2.toLowerCase());
|
|
@@ -57016,6 +57135,7 @@ var init_Orchestrator = __esm({
|
|
|
57016
57135
|
init_AttachmentMapper();
|
|
57017
57136
|
init_FallbackManager();
|
|
57018
57137
|
init_policy();
|
|
57138
|
+
init_animations();
|
|
57019
57139
|
codeFallbackManager = null;
|
|
57020
57140
|
_repoFileIndexCache = null;
|
|
57021
57141
|
codeFallbackPolicySignature = null;
|
|
@@ -58267,6 +58387,16 @@ var init_resume_command = __esm({
|
|
|
58267
58387
|
}
|
|
58268
58388
|
});
|
|
58269
58389
|
|
|
58390
|
+
// src/utils/esm-compat.ts
|
|
58391
|
+
async function loadGlobby() {
|
|
58392
|
+
const mod = await import('globby');
|
|
58393
|
+
return mod?.globby ?? mod?.default ?? mod;
|
|
58394
|
+
}
|
|
58395
|
+
var init_esm_compat = __esm({
|
|
58396
|
+
"src/utils/esm-compat.ts"() {
|
|
58397
|
+
}
|
|
58398
|
+
});
|
|
58399
|
+
|
|
58270
58400
|
// src/services/init/scanner.ts
|
|
58271
58401
|
var scanner_exports = {};
|
|
58272
58402
|
__export(scanner_exports, {
|