@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.
- package/dist/render/termrender.js +16 -17
- package/dist/render/version.d.ts +1 -1
- package/dist/render/version.js +1 -1
- package/package.json +1 -1
|
@@ -97,11 +97,14 @@ export function ensureRenderer() {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
try {
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
|
|
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
|
|
197
|
-
|
|
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
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
});
|
package/dist/render/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TERMRENDER_VERSION = "
|
|
1
|
+
export declare const TERMRENDER_VERSION = "3.0.0";
|
package/dist/render/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const TERMRENDER_VERSION = '
|
|
1
|
+
export const TERMRENDER_VERSION = '3.0.0';
|