@blockrun/franklin 3.6.7 → 3.6.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/franklin",
3
- "version": "3.6.7",
3
+ "version": "3.6.8",
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": {