omnius 1.0.349 → 1.0.351

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
@@ -578051,11 +578051,20 @@ Use the saved fact to continue the promised synthesis or next concrete step, or
578051
578051
  const repeatGateEligible = isReadLike || tc.name === "memory_write";
578052
578052
  if (repeatGateEligible && _existingFp !== void 0 && _repeatGateMax > 0) {
578053
578053
  if (criticDecision.hitNumber >= _repeatGateMax) {
578054
- repeatShortCircuit = {
578055
- success: false,
578056
- output: "",
578057
- error: this._buildRepeatGateBlock(tc.name, tc.arguments ?? {}, criticDecision.hitNumber)
578058
- };
578054
+ if (isReadLike) {
578055
+ repeatShortCircuit = {
578056
+ success: true,
578057
+ output: `[STOP RE-READING — you have requested this exact read ${criticDecision.hitNumber}× and you ALREADY HAVE its full content, shown again below. Do NOT read it again. Act on it: edit the file, run a verification, or call task_complete. If a previous edit failed with "old_string not found", your old_string did not match the file — copy it EXACTLY (including indentation) from the content below.]
578058
+
578059
+ ` + _existingFp.result
578060
+ };
578061
+ } else {
578062
+ repeatShortCircuit = {
578063
+ success: false,
578064
+ output: "",
578065
+ error: this._buildRepeatGateBlock(tc.name, tc.arguments ?? {}, criticDecision.hitNumber)
578066
+ };
578067
+ }
578059
578068
  } else {
578060
578069
  repeatShortCircuit = {
578061
578070
  success: true,
@@ -578953,7 +578962,15 @@ Respond with EXACTLY this structure before your next tool call:
578953
578962
  const cacheableMemoryNoop = tc.name === "memory_write" && result.success && result.noop;
578954
578963
  if (isReadLike && result.success || tc.name === "shell" || cacheableMemoryNoop) {
578955
578964
  recentToolResults.set(toolFingerprint, {
578956
- result: tc.name === "shell" ? this._buildShellCacheResult(tc.arguments, result) : (result.output ?? "").slice(0, 2e3),
578965
+ result: tc.name === "shell" ? this._buildShellCacheResult(tc.arguments, result) : (
578966
+ // Read-like results are SERVED BACK to the model when the
578967
+ // repeat gate fires, so they must stay complete enough to
578968
+ // edit against — truncating to 2KB cut the tail off normal
578969
+ // source files (the "old_string not found" cascade). Large
578970
+ // files are handled by branch-extract upstream, so 16KB
578971
+ // here covers ordinary files without bloating the cache.
578972
+ isReadLike ? (result.output ?? "").slice(0, 16e3) : (result.output ?? "").slice(0, 2e3)
578973
+ ),
578957
578974
  compacted: false
578958
578975
  });
578959
578976
  if (isReadLike && result.success) {
@@ -614567,11 +614584,20 @@ ${CONTENT_BG_SEQ}`);
614567
614584
  * many times per second (e.g. the shell timer) refreshes without the whole
614568
614585
  * TUI flashing. Implements the DynamicBlockHost.refreshDynamicBlocks contract.
614569
614586
  */
614587
+ _dynamicRefreshCoalesceTimer = null;
614570
614588
  refreshDynamicBlocks() {
614571
614589
  if (!this.active) return;
614572
614590
  if (this._contentScrollOffset > 0 || this._mouseSelecting) return;
614573
614591
  if (isOverlayActive() || this._suspendContentLayer) return;
614574
- this.repaintContent();
614592
+ if (this._dynamicRefreshCoalesceTimer) return;
614593
+ this._dynamicRefreshCoalesceTimer = setTimeout(() => {
614594
+ this._dynamicRefreshCoalesceTimer = null;
614595
+ if (!this.active) return;
614596
+ if (this._contentScrollOffset > 0 || this._mouseSelecting) return;
614597
+ if (isOverlayActive() || this._suspendContentLayer) return;
614598
+ this.repaintContent();
614599
+ }, 16);
614600
+ this._dynamicRefreshCoalesceTimer.unref?.();
614575
614601
  }
614576
614602
  clearStreamingRepaintTimer() {
614577
614603
  if (!this._streamingRepaintTimer) return;
@@ -614690,7 +614716,23 @@ ${CONTENT_BG_SEQ}`);
614690
614716
  }));
614691
614717
  });
614692
614718
  }
614719
+ // Memoize per-line reflow: it is a PURE function of (line, width), and
614720
+ // reflowContentLines re-wraps the entire scrollback every repaint. Caching
614721
+ // it makes a static line reflow ONCE instead of on every paint (which, for a
614722
+ // long session, was the O(n) per-repaint cost behind the freeze). Callers map
614723
+ // over the result (never mutate it), so a shared cached array is safe. Key
614724
+ // includes width, so a resize naturally re-keys; bounded with clear-on-grow.
614725
+ _reflowLineCache = /* @__PURE__ */ new Map();
614693
614726
  reflowContentLine(line, width) {
614727
+ const key = `${width}\0${line}`;
614728
+ const cached = this._reflowLineCache.get(key);
614729
+ if (cached) return cached;
614730
+ const result = this._reflowContentLineUncached(line, width);
614731
+ if (this._reflowLineCache.size > 8e3) this._reflowLineCache.clear();
614732
+ this._reflowLineCache.set(key, result);
614733
+ return result;
614734
+ }
614735
+ _reflowContentLineUncached(line, width) {
614694
614736
  const visible = stripAnsi(line);
614695
614737
  if (visible.length <= width) return [line];
614696
614738
  const continuationIndent = this.hangingIndentForVisibleLine(visible, width);
@@ -614943,7 +614985,21 @@ ${CONTENT_BG_SEQ}`);
614943
614985
  const h = this.contentHeight;
614944
614986
  const livePartialLine = this.getLiveBufferedLine();
614945
614987
  const w = termCols();
614988
+ const _perfOn = process.env["OMNIUS_TUI_PERF"] === "1";
614989
+ const _t0 = _perfOn ? performance.now() : 0;
614946
614990
  const reflowedLines = this.reflowContentLines(livePartialLine, w);
614991
+ if (_perfOn) {
614992
+ const _ms = performance.now() - _t0;
614993
+ if (_ms > 8) {
614994
+ try {
614995
+ process.stderr.write(
614996
+ `[TUI-PERF] reflow ${_ms.toFixed(1)}ms (lines=${reflowedLines.length}, w=${w})
614997
+ `
614998
+ );
614999
+ } catch {
615000
+ }
615001
+ }
615002
+ }
614947
615003
  const totalLines = reflowedLines.length;
614948
615004
  const maxOffset = Math.max(0, totalLines - h);
614949
615005
  if (this._contentScrollOffset > maxOffset) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.349",
3
+ "version": "1.0.351",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.349",
9
+ "version": "1.0.351",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
@@ -6153,12 +6153,16 @@
6153
6153
  }
6154
6154
  },
6155
6155
  "node_modules/range-parser": {
6156
- "version": "1.2.1",
6157
- "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
6158
- "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
6156
+ "version": "1.3.0",
6157
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
6158
+ "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
6159
6159
  "license": "MIT",
6160
6160
  "engines": {
6161
6161
  "node": ">= 0.6"
6162
+ },
6163
+ "funding": {
6164
+ "type": "opencollective",
6165
+ "url": "https://opencollective.com/express"
6162
6166
  }
6163
6167
  },
6164
6168
  "node_modules/raw-body": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.349",
3
+ "version": "1.0.351",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",