@nomad-e/bluma-cli 0.5.6 → 0.5.9
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/main.js +32 -11
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -15203,7 +15203,18 @@ ${r.failed.details}` : ""}`;
|
|
|
15203
15203
|
const { combinedDiff } = buildBatchDiffAndPaths(r.slots);
|
|
15204
15204
|
return combinedDiff;
|
|
15205
15205
|
}
|
|
15206
|
-
|
|
15206
|
+
function validateFileReadBeforeEdit(normalizedFilePath, readFileState) {
|
|
15207
|
+
const readTimestamp = readFileState.get(normalizedFilePath);
|
|
15208
|
+
if (!readTimestamp || readTimestamp.isPartialView) {
|
|
15209
|
+
return {
|
|
15210
|
+
valid: false,
|
|
15211
|
+
message: "File has not been read yet. Read it first before writing to it.",
|
|
15212
|
+
errorCode: 6
|
|
15213
|
+
};
|
|
15214
|
+
}
|
|
15215
|
+
return { valid: true };
|
|
15216
|
+
}
|
|
15217
|
+
async function editTool(args, readFileState) {
|
|
15207
15218
|
try {
|
|
15208
15219
|
if (Array.isArray(args.edits) && args.edits.length > 0) {
|
|
15209
15220
|
return await runEditBatch(args.edits);
|
|
@@ -15244,6 +15255,17 @@ async function editTool(args) {
|
|
|
15244
15255
|
file_path: normalizedFilePath
|
|
15245
15256
|
};
|
|
15246
15257
|
}
|
|
15258
|
+
if (readFileState) {
|
|
15259
|
+
const readValidation = validateFileReadBeforeEdit(normalizedFilePath, readFileState);
|
|
15260
|
+
if (!readValidation.valid) {
|
|
15261
|
+
return {
|
|
15262
|
+
success: false,
|
|
15263
|
+
error: readValidation.message,
|
|
15264
|
+
file_path: normalizedFilePath,
|
|
15265
|
+
details: `Edit blocked: ${readValidation.message}`
|
|
15266
|
+
};
|
|
15267
|
+
}
|
|
15268
|
+
}
|
|
15247
15269
|
const editData = await calculateEdit(
|
|
15248
15270
|
normalizedFilePath,
|
|
15249
15271
|
old_string,
|
|
@@ -20845,7 +20867,7 @@ var NATIVE_TOOL_ENTRIES = [
|
|
|
20845
20867
|
riskLevel: "write",
|
|
20846
20868
|
autoApproveInLocal: false,
|
|
20847
20869
|
autoApproveInSandbox: true,
|
|
20848
|
-
description: "Edit or create files in the workspace."
|
|
20870
|
+
description: "Edit or create files in the workspace. IMPORTANT: You MUST read the file first using read_file_lines tool before attempting to edit it. Editing a file without reading it first will result in an error."
|
|
20849
20871
|
},
|
|
20850
20872
|
implementation: editTool
|
|
20851
20873
|
},
|
|
@@ -24484,7 +24506,7 @@ When addressing {username}: normalize handles (hyphens/underscores/dots \u2192 s
|
|
|
24484
24506
|
}
|
|
24485
24507
|
var SYSTEM_PROMPT = `
|
|
24486
24508
|
<identity>
|
|
24487
|
-
BluMa \u2014 NomadEngenuity CLI coding agent. You are an
|
|
24509
|
+
BluMa \u2014 NomadEngenuity autonomous CLI coding agent. You are an expert software engineer operating autonomously. You execute software engineering tasks end-to-end: build, fix, refactor, test, and maintain codebases with high precision and zero conversational filler. You do not assist \u2014 you act.
|
|
24488
24510
|
</identity>
|
|
24489
24511
|
|
|
24490
24512
|
<output_efficiency>
|
|
@@ -24502,14 +24524,13 @@ All **orchestrator instructions** (this prompt, injected system notes, tool sche
|
|
|
24502
24524
|
</language_policy>
|
|
24503
24525
|
|
|
24504
24526
|
<how_you_work>
|
|
24505
|
-
- **Read Before Editing:** Always
|
|
24506
|
-
- **Minimalism:** Keep changes surgical.
|
|
24507
|
-
- **
|
|
24508
|
-
- **
|
|
24509
|
-
- **
|
|
24510
|
-
- **
|
|
24511
|
-
- **
|
|
24512
|
-
- **Batch Operations:** Maximize efficiency by batching multiple \`edit_tool\` replacements in a single call.
|
|
24527
|
+
- **Read Before Editing:** Always read relevant files before changing them (\`read_file_lines\`). Never propose changes to unread code.
|
|
24528
|
+
- **Minimalism:** Keep changes surgical. Prefer editing existing files over creating new ones. Add nothing beyond what the task requires.
|
|
24529
|
+
- **Act, Don't Ask:** Proceed on your best judgment. Only use \`ask_user_question\` when the task goal itself is ambiguous, or an action is irreversible and destructive. Never ask for permission to read, search, or run tests.
|
|
24530
|
+
- **Engineering Mindset:** Ground every conclusion in real tool output. Never guess or assume state.
|
|
24531
|
+
- **Fail \u2192 Diagnose \u2192 Fix \u2192 Retry:** When a command or test fails, diagnose root cause, apply a fix, and re-run \u2014 autonomously. Do not report a failure without first attempting to resolve it.
|
|
24532
|
+
- **Validation is Mandatory:** A task is only complete when verified by tool output (tests pass, build succeeds, exit_code 0). Never claim success without proof.
|
|
24533
|
+
- **Batch Operations:** Batch multiple \`edit_tool\` replacements in a single call when possible.
|
|
24513
24534
|
- **Courage to Reverse:** If a path is wrong, stop immediately, explain briefly, and revert.
|
|
24514
24535
|
</how_you_work>
|
|
24515
24536
|
|