osborn 0.9.163 → 0.9.165

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.
Files changed (2) hide show
  1. package/bin/cli.js +19 -17
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -3,8 +3,24 @@
3
3
  import { spawn } from 'child_process'
4
4
  import { fileURLToPath } from 'url'
5
5
  import { dirname, join } from 'path'
6
- import { readFileSync, existsSync, symlinkSync, rmSync } from 'fs'
7
- import { homedir } from 'os'
6
+ import { readFileSync, existsSync, lstatSync, symlinkSync } from 'fs'
7
+ import os from 'os'
8
+
9
+ // On Fly machines, home is /root (ephemeral) but sessions live on /workspace/.claude.
10
+ // Recreate the symlink on every startup so sessions survive image updates.
11
+ try {
12
+ const home = os.homedir()
13
+ const target = '/workspace/.claude'
14
+ const link = join(home, '.claude')
15
+ if (existsSync(target) && home !== '/workspace') {
16
+ let needsLink = true
17
+ try {
18
+ const stat = lstatSync(link)
19
+ needsLink = !stat.isSymbolicLink()
20
+ } catch {}
21
+ if (needsLink) symlinkSync(target, link)
22
+ }
23
+ } catch {}
8
24
 
9
25
  const __filename = fileURLToPath(import.meta.url)
10
26
  const __dirname = dirname(__filename)
@@ -60,21 +76,6 @@ Example:
60
76
  process.exit(0)
61
77
  }
62
78
 
63
- // Ensure ~/.claude → /workspace/.claude symlink exists (Fly cloud machines run
64
- // this binary directly, bypassing entrypoint.sh which normally creates it).
65
- import { symlinkSync, rmSync } from 'fs'
66
- import { homedir } from 'os'
67
- {
68
- const claudeLink = join(homedir(), '.claude')
69
- const claudeTarget = '/workspace/.claude'
70
- if (existsSync(claudeTarget)) {
71
- try {
72
- rmSync(claudeLink, { recursive: true, force: true })
73
- symlinkSync(claudeTarget, claudeLink)
74
- } catch {}
75
- }
76
- }
77
-
78
79
  // Determine mode (default to 'dev' if no mode specified)
79
80
  let mode = 'dev'
80
81
  if (args.includes('start')) {
@@ -85,6 +86,7 @@ if (args.includes('start')) {
85
86
  }
86
87
 
87
88
  // Use src/index.ts (dev) if available, otherwise dist/index.js (npm install)
89
+ import { existsSync } from 'fs'
88
90
  const srcPath = join(__dirname, '..', 'src', 'index.ts')
89
91
  const distPath = join(__dirname, '..', 'dist', 'index.js')
90
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.163",
3
+ "version": "0.9.165",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {