@menteeai/menteeswe 0.1.16 → 0.1.18
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.js +104 -109
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -293,7 +293,7 @@ var init_testing = __esm({
|
|
|
293
293
|
DEFAULT_TIMEOUT_MS2 = 18e4;
|
|
294
294
|
runTests = makeRunnerTool({
|
|
295
295
|
name: "run_tests",
|
|
296
|
-
description: "Run the project test suite
|
|
296
|
+
description: "Run the project test suite (npm test/pytest/go test/cargo test auto-detected).",
|
|
297
297
|
detect: detectTestCommand,
|
|
298
298
|
fallbackHint: "No test runner found (looked for package.json scripts.test, pytest, go, cargo)."
|
|
299
299
|
});
|
|
@@ -311,7 +311,7 @@ var init_testing = __esm({
|
|
|
311
311
|
});
|
|
312
312
|
inspectEnv = {
|
|
313
313
|
name: "inspect_env",
|
|
314
|
-
description: "
|
|
314
|
+
description: "OS info + installed toolchain versions (node, npm, python, pip, git).",
|
|
315
315
|
risk: "safe",
|
|
316
316
|
parameters: { type: "object", properties: {} },
|
|
317
317
|
async execute(_args, ctx) {
|
|
@@ -426,7 +426,9 @@ function formatEvent(event) {
|
|
|
426
426
|
const output = typeof event.data?.output === "string" ? event.data.output.trim() : "";
|
|
427
427
|
const firstLine = (output.split("\n")[0] ?? event.message ?? "").slice(0, 160);
|
|
428
428
|
const color = success ? CATEGORY_COLOR[TOOL_CATEGORY[tool] ?? "other"] : chalk.red;
|
|
429
|
-
|
|
429
|
+
const resultChars = typeof event.data?.resultChars === "number" ? event.data.resultChars : 0;
|
|
430
|
+
const sizeNote = resultChars > 0 ? chalk.dim(` \xB7 ~${(resultChars / 4 / 1e3).toFixed(1)}k tok`) : "";
|
|
431
|
+
return color(` ${success ? "\u2713" : "\u2717"} ${firstLine}`) + sizeNote;
|
|
430
432
|
}
|
|
431
433
|
case "approval":
|
|
432
434
|
return chalk.magenta(`\u{1F510} Asking permission to use ${event.message ?? "tool"}...`);
|
|
@@ -639,58 +641,34 @@ function projectTree(cwd, prefix = "", depth = 0, maxDepth = 3) {
|
|
|
639
641
|
function buildSystemPrompt(cwd) {
|
|
640
642
|
const branch = gitBranch(cwd);
|
|
641
643
|
const tree = projectTree(cwd).trim() || "(empty)";
|
|
642
|
-
return `You are MenteE, an autonomous software-engineering agent working inside a repository on the user's machine.
|
|
643
|
-
|
|
644
|
-
# Your design philosophy
|
|
645
|
-
You are built around a tool harness: every meaningful action (reading, searching, editing, running, git) goes through a tool. Use the harness decisively and efficiently. Prefer precise tool calls over long prose so token usage stays very low while your engineering stays sharp and intelligent. A good session does more with fewer tokens \u2014 call exactly the tool needed, read only what you must, and let the harness do the heavy lifting.
|
|
644
|
+
return `You are MenteE, an autonomous software-engineering agent working inside a repository on the user's machine. You are built around a tool harness: act through tools, keep prose minimal, keep token usage low.
|
|
646
645
|
|
|
647
646
|
# Environment
|
|
648
647
|
- Workspace: ${cwd}
|
|
649
648
|
- Platform: ${os2.platform()} (${os2.release()}), shell commands run with the system shell
|
|
650
649
|
${branch ? `- Git branch: ${branch}` : "- Not a git repository"}
|
|
651
650
|
|
|
652
|
-
# Project file tree (
|
|
651
|
+
# Project file tree (already provided \u2014 do NOT re-read files just to learn structure)
|
|
653
652
|
${tree}
|
|
654
653
|
|
|
655
654
|
# How to work
|
|
656
|
-
1. UNDERSTAND before acting: use search_code to locate
|
|
657
|
-
2. MINIMAL CHANGES:
|
|
658
|
-
3. REALITY CHECK:
|
|
659
|
-
4. VERIFY: after modifying code, run the project's
|
|
660
|
-
5.
|
|
661
|
-
6.
|
|
662
|
-
7. FINISH PROPERLY: when the task is done and verified, stop calling tools and write a final answer (see Communication rules).
|
|
663
|
-
|
|
664
|
-
# Tool usage notes
|
|
665
|
-
- Call only the tools needed for the immediate next step. Do NOT read files you already understand, and do NOT read build/config files (e.g. *.config.ts, tsconfig.json) unless the task specifically needs them.
|
|
666
|
-
- Prefer search_code over reading many files.
|
|
667
|
-
- NEVER start long-running servers, dev servers, or watchers (e.g. 'npm run dev', 'npm start', 'vite', 'npm run watch', 'python -m http.server') yourself. These block and never exit. If the user needs to run the app, give them the exact command to run in their OWN terminal. Only run commands that exit on their own.
|
|
668
|
-
- If a task result requires running the app to verify, say so and provide the command \u2014 do not run it for them.
|
|
669
|
-
|
|
670
|
-
# Research strategy (IMPORTANT \u2014 HARD RULE)
|
|
671
|
-
- The file tree above already shows the whole structure. Do NOT read files just to "see what's there".
|
|
672
|
-
- Before reading anything, use search_code to locate the symbols and files that matter. Then read ONLY the 5-6 most important files as reference (README, package.json / pyproject, and the few source files directly relevant to the task). Do not open many files \u2014 search first, read selectively.
|
|
673
|
-
- For debugging or feature tasks, read only the files directly involved, then verify with tests. Never read the entire codebase.
|
|
674
|
-
|
|
675
|
-
# Editing notes
|
|
676
|
-
- Use read_file with start_line/end_line for files that may be large.
|
|
677
|
-
- Use apply_patch (exact unique snippet replacement) for edits; use write_file only for new files or complete rewrites you have fully read.
|
|
678
|
-
- Run tests with execute_command (e.g. "npm test", "pytest"). Safe read-only commands run automatically; installing packages or git history changes will ask the user for approval.
|
|
679
|
-
|
|
680
|
-
# Persistent memory
|
|
681
|
-
- Use the 'memory' tool to store important, reusable context so you don't re-derive it: project conventions, key file locations, design decisions, gotchas, API quirks. Example: after discovering "tests run with vitest and need a built dist", store it with topic "testing".
|
|
682
|
-
- At the start of a task, call 'memory' with action=search (or list) to recall prior findings for THIS project. Prefer recalled memory over re-reading files.
|
|
683
|
-
- This memory persists across sessions and is project-scoped; it never lives in the workspace.
|
|
655
|
+
1. UNDERSTAND before acting: use search_code to locate relevant files/symbols, then read only the 5-6 most important files as reference (line ranges for large files). Never modify a file you have not read. Do not open files just to "see what's there".
|
|
656
|
+
2. MINIMAL CHANGES: the smallest change that fulfils the task. Never refactor, reformat, or rename unrelated code.
|
|
657
|
+
3. REALITY CHECK: never invent APIs, packages, or paths \u2014 verify via search_code or package.json.
|
|
658
|
+
4. VERIFY: after modifying code, run the project's tests/build/typecheck. If a command fails, read the error, find the root cause, fix it. After 3 identical failures, change strategy.
|
|
659
|
+
5. STAY IN SCOPE: never read/modify/execute outside the workspace; never print secrets or credentials.
|
|
660
|
+
6. FINISH: when done and verified, stop calling tools and write the final answer.
|
|
684
661
|
|
|
685
|
-
#
|
|
686
|
-
-
|
|
687
|
-
-
|
|
688
|
-
-
|
|
689
|
-
-
|
|
690
|
-
- Never dump the whole repo structure or a file-by-file summary unless requested.
|
|
691
|
-
- If the user refers to something you said or did earlier ("that", "it", "before"), use the prior conversation context provided above.
|
|
662
|
+
# Tool notes
|
|
663
|
+
- Call only the tools the immediate step needs; skip build/config files unless required.
|
|
664
|
+
- NEVER start long-running servers or watchers (npm run dev, vite, python -m http.server, ...): they block. Give the user the command to run in their own terminal; only run commands that exit on their own.
|
|
665
|
+
- Use apply_patch for edits; write_file only for new files or full rewrites you have fully read.
|
|
666
|
+
- Use the memory tool to store/recall reusable project facts (conventions, test commands, gotchas) instead of re-deriving them.
|
|
692
667
|
|
|
693
|
-
|
|
668
|
+
# Communication
|
|
669
|
+
- Between tools: ONE short sentence on what and why. Low token usage is a core goal \u2014 be terse everywhere.
|
|
670
|
+
- FINAL answer: hard limit of 3 sentences, plain prose, no bullets/headings unless asked. State the outcome and the command used to verify. No preamble ("Sure", "Here are"), no repo inventories, no repeated tool output.
|
|
671
|
+
- If the user says "that", "it", or "earlier", they mean the prior conversation above.`;
|
|
694
672
|
}
|
|
695
673
|
var SKIP_DIRS;
|
|
696
674
|
var init_prompts = __esm({
|
|
@@ -753,7 +731,7 @@ function appendTurn(cwd, task, response) {
|
|
|
753
731
|
function formatConversationContext(cwd, limit = 10) {
|
|
754
732
|
const turns = loadConversation(cwd, limit);
|
|
755
733
|
if (turns.length === 0) return "";
|
|
756
|
-
const MAX_PRIOR_CHARS =
|
|
734
|
+
const MAX_PRIOR_CHARS = 3e3;
|
|
757
735
|
const header = "# Prior conversation in this project (most recent shown)";
|
|
758
736
|
const blocks = [];
|
|
759
737
|
let total = header.length;
|
|
@@ -893,7 +871,8 @@ async function runVerification(tools, ctx, bus, state, cwd) {
|
|
|
893
871
|
bus.emit("tool_completed", `verify \xB7 ${tool.name}`, {
|
|
894
872
|
tool: tool.name,
|
|
895
873
|
success: res.success,
|
|
896
|
-
output: res.output.slice(0, 2e3)
|
|
874
|
+
output: res.output.slice(0, 2e3),
|
|
875
|
+
resultChars: res.output.length
|
|
897
876
|
});
|
|
898
877
|
combined += `${tool.name}: ${res.output}
|
|
899
878
|
`;
|
|
@@ -936,6 +915,8 @@ ${systemExtra}` : "");
|
|
|
936
915
|
}
|
|
937
916
|
};
|
|
938
917
|
const messages = [{ role: "user", content: task }];
|
|
918
|
+
const readMsgIndex = /* @__PURE__ */ new Map();
|
|
919
|
+
const normalizeRel = (p) => p.replace(/\\/g, "/");
|
|
939
920
|
const setPhase = (p) => {
|
|
940
921
|
state.phase = p;
|
|
941
922
|
bus.emit("phase", p);
|
|
@@ -1033,7 +1014,7 @@ ${systemExtra}` : "");
|
|
|
1033
1014
|
messages.push({
|
|
1034
1015
|
role: "user",
|
|
1035
1016
|
content: `SYSTEM NOTE: Verification failed.
|
|
1036
|
-
${verdict.output}
|
|
1017
|
+
${verdict.output.slice(0, 2e3)}
|
|
1037
1018
|
Investigate the root cause, fix it, then finish with a final answer.`
|
|
1038
1019
|
});
|
|
1039
1020
|
sawFinish = false;
|
|
@@ -1128,7 +1109,8 @@ Investigate the root cause, fix it, then finish with a final answer.`
|
|
|
1128
1109
|
bus.emit("tool_completed", toolCallPreview(call), {
|
|
1129
1110
|
tool: tool.name,
|
|
1130
1111
|
success: result.success,
|
|
1131
|
-
output: result.output.slice(0, 2e3)
|
|
1112
|
+
output: result.output.slice(0, 2e3),
|
|
1113
|
+
resultChars: result.output.length
|
|
1132
1114
|
});
|
|
1133
1115
|
if (tool.name === "apply_patch" && result.success && result.data?.kind === "patch") {
|
|
1134
1116
|
bus.emit("patch", void 0, {
|
|
@@ -1137,19 +1119,40 @@ Investigate the root cause, fix it, then finish with a final answer.`
|
|
|
1137
1119
|
new_string: result.data.new_string
|
|
1138
1120
|
});
|
|
1139
1121
|
}
|
|
1122
|
+
const readHeader = result.success && tool.name === "read_file" ? result.output.split("\n")[0] ?? "" : "";
|
|
1123
|
+
const readRel = readHeader ? normalizeRel(readHeader.replace(/\s+\(\d+ lines\)\s*$/, "").trim()) : "";
|
|
1124
|
+
if (readRel) readMsgIndex.set(readRel, messages.length);
|
|
1125
|
+
if ((tool.name === "apply_patch" || tool.name === "write_file") && result.success) {
|
|
1126
|
+
const patchedRel = normalizeRel(
|
|
1127
|
+
typeof result.data?.path === "string" && result.data.path ? result.data.path : typeof args.path === "string" ? args.path : ""
|
|
1128
|
+
);
|
|
1129
|
+
const idx = patchedRel ? readMsgIndex.get(patchedRel) : void 0;
|
|
1130
|
+
if (idx !== void 0) {
|
|
1131
|
+
const old = messages[idx];
|
|
1132
|
+
if (old && old.role === "tool") {
|
|
1133
|
+
messages[idx] = {
|
|
1134
|
+
role: "tool",
|
|
1135
|
+
tool_call_id: old.tool_call_id ?? "elided",
|
|
1136
|
+
content: `\u27E8${patchedRel} was read earlier; its content is elided because it has since been modified. Re-read only if needed.\u27E9`
|
|
1137
|
+
};
|
|
1138
|
+
readMsgIndex.delete(patchedRel);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
const { text: historyOutput } = truncateOutput(result.output, MAX_RESULT_HISTORY_CHARS);
|
|
1140
1143
|
messages.push({
|
|
1141
1144
|
role: "tool",
|
|
1142
1145
|
tool_call_id: call.id,
|
|
1143
|
-
content:
|
|
1146
|
+
content: historyOutput
|
|
1144
1147
|
});
|
|
1145
1148
|
}
|
|
1146
1149
|
if (signal?.aborted) {
|
|
1147
1150
|
finalText = "Task cancelled.";
|
|
1148
1151
|
break;
|
|
1149
1152
|
}
|
|
1153
|
+
trimOldToolResults(messages);
|
|
1150
1154
|
if (estimateContextChars(messages, system) > MAX_CONTEXT_CHARS) {
|
|
1151
|
-
bus.emit("warning", "Context is large
|
|
1152
|
-
trimOldToolResults(messages);
|
|
1155
|
+
bus.emit("warning", "Context is still very large after trimming oldest tool outputs.");
|
|
1153
1156
|
}
|
|
1154
1157
|
}
|
|
1155
1158
|
if (!sawFinish && !finalText) {
|
|
@@ -1170,7 +1173,7 @@ Investigate the root cause, fix it, then finish with a final answer.`
|
|
|
1170
1173
|
});
|
|
1171
1174
|
return { success, finalText, state };
|
|
1172
1175
|
}
|
|
1173
|
-
var MAX_CONTEXT_CHARS, RATE_LIMIT_MAX_ATTEMPTS, MAX_VERIFY, EDIT_TOOLS, KEEP_RECENT_TOOL;
|
|
1176
|
+
var MAX_CONTEXT_CHARS, MAX_RESULT_HISTORY_CHARS, RATE_LIMIT_MAX_ATTEMPTS, MAX_VERIFY, EDIT_TOOLS, KEEP_RECENT_TOOL;
|
|
1174
1177
|
var init_loop = __esm({
|
|
1175
1178
|
"src/agent/loop.ts"() {
|
|
1176
1179
|
"use strict";
|
|
@@ -1179,11 +1182,12 @@ var init_loop = __esm({
|
|
|
1179
1182
|
init_state();
|
|
1180
1183
|
init_base();
|
|
1181
1184
|
init_testing();
|
|
1182
|
-
MAX_CONTEXT_CHARS =
|
|
1185
|
+
MAX_CONTEXT_CHARS = 4e4;
|
|
1186
|
+
MAX_RESULT_HISTORY_CHARS = 12e3;
|
|
1183
1187
|
RATE_LIMIT_MAX_ATTEMPTS = 8;
|
|
1184
1188
|
MAX_VERIFY = 3;
|
|
1185
1189
|
EDIT_TOOLS = /* @__PURE__ */ new Set(["apply_patch", "write_file", "move_path"]);
|
|
1186
|
-
KEEP_RECENT_TOOL =
|
|
1190
|
+
KEEP_RECENT_TOOL = 3;
|
|
1187
1191
|
}
|
|
1188
1192
|
});
|
|
1189
1193
|
|
|
@@ -1191,7 +1195,7 @@ var init_loop = __esm({
|
|
|
1191
1195
|
var version;
|
|
1192
1196
|
var init_package = __esm({
|
|
1193
1197
|
"package.json"() {
|
|
1194
|
-
version = "0.1.
|
|
1198
|
+
version = "0.1.18";
|
|
1195
1199
|
}
|
|
1196
1200
|
});
|
|
1197
1201
|
|
|
@@ -2379,19 +2383,13 @@ function relativeToWorkspace(cwd, target) {
|
|
|
2379
2383
|
}
|
|
2380
2384
|
var listFiles = {
|
|
2381
2385
|
name: "list_files",
|
|
2382
|
-
description: "List files
|
|
2386
|
+
description: "List files/dirs under a path (ignores node_modules etc.). The system prompt already contains a file tree.",
|
|
2383
2387
|
risk: "safe",
|
|
2384
2388
|
parameters: {
|
|
2385
2389
|
type: "object",
|
|
2386
2390
|
properties: {
|
|
2387
|
-
path: {
|
|
2388
|
-
|
|
2389
|
-
description: "Relative path inside the workspace. Defaults to the workspace root."
|
|
2390
|
-
},
|
|
2391
|
-
max_entries: {
|
|
2392
|
-
type: "number",
|
|
2393
|
-
description: "Maximum number of entries to return. Defaults to 500."
|
|
2394
|
-
}
|
|
2391
|
+
path: { type: "string", description: "Relative path (default root)." },
|
|
2392
|
+
max_entries: { type: "number", description: "Max entries (default 500)." }
|
|
2395
2393
|
}
|
|
2396
2394
|
},
|
|
2397
2395
|
async execute(args, ctx) {
|
|
@@ -2450,13 +2448,13 @@ var listFiles = {
|
|
|
2450
2448
|
};
|
|
2451
2449
|
var movePath = {
|
|
2452
2450
|
name: "move_path",
|
|
2453
|
-
description: "Move or rename a file
|
|
2451
|
+
description: "Move or rename a file/directory within the workspace. Requires user approval.",
|
|
2454
2452
|
risk: "restricted",
|
|
2455
2453
|
parameters: {
|
|
2456
2454
|
type: "object",
|
|
2457
2455
|
properties: {
|
|
2458
|
-
from: { type: "string", description: "Source path relative to
|
|
2459
|
-
to: { type: "string", description: "Destination path relative to
|
|
2456
|
+
from: { type: "string", description: "Source path (relative to root)." },
|
|
2457
|
+
to: { type: "string", description: "Destination path (relative to root)." }
|
|
2460
2458
|
},
|
|
2461
2459
|
required: ["from", "to"]
|
|
2462
2460
|
},
|
|
@@ -2479,14 +2477,14 @@ var movePath = {
|
|
|
2479
2477
|
};
|
|
2480
2478
|
var readFile = {
|
|
2481
2479
|
name: "read_file",
|
|
2482
|
-
description: "Read a file
|
|
2480
|
+
description: "Read a file (line-numbered), optionally a line range. Prefer ranges for large files.",
|
|
2483
2481
|
risk: "safe",
|
|
2484
2482
|
parameters: {
|
|
2485
2483
|
type: "object",
|
|
2486
2484
|
properties: {
|
|
2487
|
-
path: { type: "string", description: "
|
|
2488
|
-
start_line: { type: "number", description: "First line
|
|
2489
|
-
end_line: { type: "number", description: "Last line
|
|
2485
|
+
path: { type: "string", description: "Path relative to workspace root." },
|
|
2486
|
+
start_line: { type: "number", description: "First line (1-based)." },
|
|
2487
|
+
end_line: { type: "number", description: "Last line inclusive (default start+400)." }
|
|
2490
2488
|
},
|
|
2491
2489
|
required: ["path"]
|
|
2492
2490
|
},
|
|
@@ -2500,7 +2498,7 @@ var readFile = {
|
|
|
2500
2498
|
}
|
|
2501
2499
|
const lines = content.split(/\r?\n/);
|
|
2502
2500
|
const start = Math.max(1, firstNumber(args, "start_line") ?? 1);
|
|
2503
|
-
const defaultEnd = start +
|
|
2501
|
+
const defaultEnd = start + 400 - 1;
|
|
2504
2502
|
const end = Math.min(lines.length, firstNumber(args, "end_line") ?? defaultEnd);
|
|
2505
2503
|
if (start > lines.length) {
|
|
2506
2504
|
return {
|
|
@@ -2509,7 +2507,7 @@ var readFile = {
|
|
|
2509
2507
|
};
|
|
2510
2508
|
}
|
|
2511
2509
|
const slice = lines.slice(start - 1, end).map((line, i) => `${start + i}: ${line}`);
|
|
2512
|
-
const { text, truncated } = truncateOutput(slice.join("\n"),
|
|
2510
|
+
const { text, truncated } = truncateOutput(slice.join("\n"), 12e3);
|
|
2513
2511
|
const note = end < lines.length ? `
|
|
2514
2512
|
...[${lines.length - end} more lines. Use start_line=${end + 1} to continue reading.]` : "";
|
|
2515
2513
|
return {
|
|
@@ -2522,13 +2520,13 @@ ${text}${note}`,
|
|
|
2522
2520
|
};
|
|
2523
2521
|
var writeFile = {
|
|
2524
2522
|
name: "write_file",
|
|
2525
|
-
description: "Create
|
|
2523
|
+
description: "Create or fully overwrite a file. Prefer apply_patch for edits to existing files.",
|
|
2526
2524
|
risk: "safe",
|
|
2527
2525
|
parameters: {
|
|
2528
2526
|
type: "object",
|
|
2529
2527
|
properties: {
|
|
2530
|
-
path: { type: "string", description: "
|
|
2531
|
-
content: { type: "string", description: "
|
|
2528
|
+
path: { type: "string", description: "Path relative to workspace root." },
|
|
2529
|
+
content: { type: "string", description: "Full file content." }
|
|
2532
2530
|
},
|
|
2533
2531
|
required: ["path", "content"]
|
|
2534
2532
|
},
|
|
@@ -2545,14 +2543,14 @@ var writeFile = {
|
|
|
2545
2543
|
};
|
|
2546
2544
|
var applyPatch = {
|
|
2547
2545
|
name: "apply_patch",
|
|
2548
|
-
description: "
|
|
2546
|
+
description: "Replace an exact unique snippet in a file: old_string (must occur exactly once) becomes new_string. Preferred edit method.",
|
|
2549
2547
|
risk: "safe",
|
|
2550
2548
|
parameters: {
|
|
2551
2549
|
type: "object",
|
|
2552
2550
|
properties: {
|
|
2553
|
-
path: { type: "string", description: "
|
|
2554
|
-
old_string: { type: "string", description: "
|
|
2555
|
-
new_string: { type: "string", description: "
|
|
2551
|
+
path: { type: "string", description: "Path relative to workspace root." },
|
|
2552
|
+
old_string: { type: "string", description: "Exact text to replace, unique in file." },
|
|
2553
|
+
new_string: { type: "string", description: "Replacement text." }
|
|
2556
2554
|
},
|
|
2557
2555
|
required: ["path", "old_string", "new_string"]
|
|
2558
2556
|
},
|
|
@@ -2831,15 +2829,15 @@ function ripgrepAvailable() {
|
|
|
2831
2829
|
}
|
|
2832
2830
|
var searchCode = {
|
|
2833
2831
|
name: "search_code",
|
|
2834
|
-
description: "
|
|
2832
|
+
description: "Regex-search file contents workspace-wide; returns path:line:match. Cheaper than reading files.",
|
|
2835
2833
|
risk: "safe",
|
|
2836
2834
|
parameters: {
|
|
2837
2835
|
type: "object",
|
|
2838
2836
|
properties: {
|
|
2839
|
-
pattern: { type: "string", description: "Regex or literal text
|
|
2840
|
-
path: { type: "string", description: "Subdirectory
|
|
2841
|
-
glob: { type: "string", description: '
|
|
2842
|
-
max_results: { type: "number", description: "
|
|
2837
|
+
pattern: { type: "string", description: "Regex or literal text." },
|
|
2838
|
+
path: { type: "string", description: "Subdirectory (default root)." },
|
|
2839
|
+
glob: { type: "string", description: 'Glob filter, e.g. "*.ts".' },
|
|
2840
|
+
max_results: { type: "number", description: "Max matches (default 50)." }
|
|
2843
2841
|
},
|
|
2844
2842
|
required: ["pattern"]
|
|
2845
2843
|
},
|
|
@@ -2919,14 +2917,14 @@ ${text}`,
|
|
|
2919
2917
|
};
|
|
2920
2918
|
var searchFiles = {
|
|
2921
2919
|
name: "search_files",
|
|
2922
|
-
description: "Find files by name
|
|
2920
|
+
description: "Find files by name with * and ? wildcards.",
|
|
2923
2921
|
risk: "safe",
|
|
2924
2922
|
parameters: {
|
|
2925
2923
|
type: "object",
|
|
2926
2924
|
properties: {
|
|
2927
|
-
pattern: { type: "string", description: '
|
|
2928
|
-
path: { type: "string", description: "Subdirectory
|
|
2929
|
-
max_results: { type: "number", description: "
|
|
2925
|
+
pattern: { type: "string", description: 'Name pattern with wildcards, e.g. "*.test.ts".' },
|
|
2926
|
+
path: { type: "string", description: "Subdirectory (default root)." },
|
|
2927
|
+
max_results: { type: "number", description: "Max results (default 100)." }
|
|
2930
2928
|
},
|
|
2931
2929
|
required: ["pattern"]
|
|
2932
2930
|
},
|
|
@@ -3140,7 +3138,7 @@ var DEFAULT_TIMEOUT_MS = 12e4;
|
|
|
3140
3138
|
var MAX_OUTPUT_CHARS = 1e5;
|
|
3141
3139
|
var executeCommand = {
|
|
3142
3140
|
name: "execute_command",
|
|
3143
|
-
description: "
|
|
3141
|
+
description: "Run a shell command in the workspace. Read-only commands auto-run; installs/git-writes need approval; dangerous ones are blocked.",
|
|
3144
3142
|
risk: "restricted",
|
|
3145
3143
|
timeoutMs: DEFAULT_TIMEOUT_MS,
|
|
3146
3144
|
dynamicRisk: (args) => {
|
|
@@ -3150,8 +3148,8 @@ var executeCommand = {
|
|
|
3150
3148
|
parameters: {
|
|
3151
3149
|
type: "object",
|
|
3152
3150
|
properties: {
|
|
3153
|
-
command: { type: "string", description: "The
|
|
3154
|
-
timeout_ms: { type: "number", description: `Timeout
|
|
3151
|
+
command: { type: "string", description: "The command." },
|
|
3152
|
+
timeout_ms: { type: "number", description: `Timeout ms (default ${DEFAULT_TIMEOUT_MS}).` }
|
|
3155
3153
|
},
|
|
3156
3154
|
required: ["command"]
|
|
3157
3155
|
},
|
|
@@ -3200,19 +3198,16 @@ function save(cwd, entries) {
|
|
|
3200
3198
|
}
|
|
3201
3199
|
var memoryTool = {
|
|
3202
3200
|
name: "memory",
|
|
3203
|
-
description:
|
|
3201
|
+
description: "Persist notes for this project across sessions. Actions: add (content, topic?), search (query), list, forget (id or topic).",
|
|
3204
3202
|
risk: "safe",
|
|
3205
3203
|
parameters: {
|
|
3206
3204
|
type: "object",
|
|
3207
3205
|
properties: {
|
|
3208
|
-
action: { type: "string", enum: ["add", "search", "list", "forget"], description: "Operation
|
|
3209
|
-
content: { type: "string", description: "
|
|
3210
|
-
topic: {
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
},
|
|
3214
|
-
query: { type: "string", description: "Search terms (for action=search). Falls back to content if omitted." },
|
|
3215
|
-
id: { type: "string", description: "Entry id to remove (for action=forget)." }
|
|
3206
|
+
action: { type: "string", enum: ["add", "search", "list", "forget"], description: "Operation." },
|
|
3207
|
+
content: { type: "string", description: "Note text (add)." },
|
|
3208
|
+
topic: { type: "string", description: "Tag (add) or topic to clear (forget)." },
|
|
3209
|
+
query: { type: "string", description: "Search terms (search)." },
|
|
3210
|
+
id: { type: "string", description: "Entry id (forget)." }
|
|
3216
3211
|
},
|
|
3217
3212
|
required: ["action"]
|
|
3218
3213
|
},
|
|
@@ -3324,13 +3319,13 @@ function deleteCommands(cwd, target) {
|
|
|
3324
3319
|
}
|
|
3325
3320
|
var webSearch = {
|
|
3326
3321
|
name: "web_search",
|
|
3327
|
-
description: "
|
|
3322
|
+
description: "Web search for docs/solutions. Returns top results with snippets.",
|
|
3328
3323
|
risk: "safe",
|
|
3329
3324
|
parameters: {
|
|
3330
3325
|
type: "object",
|
|
3331
3326
|
properties: {
|
|
3332
3327
|
query: { type: "string", description: "Search query." },
|
|
3333
|
-
maxResults: { type: "number", description: "
|
|
3328
|
+
maxResults: { type: "number", description: "Max results (default 10)." }
|
|
3334
3329
|
},
|
|
3335
3330
|
required: ["query"]
|
|
3336
3331
|
},
|
|
@@ -3346,7 +3341,7 @@ var webSearch = {
|
|
|
3346
3341
|
};
|
|
3347
3342
|
var httpFetch = {
|
|
3348
3343
|
name: "http_fetch",
|
|
3349
|
-
description: "Fetch
|
|
3344
|
+
description: "Fetch a URL and return the body text (truncated if large).",
|
|
3350
3345
|
risk: "safe",
|
|
3351
3346
|
parameters: {
|
|
3352
3347
|
type: "object",
|
|
@@ -3372,7 +3367,7 @@ var httpFetch = {
|
|
|
3372
3367
|
};
|
|
3373
3368
|
var fileInfo = {
|
|
3374
3369
|
name: "file_info",
|
|
3375
|
-
description: "
|
|
3370
|
+
description: "File/dir info: size, type, safe-deletion profile.",
|
|
3376
3371
|
risk: "safe",
|
|
3377
3372
|
parameters: {
|
|
3378
3373
|
type: "object",
|
|
@@ -3404,7 +3399,7 @@ ${steps.join("\n")}`,
|
|
|
3404
3399
|
};
|
|
3405
3400
|
var safeDeleteSuggestion = {
|
|
3406
3401
|
name: "safe_delete_suggestion",
|
|
3407
|
-
description: "
|
|
3402
|
+
description: "Return (not execute) PowerShell/CMD deletion commands with double-check steps for a path.",
|
|
3408
3403
|
risk: "safe",
|
|
3409
3404
|
parameters: {
|
|
3410
3405
|
type: "object",
|
|
@@ -3438,12 +3433,12 @@ ${steps.join("\n")}
|
|
|
3438
3433
|
};
|
|
3439
3434
|
var processList = {
|
|
3440
3435
|
name: "process_list",
|
|
3441
|
-
description: "List
|
|
3436
|
+
description: "List running processes (find what locks files or uses resources).",
|
|
3442
3437
|
risk: "safe",
|
|
3443
3438
|
parameters: {
|
|
3444
3439
|
type: "object",
|
|
3445
3440
|
properties: {
|
|
3446
|
-
filter: { type: "string", description: "
|
|
3441
|
+
filter: { type: "string", description: "Filter substring for process names." }
|
|
3447
3442
|
}
|
|
3448
3443
|
},
|
|
3449
3444
|
async execute(args, ctx) {
|
|
@@ -3464,7 +3459,7 @@ ${trimmed}` };
|
|
|
3464
3459
|
};
|
|
3465
3460
|
var portCheck = {
|
|
3466
3461
|
name: "port_check",
|
|
3467
|
-
description: "Check
|
|
3462
|
+
description: "Check whether a local port is in use.",
|
|
3468
3463
|
risk: "safe",
|
|
3469
3464
|
parameters: {
|
|
3470
3465
|
type: "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@menteeai/menteeswe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "MenteE SWE — a model-agnostic autonomous software-engineering agent CLI. Bring your own intelligence: Kimi, GLM/Z.ai, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|