@menteeai/menteeswe 0.1.14 → 0.1.15
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 +29 -37
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -483,8 +483,8 @@ var init_render = __esm({
|
|
|
483
483
|
"use strict";
|
|
484
484
|
TOOL_CATEGORY = {
|
|
485
485
|
read_file: "filesystem",
|
|
486
|
-
write_file: "
|
|
487
|
-
apply_patch: "
|
|
486
|
+
write_file: "exec",
|
|
487
|
+
apply_patch: "testing",
|
|
488
488
|
delete_file: "filesystem",
|
|
489
489
|
move_path: "filesystem",
|
|
490
490
|
search_code: "search",
|
|
@@ -646,7 +646,7 @@ ${branch ? `- Git branch: ${branch}` : "- Not a git repository"}
|
|
|
646
646
|
${tree}
|
|
647
647
|
|
|
648
648
|
# How to work
|
|
649
|
-
1. UNDERSTAND before acting:
|
|
649
|
+
1. UNDERSTAND before acting: use search_code to locate the relevant files and symbols, then read only the 5-6 most important files as reference (with line ranges for large files) before proposing changes. Never modify a file you have not read.
|
|
650
650
|
2. MINIMAL CHANGES: make the smallest change that correctly fulfils the task. Never refactor unrelated code, never reformat, never rename things that were not asked about.
|
|
651
651
|
3. REALITY CHECK: do not invent APIs, packages, or file paths. If you are unsure a dependency or module exists, verify with search or by reading package.json / requirements files.
|
|
652
652
|
4. VERIFY: after modifying code, run the project's own tests, build, or typecheck commands to prove the change works. If no obvious test command exists, at minimum execute the modified code or a syntax check.
|
|
@@ -662,8 +662,7 @@ ${tree}
|
|
|
662
662
|
|
|
663
663
|
# Research strategy (IMPORTANT \u2014 HARD RULE)
|
|
664
664
|
- The file tree above already shows the whole structure. Do NOT read files just to "see what's there".
|
|
665
|
-
-
|
|
666
|
-
- The harness enforces a read budget. Once it warns you, STOP reading and answer or act.
|
|
665
|
+
- 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.
|
|
667
666
|
- For debugging or feature tasks, read only the files directly involved, then verify with tests. Never read the entire codebase.
|
|
668
667
|
|
|
669
668
|
# Editing notes
|
|
@@ -1085,19 +1084,6 @@ Investigate the root cause, fix it, then finish with a final answer.`
|
|
|
1085
1084
|
}
|
|
1086
1085
|
}
|
|
1087
1086
|
state.totalToolCalls += 1;
|
|
1088
|
-
if (tool.name === "read_file" && result.success) {
|
|
1089
|
-
state.readCount += 1;
|
|
1090
|
-
if (state.readCount === READ_BUDGET || state.readCount === READ_BUDGET * 2) {
|
|
1091
|
-
bus.emit(
|
|
1092
|
-
"warning",
|
|
1093
|
-
`Read budget reached (${state.readCount} files). Stop exploring \u2014 either answer now or start acting on what you have.`
|
|
1094
|
-
);
|
|
1095
|
-
messages.push({
|
|
1096
|
-
role: "user",
|
|
1097
|
-
content: "SYSTEM NOTE: You have read " + state.readCount + " files. That is more than enough exploration. Do NOT call read_file again unless a later step absolutely requires it. Either answer the question now or begin making changes."
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
1087
|
if (tool.name === "apply_patch" || tool.name === "write_file") {
|
|
1102
1088
|
const pathArg = firstString(args, "path");
|
|
1103
1089
|
if (pathArg && result.success && !state.modifiedFiles.includes(pathArg)) {
|
|
@@ -1170,7 +1156,7 @@ Investigate the root cause, fix it, then finish with a final answer.`
|
|
|
1170
1156
|
});
|
|
1171
1157
|
return { success, finalText, state };
|
|
1172
1158
|
}
|
|
1173
|
-
var MAX_CONTEXT_CHARS,
|
|
1159
|
+
var MAX_CONTEXT_CHARS, RATE_LIMIT_MAX_ATTEMPTS, MAX_VERIFY, EDIT_TOOLS, KEEP_RECENT_TOOL;
|
|
1174
1160
|
var init_loop = __esm({
|
|
1175
1161
|
"src/agent/loop.ts"() {
|
|
1176
1162
|
"use strict";
|
|
@@ -1180,7 +1166,6 @@ var init_loop = __esm({
|
|
|
1180
1166
|
init_base();
|
|
1181
1167
|
init_testing();
|
|
1182
1168
|
MAX_CONTEXT_CHARS = 7e4;
|
|
1183
|
-
READ_BUDGET = 6;
|
|
1184
1169
|
RATE_LIMIT_MAX_ATTEMPTS = 8;
|
|
1185
1170
|
MAX_VERIFY = 3;
|
|
1186
1171
|
EDIT_TOOLS = /* @__PURE__ */ new Set(["apply_patch", "write_file", "move_path"]);
|
|
@@ -1192,7 +1177,7 @@ var init_loop = __esm({
|
|
|
1192
1177
|
var version;
|
|
1193
1178
|
var init_package = __esm({
|
|
1194
1179
|
"package.json"() {
|
|
1195
|
-
version = "0.1.
|
|
1180
|
+
version = "0.1.15";
|
|
1196
1181
|
}
|
|
1197
1182
|
});
|
|
1198
1183
|
|
|
@@ -1557,9 +1542,9 @@ function App(props) {
|
|
|
1557
1542
|
const [detailsOpen, setDetailsOpen] = useState3(false);
|
|
1558
1543
|
const [showDetails, setShowDetails] = useState3(false);
|
|
1559
1544
|
const [thinkingText, setThinkingText] = useState3("");
|
|
1560
|
-
const [currentEdit, setCurrentEdit] = useState3(null);
|
|
1561
1545
|
const [phase, setPhase] = useState3("");
|
|
1562
1546
|
const [showEdits, setShowEdits] = useState3(true);
|
|
1547
|
+
const [taskSummary, setTaskSummary] = useState3(null);
|
|
1563
1548
|
const finalTextRef = useRef(null);
|
|
1564
1549
|
const pendingTool = useRef(null);
|
|
1565
1550
|
const counter = useRef(0);
|
|
@@ -1572,6 +1557,10 @@ function App(props) {
|
|
|
1572
1557
|
const line = { id: counter.current, text, noise, kind };
|
|
1573
1558
|
setLog((prev) => [...prev, line]);
|
|
1574
1559
|
};
|
|
1560
|
+
const appendPatchEdit = (edit) => {
|
|
1561
|
+
counter.current += 1;
|
|
1562
|
+
setLog((prev) => [...prev, { id: counter.current, text: "", noise: false, kind: "patch", edit }]);
|
|
1563
|
+
};
|
|
1575
1564
|
useEffect2(() => {
|
|
1576
1565
|
const TOOL_NOISE = /* @__PURE__ */ new Set(["tool_started", "tool_completed", "model_request"]);
|
|
1577
1566
|
const unsubscribeLog = bus.subscribe((event) => {
|
|
@@ -1591,7 +1580,20 @@ function App(props) {
|
|
|
1591
1580
|
const filePath = typeof event.data?.path === "string" ? event.data.path : "file";
|
|
1592
1581
|
const oldStr = typeof event.data?.old_string === "string" ? event.data.old_string : "";
|
|
1593
1582
|
const newStr = typeof event.data?.new_string === "string" ? event.data.new_string : "";
|
|
1594
|
-
|
|
1583
|
+
appendPatchEdit({ path: filePath, old: oldStr, new: newStr });
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
if (event.type === "task_completed") {
|
|
1587
|
+
setTaskSummary(formatEvent(event));
|
|
1588
|
+
const text = typeof event.data?.finalText === "string" ? event.data.finalText.trim() : "";
|
|
1589
|
+
if (text) {
|
|
1590
|
+
finalTextRef.current = text;
|
|
1591
|
+
setFinalPending(text);
|
|
1592
|
+
setTypedText("");
|
|
1593
|
+
setTyping(true);
|
|
1594
|
+
} else {
|
|
1595
|
+
finalTextRef.current = null;
|
|
1596
|
+
}
|
|
1595
1597
|
return;
|
|
1596
1598
|
}
|
|
1597
1599
|
appendLog(formatEvent(event), TOOL_NOISE.has(event.type));
|
|
@@ -1608,16 +1610,6 @@ function App(props) {
|
|
|
1608
1610
|
(prev) => [...prev, { name, target: rec?.target ?? "", args: rec?.args ?? "", output: output.slice(0, 4e3) }].slice(-40)
|
|
1609
1611
|
);
|
|
1610
1612
|
pendingTool.current = null;
|
|
1611
|
-
} else if (event.type === "task_completed") {
|
|
1612
|
-
const text = typeof event.data?.finalText === "string" ? event.data.finalText.trim() : "";
|
|
1613
|
-
if (text) {
|
|
1614
|
-
finalTextRef.current = text;
|
|
1615
|
-
setFinalPending(text);
|
|
1616
|
-
setTypedText("");
|
|
1617
|
-
setTyping(true);
|
|
1618
|
-
} else {
|
|
1619
|
-
finalTextRef.current = null;
|
|
1620
|
-
}
|
|
1621
1613
|
}
|
|
1622
1614
|
});
|
|
1623
1615
|
const unsubscribeLog2 = bus.subscribe(createSessionLogger());
|
|
@@ -1802,7 +1794,7 @@ function App(props) {
|
|
|
1802
1794
|
setInspectorIndex(null);
|
|
1803
1795
|
setDetailsOpen(false);
|
|
1804
1796
|
setRunning(true);
|
|
1805
|
-
|
|
1797
|
+
setTaskSummary(null);
|
|
1806
1798
|
const ac = new AbortController();
|
|
1807
1799
|
abortRef.current = ac;
|
|
1808
1800
|
try {
|
|
@@ -1900,14 +1892,14 @@ function App(props) {
|
|
|
1900
1892
|
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
1901
1893
|
/* @__PURE__ */ jsx6(Static, { items: [{ key: "header", text: header }], children: (item) => /* @__PURE__ */ jsx6(Box6, { children: item.text }, item.key) }),
|
|
1902
1894
|
/* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
1903
|
-
log.filter((l) => showDetails || !l.noise).map(
|
|
1904
|
-
(line) => line.kind === "answer" ? /* @__PURE__ */ jsx6(AnswerBlock, { text: line.text }, line.id) : /* @__PURE__ */ jsx6(Text6, { children: line.text }, line.id)
|
|
1895
|
+
log.filter((l) => (showDetails || !l.noise) && (l.kind !== "patch" || showEdits)).map(
|
|
1896
|
+
(line) => line.kind === "answer" ? /* @__PURE__ */ jsx6(AnswerBlock, { text: line.text }, line.id) : line.kind === "patch" && line.edit ? /* @__PURE__ */ jsx6(CurrentEditBox, { edit: line.edit }, line.id) : /* @__PURE__ */ jsx6(Text6, { children: line.text }, line.id)
|
|
1905
1897
|
),
|
|
1906
1898
|
finalPending !== null ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, children: /* @__PURE__ */ jsxs6(Text6, { color: "green", children: [
|
|
1907
1899
|
typedText,
|
|
1908
1900
|
typing ? "\u258C" : ""
|
|
1909
1901
|
] }) }) : null,
|
|
1910
|
-
|
|
1902
|
+
taskSummary ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx6(Text6, { children: taskSummary }) }) : null,
|
|
1911
1903
|
detailsOpen && inspectorIndex !== null && toolHistory[inspectorIndex] ? (() => {
|
|
1912
1904
|
const rec = toolHistory[inspectorIndex];
|
|
1913
1905
|
const outLines = rec.output.split("\n").slice(0, 24).join("\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@menteeai/menteeswe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
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",
|