@crouton-kit/humanloop 0.3.5 → 0.3.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.
@@ -97,11 +97,14 @@ export function ensureRenderer() {
97
97
  return;
98
98
  }
99
99
  try {
100
- // Skip venv creation on drift (venv exists with wrong termrender version)
101
- // `uv pip install` into the existing venv replaces it in place. Only
102
- // create when the venv directory is genuinely absent.
103
- if (!existsSync(VENV_DIR)) {
104
- execFileSync('uv', ['venv', VENV_DIR], { stdio: 'pipe', timeout: 60000 });
100
+ // (Re)create the venv whenever the interpreter is missing covers both
101
+ // "directory absent" and "directory present but bin/python stripped"
102
+ // (seen in the wild when pnpm rebuilds/dedupes node_modules or uv rotates
103
+ // its managed Python store). `--clear` makes uv wipe any partial state
104
+ // rather than refusing on the existing dir. If the interpreter is intact,
105
+ // skip straight to `uv pip install` so version drift reuses the venv.
106
+ if (!existsSync(VENV_PYTHON)) {
107
+ execFileSync('uv', ['venv', '--clear', VENV_DIR], { stdio: 'pipe', timeout: 60000 });
105
108
  }
106
109
  execFileSync('uv', ['pip', 'install', '--python', VENV_PYTHON, `termrender==${TERMRENDER_VERSION}`], { stdio: 'pipe', timeout: 120000 });
107
110
  }
@@ -193,9 +196,8 @@ export function renderMarkdown(md, width) {
193
196
  ensureRenderer();
194
197
  if (rendererState === 'ready') {
195
198
  try {
196
- const input = JSON.stringify({ source: md, width, color: true });
197
- const out = execFileSync(VENV_BIN, ['doc', 'render'], {
198
- input,
199
+ const out = execFileSync(VENV_BIN, ['doc', 'render', '--width', String(width), '--color', 'on'], {
200
+ input: md,
199
201
  encoding: 'utf-8',
200
202
  timeout: 5000,
201
203
  stdio: ['pipe', 'pipe', 'pipe'],
@@ -221,9 +223,8 @@ export function checkMarkdown(md) {
221
223
  // plaintext later. Bricking deck validation here would be the wrong default.
222
224
  if (rendererState !== 'ready')
223
225
  return { ok: true };
224
- const input = JSON.stringify({ source: md });
225
226
  const result = spawnSync(VENV_BIN, ['doc', 'check'], {
226
- input,
227
+ input: md,
227
228
  encoding: 'utf-8',
228
229
  timeout: 5000,
229
230
  });
@@ -262,13 +263,11 @@ export function displayInPane(path, opts = {}) {
262
263
  ensureRenderer();
263
264
  if (rendererState !== 'ready')
264
265
  return {};
265
- const input = JSON.stringify({
266
- path,
267
- watch: opts.watch !== false,
268
- window: opts.newWindow ? 'new' : 'split',
269
- });
270
- const result = spawnSync(VENV_BIN, ['pane', 'open'], {
271
- input,
266
+ const args = ['pane', 'open', path];
267
+ if (opts.watch !== false)
268
+ args.push('--watch');
269
+ args.push('--window', opts.newWindow ? 'new' : 'split');
270
+ const result = spawnSync(VENV_BIN, args, {
272
271
  encoding: 'utf-8',
273
272
  stdio: ['pipe', 'pipe', 'pipe'],
274
273
  });
@@ -1 +1 @@
1
- export declare const TERMRENDER_VERSION = "2.1.0";
1
+ export declare const TERMRENDER_VERSION = "3.0.0";
@@ -1 +1 @@
1
- export const TERMRENDER_VERSION = '2.1.0';
1
+ export const TERMRENDER_VERSION = '3.0.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crouton-kit/humanloop",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Human-in-the-loop decision TUI — agents write questions, humans answer them",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",