@nomad-e/bluma-cli 0.5.5 → 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 +39 -14
- package/package.json +2 -1
package/dist/main.js
CHANGED
|
@@ -3038,7 +3038,7 @@ function stopCapturingEarlyInput() {
|
|
|
3038
3038
|
}
|
|
3039
3039
|
|
|
3040
3040
|
// src/utils/execFileNoThrow.ts
|
|
3041
|
-
import execa2 from "execa";
|
|
3041
|
+
import { execa as execa2 } from "execa";
|
|
3042
3042
|
|
|
3043
3043
|
// src/utils/cwd.ts
|
|
3044
3044
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -3055,7 +3055,7 @@ function getCwd() {
|
|
|
3055
3055
|
}
|
|
3056
3056
|
|
|
3057
3057
|
// src/utils/execFileNoThrowPortable.ts
|
|
3058
|
-
import execa from "execa";
|
|
3058
|
+
import { execa } from "execa";
|
|
3059
3059
|
|
|
3060
3060
|
// src/utils/execFileNoThrow.ts
|
|
3061
3061
|
var MS_IN_SECOND = 1e3;
|
|
@@ -7354,7 +7354,7 @@ function isRunningWithBun() {
|
|
|
7354
7354
|
}
|
|
7355
7355
|
|
|
7356
7356
|
// src/utils/which.ts
|
|
7357
|
-
import execa3 from "execa";
|
|
7357
|
+
import { execa as execa3 } from "execa";
|
|
7358
7358
|
|
|
7359
7359
|
// src/utils/execSyncWrapper.ts
|
|
7360
7360
|
import {
|
|
@@ -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
|
|
|
@@ -42994,6 +43015,10 @@ function startBackgroundAgent() {
|
|
|
42994
43015
|
console.log(sessionId);
|
|
42995
43016
|
}
|
|
42996
43017
|
var argv = process.argv.slice(2);
|
|
43018
|
+
if (argv.includes("--version") || argv.includes("-v")) {
|
|
43019
|
+
console.log(readCliPackageVersion());
|
|
43020
|
+
process.exit(0);
|
|
43021
|
+
}
|
|
42997
43022
|
if (argv[0] === "agent" && argv.includes("--background")) {
|
|
42998
43023
|
startBackgroundAgent();
|
|
42999
43024
|
} else if (argv[0] === "agent") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomad-e/bluma-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "BluMa independent agent for automation and advanced software engineering.",
|
|
5
5
|
"author": "Alex Fonseca",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"test:watch": "jest --watch",
|
|
54
54
|
"test:parallel": "node scripts/test-parallel.js",
|
|
55
55
|
"test:parallel:fast": "TEST_WORKERS=8 node scripts/test-parallel.js",
|
|
56
|
+
"test:pack": "node scripts/test-pack.js",
|
|
56
57
|
"lint": "eslint src --ext .ts,.tsx",
|
|
57
58
|
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
58
59
|
"prepack": "npm run build",
|