mancode 0.3.4 → 0.3.5

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/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <p align="center">
18
18
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square" alt="License: AGPL-3.0" /></a>
19
19
  <a href="https://www.npmjs.com/package/mancode"><img src="https://img.shields.io/npm/v/mancode?style=flat-square" alt="npm version" /></a>
20
- <img src="https://img.shields.io/badge/status-stable%20v0.3.4-green?style=flat-square" alt="Status: stable v0.3.4" />
20
+ <img src="https://img.shields.io/badge/status-stable%20v0.3.5-green?style=flat-square" alt="Status: stable v0.3.5" />
21
21
  <img src="https://img.shields.io/badge/platforms-Claude%20Code%20%7C%20Cursor%20%7C%20Codex%20%7C%20Copilot%20%7C%20ZCode-5865F2?style=flat-square" alt="Platforms: Claude Code, Cursor, Codex in ChatGPT desktop and CLI, GitHub Copilot, ZCode" />
22
22
  <img src="https://img.shields.io/badge/tests-381%20passed-brightgreen?style=flat-square" alt="Tests: 381 passed" />
23
23
  </p>
@@ -292,7 +292,7 @@ it should behave, and why previous decisions were made.
292
292
 
293
293
  ## Installation
294
294
 
295
- **Status**: stable v0.3.4. Claude Code, Cursor, Codex in the ChatGPT desktop app
295
+ **Status**: stable v0.3.5. Claude Code, Cursor, Codex in the ChatGPT desktop app
296
296
  and CLI, and GitHub Copilot are supported. ZCode adapter support is included,
297
297
  with project skill discovery kept behind a verification gate before release.
298
298
 
@@ -385,7 +385,7 @@ mancode version
385
385
  Example output for a UI project (not a default stack):
386
386
 
387
387
  ```text
388
- mancode v0.3.4
388
+ mancode v0.3.5
389
389
 
390
390
  Project: my-app (React + TypeScript + Tailwind)
391
391
  Mode: solo (default)
package/README.zh-CN.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <p align="center">
18
18
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square" alt="许可证:AGPL-3.0" /></a>
19
19
  <a href="https://www.npmjs.com/package/mancode"><img src="https://img.shields.io/npm/v/mancode?style=flat-square" alt="npm 版本" /></a>
20
- <img src="https://img.shields.io/badge/status-stable%20v0.3.4-green?style=flat-square" alt="状态:稳定版 v0.3.4" />
20
+ <img src="https://img.shields.io/badge/status-stable%20v0.3.5-green?style=flat-square" alt="状态:稳定版 v0.3.5" />
21
21
  <img src="https://img.shields.io/badge/platforms-Claude%20Code%20%7C%20Cursor%20%7C%20Codex%20%7C%20Copilot%20%7C%20ZCode-5865F2?style=flat-square" alt="平台:Claude Code、Cursor、ChatGPT 桌面端 Codex、Codex CLI、GitHub Copilot、ZCode" />
22
22
  <img src="https://img.shields.io/badge/tests-381%20passed-brightgreen?style=flat-square" alt="测试:381 通过" />
23
23
  </p>
@@ -253,7 +253,7 @@ src/components/
253
253
 
254
254
  ## 安装
255
255
 
256
- **状态**:稳定版 v0.3.4。Claude Code、Cursor、ChatGPT 桌面端中的 Codex、
256
+ **状态**:稳定版 v0.3.5。Claude Code、Cursor、ChatGPT 桌面端中的 Codex、
257
257
  Codex CLI 和 GitHub Copilot 均已支持。ZCode adapter 已接入,但项目级 skill
258
258
  发现路径在发布前仍作为验证门禁。
259
259
 
@@ -344,7 +344,7 @@ mancode version
344
344
  以下是 UI 项目的输出示例,并非默认技术栈:
345
345
 
346
346
  ```text
347
- mancode v0.3.4
347
+ mancode v0.3.5
348
348
 
349
349
  Project: my-app (React + TypeScript + Tailwind)
350
350
  Mode: solo (default)
package/dist/cli.js CHANGED
@@ -2968,16 +2968,85 @@ async function detectSystemDeps(env = process3.env) {
2968
2968
  }
2969
2969
 
2970
2970
  // src/system/init-onboarding.ts
2971
+ import { execFileSync } from "child_process";
2971
2972
  import { promises as fs } from "fs";
2972
2973
  import path11 from "path";
2973
2974
  import process4 from "process";
2974
2975
  import { stdin, stdout } from "process";
2975
2976
  import { createInterface } from "readline/promises";
2976
2977
  var ALL_PLATFORMS = Object.keys(PLATFORM_INSTALLERS);
2977
- function detectInitLocale(override, environment = process4.env, systemLocale = Intl.DateTimeFormat().resolvedOptions().locale) {
2978
+ var cachedNativeSystemLocale;
2979
+ function detectInitLocale(override, environment = process4.env, systemLocale = Intl.DateTimeFormat().resolvedOptions().locale, nativeLocale) {
2978
2980
  if (override) return parseLocale(override);
2979
- const environmentLocale = environment.LC_ALL ?? environment.LC_MESSAGES ?? environment.LANG;
2980
- return parseLocale(environmentLocale) ?? parseLocale(systemLocale) ?? "en";
2981
+ const resolvedNativeLocale = nativeLocale === void 0 ? getNativeSystemLocale() : nativeLocale;
2982
+ return parseLocale(resolvedNativeLocale) ?? detectEnvironmentLocale(environment) ?? parseLocale(systemLocale) ?? "en";
2983
+ }
2984
+ function detectNativeSystemLocale(platform = process4.platform, runCommand = runLocaleCommand) {
2985
+ if (platform === "darwin") {
2986
+ const languages = runCommand("defaults", ["read", "-g", "AppleLanguages"]);
2987
+ const primaryLanguage = parsePrimaryAppleLanguage(languages);
2988
+ if (primaryLanguage) return primaryLanguage;
2989
+ return cleanLocaleOutput(
2990
+ runCommand("defaults", ["read", "-g", "AppleLocale"])
2991
+ );
2992
+ }
2993
+ if (platform === "win32") {
2994
+ return cleanLocaleOutput(
2995
+ runCommand("powershell.exe", [
2996
+ "-NoLogo",
2997
+ "-NoProfile",
2998
+ "-NonInteractive",
2999
+ "-Command",
3000
+ "[System.Globalization.CultureInfo]::CurrentUICulture.Name"
3001
+ ])
3002
+ );
3003
+ }
3004
+ return null;
3005
+ }
3006
+ function getNativeSystemLocale() {
3007
+ if (cachedNativeSystemLocale === void 0) {
3008
+ cachedNativeSystemLocale = detectNativeSystemLocale();
3009
+ }
3010
+ return cachedNativeSystemLocale;
3011
+ }
3012
+ function detectEnvironmentLocale(environment) {
3013
+ const candidates = [
3014
+ environment.LANGUAGE,
3015
+ environment.LC_ALL,
3016
+ environment.LC_MESSAGES,
3017
+ environment.LANG
3018
+ ];
3019
+ for (const candidate of candidates) {
3020
+ for (const locale of candidate?.split(":") ?? []) {
3021
+ const parsed = parseLocale(locale);
3022
+ if (parsed) return parsed;
3023
+ }
3024
+ }
3025
+ return null;
3026
+ }
3027
+ function runLocaleCommand(command, args) {
3028
+ try {
3029
+ const output = execFileSync(command, [...args], {
3030
+ encoding: "utf8",
3031
+ stdio: ["ignore", "pipe", "ignore"],
3032
+ timeout: 2e3,
3033
+ windowsHide: true
3034
+ });
3035
+ return cleanLocaleOutput(output);
3036
+ } catch {
3037
+ return null;
3038
+ }
3039
+ }
3040
+ function parsePrimaryAppleLanguage(output) {
3041
+ const cleaned = cleanLocaleOutput(output);
3042
+ if (!cleaned) return null;
3043
+ const quoted = cleaned.match(/"([^"]+)"/)?.[1];
3044
+ if (quoted) return quoted;
3045
+ return cleaned.split(/[\s(),]+/).find((value) => /^[a-z]{2,3}(?:[-_][a-z0-9]+)*$/i.test(value)) ?? null;
3046
+ }
3047
+ function cleanLocaleOutput(output) {
3048
+ const cleaned = output?.replace(/^\uFEFF/, "").trim();
3049
+ return cleaned || null;
2981
3050
  }
2982
3051
  function parseLocale(value) {
2983
3052
  if (!value) return null;