@hippox/codegenie 3.13.2026 → 3.14.2026

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/uninstall.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { cleanupAfterNpmUninstall } = require("../lib/cleanup.js")
3
+ const { cleanupAfterNpmUninstall, cleanupLegacyLoginState } = require("../lib/cleanup.js")
4
4
 
5
5
  try {
6
6
  const result = cleanupAfterNpmUninstall()
@@ -14,6 +14,16 @@ try {
14
14
  const hint = result.error && result.error.message ? ` (${result.error.message})` : ""
15
15
  console.warn(`[codegenie] Failed to remove runtime directory${hint}. Remove manually: ${result.rootDir}`)
16
16
  }
17
+
18
+ if (result.removed || result.reason === "missing") {
19
+ const legacyState = cleanupLegacyLoginState()
20
+ if (legacyState.removed) {
21
+ console.log(`[codegenie] Removed legacy login state: ${legacyState.path}`)
22
+ } else if (legacyState.reason === "remove-failed") {
23
+ const hint = legacyState.error && legacyState.error.message ? ` (${legacyState.error.message})` : ""
24
+ console.warn(`[codegenie] Failed to remove legacy login state${hint}. Remove manually: ${legacyState.path}`)
25
+ }
26
+ }
17
27
  } catch (error) {
18
28
  const message = error && error.message ? error.message : String(error)
19
29
  console.warn(`[codegenie] Runtime cleanup during npm uninstall failed: ${message}`)
package/lib/cleanup.js CHANGED
@@ -13,6 +13,10 @@ function runtimePaths(homeDir = os.homedir()) {
13
13
  }
14
14
  }
15
15
 
16
+ function legacyLoginStatePath(homeDir = os.homedir()) {
17
+ return path.join(homeDir, ".config", "ts-login")
18
+ }
19
+
16
20
  function isRecord(value) {
17
21
  return typeof value === "object" && value !== null
18
22
  }
@@ -88,9 +92,29 @@ function cleanupAfterNpmUninstall(options = {}) {
88
92
  return { removed: true, reason: "removed", rootDir: paths.rootDir }
89
93
  }
90
94
 
95
+ function cleanupLegacyLoginState(options = {}) {
96
+ const homeDir = options.homeDir || os.homedir()
97
+ const targetPath = legacyLoginStatePath(homeDir)
98
+ if (!fs.existsSync(targetPath)) {
99
+ return { removed: false, reason: "missing", path: targetPath }
100
+ }
101
+ const result = removeWithRetry(targetPath)
102
+ if (!result.success) {
103
+ return {
104
+ removed: false,
105
+ reason: "remove-failed",
106
+ path: targetPath,
107
+ error: result.error,
108
+ }
109
+ }
110
+ return { removed: true, reason: "removed", path: targetPath }
111
+ }
112
+
91
113
  module.exports = {
92
114
  belongsToExpectedPackageFamily,
93
115
  cleanupAfterNpmUninstall,
116
+ cleanupLegacyLoginState,
117
+ legacyLoginStatePath,
94
118
  readInstallContext,
95
119
  removeWithRetry,
96
120
  runtimePaths,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hippox/codegenie",
3
- "version": "3.13.2026",
3
+ "version": "3.14.2026",
4
4
  "private": false,
5
5
  "description": "HarmonyOS AI 开发 CLI,通过 npm 分发平台二进制",
6
6
  "license": "MIT",
@@ -26,9 +26,9 @@
26
26
  "ai"
27
27
  ],
28
28
  "optionalDependencies": {
29
- "@hippox/codegenie-darwin-arm64": "3.13.2026",
30
- "@hippox/codegenie-darwin-x64": "3.13.2026",
31
- "@hippox/codegenie-win32-x64": "3.13.2026"
29
+ "@hippox/codegenie-darwin-arm64": "3.14.2026",
30
+ "@hippox/codegenie-darwin-x64": "3.14.2026",
31
+ "@hippox/codegenie-win32-x64": "3.14.2026"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"