@minimax-ai/code 0.3.6 → 0.3.8

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/CHANGELOG.zh-CN.md +25 -0
  3. package/README.md +20 -8
  4. package/README.zh-CN.md +28 -5
  5. package/chunks/{application-NV4X3RV4.js → application-LFPFVITL.js} +1 -1
  6. package/chunks/auth-command-ZGB3QKMA.js +9 -0
  7. package/chunks/chunk-4S3IXX3N.js +2 -0
  8. package/chunks/{chunk-VBDTVEVF.js → chunk-5MDJKLXG.js} +1 -1
  9. package/chunks/{chunk-TJUTHJIS.js → chunk-676PV6PV.js} +452 -452
  10. package/chunks/{chunk-ISF4HEC4.js → chunk-ACTS7L64.js} +1 -1
  11. package/chunks/{chunk-RWIFT2VZ.js → chunk-NW6DSOE3.js} +2 -2
  12. package/chunks/chunk-SEVVS6ZS.js +5 -0
  13. package/chunks/{chunk-KXO2REWJ.js → chunk-UQHSY5YK.js} +1 -1
  14. package/chunks/{chunk-ZXOZXMWQ.js → chunk-WMOPXI4T.js} +7 -7
  15. package/chunks/{chunk-BN5ADI2D.js → chunk-XI2HYP4Q.js} +403 -403
  16. package/chunks/{chunk-RM42PCDV.js → chunk-XO2KLR35.js} +17 -17
  17. package/chunks/{chunk-EJS4KRR2.js → chunk-XQ2OPT34.js} +1 -1
  18. package/chunks/{data-dir-2ZJFRWW6.js → data-dir-BYKXIBNJ.js} +1 -1
  19. package/chunks/{dist-S32WQUVY.js → dist-2YKPF46H.js} +1 -1
  20. package/chunks/{install-source-O2EK6H3D.js → install-source-6JLUO3MG.js} +1 -1
  21. package/chunks/{launcher-FVXKFL4F.js → launcher-OZHJWAUU.js} +133 -131
  22. package/chunks/{lifecycle-E2PPZ25G.js → lifecycle-AOSJQEST.js} +1 -1
  23. package/chunks/{main-5I5LJBKT.js → main-F7JZ3TVA.js} +3 -3
  24. package/chunks/{plugin-command-P3VM77DS.js → plugin-command-W57XX6PP.js} +1 -1
  25. package/chunks/{provider-command-GUP4G3TR.js → provider-command-54WYLAEF.js} +1 -1
  26. package/chunks/{run-acp-command-2YNDWCTK.js → run-acp-command-TXYZMYHR.js} +2 -2
  27. package/chunks/{run-exec-command-O7SOL3RW.js → run-exec-command-WJX5CTIJ.js} +1 -1
  28. package/chunks/{update-JJ5EYXC6.js → update-HTLJYRQR.js} +1 -1
  29. package/cli.js +2 -2
  30. package/package.json +1 -1
  31. package/verify-native-install.mjs +3 -3
  32. package/chunks/auth-command-AYTFOBP7.js +0 -6
  33. package/chunks/chunk-G7PNCKMS.js +0 -2
  34. package/chunks/chunk-J63OB7U2.js +0 -5
package/CHANGELOG.md CHANGED
@@ -7,6 +7,40 @@ This changelog covers important changes that directly affect MCode TUI users. It
7
7
 
8
8
  Internal refactors, test-only changes, and changes limited to other product surfaces are excluded.
9
9
 
10
+ ## 0.3.8 · 2026-09-07
11
+
12
+ ### Improved
13
+
14
+ - `/status` now shows the running version, account and plan, instruction file sources,
15
+ Default/Plan mode transitions, and remaining 5-hour and weekly quotas with reset countdowns.
16
+ - The compact status panel wraps long paths and keeps local configuration visible while account
17
+ details load or when the account request fails.
18
+ - `/logout` and `mcode logout` print a complete browser sign-out link and open the page for the
19
+ current account region and environment. On remote or headless machines, copy the link to your
20
+ browser; command completion does not wait for the browser or page result.
21
+
22
+ ### Fixed
23
+
24
+ - Fixed authentication when uploading automatic error reports from a signed-in account.
25
+
26
+ ## 0.3.7 · 2026-09-07
27
+
28
+ ### Improved
29
+
30
+ - Long sessions search and render more smoothly, with cached search indexes and stable Markdown,
31
+ fewer history replays during terminal resizing, and clearer tool retry summaries.
32
+ - The default status line warns when remaining context reaches 25% or less. Explicitly configuring
33
+ `context-remaining` keeps valid usage visible; narrow terminals prioritize essential status.
34
+ - Terminal notifications support focus-aware policies and configurable delivery methods, with improved
35
+ compatibility for cmux. Composer keyboard hints follow the current platform.
36
+
37
+ ### Fixed
38
+
39
+ - Improved shared login recovery when switching accounts, cancelling login, or starting offline,
40
+ including concurrent credential renewal and delayed logout synchronization.
41
+ - Installation and repair guidance now preserves the selected package, version, and registry and
42
+ explains how to restore native SQLite dependencies when npm 12 blocks installation scripts.
43
+
10
44
  ## 0.3.6 · 2026-09-07
11
45
 
12
46
  ### Fixed
@@ -8,6 +8,31 @@ TUI 正式版中用户能直接感知的重要变化。收录范围以 TUI 用
8
8
 
9
9
  仅内部重构、测试调整,或只影响其他产品界面且不改变 TUI 行为的变化不记录。
10
10
 
11
+ ## 0.3.8 · 2026-09-07
12
+
13
+ ### 体验改进
14
+
15
+ - `/status` 补齐运行版本、账号与套餐、指令文件来源、Default/Plan 切换状态,以及 5 小时和每周额度的剩余比例与重置倒计时。
16
+ - 状态面板采用紧凑布局,长路径自动换行;账号信息加载中或查询失败时,仍可查看本地配置。
17
+ - `/logout` 和 `mcode logout` 会打印完整的浏览器登出链接,并打开当前地区和环境对应的登出页。开发机或无图形界面环境可复制链接手动打开,命令完成无需等待浏览器或页面结果。
18
+
19
+ ### 问题修复
20
+
21
+ - 修复已登录账号自动上报错误报告时的鉴权问题。
22
+
23
+ ## 0.3.7 · 2026-09-07
24
+
25
+ ### 改进
26
+
27
+ - 长会话搜索和渲染更流畅:缓存搜索索引和稳定的 Markdown 内容,减少调整终端尺寸时的历史重绘,并更清晰地展示工具重试摘要。
28
+ - 默认状态栏在剩余上下文不超过 25% 时提示;显式配置 `context-remaining` 可持续显示有效用量,窄屏优先保留关键状态。
29
+ - 终端通知支持按焦点状态和发送方式配置,改善 cmux 兼容性;输入框快捷键提示适配当前平台。
30
+
31
+ ### 修复
32
+
33
+ - 改善切换账号、取消登录和离线启动时的共享登录恢复,处理并发凭据续期与延迟登出同步。
34
+ - 安装和修复指引保留选定的包名、版本和 registry,并说明 npm 12 阻止安装脚本时如何恢复原生 SQLite 依赖。
35
+
11
36
  ## 0.3.6 · 2026-09-07
12
37
 
13
38
  ### 问题修复
package/README.md CHANGED
@@ -268,21 +268,33 @@ npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3
268
268
  </details>
269
269
 
270
270
  <details>
271
- <summary>Missing native SQLite dependency or blocked installation scripts</summary>
271
+ <summary>npm 12 blocks installation scripts, or startup reports a missing native SQLite dependency</summary>
272
272
 
273
- npm 12 blocks unapproved installation scripts by default. Allow scripts for the current MCode
274
- package and `better-sqlite3` when installing. Setting `ignore-scripts=false` still requires
275
- approval through `--allow-scripts`.
273
+ npm 12 blocks unapproved installation scripts by default. If `npm warn install-scripts` lists
274
+ MCode's `postinstall` and `better-sqlite3`'s `install` as blocked, SQLite may be unavailable even
275
+ when npm reports `added` or `changed packages`. Startup may report `Could not locate the bindings
276
+ file`, a missing `better_sqlite3.node`, or an outer `migration_failed` error.
276
277
 
277
- If startup reports `Could not locate the bindings file` or a missing `better_sqlite3.node`,
278
- reinstall with the installation log visible:
278
+ For official Shell/PowerShell installations, rerun the original installer command. The installer
279
+ and `/update` handle the required script options and native dependencies. If MCode cannot start,
280
+ repair it with the installer first.
281
+
282
+ For `npm install -g` installations, prefer the repair command printed in the startup error.
283
+ Use the following command when installing `latest`:
279
284
 
280
285
  ```bash
281
- npm install -g @minimax-ai/code --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
286
+ npm install -g @minimax-ai/code@latest --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
282
287
  ```
283
288
 
289
+ Keep the package name, version, and registry from the original installation command. For a Preview
290
+ or pinned installation, retain the exact version instead of switching to `latest`. List the same
291
+ MCode package name and `better-sqlite3` in `--allow-scripts`. Setting `--ignore-scripts=false` alone
292
+ does not approve scripts in npm 12; `--include=optional` ensures the SQLite dependency is installed.
293
+
284
294
  Start `mcode` after `[MCode] Native SQLite check passed.` appears. This repairs native dependencies
285
- in the installation directory and preserves existing configuration and Sessions.
295
+ in the installation directory and preserves existing configuration and Sessions. If it still fails,
296
+ provide the complete new installation log and the output of `node --version` and `npm --version`
297
+ to investigate download, build, or runtime errors.
286
298
 
287
299
  </details>
288
300
 
package/README.zh-CN.md CHANGED
@@ -133,6 +133,11 @@ mcode acp
133
133
  mcode login
134
134
  ```
135
135
 
136
+ 使用 TUI 的 `/logout` 或命令行 `mcode logout` 退出当前地区的共享账号。退出后会显示完整的浏览器登出链接,
137
+ 并尝试打开默认浏览器;在开发机、SSH 或无图形界面环境中,可复制链接到自己的浏览器完成网页登出。
138
+ 账号登出完成后,发起浏览器打开请求即返回,完整链接会保留在终端中供手动打开。
139
+ 链接按当前地区及运行环境选择,与桌面端的登出页保持一致。
140
+
136
141
  安装 `@minimax-ai/code` 时会同时安装 `mcode` 和 `mcode-tools` 两个命令;无需先启动 TUI,`mcode-tools`
137
142
  就会出现在 `PATH` 上。
138
143
 
@@ -181,6 +186,14 @@ Plan Mode 允许你在修改代码前先审阅实现计划。权限模式用于
181
186
 
182
187
  ## 命令速查
183
188
 
189
+ `/status` 查看运行版本、模型和思考配置、目录与 Git 信息、权限、工作模式、Session、MiniMax 账号与套餐,
190
+ 以及 5 小时和每周额度的剩余比例与重置倒计时。账号信息异步加载,查询失败时仍可查看本地配置。
191
+ Default / Plan 切换会标明当前模式和下一条消息的切换意图。
192
+
193
+ 指令来源列出 Runtime 按当前文件内容选用的全局、项目规则文件路径;它遵循与 Turn 装配相同的优先级和大小限制,
194
+ 不展示正文,也不代表历史 Turn 的快照。`/usage` 提供套餐到期、Credits、视频额度及 Session 用量等明细。
195
+ 查看面板可滚动,按 `Esc` 关闭,内容不会写入会话历史。
196
+
184
197
  | 命令 | 用途 |
185
198
  | ------------------------ | ---------------------------------- |
186
199
  | `mcode [prompt]` | 启动交互式 TUI |
@@ -228,18 +241,28 @@ npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3
228
241
  </details>
229
242
 
230
243
  <details>
231
- <summary>SQLite 原生依赖缺失或安装脚本被阻止</summary>
244
+ <summary>npm 12 安装脚本被阻止,或启动时提示 SQLite 原生依赖缺失</summary>
232
245
 
233
- npm 12 默认阻止未经授权的安装脚本。安装 MCode 时,需要允许当前 MCode 包和 `better-sqlite3`
234
- 的脚本执行;`ignore-scripts=false` 只解除全局禁用,仍需 `--allow-scripts` 授权。
246
+ npm 12 默认阻止未经授权的安装脚本。如果安装日志出现 `npm warn install-scripts`,并列出 MCode 的
247
+ `postinstall` 和 `better-sqlite3` 的 `install` 被阻止,即使 npm 显示 `added` 或 `changed packages`,
248
+ SQLite 原生模块也可能没有准备好。启动时可能提示 `Could not locate the bindings file`、缺少
249
+ `better_sqlite3.node`,或外层的 `migration_failed`。
235
250
 
236
- 如果启动提示 `Could not locate the bindings file` 或缺少 `better_sqlite3.node`,重新安装并显示安装日志:
251
+ 通过官方 Shell/PowerShell 安装器安装的用户,重跑原安装命令即可。安装器和 `/update` 会处理所需的
252
+ 脚本参数与原生依赖;如果 MCode 已无法启动,先重跑安装器修复。
253
+
254
+ 通过 `npm install -g` 安装的用户,优先执行启动错误中给出的修复命令。下面的命令适用于安装 `latest`:
237
255
 
238
256
  ```bash
239
- npm install -g @minimax-ai/code --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
257
+ npm install -g @minimax-ai/code@latest --registry=https://registry.npmjs.org/ --foreground-scripts --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3
240
258
  ```
241
259
 
260
+ 保留原安装命令的包名、版本和 registry;安装 Preview 或指定版本时,沿用原来的精确版本,避免切换到
261
+ `latest`。`--allow-scripts` 中填写相同的 MCode 包名及 `better-sqlite3`。只加
262
+ `--ignore-scripts=false` 不能代替 npm 12 的脚本授权;`--include=optional` 确保安装 SQLite 依赖。
263
+
242
264
  看到 `[MCode] Native SQLite check passed.` 后再启动 `mcode`。此操作修复安装目录中的原生依赖,保留已有配置和会话。
265
+ 若仍失败,提供本次完整安装日志,以及 `node --version` 和 `npm --version` 的输出,以继续排查下载、编译或运行时错误。
243
266
 
244
267
  </details>
245
268
 
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
- import{c as a}from"./chunk-ZXOZXMWQ.js";import"./chunk-C3JRMX7L.js";import"./chunk-KXO2REWJ.js";import"./chunk-RWIFT2VZ.js";import"./chunk-O6RIRKRN.js";import"./chunk-HQ2U4QVQ.js";import"./chunk-MMRA4VD2.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";export{a as McodeUpdateApplication};
2
+ import{c as a}from"./chunk-WMOPXI4T.js";import"./chunk-C3JRMX7L.js";import"./chunk-UQHSY5YK.js";import"./chunk-NW6DSOE3.js";import"./chunk-O6RIRKRN.js";import"./chunk-HQ2U4QVQ.js";import"./chunk-MMRA4VD2.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";export{a as McodeUpdateApplication};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
+ import{a as o,b as l,c as u}from"./chunk-4S3IXX3N.js";import"./chunk-ACTS7L64.js";import{d as p}from"./chunk-5MDJKLXG.js";import"./chunk-SEVVS6ZS.js";import"./chunk-XO2KLR35.js";import"./chunk-ZITT4GJK.js";import"./chunk-MMRA4VD2.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";async function A(r={}){let a=r.createApplication?r.createApplication(r.region):await c(r.region,r.prepareDataDir),t=r.writeError??(e=>process.stderr.write(e));return(await a.login(e=>{let n=l(e.verificationUriComplete??e.verificationUri);if(t(`Open: ${n}
3
+ Code: ${e.userCode}
4
+ Waiting for authorization\u2026
5
+ `),r.openBrowser===!1)return;(r.openExternalTarget??o(process.cwd()))(n).catch(()=>{t(`Couldn't open the default browser. Open the authorization URL above manually.
6
+ `)})})).message}async function h(r={}){let t=await(r.createApplication?r.createApplication(r.region):await c(r.region,r.prepareDataDir)).logout();if(t.logoutUrl){let i=r.writeError??(e=>process.stderr.write(e));if(i(`Finish signing out in your browser:
7
+ ${t.logoutUrl}
8
+ `),r.openBrowser!==!1){let e=()=>i(`Couldn't open the default browser. Open the sign-out URL above manually.
9
+ `);try{(r.openExternalTarget??o(process.cwd()))(t.logoutUrl).catch(e)}catch{e()}}}return t.message}async function c(r,a=p){return u({dataDir:await a(),...r?{region:r}:{}})}export{A as runTuiLogin,h as runTuiLogout};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
+ import{a as p}from"./chunk-ACTS7L64.js";import{e as g,j as d,l as h}from"./chunk-SEVVS6ZS.js";import{isAbsolute as f,resolve as A}from"node:path";import{spawn as E}from"node:child_process";import{fileURLToPath as y}from"node:url";function T(e){return t=>R(t,e)}function R(e,t){let i=S(e,t),[o,r]=process.platform==="darwin"?["open",[i]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",i]]:["xdg-open",[i]];return new Promise((s,u)=>{let n=E(o,r,{detached:!0,stdio:"ignore",windowsHide:!0});n.once("error",u),n.once("spawn",()=>{n.unref(),s()})})}function S(e,t){return/^https?:\/\//iu.test(e)?e:/^file:\/\//iu.test(e)?y(e):f(e)?e:A(t,e)}var x="mcode-internal";function k(e){try{let t=new URL(e);return t.searchParams.set("client_surface","tui"),t.searchParams.set("download_source",x),t.toString()}catch{return e}}var w={cn:{dev:"https://agent.minimaxi.com",test:"https://agent.minimaxi.com",staging:"https://agent.minimaxi.com",prod:"https://agent.minimax.cn"},en:{dev:"https://agent.minimax.io",test:"https://agent.minimax.io",staging:"https://agent.minimax.io",prod:"https://agent.minimax.io"}};function m(e){let t=w[e.region][e.buildEnv];return`${t}/auth/logout?logout_redirect_uri=${encodeURIComponent(t)}`}var c=class{constructor(t){this.options=t;let i=d({runtimeRegion:process.env.MAVIS_REGION==="en"?"en":"cn"});this.scope={region:t.region??i.region,buildEnv:t.buildEnv??i.buildEnv}}scope;async login(t,i=this.scope.region){this.track("login_click",{hailuo_user_id:this.hailuoUserId()});try{let o={...this.scope,region:i},r=!P(o,this.scope),s=this.options.sharedAuthCore;if(r){if(!this.options.resolveSharedAuthCore)throw new Error(C(this.scope,o));s=this.options.resolveSharedAuthCore(i)}let u=(await s.getStatus()).status==="authenticated",n=!1;await s.login({onDeviceAuthorization:M=>{n=!0,t?.({state:"device-authorization",...M})}}),this.persistRegionPreference(o);let l=u&&!n,v={state:l?"already-authenticated":"authenticated",message:l?r?`Already signed in with ${a(o.region)}.`:"Already signed in with MiniMax.":r?`Signed in with ${a(o.region)}.`:"Signed in with MiniMax.",...r?{restartRequired:!0}:{}};return this.trackLoginResult("1",""),v}catch(o){throw this.trackLoginResult("2",b(o)),o}}async logout(){this.track("logout_click",{hailuo_user_id:this.hailuoUserId()});let t=await this.options.sharedAuthCore.getStatus(),i=await this.options.sharedAuthCore.logout({revoke:!0}),o=m(this.scope);return t.status==="anonymous"&&i.status==="anonymous"?{state:"already-signed-out",message:"Already signed out of MiniMax.",logoutUrl:o}:{state:"signed-out",logoutUrl:o,message:i.status==="logout_pending"?`Signed out locally from ${a(this.scope.region)} across MCode. Server revocation is pending until the network recovers.`:`Signed out of ${a(this.scope.region)} on Desktop, CLI/TUI, and embedded mcode-tools.`}}trackLoginResult(t,i){this.track("login_result",{hailuo_user_id:this.hailuoUserId(),source:this.options.telemetrySource??"mcode_cli",result_type:t,fail_reason:i,login_type:"minimax_oauth"})}persistRegionPreference(t){try{this.options.writeRegionPreference?.(this.options.dataDir,t)}catch{}}hailuoUserId(){try{return this.options.hailuoUserId?.()?.trim()??""}catch{return""}}track(t,i){try{this.options.telemetry?.track(t,i)}catch{}}};function b(e){let t=e instanceof Error?e.message:String(e);return/cancel/iu.test(t)?"3":/network|offline|fetch|ECONN|ENOTFOUND|ETIMEDOUT/iu.test(t)?"2":/oauth|authorization|login failed|invalid login state/iu.test(t)?"5":/server|HTTP 5\d\d/iu.test(t)?"1":"4"}function P(e,t){return e.region===t.region&&e.buildEnv===t.buildEnv}function C(e,t){return e.region!==t.region?`Signed in to ${a(e.region)}. Run \`mcode logout\` before signing in to ${a(t.region)}.`:`Signed in to another MiniMax ${e.buildEnv} environment. Run \`mcode logout\` before signing in to ${t.buildEnv}.`}function a(e){return e==="cn"?"MiniMax China":"MiniMax Global"}function j(e){let t=d({runtimeRegion:e.region,runtimeBuildEnv:e.buildEnv}),i=e.region??t.region,o=e.buildEnv??t.buildEnv,r={dataDir:e.dataDir,region:i,buildEnv:o,...e.telemetry?{telemetry:e.telemetry}:{},...e.telemetrySource?{telemetrySource:e.telemetrySource}:{},...e.hailuoUserId?{hailuoUserId:e.hailuoUserId}:{},writeRegionPreference:e.writeRegionPreference??h},s=n=>(e.createSharedSession??p)({dataDir:e.dataDir,region:n,buildEnv:o,oauthEndpoints:g(e.oauthEndpointEnvironment??process.env,{buildEnv:o,region:n})}),u=e.sharedAuthCore??s(i);return new c({...r,sharedAuthCore:u,resolveSharedAuthCore:s})}export{T as a,k as b,j as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
- import{j as i,l as D}from"./chunk-J63OB7U2.js";import{$ as a,p as n}from"./chunk-RM42PCDV.js";function o(t,r=n,e=a){return r(void 0,e())}function u(){return o(i())}function m(t){let r=t.MINIMAX_DATA_DIR?.trim();return r||t.MAVIS_DATA_DIR?.trim()||void 0}function f(t=process.env,r=u){return m(t)??r()}function v(t=u,r=process.env){return f(r,t)}function p(t={}){let r=(t.getBuildEnv??i)(),e=v(t.getDefaultDataDir??(()=>o(r)),t.environment??process.env);return(t.configureRuntimeEnvironment??D)({dataDir:e}),Promise.resolve(e)}export{o as a,f as b,v as c,p as d};
2
+ import{k as i,m as D}from"./chunk-SEVVS6ZS.js";import{$ as a,p as n}from"./chunk-XO2KLR35.js";function o(t,r=n,e=a){return r(void 0,e())}function u(){return o(i())}function m(t){let r=t.MINIMAX_DATA_DIR?.trim();return r||t.MAVIS_DATA_DIR?.trim()||void 0}function f(t=process.env,r=u){return m(t)??r()}function v(t=u,r=process.env){return f(r,t)}function p(t={}){let r=(t.getBuildEnv??i)(),e=v(t.getDefaultDataDir??(()=>o(r)),t.environment??process.env);return(t.configureRuntimeEnvironment??D)({dataDir:e}),Promise.resolve(e)}export{o as a,f as b,v as c,p as d};