@blockrun/franklin 3.6.8 → 3.6.9
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/ui/app.js +8 -2
- package/dist/ui/mouse.d.ts +5 -0
- package/dist/ui/mouse.js +12 -0
- package/package.json +1 -1
package/dist/ui/app.js
CHANGED
|
@@ -13,7 +13,7 @@ import { renderMarkdown } from './markdown.js';
|
|
|
13
13
|
import { resolveModel, PICKER_CATEGORIES, PICKER_MODELS_FLAT, } from './model-picker.js';
|
|
14
14
|
import { estimateCost } from '../pricing.js';
|
|
15
15
|
import { formatTokens, shortModelName } from '../stats/format.js';
|
|
16
|
-
import { mouse } from './mouse.js';
|
|
16
|
+
import { mouse, forceDisableMouseTracking } from './mouse.js';
|
|
17
17
|
// ─── Full-width input box ──────────────────────────────────────────────────
|
|
18
18
|
function InputBox({ input, setInput, onSubmit, model, balance, sessionCost, queued, queuedCount, focused, busy, contextPct, vimMode, onVimModeChange }) {
|
|
19
19
|
const { stdout } = useStdout();
|
|
@@ -395,8 +395,14 @@ function RunCodeApp({ initialModel, workDir, walletAddress, walletBalance, chain
|
|
|
395
395
|
turnSavingsRef.current = undefined;
|
|
396
396
|
onSubmit(trimmed);
|
|
397
397
|
}, [ready, currentModel, totalCost, onSubmit, onModelChange, onAbort, onExit, exit, lastPrompt, inputHistory, showStatus]);
|
|
398
|
-
// Mouse support —
|
|
398
|
+
// Mouse support — OFF by default because Node stdin is shared: mouse escape
|
|
399
|
+
// sequences leak into Ink's input handler as typed text. Opt in with
|
|
400
|
+
// FRANKLIN_MOUSE=1 if you want click-to-expand-tool + drag-to-copy.
|
|
399
401
|
useEffect(() => {
|
|
402
|
+
// Always disable any leftover mouse tracking from a previous session
|
|
403
|
+
forceDisableMouseTracking();
|
|
404
|
+
if (process.env.FRANKLIN_MOUSE !== '1')
|
|
405
|
+
return;
|
|
400
406
|
const cleanup = mouse.enable();
|
|
401
407
|
const handleClick = (event) => {
|
|
402
408
|
// Ignore clicks in the input area (bottom 4 rows of the terminal)
|
package/dist/ui/mouse.d.ts
CHANGED
|
@@ -40,4 +40,9 @@ declare class MouseManager extends EventEmitter {
|
|
|
40
40
|
}
|
|
41
41
|
/** Singleton mouse manager. */
|
|
42
42
|
export declare const mouse: MouseManager;
|
|
43
|
+
/**
|
|
44
|
+
* Force-disable any leftover mouse tracking from a previous session.
|
|
45
|
+
* Safe to call unconditionally — if tracking is off, it's a no-op at the terminal level.
|
|
46
|
+
*/
|
|
47
|
+
export declare function forceDisableMouseTracking(): void;
|
|
43
48
|
export {};
|
package/dist/ui/mouse.js
CHANGED
|
@@ -265,3 +265,15 @@ class MouseManager extends EventEmitter {
|
|
|
265
265
|
}
|
|
266
266
|
/** Singleton mouse manager. */
|
|
267
267
|
export const mouse = new MouseManager();
|
|
268
|
+
/**
|
|
269
|
+
* Force-disable any leftover mouse tracking from a previous session.
|
|
270
|
+
* Safe to call unconditionally — if tracking is off, it's a no-op at the terminal level.
|
|
271
|
+
*/
|
|
272
|
+
export function forceDisableMouseTracking() {
|
|
273
|
+
try {
|
|
274
|
+
process.stdout.write(DISABLE_MOUSE);
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
// Ignore — stdout may not be writable in some contexts
|
|
278
|
+
}
|
|
279
|
+
}
|
package/package.json
CHANGED