@mortiseai/stem 0.0.27 → 0.0.28

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/stem.mjs CHANGED
@@ -16,6 +16,7 @@ import { devNull, totalmem } from 'node:os'
16
16
  import { fileURLToPath, pathToFileURL } from 'node:url'
17
17
  import { spawnSync } from 'node:child_process'
18
18
  import { resolveBunCommand, shouldSupervise } from './stem-launcher-lib.mjs'
19
+ import { isMaintenanceCommand, launchMaintenance } from './stem-maintenance-launcher.mjs'
19
20
 
20
21
  // realpath:npm link / 全局 bin 软链下定位真实包根,而非软链父目录。
21
22
  const selfPath = realpathSync(fileURLToPath(import.meta.url))
@@ -23,6 +24,11 @@ const rootDir = dirname(dirname(selfPath))
23
24
 
24
25
  process.env.CALLER_DIR ||= process.cwd()
25
26
 
27
+ // Maintenance must work before project settings, TUI modules or the supervisor load.
28
+ if (isMaintenanceCommand(process.argv.slice(2))) {
29
+ process.exit(launchMaintenance(rootDir, process.argv.slice(2)))
30
+ }
31
+
26
32
  const envFile = join(rootDir, '.env')
27
33
  const skipDotenv = process.env.STEM_SKIP_DOTENV === '1'
28
34
  // loadEnvFile 与 node --env-file 同语义:已有环境变量优先,仅补缺。