@minimax-ai/code 0.3.7 → 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.
- package/CHANGELOG.md +16 -0
- package/CHANGELOG.zh-CN.md +12 -0
- package/README.zh-CN.md +13 -0
- package/chunks/auth-command-ZGB3QKMA.js +9 -0
- package/chunks/chunk-4S3IXX3N.js +2 -0
- package/chunks/{chunk-MQKRH5EW.js → chunk-676PV6PV.js} +452 -452
- package/chunks/{chunk-RTN2VVTR.js → chunk-XI2HYP4Q.js} +403 -403
- package/chunks/{chunk-E3Y7YZFG.js → chunk-XQ2OPT34.js} +1 -1
- package/chunks/{launcher-N4XF6G4T.js → launcher-OZHJWAUU.js} +140 -139
- package/chunks/{lifecycle-2Z6U4ZFY.js → lifecycle-AOSJQEST.js} +1 -1
- package/chunks/{main-LM42U7RA.js → main-F7JZ3TVA.js} +1 -1
- package/chunks/{plugin-command-ENLMEUEV.js → plugin-command-W57XX6PP.js} +1 -1
- package/chunks/{provider-command-SHDAR5N3.js → provider-command-54WYLAEF.js} +1 -1
- package/chunks/{run-acp-command-IIRG3KK2.js → run-acp-command-TXYZMYHR.js} +1 -1
- package/chunks/{run-exec-command-CWJBGPN7.js → run-exec-command-WJX5CTIJ.js} +1 -1
- package/cli.js +1 -1
- package/package.json +1 -1
- package/chunks/auth-command-ZZXFBWOS.js +0 -6
- package/chunks/chunk-RXHPXCVW.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ 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
|
+
|
|
10
26
|
## 0.3.7 · 2026-09-07
|
|
11
27
|
|
|
12
28
|
### Improved
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,18 @@ 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
|
+
|
|
11
23
|
## 0.3.7 · 2026-09-07
|
|
12
24
|
|
|
13
25
|
### 改进
|
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 |
|
|
@@ -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};
|