@blockrun/franklin 3.6.7 → 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.
@@ -3,8 +3,8 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import chalk from 'chalk';
5
5
  import { BLOCKRUN_DIR, DEFAULT_PROXY_PORT } from '../config.js';
6
- const PID_FILE = path.join(BLOCKRUN_DIR, 'runcode.pid');
7
- const LOG_FILE = path.join(BLOCKRUN_DIR, 'runcode-debug.log');
6
+ const PID_FILE = path.join(BLOCKRUN_DIR, 'franklin.pid');
7
+ const LOG_FILE = path.join(BLOCKRUN_DIR, 'franklin-debug.log');
8
8
  function readPid() {
9
9
  try {
10
10
  const raw = fs.readFileSync(PID_FILE, 'utf-8').trim();
@@ -63,9 +63,9 @@ export async function initCommand(options) {
63
63
  <key>KeepAlive</key>
64
64
  <false/>
65
65
  <key>StandardOutPath</key>
66
- <string>${os.homedir()}/.blockrun/runcode-debug.log</string>
66
+ <string>${os.homedir()}/.blockrun/franklin-debug.log</string>
67
67
  <key>StandardErrorPath</key>
68
- <string>${os.homedir()}/.blockrun/runcode-debug.log</string>
68
+ <string>${os.homedir()}/.blockrun/franklin-debug.log</string>
69
69
  </dict>
70
70
  </plist>`;
71
71
  fs.mkdirSync(LAUNCH_AGENT_DIR, { recursive: true });
@@ -2,7 +2,8 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import chalk from 'chalk';
4
4
  import { BLOCKRUN_DIR } from '../config.js';
5
- const LOG_FILE = path.join(BLOCKRUN_DIR, 'runcode-debug.log');
5
+ const LOG_FILE = path.join(BLOCKRUN_DIR, 'franklin-debug.log');
6
+ const LEGACY_LOG_FILE = path.join(BLOCKRUN_DIR, 'runcode-debug.log');
6
7
  const MAX_LOG_SIZE = 10 * 1024 * 1024; // 10MB auto-rotate threshold
7
8
  export function logsCommand(options) {
8
9
  if (options.clear) {
@@ -15,9 +16,16 @@ export function logsCommand(options) {
15
16
  }
16
17
  return;
17
18
  }
19
+ // Migrate legacy log file
20
+ if (!fs.existsSync(LOG_FILE) && fs.existsSync(LEGACY_LOG_FILE)) {
21
+ try {
22
+ fs.renameSync(LEGACY_LOG_FILE, LOG_FILE);
23
+ }
24
+ catch { /* best effort */ }
25
+ }
18
26
  if (!fs.existsSync(LOG_FILE)) {
19
- console.log(chalk.dim('No logs yet. Start runcode with --debug to enable logging:'));
20
- console.log(chalk.bold(' runcode start --debug'));
27
+ console.log(chalk.dim('No logs yet. Start franklin with --debug to enable logging:'));
28
+ console.log(chalk.bold(' franklin start --debug'));
21
29
  return;
22
30
  }
23
31
  // Auto-rotate: if file is over threshold, keep only last half
@@ -87,10 +87,10 @@ function launchProxy(server, port, debug) {
87
87
  });
88
88
  server.listen(port, () => {
89
89
  console.log(chalk.green(`✓ Proxy running on port ${port}`));
90
- console.log(chalk.dim(` Usage tracking: ~/.blockrun/runcode-stats.json`));
90
+ console.log(chalk.dim(` Usage tracking: ~/.blockrun/franklin-stats.json`));
91
91
  if (debug)
92
- console.log(chalk.dim(` Debug log: ~/.blockrun/runcode-debug.log`));
93
- console.log(chalk.dim(` Run 'runcode stats' to view statistics\n`));
92
+ console.log(chalk.dim(` Debug log: ~/.blockrun/franklin-debug.log`));
93
+ console.log(chalk.dim(` Run 'franklin stats' to view statistics\n`));
94
94
  console.log('Set this in your shell to use with Claude Code:\n');
95
95
  console.log(chalk.bold(` export ANTHROPIC_BASE_URL=http://localhost:${port}/api`));
96
96
  console.log(chalk.bold(` export ANTHROPIC_AUTH_TOKEN=x402-proxy-handles-auth`));
@@ -158,7 +158,9 @@ export function createPanelServer(port) {
158
158
  }
159
159
  });
160
160
  // Watch stats file for changes → push to SSE clients
161
- const statsFile = path.join(BLOCKRUN_DIR, 'runcode-stats.json');
161
+ const statsFile = fs.existsSync(path.join(BLOCKRUN_DIR, 'franklin-stats.json'))
162
+ ? path.join(BLOCKRUN_DIR, 'franklin-stats.json')
163
+ : path.join(BLOCKRUN_DIR, 'runcode-stats.json');
162
164
  if (fs.existsSync(statsFile)) {
163
165
  fs.watchFile(statsFile, { interval: 2000 }, () => {
164
166
  try {
@@ -9,15 +9,27 @@ import { OPUS_PRICING } from '../pricing.js';
9
9
  import { BLOCKRUN_DIR } from '../config.js';
10
10
  let resolvedStatsFile = null;
11
11
  function preferredStatsFile() {
12
+ return path.join(BLOCKRUN_DIR, 'franklin-stats.json');
13
+ }
14
+ function legacyStatsFile() {
12
15
  return path.join(BLOCKRUN_DIR, 'runcode-stats.json');
13
16
  }
14
17
  function fallbackStatsFile() {
15
- return path.join(os.tmpdir(), 'runcode', 'runcode-stats.json');
18
+ return path.join(os.tmpdir(), 'franklin', 'franklin-stats.json');
16
19
  }
17
20
  export function getStatsFilePath() {
18
21
  if (resolvedStatsFile)
19
22
  return resolvedStatsFile;
20
- for (const file of [preferredStatsFile(), fallbackStatsFile()]) {
23
+ // Migrate legacy stats file if it exists and new one doesn't
24
+ const preferred = preferredStatsFile();
25
+ const legacy = legacyStatsFile();
26
+ if (!fs.existsSync(preferred) && fs.existsSync(legacy)) {
27
+ try {
28
+ fs.renameSync(legacy, preferred);
29
+ }
30
+ catch { /* best effort */ }
31
+ }
32
+ for (const file of [preferred, fallbackStatsFile()]) {
21
33
  try {
22
34
  fs.mkdirSync(path.dirname(file), { recursive: true });
23
35
  resolvedStatsFile = file;
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 — clicks toggle tool results, drag selects text
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)
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/franklin",
3
- "version": "3.6.7",
3
+ "version": "3.6.9",
4
4
  "description": "Franklin — The AI agent with a wallet. Spends USDC autonomously to get real work done. Pay per action, no subscriptions.",
5
5
  "type": "module",
6
6
  "exports": {