@minimax-ai/code 0.3.8 → 0.3.9

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.
@@ -5909,4 +5909,4 @@ ${s}Artifact: ${e}${o}
5909
5909
  Archived reference only; not evidence.]`}function b$i(e){let t=e.arguments;if(ope(t)){if(ape(e.name)==="grep"){let n=rpe(t,"pattern"),r=rpe(t,"path")??rpe(t,"file_path"),i=[n,r].filter(s=>!!s).join("; ");if(i)return i}for(let n of["query","url","pattern","path","file_path"]){let r=rpe(t,n);if(r)return r}}}function rpe(e,t){let n=e[t];if(typeof n!="string")return;let r=E$i(t,n.slice(0,1024));return r?`${t}=${JSON.stringify(r)}`:void 0}function E$i(e,t){let n=t.replaceAll(/\s+/gu," ").trim();if(e!=="url")return n;try{let r=new URL(n);if(r.protocol!=="http:"&&r.protocol!=="https:")return n;let i=r.hostname.replace(/^www\./u,""),s=r.pathname.split("/").filter(Boolean),o=s.at(-1),a=o?/^index\.(?:aspx?|html?|php)$/iu.test(o):!1,l=s.slice(a?-2:-1).join("/");return l?`${i}/\u2026/${l}`:i}catch{return n}}function jfn(e,t){if(t<=0)return"";if(Buffer.byteLength(e)<=t)return e;let n="\u2026",r=Buffer.byteLength(n);if(t<=r)return"";let i="",s=0;for(let o of e){let a=Buffer.byteLength(o);if(s+a+r>t)break;i+=o,s+=a}return i?i+n:""}function _$i(e,t,n){return Kji("sha256").update(e).update("\0").update(t.id).update("\0").update(t.name).update("\0").update(n).digest("hex")}function ape(e){return e.trim().toLowerCase()}function yx(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function ipe(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function S$i(e){return{enabled:typeof e?.enabled=="boolean"?e.enabled:Jji,watermarkBytes:ipe(e?.watermarkBytes)??Xji,minSavingsBytes:ipe(e?.minSavingsBytes)??Zji,minCandidateBytes:ipe(e?.minCandidateBytes)??e$i}}function I$i(e){try{return e?.()}catch{return}}function C$i(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`ToolResultArchiver: ${t} must be a positive integer`);return e}function ope(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cze(e,t,n){try{e?.[t]?.(n,"[local-runtime-v2] ToolResult compaction")}catch{}}function $fn(e){return ope(e)&&yx(e.code)?yx(e.code)??"error":e instanceof Error&&e.name?e.name:"unknown_error"}import{createHash as Hfn}from"node:crypto";function w$i(e){let t=JSON.stringify({systemPrompt:e.systemPrompt??"",tools:e.tools??[]},R$i);if(t===void 0)throw new TypeError("Context usage anchor input is not serializable.");let n={scope:e.scope,provider:e.provider,api:e.api,model:e.model,contextFingerprint:Hfn("sha256").update(t).digest("hex")};if(!Vfn(n))throw new TypeError("Context usage anchor key is invalid.");return n}var lpe=class{anchorsByScope=new Map;epochsByScope=new Map;keysByScope=new Map;bind(t){let n=w$i(t);return this.keysByScope.set(n.scope,n),{state:this,key:n,historyEpoch:this.epochsByScope.get(n.scope)??0}}recordBound(t,n){let r=this.keysByScope.get(t);if(!r)return!1;let i=this.epochsByScope.get(t)??0;for(let s=n.length-1;s>=0;s-=1){let o=n[s];if(v$i(o)&&this.record({key:r,historyEpoch:i,assistant:o}))return!0}return!1}advanceHistory(t){this.epochsByScope.set(t,(this.epochsByScope.get(t)??0)+1)}invalidate(t){this.anchorsByScope.delete(t)}record(t){let n=k$i(t.assistant),r=zfn(t.assistant);return!Vfn(t.key)||!Number.isSafeInteger(t.historyEpoch)||t.historyEpoch<0||!x$i(t.assistant,t.key)||n===void 0||r===void 0?!1:(this.anchorsByScope.set(t.key.scope,{key:{...t.key},historyEpoch:t.historyEpoch,assistantIdentity:r,absoluteTokens:n}),!0)}resolve(t){let n=this.anchorsByScope.get(t.key.scope);if(!n||n.historyEpoch!==t.historyEpoch||!T$i(n.key,t.key))return;let r=-1;for(let i=0;i<t.messages.length;i+=1){let s=t.messages[i];if(!(!s||zfn(s)!==n.assistantIdentity)){if(r!==-1)return;r=i}}if(r!==-1)return{absoluteTokens:n.absoluteTokens,trailingMessages:t.messages.slice(r+1)}}};function v$i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Reflect.get(e,"role")==="assistant"}function Vfn(e){return[e.scope,e.provider,e.api,e.model,e.contextFingerprint].every(t=>typeof t=="string"&&t.length>0)}function T$i(e,t){return e.scope===t.scope&&e.provider===t.provider&&e.api===t.api&&e.model===t.model&&e.contextFingerprint===t.contextFingerprint}function x$i(e,t){return e.role==="assistant"&&e.provider===t.provider&&e.api===t.api&&e.model===t.model}function k$i(e){if(e.role!=="assistant"||e.stopReason==="error"||e.stopReason==="aborted"||[e.usage.input,e.usage.output,e.usage.cacheRead,e.usage.cacheWrite,e.usage.totalTokens].some(i=>!Number.isSafeInteger(i)||i<0))return;let n=e.usage.input+e.usage.output+e.usage.cacheRead+e.usage.cacheWrite,r=e.usage.totalTokens||n;return Number.isSafeInteger(r)&&r>0?r:void 0}function zfn(e){if(e.role==="assistant"){if(typeof e.responseId=="string"&&e.responseId.length>0)return`response:${e.provider}:${e.api}:${e.model}:${e.responseId}`;try{let t=JSON.stringify({api:e.api,provider:e.provider,model:e.model,timestamp:e.timestamp,content:e.content,usage:e.usage,stopReason:e.stopReason});return t===void 0?void 0:`message:${Hfn("sha256").update(t).digest("hex")}`}catch{return}}}function R$i(e,t){return!t||typeof t!="object"||Array.isArray(t)?t:Object.fromEntries(Object.entries(t).sort(([n],[r])=>n.localeCompare(r)))}var cpe=class{usageAnchor;checkpointState;logger;toolResultArchiver;promptSnapshots;constructor(t,n,r,i){this.usageAnchor=t,this.checkpointState=n,this.logger=r,this.toolResultArchiver=i.toolResultArchiver,this.promptSnapshots=i.promptSnapshots}probeBeforeLlm(t){return t.signal?.throwIfAborted(),{shouldStart:Wfn(t,this.usageAnchor,this.toolResultArchiver).shouldStart}}async compactBeforeLlm(t,n){t.signal?.throwIfAborted();let r=Wfn(t,this.usageAnchor,this.toolResultArchiver);if(!r.shouldStart)return{status:"unchanged",reason:"nothing-to-compact"};await n?.onStarted(),t.signal?.throwIfAborted();let i=await U$i(this.toolResultArchiver,t.sessionId,r.toolResultCompactionPlan,r.canReadArchivedToolResults);if(t.signal?.throwIfAborted(),r.toolResultCompactionPlan&&!i&&!r.normalTriggerMatched)return{status:"unchanged",reason:"nothing-to-compact"};let s=await D$i({input:t,hooks:n,preparation:r,toolResultCompactionCandidate:i,checkpointState:this.checkpointState,logger:this.logger,legacyToolTrim:this.toolResultArchiver===void 0,promptSnapshots:this.promptSnapshots});return this.usageAnchor?.invalidate(t.sessionId),L$i(t.messages,s)}};function Wfn(e,t,n){let r=wze(e,t),i=r.measure(e.messages),{providerInputLimit:s,automaticTriggerAt:o}=pN({contextWindow:e.model.contextWindow,configuredMaxOutputTokens:e.maxTokens??e.model.maxTokens}),a=n?.plan({sessionId:e.sessionId,messages:e.messages}),l=i.inputTokens>o||e.maxSerializedInputBytes!==void 0&&i.serializedBytes>e.maxSerializedInputBytes;return{measurer:r,footprint:i,toolResultCompactionPlan:a,canReadArchivedToolResults:Q$i(e.tools),normalTriggerMatched:l,shouldStart:a!==void 0||l,providerInputLimit:s}}async function D$i(e){let{input:t,hooks:n,preparation:r}=e;return Jde({history:t.messages,limits:B$i(t,r.providerInputLimit),measurePair:async i=>r.measurer.measurePair(i),...e.toolResultCompactionCandidate?{toolResultCompactionCandidate:e.toolResultCompactionCandidate}:{},allowLegacyToolTrim:e.legacyToolTrim,checkpoint:M$i({input:t,hooks:n,tokensBefore:r.footprint.inputTokens,providerInputLimit:r.providerInputLimit,promptSnapshots:e.promptSnapshots}),...P$i(t.sessionId,e.checkpointState,e.logger),...t.signal===void 0?{}:{signal:t.signal}})}function B$i(e,t){return{providerInputLimit:t,...e.maxSerializedInputBytes===void 0?{}:{maxSerializedInputBytes:e.maxSerializedInputBytes}}}function M$i({input:e,hooks:t,tokensBefore:n,providerInputLimit:r,promptSnapshots:i}){return{tokensBefore:n,timestamp:Date.now(),...t?.onCheckpointAttemptSettled?{onAttemptSettled:t.onCheckpointAttemptSettled}:{},...t?.getProviderTokenUsage?{getTokenUsage:t.getProviderTokenUsage}:{},open:()=>O$i(e,t,r,i)}}async function O$i(e,t,n,r){if(!e.streamFn)throw new TypeError("Automatic context compaction requires streamFn.");let i=await epe({model:e.model,streamFn:e.streamFn,thinkingLevel:e.thinkingLevel,providerInputLimit:n,maxOutputTokens:Xde(_q.reserveTokens,e.maxTokens??e.model.maxTokens),...e.maxSerializedInputBytes===void 0?{}:{maxSerializedInputBytes:e.maxSerializedInputBytes},...e.apiKey===void 0?{}:{apiKey:e.apiKey},...e.headers===void 0?{}:{headers:e.headers},...e.payloadTransform===void 0?{}:{payloadTransform:e.payloadTransform},...t?.onProviderRequestSettled?{onRequestSettled:t.onProviderRequestSettled}:{},onGenerated:s=>t?.onCheckpointGenerated?.({responseContentKinds:s.responseContentKinds,stopReason:s.stopReason,outputTokens:s.outputTokens}),...r?{promptSnapshots:r}:{}});return{...i,fits:s=>i.fits({...s,messages:s.messages}),generate:async s=>await i.generate({...s,messages:s.messages})}}function P$i(e,t,n){return t?{captureSubagents:()=>t.captureSubagents({sessionId:e}),onSubagentCaptureFailure:()=>n?.error?.({event:"context_compaction_subagent_checkpoint_capture_failed",session_id:e},"[local-runtime-v2] subagent checkpoint state capture failed")}:{}}function L$i(e,t){let n={status:"completed",compactionId:`ctx_${N$i()}`,strategyVersion:"local-context-compaction-v3",method:t.method,replacementMessages:[...t.replacementMessages],messagesBefore:e.length,messagesAfter:t.replacementMessages.length,tokensBefore:t.measurement.before.inputTokens,tokensAfter:t.measurement.after.inputTokens,serializedBytesBefore:t.measurement.before.serializedBytes,serializedBytesAfter:t.measurement.after.serializedBytes,...F$i(t),...t.method==="llm_checkpoint"&&t.tokenUsage!==void 0?{tokenUsage:t.tokenUsage}:{}};return t.method==="llm_checkpoint"?{...n,method:t.method,summary:t.summary}:{...n,method:t.method,replacementSourceIndexes:e.map((r,i)=>i)}}function F$i(e){return e.method==="llm_checkpoint"&&e.hmidOverflowRecovered?{hmidOverflowRecovered:!0}:{}}function Q$i(e){return e?.some(t=>t.name==="read")===!0}async function U$i(e,t,n,r){if(!(!e||!n))try{return r?await e.materialize({sessionId:t,plan:n}):await e.materializeTrim({sessionId:t,plan:n})}catch{return}}function Yfn(){return e=>{let t=e.messages;return t===e.messages?{type:"continue"}:{type:"replaceRequestMessages",messages:[...t],reason:"internal-context-filter"}}}function wze(e,t){return tpe({model:e.model,...e.systemPrompt===void 0?{}:{systemPrompt:e.systemPrompt},...e.tools===void 0?{}:{tools:e.tools},...t?{usageAnchor:t.bind({scope:e.sessionId,provider:e.model.provider,api:e.model.api,model:e.model.id,...e.systemPrompt===void 0?{}:{systemPrompt:e.systemPrompt},...e.tools===void 0?{}:{tools:e.tools}})}:{}})}var s_=Ii("local_runtime_file_api_uploads",{sessionId:Et("session_id").notNull().references(()=>lt.sessionId,{onDelete:"cascade"}),cacheKey:Et("cache_key").notNull(),contentHash:Et("content_hash").notNull(),endpointHash:Et("endpoint_hash").notNull(),callerIdentityHash:Et("caller_identity_hash").notNull(),ttlSec:FL("ttl_sec").notNull(),fileId:Et("file_id").notNull(),expiresAtMs:Jt("expires_at_ms").notNull(),createdAtMs:Jt("created_at_ms").notNull(),updatedAtMs:Jt("updated_at_ms").notNull()},e=>[Rv({columns:[e.sessionId,e.cacheKey]}),mm("local_runtime_file_api_uploads_ttl_check",ze`${e.ttlSec} >= 0`),mm("local_runtime_file_api_uploads_file_id_check",ze`length(${e.fileId}) > 0`),br("idx_local_runtime_file_api_uploads_session_expiry").on(e.sessionId,e.expiresAtMs)]);function Kfn(e){let t=e.nowMs??Date.now;return{forSession:n=>j$i(e.db,n,t)}}function j$i(e,t,n){return{get:(r,i)=>{let s=e.select().from(s_).where(mt(me(s_.sessionId,t),me(s_.cacheKey,r))).get();if(!(!s||!$$i(s,i))){if(s.expiresAtMs<=n()){e.delete(s_).where(mt(me(s_.sessionId,t),me(s_.cacheKey,r))).run();return}return{fileId:s.fileId,expiresAtMs:s.expiresAtMs}}},set:(r,i,s)=>{let o=n();e.insert(s_).values({sessionId:t,cacheKey:r,contentHash:s.contentHash,endpointHash:s.endpointHash,callerIdentityHash:s.callerIdentityHash,ttlSec:s.ttlSec,fileId:s.fileId,expiresAtMs:s.expiresAtMs,createdAtMs:o,updatedAtMs:o}).onConflictDoUpdate({target:[s_.sessionId,s_.cacheKey],set:{contentHash:s.contentHash,endpointHash:s.endpointHash,callerIdentityHash:s.callerIdentityHash,ttlSec:s.ttlSec,fileId:s.fileId,expiresAtMs:s.expiresAtMs,updatedAtMs:o}}).run()}}}function $$i(e,t){return e.contentHash===t.contentHash&&e.endpointHash===t.endpointHash&&e.callerIdentityHash===t.callerIdentityHash&&e.ttlSec===t.ttlSec}import{createHash as JQ,randomUUID as q$i}from"node:crypto";import{createReadStream as G$i}from"node:fs";import{link as z$i,lstat as Zfn,mkdir as H$i,open as V$i,realpath as Jfn,unlink as W$i}from"node:fs/promises";import{isAbsolute as Y$i,join as vze,relative as K$i}from"node:path";var J$i="tool-outputs",X$i=240,Z$i=64*1024,Tze=1,eqi=`chunked_jsonl_v${Tze}`,tqi=16*1024,upe=class{options;constructor(t){this.options=t}async write(t){let n=await this.options.resolveSessionReportsDirectory(t.sessionId),r=vze(n,J$i);await H$i(r,{recursive:!0,mode:448});let[i,s]=await Promise.all([Jfn(n),Jfn(r)]);if(!nqi(s,i))throw new Error("Tool output artifact directory escapes its Session reports directory.");let o=await Zfn(s);if(!o.isDirectory()||o.isSymbolicLink())throw new Error("Tool output artifact directory is not a safe directory.");let a=rqi(t),l=vze(s,a.fileName);if(await iqi(l,t.text,a.contentSha256),sqi(t.text)){let u=vze(s,a.readableFileName);return await oqi(u,t.text,{originalBytes:Buffer.byteLength(t.text),contentSha256:a.contentSha256}),{reference:u,metadata:{artifact_kind:"tool_output",sensitive:t.sensitive,content_sha256:a.contentSha256,read_format:eqi,raw_reference:l}}}return{reference:l,metadata:{artifact_kind:"tool_output",sensitive:t.sensitive,content_sha256:a.contentSha256}}}};function nqi(e,t){let n=K$i(t,e);return n!==""&&!n.startsWith("..")&&!Y$i(n)}function rqi(e){let t=JQ("sha256").update(e.toolCallId).update("\0").update(e.toolName).digest("hex").slice(0,24),n=dqi(e.text),r=`${t}-${n}`;return{fileName:`${r}.txt`,readableFileName:`${r}.readable.v${Tze}.jsonl`,contentSha256:n}}async function iqi(e,t,n){let r={bytes:Buffer.byteLength(t),sha256:n},i=await xze(e,"Existing tool output artifact");if(i){await kze(e,i,r,"Existing tool output artifact");return}await ehn(e,"Existing tool output artifact",s=>aqi(s,t))}function sqi(e){let t=0;for(let n of e){if(n===`
5910
5910
  `){t=0;continue}if(t+=1,t>2e3)return!0}return!1}async function oqi(e,t,n){let r=await xze(e,"Existing readable tool output artifact");if(r){let i=uqi(t,n);await kze(e,r,i,"Existing readable tool output artifact");return}await ehn(e,"Existing readable tool output artifact",i=>lqi(i,t,n))}async function ehn(e,t,n){let r=`${e}.${process.pid}-${q$i()}.tmp`,i=await V$i(r,"wx",384);try{let s;try{s=await n(i)}finally{await i.close()}try{await z$i(r,e)}catch(o){if(!gqi(o))throw o;await fqi(e,s.bytes,s.sha256,t)}}finally{await cqi(r)}}async function aqi(e,t){let n=JQ("sha256"),r=0;for(let i of nhn(t))await e.writeFile(i,"utf8"),n.update(i),r+=Buffer.byteLength(i);return{bytes:r,sha256:n.digest("hex")}}async function lqi(e,t,n){let r=JQ("sha256"),i=0,s="",o=0;for(let a of thn(t,n)){let l=Buffer.byteLength(a);o>0&&o+l>Z$i&&(await e.writeFile(s,"utf8"),s="",o=0),s+=a,o+=l,r.update(a),i+=l}return o>0&&await e.writeFile(s,"utf8"),{bytes:i,sha256:r.digest("hex")}}async function cqi(e){try{await W$i(e)}catch{}}function uqi(e,t){let n=JQ("sha256"),r=0;for(let i of thn(e,t))n.update(i),r+=Buffer.byteLength(i);return{bytes:r,sha256:n.digest("hex")}}function*thn(e,t){yield`${JSON.stringify({type:"tool_output_chunks",version:Tze,original_bytes:t.originalBytes,content_sha256:t.contentSha256,instruction:"Concatenate each chunk row's text field in index order."})}
5911
5911
  `;let n=0,r=0,i="",s=0;for(let o of e)i+=o,s+=1,!(s<X$i)&&(yield Xfn(n,r,i),r+=Buffer.byteLength(i),n+=1,i="",s=0);(i||e==="")&&(yield Xfn(n,r,i))}function Xfn(e,t,n){return`${JSON.stringify({type:"chunk",index:e,byte_offset:t,text:n})}
5912
- `}function dqi(e){let t=JQ("sha256");for(let n of nhn(e))t.update(n);return t.digest("hex")}function*nhn(e){let t=0;for(;t<e.length;){let n=Math.min(t+tqi,e.length);n<e.length&&pqi(e.charCodeAt(n-1))&&mqi(e.charCodeAt(n))&&(n-=1),yield e.slice(t,n),t=n}}function pqi(e){return e>=55296&&e<=56319}function mqi(e){return e>=56320&&e<=57343}async function fqi(e,t,n,r){let i=await xze(e,r);if(!i)throw new Error(`${r} disappeared during verification.`);await kze(e,i,{bytes:t,sha256:n},r)}async function xze(e,t){try{let n=await Zfn(e);if(!n.isFile()||n.isSymbolicLink())throw new Error(`${t} is not a safe file.`);return n}catch(n){if(Aqi(n))return;throw n}}async function kze(e,t,n,r){if(t.size!==n.bytes||await hqi(e)!==n.sha256)throw new Error(`${r} content does not match this result.`)}function hqi(e){return new Promise((t,n)=>{let r=JQ("sha256"),i=G$i(e);i.on("data",s=>r.update(s)),i.on("error",n),i.on("end",()=>t(r.digest("hex")))})}function gqi(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}function Aqi(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}var yqi=new Set([Vr.LLM_RATE_LIMITED,Vr.LLM_UPSTREAM_ERROR,Vr.LLM_TPM_RATE_LIMITED,Vr.LLM_CLUSTER_OVERLOADED]);function rhn(e){return e!==void 0&&yqi.has(e)}function kY(e,t,n){let r=wze(e,n).measure([...e.messages,t]),{providerInputLimit:i}=pN({contextWindow:e.model.contextWindow,configuredMaxOutputTokens:e.maxTokens??e.model.maxTokens});return r.inputTokens<=i&&(e.maxSerializedInputBytes===void 0||r.serializedBytes<=e.maxSerializedInputBytes)}function ihn(e){return t=>{if(!t.tools?.some(o=>o.name.toLowerCase()==="todowrite"))return;let n=Gde(t.canonicalMessages);if(!n.todoState||!n.todoCadence)return;let r=Zoe(n.todoState.map(o=>({status:o.status})));if(r.active===0||n.todoCadence.assistantIterationsSinceTodoWrite<th||n.todoCadence.assistantIterationsSinceReminder<th)return;let i={version:1,summary:r,todos:n.todoState,cadence:n.todoCadence},s={role:"custom",customType:qde,content:Zqe(i),display:!1,details:i,timestamp:Date.now()};if(kY(t,s,e))return{type:"appendMessage",reason:qde,message:s}}}function shn(e){return{async prepare(t){if(ahn(t.hookInput.canonicalMessages.at(-1)))return{beforeUserMessages:[],hook:()=>{}};let n=Eqi(await t.loadFacts()),r=ohn(t.hookInput,n),i=r&&kY(t.hookInput,r,e)?r:void 0;return{beforeUserMessages:i?[i]:[],hook:bqi({facts:n,initialCandidate:r,usageAnchor:e,hasSuccessfulTaskOutputRead:t.hasSuccessfulTaskOutputRead})}}}}function bqi(e){let{facts:t,initialCandidate:n,usageAnchor:r,hasSuccessfulTaskOutputRead:i=()=>!1}=e;return s=>{if(i()||ahn(s.canonicalMessages.at(-1)))return;let o=s.phase==="initial"?n:ohn(s,t);if(!(!o||s.phase==="initial"&&_qi(s.canonicalMessages,o)||!kY(s,o,r)))return o?{type:"appendMessage",reason:Og,message:o,...s.phase==="initial"?{placement:"before-current-user"}:{}}:void 0}}function ohn(e,t){if(t.undeliveredTotal===0||t.tasks.length===0)return;let n=zde(e.canonicalMessages);if(!(!n.hasBackgroundState||n.observedTerminalCount!==void 0&&t.terminalTotal>n.observedTerminalCount)&&n.assistantIterationsSinceReminder<th)return;let i={version:1,tasks:t.tasks,undeliveredTotal:t.undeliveredTotal,queuedTotal:t.undeliveredTotal-t.tasks.length,terminalTotal:t.terminalTotal,cadence:{assistantIterationsBeforeReminder:n.assistantIterationsSinceReminder}};return{role:"custom",customType:Og,content:Xqe(i),display:!1,details:i,timestamp:Date.now()}}function Eqi(e){return Object.freeze({tasks:Object.freeze(e.tasks.map(t=>Object.freeze({...t}))),undeliveredTotal:e.undeliveredTotal,terminalTotal:e.terminalTotal})}function _qi(e,t){return e.some(n=>n!==null&&typeof n=="object"&&!Array.isArray(n)&&Reflect.get(n,"role")==="custom"&&Reflect.get(n,"customType")===Og&&Reflect.get(n,"timestamp")===t.timestamp)}function ahn(e){return vI(e)!==void 0}var chn="mcp_tool_result_artifact";var ppe=class{options;defaultMaxInlineBytes;constructor(t){this.options=t,this.defaultMaxInlineBytes=Cqi(t.maxInlineBytes,"maxInlineBytes")}finalize=async t=>{let n=Rze(t.toolContext.result.details);if(!n||!Object.prototype.hasOwnProperty.call(n,"mcp"))return;let r=n.mcp;if(Iqi(r))return;let i;try{let l=JSON.stringify(r);if(l===void 0)return;i=l}catch(l){this.log(t,{outcome:"fallback",maxInlineBytes:this.readMaxInlineBytes(),reason:lhn(l)});return}let s=Buffer.byteLength(i),o=this.readMaxInlineBytes();if(s<=o)return;let a={sessionId:t.sessionId,turnId:t.turnId,agentName:t.agentName,workspaceDir:t.workspaceDir,toolCallId:t.toolContext.toolCall.id,toolName:t.toolContext.toolCall.name,args:t.toolContext.args,text:i,originalBytes:s,sensitive:!0};try{let l=await this.options.writeArtifact(a);return this.log(t,{outcome:"externalized",originalBytes:s,maxInlineBytes:o,artifactReadFormat:dpe(l.metadata,"read_format")}),{details:{...n,mcp:Sqi(l,s)}}}catch(l){this.log(t,{outcome:"fallback",originalBytes:s,maxInlineBytes:o,reason:lhn(l)});return}};readMaxInlineBytes(){try{let t=this.options.getMaxInlineBytes?.();return uhn(t)?t:this.defaultMaxInlineBytes}catch{return this.defaultMaxInlineBytes}}log(t,n){try{let r={event:"mcp_tool_result_detail_budget_decision",session_id:t.sessionId,turn_id:t.turnId,tool_name:t.toolContext.toolCall.name,outcome:n.outcome,...n.originalBytes===void 0?{}:{original_bytes:n.originalBytes},max_inline_bytes:n.maxInlineBytes,...n.artifactReadFormat?{artifact_read_format:n.artifactReadFormat}:{},...n.reason?{reason:n.reason}:{}};this.options.logger?.[n.outcome==="fallback"?"error":"info"]?.(r,"[local-runtime-v2] MCP ToolResult detail budget")}catch{}}};function Sqi(e,t){let n=dpe(e.metadata,"read_format"),r=dpe(e.metadata,"content_sha256"),i=dpe(e.metadata,"raw_reference");return{kind:chn,version:1,externalized:!0,reference:e.reference,original_bytes:t,content_type:"application/json",...n?{read_format:n}:{},...r?{content_sha256:r}:{},...i?{raw_reference:i}:{}}}function Iqi(e){let t=Rze(e);return t?.kind===chn&&t.version===1&&t.externalized===!0&&typeof t.reference=="string"&&t.reference.length>0}function dpe(e,t){let n=e?.[t];return typeof n=="string"&&n.length>0?n:void 0}function Rze(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Cqi(e,t){if(!uhn(e))throw new TypeError(`McpToolResultHistoryExternalizer: ${t} must be a positive integer`);return e}function uhn(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}function lhn(e){let t=Rze(e);if(typeof t?.code=="string"){let n=t.code.trim();if(n)return n}return e instanceof Error&&e.name.trim()?e.name.trim():"unknown_error"}function wqi(e){return Aze(e)}function vqi(e,t){let{preparation:n}=e;return new kce({buildAgentConfig:async r=>{let i=await eB(e.agents,r);if(!i)throw new Error(`Session title Agent not found: ${r.agentName}`);return n.buildAgentConfig({session:r,agent:i,isSessionFirstTurn:!0})},resolveModel:async r=>{let i=await n.resolveModel(r),s=i.streamFn;return{model:i.model,...i.apiKey?{apiKey:i.apiKey}:{},...i.headers?{headers:i.headers}:{},...i.thinkingLevel?{thinkingLevel:i.thinkingLevel}:{},...s?{stream:(o,a,l)=>s(o,mpe(a),l)}:{}}},stream:(r,i,s)=>Ol(r,mpe(i),s),...t?{nowMs:t}:{}})}function Tqi(e,t){let{preparation:n}=e;return new Cce({buildAgentConfig:async r=>{let i=await eB(e.agents,r);if(!i)throw new Error(`Archive title Agent not found: ${r.agentName}`);return n.buildAgentConfig({session:r,agent:i,isSessionFirstTurn:!1})},resolveModel:async r=>{let i=await n.resolveModel(r),s=i.streamFn;return{model:i.model,...i.apiKey?{apiKey:i.apiKey}:{},...i.headers?{headers:i.headers}:{},...i.thinkingLevel?{thinkingLevel:i.thinkingLevel}:{},...s?{stream:(o,a,l)=>s(o,mpe(a),l)}:{}}},review:e.safety.review,stream:(r,i,s)=>Ol(r,mpe(i),s),...t?{nowMs:t}:{}})}function xqi(e){return{isSideSession:async t=>{let n=await e.sessions.execution.getExecutionSnapshot(t);return n?tce(n):!1}}}async function kqi(e){let t=mhn(e.product.eventObserver,e.eventObserver),n=new lpe,r=Nqi(e),i=Bqi(e),s=new spe({writeArtifact:u=>r.write(u),logger:e.product.runner.logger,getConfig:i}),o=Rqi(e,r,i),a=Uqi([qqe({maxInlineBytes:e2.maxInlineKiB*1024,getMaxInlineBytes:()=>i().maxInlineBytes,fallbackPreviewBytes:2*1024,writeArtifact:async u=>{let c=i().maxInlineBytes??e2.maxInlineKiB*1024,d=await r.write(u);return dhn(e.product.runner.logger,{input:u,maxInlineBytes:c,outcome:"externalized",artifactReadFormat:d.metadata?.read_format}),d},onArtifactError:(u,c)=>dhn(e.product.runner.logger,{input:c,maxInlineBytes:i().maxInlineBytes??e2.maxInlineKiB*1024,outcome:"fallback",reason:Mqi(u)})})],e.product.normalExtensions,e.normalExtensions),l=await gze({sessions:{get:u=>e.sessions.sessions.execution.getExecutionSnapshot(u)},planDocuments:e.sessions.planDocuments,agents:e.product.agents,...Fqi(e.product),turnRuntimeFacts:e.product.turnRuntimeFacts,preparation:e.preparation,toolCatalog:{resolveSources:async u=>{let c=await Gqi(e.sessions,u);return e.product.toolSources.resolve({session:c,turnId:u.turnId,resourceAgentName:u.resourceAgentName,...u.builtinCapabilities?{builtinCapabilities:u.builtinCapabilities}:{},toolsDisabled:process.env.MAVIS_LOCAL_RUNTIME_DISABLE_TOOLS==="1",cuModeActive:u.cuModeActive,...u.agentMemoryEnabled===void 0?{}:{agentMemoryEnabled:u.agentMemoryEnabled},...u.agentMemoryReadNames===void 0?{}:{agentMemoryReadNames:u.agentMemoryReadNames},...u.allowedSkillNames===void 0?{}:{allowedSkillNames:u.allowedSkillNames},...u.allowedExtensionSkillNames===void 0?{}:{allowedExtensionSkillNames:u.allowedExtensionSkillNames},...u.desktopCapabilities?{desktopCapabilities:u.desktopCapabilities}:{}})},config:e.product.preparation.configBuilder.config().mcpToolSearch,env:process.env},inputPreparation:e.product.inputPreparation,permission:{...e.product.permission,sideSessions:xqi(e.sessions)},runner:{...e.product.runner,reviewContent:e.safety.review},...jqi(e.toolPolicyGuard),executor:{...e.product.executor,backgroundCadenceReminder:shn(n),fileApi:{uploadStores:Kfn({db:e.db,...e.nowMs?{nowMs:e.nowMs}:{}}),...e.product.fileApi?.fetchImpl?{fetchImpl:e.product.fileApi.fetchImpl}:{},...e.product.fileApi?.logger?{logger:e.product.fileApi.logger}:{}},attemptRecall:e.sessions.agentProjection.attemptRecall,...e.nowMs?{nowMs:e.nowMs}:{},cliProductPolicy:e.cliProductPolicy,tuiProductPolicy:e.tuiProductPolicy,contentReviewEnabled:e.contentReviewEnabled,finalizeToolResultForHistory:o.finalize,resolvePluginHookRuntimeContext:u=>{let c=e.product.preparation.configBuilder.config();return{transcriptPath:PD(c.dataDir,u).messages,permissionMode:c.permissionMode}},preparePluginHookSessionOwnership:e.pluginHookSessionOwnership.prepare,activatePluginHookSessionOwnership:e.pluginHookSessionOwnership.activate,afterCompactionBeforeLlmCallHooks:[Yfn(),ihn(n)],onSteeringConsumed:e.onSteeringConsumed,onInputReviewResolved:e.onInputReviewResolved,resolveLlmRetry:e.resolveLlmRetry,...e.outputTokenCap?{outputTokenCap:e.outputTokenCap}:{}},...$qi(a),turnControl:e.turnControl,...e.turnCapabilities?{turnCapabilities:e.turnCapabilities}:{},...e.assemblyObserver?{assemblyObserver:e.assemblyObserver}:{},canonicalHistory:zqi(e.sessions.canonicalHistory,e.sessions.sessions.historyMutation),compaction:{...Dqi({contextUsageAnchor:n,checkpointState:e.product.checkpointState,logger:e.product.runner.logger,toolResultArchiver:s,promptSnapshots:e.product.promptSnapshots}),control:e.turnControl,lifecycle:e.sessions.agentProjection.compactionLifecycle,observer:e.sessions.agentProjection.compactionObserver,...e.product.runner.metricsClient?{metricsClient:e.product.runner.metricsClient}:{},usageAnchor:n},usage:{projector:e.sessions.usage.projector,onFailure:({sessionId:u,error:c})=>{e.product.executor.reportFailure?.(u,`agent_usage_projection_failed:${phn(c)}`)}},events:{projectors:{session:e.sessions.agentProjection.session,messages:Qqi(e.sessions.agentProjection.messages,e.contextUsageProjection),stream:e.sessions.agentProjection.stream,turnFacts:e.turnFacts},historyFailures:e.sessions.agentProjection.historyFailures,...t?{observer:t}:{},onObservationFailure:({sessionId:u,error:c})=>{e.product.executor.reportFailure?.(u,`agent_event_observation_failed:${phn(c)}`)}},isRuntimeErrorRetryable:rhn});return{host:new qW(l),lifecycle:l.lifecycle}}function Rqi(e,t,n){return new ppe({maxInlineBytes:e2.mcpDetailsMaxInlineKiB*1024,getMaxInlineBytes:()=>n().mcpDetailsMaxInlineBytes,writeArtifact:r=>t.write(r),logger:e.product.runner.logger})}function Nqi(e){return new upe({resolveSessionReportsDirectory:t=>e.sessions.artifacts.ensureReportsDirectory(t)})}function Dqi(e){return{automatic:new cpe(e.contextUsageAnchor,e.checkpointState,e.logger,{toolResultArchiver:e.toolResultArchiver,promptSnapshots:e.promptSnapshots}),manual:new npe(e.checkpointState,e.logger,e.promptSnapshots)}}function Bqi(e){let t=nHe(Pqi(e)),n={enabled:t.enabled,maxInlineBytes:t.maxInlineKiB*1024,mcpDetailsMaxInlineBytes:t.mcpDetailsMaxInlineKiB*1024,watermarkBytes:t.watermarkKiB*1024,minSavingsBytes:t.minSavingsKiB*1024,minCandidateBytes:t.minCandidateKiB*1024};return()=>{let r=Lqi(e.getToolResultCompactionConfig);return{enabled:typeof r?.enabled=="boolean"?r.enabled:n.enabled,maxInlineBytes:RY(r?.maxInlineBytes)??n.maxInlineBytes,mcpDetailsMaxInlineBytes:RY(r?.mcpDetailsMaxInlineBytes)??n.mcpDetailsMaxInlineBytes,watermarkBytes:RY(r?.watermarkBytes)??n.watermarkBytes,minSavingsBytes:RY(r?.minSavingsBytes)??n.minSavingsBytes,minCandidateBytes:RY(r?.minCandidateBytes)??n.minCandidateBytes}}}function dhn(e,t){try{let{input:n,maxInlineBytes:r,outcome:i,artifactReadFormat:s,reason:o}=t,a={event:"tool_output_budget_decision",session_id:n.sessionId,turn_id:n.turnId,tool_name:n.toolName,outcome:i,original_bytes:n.originalBytes,max_inline_bytes:r,...typeof s=="string"&&s.trim()?{artifact_read_format:s.trim()}:{},...o?{reason:o}:{}};e?.[i==="fallback"?"error":"info"]?.(a,"[local-runtime-v2] Tool output budget")}catch{}}function Mqi(e){return Oqi(e)&&typeof e.code=="string"&&e.code.trim()?e.code.trim():e instanceof Error&&e.name.trim()?e.name.trim():"unknown_error"}function Oqi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pqi(e){try{return e.product.preparation.configBuilder.config().toolResultCompaction}catch{return}}function Lqi(e){try{return e?.()}catch{return}}function RY(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function Fqi(e){return{...e.promptSnapshots?{promptSnapshots:e.promptSnapshots}:{},...e.internalTurnPromptReads?{internalTurnPromptReads:e.internalTurnPromptReads}:{}}}function Qqi(e,t){return t?{async projectRuntimeEvent(n){let r=await e.projectRuntimeEvent(n);return await t.projectRuntimeEvent(n),r},projectHistoryCommitted:n=>e.projectHistoryCommitted(n)}:e}function Uqi(e,t,n){let r=[...t??[],...n??[]],i=new Set(e.map(o=>o.id)),s=[...r.filter(o=>!i.has(o.id)),...e];return s.length>0?s:void 0}function jqi(e){return e?{toolPolicyGuard:e}:{}}function $qi(e){return e?{normalExtensions:e}:{}}function mhn(...e){let t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:{observeRuntimeEvent:n=>Nze(t,r=>r.observeRuntimeEvent?.(n)),observeHistoryCommitted:n=>Nze(t,r=>r.observeHistoryCommitted?.(n)),observeHistoryFailure:n=>Nze(t,r=>r.observeHistoryFailure?.(n))}}function qqi(e){return t=>{t.scope!=="title"&&e({type:"session.llm_retry",payload:{schemaVersion:1,...t}})}}async function Nze(e,t){let r=(await Promise.allSettled(e.map(i=>t(i)))).flatMap(i=>i.status==="rejected"?[i.reason]:[]);if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Agent event observers failed")}async function Gqi(e,t){let n=await e.sessions.repository.get(t.sessionId);if(!n||n.agentName!==t.agentName||n.workspaceDir!==t.workspaceDir)throw new Error(`AgentHost tool source Session mismatch: ${t.sessionId}`);return n}function zqi(e,t){return{read:async n=>{let r=await e.read(n);return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector}},readActive:async n=>{let r=await e.readActive(n);return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector}},append:n=>e.append(Dze(n)),replace:n=>e.replace(Dze(n)),compact:async n=>{let r=Dze(n);if(r.reason!=="replaceMessages"||r.operation.kind!=="compaction")throw new TypeError("Typed canonical compaction requires a compaction operation.");let i=pun(r.metadata);if(!i)throw new TypeError("Canonical compaction metadata is invalid.");let s={...r,reason:"replaceMessages",operation:{id:r.operation.id,kind:"compaction"},compactionId:i.compactionId,summary:i.summary,...i.currentUserSourceIndex===void 0?{}:{currentUserSourceIndex:i.currentUserSourceIndex}};if(i.method!=="llm_checkpoint"){await e.compact({...s,method:i.method,replacementSourceIndexes:i.replacementSourceIndexes});return}await e.compact({...s,method:i.method})},settleTurnTail:async n=>{if(!t.settleTurnTail)throw new TypeError("SessionSystem settleTurnTail capability is unavailable.");let r=await t.settleTurnTail({sessionId:n.sessionId,turnId:n.turnId,operationId:n.operation.id,mode:n.mode,approvedContent:n.approvedContent});return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector,status:r.status,deletedMessageIds:r.deletedMessageIds}},retractTurn:async n=>{if(!t.retractTurn)throw new TypeError("SessionSystem retractTurn capability is unavailable.");let r=await t.retractTurn({sessionId:n.sessionId,turnId:n.turnId,operationId:n.operation.id,reason:n.reason});return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector,status:r.status,deletedMessageIds:r.deletedMessageIds}}}}function Dze(e){if(!e.operation)throw new TypeError("Canonical history operation is required.");return{...e,operation:e.operation}}function mpe(e){return{systemPrompt:e.systemPrompt,messages:e.messages.map(t=>({...t})),...e.tools?{tools:[...e.tools]}:{}}}function phn(e){return e instanceof Error?e.message:String(e)}var Hqi=["local-task:","local-background-task:","team-plan:"];function Vqi(e,t){return e.sessionKind==="task"||e.sessionType==="branch"&&!!e.parentSessionId&&e.visibility==="hidden"&&Hqi.some(r=>e.purpose?.startsWith(r))?"task-child":t==="cli"||t==="tui"?"cli":"interactive"}export{Obe as a,PCt as b,eGn as c,dss as d,Ass as e,yss as f,Q8 as g,bss as h,bnt as i,yO as j,kss as k,Vr as l,zC as m,Zqi as n,eGi as o,aGi as p,kgn as q,lGi as r,hGi as s,kHt as t,ch as u,VY as v,AGi as w,yGi as x,bGi as y,lAn as z,EGi as A,$3 as B,qui as C,TD as D,Kui as E,Ol as F,s_e as G,u0 as H,Qw as I,YO as J,T0 as K,fX as L,jw as M,I$ as N,Sw as O,d2t as P,ZQt as Q,Wvo as R,ete as S,Io as T,Pr as U,ti as V,TRe as W,NRe as X,ya as Y,NR as Z,Pu as _,lg as $,nE as aa,DR as ba,lz as ca,DOr as da,fte as ea,cPr as fa,gte as ga,H2t as ha,mz as ia,wUe as ja,Udi as ka,ze as la,me as ma,Tv as na,mt as oa,Lu as pa,iE as qa,bc as ra,oi as sa,lu as ta,oE as ua,vn as va,cn as wa,mm as xa,Jt as ya,Et as za,Ii as Aa,br as Ba,Uc as Ca,Rv as Da,IRo as Ea,UL as Fa,fn as Ga,Ft as Ha,RD as Ia,zc as Ja,$Ue as Ka,ODe as La,cjt as Ma,LS as Na,FS as Oa,LDe as Pa,cQ as Qa,uQ as Ra,Nta as Sa,Z3 as Ta,Knn as Ua,nje as Va,Lle as Wa,rje as Xa,MD as Ya,PD as Za,wra as _a,$D as $a,qa as ab,wt as bb,VE as cb,Nn as db,wc as eb,Qo as fb,Xle as gb,io as hb,ece as ib,lsn as jb,lt as kb,Asa as lb,UT as mb,GD as nb,zD as ob,ysa as pb,bsa as qb,cW as rb,Bsa as sb,Soa as tb,eUt as ub,tUt as vb,X2t as wb,_Pr as xb,iUt as yb,Z2t as zb,bs as Ab,wFr as Bb,gne as Cb,XL as Db,jt as Eb,li as Fb,N as Gb,BHe as Hb,MHe as Ib,OHe as Jb,SB as Kb,PHe as Lb,LHe as Mb,FHe as Nb,cAn as Ob,dAn as Pb,pAn as Qb,TGi as Rb,a$r as Sb,l$r as Tb,p$r as Ub,m$r as Vb,KUt as Wb,g$r as Xb,AMe as Yb,vce as Zb,qg as _b,xon as $b,Pi as ac,Tla as bc,xla as cc,kla as dc,yW as ec,qt as fc,Uo as gc,BI as hc,$la as ic,YD as jc,Tm as kc,dca as lc,vQ as mc,ean as nc,Pca as oc,aqe as pc,Jr as qc,cqe as rc,Oy as sc,lda as tc,ZT as uc,_xi as vc,NQ as wc,Dxi as xc,Rpa as yc,nh as zc,j0i as Ac,X0i as Bc,oRi as Cc,aRi as Dc,lRi as Ec,cRi as Fc,bue as Gc,gRi as Hc,YRi as Ic,Cue as Jc,ZRi as Kc,k$r as Lc,OGr as Mc,PGr as Nc,LGr as Oc,FGr as Pc,QGr as Qc,UGr as Rc,jGr as Sc,$Gr as Tc,qGr as Uc,Ore as Vc,Ag as Wc,Pse as Xc,U1e as Yc,h5t as Zc,uF as _c,Pe as $c,yQe as ad,bQe as bd,EQe as cd,_Qe as dd,xni as ed,YQe as fd,Oni as gd,i2 as hd,UHe as id,CB as jd,wB as kd,YHe as ld,KYe as md,SUo as nd,tie as od,MH as pd,fN as qd,e4t as rd,M1 as sd,wUo as td,c4t as ud,hie as vd,O3r as wd,JLe as xd,a1e as yd,A8o as zd,mae as Ad,kXt as Bd,SI as Cd,T3 as Dd,h2e as Ed,GXt as Fd,y2e as Gd,jC as Hd,Ui as Id,of as Jd,yae as Kd,_2e as Ld,S2e as Md,Rae as Nd,dai as Od,pai as Pd,Hae as Qd,z2e as Rd,Qai as Sd,JJo as Td,C7o as Ud,w7o as Vd,eye as Wd,ub as Xd,x3 as Yd,gUe as Zd,AUe as _d,Uui as $d,OXo as ae,PXo as be,nZo as ce,rde as de,xn as ee,n_ as fe,r_ as ge,kp as he,aLi as ie,lLi as je,qEa as ke,Spn as le,Cpn as me,WEa as ne,mLi as oe,kpn as pe,jGe as qe,HGe as re,PQi as se,s_ as te,wqi as ue,vqi as ve,Tqi as we,kqi as xe,mhn as ye,qqi as ze,Vqi as Ae,kHe as Be,r2 as Ce};
5912
+ `}function dqi(e){let t=JQ("sha256");for(let n of nhn(e))t.update(n);return t.digest("hex")}function*nhn(e){let t=0;for(;t<e.length;){let n=Math.min(t+tqi,e.length);n<e.length&&pqi(e.charCodeAt(n-1))&&mqi(e.charCodeAt(n))&&(n-=1),yield e.slice(t,n),t=n}}function pqi(e){return e>=55296&&e<=56319}function mqi(e){return e>=56320&&e<=57343}async function fqi(e,t,n,r){let i=await xze(e,r);if(!i)throw new Error(`${r} disappeared during verification.`);await kze(e,i,{bytes:t,sha256:n},r)}async function xze(e,t){try{let n=await Zfn(e);if(!n.isFile()||n.isSymbolicLink())throw new Error(`${t} is not a safe file.`);return n}catch(n){if(Aqi(n))return;throw n}}async function kze(e,t,n,r){if(t.size!==n.bytes||await hqi(e)!==n.sha256)throw new Error(`${r} content does not match this result.`)}function hqi(e){return new Promise((t,n)=>{let r=JQ("sha256"),i=G$i(e);i.on("data",s=>r.update(s)),i.on("error",n),i.on("end",()=>t(r.digest("hex")))})}function gqi(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}function Aqi(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}var yqi=new Set([Vr.LLM_RATE_LIMITED,Vr.LLM_UPSTREAM_ERROR,Vr.LLM_TPM_RATE_LIMITED,Vr.LLM_CLUSTER_OVERLOADED]);function rhn(e){return e!==void 0&&yqi.has(e)}function kY(e,t,n){let r=wze(e,n).measure([...e.messages,t]),{providerInputLimit:i}=pN({contextWindow:e.model.contextWindow,configuredMaxOutputTokens:e.maxTokens??e.model.maxTokens});return r.inputTokens<=i&&(e.maxSerializedInputBytes===void 0||r.serializedBytes<=e.maxSerializedInputBytes)}function ihn(e){return t=>{if(!t.tools?.some(o=>o.name.toLowerCase()==="todowrite"))return;let n=Gde(t.canonicalMessages);if(!n.todoState||!n.todoCadence)return;let r=Zoe(n.todoState.map(o=>({status:o.status})));if(r.active===0||n.todoCadence.assistantIterationsSinceTodoWrite<th||n.todoCadence.assistantIterationsSinceReminder<th)return;let i={version:1,summary:r,todos:n.todoState,cadence:n.todoCadence},s={role:"custom",customType:qde,content:Zqe(i),display:!1,details:i,timestamp:Date.now()};if(kY(t,s,e))return{type:"appendMessage",reason:qde,message:s}}}function shn(e){return{async prepare(t){if(ahn(t.hookInput.canonicalMessages.at(-1)))return{beforeUserMessages:[],hook:()=>{}};let n=Eqi(await t.loadFacts()),r=ohn(t.hookInput,n),i=r&&kY(t.hookInput,r,e)?r:void 0;return{beforeUserMessages:i?[i]:[],hook:bqi({facts:n,initialCandidate:r,usageAnchor:e,hasSuccessfulTaskOutputRead:t.hasSuccessfulTaskOutputRead})}}}}function bqi(e){let{facts:t,initialCandidate:n,usageAnchor:r,hasSuccessfulTaskOutputRead:i=()=>!1}=e;return s=>{if(i()||ahn(s.canonicalMessages.at(-1)))return;let o=s.phase==="initial"?n:ohn(s,t);if(!(!o||s.phase==="initial"&&_qi(s.canonicalMessages,o)||!kY(s,o,r)))return o?{type:"appendMessage",reason:Og,message:o,...s.phase==="initial"?{placement:"before-current-user"}:{}}:void 0}}function ohn(e,t){if(t.undeliveredTotal===0||t.tasks.length===0)return;let n=zde(e.canonicalMessages);if(!(!n.hasBackgroundState||n.observedTerminalCount!==void 0&&t.terminalTotal>n.observedTerminalCount)&&n.assistantIterationsSinceReminder<th)return;let i={version:1,tasks:t.tasks,undeliveredTotal:t.undeliveredTotal,queuedTotal:t.undeliveredTotal-t.tasks.length,terminalTotal:t.terminalTotal,cadence:{assistantIterationsBeforeReminder:n.assistantIterationsSinceReminder}};return{role:"custom",customType:Og,content:Xqe(i),display:!1,details:i,timestamp:Date.now()}}function Eqi(e){return Object.freeze({tasks:Object.freeze(e.tasks.map(t=>Object.freeze({...t}))),undeliveredTotal:e.undeliveredTotal,terminalTotal:e.terminalTotal})}function _qi(e,t){return e.some(n=>n!==null&&typeof n=="object"&&!Array.isArray(n)&&Reflect.get(n,"role")==="custom"&&Reflect.get(n,"customType")===Og&&Reflect.get(n,"timestamp")===t.timestamp)}function ahn(e){return vI(e)!==void 0}var chn="mcp_tool_result_artifact";var ppe=class{options;defaultMaxInlineBytes;constructor(t){this.options=t,this.defaultMaxInlineBytes=Cqi(t.maxInlineBytes,"maxInlineBytes")}finalize=async t=>{let n=Rze(t.toolContext.result.details);if(!n||!Object.prototype.hasOwnProperty.call(n,"mcp"))return;let r=n.mcp;if(Iqi(r))return;let i;try{let l=JSON.stringify(r);if(l===void 0)return;i=l}catch(l){this.log(t,{outcome:"fallback",maxInlineBytes:this.readMaxInlineBytes(),reason:lhn(l)});return}let s=Buffer.byteLength(i),o=this.readMaxInlineBytes();if(s<=o)return;let a={sessionId:t.sessionId,turnId:t.turnId,agentName:t.agentName,workspaceDir:t.workspaceDir,toolCallId:t.toolContext.toolCall.id,toolName:t.toolContext.toolCall.name,args:t.toolContext.args,text:i,originalBytes:s,sensitive:!0};try{let l=await this.options.writeArtifact(a);return this.log(t,{outcome:"externalized",originalBytes:s,maxInlineBytes:o,artifactReadFormat:dpe(l.metadata,"read_format")}),{details:{...n,mcp:Sqi(l,s)}}}catch(l){this.log(t,{outcome:"fallback",originalBytes:s,maxInlineBytes:o,reason:lhn(l)});return}};readMaxInlineBytes(){try{let t=this.options.getMaxInlineBytes?.();return uhn(t)?t:this.defaultMaxInlineBytes}catch{return this.defaultMaxInlineBytes}}log(t,n){try{let r={event:"mcp_tool_result_detail_budget_decision",session_id:t.sessionId,turn_id:t.turnId,tool_name:t.toolContext.toolCall.name,outcome:n.outcome,...n.originalBytes===void 0?{}:{original_bytes:n.originalBytes},max_inline_bytes:n.maxInlineBytes,...n.artifactReadFormat?{artifact_read_format:n.artifactReadFormat}:{},...n.reason?{reason:n.reason}:{}};this.options.logger?.[n.outcome==="fallback"?"error":"info"]?.(r,"[local-runtime-v2] MCP ToolResult detail budget")}catch{}}};function Sqi(e,t){let n=dpe(e.metadata,"read_format"),r=dpe(e.metadata,"content_sha256"),i=dpe(e.metadata,"raw_reference");return{kind:chn,version:1,externalized:!0,reference:e.reference,original_bytes:t,content_type:"application/json",...n?{read_format:n}:{},...r?{content_sha256:r}:{},...i?{raw_reference:i}:{}}}function Iqi(e){let t=Rze(e);return t?.kind===chn&&t.version===1&&t.externalized===!0&&typeof t.reference=="string"&&t.reference.length>0}function dpe(e,t){let n=e?.[t];return typeof n=="string"&&n.length>0?n:void 0}function Rze(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Cqi(e,t){if(!uhn(e))throw new TypeError(`McpToolResultHistoryExternalizer: ${t} must be a positive integer`);return e}function uhn(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}function lhn(e){let t=Rze(e);if(typeof t?.code=="string"){let n=t.code.trim();if(n)return n}return e instanceof Error&&e.name.trim()?e.name.trim():"unknown_error"}function wqi(e){return Aze(e)}function vqi(e,t){let{preparation:n}=e;return new kce({buildAgentConfig:async r=>{let i=await eB(e.agents,r);if(!i)throw new Error(`Session title Agent not found: ${r.agentName}`);return n.buildAgentConfig({session:r,agent:i,isSessionFirstTurn:!0})},resolveModel:async r=>{let i=await n.resolveModel(r),s=i.streamFn;return{model:i.model,...i.apiKey?{apiKey:i.apiKey}:{},...i.headers?{headers:i.headers}:{},...i.thinkingLevel?{thinkingLevel:i.thinkingLevel}:{},...s?{stream:(o,a,l)=>s(o,mpe(a),l)}:{}}},stream:(r,i,s)=>Ol(r,mpe(i),s),...t?{nowMs:t}:{}})}function Tqi(e,t){let{preparation:n}=e;return new Cce({buildAgentConfig:async r=>{let i=await eB(e.agents,r);if(!i)throw new Error(`Archive title Agent not found: ${r.agentName}`);return n.buildAgentConfig({session:r,agent:i,isSessionFirstTurn:!1})},resolveModel:async r=>{let i=await n.resolveModel(r),s=i.streamFn;return{model:i.model,...i.apiKey?{apiKey:i.apiKey}:{},...i.headers?{headers:i.headers}:{},...i.thinkingLevel?{thinkingLevel:i.thinkingLevel}:{},...s?{stream:(o,a,l)=>s(o,mpe(a),l)}:{}}},review:e.safety.review,stream:(r,i,s)=>Ol(r,mpe(i),s),...t?{nowMs:t}:{}})}function xqi(e){return{isSideSession:async t=>{let n=await e.sessions.execution.getExecutionSnapshot(t);return n?n.purpose!=="peek_btw_session"&&tce(n):!1}}}async function kqi(e){let t=mhn(e.product.eventObserver,e.eventObserver),n=new lpe,r=Nqi(e),i=Bqi(e),s=new spe({writeArtifact:u=>r.write(u),logger:e.product.runner.logger,getConfig:i}),o=Rqi(e,r,i),a=Uqi([qqe({maxInlineBytes:e2.maxInlineKiB*1024,getMaxInlineBytes:()=>i().maxInlineBytes,fallbackPreviewBytes:2*1024,writeArtifact:async u=>{let c=i().maxInlineBytes??e2.maxInlineKiB*1024,d=await r.write(u);return dhn(e.product.runner.logger,{input:u,maxInlineBytes:c,outcome:"externalized",artifactReadFormat:d.metadata?.read_format}),d},onArtifactError:(u,c)=>dhn(e.product.runner.logger,{input:c,maxInlineBytes:i().maxInlineBytes??e2.maxInlineKiB*1024,outcome:"fallback",reason:Mqi(u)})})],e.product.normalExtensions,e.normalExtensions),l=await gze({sessions:{get:u=>e.sessions.sessions.execution.getExecutionSnapshot(u)},planDocuments:e.sessions.planDocuments,agents:e.product.agents,...Fqi(e.product),turnRuntimeFacts:e.product.turnRuntimeFacts,preparation:e.preparation,toolCatalog:{resolveSources:async u=>{let c=await Gqi(e.sessions,u);return e.product.toolSources.resolve({session:c,turnId:u.turnId,resourceAgentName:u.resourceAgentName,...u.builtinCapabilities?{builtinCapabilities:u.builtinCapabilities}:{},toolsDisabled:process.env.MAVIS_LOCAL_RUNTIME_DISABLE_TOOLS==="1",cuModeActive:u.cuModeActive,...u.agentMemoryEnabled===void 0?{}:{agentMemoryEnabled:u.agentMemoryEnabled},...u.agentMemoryReadNames===void 0?{}:{agentMemoryReadNames:u.agentMemoryReadNames},...u.allowedSkillNames===void 0?{}:{allowedSkillNames:u.allowedSkillNames},...u.allowedExtensionSkillNames===void 0?{}:{allowedExtensionSkillNames:u.allowedExtensionSkillNames},...u.desktopCapabilities?{desktopCapabilities:u.desktopCapabilities}:{}})},config:e.product.preparation.configBuilder.config().mcpToolSearch,env:process.env},inputPreparation:e.product.inputPreparation,permission:{...e.product.permission,sideSessions:xqi(e.sessions)},runner:{...e.product.runner,reviewContent:e.safety.review},...jqi(e.toolPolicyGuard),executor:{...e.product.executor,backgroundCadenceReminder:shn(n),fileApi:{uploadStores:Kfn({db:e.db,...e.nowMs?{nowMs:e.nowMs}:{}}),...e.product.fileApi?.fetchImpl?{fetchImpl:e.product.fileApi.fetchImpl}:{},...e.product.fileApi?.logger?{logger:e.product.fileApi.logger}:{}},attemptRecall:e.sessions.agentProjection.attemptRecall,...e.nowMs?{nowMs:e.nowMs}:{},cliProductPolicy:e.cliProductPolicy,tuiProductPolicy:e.tuiProductPolicy,contentReviewEnabled:e.contentReviewEnabled,finalizeToolResultForHistory:o.finalize,resolvePluginHookRuntimeContext:u=>{let c=e.product.preparation.configBuilder.config();return{transcriptPath:PD(c.dataDir,u).messages,permissionMode:c.permissionMode}},preparePluginHookSessionOwnership:e.pluginHookSessionOwnership.prepare,activatePluginHookSessionOwnership:e.pluginHookSessionOwnership.activate,afterCompactionBeforeLlmCallHooks:[Yfn(),ihn(n)],onSteeringConsumed:e.onSteeringConsumed,onInputReviewResolved:e.onInputReviewResolved,resolveLlmRetry:e.resolveLlmRetry,...e.outputTokenCap?{outputTokenCap:e.outputTokenCap}:{}},...$qi(a),turnControl:e.turnControl,...e.turnCapabilities?{turnCapabilities:e.turnCapabilities}:{},...e.assemblyObserver?{assemblyObserver:e.assemblyObserver}:{},canonicalHistory:zqi(e.sessions.canonicalHistory,e.sessions.sessions.historyMutation),compaction:{...Dqi({contextUsageAnchor:n,checkpointState:e.product.checkpointState,logger:e.product.runner.logger,toolResultArchiver:s,promptSnapshots:e.product.promptSnapshots}),control:e.turnControl,lifecycle:e.sessions.agentProjection.compactionLifecycle,observer:e.sessions.agentProjection.compactionObserver,...e.product.runner.metricsClient?{metricsClient:e.product.runner.metricsClient}:{},usageAnchor:n},usage:{projector:e.sessions.usage.projector,onFailure:({sessionId:u,error:c})=>{e.product.executor.reportFailure?.(u,`agent_usage_projection_failed:${phn(c)}`)}},events:{projectors:{session:e.sessions.agentProjection.session,messages:Qqi(e.sessions.agentProjection.messages,e.contextUsageProjection),stream:e.sessions.agentProjection.stream,turnFacts:e.turnFacts},historyFailures:e.sessions.agentProjection.historyFailures,...t?{observer:t}:{},onObservationFailure:({sessionId:u,error:c})=>{e.product.executor.reportFailure?.(u,`agent_event_observation_failed:${phn(c)}`)}},isRuntimeErrorRetryable:rhn});return{host:new qW(l),lifecycle:l.lifecycle}}function Rqi(e,t,n){return new ppe({maxInlineBytes:e2.mcpDetailsMaxInlineKiB*1024,getMaxInlineBytes:()=>n().mcpDetailsMaxInlineBytes,writeArtifact:r=>t.write(r),logger:e.product.runner.logger})}function Nqi(e){return new upe({resolveSessionReportsDirectory:t=>e.sessions.artifacts.ensureReportsDirectory(t)})}function Dqi(e){return{automatic:new cpe(e.contextUsageAnchor,e.checkpointState,e.logger,{toolResultArchiver:e.toolResultArchiver,promptSnapshots:e.promptSnapshots}),manual:new npe(e.checkpointState,e.logger,e.promptSnapshots)}}function Bqi(e){let t=nHe(Pqi(e)),n={enabled:t.enabled,maxInlineBytes:t.maxInlineKiB*1024,mcpDetailsMaxInlineBytes:t.mcpDetailsMaxInlineKiB*1024,watermarkBytes:t.watermarkKiB*1024,minSavingsBytes:t.minSavingsKiB*1024,minCandidateBytes:t.minCandidateKiB*1024};return()=>{let r=Lqi(e.getToolResultCompactionConfig);return{enabled:typeof r?.enabled=="boolean"?r.enabled:n.enabled,maxInlineBytes:RY(r?.maxInlineBytes)??n.maxInlineBytes,mcpDetailsMaxInlineBytes:RY(r?.mcpDetailsMaxInlineBytes)??n.mcpDetailsMaxInlineBytes,watermarkBytes:RY(r?.watermarkBytes)??n.watermarkBytes,minSavingsBytes:RY(r?.minSavingsBytes)??n.minSavingsBytes,minCandidateBytes:RY(r?.minCandidateBytes)??n.minCandidateBytes}}}function dhn(e,t){try{let{input:n,maxInlineBytes:r,outcome:i,artifactReadFormat:s,reason:o}=t,a={event:"tool_output_budget_decision",session_id:n.sessionId,turn_id:n.turnId,tool_name:n.toolName,outcome:i,original_bytes:n.originalBytes,max_inline_bytes:r,...typeof s=="string"&&s.trim()?{artifact_read_format:s.trim()}:{},...o?{reason:o}:{}};e?.[i==="fallback"?"error":"info"]?.(a,"[local-runtime-v2] Tool output budget")}catch{}}function Mqi(e){return Oqi(e)&&typeof e.code=="string"&&e.code.trim()?e.code.trim():e instanceof Error&&e.name.trim()?e.name.trim():"unknown_error"}function Oqi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pqi(e){try{return e.product.preparation.configBuilder.config().toolResultCompaction}catch{return}}function Lqi(e){try{return e?.()}catch{return}}function RY(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function Fqi(e){return{...e.promptSnapshots?{promptSnapshots:e.promptSnapshots}:{},...e.internalTurnPromptReads?{internalTurnPromptReads:e.internalTurnPromptReads}:{}}}function Qqi(e,t){return t?{async projectRuntimeEvent(n){let r=await e.projectRuntimeEvent(n);return await t.projectRuntimeEvent(n),r},projectHistoryCommitted:n=>e.projectHistoryCommitted(n)}:e}function Uqi(e,t,n){let r=[...t??[],...n??[]],i=new Set(e.map(o=>o.id)),s=[...r.filter(o=>!i.has(o.id)),...e];return s.length>0?s:void 0}function jqi(e){return e?{toolPolicyGuard:e}:{}}function $qi(e){return e?{normalExtensions:e}:{}}function mhn(...e){let t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:{observeRuntimeEvent:n=>Nze(t,r=>r.observeRuntimeEvent?.(n)),observeHistoryCommitted:n=>Nze(t,r=>r.observeHistoryCommitted?.(n)),observeHistoryFailure:n=>Nze(t,r=>r.observeHistoryFailure?.(n))}}function qqi(e){return t=>{t.scope!=="title"&&e({type:"session.llm_retry",payload:{schemaVersion:1,...t}})}}async function Nze(e,t){let r=(await Promise.allSettled(e.map(i=>t(i)))).flatMap(i=>i.status==="rejected"?[i.reason]:[]);if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Agent event observers failed")}async function Gqi(e,t){let n=await e.sessions.repository.get(t.sessionId);if(!n||n.agentName!==t.agentName||n.workspaceDir!==t.workspaceDir)throw new Error(`AgentHost tool source Session mismatch: ${t.sessionId}`);return n}function zqi(e,t){return{read:async n=>{let r=await e.read(n);return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector}},readActive:async n=>{let r=await e.readActive(n);return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector}},append:n=>e.append(Dze(n)),replace:n=>e.replace(Dze(n)),compact:async n=>{let r=Dze(n);if(r.reason!=="replaceMessages"||r.operation.kind!=="compaction")throw new TypeError("Typed canonical compaction requires a compaction operation.");let i=pun(r.metadata);if(!i)throw new TypeError("Canonical compaction metadata is invalid.");let s={...r,reason:"replaceMessages",operation:{id:r.operation.id,kind:"compaction"},compactionId:i.compactionId,summary:i.summary,...i.currentUserSourceIndex===void 0?{}:{currentUserSourceIndex:i.currentUserSourceIndex}};if(i.method!=="llm_checkpoint"){await e.compact({...s,method:i.method,replacementSourceIndexes:i.replacementSourceIndexes});return}await e.compact({...s,method:i.method})},settleTurnTail:async n=>{if(!t.settleTurnTail)throw new TypeError("SessionSystem settleTurnTail capability is unavailable.");let r=await t.settleTurnTail({sessionId:n.sessionId,turnId:n.turnId,operationId:n.operation.id,mode:n.mode,approvedContent:n.approvedContent});return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector,status:r.status,deletedMessageIds:r.deletedMessageIds}},retractTurn:async n=>{if(!t.retractTurn)throw new TypeError("SessionSystem retractTurn capability is unavailable.");let r=await t.retractTurn({sessionId:n.sessionId,turnId:n.turnId,operationId:n.operation.id,reason:n.reason});return Ly(r.messages),{revision:r.revision,messages:r.messages,identityVector:r.identityVector,status:r.status,deletedMessageIds:r.deletedMessageIds}}}}function Dze(e){if(!e.operation)throw new TypeError("Canonical history operation is required.");return{...e,operation:e.operation}}function mpe(e){return{systemPrompt:e.systemPrompt,messages:e.messages.map(t=>({...t})),...e.tools?{tools:[...e.tools]}:{}}}function phn(e){return e instanceof Error?e.message:String(e)}var Hqi=["local-task:","local-background-task:","team-plan:"];function Vqi(e,t){return e.sessionKind==="task"||e.sessionType==="branch"&&!!e.parentSessionId&&e.visibility==="hidden"&&Hqi.some(r=>e.purpose?.startsWith(r))?"task-child":t==="cli"||t==="tui"?"cli":"interactive"}export{Obe as a,PCt as b,eGn as c,dss as d,Ass as e,yss as f,Q8 as g,bss as h,bnt as i,yO as j,kss as k,Vr as l,zC as m,Zqi as n,eGi as o,aGi as p,kgn as q,lGi as r,hGi as s,kHt as t,ch as u,VY as v,AGi as w,yGi as x,bGi as y,lAn as z,EGi as A,$3 as B,qui as C,TD as D,Kui as E,Ol as F,s_e as G,u0 as H,Qw as I,YO as J,T0 as K,fX as L,jw as M,I$ as N,Sw as O,d2t as P,ZQt as Q,Wvo as R,ete as S,Io as T,Pr as U,ti as V,TRe as W,NRe as X,ya as Y,NR as Z,Pu as _,lg as $,nE as aa,DR as ba,lz as ca,DOr as da,fte as ea,cPr as fa,gte as ga,H2t as ha,mz as ia,wUe as ja,Udi as ka,ze as la,me as ma,Tv as na,mt as oa,Lu as pa,iE as qa,bc as ra,oi as sa,lu as ta,oE as ua,vn as va,cn as wa,mm as xa,Jt as ya,Et as za,Ii as Aa,br as Ba,Uc as Ca,Rv as Da,IRo as Ea,UL as Fa,fn as Ga,Ft as Ha,RD as Ia,zc as Ja,$Ue as Ka,ODe as La,cjt as Ma,LS as Na,FS as Oa,LDe as Pa,cQ as Qa,uQ as Ra,Nta as Sa,Z3 as Ta,Knn as Ua,nje as Va,Lle as Wa,rje as Xa,MD as Ya,PD as Za,wra as _a,$D as $a,qa as ab,wt as bb,VE as cb,Nn as db,wc as eb,Qo as fb,Xle as gb,io as hb,ece as ib,lsn as jb,lt as kb,Asa as lb,UT as mb,GD as nb,zD as ob,ysa as pb,bsa as qb,cW as rb,Bsa as sb,Soa as tb,eUt as ub,tUt as vb,X2t as wb,_Pr as xb,iUt as yb,Z2t as zb,bs as Ab,wFr as Bb,gne as Cb,XL as Db,jt as Eb,li as Fb,N as Gb,BHe as Hb,MHe as Ib,OHe as Jb,SB as Kb,PHe as Lb,LHe as Mb,FHe as Nb,cAn as Ob,dAn as Pb,pAn as Qb,TGi as Rb,a$r as Sb,l$r as Tb,p$r as Ub,m$r as Vb,KUt as Wb,g$r as Xb,AMe as Yb,vce as Zb,qg as _b,xon as $b,Pi as ac,Tla as bc,xla as cc,kla as dc,yW as ec,qt as fc,Uo as gc,BI as hc,$la as ic,YD as jc,Tm as kc,dca as lc,vQ as mc,ean as nc,Pca as oc,aqe as pc,Jr as qc,cqe as rc,Oy as sc,lda as tc,ZT as uc,_xi as vc,NQ as wc,Dxi as xc,Rpa as yc,nh as zc,j0i as Ac,X0i as Bc,oRi as Cc,aRi as Dc,lRi as Ec,cRi as Fc,bue as Gc,gRi as Hc,YRi as Ic,Cue as Jc,ZRi as Kc,k$r as Lc,OGr as Mc,PGr as Nc,LGr as Oc,FGr as Pc,QGr as Qc,UGr as Rc,jGr as Sc,$Gr as Tc,qGr as Uc,Ore as Vc,Ag as Wc,Pse as Xc,U1e as Yc,h5t as Zc,uF as _c,Pe as $c,yQe as ad,bQe as bd,EQe as cd,_Qe as dd,xni as ed,YQe as fd,Oni as gd,i2 as hd,UHe as id,CB as jd,wB as kd,YHe as ld,KYe as md,SUo as nd,tie as od,MH as pd,fN as qd,e4t as rd,M1 as sd,wUo as td,c4t as ud,hie as vd,O3r as wd,JLe as xd,a1e as yd,A8o as zd,mae as Ad,kXt as Bd,SI as Cd,T3 as Dd,h2e as Ed,GXt as Fd,y2e as Gd,jC as Hd,Ui as Id,of as Jd,yae as Kd,_2e as Ld,S2e as Md,Rae as Nd,dai as Od,pai as Pd,Hae as Qd,z2e as Rd,Qai as Sd,JJo as Td,C7o as Ud,w7o as Vd,eye as Wd,ub as Xd,x3 as Yd,gUe as Zd,AUe as _d,Uui as $d,OXo as ae,PXo as be,nZo as ce,rde as de,xn as ee,n_ as fe,r_ as ge,kp as he,aLi as ie,lLi as je,qEa as ke,Spn as le,Cpn as me,WEa as ne,mLi as oe,kpn as pe,jGe as qe,HGe as re,PQi as se,s_ as te,wqi as ue,vqi as ve,Tqi as we,kqi as xe,mhn as ye,qqi as ze,Vqi as Ae,kHe as Be,r2 as Ce};