@menteeai/menteeswe 0.1.17 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +13 -7
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -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
- return color(` ${success ? "\u2713" : "\u2717"} ${firstLine}`);
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"}...`);
@@ -869,7 +871,8 @@ async function runVerification(tools, ctx, bus, state, cwd) {
869
871
  bus.emit("tool_completed", `verify \xB7 ${tool.name}`, {
870
872
  tool: tool.name,
871
873
  success: res.success,
872
- output: res.output.slice(0, 2e3)
874
+ output: res.output.slice(0, 2e3),
875
+ resultChars: res.output.length
873
876
  });
874
877
  combined += `${tool.name}: ${res.output}
875
878
  `;
@@ -1011,7 +1014,7 @@ ${systemExtra}` : "");
1011
1014
  messages.push({
1012
1015
  role: "user",
1013
1016
  content: `SYSTEM NOTE: Verification failed.
1014
- ${verdict.output}
1017
+ ${verdict.output.slice(0, 2e3)}
1015
1018
  Investigate the root cause, fix it, then finish with a final answer.`
1016
1019
  });
1017
1020
  sawFinish = false;
@@ -1106,7 +1109,8 @@ Investigate the root cause, fix it, then finish with a final answer.`
1106
1109
  bus.emit("tool_completed", toolCallPreview(call), {
1107
1110
  tool: tool.name,
1108
1111
  success: result.success,
1109
- output: result.output.slice(0, 2e3)
1112
+ output: result.output.slice(0, 2e3),
1113
+ resultChars: result.output.length
1110
1114
  });
1111
1115
  if (tool.name === "apply_patch" && result.success && result.data?.kind === "patch") {
1112
1116
  bus.emit("patch", void 0, {
@@ -1135,10 +1139,11 @@ Investigate the root cause, fix it, then finish with a final answer.`
1135
1139
  }
1136
1140
  }
1137
1141
  }
1142
+ const { text: historyOutput } = truncateOutput(result.output, MAX_RESULT_HISTORY_CHARS);
1138
1143
  messages.push({
1139
1144
  role: "tool",
1140
1145
  tool_call_id: call.id,
1141
- content: result.output
1146
+ content: historyOutput
1142
1147
  });
1143
1148
  }
1144
1149
  if (signal?.aborted) {
@@ -1168,7 +1173,7 @@ Investigate the root cause, fix it, then finish with a final answer.`
1168
1173
  });
1169
1174
  return { success, finalText, state };
1170
1175
  }
1171
- 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;
1172
1177
  var init_loop = __esm({
1173
1178
  "src/agent/loop.ts"() {
1174
1179
  "use strict";
@@ -1178,6 +1183,7 @@ var init_loop = __esm({
1178
1183
  init_base();
1179
1184
  init_testing();
1180
1185
  MAX_CONTEXT_CHARS = 4e4;
1186
+ MAX_RESULT_HISTORY_CHARS = 12e3;
1181
1187
  RATE_LIMIT_MAX_ATTEMPTS = 8;
1182
1188
  MAX_VERIFY = 3;
1183
1189
  EDIT_TOOLS = /* @__PURE__ */ new Set(["apply_patch", "write_file", "move_path"]);
@@ -1189,7 +1195,7 @@ var init_loop = __esm({
1189
1195
  var version;
1190
1196
  var init_package = __esm({
1191
1197
  "package.json"() {
1192
- version = "0.1.17";
1198
+ version = "0.1.18";
1193
1199
  }
1194
1200
  });
1195
1201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@menteeai/menteeswe",
3
- "version": "0.1.17",
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",