@minimax-ai/code 0.6.3 → 0.6.5
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 +58 -2
- package/CHANGELOG.zh-CN.md +30 -1
- package/README.md +59 -0
- package/README.zh-CN.md +41 -0
- package/assets/agents/mavis/skills/minimax-code-product/SKILL.md +7 -6
- package/assets/agents/mavis/skills/minimax-code-product/references/account-models.md +13 -4
- package/assets/agents/mavis/skills/minimax-code-product/references/agents.md +1 -1
- package/assets/agents/mavis/skills/minimax-code-product/references/extensions.md +1 -1
- package/assets/agents/mavis/skills/minimax-code-product/references/workflows.md +1 -1
- package/chunks/{anthropic-HVUDB2UQ.js → anthropic-3PPUMUI5.js} +1 -1
- package/chunks/{application-JOJGAMXA.js → application-ZJ5NM3DF.js} +1 -1
- package/chunks/{auth-command-CO6IUQQ5.js → auth-command-OLQL7FZY.js} +1 -1
- package/chunks/{azure-openai-responses-2XUN7HBR.js → azure-openai-responses-TINWNAR2.js} +1 -1
- package/chunks/{chunk-EL5XOH23.js → chunk-2XPMNZVR.js} +541 -536
- package/chunks/{chunk-VN3EYAMT.js → chunk-37SOT72H.js} +1 -1
- package/chunks/{chunk-Z4VKGZFA.js → chunk-3FETZOUF.js} +30 -30
- package/chunks/{chunk-WJZDMLYV.js → chunk-3MHUE4DM.js} +1 -1
- package/chunks/{chunk-UJCQHSQD.js → chunk-76MC32T2.js} +1 -1
- package/chunks/{chunk-U7ACBEGU.js → chunk-JIWEZSQY.js} +676 -675
- package/chunks/{chunk-7CKVJIAL.js → chunk-JL7ZXU6T.js} +1 -1
- package/chunks/{chunk-YC47AWPX.js → chunk-LM3FMMAB.js} +1 -1
- package/chunks/{chunk-GPPNWE6W.js → chunk-LQIEYG3O.js} +8 -3
- package/chunks/{chunk-T6KXDH7B.js → chunk-NFVRVRCL.js} +1 -1
- package/chunks/{chunk-YPNDEPC5.js → chunk-NXXFMBAV.js} +1 -1
- package/chunks/{chunk-HVP63X6W.js → chunk-ONRKFD6S.js} +1 -1
- package/chunks/{chunk-T4F6MBL2.js → chunk-OSA3A5UV.js} +1 -1
- package/chunks/chunk-RDUENEEQ.js +2 -0
- package/chunks/{chunk-XYED4XTT.js → chunk-TWO6GIVD.js} +99 -99
- package/chunks/{chunk-5GISCO53.js → chunk-U5SHMJ7Y.js} +1 -1
- package/chunks/{chunk-G64EFDMH.js → chunk-UOE7W4PK.js} +1 -1
- package/chunks/{data-dir-4GSZVAMG.js → data-dir-KFZIXVT7.js} +1 -1
- package/chunks/{dist-DQKO47DC.js → dist-PBZ5PIWM.js} +1 -1
- package/chunks/{google-R5XVVF36.js → google-W4KKPJIU.js} +1 -1
- package/chunks/{google-vertex-IQCRUNEW.js → google-vertex-K2VBU5YX.js} +1 -1
- package/chunks/{install-source-KWOIXLTZ.js → install-source-REWTEDE3.js} +1 -1
- package/chunks/{launcher-ST7GNBTY.js → launcher-BK5UP7KA.js} +159 -156
- package/chunks/{lifecycle-MEDWAANQ.js → lifecycle-RMTLVDXY.js} +1 -1
- package/chunks/main-ANJ6TEDF.js +9 -0
- package/chunks/{mistral-YGQW5B3K.js → mistral-5IVMGNIC.js} +1 -1
- package/chunks/{openai-codex-responses-2JCAFRE3.js → openai-codex-responses-HMN5LXLI.js} +1 -1
- package/chunks/{openai-completions-HCLBIIWV.js → openai-completions-A22BIUQL.js} +1 -1
- package/chunks/openai-responses-7MFUVUZA.js +2 -0
- package/chunks/{plugin-command-EZNOWONW.js → plugin-command-AXB4A2DP.js} +1 -1
- package/chunks/{provider-command-OJLRQ76A.js → provider-command-2MVBCAF6.js} +1 -1
- package/chunks/{run-acp-command-Z5CVNHZZ.js → run-acp-command-4JFNMYRS.js} +2 -2
- package/chunks/{run-exec-command-MT4Y6VPF.js → run-exec-command-SAUHM46S.js} +8 -8
- package/chunks/{update-XSUZQSPB.js → update-HOQ5YQFF.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
- package/chunks/chunk-22LFXEGJ.js +0 -2
- package/chunks/main-7X6VQMDB.js +0 -9
- package/chunks/openai-responses-65UFQVVM.js +0 -2
|
@@ -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,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-OSA3A5UV.js";import"./chunk-JL7ZXU6T.js";import"./chunk-TWO6GIVD.js";import"./chunk-3FETZOUF.js";import"./chunk-CWWDVX6C.js";import"./chunk-ZITT4GJK.js";import"./chunk-D76SO2ME.js";export{b as getTuiDataDirPath,d as prepareTuiDataDir,a as resolveDefaultTuiDataDir,c as resolveTuiDataDir};
|
|
@@ -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{$ as W,$a as cb,A as v,Aa as ua,B as w,Ba as va,C as x,Ca as wa,D as y,Da as xa,E as z,Ea as ya,F as A,Fa as za,G as B,Ga as Aa,H as C,Ha as Ba,I as D,Ia as Ca,J as E,Ja as Da,K as F,Ka as Ea,L as G,La as Fa,M as H,Ma as Ga,N as I,Na as Ha,O as J,Oa as Ia,P as K,Pa as Ja,Q as L,Qa as Ka,R as M,Ra as La,S as N,Sa as Ma,T as O,Ta as Na,U as P,Ua as Oa,V as Q,Va as Pa,W as R,Wa as Qa,X as S,Xa as Ra,Y as T,Ya as $a,Z as U,Za as ab,_ as V,_a as bb,ab as db,ba as X,bb as eb,ca as Y,cb as fb,d as a,da as Z,db as gb,ea as _,eb as hb,f as b,fa as $,fb as ib,g as c,ga as aa,gb as jb,h as d,ha as ba,hb as kb,ia as ca,ib as lb,j as e,ja as da,jb as mb,k as f,ka as ea,kb as nb,l as g,la as fa,m as h,ma as ga,n as i,na as ha,o as j,oa as ia,p as k,pa as ja,q as l,qa as ka,r as m,ra as la,s as n,sa as ma,t as o,ta as na,u as p,ua as oa,v as q,va as pa,w as r,wa as qa,x as s,xa as ra,y as t,ya as sa,z as u,za as ta}from"./chunk-
|
|
2
|
+
import{$ as W,$a as cb,A as v,Aa as ua,B as w,Ba as va,C as x,Ca as wa,D as y,Da as xa,E as z,Ea as ya,F as A,Fa as za,G as B,Ga as Aa,H as C,Ha as Ba,I as D,Ia as Ca,J as E,Ja as Da,K as F,Ka as Ea,L as G,La as Fa,M as H,Ma as Ga,N as I,Na as Ha,O as J,Oa as Ia,P as K,Pa as Ja,Q as L,Qa as Ka,R as M,Ra as La,S as N,Sa as Ma,T as O,Ta as Na,U as P,Ua as Oa,V as Q,Va as Pa,W as R,Wa as Qa,X as S,Xa as Ra,Y as T,Ya as $a,Z as U,Za as ab,_ as V,_a as bb,ab as db,ba as X,bb as eb,ca as Y,cb as fb,d as a,da as Z,db as gb,ea as _,eb as hb,f as b,fa as $,fb as ib,g as c,ga as aa,gb as jb,h as d,ha as ba,hb as kb,ia as ca,ib as lb,j as e,ja as da,jb as mb,k as f,ka as ea,kb as nb,l as g,la as fa,m as h,ma as ga,n as i,na as ha,o as j,oa as ia,p as k,pa as ja,q as l,qa as ka,r as m,ra as la,s as n,sa as ma,t as o,ta as na,u as p,ua as oa,v as q,va as pa,w as r,wa as qa,x as s,xa as ra,y as t,ya as sa,z as u,za as ta}from"./chunk-TWO6GIVD.js";import"./chunk-3FETZOUF.js";import"./chunk-CWWDVX6C.js";import{a as Sa,b as Ta,c as Ua,d as Va,e as Wa,f as Xa,g as Ya,h as Za,i as _a}from"./chunk-ZITT4GJK.js";import"./chunk-D76SO2ME.js";export{z as AGENT_BUILTIN_MCP_TOOL_IDS,A as AGENT_BUILTIN_SKILL_IDS,y as AGENT_BUILTIN_TOOL_IDS,B as AGENT_CAPABILITY_OWNED_SKILL_IDS,n as AGENT_RUNTIME_FRAMEWORKS,Wa as ASR_PROXY_AUTH_ENV_KEYS,ia as BRAND,V as BROWSER_CONFIG_DEFAULTS,Fa as CUSTOM_PROVIDER_ID_PREFIX,lb as ConfigFileError,I as DATA_CONTRIBUTION_CONFIG_DEFAULTS,o as DEFAULT_AGENT_RUNTIME_FRAMEWORK,sa as DEFAULT_MODEL_PRESETS,ka as DEFAULT_PORT,k as DEFAULT_SKILLS_CONFIG,m as EXTERNAL_SOURCE_KIND_LIST,Q as GOAL_CONFIG_DEFAULTS,R as GOAL_CONFIG_LIMITS,N as GOAL_EVALUATOR_MODEL_POLICIES,P as GOAL_SUBAGENT_PROFILES,M as GOAL_VERIFICATION_EVIDENCE_MODES,L as GOAL_VERIFICATION_MODES,O as GOAL_VERIFIER_READONLY_PROFILE,s as LEGACY_DATA_DIR_BASENAME,Ta as LEGACY_RUNTIME_ENV_KEYS,cb as LOCAL_RUNTIME_AUTH_CONTEXT_FILE,Da as MANAGED_MINIMAX_PROVIDER_ID,Sa as MANAGED_RUNTIME_KEYS,h as MEMORY_V2_DEFAULTS,Ea as MINIMAX_API_PROVIDER_ID,r as NEW_DATA_DIR_BASENAME,la as OPENCODE_PORT_OFFSET,Va as PARENT_HINT_KEYS,ja as RUNTIME_ENV_PREFIX,Ua as RUNTIME_IDENTITY_KEYS,Y as SANDBOX_CONFIG_DEFAULTS,_ as SUBAGENT_CONFIG_DEFAULTS,jb as TEST_PORT_ROLE_FLOOR,ib as TEST_PORT_ROLE_OFFSET,T as TOOL_RESULT_COMPACTION_DEFAULTS,ra as allowsManagedMinimaxProviderOverride,Xa as buildChildEnv,hb as clearLocalRuntimeAuthContextFile,Ra as compareAndSetLocalModelContext,Ka as credentialEnvReferenceName,na as detectGitPortInfo,bb as detectPidOwner,_a as findLegacyRuntimeEnvKeys,ab as formatPidFile,wa as getConfig,qa as getConfigPath,pa as getDataDir,u as getLegacyDataDirPath,za as getOpenCodePort,t as getPrimaryDataDirPath,oa as getProfile,ca as getRuntimeBuildEnv,ea as getRuntimePresetKey,ba as getRuntimeRegion,X as getSandboxConfigDefaults,G as isAgentBuiltinMcpToolEnabled,H as isAgentBuiltinSkillEnabled,F as isAgentBuiltinToolEnabled,ga as isBetaFeatureProdReady,Ga as isFirstPartyMinimaxMessagesRoute,ha as isInternalBuild,Aa as isLegacyManagedMinimaxProvider,i as isLegacyMemoryRecallEnabled,a as isLocalSourceProvenanceEnabled,Ba as isManagedProviderBaseUrl,da as isManagedRuntime,g as isMemoryV2Enabled,aa as isProposalEligibleAgent,Ia as listRouteModelIds,mb as loadConfigFromFile,w as migrateDefaultDataDir,x as migrateProfileDataDir,j as minimaxApiModels,db as normalizeLocalRuntimeAuthContext,D as parseAgentCapabilityConfig,q as parseAgentRuntimeConfig,p as parseAgentRuntimeFramework,C as parseAgentsConfig,W as parseBrowserConfig,e as parseConfigText,J as parseDataContributionConfig,S as parseGoalConfig,$a as parsePidFile,c as parseRunawayGuardOverride,Z as parseSandboxConfig,l as parseSkillsConfig,$ as parseSubagentConfig,U as parseToolResultCompactionConfig,kb as pickTestPort,Ma as probeProviderCredential,K as readDataContributionEnabled,nb as readExplicitBetaFeatureFromFile,fb as readLocalRuntimeAuthContext,Na as removeLocalProviderConfig,Oa as replaceLocalManagedMinimaxProvider,va as resetConfig,ma as resetGitDetect,E as resolveAgentCapabilities,fa as resolveBetaFeature,v as resolveDataDir,eb as resolveLocalRuntimeAuthContextPath,Ja as resolveModelAvailability,Ha as resolveModelCallRoute,ya as resolvePort,xa as resolvePromptConfig,Ca as resolveProviderAuthMode,La as resolveProviderCredential,d as resolveRunawayGuardConfig,f as serializeConfigPreservingComments,ta as setLegacyByokProviderMigrationEnabled,ua as setManagedPresetBaseUrlSyncEnabled,Ya as stripManagedRuntimeEnv,Za as stripRuntimeBoundaryKeysFrom,Pa as updateLocalByokConfig,Qa as updateLocalModelSelection,gb as writeLocalRuntimeAuthContext,b as writeTuiStatusLineSetting};
|
|
@@ -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 R,d as L,e as f,f as _,g as G,h as O,i as P}from"./chunk-
|
|
2
|
+
import{c as R,d as L,e as f,f as _,g as G,h as O,i as P}from"./chunk-NXXFMBAV.js";import"./chunk-X4N2MWNJ.js";import{d as w,e as M,f as T,h as v,j as S}from"./chunk-UOE7W4PK.js";import{a as b}from"./chunk-WFWSBUYD.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";var A=0,k=(e,o,n)=>{let i=new T;return(async()=>{let t={role:"assistant",content:[],api:"google-generative-ai",provider:e.provider,model:e.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 r=n?.apiKey;if(!r)throw new Error(`No API key for provider: ${e.provider}`);let c=W(e,r,n?.headers),u=B(e,o,n),C=await n?.onPayload?.(u,e);C!==void 0&&(u=C);let N=await c.models.generateContentStream(u);i.push({type:"start",partial:t});let a=null,I=t.content,l=()=>I.length-1;for await(let g of N){t.responseId||=g.responseId;let d=g.candidates?.[0];if(d?.content?.parts)for(let s of d.content.parts){if(s.text!==void 0){let h=L(s);(!a||h&&a.type!=="thinking"||!h&&a.type!=="text")&&(a&&(a.type==="text"?i.push({type:"text_end",contentIndex:I.length-1,content:a.text,partial:t}):i.push({type:"thinking_end",contentIndex:l(),content:a.thinking,partial:t})),h?(a={type:"thinking",thinking:"",thinkingSignature:void 0},t.content.push(a),i.push({type:"thinking_start",contentIndex:l(),partial:t})):(a={type:"text",text:""},t.content.push(a),i.push({type:"text_start",contentIndex:l(),partial:t}))),a.type==="thinking"?(a.thinking+=s.text,a.thinkingSignature=f(a.thinkingSignature,s.thoughtSignature),i.push({type:"thinking_delta",contentIndex:l(),delta:s.text,partial:t})):(a.text+=s.text,a.textSignature=f(a.textSignature,s.thoughtSignature),i.push({type:"text_delta",contentIndex:l(),delta:s.text,partial:t}))}if(s.functionCall){a&&(a.type==="text"?i.push({type:"text_end",contentIndex:l(),content:a.text,partial:t}):i.push({type:"thinking_end",contentIndex:l(),content:a.thinking,partial:t}),a=null);let h=s.functionCall.id,p={type:"toolCall",id:!h||t.content.some(x=>x.type==="toolCall"&&x.id===h)?`${s.functionCall.name}_${Date.now()}_${++A}`:h,name:s.functionCall.name||"",arguments:s.functionCall.args??{},...s.thoughtSignature&&{thoughtSignature:s.thoughtSignature}};t.content.push(p),i.push({type:"toolcall_start",contentIndex:l(),partial:t}),i.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(p.arguments),partial:t}),i.push({type:"toolcall_end",contentIndex:l(),toolCall:p,partial:t})}}d?.finishReason&&(t.stopReason=P(d.finishReason),t.content.some(s=>s.type==="toolCall")&&(t.stopReason="toolUse")),g.usageMetadata&&(t.usage={input:(g.usageMetadata.promptTokenCount||0)-(g.usageMetadata.cachedContentTokenCount||0),output:(g.usageMetadata.candidatesTokenCount||0)+(g.usageMetadata.thoughtsTokenCount||0),cacheRead:g.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:g.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},w(e,t.usage))}if(a&&(a.type==="text"?i.push({type:"text_end",contentIndex:l(),content:a.text,partial:t}):i.push({type:"thinking_end",contentIndex:l(),content:a.thinking,partial:t})),n?.signal?.aborted)throw new Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw new Error("An unknown error occurred");i.push({type:"done",reason:t.stopReason,message:t}),i.end()}catch(r){v(n?.onProviderError,r,e);for(let c of t.content)"index"in c&&delete c.index;t.stopReason=n?.signal?.aborted?"aborted":"error",t.errorMessage=r instanceof Error?r.message:JSON.stringify(r),i.push({type:"error",reason:t.stopReason,error:t}),i.end()}})(),i},X=(e,o,n)=>{let i=n?.apiKey;if(!i)throw new Error(`No API key for provider: ${e.provider}`);let t=S(e,n,i);if(!n?.reasoning)return k(e,o,{...t,thinking:{enabled:!1}});let r=M(e,n.reasoning),c=r==="off"?"high":r,u=e;return y(u)||E(u)||m(u)?k(e,o,{...t,thinking:{enabled:!0,level:U(c,u)}}):k(e,o,{...t,thinking:{enabled:!0,budgetTokens:$(u,c,n.thinkingBudgets)}})};function W(e,o,n){let i={};return e.baseUrl&&(i.baseUrl=e.baseUrl,i.apiVersion=""),(e.headers||n)&&(i.headers={...e.headers,...n}),new R({apiKey:o,httpOptions:Object.keys(i).length>0?i:void 0})}function B(e,o,n={}){let i=_(e,o),t={};n.temperature!==void 0&&(t.temperature=n.temperature),n.maxTokens!==void 0&&(t.maxOutputTokens=n.maxTokens);let r={...Object.keys(t).length>0&&t,...o.systemPrompt&&{systemInstruction:b(o.systemPrompt)},...o.tools&&o.tools.length>0&&{tools:G(o.tools)}};if(o.tools&&o.tools.length>0&&n.toolChoice?r.toolConfig={functionCallingConfig:{mode:O(n.toolChoice)}}:r.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let u={includeThoughts:!0};n.thinking.level!==void 0?u.thinkingLevel=n.thinking.level:n.thinking.budgetTokens!==void 0&&(u.thinkingBudget=n.thinking.budgetTokens),r.thinkingConfig=u}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(r.thinkingConfig=H(e));if(n.signal){if(n.signal.aborted)throw new Error("Request aborted");r.abortSignal=n.signal}return{model:e.id,contents:i,config:r}}function m(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function E(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function H(e){return y(e)?{thinkingLevel:"LOW"}:E(e)?{thinkingLevel:"MINIMAL"}:m(e)?{thinkingLevel:"MINIMAL"}:{thinkingBudget:0}}function U(e,o){if(y(o))switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}if(m(o))switch(e){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function $(e,o,n){return n?.[o]!==void 0?n[o]:e.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[o]:e.id.includes("2.5-flash-lite")?{minimal:512,low:2048,medium:8192,high:24576}[o]:e.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[o]:-1}export{k as streamGoogle,X as streamSimpleGoogle};
|
|
@@ -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 d,b as w,c as m,d as M,e as k,f as R,g as S,h as G,i as N}from"./chunk-
|
|
2
|
+
import{a as d,b as w,c as m,d as M,e as k,f as R,g as S,h as G,i as N}from"./chunk-NXXFMBAV.js";import"./chunk-X4N2MWNJ.js";import{d as E,e as T,f as b,h as _,j as v}from"./chunk-UOE7W4PK.js";import{a as O}from"./chunk-WFWSBUYD.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";var P="v1",V="gcp-vertex-credentials",H={THINKING_LEVEL_UNSPECIFIED:d.THINKING_LEVEL_UNSPECIFIED,MINIMAL:d.MINIMAL,LOW:d.LOW,MEDIUM:d.MEDIUM,HIGH:d.HIGH},K=0,C=(e,n,t)=>{let o=new b;return(async()=>{let i={role:"assistant",content:[],api:"google-vertex",provider:e.provider,model:e.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 a=$(t),c=a?j(e,a,t?.headers):W(e,F(t),z(t),t?.headers),g=X(e,n,t),y=await t?.onPayload?.(g,e);y!==void 0&&(g=y);let D=await c.models.generateContentStream(g);o.push({type:"start",partial:i});let r=null,x=i.content,u=()=>x.length-1;for await(let l of D){i.responseId||=l.responseId;let p=l.candidates?.[0];if(p?.content?.parts)for(let s of p.content.parts){if(s.text!==void 0){let h=M(s);(!r||h&&r.type!=="thinking"||!h&&r.type!=="text")&&(r&&(r.type==="text"?o.push({type:"text_end",contentIndex:x.length-1,content:r.text,partial:i}):o.push({type:"thinking_end",contentIndex:u(),content:r.thinking,partial:i})),h?(r={type:"thinking",thinking:"",thinkingSignature:void 0},i.content.push(r),o.push({type:"thinking_start",contentIndex:u(),partial:i})):(r={type:"text",text:""},i.content.push(r),o.push({type:"text_start",contentIndex:u(),partial:i}))),r.type==="thinking"?(r.thinking+=s.text,r.thinkingSignature=k(r.thinkingSignature,s.thoughtSignature),o.push({type:"thinking_delta",contentIndex:u(),delta:s.text,partial:i})):(r.text+=s.text,r.textSignature=k(r.textSignature,s.thoughtSignature),o.push({type:"text_delta",contentIndex:u(),delta:s.text,partial:i}))}if(s.functionCall){r&&(r.type==="text"?o.push({type:"text_end",contentIndex:u(),content:r.text,partial:i}):o.push({type:"thinking_end",contentIndex:u(),content:r.thinking,partial:i}),r=null);let h=s.functionCall.id,f={type:"toolCall",id:!h||i.content.some(L=>L.type==="toolCall"&&L.id===h)?`${s.functionCall.name}_${Date.now()}_${++K}`:h,name:s.functionCall.name||"",arguments:s.functionCall.args??{},...s.thoughtSignature&&{thoughtSignature:s.thoughtSignature}};i.content.push(f),o.push({type:"toolcall_start",contentIndex:u(),partial:i}),o.push({type:"toolcall_delta",contentIndex:u(),delta:JSON.stringify(f.arguments),partial:i}),o.push({type:"toolcall_end",contentIndex:u(),toolCall:f,partial:i})}}p?.finishReason&&(i.stopReason=N(p.finishReason),i.content.some(s=>s.type==="toolCall")&&(i.stopReason="toolUse")),l.usageMetadata&&(i.usage={input:(l.usageMetadata.promptTokenCount||0)-(l.usageMetadata.cachedContentTokenCount||0),output:(l.usageMetadata.candidatesTokenCount||0)+(l.usageMetadata.thoughtsTokenCount||0),cacheRead:l.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:l.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},E(e,i.usage))}if(r&&(r.type==="text"?o.push({type:"text_end",contentIndex:u(),content:r.text,partial:i}):o.push({type:"thinking_end",contentIndex:u(),content:r.thinking,partial:i})),t?.signal?.aborted)throw new Error("Request was aborted");if(i.stopReason==="aborted"||i.stopReason==="error")throw new Error("An unknown error occurred");o.push({type:"done",reason:i.stopReason,message:i}),o.end()}catch(a){_(t?.onProviderError,a,e);for(let c of i.content)"index"in c&&delete c.index;i.stopReason=t?.signal?.aborted?"aborted":"error",i.errorMessage=a instanceof Error?a.message:JSON.stringify(a),o.push({type:"error",reason:i.stopReason,error:i}),o.end()}})(),o},ce=(e,n,t)=>{let o=v(e,t,void 0);if(!t?.reasoning)return C(e,n,{...o,thinking:{enabled:!1}});let i=T(e,t.reasoning),a=i==="off"?"high":i,c=e;return I(c)||U(c)?C(e,n,{...o,thinking:{enabled:!0,level:Y(a,c)}}):C(e,n,{...o,thinking:{enabled:!0,budgetTokens:Z(c,a,t.thinkingBudgets)}})};function W(e,n,t,o){return new m({vertexai:!0,project:n,location:t,apiVersion:P,httpOptions:A(e,o)})}function j(e,n,t){return new m({vertexai:!0,apiKey:n,apiVersion:P,httpOptions:A(e,t)})}function A(e,n){let t={},o=B(e.baseUrl);return o&&(t.baseUrl=o,t.baseUrlResourceScope=w.COLLECTION,J(o)&&(t.apiVersion="")),(e.headers||n)&&(t.headers={...e.headers,...n}),Object.keys(t).length>0?t:void 0}function B(e){let n=e.trim();if(!(!n||n.includes("{location}")))return n}function J(e){try{return new URL(e).pathname.split("/").some(t=>/^v\d+(?:beta\d*)?$/.test(t))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function $(e){let n=e?.apiKey?.trim();if(!(!n||n===V||q(n)))return n}function q(e){return/^<[^>]+>$/.test(e)}function F(e){let n=e?.project||process.env.GOOGLE_CLOUD_PROJECT||process.env.GCLOUD_PROJECT;if(!n)throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return n}function z(e){let n=e?.location||process.env.GOOGLE_CLOUD_LOCATION;if(!n)throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return n}function X(e,n,t={}){let o=R(e,n),i={};t.temperature!==void 0&&(i.temperature=t.temperature),t.maxTokens!==void 0&&(i.maxOutputTokens=t.maxTokens);let a={...Object.keys(i).length>0&&i,...n.systemPrompt&&{systemInstruction:O(n.systemPrompt)},...n.tools&&n.tools.length>0&&{tools:S(n.tools)}};if(n.tools&&n.tools.length>0&&t.toolChoice?a.toolConfig={functionCallingConfig:{mode:G(t.toolChoice)}}:a.toolConfig=void 0,t.thinking?.enabled&&e.reasoning){let g={includeThoughts:!0};t.thinking.level!==void 0?g.thinkingLevel=H[t.thinking.level]:t.thinking.budgetTokens!==void 0&&(g.thinkingBudget=t.thinking.budgetTokens),a.thinkingConfig=g}else e.reasoning&&t.thinking&&!t.thinking.enabled&&(a.thinkingConfig=Q(e));if(t.signal){if(t.signal.aborted)throw new Error("Request aborted");a.abortSignal=t.signal}return{model:e.id,contents:o,config:a}}function I(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function U(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function Q(e){let n=e;return I(n)?{thinkingLevel:d.LOW}:U(n)?{thinkingLevel:d.MINIMAL}:{thinkingBudget:0}}function Y(e,n){if(I(n))switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function Z(e,n,t){return t?.[n]!==void 0?t[n]:e.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[n]:e.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[n]:-1}export{C as streamGoogleVertex,ce as streamSimpleGoogleVertex};
|
|
@@ -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{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r}from"./chunk-
|
|
2
|
+
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r}from"./chunk-RDUENEEQ.js";import"./chunk-HQ2U4QVQ.js";import"./chunk-D76SO2ME.js";export{a as MCODE_INTERNAL_NPM_REGISTRY,c as MCODE_PUBLIC_NPM_MIRROR_REGISTRY,b as MCODE_PUBLIC_NPM_REGISTRY,l as bindMcodeNpmCommandToRuntime,j as buildMcodePackageManagerCommand,f as classifyMcodeInstallPath,i as classifyNpmGlobalInstall,m as createMcodeNpmRuntimeEnvironment,e as detectMcodeInstallSource,p as isInternalMcodePackageName,d as isManagedMcodeInstallRoot,q as resolveInstalledMcodePackageVersion,k as resolveLatestMcodeRegistryVersion,h as resolveMcodeNpmDistTag,g as resolveMcodeNpmDistribution,r as resolveMcodeNpmPrefixInstall,o as resolveMcodePackageName,n as runMcodePackageManagerCommand};
|