@minimax-ai/code 0.3.5 → 0.3.6
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 +19 -0
- package/CHANGELOG.zh-CN.md +10 -0
- package/README.md +21 -2
- package/README.zh-CN.md +18 -2
- package/chunks/{application-HUWMCHND.js → application-NV4X3RV4.js} +1 -1
- package/chunks/{auth-command-BYZBT26P.js → auth-command-AYTFOBP7.js} +1 -1
- package/chunks/{azure-openai-responses-FWEOB2GJ.js → azure-openai-responses-TYAI4QCH.js} +1 -1
- package/chunks/{chunk-H3N3OSTE.js → chunk-BN5ADI2D.js} +495 -495
- package/chunks/{chunk-MZPFHOPH.js → chunk-EJS4KRR2.js} +1 -1
- package/chunks/{chunk-BLWZ6QN5.js → chunk-G7PNCKMS.js} +1 -1
- package/chunks/{chunk-JAU52A7E.js → chunk-GMXY243M.js} +1 -1
- package/chunks/{chunk-XAM5MDT7.js → chunk-ISF4HEC4.js} +1 -1
- package/chunks/{chunk-KIJODLFS.js → chunk-J63OB7U2.js} +4 -4
- package/chunks/chunk-KXO2REWJ.js +164 -0
- package/chunks/{chunk-SAVPNWES.js → chunk-RM42PCDV.js} +20 -20
- package/chunks/chunk-RWIFT2VZ.js +3 -0
- package/chunks/{chunk-B3RZOZAM.js → chunk-TJUTHJIS.js} +426 -426
- package/chunks/{chunk-XRVRMFGU.js → chunk-VBDTVEVF.js} +1 -1
- package/chunks/{chunk-LA56ACSJ.js → chunk-ZXOZXMWQ.js} +1 -1
- package/chunks/{data-dir-VQU534BQ.js → data-dir-2ZJFRWW6.js} +1 -1
- package/chunks/dist-S32WQUVY.js +2 -0
- package/chunks/install-source-O2EK6H3D.js +2 -0
- package/chunks/{launcher-MX2NVH43.js → launcher-FVXKFL4F.js} +38 -38
- package/chunks/{lifecycle-FOX6WX4K.js → lifecycle-E2PPZ25G.js} +1 -1
- package/chunks/{main-QMF5ARJ7.js → main-5I5LJBKT.js} +15 -14
- package/chunks/{openai-codex-responses-4DFNORNB.js → openai-codex-responses-HB3H25XX.js} +1 -1
- package/chunks/{openai-completions-7UHFNP2X.js → openai-completions-4CWNFN62.js} +1 -1
- package/chunks/{openai-responses-FVDPT4UA.js → openai-responses-3ODEYAEO.js} +1 -1
- package/chunks/{plugin-command-PPXN6LWR.js → plugin-command-P3VM77DS.js} +1 -1
- package/chunks/{provider-command-B3MUOIKK.js → provider-command-GUP4G3TR.js} +1 -1
- package/chunks/{run-acp-command-VU6B46YW.js → run-acp-command-2YNDWCTK.js} +2 -2
- package/chunks/{run-exec-command-3MEFVBVG.js → run-exec-command-O7SOL3RW.js} +1 -1
- package/chunks/{update-UUNJOWUN.js → update-JJ5EYXC6.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
- package/verify-native-install.mjs +4 -4
- package/chunks/chunk-GGVSHD4M.js +0 -165
- package/chunks/dist-K5PPY2Q5.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,25 @@ 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.6 · 2026-09-07
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- When MCode shares its data directory with MiniMax Desktop, official model endpoints are now
|
|
15
|
+
resolved in memory for the current environment: reading configuration or first-run
|
|
16
|
+
initialization no longer writes new official endpoints into the shared config file, so older
|
|
17
|
+
Desktop versions keep working alongside the TUI. Custom (BYOK) endpoints behave as before.
|
|
18
|
+
- Legacy model recovery now also covers numbered model aliases and retired default models, and
|
|
19
|
+
applies consistently to the model list, Goal model checks, and login checks: selections
|
|
20
|
+
pointing at the legacy official gateway resolve to the same-name official model, then the
|
|
21
|
+
configured default model, then the current official default. Shared default models, session
|
|
22
|
+
model references, and migration records are preserved; only explicit user selections are
|
|
23
|
+
written back to configuration.
|
|
24
|
+
- Installing or updating with npm 12 no longer breaks the native SQLite module: install and
|
|
25
|
+
update authorize the MCode and `better-sqlite3` lifecycle scripts and keep optional native
|
|
26
|
+
dependencies. When native SQLite fails to load, startup prints a repair command matching the
|
|
27
|
+
install registry, and early startup errors are reported instead of failing silently.
|
|
28
|
+
|
|
10
29
|
## 0.3.5 · 2026-09-07
|
|
11
30
|
|
|
12
31
|
### Fixed
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,16 @@ TUI 正式版中用户能直接感知的重要变化。收录范围以 TUI 用
|
|
|
8
8
|
|
|
9
9
|
仅内部重构、测试调整,或只影响其他产品界面且不改变 TUI 行为的变化不记录。
|
|
10
10
|
|
|
11
|
+
## 0.3.6 · 2026-09-07
|
|
12
|
+
|
|
13
|
+
### 问题修复
|
|
14
|
+
|
|
15
|
+
- 与 MiniMax 桌面端共用数据目录时,官方模型地址改为在 TUI 内按当前环境解析:读取配置和首次初始化不再向共享配置文件写入新的官方地址,避免影响旧版桌面端;自定义(BYOK)服务地址行为不变。
|
|
16
|
+
- 遗留模型自动恢复扩展到编号模型别名和已下线的默认模型,并统一覆盖模型列表、Goal
|
|
17
|
+
模型校验和登录检查:指向旧官方网关的模型选择依次解析为官方同名模型、配置默认模型和当前官方默认模型;共享默认模型、会话模型引用和迁移记录保持不变,仅用户主动选择模型才会写回配置。
|
|
18
|
+
- 修复 npm 12 下安装或更新导致 SQLite 原生模块损坏的问题:安装和更新会授权 MCode 与
|
|
19
|
+
`better-sqlite3` 的安装脚本并保留可选原生依赖;原生模块加载失败时,启动会按安装来源给出对应的修复命令,启动早期错误也会如实报告而不是静默失败。
|
|
20
|
+
|
|
11
21
|
## 0.3.5 · 2026-09-07
|
|
12
22
|
|
|
13
23
|
### 问题修复
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ ACP-compatible client.
|
|
|
13
13
|
Requires Node.js `22.19+` on Node 22, or Node.js `24–26`.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install -g @minimax-ai/code
|
|
16
|
+
npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3 --registry=https://registry.npmjs.org/
|
|
17
17
|
cd your-project
|
|
18
18
|
mcode
|
|
19
19
|
```
|
|
@@ -262,11 +262,30 @@ switching Node.js versions, reinstall MiniMax Code:
|
|
|
262
262
|
|
|
263
263
|
```bash
|
|
264
264
|
node --version
|
|
265
|
-
npm install -g @minimax-ai/code
|
|
265
|
+
npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3 --registry=https://registry.npmjs.org/
|
|
266
266
|
```
|
|
267
267
|
|
|
268
268
|
</details>
|
|
269
269
|
|
|
270
|
+
<details>
|
|
271
|
+
<summary>Missing native SQLite dependency or blocked installation scripts</summary>
|
|
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`.
|
|
276
|
+
|
|
277
|
+
If startup reports `Could not locate the bindings file` or a missing `better_sqlite3.node`,
|
|
278
|
+
reinstall with the installation log visible:
|
|
279
|
+
|
|
280
|
+
```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
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Start `mcode` after `[MCode] Native SQLite check passed.` appears. This repairs native dependencies
|
|
285
|
+
in the installation directory and preserves existing configuration and Sessions.
|
|
286
|
+
|
|
287
|
+
</details>
|
|
288
|
+
|
|
270
289
|
<details>
|
|
271
290
|
<summary>Authentication or Provider problems</summary>
|
|
272
291
|
|
package/README.zh-CN.md
CHANGED
|
@@ -12,7 +12,7 @@ Code 能理解代码库、修改文件、执行命令和测试,并把每次工
|
|
|
12
12
|
需要 Node.js `22.19+`(Node 22)或 Node.js `24–26`。
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npm install -g @minimax-ai/code
|
|
15
|
+
npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3 --registry=https://registry.npmjs.org/
|
|
16
16
|
cd your-project
|
|
17
17
|
mcode
|
|
18
18
|
```
|
|
@@ -222,11 +222,27 @@ Code:
|
|
|
222
222
|
|
|
223
223
|
```bash
|
|
224
224
|
node --version
|
|
225
|
-
npm install -g @minimax-ai/code
|
|
225
|
+
npm install -g @minimax-ai/code --allow-scripts=@minimax-ai/code,better-sqlite3 --registry=https://registry.npmjs.org/
|
|
226
226
|
```
|
|
227
227
|
|
|
228
228
|
</details>
|
|
229
229
|
|
|
230
|
+
<details>
|
|
231
|
+
<summary>SQLite 原生依赖缺失或安装脚本被阻止</summary>
|
|
232
|
+
|
|
233
|
+
npm 12 默认阻止未经授权的安装脚本。安装 MCode 时,需要允许当前 MCode 包和 `better-sqlite3`
|
|
234
|
+
的脚本执行;`ignore-scripts=false` 只解除全局禁用,仍需 `--allow-scripts` 授权。
|
|
235
|
+
|
|
236
|
+
如果启动提示 `Could not locate the bindings file` 或缺少 `better_sqlite3.node`,重新安装并显示安装日志:
|
|
237
|
+
|
|
238
|
+
```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
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
看到 `[MCode] Native SQLite check passed.` 后再启动 `mcode`。此操作修复安装目录中的原生依赖,保留已有配置和会话。
|
|
243
|
+
|
|
244
|
+
</details>
|
|
245
|
+
|
|
230
246
|
<details>
|
|
231
247
|
<summary>登录或 Provider 异常</summary>
|
|
232
248
|
|
|
@@ -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-
|
|
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};
|
|
@@ -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 p,c as u}from"./chunk-
|
|
2
|
+
import{a as o,b as p,c as u}from"./chunk-G7PNCKMS.js";import"./chunk-ISF4HEC4.js";import{d as n}from"./chunk-VBDTVEVF.js";import"./chunk-J63OB7U2.js";import"./chunk-RM42PCDV.js";import"./chunk-ZITT4GJK.js";import"./chunk-MMRA4VD2.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";async function f(e={}){let t=e.createApplication?e.createApplication(e.region):await c(e.region,e.prepareDataDir),a=e.writeError??(r=>process.stderr.write(r));return(await t.login(r=>{let i=p(r.verificationUriComplete??r.verificationUri);if(a(`Open: ${i}
|
|
3
3
|
Code: ${r.userCode}
|
|
4
4
|
Waiting for authorization\u2026
|
|
5
5
|
`),e.openBrowser===!1)return;(e.openExternalTarget??o(process.cwd()))(i).catch(()=>{a(`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{a as R,b as g,c as h}from"./chunk-ECV3PLKX.js";import
|
|
2
|
+
import{a as R,b as g,c as h}from"./chunk-ECV3PLKX.js";import{a as y}from"./chunk-SHXPTUWI.js";import"./chunk-PWQHCWDV.js";import{b as f}from"./chunk-IIHJNKC3.js";import"./chunk-II4JKPH5.js";import{f as d,g as l,h as A,j as E}from"./chunk-KSPFS4MM.js";import{a as m}from"./chunk-CK62QLTS.js";import"./chunk-WFWSBUYD.js";import"./chunk-D76SO2ME.js";var w="v1",U=new Set(["openai","openai-codex","opencode","azure-openai-responses"]);function O(r){let t=new Map;if(!r)return t;for(let e of r.split(",")){let s=e.trim();if(!s)continue;let[a,n]=s.split("=",2);!a||!n||t.set(a.trim(),n.trim())}return t}function I(r,t){return t?.azureDeploymentName?t.azureDeploymentName:O(process.env.AZURE_OPENAI_DEPLOYMENT_NAME_MAP).get(r.id)||r.id}function z(r){if(r instanceof Error){let t=r.status,e=typeof t=="number"?t:void 0;return e!==void 0?`Azure OpenAI API error (${e}): ${r.message}`:r.message}try{return JSON.stringify(r)}catch{return String(r)}}var N=(r,t,e)=>{let s=new l;return(async()=>{let a=I(r,e),n={role:"assistant",content:[],api:"azure-openai-responses",provider:r.provider,model:r.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let o=e?.apiKey;if(!o)throw new Error(`No API key for provider: ${r.provider}`);let i=L(r,o,e),u=M(r,t,e,a),c=await e?.onPayload?.(u,r);c!==void 0&&(u=c);let _={...e?.signal?{signal:e.signal}:{},...e?.timeoutMs!==void 0?{timeout:e.timeoutMs}:{},maxRetries:e?.maxRetries??0},{data:v,response:p}=await i.responses.create(u,_).withResponse();if(await e?.onResponse?.({status:p.status,headers:m(p.headers)},r),s.push({type:"start",partial:n}),await h(v,n,s,r),e?.signal?.aborted)throw new Error("Request was aborted");if(n.stopReason==="aborted"||n.stopReason==="error")throw new Error("An unknown error occurred");s.push({type:"done",reason:n.stopReason,message:n}),s.end()}catch(o){A(e?.onProviderError,o,r);for(let i of n.content)delete i.index,delete i.partialJson;n.stopReason=e?.signal?.aborted?"aborted":"error",n.errorMessage=z(o),s.push({type:"error",reason:n.stopReason,error:n}),s.end()}})(),s},V=(r,t,e)=>{let s=e?.apiKey;if(!s)throw new Error(`No API key for provider: ${r.provider}`);let a=E(r,e,s),n=e?.reasoning?d(r,e.reasoning):void 0;return N(r,t,{...a,reasoningEffort:n==="off"?void 0:n})};function P(r){let t=r.trim().replace(/\/+$/,""),e;try{e=new URL(t)}catch{throw new Error(`Invalid Azure OpenAI base URL: ${r}`)}let s=e.hostname.endsWith(".openai.azure.com")||e.hostname.endsWith(".cognitiveservices.azure.com"),a=e.pathname.replace(/\/+$/,"");return s&&(a===""||a==="/"||a==="/openai")&&(e.pathname="/openai/v1",e.search=""),e.toString().replace(/\/+$/,"")}function b(r){return`https://${r}.openai.azure.com/openai/v1`}function S(r,t){let e=t?.azureApiVersion||process.env.AZURE_OPENAI_API_VERSION||w,s=t?.azureBaseUrl?.trim()||process.env.AZURE_OPENAI_BASE_URL?.trim()||void 0,a=t?.azureResourceName||process.env.AZURE_OPENAI_RESOURCE_NAME,n=s;if(!n&&a&&(n=b(a)),!n&&r.baseUrl&&(n=r.baseUrl),!n)throw new Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:P(n),apiVersion:e}}function L(r,t,e){let s={...r.headers};e?.headers&&Object.assign(s,e.headers);let{baseUrl:a,apiVersion:n}=S(r,e);return new f({apiKey:t,apiVersion:n,dangerouslyAllowBrowser:!0,defaultHeaders:s,baseURL:a})}function M(r,t,e,s){let a=R(r,t,U),n={model:s,input:a,stream:!0,prompt_cache_key:y(e?.sessionId),store:!1};if(e?.maxTokens&&(n.max_output_tokens=e?.maxTokens),e?.temperature!==void 0&&(n.temperature=e?.temperature),t.tools&&t.tools.length>0&&(n.tools=g(t.tools)),r.reasoning)if(e?.reasoningEffort||e?.reasoningSummary){let o=e?.reasoningEffort?r.thinkingLevelMap?.[e.reasoningEffort]??e.reasoningEffort:"medium";n.reasoning={effort:o,summary:e?.reasoningSummary||"auto"},n.include=["reasoning.encrypted_content"]}else r.thinkingLevelMap?.off!==null&&(n.reasoning={effort:r.thinkingLevelMap?.off??"none"});return n}export{N as streamAzureOpenAIResponses,V as streamSimpleAzureOpenAIResponses};
|