@minimax-ai/code 0.4.7 → 0.4.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 +29 -0
- package/CHANGELOG.zh-CN.md +20 -0
- package/README.zh-CN.md +7 -0
- package/assets/agents/_v2/explore.md.hbs +8 -0
- package/assets/agents/explore/agent.md +1 -0
- package/assets/agents/explore/system-prompt.md.hbs +9 -0
- package/assets/agents/mavis/features/delegation.md.hbs +4 -2
- package/chunks/{anthropic-LCJD7NOY.js → anthropic-MQQCIUHP.js} +1 -1
- package/chunks/{application-OZ6YEJNG.js → application-6MCV7ILB.js} +1 -1
- package/chunks/{auth-command-TP25VHV4.js → auth-command-T5DRRUNT.js} +1 -1
- package/chunks/{chunk-BNU46XHR.js → chunk-2CEKQTMO.js} +1 -1
- package/chunks/{chunk-RPO5CDCP.js → chunk-3V6OPTHM.js} +9 -9
- package/chunks/{chunk-C2OVBAOI.js → chunk-DIMUZAUA.js} +1 -1
- package/chunks/{chunk-2SW3R5AB.js → chunk-DV5WIEGS.js} +1 -1
- package/chunks/{chunk-YBZTB54I.js → chunk-E6MMSL54.js} +649 -646
- package/chunks/{chunk-SYLCIHHV.js → chunk-HMP2XYHW.js} +1 -1
- package/chunks/{chunk-OVLV6FQA.js → chunk-LOASZMQB.js} +531 -531
- package/chunks/{chunk-W7JHDTPW.js → chunk-VCJI7AJO.js} +1 -1
- package/chunks/{chunk-QJWOGW27.js → chunk-VPHVKGPT.js} +1 -1
- package/chunks/{chunk-22LVIQ2T.js → chunk-WAVNKSSE.js} +1 -1
- package/chunks/{chunk-NELAOQAA.js → chunk-X5PAB4UH.js} +2 -2
- package/chunks/chunk-Z44TXDGK.js +50 -0
- package/chunks/{chunk-KVMK6REW.js → chunk-ZCP4JGO4.js} +1 -1
- package/chunks/{chunk-AJSGEEWR.js → chunk-ZRZKBTCU.js} +1 -1
- package/chunks/{data-dir-KTXCGPJZ.js → data-dir-YVQZ5MXP.js} +1 -1
- package/chunks/{dist-MM7GHB2J.js → dist-N5YYFCWT.js} +1 -1
- package/chunks/{dist-XS6VO2LU.js → dist-Z3PYNW6P.js} +1 -1
- package/chunks/{install-source-3CE52ZIN.js → install-source-GWYHWTTG.js} +1 -1
- package/chunks/{launcher-BNIFOBXD.js → launcher-NIEXEZF5.js} +134 -134
- package/chunks/{lifecycle-EKT5LQIE.js → lifecycle-EEX754QU.js} +1 -1
- package/chunks/{main-FAPYW7S4.js → main-ANDH2IE5.js} +3 -3
- package/chunks/{plugin-command-TD3DWK7U.js → plugin-command-STBEQNGX.js} +1 -1
- package/chunks/{provider-command-AQPDCWDR.js → provider-command-MKVRALX5.js} +1 -1
- package/chunks/{run-acp-command-OPS4CBHL.js → run-acp-command-2AEYGDBH.js} +2 -2
- package/chunks/{run-exec-command-QR3TWWDO.js → run-exec-command-LVG3YSVK.js} +1 -1
- package/chunks/{update-KWS4AOND.js → update-CG3K6TMW.js} +1 -1
- package/cli.js +2 -2
- package/image-preview-worker.js +1 -1
- package/package.json +1 -1
- package/chunks/chunk-B2NJMA4I.js +0 -50
|
@@ -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{b as I}from"./chunk-
|
|
2
|
+
import{b as I}from"./chunk-LOASZMQB.js";import{J as $,S as k}from"./chunk-Z44TXDGK.js";import{e as X}from"./chunk-D76SO2ME.js";var _=X(I(),1);import{stripVTControlCharacters as F}from"node:util";function g(e){return F(e).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/gu,"")}var O=1e6,M=1e3,V=32,x=/^(?![A-Za-z]:[\\/])(?![\\/])(?!.*(?:^|[\\/])\.\.(?:[\\/]|$))[^\0]+$/u,L=/^sha256:[a-f0-9]{64}$/u,j=/^git-blob:[a-f0-9]{40,64}$/u;function ue(e){if(!E(e))return;let n=e.reviewOutcome;return n==="pass"||n==="needs_changes"||n==="failed"?n:void 0}function de(e){let n=e.trim();if(!(!n.startsWith("<annotation-result")||!n.endsWith("</annotation-result>")))try{let t=G(n);if(R(t,"annotation-result"),p(t,["version","source","review-run-id","trigger","mode","verdict"]),c(t,"version")!=="2"||c(t,"source")!=="code-review"||c(t,"verdict")!=="needs-changes"||!c(t,"review-run-id"))return;let r=c(t,"trigger"),i=c(t,"mode");if(r!=="slash"&&r!=="natural_language"||i!=="inline"&&i!=="subagent")return;f(t),T(t,["summary","annotations"]);let s=b(m(t,"summary")),o=m(t,"annotations");if(p(o,[]),f(o),o.children.some(u=>u.name!=="annotation"))return;let l=o.children.map(q);return!s||l.length===0?void 0:{schemaVersion:1,type:"review.result",scope:"local_changes",verdict:"needs_changes",summary:s,findings:l,mode:i}}catch{return}}function pe(e){let n=e.trim();if(n)return{schemaVersion:1,type:"review.result",scope:"local_changes",verdict:"pass",summary:n,findings:[]}}function ge(e){return!E(e)||e.schemaVersion!==1||e.type!=="review.result"||e.scope!=="local_changes"||e.verdict!=="pass"&&e.verdict!=="needs_changes"||typeof e.summary!="string"||!e.summary.trim()||!Array.isArray(e.findings)||!e.findings.every(U)||e.mode!==void 0&&e.mode!=="inline"&&e.mode!=="subagent"?!1:e.verdict==="pass"?e.findings.length===0:e.findings.length>0}function me(e){return e.verdict==="pass"?g(e.summary):[g(e.summary),...e.findings.flatMap(n=>["",`[${n.priority}] ${g(n.title)}`,g(W(n)),g(n.content)])].join(`
|
|
3
3
|
`)}function W(e){if(e.targetType==="file")return e.path;let n=e.startLine===e.endLine?String(e.startLine):`${String(e.startLine)}-${String(e.endLine)}`;return`${e.path}:${n}${e.side?` (${e.side})`:""}`}function q(e){if(R(e,"annotation"),p(e,["id","kind","priority"]),c(e,"kind")!=="code-review")throw new Error("annotation kind must be code-review");let n=c(e,"id"),t=c(e,"priority");if(!n||!C(t))throw new Error("annotation identity is invalid");f(e),T(e,["target","title","content"]);let r=z(m(e,"target")),i=b(m(e,"title")),s=b(m(e,"content"));if(!i||!s)throw new Error("annotation text is empty");return{id:n,priority:t,...r,title:i,content:s}}function z(e){R(e,"target");let n=c(e,"uri");if(!x.test(n)||c(e,"type")!=="file")throw new Error("annotation target is invalid");if(f(e),e.attributes.state==="deleted"){if(p(e,["type","uri","state","blob-revision"]),e.children.length>0||!j.test(c(e,"blob-revision")))throw new Error("deleted annotation target is invalid");return{targetType:"file",path:n}}p(e,["type","uri"]),T(e,["selector","related-change"]);let t=m(e,"selector");if(p(t,["type","side","start-line","end-line","anchor-revision","context-before","context-after"]),f(t),t.children.length>0||c(t,"type")!=="line-range")throw new Error("annotation selector is invalid");let r=c(t,"side"),i=y(c(t,"start-line")),s=y(c(t,"end-line")),o=t.attributes["anchor-revision"];if(r!=="old"&&r!=="new"||s<i||o!==void 0&&!L.test(o)||!A(t.attributes["context-before"])||!A(t.attributes["context-after"]))throw new Error("annotation selector is invalid");let l=H(e,"related-change");return l&&B(l),{targetType:"line-range",path:n,side:r,startLine:i,endLine:s}}function B(e){p(e,["path","side","start-line","end-line","revision"]),f(e);let n=c(e,"path"),t=c(e,"side"),r=y(c(e,"start-line")),i=y(c(e,"end-line"));if(e.children.length>0||!x.test(n)||t!=="old"&&t!=="new"||i<r||!L.test(c(e,"revision")))throw new Error("related change is invalid")}function G(e){if(e.length>O)throw new Error("Review result is too large");let n,t=!1,r=0,i="",s=[],o=new _.SaxesParser({xmlns:!1});if(o.on("opentag",l=>{r+=1,(r>M||s.length>=V)&&(t=!0);let u={name:l.name,attributes:Object.fromEntries(Object.entries(l.attributes).map(([d,w])=>[d,String(w)])),children:[],text:""},a=s.at(-1);a?a.children.push(u):n?t=!0:n=u,s.push(u)}),o.on("text",l=>{let u=s.at(-1);u?u.text+=l:i+=l}),o.on("closetag",()=>{s.pop()}),o.on("cdata",()=>{t=!0}),o.on("comment",()=>{t=!0}),o.on("doctype",()=>{t=!0}),o.on("processinginstruction",()=>{t=!0}),o.on("error",()=>{t=!0}),o.write(e).close(),t||!n||s.length>0||i.trim())throw new Error("Review result XML is invalid");return n}function b(e){if(p(e,[]),e.children.length>0)throw new Error(`${e.name} must contain text only`);return e.text.trim()}function R(e,n){if(e.name!==n)throw new Error(`Expected ${n}`)}function p(e,n){let t=[...n].sort().join("\0");if(Object.keys(e.attributes).sort().join("\0")!==t)throw new Error(`${e.name} attributes are invalid`)}function f(e){if(e.text.trim())throw new Error(`${e.name} contains unexpected text`)}function T(e,n){let t=new Set(n);if(e.children.some(r=>!t.has(r.name)))throw new Error(`${e.name} contains an unexpected element`)}function m(e,n){let t=e.children.filter(i=>i.name===n),r=t[0];if(t.length!==1||!r)throw new Error(`${e.name} must contain one ${n}`);return r}function H(e,n){let t=e.children.filter(r=>r.name===n);if(t.length>1)throw new Error(`${e.name} contains duplicate ${n}`);return t[0]}function c(e,n){let t=e.attributes[n];if(t===void 0)throw new Error(`${e.name}.${n} is required`);return t}function y(e){if(!/^[1-9]\d*$/u.test(e))throw new Error("Expected a positive integer");let n=Number(e);if(!Number.isSafeInteger(n))throw new Error("Integer is out of range");return n}function A(e){return e===void 0||/^[0-3]$/u.test(e)}function C(e){return e==="P0"||e==="P1"||e==="P2"||e==="P3"}function U(e){return!E(e)||typeof e.id!="string"||!e.id||typeof e.priority!="string"||!C(e.priority)||typeof e.path!="string"||!x.test(e.path)||typeof e.title!="string"||!e.title.trim()||typeof e.content!="string"||!e.content.trim()?!1:e.targetType==="file"?e.side===void 0&&e.startLine===void 0&&e.endLine===void 0:e.targetType==="line-range"&&(e.side==="old"||e.side==="new")&&typeof e.startLine=="number"&&Number.isSafeInteger(e.startLine)&&e.startLine>0&&typeof e.endLine=="number"&&Number.isSafeInteger(e.endLine)&&e.endLine>=e.startLine}function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var N=/<(?:deliver[-_]assets|media|publish[_-]artifact|preview_card|genui-|mavis-widget|mavis-thinking|mavis-progress|think|final|permission-(?:ask|response)|questionnaire-(?:ask|response))\b|^\s*preview_cards?:\s*$/imu;function we(e){let n=Z(e);return n.assets.length===0?n.text:[n.text,se(n.assets)].filter(Boolean).join(`
|
|
4
4
|
|
|
5
5
|
`)}function Z(e){if(!e||!N.test(e))return{text:e,assets:[]};let n=$(e),t=[],r=[],i="\uE000mcode-protected";for(;e.includes(i);)i+="-";let s=!1,o=n.map(a=>{if(a.type==="protected"){let d=t.push(a.content)-1;return`${i}-${d}\uE001`}return N.test(a.content)?(s=!0,J(a.content,r)):a.content}).join("");if(!s)return{text:e,assets:[]};let l=oe(o);t.forEach((a,d)=>{l=l.replace(`${i}-${d}\uE001`,a)});let u=[...new Map(r.map(a=>[a.path.trim(),a])).values()];return{text:l,assets:u.map(a=>({path:a.path.trim(),...a.name?.trim()?{name:a.name.trim()}:{}}))}}function J(e,n){let t=e;return t=h(t,"mavis-thinking"),t=h(t,"think"),t=K(t,"mavis-progress"),t=h(t,"permission-ask"),t=h(t,"permission-response"),t=h(t,"questionnaire-ask"),t=h(t,"questionnaire-response"),t=t.replace(/<\/?final\b[^>]*>/giu,""),t=Q(t),t=Y(t),t=ee(t),t=ne(t),t=re(t,n),t=t.replace(/<\/?(?:deliver-assets|deliver_assets)\b[^>]*>/giu,"file attachment").replace(/<media\b[^>]*\/?>/giu,"file attachment").replace(/<media\b[^>]*$/iu,""),t}function h(e,n){let t=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu"),r=e,i=e.replace(t,"");for(;i!==r;)r=i,i=i.replace(t,"");return i}function K(e,n){let t=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu"),r=e,i=e.replace(t,(s,o)=>o.trim());for(;i!==r;)r=i,i=i.replace(t,(s,o)=>o.trim());return i}function Q(e){let n=/<mavis-widget\b([^>]*)>([\s\S]*?)<\/mavis-widget\s*>/giu,t=e.replace(n,(r,i,s)=>{let o=/<mavis-fallback\b[^>]*>([\s\S]*?)<\/mavis-fallback\s*>/iu.exec(s)?.[1];return o?.trim()?o.trim():S(v(i))});return t=t.replace(/<mavis-widget\b([^>]*)>[\s\S]*$/iu,(r,i)=>S(v(i))),t.replace(/<mavis-widget\b[^>]*$/iu,"Interactive content is loading\u2026")}function S(e){let n=e.kind?.trim(),t=e.title?.trim();return n&&t?`Interactive ${n}: ${t} (open in Desktop).`:t?`Interactive content: ${t} (open in Desktop).`:"Interactive content available in Desktop."}function Y(e){let n=/<genui-([\w-]+)\b([^>]*)>[\s\S]*?<\/genui-\1\s*>/giu,t=/<genui-([\w-]+)\b([^>]*?)\/\s*>/giu,r=e.replace(n,(i,s,o)=>D(s,v(o)));return r=r.replace(t,(i,s,o)=>D(s,v(o))),r.replace(/<genui-[\w-]*\b[^>]*$/iu,"Interactive content is loading\u2026")}function D(e,n){if(e.toLocaleLowerCase()==="mcp-auth"){let t=n.label?.trim()||n["server-id"]?.trim();return t?`MCP authorization required: ${t} (open in Desktop).`:"MCP authorization required (open in Desktop)."}if(e.toLocaleLowerCase()==="agent-team-recommendation"){let t=n.status?.trim().toLocaleLowerCase();return t==="accepted"?"Team recommendation accepted.":t==="skipped"?"Team recommendation skipped.":"Team recommendation available in Desktop."}return"Interactive content available in Desktop."}function v(e){let n={},t=/([\w-]+)\s*=\s*(["'])(.*?)\2/gu,r;for(;(r=t.exec(e))!==null;){let i=r[1],s=r[3];i&&s!==void 0&&(n[i]=te(s))}return n}function ee(e){let n=/<(deliver-assets|deliver_assets)\b[^>]*>\s*<\/\1\s*>/giu,t=e,r=e.replace(n,"");for(;r!==t;)t=r,r=r.replace(n,"");return r}function te(e){return e.replace(/"/gu,'"').replace(/'|'/gu,"'").replace(/</gu,"<").replace(/>/gu,">").replace(/&/gu,"&")}function ne(e){let n=/<\/?(deliver-assets|deliver_assets)\b[^>]*>/giu,t=[],r;for(;(r=n.exec(e))!==null;)t.push({start:r.index,end:n.lastIndex,name:r[1]?.toLocaleLowerCase()??"",closing:r[0].startsWith("</")});if(t.length===0)return e;let i=[],s=new Set;if(t.forEach((u,a)=>{if(!u.closing){i.push(a);return}for(let d=i.length-1;d>=0;d-=1){let w=i[d];if(!(w===void 0||t[w]?.name!==u.name)){i.splice(d,1),s.add(w),s.add(a);return}}}),s.size===t.length)return e;let o=0,l="";return t.forEach((u,a)=>{l+=e.slice(o,u.start),l+=s.has(a)?e.slice(u.start,u.end):"file attachment",o=u.end}),l+e.slice(o)}function re(e,n){let t=e;for(let r=0;r<3;r+=1){let i=k(t),s=ie(i);if(s.assets.length===0)break;n.push(...s.assets),t=s.text}return t}function ie(e){let n=[],t=[];for(let r of e)r.type==="deliver-assets"||r.type==="image-gallery"?t.push(...r.items):r.content.trim()&&n.push(r.content.trim());return{text:n.join(`
|
|
@@ -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 Ei}from"./chunk-2ZG44JU6.js";import{l as un}from"./chunk-
|
|
2
|
+
import{a as Ei}from"./chunk-2ZG44JU6.js";import{l as un}from"./chunk-Z44TXDGK.js";import{e as vi}from"./chunk-D76SO2ME.js";function Si(e){return!1}function bc(e){return e.replace(/^#{2,4} MCP\/App citation examples\r?\n\r?\n```\r?\n[\s\S]*?^```\r?\n\s*/gm,n=>n.includes("#mavis-source=")?"":n).replace(/^#{2,4} Citations\r?\n(?:[ \t]*\r?\n)*Cite every used result where it supports the answer\.[\s\S]*?^Do not cite unused calls or unsupported claims, invent metadata, output bare parenthesized links, or add trailing source\/reference lists\.\r?\n*/gm,n=>n.includes("Citation candidate")?"":n)}function Ac(e){let i=["- Independent tool calls can run in parallel in one response.","- Issue independent tool calls together when safe. Run dependent calls or conflicting writes sequentially, and follow each tool's concurrency restrictions."].find(c=>e.includes(c));if(!i)return e;let r="- Reference code as `file_path:line_number` \u2014 it's clickable.",t="- Reference code as `file_path:line_number` so it is clickable. Place references near the relevant claim; group them only when there are many files.",o=["- Cite sources where they support the answer, using exact source URLs or supplied links.","- Place references near the relevant claim; group them only when there are many files.","- Cite only sources you used; do not invent sources or links."].join(`
|
|
3
3
|
`),l=["- When referencing code, use `file_path:line_number` format.","- When citing one or two files, place one or two `file_path:line_number` references in the relevant conclusion sentence. Use a separate evidence list only when there are many references.",r,"- Reference code as `file_path:line_number` \u2014 it's clickable in the TUI."].reduce((c,f)=>c.replaceAll(`${f}\r
|
|
4
4
|
`,"").replaceAll(`${f}
|
|
5
5
|
`,""),e.replace(t,"- Place references near the relevant claim; group them only when there are many files.")).replace(i,`${i}
|