openzoo 0.48.15 → 0.48.16

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/lib/grokui.mjs +24 -4
  2. package/package.json +1 -1
package/lib/grokui.mjs CHANGED
@@ -516,7 +516,7 @@ function execCommand(command, cwd) {
516
516
  exec(command, { cwd, shell: RUN_SHELL, timeout: RUN_TIMEOUT_MS, maxBuffer: 10 * 1024 * 1024 }, (err, stdout, stderr) => {
517
517
  let out = (stdout || '') + (stderr ? '\n' + stderr : '');
518
518
  if (err) out += `\n(exit ${err.code ?? 1})`;
519
- resolve(out.slice(0, 6000) || '(no output)');
519
+ resolve(keepWhole(out) || '(no output)');
520
520
  });
521
521
  });
522
522
  }
@@ -572,6 +572,26 @@ const usd = (n) => (n >= 0.01 || n === 0 ? '$' + n.toFixed(2) : '$' + n.toFixed(
572
572
  //
573
573
  // So: feed back the head and tail (where the answer nearly always is) and say
574
574
  // plainly that the middle is recallable rather than lost.
575
+ // Directive output goes into t.history VERBATIM, because bindThread() binds
576
+ // history — so whatever is cut here is not "elided", it is DESTROYED before
577
+ // the holographic context ever sees it.
578
+ //
579
+ // These used to be hard slices at 4-8k right where the output was produced:
580
+ // a command's stdout, a READ, a FETCH, an MCP tool result. The user saw
581
+ // "…(truncated)" and the rest was simply gone — unrecallable, because it was
582
+ // never stored. That is the opposite of what this product does.
583
+ //
584
+ // So: keep the whole thing (up to a sanity ceiling that exists only to stop a
585
+ // runaway `yes` or a binary dump from bloating the thread store), let it bind,
586
+ // and let condense() decide how much the MODEL sees on the next hop. Big
587
+ // outputs are exactly the case leCore is for.
588
+ const KEEP_MAX = Number(process.env.OZ_KEEP_MAX || 400000);
589
+ function keepWhole(text) {
590
+ const s = String(text ?? '');
591
+ if (s.length <= KEEP_MAX) return s;
592
+ return `${s.slice(0, KEEP_MAX)}\n…[${s.length - KEEP_MAX} chars over the ${KEEP_MAX}-char store ceiling and dropped]`;
593
+ }
594
+
575
595
  const FEEDBACK_MAX = Number(process.env.OZ_FEEDBACK_MAX || 3000);
576
596
  function condense(label, text) {
577
597
  const s = String(text ?? '');
@@ -908,7 +928,7 @@ async function tryDirective(reply, originId) {
908
928
  const rel = readD[1].trim();
909
929
  try {
910
930
  const data = readFileSync(safeResolveIn(dirFor(originId), rel), 'utf8');
911
- return `${rel}:\n${data.slice(0, 4000)}${data.length > 4000 ? '\n…(truncated)' : ''}`;
931
+ return `${rel}:\n${keepWhole(data)}`;
912
932
  } catch (e) { return `Couldn't read ${rel}: ${e.message}`; }
913
933
  }
914
934
  // EDIT beats WRITE for changing part of a file: WRITE overwrites the whole
@@ -1090,7 +1110,7 @@ async function tryDirective(reply, originId) {
1090
1110
  + `directive instead:\n MCP: ${url}\nto list its tools, then\n `
1091
1111
  + `MCP: ${url} | <tool> | {"arg": "value"}\nto call one.`;
1092
1112
  }
1093
- return `${url} (${r.status}):\n${text.slice(0, 8000)}${text.length > 8000 ? '\n…(truncated)' : ''}`;
1113
+ return `${url} (${r.status}):\n${keepWhole(text)}`;
1094
1114
  } catch (e) { return `Couldn't fetch ${url}: ${e.message}`; }
1095
1115
  }
1096
1116
 
@@ -1194,7 +1214,7 @@ async function mcpDirective(url, tool, args) {
1194
1214
  const out = (res?.content || [])
1195
1215
  .map((c) => (c.type === 'text' ? c.text : `[${c.type}]`))
1196
1216
  .join('\n') || JSON.stringify(res ?? call.raw);
1197
- return `${banner}\n$ ${tool}\n${out.slice(0, 6000)}${out.length > 6000 ? '\n…(truncated)' : ''}`;
1217
+ return `${banner}\n$ ${tool}\n${keepWhole(out)}`;
1198
1218
  } catch (e) {
1199
1219
  return `MCP ${url}: ${e.message}`;
1200
1220
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.48.15",
3
+ "version": "0.48.16",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",