@minimax-ai/code 0.2.5 → 0.2.7

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +185 -159
  2. package/CHANGELOG.zh-CN.md +264 -0
  3. package/README.md +6 -3
  4. package/README.zh-CN.md +4 -2
  5. package/assets/agents/_tui/prompt-base-all.md.hbs +12 -0
  6. package/assets/agents/_tui/prompt-base-windows.md.hbs +45 -0
  7. package/assets/agents/_tui/prompt-base-worker.md.hbs +4 -0
  8. package/assets/agents/_tui/prompt-session-branch.md.hbs +13 -0
  9. package/assets/agents/_tui/prompt-session-root.md.hbs +4 -0
  10. package/assets/agents/mavis/tui/PERSONA-zh.md.hbs +17 -0
  11. package/assets/agents/mavis/tui/PERSONA.md.hbs +22 -0
  12. package/assets/agents/mavis/tui/SYSTEM.md.hbs +110 -0
  13. package/assets/agents/mavis/tui/features/delegation.md.hbs +52 -0
  14. package/assets/agents/mavis/tui/features/task-management.md.hbs +11 -0
  15. package/assets/agents/mavis/tui/features/web-search.md.hbs +7 -0
  16. package/chunks/{application-F5GCGMBT.js → application-VM7NETBS.js} +1 -1
  17. package/chunks/chunk-B7AEIYE2.js +155 -0
  18. package/chunks/{chunk-ZQ5NFQRA.js → chunk-BPRXRI4W.js} +467 -467
  19. package/chunks/chunk-C3JRMX7L.js +2 -0
  20. package/chunks/{chunk-VVZRUBTN.js → chunk-CSEMCTUO.js} +490 -490
  21. package/chunks/{chunk-3X7O237P.js → chunk-J6D4YR7Q.js} +1 -1
  22. package/chunks/chunk-OGKBQLFH.js +33 -0
  23. package/chunks/launcher-U4C3IZNL.js +231 -0
  24. package/chunks/{lifecycle-W7H7AQB2.js → lifecycle-KCPZFQXU.js} +1 -1
  25. package/chunks/{main-KR4ULBZO.js → main-X4HBPBMC.js} +1 -1
  26. package/chunks/{plugin-command-KVTQXIBN.js → plugin-command-A5E7VOZF.js} +1 -1
  27. package/chunks/provider-command-MKFDOYFC.js +3 -0
  28. package/chunks/{run-acp-command-RJAB4GDT.js → run-acp-command-X52GQQTB.js} +1 -1
  29. package/chunks/{run-exec-command-KYGOLZKQ.js → run-exec-command-YNDAZGJH.js} +1 -1
  30. package/chunks/update-WS5F7FXU.js +15 -0
  31. package/cli.js +1 -1
  32. package/package.json +2 -1
  33. package/chunks/chunk-COTC5RMO.js +0 -156
  34. package/chunks/chunk-GWC5532O.js +0 -2
  35. package/chunks/launcher-RQDNLK5Q.js +0 -230
  36. package/chunks/provider-command-NMPS5C3N.js +0 -3
  37. package/chunks/update-NYOPKJYL.js +0 -14
@@ -1,3 +0,0 @@
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 d}from"./chunk-IUKKQKCM.js";import"./chunk-I3GV76MP.js";import{a as c,b as m}from"./chunk-VVZRUBTN.js";import"./chunk-ZQ5NFQRA.js";import{b as t}from"./chunk-A2CQYOXE.js";import"./chunk-QJA2AFYN.js";import"./chunk-6IC2NFSY.js";import"./chunk-PPIEC7ZM.js";import"./chunk-R6GVNV7J.js";import"./chunk-DMRTIGHH.js";import"./chunk-75PL5LYJ.js";import"./chunk-VYI2WX6B.js";import"./chunk-4VFN3CQO.js";import"./chunk-HQ2U4QVQ.js";import{d as s}from"./chunk-Y532HLC2.js";import"./chunk-FNV3CQPA.js";import"./chunk-5RRKMW2I.js";import"./chunk-V265NCK2.js";import"./chunk-I7TKU4UZ.js";import"./chunk-CWWDVX6C.js";import"./chunk-LOQ4VVEN.js";import"./chunk-DJJIPU64.js";import"./chunk-PWQHCWDV.js";import"./chunk-SHXPTUWI.js";import"./chunk-IIHJNKC3.js";import"./chunk-II4JKPH5.js";import"./chunk-4FZAQBEE.js";import"./chunk-5OKQK3WJ.js";import"./chunk-CK62QLTS.js";import"./chunk-WFWSBUYD.js";import"./chunk-D76SO2ME.js";async function P(r){let a=r.createContext?await r.createContext():await l(r.version,r.workspaceDir);try{let{request:e}=r;if(e.action==="list")return p(await a.application.snapshot(),!!e.json);if(e.action==="add"){let n=e.apiKeyEnv?.trim()||"MCODE_PROVIDER_API_KEY",i=(r.environment??process.env)[n]?.trim();if(!i)throw new Error(`Provider API key is missing. Set ${n} or pass --api-key-env <name>.`);return await a.application.create({name:e.name,baseUrl:e.baseUrl,apiKey:i,apiFormat:e.apiFormat,models:e.models.map(o=>({modelId:o})),saveAndUse:e.saveAndUse}),`Provider added: ${e.name}`}if(e.action==="remove"){if(!e.confirmed)throw new Error("Refusing to remove a provider without --yes.");return await a.application.remove(e.providerId),`Provider removed: ${e.providerId}`}if(e.action==="test"){if(e.providerId==="minimax_oauth"){let i="MiniMax OAuth sign-in and connectivity are managed by /login.";return e.json?JSON.stringify({success:!1,status:{state:"unsupported",lastErrorMessage:i}},null,2):t(i,{summary:"MiniMax OAuth provider test skipped.",nextStep:"Run /login to manage Token Plan sign-in."})}let n=await a.application.test(e.providerId,e.modelId);return e.json?JSON.stringify(n,null,2):n.success?`Provider available: ${e.providerId}${e.modelId?`/${e.modelId}`:""}`:t(n.status.lastErrorMessage??n.status.state,{summary:"Provider test failed.",nextStep:"Check the URL, API key, and model ID, then retry."})}if(e.action==="set-minimax-key"){let n=e.apiKeyEnv?.trim()||"MCODE_PROVIDER_API_KEY",i=(r.environment??process.env)[n]?.trim();if(!i)throw new Error(`MiniMax API key is missing. Set ${n} or pass --api-key-env <name>.`);return await a.application.setMiniMaxApiKey(i),"MiniMax API Key saved and selected."}return await a.application.setMiniMaxSource(e.source),e.source==="token_plan"?"Using MiniMax Token Plan.":"Using MiniMax API Key."}finally{await a.shutdown()}}async function l(r,a=process.cwd()){let e=await c({dataDir:await s(),workspaceDir:a,version:r,surface:"headless"});return{application:new d(e.adapter),shutdown:async()=>{await m(e)}}}function p(r,a){return a?JSON.stringify(r,null,2):r.providers.map(n=>{let i=n.active?"active":n.enabled?"enabled":"disabled",o=n.kind==="minimax-oauth"?"managed login":n.hasApiKey?n.maskedApiKey??"key saved":"no key";return`${n.active?"*":" "} ${n.providerId} ${i} ${o}`}).join(`
3
- `)}export{P as runMcodeProviderCommand};
@@ -1,14 +0,0 @@
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,b as m,c as f}from"./chunk-GWC5532O.js";import{w as u}from"./chunk-COTC5RMO.js";import"./chunk-O6RIRKRN.js";import"./chunk-HQ2U4QVQ.js";import"./chunk-I7TKU4UZ.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";import{createInterface as v}from"node:readline/promises";import{stripVTControlCharacters as w}from"node:util";var $=80,c=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],h=72;async function O(e,n={}){let r=n.application??new f({currentVersion:e}),o=n.interactive??!!(process.stdin.isTTY&&process.stdout.isTTY),a=n.write??(i=>process.stdout.write(i)),l=n.schedulePendingPrefixUpdate??(()=>u());if(await l()){a(`${p()}
3
- `);return}let t=await r.inspect();if(t.kind==="current"){a(t.source==="managed-installer"?`MCode ${t.currentVersion} is current on ${t.channel}.
4
- `:`MCode ${t.currentVersion} is current on @${t.packageTag}.
5
- `);return}if(t.kind==="ahead"){a(`MCode ${t.currentVersion} is newer than ${t.source==="managed-installer"?t.channel:`@${t.packageTag}`} ${t.latestVersion}; no update was applied.
6
- `);return}if(t.kind==="manual"){a(`MCode could not identify the owner of this installation. Update manually with:
7
- ${t.command}
8
- `);return}if(a(y(t)),!o){a(`${P(t)}
9
- `);return}if(!await(n.confirm??U)("Install the update now? [y/N] ")){a(`Update cancelled.
10
- `);return}let s=new d(a);s.start();try{let i=await r.apply(t,{onOutput:g=>s.acceptOutput(g)});if(s.stop(),a(`${i.message}
11
- `),i.restartRequired&&!await l())throw new Error(m())}catch(i){throw s.stop(),i}}var d=class{constructor(n){this.write=n}frameIndex=0;latestOutput="";startedAtMs=0;timer;start(){this.timer||(this.startedAtMs=Date.now(),this.render(),this.timer=setInterval(()=>{this.frameIndex=(this.frameIndex+1)%c.length,this.render()},$),this.timer.unref?.())}acceptOutput(n){let r=w(n).split(/[\r\n]+/u).map(o=>o.trim()).filter(Boolean).at(-1);r&&(this.latestOutput=M(r),this.render())}stop(){this.timer&&clearInterval(this.timer),this.timer=void 0,this.write("\r\x1B[2K")}render(){let n=c[this.frameIndex]??c[0],r=Math.max(0,Math.floor((Date.now()-this.startedAtMs)/1e3)),o=r>0?` \xB7 ${r}s`:"",a=this.latestOutput?` \xB7 ${this.latestOutput}`:"";this.write(`\r\x1B[2K${n} Updating MCode${o}${a}`)}};function M(e){return e.length<=h?e:`${e.slice(0,h-1)}\u2026`}function y(e){return e.kind==="available"?`MCode ${e.latestVersion} is available on ${e.channel} (current ${e.currentVersion}).
12
- `:`MCode ${e.latestVersion} is available on @${e.packageTag} (current ${e.currentVersion}, installed through ${e.source.replace("-global","")}).
13
- Command: ${e.command.display}
14
- `}function P(e){return e.kind==="package-manager"?`No interactive confirmation is available. Run: ${e.command.display}`:"No interactive confirmation is available. Run `mcode update` from a terminal to install it."}async function U(e){let n=v({input:process.stdin,output:process.stdout,terminal:!0});try{let r=(await n.question(e)).trim().toLocaleLowerCase();return r==="y"||r==="yes"}finally{n.close()}}export{O as runMcodeUpdate};