@menteeai/menteeswe 0.1.21 → 0.1.23

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 +121 -109
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1306,7 +1306,7 @@ var init_loop = __esm({
1306
1306
  var version;
1307
1307
  var init_package = __esm({
1308
1308
  "package.json"() {
1309
- version = "0.1.21";
1309
+ version = "0.1.23";
1310
1310
  }
1311
1311
  });
1312
1312
 
@@ -1644,6 +1644,12 @@ import { useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useSt
1644
1644
  import { Box as Box6, Static, Text as Text6, useApp, useInput as useInput4, useStdout } from "ink";
1645
1645
  import TextInput2 from "ink-text-input";
1646
1646
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1647
+ function TaskBlock({ text }) {
1648
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
1649
+ /* @__PURE__ */ jsx6(Text6, { color: "magenta", bold: true, children: "\u25B8 Task" }),
1650
+ /* @__PURE__ */ jsx6(Text6, { children: text })
1651
+ ] });
1652
+ }
1647
1653
  function App(props) {
1648
1654
  const { exit } = useApp();
1649
1655
  const { stdout } = useStdout();
@@ -1681,13 +1687,19 @@ function App(props) {
1681
1687
  const stateRef = useRef({ running, approval, dialog, factoryResult, providerName, model });
1682
1688
  stateRef.current = { running, approval, dialog, factoryResult, providerName, model };
1683
1689
  const abortRef = useRef(null);
1690
+ const showDetailsRef = useRef(showDetails);
1691
+ showDetailsRef.current = showDetails;
1692
+ const showEditsRef = useRef(showEdits);
1693
+ showEditsRef.current = showEdits;
1684
1694
  const appendLog = (text, noise = false, kind) => {
1685
1695
  if (!text) return;
1696
+ if (noise && !showDetailsRef.current) return;
1686
1697
  counter.current += 1;
1687
1698
  const line = { id: counter.current, text, noise, kind };
1688
1699
  setLog((prev) => [...prev, line]);
1689
1700
  };
1690
1701
  const appendPatchEdit = (edit) => {
1702
+ if (!showEditsRef.current) return;
1691
1703
  counter.current += 1;
1692
1704
  setLog((prev) => [...prev, { id: counter.current, text: "", noise: false, kind: "patch", edit }]);
1693
1705
  };
@@ -1731,6 +1743,10 @@ function App(props) {
1731
1743
  }
1732
1744
  return;
1733
1745
  }
1746
+ if (event.type === "task_started") {
1747
+ appendLog(event.message ?? "", false, "task");
1748
+ return;
1749
+ }
1734
1750
  appendLog(formatEvent(event), TOOL_NOISE.has(event.type));
1735
1751
  if (event.type === "tool_started") {
1736
1752
  const name = typeof event.data?.tool === "string" ? event.data.tool : "";
@@ -1756,7 +1772,7 @@ function App(props) {
1756
1772
  unsubscribeLog();
1757
1773
  unsubscribeLog2();
1758
1774
  };
1759
- }, [bus, bridge, showDetails]);
1775
+ }, [bus, bridge]);
1760
1776
  useEffect2(() => {
1761
1777
  if (!running) return;
1762
1778
  const timer = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 80);
@@ -2026,116 +2042,112 @@ function App(props) {
2026
2042
  const cols = stdout.columns || 80;
2027
2043
  const marquee = thinkingText.slice(-Math.max(1, cols - 4));
2028
2044
  return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
2029
- /* @__PURE__ */ jsx6(Static, { items: [{ key: "header", text: header }], children: (item) => /* @__PURE__ */ jsx6(Box6, { children: item.text }, item.key) }),
2030
- /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
2031
- log.filter((l) => (showDetails || !l.noise) && (l.kind !== "patch" || showEdits)).map(
2032
- (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)
2033
- ),
2034
- finalPending !== null ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, children: /* @__PURE__ */ jsxs6(Text6, { color: "green", children: [
2035
- typedText,
2036
- typing ? "\u258C" : ""
2037
- ] }) }) : null,
2038
- taskSummary ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx6(Text6, { children: taskSummary }) }) : null,
2039
- detailsOpen && inspectorIndex !== null && toolHistory[inspectorIndex] ? (() => {
2040
- const rec = toolHistory[inspectorIndex];
2041
- const outLines = rec.output.split("\n").slice(0, 24).join("\n");
2042
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", marginTop: 1, borderStyle: "round", borderColor: "gray", paddingX: 1, children: [
2043
- /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
2044
- " tool details (",
2045
- inspectorIndex + 1,
2046
- "/",
2047
- toolHistory.length,
2048
- ") \xB7 Alt+D to cycle "
2049
- ] }),
2050
- /* @__PURE__ */ jsxs6(Text6, { color: toolColorName(rec.name), bold: true, children: [
2051
- rec.name,
2052
- " ",
2053
- rec.target
2054
- ] }),
2055
- /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
2056
- "args: ",
2057
- rec.args.slice(0, 400) || "(none)"
2058
- ] }),
2059
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: outLines || "(no output)" })
2060
- ] });
2061
- })() : null,
2062
- dialog?.kind === "model" ? /* @__PURE__ */ jsx6(
2063
- SelectDialog,
2064
- {
2065
- title: `Model \u2014 ${providerName}`,
2066
- items: modelItems,
2067
- loading: modelLoading,
2068
- error: modelError,
2069
- current: model ?? factoryResult.provider?.defaultModel,
2070
- onSelect: (id) => {
2071
- setDialog(null);
2072
- setModelAndPersist(id);
2073
- },
2074
- onClose: () => setDialog(null)
2075
- }
2076
- ) : dialog?.kind === "provider" ? /* @__PURE__ */ jsx6(
2077
- SelectDialog,
2078
- {
2079
- title: "Provider",
2080
- items: PROVIDER_NAMES,
2081
- descriptions: PROVIDER_DESCRIPTIONS,
2082
- current: providerName,
2083
- onSelect: (name) => {
2084
- setDialog(null);
2085
- switchProvider(name);
2086
- },
2087
- onClose: () => setDialog(null)
2088
- }
2089
- ) : dialog?.kind === "key" ? /* @__PURE__ */ jsx6(
2090
- KeyDialog,
2091
- {
2092
- providerName,
2093
- onSubmit: (value) => {
2094
- setDialog(null);
2095
- saveKey(value);
2096
- },
2097
- onClose: () => setDialog(null)
2045
+ /* @__PURE__ */ jsx6(Static, { items: [{ key: "header", text: header }], children: (item) => /* @__PURE__ */ jsx6(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: /* @__PURE__ */ jsx6(Text6, { children: item.text }) }, item.key) }),
2046
+ /* @__PURE__ */ jsx6(Static, { items: log, children: (line) => line.kind === "answer" ? /* @__PURE__ */ jsx6(AnswerBlock, { text: line.text }, line.id) : line.kind === "task" ? /* @__PURE__ */ jsx6(TaskBlock, { 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) }),
2047
+ finalPending !== null ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, children: /* @__PURE__ */ jsxs6(Text6, { color: "green", children: [
2048
+ typedText,
2049
+ typing ? "\u258C" : ""
2050
+ ] }) }) : null,
2051
+ taskSummary ? /* @__PURE__ */ jsx6(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx6(Text6, { children: taskSummary }) }) : null,
2052
+ detailsOpen && inspectorIndex !== null && toolHistory[inspectorIndex] ? (() => {
2053
+ const rec = toolHistory[inspectorIndex];
2054
+ const outLines = rec.output.split("\n").slice(0, 24).join("\n");
2055
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", marginTop: 1, borderStyle: "round", borderColor: "gray", paddingX: 1, children: [
2056
+ /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
2057
+ " tool details (",
2058
+ inspectorIndex + 1,
2059
+ "/",
2060
+ toolHistory.length,
2061
+ ") \xB7 Alt+D to cycle "
2062
+ ] }),
2063
+ /* @__PURE__ */ jsxs6(Text6, { color: toolColorName(rec.name), bold: true, children: [
2064
+ rec.name,
2065
+ " ",
2066
+ rec.target
2067
+ ] }),
2068
+ /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
2069
+ "args: ",
2070
+ rec.args.slice(0, 400) || "(none)"
2071
+ ] }),
2072
+ /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: outLines || "(no output)" })
2073
+ ] });
2074
+ })() : null,
2075
+ dialog?.kind === "model" ? /* @__PURE__ */ jsx6(
2076
+ SelectDialog,
2077
+ {
2078
+ title: `Model \u2014 ${providerName}`,
2079
+ items: modelItems,
2080
+ loading: modelLoading,
2081
+ error: modelError,
2082
+ current: model ?? factoryResult.provider?.defaultModel,
2083
+ onSelect: (id) => {
2084
+ setDialog(null);
2085
+ setModelAndPersist(id);
2086
+ },
2087
+ onClose: () => setDialog(null)
2088
+ }
2089
+ ) : dialog?.kind === "provider" ? /* @__PURE__ */ jsx6(
2090
+ SelectDialog,
2091
+ {
2092
+ title: "Provider",
2093
+ items: PROVIDER_NAMES,
2094
+ descriptions: PROVIDER_DESCRIPTIONS,
2095
+ current: providerName,
2096
+ onSelect: (name) => {
2097
+ setDialog(null);
2098
+ switchProvider(name);
2099
+ },
2100
+ onClose: () => setDialog(null)
2101
+ }
2102
+ ) : dialog?.kind === "key" ? /* @__PURE__ */ jsx6(
2103
+ KeyDialog,
2104
+ {
2105
+ providerName,
2106
+ onSubmit: (value) => {
2107
+ setDialog(null);
2108
+ saveKey(value);
2109
+ },
2110
+ onClose: () => setDialog(null)
2111
+ }
2112
+ ) : approval ? /* @__PURE__ */ jsx6(
2113
+ ApprovalPrompt,
2114
+ {
2115
+ request: approval,
2116
+ onDecision: (decision) => {
2117
+ bridge.resolve(decision);
2118
+ if (decision === "always") bus.emit("info", "Approved for the rest of this session.");
2098
2119
  }
2099
- ) : approval ? /* @__PURE__ */ jsx6(
2100
- ApprovalPrompt,
2120
+ }
2121
+ ) : running ? /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
2122
+ /* @__PURE__ */ jsxs6(Box6, { children: [
2123
+ /* @__PURE__ */ jsxs6(Text6, { color: "yellow", children: [
2124
+ SPINNER_FRAMES[frame],
2125
+ " "
2126
+ ] }),
2127
+ /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
2128
+ "agent ",
2129
+ PHASE_LABEL[phase] ?? "working",
2130
+ "\u2026",
2131
+ tokenTotals.totalIn + tokenTotals.totalOut > 0 ? ` \xB7 ${((tokenTotals.totalIn + tokenTotals.totalOut) / 1e3).toFixed(1)}k tok` : "",
2132
+ " (Ctrl+C to exit)"
2133
+ ] })
2134
+ ] }),
2135
+ thinkingText ? /* @__PURE__ */ jsxs6(Box6, { children: [
2136
+ /* @__PURE__ */ jsx6(Text6, { color: "cyan", children: "\u{1F4AD} " }),
2137
+ /* @__PURE__ */ jsx6(Text6, { color: "cyan", dimColor: true, children: marquee }),
2138
+ /* @__PURE__ */ jsx6(Text6, { color: "cyan", children: "\u258C" })
2139
+ ] }) : null
2140
+ ] }) : /* @__PURE__ */ jsxs6(Box6, { children: [
2141
+ /* @__PURE__ */ jsx6(Text6, { color: "cyan", bold: true, children: "\u25B8 " }),
2142
+ /* @__PURE__ */ jsx6(
2143
+ TextInput2,
2101
2144
  {
2102
- request: approval,
2103
- onDecision: (decision) => {
2104
- bridge.resolve(decision);
2105
- if (decision === "always") bus.emit("info", "Approved for the rest of this session.");
2106
- }
2145
+ value: taskInput,
2146
+ onChange: setTaskInput,
2147
+ onSubmit: handleSubmit,
2148
+ placeholder: "Describe a task, or /help"
2107
2149
  }
2108
- ) : running ? /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
2109
- /* @__PURE__ */ jsxs6(Box6, { children: [
2110
- /* @__PURE__ */ jsxs6(Text6, { color: "yellow", children: [
2111
- SPINNER_FRAMES[frame],
2112
- " "
2113
- ] }),
2114
- /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
2115
- "agent ",
2116
- PHASE_LABEL[phase] ?? "working",
2117
- "\u2026",
2118
- tokenTotals.totalIn + tokenTotals.totalOut > 0 ? ` \xB7 ${((tokenTotals.totalIn + tokenTotals.totalOut) / 1e3).toFixed(1)}k tok` : "",
2119
- " (Ctrl+C to exit)"
2120
- ] })
2121
- ] }),
2122
- thinkingText ? /* @__PURE__ */ jsxs6(Box6, { children: [
2123
- /* @__PURE__ */ jsx6(Text6, { color: "cyan", children: "\u{1F4AD} " }),
2124
- /* @__PURE__ */ jsx6(Text6, { color: "cyan", dimColor: true, children: marquee }),
2125
- /* @__PURE__ */ jsx6(Text6, { color: "cyan", children: "\u258C" })
2126
- ] }) : null
2127
- ] }) : /* @__PURE__ */ jsxs6(Box6, { children: [
2128
- /* @__PURE__ */ jsx6(Text6, { color: "cyan", bold: true, children: "\u25B8 " }),
2129
- /* @__PURE__ */ jsx6(
2130
- TextInput2,
2131
- {
2132
- value: taskInput,
2133
- onChange: setTaskInput,
2134
- onSubmit: handleSubmit,
2135
- placeholder: "Describe a task, or /help"
2136
- }
2137
- )
2138
- ] })
2150
+ )
2139
2151
  ] })
2140
2152
  ] });
2141
2153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@menteeai/menteeswe",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
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",