@hasna/coders 0.0.7 → 0.0.8

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.mjs CHANGED
@@ -58429,7 +58429,7 @@ var init_client = __esm({
58429
58429
  "Content-Type": "application/json",
58430
58430
  "anthropic-version": "2023-06-01",
58431
58431
  "anthropic-beta": BETA_HEADERS.join(","),
58432
- "User-Agent": `coders/${"0.0.7"}`
58432
+ "User-Agent": `coders/${"0.0.8"}`
58433
58433
  };
58434
58434
  if (key.isOAuth) {
58435
58435
  headers["Authorization"] = `Bearer ${key.apiKey}`;
@@ -69802,14 +69802,23 @@ function ToolItem({ tool }) {
69802
69802
  "s)"
69803
69803
  ] })
69804
69804
  ] }),
69805
- tool.status === "done" && resultPreview && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { flexDirection: "column", children: resultPreview.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
69806
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
69805
+ tool.status === "done" && resultPreview && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", children: [
69806
+ resultPreview.slice(0, 2).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
69807
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
69808
+ " ",
69809
+ CONN,
69810
+ " "
69811
+ ] }),
69812
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: line.slice(0, 100) })
69813
+ ] }, i)),
69814
+ resultPreview.length > 2 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
69807
69815
  " ",
69808
69816
  CONN,
69809
- " "
69810
- ] }),
69811
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: line })
69812
- ] }, i)) }),
69817
+ " \u2026 +",
69818
+ resultPreview.length - 2,
69819
+ " more (ctrl+o to expand)"
69820
+ ] }) })
69821
+ ] }),
69813
69822
  tool.error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
69814
69823
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
69815
69824
  " ",
@@ -70063,46 +70072,35 @@ function App2({ model, mode, initialPrompt }) {
70063
70072
  } else if (key.escape) setInput("");
70064
70073
  else if (!key.ctrl && !key.meta && ch) setInput((p) => p + ch);
70065
70074
  });
70066
- const messageAreaHeight = Math.max(5, rows - 5);
70067
- const visible = msgs.slice(-messageAreaHeight);
70075
+ const maxMsgs = busy ? 1 : 3;
70076
+ const visible = msgs.slice(-maxMsgs);
70077
+ const recentTools = activeTools.slice(-3);
70078
+ const streamLines = streaming.split("\n");
70079
+ const maxStreamLines = Math.max(3, rows - 15);
70080
+ const truncatedStream = streamLines.length > maxStreamLines ? streamLines.slice(-maxStreamLines).join("\n") : streaming;
70068
70081
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", children: [
70069
70082
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Header, { model, mode }),
70070
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", height: messageAreaHeight, overflow: "hidden", children: [
70083
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
70071
70084
  visible.map((m) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageView, { msg: m }, m.id)),
70072
- busy && activeTools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { flexDirection: "column", children: activeTools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolItem, { tool: t }, t.id)) }),
70073
- busy && streaming && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { marginTop: 0, children: [
70085
+ busy && recentTools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", children: [
70086
+ activeTools.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
70087
+ " \u2026 +",
70088
+ activeTools.length - 3,
70089
+ " earlier tools"
70090
+ ] }) }),
70091
+ recentTools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolItem, { tool: t }, t.id))
70092
+ ] }),
70093
+ busy && truncatedStream && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { marginTop: 0, children: [
70074
70094
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "green", children: "\u25CF " }),
70075
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: streaming })
70095
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: truncatedStream })
70076
70096
  ] }),
70077
- busy && !streaming && !permissionPending && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { marginTop: 0, children: [
70097
+ busy && !streaming && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { marginTop: 0, children: [
70078
70098
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpinnerDot, {}),
70079
70099
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
70080
70100
  " ",
70081
- activeTools.some((t) => t.status === "running") ? "Working" : "Thinking",
70101
+ recentTools.some((t) => t.status === "running") ? "Working" : "Thinking",
70082
70102
  "..."
70083
70103
  ] })
70084
- ] }),
70085
- permissionPending && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
70086
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
70087
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "yellow", bold: true, children: "? " }),
70088
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: "Allow " }),
70089
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { bold: true, children: permissionPending.toolName }),
70090
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
70091
- ": ",
70092
- permissionPending.summary.slice(0, 80)
70093
- ] })
70094
- ] }),
70095
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
70096
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: " " }),
70097
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "green", bold: true, children: "(y)" }),
70098
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "green", children: "es" }),
70099
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: " " }),
70100
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "red", bold: true, children: "(n)" }),
70101
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "red", children: "o" }),
70102
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: " " }),
70103
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "blue", bold: true, children: "(a)" }),
70104
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "blue", children: "lways allow" })
70105
- ] })
70106
70104
  ] })
70107
70105
  ] }),
70108
70106
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: "\u2500".repeat(Math.min(stdout?.columns ?? 80, 120)) }) }),
@@ -70404,8 +70402,8 @@ async function bootstrap() {
70404
70402
  var VERSION, BUILD_TIME, PACKAGE_NAME2, ISSUES_URL2, startupTimestamps, originalCwd, RESET_TERMINAL, cleanupHandlers, earlyInput, earlyInputCapturing;
70405
70403
  var init_index = __esm({
70406
70404
  "src/cli/index.ts"() {
70407
- VERSION = "0.0.7";
70408
- BUILD_TIME = "2026-03-20T08:00:00.712Z";
70405
+ VERSION = "0.0.8";
70406
+ BUILD_TIME = "2026-03-20T08:07:42.452Z";
70409
70407
  PACKAGE_NAME2 = "@hasna/coders";
70410
70408
  ISSUES_URL2 = "https://github.com/hasnaxyz/open-coders/issues";
70411
70409
  startupTimestamps = {};