@menteeai/menteeswe 0.1.13 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +37 -38
  2. 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: "filesystem",
487
- apply_patch: "filesystem",
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: list files, search code, and read the relevant files (with line ranges for large files) before proposing changes. Never modify a file you have not read.
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
- - When asked to "understand", "study", or "explore", read at most 5 files: typically README, package.json / pyproject, and 1-3 source files directly relevant to the question. Use search_code to locate symbols instead of opening files blindly.
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, READ_BUDGET, RATE_LIMIT_MAX_ATTEMPTS, MAX_VERIFY, EDIT_TOOLS, KEEP_RECENT_TOOL;
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.13";
1180
+ version = "0.1.15";
1196
1181
  }
1197
1182
  });
1198
1183
 
@@ -1557,8 +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("");
1546
+ const [showEdits, setShowEdits] = useState3(true);
1547
+ const [taskSummary, setTaskSummary] = useState3(null);
1562
1548
  const finalTextRef = useRef(null);
1563
1549
  const pendingTool = useRef(null);
1564
1550
  const counter = useRef(0);
@@ -1571,6 +1557,10 @@ function App(props) {
1571
1557
  const line = { id: counter.current, text, noise, kind };
1572
1558
  setLog((prev) => [...prev, line]);
1573
1559
  };
1560
+ const appendPatchEdit = (edit) => {
1561
+ counter.current += 1;
1562
+ setLog((prev) => [...prev, { id: counter.current, text: "", noise: false, kind: "patch", edit }]);
1563
+ };
1574
1564
  useEffect2(() => {
1575
1565
  const TOOL_NOISE = /* @__PURE__ */ new Set(["tool_started", "tool_completed", "model_request"]);
1576
1566
  const unsubscribeLog = bus.subscribe((event) => {
@@ -1590,7 +1580,20 @@ function App(props) {
1590
1580
  const filePath = typeof event.data?.path === "string" ? event.data.path : "file";
1591
1581
  const oldStr = typeof event.data?.old_string === "string" ? event.data.old_string : "";
1592
1582
  const newStr = typeof event.data?.new_string === "string" ? event.data.new_string : "";
1593
- setCurrentEdit({ path: filePath, old: oldStr, new: newStr });
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
+ }
1594
1597
  return;
1595
1598
  }
1596
1599
  appendLog(formatEvent(event), TOOL_NOISE.has(event.type));
@@ -1607,16 +1610,6 @@ function App(props) {
1607
1610
  (prev) => [...prev, { name, target: rec?.target ?? "", args: rec?.args ?? "", output: output.slice(0, 4e3) }].slice(-40)
1608
1611
  );
1609
1612
  pendingTool.current = null;
1610
- } else if (event.type === "task_completed") {
1611
- const text = typeof event.data?.finalText === "string" ? event.data.finalText.trim() : "";
1612
- if (text) {
1613
- finalTextRef.current = text;
1614
- setFinalPending(text);
1615
- setTypedText("");
1616
- setTyping(true);
1617
- } else {
1618
- finalTextRef.current = null;
1619
- }
1620
1613
  }
1621
1614
  });
1622
1615
  const unsubscribeLog2 = bus.subscribe(createSessionLogger());
@@ -1801,7 +1794,7 @@ function App(props) {
1801
1794
  setInspectorIndex(null);
1802
1795
  setDetailsOpen(false);
1803
1796
  setRunning(true);
1804
- setCurrentEdit(null);
1797
+ setTaskSummary(null);
1805
1798
  const ac = new AbortController();
1806
1799
  abortRef.current = ac;
1807
1800
  try {
@@ -1867,6 +1860,10 @@ function App(props) {
1867
1860
  setShowDetails((v) => !v);
1868
1861
  return;
1869
1862
  }
1863
+ if (key.meta && (input === "e" || input === "E")) {
1864
+ setShowEdits((v) => !v);
1865
+ return;
1866
+ }
1870
1867
  if (stateRef.current.dialog || stateRef.current.approval || stateRef.current.running) return;
1871
1868
  if (key.meta && (input === "m" || input === "M")) openModelDialog();
1872
1869
  else if (key.ctrl && input === "p") setDialog({ kind: "provider" });
@@ -1883,24 +1880,26 @@ function App(props) {
1883
1880
  modelLabel ? `:${modelLabel}` : "",
1884
1881
  " \xB7 details ",
1885
1882
  showDetails ? "open" : "collapsed",
1883
+ " \xB7 edits ",
1884
+ showEdits ? "open" : "collapsed",
1886
1885
  " \xB7 ",
1887
1886
  props.cwd
1888
1887
  ] }),
1889
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Alt+M model \xB7 Ctrl+P provider \xB7 Ctrl+K key \xB7 Alt+D details \xB7 /help" })
1888
+ /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Alt+M model \xB7 Ctrl+P provider \xB7 Ctrl+K key \xB7 Alt+D details \xB7 Alt+E edits \xB7 /help" })
1890
1889
  ] }, "header");
1891
1890
  const cols = stdout.columns || 80;
1892
1891
  const marquee = thinkingText.slice(-Math.max(1, cols - 4));
1893
1892
  return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
1894
1893
  /* @__PURE__ */ jsx6(Static, { items: [{ key: "header", text: header }], children: (item) => /* @__PURE__ */ jsx6(Box6, { children: item.text }, item.key) }),
1895
1894
  /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
1896
- log.filter((l) => showDetails || !l.noise).map(
1897
- (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)
1898
1897
  ),
1899
1898
  finalPending !== null ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, children: /* @__PURE__ */ jsxs6(Text6, { color: "green", children: [
1900
1899
  typedText,
1901
1900
  typing ? "\u258C" : ""
1902
1901
  ] }) }) : null,
1903
- /* @__PURE__ */ jsx6(CurrentEditBox, { edit: currentEdit }),
1902
+ taskSummary ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx6(Text6, { children: taskSummary }) }) : null,
1904
1903
  detailsOpen && inspectorIndex !== null && toolHistory[inspectorIndex] ? (() => {
1905
1904
  const rec = toolHistory[inspectorIndex];
1906
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.13",
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",