@minimax-ai/code 0.6.6 → 0.6.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.
- package/CHANGELOG.md +20 -0
- package/CHANGELOG.zh-CN.md +19 -0
- package/README.md +26 -0
- package/README.zh-CN.md +51 -0
- package/chunks/{auth-command-VA6MMKOP.js → auth-command-VRPOVPAG.js} +1 -1
- package/chunks/{chunk-VCAGMAY5.js → chunk-3LM4G7WV.js} +1 -1
- package/chunks/{chunk-WQPQHX2N.js → chunk-F5BJTVSP.js} +1 -1
- package/chunks/{chunk-WUBVVATA.js → chunk-HTUJPI64.js} +734 -673
- package/chunks/{chunk-EGP34E73.js → chunk-RCKQIK7B.js} +1 -1
- package/chunks/{chunk-AKM6CI7T.js → chunk-TBUCWZJV.js} +1 -1
- package/chunks/{chunk-52X742AN.js → chunk-TJWBPT2F.js} +1 -1
- package/chunks/{chunk-EZ7Q2NM4.js → chunk-VRCVX3OX.js} +6 -6
- package/chunks/{chunk-G5QL7ZHU.js → chunk-W2YPWDHA.js} +1 -1
- package/chunks/{data-dir-IMRONFFA.js → data-dir-5RSS75A3.js} +1 -1
- package/chunks/{dist-63237B2W.js → dist-VUHPFVW3.js} +1 -1
- package/chunks/{launcher-AW4MDLKG.js → launcher-UXZG5P2R.js} +3 -3
- package/chunks/{lifecycle-INAA4RL2.js → lifecycle-LWEBNCGO.js} +1 -1
- package/chunks/{main-AFQG6DBW.js → main-ZF4GAXGG.js} +2 -2
- package/chunks/{plugin-command-LOWP3CEB.js → plugin-command-DE7EI72Q.js} +1 -1
- package/chunks/{provider-command-CS5TVIBU.js → provider-command-WEUFNCBJ.js} +1 -1
- package/chunks/{run-acp-command-2QYNAZF5.js → run-acp-command-RJGV3PNR.js} +2 -2
- package/chunks/{run-exec-command-XCRQ6UR5.js → run-exec-command-LDQWWWXK.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ 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.6.8 · 2026-10-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Windows TUI adds `skipWindowsHardSafetyChecks` in `config.yaml` to opt out of command-text and path checks that can reject valid scripts. It defaults to `false` and requires a restart. Enabling it weakens protected-path checks; supported deletions still go to the trash, and other permission checks remain active.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- On macOS and Linux, deleting files with `rm` now preserves shell variables, globs, quoting and redirections when moving files to the trash. Successful cleanup allows following commands such as `&& npm run build` to continue.
|
|
19
|
+
- With `rm -f`, missing files, empty arguments and repeated targets no longer incorrectly stop cleanup. Directory deletion still requires `-r`; real failures return a nonzero exit status, and protected directories remain blocked. Dynamic targets still require explicit approval when no sandbox is enabled, unless full permission was explicitly granted.
|
|
20
|
+
|
|
21
|
+
## 0.6.7 · 2026-10-10
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Set `MCODE_BROWSER_USE_SWIFTSHADER=true` to enable software WebGL rendering in the
|
|
26
|
+
TUI browser on virtual machines without a usable GPU. Browser Use must also be enabled.
|
|
27
|
+
This opt-in mode is intended for trusted local page testing; CPU rendering is slower
|
|
28
|
+
and does not measure hardware-accelerated game performance.
|
|
29
|
+
|
|
10
30
|
## 0.6.6 · 2026-10-10
|
|
11
31
|
|
|
12
32
|
### Added
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,25 @@ TUI 正式版中用户能直接感知的重要变化。收录范围以 TUI 用
|
|
|
8
8
|
|
|
9
9
|
仅内部重构、测试调整,或只影响其他产品界面且不改变 TUI 行为的变化不记录。
|
|
10
10
|
|
|
11
|
+
## 0.6.8 · 2026-10-11
|
|
12
|
+
|
|
13
|
+
### 新增功能
|
|
14
|
+
|
|
15
|
+
- Windows TUI 新增 `config.yaml` 配置 `skipWindowsHardSafetyChecks`,可跳过可能误拦有效脚本的命令文本和路径检查。默认关闭,修改后需重启。开启会削弱受保护路径检查;支持的删除命令仍转入回收站,其他权限检查继续生效。
|
|
16
|
+
|
|
17
|
+
### 问题修复
|
|
18
|
+
|
|
19
|
+
- 修复 macOS / Linux 下 `rm` 转入回收站时变量、通配符、引号和重定向处理错误,清理成功后,`&& npm run build` 等后续命令能够继续执行。
|
|
20
|
+
- 修复 `rm -f` 遇到不存在的文件、空参数或重复目标时错误中断的问题。删除目录仍需 `-r`,真实失败仍返回非零状态,受保护目录仍会被阻止。没有启用沙箱时,动态目标仍需明确批准,显式授予完整权限的情况除外。
|
|
21
|
+
|
|
22
|
+
## 0.6.7 · 2026-10-10
|
|
23
|
+
|
|
24
|
+
### 新增功能
|
|
25
|
+
|
|
26
|
+
- TUI 浏览器支持通过 `MCODE_BROWSER_USE_SWIFTSHADER=true` 启用软件 WebGL 渲染,
|
|
27
|
+
便于在没有可用 GPU 的虚拟机中验证 3D 页面。仍需单独开启 Browser Use,默认行为不变。
|
|
28
|
+
此模式适用于受信任的本地页面测试;CPU 渲染较慢,不用于评估硬件加速下的游戏性能。
|
|
29
|
+
|
|
11
30
|
## 0.6.6 · 2026-10-10
|
|
12
31
|
|
|
13
32
|
### 新增功能
|
package/README.md
CHANGED
|
@@ -324,6 +324,32 @@ provider. Model-facing `navigate` and `open_tab` actions accept HTTP(S) URLs onl
|
|
|
324
324
|
schemes such as `file:` and `data:` are rejected before Chrome starts; local files must enter
|
|
325
325
|
Browser upload through the workspace-authorized file input path.
|
|
326
326
|
|
|
327
|
+
#### WebGL tests without a usable GPU
|
|
328
|
+
|
|
329
|
+
If a page loads in a VM or CI but Three.js reports `Error creating WebGL context`, set
|
|
330
|
+
`MCODE_BROWSER_USE_SWIFTSHADER=true` before starting the TUI to use Chrome's bundled SwiftShader
|
|
331
|
+
software renderer. This does not enable Browser Use; `beta.browserUseTooling: true` is still
|
|
332
|
+
required. For TUI builds that support this option, Vela's `agents[].harness.env` can contain:
|
|
333
|
+
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"MCODE_TUI_BROWSER": "true",
|
|
337
|
+
"MCODE_BROWSER_USE_SWIFTSHADER": "true"
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Vela's execution adapter handles `MCODE_TUI_BROWSER`; local runs use the YAML configuration above.
|
|
342
|
+
The SwiftShader option accepts only `true` (case-insensitive, with surrounding whitespace ignored).
|
|
343
|
+
Unset or other values preserve Chrome's default rendering. Older TUI builds ignore this option;
|
|
344
|
+
changing the environment alone does not add support to an older build.
|
|
345
|
+
|
|
346
|
+
This mode adds `--use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader` and is intended
|
|
347
|
+
only for trusted local test pages; see
|
|
348
|
+
[Chromium's SwiftShader documentation](https://chromium.googlesource.com/chromium/src/+/main/docs/gpu/swiftshader.md).
|
|
349
|
+
CPU rendering can verify visuals and interactions, but is unsuitable for measuring game frame rates.
|
|
350
|
+
It does not additionally disable Chrome's process sandbox. An image that already includes a
|
|
351
|
+
SwiftShader-capable Chrome needs neither an image change nor a separate renderer installation.
|
|
352
|
+
|
|
327
353
|
### ACP clients
|
|
328
354
|
|
|
329
355
|
Start the Agent Client Protocol server over stdin/stdout:
|
package/README.zh-CN.md
CHANGED
|
@@ -32,6 +32,12 @@ MiniMax Code 会检查代码库、完成修改、运行能够执行的验证,
|
|
|
32
32
|
运行状态行、单轮结束后的耗时和 Goal 计时统一使用 `s` / `min` / `h`,例如
|
|
33
33
|
`30s`、`9min30s`、`2h9min30s`;超过一小时仍显示秒。运行耗时统计当前轮,Goal 统计累计 active 时间,两者数值可以不同。
|
|
34
34
|
|
|
35
|
+
## 清理文件与组合命令
|
|
36
|
+
|
|
37
|
+
在 macOS / Linux,Agent 的 `rm` 会转交给回收站程序。Shell 仍负责展开通配符和变量、处理引号和重定向;例如 `rm -f "$DIR"/*.png 2>/dev/null && npm run build`,清理成功后才执行构建。`-f` 下不存在的文件、空参数和重复目标不会中断后续命令;真实的移动失败仍返回非零退出码。目录需要 `-r`,当前目录、主目录及其祖先仍受到保护。
|
|
38
|
+
|
|
39
|
+
没有启用沙箱时,包含变量或通配符的删除需要明确授权;`--permission full` 属于明确授权。命令替换、进程替换等会执行代码的参数继续使用保守检查,不承诺兼容全部 Shell 语法或所有 `rm` 扩展选项。
|
|
40
|
+
|
|
35
41
|
## 模型、Provider 与终端设置
|
|
36
42
|
|
|
37
43
|
交互模式支持
|
|
@@ -435,6 +441,28 @@ Provider。模型侧的 `navigate` / `open_tab` 只接受 HTTP(S) URL;`file:`
|
|
|
435
441
|
等本地或内联 scheme 会在启动 Chrome 前被拒绝,上传本地文件应使用经过 workspace 授权的 Browser
|
|
436
442
|
upload 输入。
|
|
437
443
|
|
|
444
|
+
#### 无可用 GPU 的 WebGL 测试
|
|
445
|
+
|
|
446
|
+
在虚拟机或 CI 中,如果页面能打开,但 Three.js 报 `Error creating WebGL context`,可在启动 TUI 前设置
|
|
447
|
+
`MCODE_BROWSER_USE_SWIFTSHADER=true`,让 Browser 使用 Chrome 自带的 SwiftShader 软件渲染。此开关不会启用 Browser
|
|
448
|
+
Use,仍需上面的 `beta.browserUseTooling: true`。支持该开关的 TUI 版本在 Vela 中可以使用以下
|
|
449
|
+
`agents[].harness.env`:
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"MCODE_TUI_BROWSER": "true",
|
|
454
|
+
"MCODE_BROWSER_USE_SWIFTSHADER": "true"
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
`MCODE_TUI_BROWSER` 由 Vela 的执行适配器处理;本地运行仍使用上述 YAML 开启 Browser
|
|
459
|
+
Use。SwiftShader 开关只接受
|
|
460
|
+
`true`(忽略大小写及首尾空白),未设置或其他值保持 Chrome 默认渲染方式。旧 TUI 版本不会识别该开关;需使用包含此功能的构建,单独改 env 不会给旧版本补上能力。
|
|
461
|
+
|
|
462
|
+
该模式添加
|
|
463
|
+
`--use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader`,仅用于受信任的本地页面测试;Chrome 的说明见
|
|
464
|
+
[SwiftShader 文档](https://chromium.googlesource.com/chromium/src/+/main/docs/gpu/swiftshader.md)。它用 CPU 绘图,适合验证画面和交互,不适合测游戏帧率;不会额外关闭 Chrome 进程沙箱。镜像已包含支持 SwiftShader 的 Chrome 时,不需要更换镜像或安装独立渲染库。
|
|
465
|
+
|
|
438
466
|
### ACP 客户端
|
|
439
467
|
|
|
440
468
|
通过 stdin/stdout 启动 Agent Client Protocol 服务:
|
|
@@ -612,6 +640,29 @@ mcode provider test <provider-id>
|
|
|
612
640
|
|
|
613
641
|
</details>
|
|
614
642
|
|
|
643
|
+
## Windows 硬性安全检查开关
|
|
644
|
+
|
|
645
|
+
Windows 下,Runtime 默认会在 `off` 等权限模式之前检查删除命令、回收站工具可用性及受保护/含糊的路径。
|
|
646
|
+
首次启动生成的 `config.yaml` 会写入顶层 `skipWindowsHardSafetyChecks: false`,与 `permissionMode` 并列。如果这些检查误判
|
|
647
|
+
Python、XML 或 PowerShell 脚本,可在当前 TUI 数据目录的 `config.yaml` 中把它改为 `true`;已有配置
|
|
648
|
+
没有该项时手动添加。默认路径为 `~/.minimax/config.yaml`(Windows 为 `%USERPROFILE%\.minimax\config.yaml`);
|
|
649
|
+
设置数据目录、profile 或启动时 `--config` 参数时,修改实际使用的配置文件:
|
|
650
|
+
|
|
651
|
+
```yaml
|
|
652
|
+
skipWindowsHardSafetyChecks: true
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
默认值为 `false`;缺省或错误类型均不跳过,`"true"` 字符串也不会开启。修改后需重启 `mcode`;改回
|
|
656
|
+
`false` 或删除该项并重启即可恢复。该设置仅作用于 Windows TUI Runtime(包括 `exec` / ACP),不影响
|
|
657
|
+
Desktop、macOS 或 Linux。
|
|
658
|
+
|
|
659
|
+
开启后会跳过 Windows 命令文本和路径的硬性拦截,包括重复的路径检查;受保护路径写入也可能通过这层检查。
|
|
660
|
+
删除转入回收站的行为保持不变:即使使用 `permissionMode: off`(或 `--permission off`),已有解析器支持的
|
|
661
|
+
`rm` 和 Windows 原生删除仍重写为 `mavis-trash`。回收站不可用、不可信,或已识别的删除无法安全重写时仍会拦截,
|
|
662
|
+
不会退回执行原始永久删除命令。该开关不扩展删除解析器,不能保证任意脚本内部的删除都被识别和重写。
|
|
663
|
+
此配置本身不切换权限模式;`default` / `auto` 等模式的规则、确认、通用安全检查及执行层限制仍生效,仍可能阻止命令。
|
|
664
|
+
它只能解除这层权限拦截,不能修复后续脚本错误或保证文档任务成功。
|
|
665
|
+
|
|
615
666
|
## 更新与卸载
|
|
616
667
|
|
|
617
668
|
```bash
|
|
@@ -1,5 +1,5 @@
|
|
|
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{a as o,b as l,c as u}from"./chunk-
|
|
2
|
+
import{a as o,b as l,c as u}from"./chunk-F5BJTVSP.js";import"./chunk-3LM4G7WV.js";import{d as p}from"./chunk-RCKQIK7B.js";import"./chunk-TJWBPT2F.js";import"./chunk-VRCVX3OX.js";import"./chunk-3FETZOUF.js";import"./chunk-CWWDVX6C.js";import"./chunk-ZITT4GJK.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
3
|
Code: ${e.userCode}
|
|
4
4
|
Waiting for authorization\u2026
|
|
5
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.
|
|
@@ -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{b as i,c as n,d as o,h as a,i as r}from"./chunk-
|
|
2
|
+
import{b as i,c as n,d as o,h as a,i as r}from"./chunk-TJWBPT2F.js";function s(t){let e=i({dataDir:t.dataDir,buildEnv:t.buildEnv,region:t.region}),u=t.oauthClient??h(t.oauthEndpoints),d=r({authHome:e.namespaceHome});return new a({namespace:e,oauthClient:u,credentialStore:d,initialize:()=>n(e)})}function h(t){if(!t)throw new TypeError("Shared MCode OAuth requires explicit device authorization, token, and revocation endpoints.");return new o(t)}export{s as a};
|
|
@@ -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{a as p}from"./chunk-
|
|
2
|
+
import{a as p}from"./chunk-3LM4G7WV.js";import{e as g,k as d,m as h}from"./chunk-TJWBPT2F.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};
|