@miphamai/cli 0.5.11 → 0.5.12

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/bin/mipham.ts CHANGED
@@ -270,13 +270,25 @@ async function runUpdate(): Promise<boolean> {
270
270
  }
271
271
 
272
272
  async function main() {
273
+ // ── Read version fresh from package.json at startup (bypasses Bun module cache) ──
274
+ const { readFileSync } = await import('node:fs')
275
+ const { join } = await import('node:path')
276
+ let APP_VERSION = '0.0.0'
277
+ try {
278
+ const pkgPath = join(import.meta.dirname!, '..', 'package.json')
279
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
280
+ APP_VERSION = pkg.version
281
+ } catch {
282
+ // fallback — version will be '0.0.0'
283
+ }
284
+
273
285
  // ── Version flag ──────────────────────────────────────────────────────────
274
286
  if (
275
287
  process.argv.includes('--version') ||
276
288
  process.argv.includes('-v') ||
277
289
  process.argv.includes('-V')
278
290
  ) {
279
- const pkg = await import('../package.json')
291
+ const pkg = JSON.parse(readFileSync(join(import.meta.dirname!, '..', 'package.json'), 'utf-8'))
280
292
  console.log(`${pkg.name} v${pkg.version}`)
281
293
  process.exit(0)
282
294
  }
@@ -301,7 +313,7 @@ async function main() {
301
313
 
302
314
  try {
303
315
  const { runApp } = await import('../src/index')
304
- await runApp({})
316
+ await runApp({ version: APP_VERSION })
305
317
  } catch (err: unknown) {
306
318
  const msg = err instanceof Error ? err.message : String(err)
307
319
  if (msg.includes('react-devtools-core')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miphamai/cli",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Mipham Code — Multi-model open-core intelligent coding terminal by MiphamAI",
5
5
  "keywords": [
6
6
  "ai",
@@ -4,8 +4,8 @@ import { PACKAGE_VERSION } from '../shared/index.ts'
4
4
 
5
5
  export const DEFAULT_CONFIG: MiphamConfig = {
6
6
  version: PACKAGE_VERSION,
7
- defaultProvider: 'anthropic',
8
- defaultModel: 'claude-sonnet-4-6',
7
+ defaultProvider: 'deepseek',
8
+ defaultModel: 'deepseek-v4-pro',
9
9
  permission: 'auto',
10
10
  providers: DEFAULT_PROVIDERS,
11
11
  }
package/src/index.tsx CHANGED
@@ -22,6 +22,7 @@ interface RunOptions {
22
22
  lang?: string
23
23
  permission?: string
24
24
  resume?: string
25
+ version?: string
25
26
  }
26
27
 
27
28
  export async function runApp(options: RunOptions): Promise<void> {
@@ -139,6 +140,7 @@ export async function runApp(options: RunOptions): Promise<void> {
139
140
  initialModel={defaultModel}
140
141
  lang={options.lang}
141
142
  skillsLoader={skillsLoader}
143
+ version={options.version}
142
144
  />,
143
145
  )
144
146
  await waitUntilExit()
package/src/ui/app.tsx CHANGED
@@ -22,6 +22,7 @@ interface AppProps {
22
22
  initialModel?: string
23
23
  lang?: string
24
24
  skillsLoader?: SkillsLoader
25
+ version?: string
25
26
  }
26
27
 
27
28
  export interface ToolMeta {
@@ -43,9 +44,8 @@ interface AgentProgress {
43
44
  startTime: number
44
45
  }
45
46
 
46
- import { PACKAGE_VERSION } from '../shared/index.ts'
47
-
48
- const VERSION = PACKAGE_VERSION
47
+ // Version is read fresh from package.json at startup via runApp prop
48
+ // (bypasses Bun module caching after npm update)
49
49
 
50
50
  type PermissionMode = 'auto' | 'ask' | 'bypass'
51
51
 
@@ -63,6 +63,7 @@ export function App({
63
63
  initialModel,
64
64
  lang: _lang,
65
65
  skillsLoader,
66
+ version,
66
67
  }: AppProps) {
67
68
  const [messages, setMessages] = useState<ChatMessage[]>([])
68
69
  const [isLoading, setIsLoading] = useState(false)
@@ -105,7 +106,7 @@ export function App({
105
106
  config,
106
107
  providerId,
107
108
  modelId,
108
- version: VERSION,
109
+ version: version || '0.0.0',
109
110
  setSessionTitle: (title: string) => setSessionTitle(title),
110
111
  setFastMode: (on: boolean) => setFastMode(on),
111
112
  setEffort: (level: string) => setEffort(level),
@@ -356,7 +357,7 @@ export function App({
356
357
  <Text color="#FFD700" bold>
357
358
  Mipham Code
358
359
  </Text>
359
- <Text dimColor>v{VERSION}</Text>
360
+ <Text dimColor>v{version || '0.0.0'}</Text>
360
361
  <Text dimColor>{modelId}</Text>
361
362
  </Box>
362
363