@miphamai/cli 0.5.1 → 0.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miphamai/cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Mipham Code — Multi-model open-core intelligent coding terminal by MiphamAI",
5
5
  "keywords": [
6
6
  "ai",
@@ -1,6 +1,6 @@
1
1
  import type { MiphamConfig } from '../shared/index.ts'
2
2
  import { DEFAULT_PROVIDERS } from '../shared/index.ts'
3
- import { PACKAGE_VERSION } from '@mipham/shared'
3
+ import { PACKAGE_VERSION } from '../shared/index.ts'
4
4
 
5
5
  export const DEFAULT_CONFIG: MiphamConfig = {
6
6
  version: PACKAGE_VERSION,
@@ -1,4 +1,4 @@
1
- import type { Message, ToolResultContent } from '@mipham/shared'
1
+ import type { Message, ToolResultContent } from '../shared/index.ts'
2
2
  import type { CacheTracker } from './context-token'
3
3
  import { estimateMessageTokens } from './context-token'
4
4
 
@@ -1,4 +1,4 @@
1
- import type { Message } from '@mipham/shared'
1
+ import type { Message } from '../shared/index.ts'
2
2
 
3
3
  export interface CacheStatus {
4
4
  totalMessages: number
@@ -1,2 +1,3 @@
1
1
  export * from './types'
2
2
  export * from './constants'
3
+ export * from './package-info'
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Mipham Code — package metadata (bundled version)
3
+ *
4
+ * Reads directly from the CLI's own package.json at runtime
5
+ * so npm consumers don't need the @mipham/shared workspace package.
6
+ */
7
+
8
+ import { readFileSync } from 'node:fs'
9
+ import path from 'node:path'
10
+
11
+ // resolve package.json relative to this source file
12
+ const PKG_PATH = path.join(import.meta.dirname!, '..', '..', 'package.json')
13
+ const pkg = JSON.parse(readFileSync(PKG_PATH, 'utf-8'))
14
+
15
+ /** npm 包全名(含 scope) */
16
+ export const PACKAGE_NAME: string = pkg.name
17
+
18
+ /** 当前发布版本 */
19
+ export const PACKAGE_VERSION: string = pkg.version
20
+
21
+ /** npm install 全局安装命令 */
22
+ export const NPM_INSTALL_COMMAND = `npm install -g ${PACKAGE_NAME}` as const
23
+
24
+ /** npm update 全局升级命令 */
25
+ export const NPM_UPDATE_COMMAND = `npm update -g ${PACKAGE_NAME}` as const
26
+
27
+ /** npm 包页面 URL */
28
+ export const NPM_URL = `https://www.npmjs.com/package/${PACKAGE_NAME}` as const
29
+
30
+ /** npm 下载量 API */
31
+ export const NPM_DOWNLOADS_API =
32
+ `https://api.npmjs.org/downloads/point/last-month/${PACKAGE_NAME}` as const
33
+
34
+ /** 国际站 — curl 一键安装 */
35
+ export const INSTALL_CURL_INTERNATIONAL = 'curl -fsSL https://mipham.ai/install.sh | bash' as const
36
+
37
+ /** 国内站 — curl 一键安装 */
38
+ export const INSTALL_CURL_CHINA = 'curl -fsSL https://onemipham.com/install.sh | bash' as const
39
+
40
+ /** 国际站产品页 */
41
+ export const PRODUCT_URL_INTERNATIONAL = 'https://mipham.ai/mipham-code' as const
42
+
43
+ /** 国内站产品页 */
44
+ export const PRODUCT_URL_CHINA = 'https://onemipham.com/mipham-code' as const
45
+
46
+ /** GitHub 仓库 */
47
+ export const GITHUB_REPO = 'https://github.com/One-Mipham/mipham-code' as const
48
+
49
+ /** 品牌名称 */
50
+ export const BRAND_NAME = 'MiphamAI' as const
51
+
52
+ /** 产品名称 */
53
+ export const PRODUCT_NAME = 'Mipham Code' as const
54
+
55
+ /** 公司名称(英文) */
56
+ export const COMPANY_NAME_EN = 'One Mipham Corporation' as const
57
+
58
+ /** 公司名称(中文) */
59
+ export const COMPANY_NAME_ZH = '北京华安麦逄科技有限公司' as const
60
+
61
+ /** 公司简称 */
62
+ export const COMPANY_SHORT = '华安麦逄科技' as const
package/src/ui/app.tsx CHANGED
@@ -43,7 +43,7 @@ interface AgentProgress {
43
43
  startTime: number
44
44
  }
45
45
 
46
- import { PACKAGE_VERSION } from '@mipham/shared'
46
+ import { PACKAGE_VERSION } from '../shared/index.ts'
47
47
 
48
48
  const VERSION = PACKAGE_VERSION
49
49
 
@@ -8,7 +8,7 @@ import type { QueryEngine } from '../core/engine'
8
8
  import type { MiphamConfig } from '../shared/index.ts'
9
9
  import type { SkillsLoader } from '../skills/loader'
10
10
  import { McpClient } from '../mcp/client'
11
- import { NPM_INSTALL_COMMAND, NPM_UPDATE_COMMAND, PACKAGE_VERSION } from '@mipham/shared'
11
+ import { NPM_INSTALL_COMMAND, NPM_UPDATE_COMMAND, PACKAGE_VERSION } from '../shared/index.ts'
12
12
 
13
13
  export interface CommandContext {
14
14
  engine: QueryEngine