@zhongqian97-code/ecode 0.5.68 → 0.5.69

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/index.js CHANGED
@@ -909,7 +909,7 @@ Node.js 16/18 \u8BF7\u4F7F\u7528 --web \u6216 --pipe \u6A21\u5F0F\u3002
909
909
  );
910
910
  process.exit(1);
911
911
  }
912
- const { App, React, render, createStdinFilter } = await import("./ui-HQUS2ZJG.js");
912
+ const { App, React, render, createStdinFilter } = await import("./ui-62ULGO6H.js");
913
913
  const stdinFilter = process.stdin.isTTY ? createStdinFilter(process.stdin) : process.stdin;
914
914
  render(
915
915
  React.createElement(App, { config: finalConfig, version: VERSION, autoMode, registry, trustedSkillDirs, initialMessages, stdinFilter }),
@@ -984,7 +984,6 @@ ${contextSection}` : contextSection;
984
984
  }
985
985
 
986
986
  // src/ui/mouseCoords.ts
987
- var STATUS_BAR_ROWS = 1;
988
987
  function computeVisibleWindow(totalLines, scrollOffset, historyMaxHeight) {
989
988
  const end = Math.max(0, Math.min(totalLines, totalLines - scrollOffset));
990
989
  const initialStart = Math.max(0, end - historyMaxHeight);
@@ -995,14 +994,11 @@ function computeVisibleWindow(totalLines, scrollOffset, historyMaxHeight) {
995
994
  }
996
995
  function mouseRowToLineIndex(opts) {
997
996
  if (opts.visibleCount <= 0) return null;
998
- const bottomRows = opts.bottomChromeRows ?? STATUS_BAR_ROWS + (opts.skillAcRows ?? 0) + (opts.fileAcRows ?? 0) + (opts.selectedItemsRows ?? 0) + (opts.inputRows ?? 1);
999
- const innerBoxHeight = opts.terminalRows - bottomRows;
1000
- const chTopRow = innerBoxHeight - opts.visibleCount;
1001
- const chBottomRow = innerBoxHeight - 1;
1002
- if (opts.mouseRow < chTopRow || opts.mouseRow > chBottomRow) return null;
997
+ const chBottomRow = opts.chTopRow + opts.visibleCount - 1;
998
+ if (opts.mouseRow < opts.chTopRow || opts.mouseRow > chBottomRow) return null;
1003
999
  const indicatorOffset = opts.hasScrollIndicator ? 1 : 0;
1004
- if (opts.mouseRow < chTopRow + indicatorOffset) return null;
1005
- return opts.mouseRow - chTopRow - indicatorOffset;
1000
+ if (opts.mouseRow < opts.chTopRow + indicatorOffset) return null;
1001
+ return opts.mouseRow - opts.chTopRow - indicatorOffset;
1006
1002
  }
1007
1003
 
1008
1004
  // src/ui/App.tsx
@@ -2510,6 +2506,17 @@ function handleMetaAlignCommand(input) {
2510
2506
  return `**[meta-align \u9519\u8BEF]** ${String(err)}`;
2511
2507
  }
2512
2508
  }
2509
+ function absoluteTop(node) {
2510
+ var _a;
2511
+ if (!(node == null ? void 0 : node.yogaNode)) return null;
2512
+ let top = 0;
2513
+ let cur = node;
2514
+ while (cur) {
2515
+ top += ((_a = cur.yogaNode) == null ? void 0 : _a.getComputedTop()) ?? 0;
2516
+ cur = cur.parentNode ?? null;
2517
+ }
2518
+ return top;
2519
+ }
2513
2520
  function formatMetaAlignOutput(result, model) {
2514
2521
  const { resolvedTaskType, modelProfileSummary, executionPolicy, materializedArtifacts } = result;
2515
2522
  const lines = [
@@ -2592,10 +2599,9 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
2592
2599
  historyMaxHeightRef.current = historyMaxHeight;
2593
2600
  const selectionStateRef = useRef2(selectionState);
2594
2601
  selectionStateRef.current = selectionState;
2595
- const bottomChromeRef = useRef2(null);
2602
+ const chBoxRef = useRef2(null);
2603
+ const inputBoxRef = useRef2(null);
2596
2604
  const inputRowsRef = useRef2(1);
2597
- const terminalRowsRef = useRef2((stdout == null ? void 0 : stdout.rows) ?? 24);
2598
- terminalRowsRef.current = (stdout == null ? void 0 : stdout.rows) ?? 24;
2599
2605
  const pendingConfirmRef = useRef2(null);
2600
2606
  const abortControllerRef = useRef2(null);
2601
2607
  const llmRef = useRef2(llmClient ?? createProvider(resolveActiveProfile(config)));
@@ -2693,11 +2699,10 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
2693
2699
  }
2694
2700
  return;
2695
2701
  }
2696
- const tRows = terminalRowsRef.current;
2697
- const inRows = inputRowsRef.current;
2698
- const inputStartRow = tRows - inRows;
2699
- if (e.row >= inputStartRow && e.row <= tRows - 1) {
2700
- const localRow = e.row - inputStartRow;
2702
+ const inputTop = absoluteTop(inputBoxRef.current);
2703
+ const inputHeight = inputBoxRef.current ? measureElement(inputBoxRef.current).height : inputRowsRef.current;
2704
+ if (inputTop !== null && e.row >= inputTop && e.row <= inputTop + inputHeight - 1) {
2705
+ const localRow = e.row - inputTop;
2701
2706
  if (e.type === "leftDown") {
2702
2707
  (_a = inputRef.current) == null ? void 0 : _a.setCursorByClick(localRow, e.col);
2703
2708
  (_b = inputRef.current) == null ? void 0 : _b.startInputSelection(localRow, e.col);
@@ -2719,16 +2724,11 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
2719
2724
  scrollOffsetRef.current,
2720
2725
  historyMaxHeightRef.current
2721
2726
  );
2722
- let bottomRows;
2723
- if (bottomChromeRef.current) {
2724
- const m = measureElement(bottomChromeRef.current);
2725
- if (m && m.height > 0) bottomRows = m.height;
2726
- }
2727
+ const chTopRow = absoluteTop(chBoxRef.current);
2728
+ if (chTopRow === null) return;
2727
2729
  const lineIdx = mouseRowToLineIndex({
2728
2730
  mouseRow: e.row,
2729
- terminalRows: tRows,
2730
- bottomChromeRows: bottomRows,
2731
- inputRows: inRows,
2731
+ chTopRow,
2732
2732
  visibleCount: window.visibleCount,
2733
2733
  hasScrollIndicator: window.hasScrollIndicator
2734
2734
  });
@@ -3217,7 +3217,7 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
3217
3217
  const acOpen = isOpen(acState, skillSuggestions);
3218
3218
  const facOpen = isOpen2(fileAcState, fileSuggestions);
3219
3219
  return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", height: "100%", children: [
3220
- /* @__PURE__ */ jsx6(Box6, { flexGrow: 1, flexDirection: "column", justifyContent: "flex-end", children: /* @__PURE__ */ jsx6(
3220
+ /* @__PURE__ */ jsx6(Box6, { flexGrow: 1, flexDirection: "column", justifyContent: "flex-end", children: /* @__PURE__ */ jsx6(Box6, { flexDirection: "column", ref: chBoxRef, children: /* @__PURE__ */ jsx6(
3221
3221
  ConversationHistory,
3222
3222
  {
3223
3223
  messages,
@@ -3227,8 +3227,8 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
3227
3227
  scrollOffset,
3228
3228
  selection: selectionState
3229
3229
  }
3230
- ) }),
3231
- /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", ref: bottomChromeRef, children: [
3230
+ ) }) }),
3231
+ /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
3232
3232
  /* @__PURE__ */ jsx6(
3233
3233
  StatusBar,
3234
3234
  {
@@ -3259,7 +3259,7 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
3259
3259
  "Selected: ",
3260
3260
  selectedItems.map((i) => i.label).join(", ")
3261
3261
  ] }) }),
3262
- /* @__PURE__ */ jsx6(
3262
+ /* @__PURE__ */ jsx6(Box6, { flexDirection: "column", ref: inputBoxRef, children: /* @__PURE__ */ jsx6(
3263
3263
  Input_default,
3264
3264
  {
3265
3265
  ref: inputRef,
@@ -3268,7 +3268,7 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
3268
3268
  onChange: handleInputTextChange,
3269
3269
  placeholder: status === "awaiting_confirm" ? "y / n" : void 0
3270
3270
  }
3271
- )
3271
+ ) })
3272
3272
  ] })
3273
3273
  ] });
3274
3274
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhongqian97-code/ecode",
3
- "version": "0.5.68",
3
+ "version": "0.5.69",
4
4
  "description": "A minimal Claude Code clone with REPL interface and bash tool calling",
5
5
  "type": "module",
6
6
  "author": "zhongqian97-code",