@hasna/coders 0.1.5 → 0.1.6

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
@@ -70396,6 +70396,7 @@ function App2({ model, mode, initialPrompt }) {
70396
70396
  const [tokens, setTokens] = (0, import_react22.useState)(0);
70397
70397
  const [history, setHistory] = (0, import_react22.useState)([]);
70398
70398
  const [activeTools, setActiveTools] = (0, import_react22.useState)([]);
70399
+ const [queuedMessages, setQueuedMessages] = (0, import_react22.useState)([]);
70399
70400
  const activeToolsRef = import_react22.default.useRef([]);
70400
70401
  activeToolsRef.current = activeTools;
70401
70402
  const rows = stdout?.rows ?? 24;
@@ -70554,6 +70555,13 @@ function App2({ model, mode, initialPrompt }) {
70554
70555
  setBusy(false);
70555
70556
  }
70556
70557
  }, [busy, history, model, exit, onToolStart, onToolEnd, streaming, activeTools]);
70558
+ (0, import_react22.useEffect)(() => {
70559
+ if (!busy && queuedMessages.length > 0) {
70560
+ const next = queuedMessages[0];
70561
+ setQueuedMessages((q) => q.slice(1));
70562
+ setTimeout(() => submit(next), 100);
70563
+ }
70564
+ }, [busy, queuedMessages]);
70557
70565
  (0, import_react22.useEffect)(() => {
70558
70566
  if (initialPrompt) submit(initialPrompt);
70559
70567
  }, []);
@@ -70563,6 +70571,24 @@ function App2({ model, mode, initialPrompt }) {
70563
70571
  if (key.ctrl && ch === "c") {
70564
70572
  setBusy(false);
70565
70573
  setStreaming("");
70574
+ return;
70575
+ }
70576
+ if (key.return && input.trim()) {
70577
+ setQueuedMessages((q) => [...q, input.trim()]);
70578
+ setInput("");
70579
+ return;
70580
+ }
70581
+ if (key.backspace || key.delete) {
70582
+ setInput((p) => p.slice(0, -1));
70583
+ return;
70584
+ }
70585
+ if (key.escape) {
70586
+ setInput("");
70587
+ return;
70588
+ }
70589
+ if (!key.ctrl && !key.meta && ch) {
70590
+ setInput((p) => p + ch);
70591
+ return;
70566
70592
  }
70567
70593
  return;
70568
70594
  }
@@ -70633,8 +70659,15 @@ function App2({ model, mode, initialPrompt }) {
70633
70659
  " "
70634
70660
  ] }),
70635
70661
  input.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "magenta", children: input }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: input }),
70636
- !busy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", children: "\u258E" })
70662
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", children: "\u258E" })
70637
70663
  ] }),
70664
+ queuedMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
70665
+ " ",
70666
+ queuedMessages.length,
70667
+ " queued message",
70668
+ queuedMessages.length > 1 ? "s" : "",
70669
+ " \u2014 will send after current response"
70670
+ ] }) }),
70638
70671
  showSlashMenu && filteredCommands.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, children: filteredCommands.map((cmd, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
70639
70672
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: i === slashSelected ? "cyan" : void 0, bold: i === slashSelected, children: i === slashSelected ? "\u25B8 " : " " }),
70640
70673
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { color: i === slashSelected ? "cyan" : "blue", children: [
@@ -71022,7 +71055,7 @@ var VERSION, BUILD_TIME, PACKAGE_NAME2, ISSUES_URL2, startupTimestamps, original
71022
71055
  var init_index = __esm({
71023
71056
  "src/cli/index.ts"() {
71024
71057
  VERSION = "0.1.2";
71025
- BUILD_TIME = "2026-03-20T17:30:01.515Z";
71058
+ BUILD_TIME = "2026-03-20T17:39:26.799Z";
71026
71059
  PACKAGE_NAME2 = "@hasna/coders";
71027
71060
  ISSUES_URL2 = "https://github.com/hasnaxyz/open-coders/issues";
71028
71061
  startupTimestamps = {};