@minimax-ai/code 0.6.4 → 0.6.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 +77 -0
- package/CHANGELOG.zh-CN.md +33 -0
- package/README.md +44 -7
- package/README.zh-CN.md +23 -4
- package/chunks/{application-YV6I5PN3.js → application-ZJ5NM3DF.js} +1 -1
- package/chunks/{auth-command-F6CMS6YE.js → auth-command-VA6MMKOP.js} +1 -1
- package/chunks/{chunk-Z4VKGZFA.js → chunk-3FETZOUF.js} +30 -30
- package/chunks/{chunk-C2QIYD6E.js → chunk-52X742AN.js} +1 -1
- package/chunks/{chunk-LOIYR2RZ.js → chunk-AKM6CI7T.js} +1 -1
- package/chunks/{chunk-DKHGVKVS.js → chunk-EGP34E73.js} +1 -1
- package/chunks/{chunk-AVYSGYVY.js → chunk-EZ7Q2NM4.js} +94 -94
- package/chunks/{chunk-RWMY26JX.js → chunk-G5QL7ZHU.js} +706 -702
- package/chunks/{chunk-OQ7HN3XJ.js → chunk-LQIEYG3O.js} +1 -1
- package/chunks/{chunk-AQ73XBVZ.js → chunk-VCAGMAY5.js} +1 -1
- package/chunks/{chunk-77TNCP5I.js → chunk-WQPQHX2N.js} +1 -1
- package/chunks/{chunk-IBPQKAN6.js → chunk-WUBVVATA.js} +676 -676
- package/chunks/{data-dir-U4LWH2QP.js → data-dir-IMRONFFA.js} +1 -1
- package/chunks/dist-63237B2W.js +2 -0
- package/chunks/{launcher-74Z5T4C2.js → launcher-AW4MDLKG.js} +87 -87
- package/chunks/{lifecycle-ADITN7NX.js → lifecycle-INAA4RL2.js} +1 -1
- package/chunks/{main-WKTFLQ4A.js → main-AFQG6DBW.js} +2 -2
- package/chunks/{plugin-command-7PC7EX65.js → plugin-command-LOWP3CEB.js} +1 -1
- package/chunks/{provider-command-JWWVMDYX.js → provider-command-CS5TVIBU.js} +1 -1
- package/chunks/{run-acp-command-AAHBRZ4K.js → run-acp-command-2QYNAZF5.js} +2 -2
- package/chunks/{run-exec-command-HGDHDSXT.js → run-exec-command-XCRQ6UR5.js} +1 -1
- package/chunks/{update-X4G4FEY3.js → update-HOQ5YQFF.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
- package/chunks/dist-KNYBCP4F.js +0 -2
|
@@ -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 y,c as M,d as p}from"./chunk-NICEDCLM.js";import{b as ie}from"./chunk-FKQFVOLR.js";import{a as q,b as C,c as ee,e as te,f as I,h as re,i as ne}from"./chunk-3MHUE4DM.js";import{a as A,b as U,c as _,d as F,e as K,f as V,k as z,m as b,n as H,p as x,q as X,r as G,s as Y,t as Z,w as W,x as Q}from"./chunk-RDUENEEQ.js";import{a as Oe}from"./chunk-HQ2U4QVQ.js";import{n as S}from"./chunk-
|
|
2
|
+
import{a as y,c as M,d as p}from"./chunk-NICEDCLM.js";import{b as ie}from"./chunk-FKQFVOLR.js";import{a as q,b as C,c as ee,e as te,f as I,h as re,i as ne}from"./chunk-3MHUE4DM.js";import{a as A,b as U,c as _,d as F,e as K,f as V,k as z,m as b,n as H,p as x,q as X,r as G,s as Y,t as Z,w as W,x as Q}from"./chunk-RDUENEEQ.js";import{a as Oe}from"./chunk-HQ2U4QVQ.js";import{n as S}from"./chunk-3FETZOUF.js";import{e as Le}from"./chunk-D76SO2ME.js";var pe=Le(Oe(),1);import{createHash as De}from"node:crypto";import{existsSync as k,mkdirSync as se,readFileSync as v,renameSync as ce,rmSync as de,writeFileSync as le}from"node:fs";import{homedir as Je}from"node:os";import d from"node:path";var Be="https://algeng-ali-shanghai-agent-02.oss-cn-shanghai.aliyuncs.com/minimax-dialogue/data/env/.npm-global/mcode",je=8e3,$=class{currentVersion;installRoot;releaseBaseUrl;publicKey;environment;dependencies;constructor(e){this.currentVersion=U(e.currentVersion),this.installRoot=e.installRoot??L(e.environment),this.releaseBaseUrl=(e.releaseBaseUrl??Be).replace(/\/+$/u,""),this.publicKey=e.publicKey,this.environment=e.environment??process.env,this.dependencies={fetchBytes:Ke,installArtifact:ze,validateInstalledVersion:He,...e.dependencies}}async check(e={}){M(e.signal),p(e,"checking",!0);let r=e.channel?A(e.channel):_e(this.installRoot),n=e.version?U(e.version):void 0,i=n?`${this.releaseBaseUrl}/releases/${encodeURIComponent(n)}/manifest.json`:`${this.releaseBaseUrl}/channels/${r}.json`,o=this.publicKey??Fe(this.installRoot,this.environment),a=ae(e.timeoutMs),s=new AbortController,c=oe(e.signal,s),f=!1,l=setTimeout(()=>{f=!0,s.abort(new Error(`MCode update check timed out after ${a}ms.`))},a);l.unref?.();try{let[u,h]=await Promise.all([this.dependencies.fetchBytes(i,{signal:s.signal,proxyEnvironment:this.environment}),this.dependencies.fetchBytes(`${i}.sig`,{signal:s.signal,proxyEnvironment:this.environment})]),g=_(u,h.toString("utf8"),o);if(!n&&g.channel!==r)throw new Error(`Signed MCode release channel mismatch: expected ${r}, got ${g.channel}.`);if(n&&g.version!==n)throw new Error(`Signed MCode release version mismatch: expected ${n}, got ${g.version}.`);K(g,F());let m=V(this.currentVersion,g.version);return{status:m<0?"available":m>0?"ahead":"current",channel:r,currentVersion:this.currentVersion,latestVersion:g.version,manifest:g}}catch(u){throw e.signal?.aborted?new y:f?new Error(`MCode update check timed out after ${a}ms.`,{cause:u}):u}finally{clearTimeout(l),c()}}async apply(e={}){let r=await this.check(e);if(r.status==="current")return{...r,applied:!1,installRoot:this.installRoot};if(r.status==="ahead"&&!e.version)throw new Error(`Installed MCode ${this.currentVersion} is newer than ${r.channel} ${r.latestVersion}; pass --to to downgrade explicitly.`);let n=ae(e.timeoutMs);M(e.signal),p(e,"downloading",!0);let i=new AbortController,o=oe(e.signal,i),a=!1,s=setTimeout(()=>{a=!0,i.abort(new Error(`MCode artifact download timed out after ${n}ms.`))},n);s.unref?.();let c;try{c=await this.dependencies.fetchBytes(r.manifest.installArtifact.url,{signal:i.signal,proxyEnvironment:this.environment})}catch(m){throw e.signal?.aborted?new y:a?new Error(`MCode artifact download timed out after ${n}ms.`,{cause:m}):m}finally{clearTimeout(s),o()}M(e.signal),Xe(c,r.manifest);let f=d.join(this.installRoot,"versions"),l=d.join(f,r.latestVersion),u=d.join(f,`.staging-${r.latestVersion}-${process.pid}-${Date.now()}`),h=d.join(u,`minimax-mcode-${r.latestVersion}.tgz`);se(u,{recursive:!0});let g=!1;try{return p(e,"staging",!0),M(e.signal),le(h,c,{mode:384}),M(e.signal),p(e,"installing",!1),await this.dependencies.installArtifact({artifact:h,prefix:u,registry:r.manifest.registry,proxyEnvironment:this.environment}),M(e.signal),S(()=>de(h,{force:!0})),p(e,"validating",!1),await this.dependencies.validateInstalledVersion(u,r.latestVersion),M(e.signal),p(e,"activating",!1),k(l)?(await this.dependencies.validateInstalledVersion(l,r.latestVersion),T(u)):(S(()=>ce(u,l)),g=!0),Ge(this.installRoot,r.latestVersion),p(e,"completed",!1),{...r,applied:!0,installRoot:this.installRoot}}catch(m){throw T(u),g&&Ye(this.installRoot)!==r.latestVersion&&T(l),m instanceof y||e.signal?.aborted?new y:new Error(`MCode ${r.latestVersion} was not activated; the previous version is unchanged: ${ge(m)}`,{cause:m})}}};function L(t=process.env){if(t.MCODE_INSTALL_ROOT)return d.resolve(t.MCODE_INSTALL_ROOT);if(process.platform==="win32"){let r=t.LOCALAPPDATA;if(!r)throw new Error("LOCALAPPDATA is required to resolve the MCode install root.");return d.join(r,"MinimaxCode")}let e=t.XDG_DATA_HOME||d.join(Je(),".local","share");return d.join(e,"minimax-code")}function _e(t){let e=d.join(t,"update.json");if(!k(e))return"stable";let r;try{r=JSON.parse(v(e,"utf8"))}catch(n){throw new Error(`MCode update channel config is invalid: ${ge(n)}`)}if(typeof r!="object"||r===null||!("channel"in r)||typeof r.channel!="string")throw new Error("MCode update channel config is missing channel.");return A(r.channel)}function Fe(t,e){let r=e.MCODE_RELEASE_PUBLIC_KEY_FILE;if(r)return v(d.resolve(r),"utf8");let n=d.join(t,"install.json");if(!k(n))throw new Error("MCode update trust root is missing. Install with the official Shell/PowerShell installer first.");let i=JSON.parse(v(n,"utf8"));if(typeof i.publicKey!="string"||!i.publicKey.includes("BEGIN PUBLIC KEY"))throw new Error("MCode installer metadata does not contain a valid release public key.");return i.publicKey}function ae(t){if(t===void 0)return je;if(!Number.isSafeInteger(t)||t<100||t>6e4)throw new Error("MCode update timeout must be an integer between 100 and 60000 milliseconds.");return t}async function Ke(t,e={}){let[{default:r},{createTuiNetworkDispatcher:n}]=await Promise.all([import("./undici-75A6L7DQ.js"),import("./network-proxy-D4QGWYR5.js")]),i=n(e.proxyEnvironment);try{let o=await r.fetch(t,{signal:e.signal,dispatcher:i,redirect:"error"});if(!o.ok)throw new Error(`MCode release server returned HTTP ${o.status} for ${t}`);return Buffer.from(await o.arrayBuffer())}finally{await i.close()}}async function ze(t){let e=process.platform==="win32"?"npm.cmd":"npm";await ue(e,["install","--global","--prefix",t.prefix,t.artifact,"--registry",t.registry,"--no-audit","--no-fund","--package-lock=false"],t.proxyEnvironment,!0)}async function He(t,e){let r=d.join(t,"bin","mcode"),n=["--version"];if(process.platform==="win32"){let o=q(t,b().packageName),a=JSON.parse(v(d.join(o,"package.json"),"utf8")),s=ne(a.bin,"mcode");if(!s||!k(d.join(t,"mcode.cmd")))throw new Error(`Installed MCode launcher is missing or invalid at ${t}.`);r=process.execPath,n=[d.join(o,s),"--version"]}let i=await ue(r,n,process.env,!0);if(i.trim()!==e)throw new Error(`Installed MCode version mismatch: expected ${e}, got ${i.trim()}`)}function ue(t,e,r,n=!1){return new Promise((i,o)=>{let a=!1,s=(0,pe.default)(t,e,{env:r,shell:!1,stdio:n?["ignore","pipe","pipe"]:"inherit",windowsHide:!0}),c=[],f=[];s.stdout?.on("data",l=>c.push(l)),s.stderr?.on("data",l=>f.push(l)),s.once("error",l=>{a||(a=!0,o(l))}),s.once("close",(l,u)=>{if(a)return;if(a=!0,l===0)return i(Buffer.concat(c).toString("utf8"));let h=Buffer.concat(f).toString("utf8").trim();o(new Error(`${t} failed (${u?`signal ${u}`:`exit ${String(l)}`})${h?`: ${h}`:""}`))})})}function oe(t,e){if(!t)return()=>{};let r=()=>e.abort(t.reason);return t.aborted?r():t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}function Xe(t,e){if(t.length!==e.installArtifact.size)throw new Error(`MCode artifact checksum/size verification failed: expected ${e.installArtifact.size} bytes, got ${t.length}.`);if(De("sha256").update(t).digest("hex")!==e.installArtifact.sha256)throw new Error("MCode artifact checksum verification failed.")}function Ge(t,e){se(t,{recursive:!0});let r=d.join(t,"current"),n=`${r}.tmp-${process.pid}-${Date.now()}`;le(n,`${e}
|
|
3
3
|
`,{mode:384}),S(()=>ce(n,r))}function T(t){de(t,{recursive:!0,force:!0,maxRetries:4,retryDelay:50})}function Ye(t){let e=d.join(t,"current");if(k(e))return v(e,"utf8").trim()||void 0}function ge(t){return t instanceof Error?t.message:String(t)}function kt(t=process.env){return"A staged MCode update will activate after this process exits."}function wt(t=process.env){return"MCode update was staged, but its activation journal could not be scheduled."}function fe(t){return"MCode npm prefix updater received a non-prefix plan."}function me(t){return"MCode npm prefix ownership metadata is missing."}function he(t,e={}){if(e.blockingSessionCount===void 0)return`MCode ${t} is already staged. Restarting will resume activation after running MCode sessions exit.`;let r=Math.max(0,Math.trunc(e.blockingSessionCount));return r>0?`MCode ${t} is already staged. Activation will wait for ${String(r)} other MCode ${r===1?"session":"sessions"} to exit.`:`MCode ${t} is already staged. It will activate after this process exits.`}function Me(t,e={}){if(e.blockingSessionCount===void 0)return`MCode ${t} is already active. Restarting will finish update cleanup after running MCode sessions exit.`;let r=Math.max(0,Math.trunc(e.blockingSessionCount));return r>0?`MCode ${t} is already active. Update cleanup will wait for ${String(r)} other MCode ${r===1?"session":"sessions"} to exit.`:`MCode ${t} is already active. Restarting will finish update cleanup.`}function Pe(t,e,r){return`MCode update staged ${t}; expected ${e}.`}function xe(t,e=process.env){let r=e.LC_ALL||e.LC_MESSAGES||e.LANG;return ie(r,"update.versionedInstalled").replace("{version}",t)}function ye(t,e,r){return`MCode ${t} was not staged; the active installation is unchanged: ${e}`}import{randomUUID as R}from"node:crypto";import{chmodSync as Ze,existsSync as O,mkdirSync as N,readdirSync as We,readFileSync as B,renameSync as Se,rmSync as D,writeFileSync as Ve}from"node:fs";import P from"node:path";var j="releases",be="current",Qe=".mcode-update.lock",qe=2;function Ce(t,e,r=process.platform){return E(r).join(t,j,`.staging-${e}-${process.pid}-${R()}`)}function $e(t){N(t,{recursive:!0,mode:448})}function Re(t){let e=P.join(t,Qe);N(e,{recursive:!0,mode:448});let r=`${String(process.pid)}-${R()}.claim`,n=P.join(e,r);Ve(n,`choosing
|
|
4
4
|
`,{flag:"wx",mode:384});try{let o=Math.max(0,...ke(e).map(s=>s.ticket??0))+1;if(w(n,`${String(o)}
|
|
5
5
|
`,384),ke(e).some(s=>s.name!==r&&(s.ticket===void 0||s.ticket<o||s.ticket===o&&(s.pid<process.pid||s.pid===process.pid&&s.name.localeCompare(r)<0))))throw new Error("Another MCode update is already running.")}catch(o){throw D(n,{force:!0}),o}let i=!1;return()=>{i||(i=!0,D(n,{force:!0}))}}function Ne(t,e=process.platform){let r=E(e),n=r.join(t.activePrefix,j),i=Ae(t.stagingPrefix,t,e);et(t.stagingPrefix,i,t.runtimeExecutable,e),ve(t.stagingPrefix,t,e),N(n,{recursive:!0,mode:448});let o=t.expectedVersion,a=r.join(n,o);return O(a)&&(o=`${t.expectedVersion}-repair-${R()}`,a=r.join(n,o)),Se(t.stagingPrefix,a),ve(a,t,e),nt(t,e),rt(t.activePrefix,e)||tt(t.activePrefix,e),w(r.join(t.activePrefix,be),`${o}
|
|
@@ -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-52X742AN.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-VCAGMAY5.js";import{e as g,k as d,m as h}from"./chunk-52X742AN.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};
|