mmx-cli 1.0.14 → 1.0.15
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/dist/mmx.mjs +1 -1
- package/dist/sdk.mjs +1 -1
- package/package.json +1 -1
package/dist/mmx.mjs
CHANGED
|
@@ -119,7 +119,7 @@ Music-2.6 requires the Max plan or above.`;return""}function we(t){return`${t?.i
|
|
|
119
119
|
Re-authenticate: mmx auth login`);if(t===429)return new _(`Rate limit or quota exceeded. ${i}`,y.QUOTA,"Check usage: mmx quota show");if(t===408||t===504)return new _(`Request timed out (HTTP ${t}).`,y.TIMEOUT,"Try increasing --timeout or retry later.");if(r===1002||r===1039){let m=n.base_resp?.status_msg||"content sensitivity";return new _(`Input content flagged by sensitivity filter (${m}).`,y.CONTENT_FILTER)}if(r===1028||r===1030){let m=_e(e);return new _(`Quota exhausted. ${i}`,y.QUOTA,`Check usage: mmx quota show${m}
|
|
120
120
|
Upgrade plan: ${we(e)}`)}if(r===2061){let m=_e(e);return new _(`This model is not available on your current Token Plan. ${i}`,y.QUOTA,`Check usage: mmx quota show${m}
|
|
121
121
|
Upgrade plan: ${we(e)}`)}return new _(`API error: ${i} (HTTP ${t})`,y.GENERAL)}var ue=b(()=>{k();h()});import{homedir as Me}from"os";function dm(t){return t.startsWith(Me())?t.replace(Me(),"~"):t}function fm(t){return t.replace(/^https?:\/\//,"")}function ve(t,n,e){if(t.quiet||ce||!process.stderr.isTTY)return;ce=!0;let i=t.configPath?dm(t.configPath):"~/.mmx/config.json",r=fm(t.baseUrl),m=t.apiKey?"(flag)":"(file)",$=a(n),p=e?` ${xt}|${F} ${xt}Model:${F} ${Lm}${e}${F}`:"";process.stderr.write(`${lm}${Em}MINIMAX${F} ${xt}${i}${F} ${xt}|${F} ${xt}URL:${F} ${Cm}${r}${F} ${xt}|${F} ${xt}Key:${F} ${Fm}${$}${F} ${xt}${m}${F}${p}
|
|
122
|
-
`)}var ce=!1,F="\x1B[0m",xt="\x1B[2m",lm="\x1B[1m",Em="\x1B[38;2;43;82;255m",Lm="\x1B[38;2;147;51;234m",Cm="\x1B[38;2;6;184;212m",Fm="\x1B[38;2;236;72;153m";var be=()=>{};var Ge=()=>{};var bt="1.0.
|
|
122
|
+
`)}var ce=!1,F="\x1B[0m",xt="\x1B[2m",lm="\x1B[1m",Em="\x1B[38;2;43;82;255m",Lm="\x1B[38;2;147;51;234m",Cm="\x1B[38;2;6;184;212m",Fm="\x1B[38;2;236;72;153m";var be=()=>{};var Ge=()=>{};var bt="1.0.15";var nn=b(()=>{Ge()});async function D(t,n){let e=typeof FormData<"u"&&n.body instanceof FormData,i={"User-Agent":`mmx-cli/${bt}`,...n.headers};if(!e&&!i["Content-Type"])i["Content-Type"]="application/json";if(!n.noAuth){let $=await tn(t);if(n.authStyle==="x-api-key")i["x-api-key"]=$.token;else i.Authorization=`Bearer ${$.token}`;if(t.verbose)process.stderr.write(`> ${n.method??"GET"} ${n.url}
|
|
123
123
|
`),process.stderr.write(`> Auth: ${$.token.slice(0,8)}...
|
|
124
124
|
`);let p=n.body&&typeof n.body==="object"&&"model"in n.body?String(n.body.model):void 0;ve(t,$.token,p)}let r=(n.timeout??t.timeout)*1000,m=await fetch(n.url,{method:n.method??"GET",headers:i,body:n.body?e?n.body:JSON.stringify(n.body):void 0,signal:n.stream?void 0:AbortSignal.timeout(r)});if(t.verbose)process.stderr.write(`< ${m.status} ${m.statusText}
|
|
125
125
|
`);if(!m.ok){let $={};try{$=await m.json()}catch{}throw gn(m.status,$,n.url)}return m}async function J(t,n){let e=await D(t,n),i;try{i=await e.json()}catch{let r=e.headers.get("content-type")||"";throw new _(`API returned non-JSON response (${r||"unknown type"}). Server may be experiencing issues.`,y.GENERAL)}if(i.base_resp?.status_code&&i.base_resp.status_code!==0)throw gn(200,{base_resp:i.base_resp},n.url);return i}var I=b(()=>{k();h();Dn();ue();be();nn()});function $n(t){return`${t}/anthropic/v1/messages`}function Se(t){return`${t}/v1/t2a_v2`}function Re(t){return`${t}/v1/get_voice`}function qe(t){return`${t}/v1/image_generation`}function je(t){return`${t}/v1/video_generation`}function en(t,n){return`${t}/v1/query/video_generation?task_id=${n}`}function rn(t,n){return`${t}/v1/files/retrieve?file_id=${n}`}function mn(t){return`${t}/v1/music_generation`}function Be(t){return`${t}/v1/coding_plan/search`}function Ae(t){return`${t}/v1/coding_plan/vlm`}function Gt(t){return`${t.includes("minimaxi.com")?"https://api.minimaxi.com":"https://api.minimax.io"}/v1/token_plan/remains`}function Je(t){return`${t}/v1/files`}function Te(t){return`${t}/v1/files/list`}function he(t){return`${t}/v1/files/delete`}function Ye(t){if(t<50)return["\x1B[38;2;74;222;128m","\x1B[48;2;22;163;74m"];if(t<=80)return["\x1B[38;2;250;204;21m","\x1B[48;2;202;138;4m"];return["\x1B[38;2;248;113;113m","\x1B[48;2;220;38;38m"]}function gm(t,n){if(t<=0)return n;let e=Math.floor(t/3600000),i=Math.floor(t%3600000/60000);return e>0?`${e}h ${i}m`:`${i}m`}function ke(t){return new Date(t).toISOString().slice(0,10)}function tp(t){return t>=11904&&t<=40959||t>=63744&&t<=64255||t>=65072&&t<=65103||t>=65281&&t<=65376||t>=131072&&t<=195103}function ot(t){let n=t.replace(/\x1b\[[0-9;]*m/g,""),e=0;for(let i of n)e+=tp(i.codePointAt(0))?2:1;return e}function Xe(t,n){let e=Math.max(0,Math.min(100,t))/100,i=Math.round(xn*e),r=xn-i,m=`${t}%`.padStart(4);if(!n)return`[${"█".repeat(i)}${".".repeat(r)}] ${m}`;let[$,p]=Ye(t);return`${p}${" ".repeat(i)}\x1B[0m\x1B[48;2;55;65;81m${" ".repeat(r)}\x1B[0m ${$}\x1B[1m${m}\x1B[0m`}function pn(t,n,e,i,r){return r?`\x1B[2m${n}${e.repeat(t)}${i}\x1B[0m`:`+${"-".repeat(t)}+`}function t$(t,n,e,i){let r=Math.max(0,n-2-e);return i?`${"\x1B[2m"}│${"\x1B[0m"} ${t}${" ".repeat(r)} ${"\x1B[2m"}│${"\x1B[0m"}`:`| ${t}${" ".repeat(r)} |`}function Jt(t,n){let e=!n.noColor&&process.stdout.isTTY===!0,i=n.region==="cn"?Dm:am,r=t.length>0?Math.max(...t.map((v)=>v.model_name.length)):16,m=e?xn+5:xn+7,$=Math.max(68,r+2+15+2+m+2),p=t.length>0?`${ke(t[0].weekly_start_time)} — ${ke(t[0].weekly_end_time)}`:"",o=`MINIMAX ${i.dashboard}`,w=`${i.week}: ${p}`,u=Math.max(2,$-2-ot(o)-ot(w)),M=e?`\x1B[1m\x1B[38;2;43;82;255mMINIMAX\x1B[0m \x1B[2m${i.dashboard}\x1B[0m${" ".repeat(u)}\x1B[2m${i.week}:\x1B[0m \x1B[38;2;6;184;212m${p}\x1B[0m`:`${o}${" ".repeat(u)}${w}`,c=ot(o)+u+ot(w);if(console.log(""),console.log(pn($,"╭","─","╮",e)),console.log(t$(M,$,c,e)),t.length===0){console.log(pn($,"╰","─","╯",e)),console.log(`
|
package/dist/sdk.mjs
CHANGED
|
@@ -468,7 +468,7 @@ function maybeShowStatusBar(config, token, model) {
|
|
|
468
468
|
// package.json
|
|
469
469
|
var package_default = {
|
|
470
470
|
name: "mmx-cli",
|
|
471
|
-
version: "1.0.
|
|
471
|
+
version: "1.0.15",
|
|
472
472
|
description: "CLI for the MiniMax AI Platform",
|
|
473
473
|
type: "module",
|
|
474
474
|
engines: {
|