@maincode-ai/matilda-code 0.21.2 → 0.21.3
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/README.md +7 -0
- package/chunks/{agent-B4THN25M.js → agent-WBKEN3MM.js} +1 -1
- package/chunks/{agent-headless-CR55Q5QA.js → agent-headless-OJM6RWIA.js} +1 -1
- package/chunks/{anthropicContentGenerator-GW3P6NLQ.js → anthropicContentGenerator-EFVV6ZTA.js} +1 -1
- package/chunks/{chunk-CFBZKYFB.js → chunk-6QP5C76Y.js} +52 -52
- package/chunks/{chunk-MAQJCFZU.js → chunk-7LNKXNEZ.js} +526 -517
- package/chunks/{chunk-GIIMOLLN.js → chunk-C2ZWB2NT.js} +1 -1
- package/chunks/{chunk-NUJ63BIE.js → chunk-DBSJNFFU.js} +1 -1
- package/chunks/{chunk-SS5WUOSJ.js → chunk-FT76AZPN.js} +1 -1
- package/chunks/chunk-FU2PKCG5.js +108 -0
- package/chunks/{chunk-QEUJHX22.js → chunk-IZ6YBZWM.js} +13 -13
- package/chunks/{chunk-M3G4PG2T.js → chunk-JDXISO3F.js} +4 -4
- package/chunks/chunk-MJEXA2MA.js +8 -0
- package/chunks/chunk-MTMU7JYZ.js +11 -0
- package/chunks/chunk-SDTWBD62.js +8 -0
- package/chunks/{chunk-JEDNTIM3.js → chunk-ZYW5GLYY.js} +1 -1
- package/chunks/{computer-use-STZBQBFP.js → computer-use-MCXFHFTP.js} +1 -1
- package/chunks/{contextCommand-LB5MHXJY.js → contextCommand-G4LS5GW6.js} +1 -1
- package/chunks/edit-KNZAPSGJ.js +39 -0
- package/chunks/{enter-worktree-V6TA7IPP.js → enter-worktree-LJ66TFYR.js} +1 -1
- package/chunks/{enterPlanMode-KQCLOC2K.js → enterPlanMode-P6EIGU3Y.js} +1 -1
- package/chunks/{exit-worktree-B3SWF6PM.js → exit-worktree-QVQ3TLW5.js} +1 -1
- package/chunks/{exitPlanMode-7OHF37SX.js → exitPlanMode-I7SGPSG4.js} +1 -1
- package/chunks/{geminiContentGenerator-6VRAJ3BI.js → geminiContentGenerator-SBVCQ423.js} +1 -1
- package/chunks/{glob-ZAZPTZD5.js → glob-F5YOX6YA.js} +1 -1
- package/chunks/{grep-DNYRXQWA.js → grep-UOIHSM5U.js} +1 -1
- package/chunks/{matildaAgentContentGenerator-S26H4H3W.js → matildaAgentContentGenerator-EIQI4YCP.js} +10 -10
- package/chunks/{matildaContentGenerator-UFATU4UK.js → matildaContentGenerator-QMMGDPIK.js} +1 -1
- package/chunks/{monitor-HQXCJQ3M.js → monitor-GDKHPTET.js} +1 -1
- package/chunks/notebook-edit-LWH7H4WX.js +17 -0
- package/chunks/{openaiContentGenerator-XAPZXISY.js → openaiContentGenerator-TNZ6SB7H.js} +1 -1
- package/chunks/{read-file-HEVXSNSO.js → read-file-URGJTANM.js} +1 -1
- package/chunks/{ripGrep-BNBRX7HQ.js → ripGrep-SL4ICAX6.js} +1 -1
- package/chunks/{scheduler-3K7OROFK.js → scheduler-EX674HYK.js} +1 -1
- package/chunks/{serve-MBVRWSOA.js → serve-FZ4FTA5D.js} +7 -7
- package/chunks/{shell-3YF6VEDO.js → shell-LLU55LCI.js} +1 -1
- package/chunks/{skill-4GKPLUND.js → skill-KSYY6BM6.js} +1 -1
- package/chunks/src-UXJDJ3RJ.js +3 -0
- package/chunks/{symbol-search-WVNUJRET.js → symbol-search-3A66G4MP.js} +1 -1
- package/chunks/{team-create-2LLJKRSY.js → team-create-7PFAVYVV.js} +1 -1
- package/chunks/{tool-search-47TA6SG4.js → tool-search-7D46IF5G.js} +1 -1
- package/chunks/{update-goal-6WDBMJ2I.js → update-goal-EUJYH23K.js} +1 -1
- package/chunks/{web-fetch-QP42GV23.js → web-fetch-UGTFUOQN.js} +1 -1
- package/chunks/{workflow-EIZTKOPX.js → workflow-2TGFLD2R.js} +2 -2
- package/chunks/write-file-DQ6NYEJ7.js +15 -0
- package/cli.js +443 -444
- package/package.json +2 -2
- package/sandbox-macos-restrictive-open.sb +22 -2
- package/chunks/chunk-I55PXD4N.js +0 -10
- package/chunks/chunk-KFULPF66.js +0 -107
- package/chunks/chunk-OCXGNAAT.js +0 -8
- package/chunks/chunk-RBG4ERTN.js +0 -11
- package/chunks/chunk-XJDC3ZQZ.js +0 -8
- package/chunks/edit-EP7HIW5W.js +0 -39
- package/chunks/notebook-edit-S63FQCCF.js +0 -17
- package/chunks/src-4XJIGVTS.js +0 -3
- package/chunks/write-file-YT7UT6TX.js +0 -15
package/chunks/edit-EP7HIW5W.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{a as V}from"./chunk-OCXGNAAT.js";import{a as X}from"./chunk-I55PXD4N.js";import{Kd as P,Ld as j,Ob as W,Sd as z,de as B,ee as y,ja as S,ke as q,le as G,oe as H}from"./chunk-MAQJCFZU.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-GIIMOLLN.js";import"./chunk-RBG4ERTN.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-SS5WUOSJ.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import"./chunk-QKYGQLWC.js";import"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import"./chunk-RNKDFE2S.js";import"./chunk-EMWHQSMS.js";import"./chunk-S4K76QPI.js";import"./chunk-KFULPF66.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-XJDC3ZQZ.js";import{Lb as $,Oa as M,_c as k,ca as O,ha as b,wc as F}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{w as U}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{i as R,p as x,q as A}from"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{A as C,C as L,Y as v,a as w,z as _}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as E}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";E();import*as m from"node:fs";import*as g from"node:path";E();var re={"\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2015":"-","\u2212":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xA0":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2007":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u202F":" ","\u205F":" ","\u3000":" "};function D(i){if(i==="")return i;let t="";for(let e of i)t+=re[e]??e;return t}var oe=[i=>i,i=>i.trimEnd()];function le(i){return D(i).trimEnd()}function K(i,t,e){if(t.length===0)return 0;if(t.length>i.length)return null;e:for(let n=0;n<=i.length-t.length;n++){for(let r=0;r<t.length;r++)if(e(i[n+r])!==e(t[r]))continue e;return n}return null}function se(i){let t=i.split(`
|
|
4
|
-
`),e=new Array(t.length+1),n=0;for(let r=0;r<t.length;r++)e[r]=n,n+=t[r].length,r<t.length-1&&(n+=1);return e[t.length]=i.length,{lines:t,offsets:e}}function Q(i,t,e,n,r,l){if(r===0)return l?`
|
|
5
|
-
`:"";let a=t[n]??0,s=n+r-1,f=(t[s]??0)+(e[s]?.length??0);if(l){let d=t[n+r];d!==void 0?f=d:i.endsWith(`
|
|
6
|
-
`)&&(f=i.length)}return i.slice(a,f)}function ae(i,t){let{lines:e,offsets:n}=se(i),r=t.split(`
|
|
7
|
-
`),l=t.endsWith(`
|
|
8
|
-
`);if(r.length===0)return null;let a=c=>{for(let f of oe){let d=K(e,c,f);if(d!==null)return d}return K(e,c,le)},s=a(r);if(s!==null)return{slice:Q(i,n,e,s,r.length,l),removedTrailingFinalEmptyLine:!1};if(r.at(-1)===""){let c=r.slice(0,-1);if(c.length===0)return null;if(s=a(c),s!==null)return{slice:Q(i,n,e,s,c.length,!1),removedTrailingFinalEmptyLine:!0}}return null}function ce(i,t){if(t==="")return null;let e=i.indexOf(t);if(e!==-1)return{slice:i.slice(e,e+t.length),removedTrailingFinalEmptyLine:!1};let n=D(i),r=D(t),l=n.indexOf(r);return l!==-1?{slice:i.slice(l,l+t.length),removedTrailingFinalEmptyLine:!1}:ae(i,t)}function fe(i){return i.endsWith(`\r
|
|
9
|
-
`)?i.slice(0,-2):i.endsWith(`
|
|
10
|
-
`)||i.endsWith("\r")?i.slice(0,-1):i}function de(i,t){return t?fe(i):i}function J(i,t,e){if(i===null||t==="")return{oldString:t,newString:e};let n=ce(i,t);return n!==null?{oldString:n.slice,newString:de(e,n.removedTrailingFinalEmptyLine)}:{oldString:t,newString:e}}function Z(i,t,e){if(i===null||t===""||e!==""||t.endsWith(`
|
|
11
|
-
`))return t;let n=`${t}
|
|
12
|
-
`;return i.includes(n)?n:t}function ee(i,t){if(t==="")return 0;let e=0,n=i.indexOf(t);for(;n!==-1;)e++,n=i.indexOf(t,n+t.length);return e}var Y=4,ge=1e3;function te(i,t){let e=t.split(`
|
|
13
|
-
`),n=e.length;if(i===null)return{startLine:1,endLine:n,totalLines:n,content:t};if(i===t||!t)return null;let r=i.split(`
|
|
14
|
-
`),l=0,a=Math.min(r.length,e.length);for(;l<a&&r[l]===e[l];)l++;let s=r.length-1,c=e.length-1;for(;s>=l&&c>=l&&r[s]===e[c];)s--,c--;let f=l+1,d=c+1;if(d-f>ge)return null;let h=Math.max(1,f-Y),p=Math.min(n,d+Y),u=e.slice(h-1,p);return{startLine:h,endLine:p,totalLines:n,content:u.join(`
|
|
15
|
-
`)}}var ne=v("EDIT_PRIOR_READ");function ie(i,t,e,n){return n?e:i===null?t===""?e:"":t===""&&!n?i:z(i,t,e)}var ue=["filePath","filepath","path","file","filename"],pe=["oldString","oldText","old_text","previous_string","previousString"],he=["newString","newText","new_text","content"];function me(i){if(!(typeof i.file_path=="string"&&i.file_path.trim()))for(let t of ue){let e=i[t];if(typeof e=="string"&&e.trim()){i.file_path=e,delete i[t];break}}if(i.old_string===void 0||i.old_string===null){for(let t of pe)if(i[t]!==void 0&&i[t]!==null){i.old_string=i[t],delete i[t];break}}if(i.new_string===void 0||i.new_string===null){for(let t of he)if(i[t]!==void 0&&i[t]!==null){i.new_string=i[t],delete i[t];break}}(i.old_string===void 0||i.old_string===null)&&typeof i.new_string=="string"&&typeof i.file_path=="string"&&i.file_path.trim()&&(i.old_string="",i.full_file_replace=!0)}var N=class{constructor(t,e){this.config=t;this.params=e}toolLocations(){return[{path:this.params.file_path}]}async calculateEdit(t){let e=t.replace_all??!1,n=null,r=await b(t.file_path),l=!1,a=t.new_string,s=t.old_string,c=0,f,d=!1,h="utf-8",p="lf";if(!this.config.getFileReadCacheDisabled()){let o=await y(this.config.getFileReadCache(),t.file_path,"editing");if(!o.ok)return{currentContent:null,newContent:"",occurrences:0,error:{display:o.displayMessage,raw:o.rawMessage,type:o.type},isNewFile:!1,encoding:"utf-8",bom:!1,lineEnding:"lf"}}if(r)try{let o=await this.config.getFileSystemService().readTextFile({path:t.file_path});o._meta?.bom!==void 0?d=o._meta.bom:d=o.content.length>0&&o.content.codePointAt(0)===65279,h=o._meta?.encoding||"utf-8",p=H(o.content),n=o.content.replace(/\r\n/g,`
|
|
16
|
-
`),r=!0}catch(o){if(!w(o)||o.code!=="ENOENT")throw o;r=!1}if(r&&!this.config.getFileReadCacheDisabled()){let o=await y(this.config.getFileReadCache(),t.file_path,"editing",{expectExisting:!0});if(!o.ok)return ne.warn("post-read TOCTOU rejection",{path:t.file_path,reason:o.type}),{currentContent:null,newContent:"",occurrences:0,error:{display:o.displayMessage,raw:o.rawMessage,type:o.type},isNewFile:!1,encoding:"utf-8",bom:!1,lineEnding:"lf"}}if(t.full_file_replace)l=!r,r&&n!==null?(c=1,s=n,a=t.new_string):r||(s="",a=t.new_string);else{let o=J(n,s,a);s=o.oldString,a=o.newString,s===""&&!r?l=!0:r?n!==null?(s=Z(n,s,a),c=ee(n,s),t.old_string===""?f={display:"Failed to edit. Attempted to create a file that already exists.",raw:`File already exists, cannot create: ${t.file_path}`,type:"attempt_to_create_existing_file"}:c===0?f={display:"Failed to edit, could not find the string to replace.",raw:`Failed to edit, 0 occurrences found for old_string in ${t.file_path}. No edits made. The exact text in old_string was not found. Ensure you're not escaping content incorrectly and check whitespace, indentation, and context. Use ${F.Name} tool to verify.`,type:"edit_no_occurrence_found"}:!e&&c>1?f={display:"Failed to edit because the text matches multiple locations. Provide more context or set replace_all to true.",raw:`Failed to edit. Found ${c} occurrences for old_string in ${t.file_path} but replace_all was not enabled.`,type:"edit_expected_occurrence_mismatch"}:s===a&&(f={display:"No changes to apply. The old_string and new_string are identical.",raw:`No changes to apply. The old_string and new_string are identical in file: ${t.file_path}`,type:"edit_no_change"})):f={display:"Failed to read content of file.",raw:`Failed to read content of existing file: ${t.file_path}`,type:"read_content_failure"}:f={display:"File not found. Cannot apply edit. Use an empty old_string to create a new file.",raw:`File not found: ${t.file_path}`,type:"file_not_found"}}let u=f?n??"":t.full_file_replace?t.new_string:ie(n,s,a,l);return!f&&r&&n===u&&(f={display:"No changes to apply. The new content is identical to the current content.",raw:`No changes to apply. The new content is identical to the current content in file: ${t.file_path}`,type:"edit_no_change"}),{currentContent:n,newContent:u,occurrences:c,error:f,isNewFile:l,bom:d,encoding:h,lineEnding:p}}async getDefaultPermission(){let t=this.config.getProjectRoot();return U(g.resolve(this.params.file_path),t)?"allow":"ask"}async getConfirmationDetails(t){let e;try{e=await this.calculateEdit(this.params)}catch(a){if(t.aborted)throw a;let s=a instanceof Error?a.message:String(a);throw new Error(`Error preparing edit: ${s}`)}if(e.error)throw new B(e.error.raw,e.error.type);let n=g.basename(this.params.file_path),r=S(n,e.currentContent??"",e.newContent,"Current","Proposed",P);return{type:"edit",title:`Confirm Edit: ${_(C(this.params.file_path,this.config.getTargetDir()))}`,fileName:n,filePath:this.params.file_path,fileDiff:r,originalContent:e.currentContent,newContent:e.newContent,onConfirm:async a=>{a==="proceed_always"&&this.config.setApprovalMode("auto-edit")}}}getDescription(){let t=C(this.params.file_path,this.config.getTargetDir());return this.params.old_string===""?`Create ${_(t)}`:this.params.old_string===this.params.new_string?`No file changes to ${_(t)}`:_(t)}async execute(t){let e;try{e=await this.calculateEdit(this.params)}catch(n){if(t.aborted)throw n;let r=n instanceof Error?n.message:String(n);return{llmContent:`Error preparing edit: ${r}`,returnDisplay:`Error preparing edit: ${r}`,error:{message:r,type:"edit_preparation_failure"}}}if(e.error)return{llmContent:e.error.raw,returnDisplay:`Error: ${e.error.display}`,error:{message:e.error.raw,type:e.error.type}};try{try{await this.config.getFileHistoryService().trackEdit(this.params.file_path)}catch{}if(!this.config.getFileReadCacheDisabled()){let o=await y(this.config.getFileReadCache(),this.params.file_path,"editing",{expectExisting:!e.isNewFile});if(!o.ok)return ne.warn("pre-write TOCTOU rejection",{path:this.params.file_path,reason:o.type}),{llmContent:o.rawMessage,returnDisplay:`Error: ${o.displayMessage}`,error:{message:o.rawMessage,type:o.type}}}if(this.ensureParentDirectoriesExist(this.params.file_path),e.isNewFile){let o=this.config.getDefaultFileEncoding(),T=!1;o===q.UTF8_BOM?T=!0:o===void 0&&(T=G(this.params.file_path)),await this.config.getFileSystemService().writeTextFile({path:this.params.file_path,content:e.newContent,_meta:{bom:T}})}else await this.config.getFileSystemService().writeTextFile({path:this.params.file_path,content:e.newContent,_meta:{bom:e.bom,encoding:e.encoding,lineEnding:e.lineEnding}});this.params.modified_by_user||W.getInstance().recordEdit(this.params.file_path,e.currentContent,e.newContent);try{let o=m.statSync(this.params.file_path);this.config.getFileReadCache().recordWrite(this.params.file_path,o)}catch{}let n=g.basename(this.params.file_path),r=this.params.ai_proposed_content||e.newContent,l=j(n,e.currentContent??"",r,e.newContent),s={fileDiff:S(n,e.currentContent??"",e.newContent,"Current","Proposed",P),fileName:n,originalContent:e.currentContent,newContent:e.newContent,diffStat:l},c=O(this.params.file_path),f=M(this.params.file_path),d=g.extname(this.params.file_path),h=e.isNewFile?"create":"update";$(this.config,new k(I.Name,h,e.newContent.split(`
|
|
17
|
-
`).length,c,d,f));let p=[e.isNewFile?`Created new file: ${this.params.file_path} with provided content.`:`The file: ${this.params.file_path} has been updated.`],u=te(e.currentContent,e.newContent);if(u){let o=`Showing lines ${u.startLine}-${u.endLine} of ${u.totalLines} from the edited file:
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
${u.content}`;p.push(o)}try{let o=await X(this.config,this.params.file_path);o&&p.push(`
|
|
22
|
-
|
|
23
|
-
${o}`)}catch{}return{llmContent:p.join(" "),returnDisplay:s}}catch(n){let r=n instanceof Error?n.message:String(n);return{llmContent:`Error executing edit: ${r}`,returnDisplay:`Error writing file: ${r}`,error:{message:r,type:"file_write_failure"}}}}ensureParentDirectoriesExist(t){let e=g.dirname(t);m.existsSync(e)||m.mkdirSync(e,{recursive:!0})}},I=class i extends R{constructor(e){super(i.Name,A.EDIT,`Replaces text within a file. By default, replaces a single occurrence. Set \`replace_all\` to true when you intend to modify every instance of \`old_string\`. This tool requires providing significant context around the change to ensure precise targeting. Always use the ${F.Name} tool to examine the file's current content before attempting a text replacement.
|
|
24
|
-
|
|
25
|
-
The user has the ability to modify the \`new_string\` content. If modified, this will be stated in the response.
|
|
26
|
-
|
|
27
|
-
Expectation for required parameters:
|
|
28
|
-
1. \`file_path\` MUST be an absolute path; otherwise an error will be thrown.
|
|
29
|
-
2. \`old_string\` MUST be the exact literal text to replace (including all whitespace, indentation, newlines, and surrounding code etc.). For a full-file rewrite prefer \`${x.WRITE_FILE}\`; if you omit \`old_string\` and only pass \`new_string\`, the tool overwrites the entire file.
|
|
30
|
-
3. \`new_string\` MUST be the exact literal text to replace \`old_string\` with (also including all whitespace, indentation, newlines, and surrounding code etc.). Ensure the resulting code is correct and idiomatic.
|
|
31
|
-
4. NEVER escape \`old_string\` or \`new_string\`, that would break the exact literal text requirement.
|
|
32
|
-
**Important:** If ANY of the above are not satisfied, the tool will fail. CRITICAL for \`old_string\`: Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string matches multiple locations, or does not match exactly, the tool will fail.
|
|
33
|
-
**Multiple replacements:** Set \`replace_all\` to true when you want to replace every occurrence that matches \`old_string\`.
|
|
34
|
-
**New files:** Pass an empty \`old_string\` to create a file that does not exist yet.`,"edit",{properties:{file_path:{description:"The absolute path to the file to modify. Must start with '/'.",type:"string"},old_string:{description:"The exact literal text to replace, preferably unescaped. For single replacements (default), include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string is not the exact literal text (i.e. you escaped it) or does not match exactly, the tool will fail. Omit only when intentionally overwriting the entire file with new_string (prefer write_file for that). Empty string creates a new file when the path does not exist.",type:"string"},new_string:{description:"The exact literal text to replace `old_string` with, preferably unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic.",type:"string"},replace_all:{type:"boolean",description:"Replace all occurrences of old_string (default false)."}},required:["file_path","old_string","new_string"],type:"object"});this.config=e}static Name=x.EDIT;validateToolParams(e){return me(e),super.validateToolParams(e)}validateToolParamValues(e){if(e.file_path=L(e.file_path.trim()),!e.file_path)return"The 'file_path' parameter must be non-empty.";if(!g.isAbsolute(e.file_path))return`File path must be absolute: ${e.file_path}`;if(typeof e.new_string!="string")return"The 'new_string' parameter must be a string.";let n=V(this.config,e.file_path);return n||null}createInvocation(e){return new N(this.config,e)}toAutoClassifierInput(e){let n=e.old_string??"",r=e.new_string??"";return{file_path:e.file_path,old_string_preview:n.slice(0,300),new_string_preview:r.slice(0,300),old_string_truncated:n.length>300,new_string_truncated:r.length>300,lines_changed:(r.match(/\n/g)?.length??0)-(n.match(/\n/g)?.length??0)}}getModifyContext(e){return{getFilePath:n=>n.file_path,getCurrentContent:async n=>{if(await b(n.file_path))try{let{content:l}=await this.config.getFileSystemService().readTextFile({path:n.file_path});return l}catch(l){if(!w(l)||l.code!=="ENOENT")throw l;return""}else return""},getProposedContent:async n=>{if(n.full_file_replace)return n.new_string;if(m.existsSync(n.file_path))try{let{content:r}=await this.config.getFileSystemService().readTextFile({path:n.file_path});return ie(r,n.old_string,n.new_string,n.old_string===""&&r==="")}catch(r){if(!w(r)||r.code!=="ENOENT")throw r;return""}else return""},createUpdatedParams:(n,r,l)=>({...l,ai_proposed_content:n,old_string:n,new_string:r,modified_by_user:!0})}}};export{I as EditTool,ie as applyReplacement,me as normalizeEditToolParams};
|
|
35
|
-
/**
|
|
36
|
-
* @license
|
|
37
|
-
* Copyright 2025 Google LLC
|
|
38
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
39
|
-
*/
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{a as Z}from"./chunk-I55PXD4N.js";import{Kd as D,Ld as Y,Ob as Q,de as y,ja as R,oe as X}from"./chunk-MAQJCFZU.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-GIIMOLLN.js";import"./chunk-RBG4ERTN.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-SS5WUOSJ.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import"./chunk-QKYGQLWC.js";import"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import"./chunk-RNKDFE2S.js";import"./chunk-EMWHQSMS.js";import"./chunk-S4K76QPI.js";import"./chunk-KFULPF66.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-XJDC3ZQZ.js";import{J as B,K as k,L as U,Lb as z,M as K,N as q,O as b,P as W,Q as j,R as C,S as J,T as V,U as w,V as M,_c as H,ca as G}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as $,i as L,p as c,q as x}from"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{A as N,C as T,Y as F,z as _}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as v}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";v();import*as E from"node:fs";import*as m from"node:path";var ee=F("NOTEBOOK_EDIT");function g(d,r,t){return ee.debug("prior-read-rejected",{path:d,reason:r,type:t.type,displayMessage:t.displayMessage}),t}var u=class extends Error{constructor(t,e){super(t);this.type=e;this.name="NotebookEditError"}};function te(d,r){if(r==="delete")return"";if(typeof d!="string")throw new u(`new_source is required when edit_mode is "${r}".`,"invalid_tool_params");return d}function I(d,r){return d?q(d,r):`cell-${r}`}function oe(d,r,t){if(!r){if(t==="insert")return-1;throw new u("cell_id is required for replace and delete operations.","invalid_tool_params")}if(W(d,r))throw new u(`Cell ID "${r}" is ambiguous in the rendered notebook. Re-read the notebook and target a stable real cell ID before editing.`,"invalid_tool_params");let e=j(d,r);if(e===-1)throw new u(`Cell with ID "${r}" not found in notebook.`,"notebook_cell_not_found");return e}function ie(d,r,t,e){let o={cell_type:r,metadata:{},source:w(t,e)},i=J(d);return i&&(o.id=i),M(o,r),o}function O(d,r){let t;try{t=k(d)}catch(a){throw new u(a instanceof Error?a.message:String(a),"notebook_invalid_json")}let e=r.edit_mode??"replace",o=te(r.new_source,e),i=b(t),n=oe(t,r.cell_id,e),l=C(t),p=U(d),s=(a,f)=>{let h=e==="insert"||e==="delete";return{...f,updatedContent:K(a,p),requiresReadAfterWrite:h&&!(i&&b(a))}};switch(e){case"insert":{let a=r.cell_type??"code",f=n===-1?0:n+1,h=ie(t,a,o,V(t,f));return t.cells.splice(f,0,h),s(t,{editedCellId:I(h,f),editedCellType:a,language:l,mode:e})}case"delete":{let[a]=t.cells.splice(n,1);return s(t,{editedCellId:I(a,n),editedCellType:a?.cell_type,language:l,mode:e})}case"replace":{let a=t.cells[n];if(!a)throw new u(`Cell index ${n} is out of range.`,"notebook_cell_not_found");let f=r.cell_type??a.cell_type;return a.source=w(o,Array.isArray(a.source)),M(a,f),s(t,{editedCellId:I(a,n),editedCellType:f,language:l,mode:e})}default:throw new u(`Unsupported notebook edit mode: ${e}`,"invalid_tool_params")}}function re(d,r,t){let e,o;try{e=k(r),o=k(d)}catch(i){throw new u(i instanceof Error?i.message:String(i),"notebook_invalid_json")}return{updatedContent:r,editedCellId:t.cell_id??"user-modified-notebook",editedCellType:void 0,language:C(e),mode:t.edit_mode??"replace",requiresReadAfterWrite:!b(o)||!b(e)}}async function A(d,r,t={}){if(d.getFileReadCacheDisabled())return{ok:!0};let e;try{e=await E.promises.stat(r)}catch(i){let n=i?.code;return n==="ENOENT"?t.expectExisting?g(r,"missing-after-read",{ok:!1,type:"file_changed_since_read",rawMessage:`Notebook ${r} disappeared after it was read. Re-read it with the ${c.READ_FILE} tool before editing it.`,displayMessage:`notebook disappeared after last read; re-run ${c.READ_FILE} first.`}):{ok:!0}:g(r,"stat-failed",{ok:!1,type:"prior_read_verification_failed",rawMessage:`Could not stat ${r} to verify prior notebook read (${n??"unknown error"}). Re-read it with the ${c.READ_FILE} tool before editing it.`,displayMessage:`cannot verify prior read of ${r}; re-run ${c.READ_FILE} before editing this notebook.`})}if(e.isDirectory())return g(r,"target-is-directory",{ok:!1,type:"target_is_directory",rawMessage:`${r} is a directory. The NotebookEdit tool only operates on .ipynb files.`,displayMessage:"path is a directory; cannot edit as a notebook."});if(!e.isFile())return g(r,"target-not-regular-file",{ok:!1,type:"target_not_regular_file",rawMessage:`${r} is not a regular file. The NotebookEdit tool only operates on .ipynb files.`,displayMessage:"special file; cannot edit as a notebook."});let o=d.getFileReadCache().check(e);return o.state==="fresh"&&o.entry.lastReadAt!==void 0&&o.entry.lastReadWasFull?{ok:!0}:o.state==="fresh"&&o.entry.lastReadAt!==void 0&&!o.entry.lastReadWasFull?g(r,"truncated-cache-entry",{ok:!1,type:"edit_requires_prior_read",rawMessage:`Notebook ${r} is too large for cell-level editing because its rendered output was truncated when read. Reduce the notebook output size or split the notebook before editing cells.`,displayMessage:"notebook too large for cell-level editing."}):o.state==="stale"?g(r,"stale-cache-entry",{ok:!1,type:"file_changed_since_read",rawMessage:`Notebook ${r} has been modified since you last read it. Re-read it with the ${c.READ_FILE} tool before editing it.`,displayMessage:`notebook changed since last read; re-run ${c.READ_FILE} first.`}):g(r,`cache-${o.state}`,{ok:!1,type:"edit_requires_prior_read",rawMessage:`Notebook ${r} has not been fully read in this session. Use the ${c.READ_FILE} tool first, without offset or limit, before editing cells.`,displayMessage:`${c.READ_FILE} required before editing this notebook.`})}var P=class extends ${constructor(t,e,o){super(e);this.config=t;this.modifyMetadata=o}toolLocations(){return[{path:this.params.notebook_path}]}getDescription(){let t=N(this.params.notebook_path,this.config.getTargetDir()),e=this.params.edit_mode??"replace",o=this.params.cell_id??"beginning";return`${e} notebook cell ${o} in ${_(t)}`}async getDefaultPermission(){return"ask"}async getConfirmationDetails(t){let e=await this.prepareEdit(t),o=m.basename(this.params.notebook_path),i=R(o,e.originalContent,e.updatedContent,"Current","Proposed",D);return{type:"edit",title:`Confirm Notebook Edit: ${_(N(this.params.notebook_path,this.config.getTargetDir()))}`,fileName:o,filePath:this.params.notebook_path,fileDiff:i,originalContent:e.originalContent,newContent:e.updatedContent,onConfirm:async l=>{l==="proceed_always"&&this.config.setApprovalMode("auto-edit")}}}async prepareEdit(t){let e=await A(this.config,this.params.notebook_path);if(!e.ok)throw new y(e.rawMessage,e.type);let o,i=!1,n,l="lf";try{let s=await this.config.getFileSystemService().readTextFile({path:this.params.notebook_path});o=s.content,i=s._meta?.bom??!1,n=s._meta?.encoding,l=s._meta?.lineEnding??X(s.content)}catch(s){throw t.aborted?s:s?.code==="ENOENT"?new y(`Notebook file not found: ${this.params.notebook_path}`,"file_not_found"):new y(`Error reading notebook: ${s instanceof Error?s.message:String(s)}`,"read_content_failure")}let p=await A(this.config,this.params.notebook_path,{expectExisting:!0});if(!p.ok)throw new y(p.rawMessage,p.type);try{return this.modifyMetadata?.modifiedNotebookContent!==void 0?{...re(o,this.modifyMetadata.modifiedNotebookContent,this.params),originalContent:o,bom:i,encoding:n,lineEnding:l}:{...O(o,this.params),originalContent:o,bom:i,encoding:n,lineEnding:l}}catch(s){throw s instanceof u?new y(s.message,s.type):s}}async execute(t){let e;try{e=await this.prepareEdit(t)}catch(o){if(t.aborted)throw o;let i=o instanceof y?o.errorType:"notebook_edit_failure",n=o instanceof Error?o.message:String(o);return{llmContent:n,returnDisplay:`Error: ${n}`,error:{message:n,type:i}}}try{try{await this.config.getFileHistoryService().trackEdit(this.params.notebook_path)}catch{}let o=await A(this.config,this.params.notebook_path,{expectExisting:!0});if(!o.ok)return{llmContent:o.rawMessage,returnDisplay:`Error: ${o.displayMessage}`,error:{message:o.rawMessage,type:o.type}};await this.config.getFileSystemService().writeTextFile({path:this.params.notebook_path,content:e.updatedContent,_meta:{bom:e.bom,encoding:e.encoding,lineEnding:e.lineEnding}}),this.modifyMetadata?.modifiedByUser||Q.getInstance().recordEdit(this.params.notebook_path,e.originalContent,e.updatedContent);try{let a=E.statSync(this.params.notebook_path),f=this.config.getFileReadCache();e.requiresReadAfterWrite?f.invalidate(a):f.recordWrite(this.params.notebook_path,a,{cacheable:!1})}catch(a){ee.warn(`[NotebookEdit] post-write cache update failed for ${this.params.notebook_path}: ${a instanceof Error?a.message:String(a)}`)}let i=m.basename(this.params.notebook_path),n=R(i,e.originalContent,e.updatedContent,"Current","Proposed",D),l=Y(i,e.originalContent,this.modifyMetadata?.aiProposedContent??e.updatedContent,e.updatedContent);z(this.config,new H(S.Name,"update",e.updatedContent.split(`
|
|
4
|
-
`).length,G(this.params.notebook_path),".ipynb",e.language));let p={fileDiff:n,fileName:i,originalContent:e.originalContent,newContent:e.updatedContent,diffStat:l},s=this.modifyMetadata?.modifiedNotebookContent!==void 0?`Notebook ${this.params.notebook_path} has been updated. Notebook content was modified by the user before approval; the final saved notebook may differ from the original ${e.mode} cell ${e.editedCellId} proposal.`:`Notebook ${this.params.notebook_path} has been updated. ${e.mode} cell ${e.editedCellId}.${e.mode==="delete"?"":`
|
|
5
|
-
|
|
6
|
-
Updated source:
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
${B(this.params.new_source??"")}`}`;try{let a=await Z(this.config,this.params.notebook_path);a&&(s+=`
|
|
11
|
-
|
|
12
|
-
${a}`)}catch{}return{llmContent:s,returnDisplay:p,resultFilePaths:[this.params.notebook_path]}}catch(o){let i=o instanceof Error?o.message:String(o);return{llmContent:`Error writing notebook: ${i}`,returnDisplay:`Error writing notebook: ${i}`,error:{message:i,type:"file_write_failure"}}}}},S=class d extends L{constructor(t){super(d.Name,x.NOTEBOOK_EDIT,`Edits a Jupyter notebook (.ipynb) safely at the cell level. Use this instead of ${c.EDIT} or ${c.WRITE_FILE} for notebook cells. Supports replacing, inserting, and deleting cells. Always read the notebook first with ${c.READ_FILE}; then use the cell IDs shown in that output.`,"edit",{properties:{notebook_path:{description:"Absolute path to the Jupyter notebook file to edit. Must end with .ipynb.",type:"string"},cell_id:{description:"Target cell ID from read_file output, or cell-N 0-based fallback. Required for replace and delete. For insert, the new cell is inserted after this cell; if omitted, inserted at the beginning.",type:"string"},new_source:{description:"New source content for replace and insert operations. Not required for delete.",type:"string"},cell_type:{description:"Cell type for inserted cells or type conversion on replace.",type:"string",enum:["code","markdown"]},edit_mode:{description:"Notebook edit operation. Defaults to replace.",type:"string",enum:["replace","insert","delete"]}},required:["notebook_path"],additionalProperties:!1,type:"object"});this.config=t}static Name=c.NOTEBOOK_EDIT;modifyMetadataByParams=new WeakMap;modifyMetadataByKey=new Map;validateToolParamValues(t){if(t.notebook_path=T(t.notebook_path.trim()),!t.notebook_path)return"The 'notebook_path' parameter must be non-empty.";if(!m.isAbsolute(t.notebook_path))return`Notebook path must be absolute: ${t.notebook_path}`;if(m.extname(t.notebook_path).toLowerCase()!==".ipynb")return"File must be a Jupyter notebook (.ipynb). Use the edit tool for other file types.";let e=t.edit_mode??"replace";return["replace","insert","delete"].includes(e)?t.cell_type&&!["code","markdown"].includes(t.cell_type)?"cell_type must be 'code' or 'markdown'.":e!=="insert"&&!t.cell_id?"cell_id is required for replace and delete operations.":e!=="delete"&&typeof t.new_source!="string"?`new_source is required when edit_mode is "${e}".`:this.config.getFileService().shouldMatildaIgnoreFile(t.notebook_path)?`File path '${t.notebook_path}' is ignored by .matildaignore pattern(s).`:null:"edit_mode must be 'replace', 'insert', or 'delete'."}createInvocation(t){return new P(this.config,t,this.consumeModifyMetadata(t))}getModifyMetadataKey(t){return JSON.stringify({notebook_path:T(t.notebook_path.trim()),cell_id:t.cell_id,new_source:t.new_source,cell_type:t.cell_type,edit_mode:t.edit_mode})}rememberModifyMetadata(t,e){this.modifyMetadataByParams.set(t,e);let o=this.getModifyMetadataKey(t),i=this.modifyMetadataByKey.get(o)??[];i.push(e),this.modifyMetadataByKey.set(o,i)}consumeModifyMetadata(t){let e=this.modifyMetadataByParams.get(t);if(e)return this.modifyMetadataByParams.delete(t),this.removeQueuedModifyMetadata(t,e),e;let o=this.getModifyMetadataKey(t),i=this.modifyMetadataByKey.get(o),n=i?.shift();return i&&i.length===0&&this.modifyMetadataByKey.delete(o),n}removeQueuedModifyMetadata(t,e){let o=this.getModifyMetadataKey(t),i=this.modifyMetadataByKey.get(o);if(!i)return;let n=i.indexOf(e);n!==-1&&i.splice(n,1),i.length===0&&this.modifyMetadataByKey.delete(o)}getModifyContext(t){let e=new Map,o=async i=>{let n=e.get(i.notebook_path);if(n!==void 0)return n;let{content:l}=await this.config.getFileSystemService().readTextFile({path:i.notebook_path});return e.set(i.notebook_path,l),l};return{getFilePath:i=>i.notebook_path,getCurrentContent:async i=>o(i),getProposedContent:async i=>{let n=await o(i);return O(n,i).updatedContent},createUpdatedParams:(i,n,l)=>{let p=this.modifyMetadataByParams.get(l)?.aiProposedContent;if(p===void 0)try{p=O(i,l).updatedContent}catch{p=n}let s={...l};return this.rememberModifyMetadata(s,{aiProposedContent:p,modifiedByUser:!0,modifiedNotebookContent:n}),s}}}};export{S as NotebookEditTool,O as applyNotebookEdit};
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2026 Matilda Team
|
|
16
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
17
|
-
*/
|
package/chunks/src-4XJIGVTS.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{$ as pi,$a as pj,$b as rk,$c as ql,$d as km,$e as Um,$f as bp,$g as cq,$h as cr,$j as at,$k as au,A as Zg,Aa as Qi,Ab as Uj,Ac as Rk,Ad as Rl,Ae as wm,Ag as Dp,Ah as Fq,Ai as Ar,Aj as Bs,Ak as Bt,Al as Au,B as _g,Ba as Ri,Bb as Vj,Bc as Sk,Bd as Sl,Be as xm,Bg as Ep,Bh as Gq,Bi as Br,Bj as Cs,Bk as Ct,Bl as Bu,C as $g,Ca as Si,Cb as Wj,Cc as Tk,Cd as Tl,Ce as ym,Cg as Fp,Ch as Hq,Ci as Cr,Cj as Ds,Ck as Dt,Cl as Cu,D as ah,Da as Ti,Db as Xj,Dc as Uk,Dd as Ul,De as zm,Dg as Gp,Dh as Iq,Di as Dr,Dj as Es,Dk as Et,Dl as Du,E as bh,Ea as Ui,Eb as Yj,Ec as Vk,Ed as Vl,Ee as Am,Eg as Hp,Eh as Jq,Ei as Er,Ej as Fs,Ek as Ft,El as Eu,F as ch,Fa as Vi,Fb as Zj,Fc as Wk,Fd as Wl,Fe as Bm,Ff as Dn,Fg as Ip,Fh as Kq,Fi as Fr,Fj as Gs,Fk as Gt,Fl as Fu,G as dh,Ga as Wi,Gb as _j,Gc as Xk,Gd as Xl,Ge as Cm,Gf as En,Gg as Jp,Gh as Lq,Gi as Gr,Gj as Hs,Gk as Ht,Gl as Gu,H as eh,Ha as Xi,Hb as $j,Hc as Yk,Hd as Yl,He as Dm,Hf as Fn,Hg as Kp,Hh as Mq,Hi as Hr,Hj as Is,Hk as It,Hl as Hu,Ia as Yi,Ib as ak,Ic as Zk,Id as Zl,Ie as Em,If as Gn,Ig as Lp,Ih as Nq,Ii as Ir,Ij as Js,Ik as Jt,Il as Iu,J as fh,Ja as Zi,Jb as bk,Jc as _k,Jd as _l,Je as Fm,Jf as Hn,Jg as Mp,Jh as Oq,Ji as Jr,Jj as Ks,Jk as Kt,Jl as Ju,K as gh,Ka as _i,Kb as ck,Kc as $k,Ke as Gm,Kf as In,Kg as Np,Kh as Pq,Ki as Kr,Kj as Ls,Kk as Lt,L as hh,La as $i,Lb as dk,Lc as al,Le as Hm,Lf as Jn,Lg as Op,Lh as Qq,Li as Lr,Lj as Ms,Lk as Mt,M as ai,Ma as aj,Mb as ek,Mc as bl,Md as $l,Me as Im,Mf as Kn,Mg as Pp,Mh as Rq,Mi as Mr,Mj as Ns,Mk as Nt,N as bi,Na as bj,Nb as fk,Nc as cl,Nd as am,Ne as Jm,Nf as Ln,Ng as Qp,Nh as Sq,Ni as Nr,Nj as Os,Nk as Ot,O as ci,Oa as cj,Oc as dl,Of as Mn,Og as Rp,Oh as Tq,Oi as Or,Oj as Ps,Ok as Pt,P as di,Pa as dj,Pb as gk,Pc as el,Pf as Nn,Pg as Sp,Ph as Uq,Pi as Pr,Pj as Qs,Pk as Qt,Q as ei,Qa as ej,Qb as hk,Qc as fl,Qf as On,Qg as Tp,Qh as Vq,Qi as Qr,Qj as Rs,Qk as Rt,R as fi,Ra as fj,Rb as ik,Rc as gl,Re as Km,Rf as Pn,Rg as Up,Rh as Wq,Ri as Rr,Rj as Ss,Rk as St,S as gi,Sa as gj,Sb as jk,Sc as hl,Sd as bm,Se as Lm,Sf as Xn,Sg as Vp,Sh as Xq,Si as Sr,Sj as Ts,Sk as Tt,T as hi,Ta as hj,Tb as kk,Tc as il,Td as cm,Te as Mm,Tf as Yn,Tg as Wp,Th as Yq,Ti as Tr,Tj as Us,Tk as Ut,U as ii,Ua as ij,Ub as lk,Uc as jl,Ud as dm,Ue as Nm,Uf as Wo,Ug as Xp,Uh as Zq,Ui as Ur,Uj as Vs,Uk as Vt,V as ji,Va as jj,Vb as mk,Vc as kl,Vd as em,Ve as Om,Vf as Xo,Vg as Yp,Vh as _q,Vi as Vr,Vj as Ws,Vk as Wt,W as ki,Wa as kj,Wb as nk,Wc as ll,Wd as fm,We as Pm,Wf as Yo,Wg as Zp,Wh as $q,Wi as Wr,Wj as Xs,Wk as Xt,X as li,Xa as lj,Xb as ok,Xc as ml,Xd as gm,Xe as Qm,Xf as Zo,Xg as _p,Xh as ar,Xi as Xr,Xj as Ys,Xk as Yt,Y as mi,Ya as mj,Yc as nl,Yd as hm,Ye as Rm,Yf as _o,Yg as $p,Yh as br,Yi as Yr,Yj as Zs,Yk as Zt,Z as ni,Za as nj,Zb as pk,Zc as ol,Zd as im,Ze as Sm,Zf as $o,Zg as aq,Zi as Zr,Zj as _s,Zk as _t,_ as oi,_a as oj,_b as qk,_c as pl,_d as jm,_e as Tm,_f as ap,_g as bq,_i as _r,_j as $s,_k as $t,a as qa,aa as qi,ab as qj,ac as sk,ad as rl,af as Vm,ag as cp,ah as dq,ai as dr,ak as bt,al as bu,b as ra,ba as ri,bb as rj,bc as tk,bd as sl,be as lm,bf as en,bg as dp,bh as eq,bi as er,bj as $r,bk as ct,bl as cu,c as sa,ca as si,cb as sj,cc as uk,cd as tl,ce as mm,cf as fn,cg as ep,ch as fq,ci as fr,cj as as,ck as dt,cl as du,d as ta,da as ti,db as tj,dc as vk,dd as ul,df as gn,dg as fp,dh as gq,di as gr,dj as bs,dk as et,dl as eu,e as ua,ea as ui,eb as uj,ed as vl,ef as hn,eg as gp,eh as hq,ei as hr,ej as cs,ek as ft,el as fu,f as va,fa as wi,fb as vj,fc as wk,fd as wl,ff as jn,fg as hp,fh as iq,fi as ir,fj as ds,fk as gt,fl as gu,g as wa,ga as xi,gb as wj,gc as xk,gd as xl,gf as kn,gg as ip,gh as jq,gi as jr,gj as es,gk as ht,gl as hu,h as xa,ha as yi,hb as xj,hc as yk,hd as yl,hf as ln,hg as jp,hh as kq,hi as kr,hj as is,hk as it,hl as iu,i as ya,ia as zi,ib as yj,ic as zk,id as zl,if as mn,ig as kp,ih as lq,ii as lr,ij as js,ik as jt,il as ju,j as Ig,jb as zj,jc as Ak,jd as Al,jf as nn,jg as lp,jh as mq,ji as mr,jj as ks,jk as kt,jl as ku,k as Jg,ka as Ai,kb as Aj,kc as Bk,kd as Bl,ke as nm,kf as on,kg as mp,kh as nq,ki as nr,kj as ls,kk as lt,kl as lu,l as Kg,la as Bi,lb as Dj,lc as Ck,ld as Cl,le as om,lf as pn,lg as np,lh as oq,li as or,lj as ms,lk as mt,ll as mu,m as Lg,ma as Ci,mb as Gj,mc as Dk,md as Dl,me as pm,mf as qn,mg as op,mh as pq,mj as ns,mk as nt,ml as nu,n as Mg,na as Di,nb as Hj,nc as Ek,nd as El,ne as qm,nf as rn,ng as pp,nh as qq,ni as pr,nj as os,nk as ot,nl as ou,o as Ng,oa as Ei,ob as Ij,oc as Fk,od as Fl,oe as rm,of as sn,og as qp,oh as rq,oi as qr,oj as ps,ok as pt,p as Og,pa as Fi,pb as Jj,pc as Gk,pd as Gl,pe as sm,pf as tn,pg as rp,ph as sq,pi as rr,pj as qs,pk as qt,pl as pu,q as Pg,qa as Gi,qb as Kj,qc as Hk,qd as Hl,qe as tm,qf as un,qg as sp,qh as tq,qi as sr,qj as rs,qk as rt,ql as qu,r as Qg,ra as Hi,rb as Lj,rc as Ik,rd as Il,rf as vn,rg as tp,rh as uq,ri as tr,rj as ss,rk as st,rl as ru,s as Rg,sa as Ii,sb as Mj,sc as Jk,sd as Jl,sf as wn,sg as up,sh as vq,si as ur,sj as ts,sk as tt,sl as su,t as Sg,ta as Ji,tb as Nj,tc as Kk,td as Kl,tf as xn,tg as vp,th as wq,ti as vr,tj as us,tk as ut,tl as tu,u as Tg,ua as Ki,ub as Oj,uc as Lk,ud as Ll,uf as yn,ug as wp,uh as xq,uj as vs,uk as vt,ul as uu,v as Ug,va as Li,vb as Pj,vc as Mk,vd as Ml,vf as zn,vg as xp,vh as yq,vj as ws,vk as wt,vl as vu,w as Vg,wa as Mi,wb as Qj,wc as Nk,wd as Nl,wf as An,wg as yp,wh as Bq,wi as wr,wj as xs,wk as xt,wl as wu,x as Wg,xa as Ni,xb as Rj,xc as Ok,xd as Ol,xf as Bn,xg as zp,xh as Cq,xi as xr,xj as ys,xk as yt,xl as xu,y as Xg,ya as Oi,yb as Sj,yc as Pk,yd as Pl,ye as um,yf as Cn,yg as Ap,yh as Dq,yi as yr,yj as zs,yk as zt,yl as yu,z as Yg,za as Pi,zb as Tj,zc as Qk,zd as Ql,ze as vm,zg as Cp,zh as Eq,zi as zr,zj as As,zk as At,zl as zu}from"./chunk-MAQJCFZU.js";import"./chunk-TZIDSCTF.js";import{a as Zn,b as _n,c as $n,d as ao,e as bo,f as xo,g as yo,h as zo,i as Ao,j as Bo,k as Co,l as Do,m as Eo}from"./chunk-FUNLOUYI.js";import{a as Fo,b as Go,c as Ho,d as Io,e as Jo,f as Ko,g as Lo,h as Mo,i as No,j as Oo,k as Po,l as Qo,m as Ro,n as So,o as To,p as Uo,q as Vo}from"./chunk-R3H6IWFK.js";import{a as co,b as eo,c as fo,d as go,e as ho,f as io,g as jo,h as ko,i as lo,j as mo,k as no,l as oo,m as po,n as qo,o as ro,p as so,q as to,r as uo,s as vo,t as wo}from"./chunk-OMZ5SGMK.js";import{a as vi}from"./chunk-GIIMOLLN.js";import{c as fs,e as gs,f as hs}from"./chunk-RBG4ERTN.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import{b as ih,c as jh,d as kh,e as lh,f as mh,g as nh,h as oh,i as ph,j as qh,k as rh,l as sh,m as th,n as uh,o as Uh,p as Vh,q as Wh,r as Xh,s as Yh,t as Zh,u as _h,v as $h}from"./chunk-SS5WUOSJ.js";import{a as zq,b as Aq}from"./chunk-47XR7IMP.js";import{b as Bp}from"./chunk-QEI3OETI.js";import{a as Wm,b as Xm,c as Ym,d as Zm,e as _m,f as $m,g as an,h as bn,i as cn,j as dn,k as Qn,l as Rn,m as Sn,n as Tn,o as Un,p as Vn,q as Wn}from"./chunk-QKYGQLWC.js";import{c as Ej,f as Fj}from"./chunk-MNGFXISD.js";import{a as vh,b as wh,c as xh,d as yh,e as zh,f as Ah,g as Bh,h as Ch,i as Dh,j as Eh,k as Fh,l as Gh,m as Hh,n as Ih,o as Jh,p as Kh,q as Lh,r as Mh,s as Nh,t as Oh,u as Ph,v as Qh,w as Rh,x as Sh,y as Th}from"./chunk-4R2OFVPK.js";import{a as Bj,b as Cj}from"./chunk-RNKDFE2S.js";import"./chunk-EMWHQSMS.js";import{b as dg,d as eg,e as fg,g as gg,h as hg,i as ig,j as jg,k as kg}from"./chunk-S4K76QPI.js";import{A as Re,B as Se,C as Te,D as Ue,E as Ve,F as We,G as Xe,H as Ye,I as Ze,J as _e,K as $e,L as af,P as pf,Q as qf,T as rf,U as sf,V as tf,X as Mf,Y as Nf,Z as Of,aa as Pf,b as qe,c as re,ca as Qf,d as se,da as Rf,e as te,ea as Sf,fa as Vf,ga as Wf,ha as Xf,i as ue,ia as Yf,j as ve,ja as Zf,k as we,ka as _f,l as Ce,la as $f,m as De,ma as ag,n as Ee,na as bg,o as Fe,oa as cg,p as Ge,pa as Dg,q as He,qa as Eg,r as Ie,ra as Fg,s as Je,sa as Gg,t as Ke,ta as Hg,u as Le,v as Me,w as Ne,x as Oe,y as Pe,z as Qe}from"./chunk-KFULPF66.js";import{a as uf,b as vf,c as wf,d as xf}from"./chunk-4F4DA5UI.js";import{a as If,e as Jf,f as Kf,g as Lf}from"./chunk-DC7LAFZZ.js";import{e as xe,f as ye,g as ze,h as Ae,i as Be,m as yf,n as zf,o as Af,p as Bf,q as Cf,r as Df,s as Ef,t as Ff,u as Gf,v as Hf}from"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{b as bf,c as cf,d as df,e as ef,f as ff,g as gf,h as hf,i as jf,j as kf,k as lf,l as mf,m as nf,n as of}from"./chunk-XJDC3ZQZ.js";import{$ as cb,A as Qa,Aa as Cb,Ab as uc,B as Ra,Ba as Db,Bb as vc,C as Sa,Ca as Eb,Cb as wc,Cc as Ed,D as Ta,Da as Fb,Db as xc,Dc as Fd,E as Ua,Ea as Gb,Eb as yc,Ec as Gd,F as Va,Fa as Hb,Fb as zc,Fc as Hd,G as Wa,Ga as Ib,Gb as Ac,Gc as Id,H as Xa,Ha as Jb,Hb as Bc,Hc as Jd,I as Ya,Ia as Kb,Ib as Cc,Ic as Kd,Ja as Lb,Jb as Dc,Jc as Ld,Ka as Mb,Kb as Ec,Kc as Md,La as Nb,Lc as Nd,Ma as Ob,Mb as Fc,Mc as Od,Na as Pb,Nb as Gc,Nc as Pd,Ob as Hc,Oc as Qd,Pb as Ic,Pc as Rd,Qa as Qb,Qb as Jc,Rb as Kc,Sc as Sd,Ta as Rb,Tc as Td,Ua as Sb,Ub as Lc,Uc as Ud,Va as Tb,Vb as Mc,Vc as Vd,W as Za,Wa as Ub,Wb as Nc,Wc as Wd,X as _a,Xa as Vb,Xb as Oc,Xc as Xd,Y as $a,Ya as Wb,Yb as Pc,Yc as Yd,Z as ab,Za as Xb,Zb as Qc,Zc as Zd,_ as bb,_a as Yb,aa as db,ab as Zb,b as _,ba as eb,bb as _b,c as $,ca as fb,cb as $b,cc as Rc,cd as _d,d as aa,da as gb,db as ac,dd as $d,e as na,ea as hb,eb as bc,ec as Sc,ed as ae,fa as ib,fb as cc,fc as Tc,g as oa,ga as jb,gb as dc,gc as Uc,gd as be,h as pa,ha as kb,hb as ec,hc as Vc,hd as ce,ia as lb,ib as fc,ic as Wc,ja as mb,jb as gc,jc as Xc,jd as de,ka as nb,kb as hc,kc as Yc,la as ob,lb as ic,lc as Zc,ld as ee,ma as pb,mb as jc,mc as _c,md as fe,n as Da,nb as kc,nc as $c,nd as ge,o as Ea,oa as qb,ob as lc,oc as ad,od as he,p as Fa,pa as rb,pb as mc,pc as bd,pd as ie,q as Ga,qa as sb,qb as nc,qc as cd,qd as je,r as Ha,ra as tb,rb as oc,rc as dd,rd as ke,s as Ia,sa as ub,sb as pc,sc as ed,sd as le,t as Ja,ta as vb,tc as fd,td as me,u as Ka,ua as wb,ud as ne,v as La,va as xb,vd as oe,w as Ma,wa as yb,wb as qc,wc as Dd,wd as pe,x as Na,xa as zb,xb as rc,y as Oa,ya as Ab,yb as sc,z as Pa,za as Bb,zb as tc}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{a as gd,b as hd,c as id,d as jd,e as kd,f as ld,g as md,h as nd,i as od,j as pd,k as qd,l as rd,m as sd,n as td,o as ud,p as vd,q as wd,r as xd,s as yd,t as zd,u as Ad,v as Bd,w as Cd}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{a as ba,e as ca,f as da,g as ea,h as fa,i as ga,j as ha,k as ia,l as ja,m as ka,n as la,o as ma,p as za,q as Aa,r as Ba,s as Ca}from"./chunk-5U3A6KMU.js";import{a as lg,b as mg,d as ng,e as og,f as pg,g as qg,h as rg,i as sg,j as tg,k as ug,l as vg,m as wg,n as xg,o as yg,p as zg,q as Ag,r as Bg,t as Cg}from"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import{a as Tf,b as Uf}from"./chunk-3YLXGE6T.js";import{a as V,b as W,c as X,d as Y,e as Z}from"./chunk-IOCF4XSR.js";import{A,B,C,D,E,F,G,H,I,J,L as K,M as L,Q as O,R as P,U as Q,V as R,W as S,X as T,Y as U,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import{c as M,g as N}from"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{Ea as AGENT_CONTEXT_FILENAME,tn as AGENT_WORKTREE_HEX_LENGTH,sn as AGENT_WORKTREE_PREFIX,un as AGENT_WORKTREE_SLUG_PATTERN,gt as ALL_PROVIDERS,js as APPROVAL_MODES,ls as APPROVAL_MODE_INFO,qa as ARENA_MAX_AGENTS,kd as AUTO_MEMORY_CONSOLIDATION_LOCK_FILENAME,gd as AUTO_MEMORY_DIRNAME,jd as AUTO_MEMORY_EXTRACT_CURSOR_FILENAME,hd as AUTO_MEMORY_INDEX_FILENAME,id as AUTO_MEMORY_METADATA_FILENAME,hk as AUTO_MEMORY_SCHEMA_VERSION,gk as AUTO_MEMORY_TYPES,vl as AUTO_MODE_DENIAL_LIMITS,op as AUTO_SKILL_THRESHOLD,pu as AbortError,gn as AgentCore,Sm as AgentEventEmitter,Rm as AgentEventType,Vm as AgentHeadless,Hn as AgentInteractive,da as AgentStatistics,ua as AgentStatus,ta as AgentTerminateMode,Sh as AgentType,Nd as ApiCancelEvent,Md as ApiErrorEvent,Ld as ApiRequestEvent,pb as ApiRequestPhase,Od as ApiResponseEvent,is as ApprovalMode,ya as ArenaAgentClient,Ln as ArenaEventEmitter,Kn as ArenaEventType,Pn as ArenaManager,ra as ArenaSessionStatus,Gn as AsyncMessageQueue,de as AuthEvent,ts as AuthProviderType,Dg as AuthType,Zo as BACKGROUND_AGENT_CONCURRENCY_ENV,qn as BASELINE_COMMIT_MESSAGE,Ta as BINARY_EXTENSIONS,La as BINARY_FILE_PATTERNS,zu as BTW_MAX_INPUT_LENGTH,eq as BUNDLE_CHUNK_DIR,ep as BackgroundAgentResumeService,Rq as BackgroundShellRegistry,cp as BackgroundTaskRegistry,q as BadRequestError,ga as BaseDeclarativeTool,ea as BaseToolInvocation,uq as BudgetExhaustedError,Cn as BuiltinAgentRegistry,Af as CAPPED_DEFAULT_MAX_TOKENS,Tt as CODE_ACTION_KIND_LABELS,Kk as COMMAND_SUBSTITUTION_WARNING,Na as COMMON_DIRECTORY_EXCLUDES,Ka as COMMON_IGNORE_PATTERNS,ma as CONCURRENCY_SAFE_KINDS,dt as CUSTOM_API_KEY_ENV_PREFIX,jj as ChatRecordingService,Jm as CloseDiffRequestSchema,fm as ColorMode,nj as CompressionStatus,Pr as ConditionalRulesRegistry,us as Config,Tm as ContextState,Yd as ConversationFinishedEvent,Qm as CoreToolScheduler,qg as CredentialsClearRequiredError,xp as CronScheduler,Fe as DAEMON_TRACEPARENT_META_KEY,Ge as DAEMON_TRACESTATE_META_KEY,pp as DEFAULT_AUTO_DREAM_MIN_HOURS,qp as DEFAULT_AUTO_DREAM_MIN_SESSIONS,dp as DEFAULT_BACKGROUND_AGENT_CONTINUATION_MESSAGE,Bn as DEFAULT_BUILTIN_SUBAGENT_TYPE,Da as DEFAULT_CONTEXT_FILENAME,Za as DEFAULT_ENCODING,Qa as DEFAULT_FILE_EXCLUDES,Cj as DEFAULT_FILE_FILTERING_OPTIONS,Lt as DEFAULT_LSP_COMMAND_CHECK_TIMEOUT_MS,Kt as DEFAULT_LSP_DOCUMENT_OPEN_DELAY_MS,Nt as DEFAULT_LSP_DOCUMENT_RETRY_DELAY_MS,Ot as DEFAULT_LSP_MAX_RESTARTS,It as DEFAULT_LSP_REQUEST_TIMEOUT_MS,Qt as DEFAULT_LSP_SOCKET_MAX_RETRY_DELAY_MS,Pt as DEFAULT_LSP_SOCKET_RETRY_DELAY_MS,Ht as DEFAULT_LSP_STARTUP_TIMEOUT_MS,Jt as DEFAULT_LSP_WARMUP_DELAY_MS,Mt as DEFAULT_LSP_WORKSPACE_SYMBOL_WARMUP_DELAY_MS,wf as DEFAULT_MATILDA_EMBEDDING_MODEL,vf as DEFAULT_MATILDA_FLASH_MODEL,uf as DEFAULT_MATILDA_MODEL,Yo as DEFAULT_MAX_CONCURRENT_BACKGROUND_AGENTS,xs as DEFAULT_MAX_INLINE_MEDIA_BYTES,Bj as DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,tf as DEFAULT_OTLP_ENDPOINT,zf as DEFAULT_OUTPUT_TOKEN_LIMIT,ms as DEFAULT_PR_ATTRIBUTION_MESSAGE,ai as DEFAULT_STOP_HOOK_BLOCK_CAP,sf as DEFAULT_TELEMETRY_TARGET,yf as DEFAULT_TOKEN_LIMIT,ps as DEFAULT_TOOL_OUTPUT_BATCH_BUDGET,hh as DEFAULT_TOOL_RESULTS_TOTAL_CHARS_THRESHOLD,os as DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,ns as DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,St as DIAGNOSTIC_SEVERITY_LABELS,Dn as DISPLAY_MODE,mp as DREAM_TASK_TYPE,fa as DeclarativeTool,Eh as DefaultHookOutput,Ed as DiscoveredMCPTool,xq as DiscoveredTool,Bf as ESCALATED_MAX_TOKENS,$ as EVENT_API_ERROR,aa as EVENT_API_RESPONSE,_ as EVENT_TOOL_CALL,en as EXCLUDED_TOOLS_FOR_SUBAGENTS,Wq as EXTENSIONS_CONFIG_FILENAME,Vq as EXTENSIONS_DIRECTORY_NAME,Yq as EXTENSION_SETTINGS_FILENAME,fn as EXTERNAL_MESSAGE_PREFIX,lp as EXTRACT_TASK_TYPE,Hd as EndSessionEvent,ke as ExtensionDisableEvent,be as ExtensionEnableEvent,_d as ExtensionInstallEvent,Er as ExtensionManager,wr as ExtensionSettingScope,ae as ExtensionUninstallEvent,Dr as ExtensionUpdateState,Mi as FILE_HISTORY_DIR,kn as FORK_SUBAGENT_TYPE,g as FatalAuthenticationError,m as FatalBudgetExceededError,n as FatalCancellationError,j as FatalConfigError,f as FatalError,h as FatalInputError,i as FatalSandboxError,l as FatalToolExecutionError,k as FatalTurnLimitedError,yn as FileDiscoveryService,nm as FileEncoding,Ra as FileExclusions,Pi as FileHistoryService,lb as FileOperation,Uq as FileReadCache,Cm as FileSchema,ru as FileSearchFactory,Pd as FlashFallbackEvent,o as ForbiddenError,Xh as GOAL_HOOK_TIMEOUT_MS,Wh as GOAL_HOOK_TIMEOUT_SECONDS,t as GOOGLE_ACCOUNTS_FILENAME,dk as GeminiChat,wp as GeminiClient,mj as GeminiEventType,xn as GitIgnoreParser,wn as GitWorktreeService,yh as HOOKS_CONFIG_FIELDS,wh as HookEventName,xh as HookPhase,Jr as HookRegistry,Lr as HookSystem,zh as HookType,vh as HooksConfigSource,Km as IDEConnectionStatus,um as IDE_DEFINITIONS,xm as IDE_MAX_OPEN_FILES,ym as IDE_MAX_SELECTED_TEXT_LENGTH,zm as IDE_REQUEST_TIMEOUT_MS,ku as IDLE_SPECULATION,Vn as INBOXES_DIR,bu as INITIAL_FOLLOWUP_STATE,Xq as INSTALL_METADATA_FILENAME,Fn as ITermBackend,Lm as IdeClient,Xd as IdeConnectionEvent,Wd as IdeConnectionType,Em as IdeContextNotificationSchema,Dm as IdeContextSchema,Am as IdeContextStore,Fm as IdeDiffAcceptedNotificationSchema,Hm as IdeDiffClosedNotificationSchema,Gm as IdeDiffRejectedNotificationSchema,hs as Ignore,In as InProcessBackend,zq as InputFormat,rq as InvalidMcpConfigError,bk as InvalidStreamError,vs as JsonFormatter,Bp as KeychainTokenStorage,ka as Kind,Zd as KittySequenceOverflowEvent,Rn as LEADER_NAME,Ui as LITE_READ_BUF_SIZE,Fa as LOCAL_CONTEXT_FILENAME,Js as Logger,Rd as LoopType,Ut as LspConfigLoader,Vt as LspConnectionFactory,Wt as LspResponseNormalizer,Xt as LspServerManager,xf as MAINLINE_CODER_MODEL,na as MAIN_SOURCE,If as MATILDA_API_KEY_ENV_KEY,wm as MATILDA_CODE_COMPANION_EXTENSION_NAME,Bt as MATILDA_CODE_SIMPLE_ENV_VAR,Ag as MATILDA_CREDENTIAL_FILE_MODE,s as MATILDA_DIR,Pf as MATILDA_OAUTH_MODELS,rc as MATILDA_SESSION_ID_HASH_ATTR,qc as MATILDA_USER_ID_HASH_ATTR,$o as MAX_CONCURRENT_BACKGROUND_AGENTS,Lq as MAX_CONCURRENT_MONITORS,Bi as MAX_DIFF_SIZE_BYTES,Ai as MAX_FILES,Di as MAX_FILES_FOR_DETAILS,Vh as MAX_GOAL_ITERATIONS,Ci as MAX_LINES_PER_FILE,Pq as MAX_NOTIFICATION_OUTPUT_TAIL_BYTES,ap as MAX_RETAINED_TERMINAL_AGENTS,Mq as MAX_RETAINED_TERMINAL_MONITORS,Qq as MAX_RETAINED_TERMINAL_SHELLS,Sq as MAX_RETAINED_TERMINAL_WORKFLOWS,Li as MAX_SNAPSHOTS,Qn as MAX_TEAMMATES,tl as MAX_TRANSCRIPT_MESSAGES,Bh as MAX_USER_PROMPT_EXPANSION_ADDITIONAL_CONTEXT_LENGTH,Kp as MCPDiscoveryState,Gp as MCPOAuthProvider,Cp as MCPOAuthTokenStorage,rs as MCPServerConfig,Jp as MCPServerStatus,tq as MCP_BUDGET_REARM_FRACTION,sq as MCP_BUDGET_WARN_FRACTION,Hp as MCP_DEFAULT_TIMEOUT_MSEC,Ma as MEDIA_FILE_PATTERNS,Ga as MEMORY_SECTION_HEADER,Fu as MOCK_TOOL_GET_CONFIRMATION_DETAILS,Eu as MOCK_TOOL_GET_DEFAULT_PERMISSION,Of as MODEL_GENERATION_CONFIG_FIELDS,la as MUTATOR_KINDS,wg as MatildaOAuth2Client,xg as MatildaOAuth2Event,rg as MatildaOAuthPollError,pq as McpBudgetWouldExceedError,Lp as McpClient,wq as McpClientManager,qq as McpServerSpawnFailedError,Ls as McpTransportPool,oe as MemoryDreamEvent,ne as MemoryExtractEvent,rp as MemoryManager,nb as MemoryMetricType,pe as MemoryRecallEvent,Nr as MessageBus,pk as MessageBusType,Gs as MessageSenderType,Hu as MockModifiableTool,Gu as MockModifiableToolInvocation,Du as MockTool,Rf as ModelRegistry,ce as ModelSlashCommandEvent,Sf as ModelsConfig,Oq as MonitorRegistry,Yt as NativeLspClient,Zt as NativeLspService,Sd as NextSpeakerCheckEvent,Mh as NotificationType,Fp as OAUTH_AUTH_URL_EVENT,Ep as OAUTH_DISPLAY_MESSAGE_EVENT,Dp as OAuthUtils,Zs as OPENROUTER_BASE_URL,Ys as OPENROUTER_ENV_KEY,Cf as OUTPUT_TOKEN_SAFETY_MARGIN,ve as OpenAILogger,Im as OpenDiffRequestSchema,Aq as OutputFormat,hu as OverlayFs,w as PATH_ARG_KEYS,mq as POOLED_TRANSPORTS_DEFAULT,Ps as PROVIDER_METADATA_NS,Oa as PYTHON_EXCLUDES,mb as PerformanceMetricType,Iq as PermissionManager,Oh as PermissionMode,Lh as PermissionRequestHookOutput,Rh as PostCompactTrigger,Jh as PostToolBatchHookOutput,Hh as PostToolUseFailureHookOutput,Gh as PostToolUseHookOutput,Qh as PreCompactTrigger,Fh as PreToolUseHookOutput,le as PromptSuggestionEvent,lt as ProviderInstallError,Fo as RECIPROCAL_CALLER,cr as REDACTED_URL_CREDENTIAL,ef as REPORTED_ATTEMPT_PURPOSES,cf as REPORTED_ATTEMPT_PURPOSE_HEADER,df as REPORTED_OPERATION_HEADER_NAMES,bf as REPORTED_OPERATION_ID_HEADER,Mf as RUNTIME_SNAPSHOT_PREFIX,Qi as RUNTIME_STATUS_SCHEMA_VERSION,Dd as ReadFileTool,hf as ReportedOperationTracker,as as RipGrepTool,Qd as RipgrepFallbackEvent,ye as RuntimeDiagnosticsCollector,Gl as SAFE_TOOL_ALLOWLIST,$i as SESSION_TITLE_MAX_LENGTH,v as SHELL_SPECIAL_CHARS,Wk as SHELL_TOOL_NAMES,np as SKILL_REVIEW_TASK_TYPE,bi as STOP_HOOK_BLOCK_CAP_ENV,du as SUGGESTION_PROMPT,hg as SUPPORTED_IMAGE_MIME_TYPES,Rt as SYMBOL_KIND_LABELS,Pa as SYSTEM_FILE_EXCLUDES,Hj as SYSTEM_REMINDER_CLOSE,Gj as SYSTEM_REMINDER_OPEN,ca as SchemaValidator,Ap as SdkControlClientTransport,Qb as SemanticAttributes,tp as SendMessageType,Ph as SessionEndReason,aj as SessionService,Nh as SessionStartSource,Cr as SettingScope,mm as ShellExecutionService,Gq as SkillActivationRegistry,Dq as SkillError,ee as SkillLaunchEvent,Hq as SkillManager,Ud as SlashCommandStatus,yj as SleepInhibitor,N as SpanStatusCode,me as SpeculationEvent,tm as StandardFileSystemService,Gd as StartSessionEvent,Kh as StopHookOutput,K as Storage,Zj as StreamEventType,hn as SubagentError,jn as SubagentErrorCode,Kq as SubagentManager,Jq as SubagentValidator,Tn as TASKS_DIR,Wn as TEAMMATE_COLORS,Sn as TEAMS_DIR,Un as TEAM_CONFIG_FILENAME,xi as TERMINAL_CSI_REGEX,wi as TERMINAL_OSC_REGEX,yi as TERMINAL_SHIFT_DCS_REGEX,ht as THIRD_PARTY_PROVIDERS,Vk as TOOL_NAME_ALIASES,pt as TOOL_USE_SUMMARY_SYSTEM_PROMPT,Mo as TaskOwnershipError,Yn as TeamEventEmitter,Xn as TeamEventType,Xo as TeamManager,rf as TelemetryTarget,gg as TextTokenizer,En as TmuxBackend,Kd as ToolCallEvent,ja as ToolConfirmationOutcome,Aa as ToolDisplayNames,Ca as ToolDisplayNamesMigration,ba as ToolErrorType,ob as ToolExecutionPhase,za as ToolNames,Ba as ToolNamesMigration,$d as ToolOutputTruncatedEvent,yq as ToolRegistry,ks as TrustGateError,oj as Turn,ld as USER_AUTO_MEMORY_DIRNAME,oa as UiTelemetryService,p as UnauthorizedError,ge as UserFeedbackEvent,fe as UserFeedbackRating,Id as UserPromptEvent,Ih as UserPromptExpansionHookOutput,Jd as UserRetryEvent,M as ValueType,rn as WORKTREES_DIR,ln as WORKTREE_BRANCH_PREFIX,nn as WORKTREE_SESSION_FILE,Tq as WorkflowRunRegistry,zn as WorkspaceContext,Ms as WorkspaceMcpBudget,Ft as WorkspaceMemoryFileTooLargeError,Dt as WorkspaceMemoryWriteTimeoutError,ph as __resetActiveGoalStoreForTests,gi as _recoverObjectsFromLine,Mm as _resetCachedIdeServerHost,ki as _resetEnsuredDirsCacheForTest,$r as _resetRipGrepCachesForTest,u as _resetValidatePathCacheForTest,Yh as abortGoalForStopHookCap,nu as abortSpeculation,mu as acceptSpeculation,Aj as acquireSleepInhibitor,ih as activeGoalEquals,Me as addDaemonRequestAttribute,Np as addMCPStatusChangeListener,Wb as addModelOutputAttributes,Ub as addSystemPromptAttributes,Xb as addToolInputAttributes,Yb as addToolResultAttributes,Vb as addToolSchemaAttributes,Tb as addUserPromptAttributes,At as aggregateUsage,Xl as allowEditorTypeInSandbox,Yg as appendToLastTextPart,Ll as applyAutoModeDecision,mt as applyProviderInstallPlan,Fj as applySkillAllowedTools,zs as approxBase64Bytes,Go as assertValidTaskId,lo as assignTeammateColor,W as atomicWriteFile,Z as atomicWriteFileSync,X as atomicWriteJSON,Ro as blockTask,Mj as buildAddedMcpToolsReminder,Pj as buildAddedSkillsReminder,bj as buildApiHistoryFromConversation,Oj as buildAvailableSkillsReminder,bp as buildBackgroundEntryLabel,Bu as buildBtwCacheSafeParams,Au as buildBtwPrompt,Lj as buildDeferredToolsReminder,Nn as buildFallbackApproachSummary,cl as buildHumanReadableRuleLabel,Qs as buildInstallPlan,Nj as buildMcpServerInstructionsReminder,yp as buildMissedCronNotification,Jg as buildModelIdContext,kl as buildPermissionCheckContext,bl as buildPermissionRules,Xs as buildProviderTemplate,of as buildReportedOperationHeaders,Mk as buildShellExecWarnings,Ej as buildSkillLlmContent,Qj as buildStartupContextReminder,Wo as buildTeammatePromptAddendum,Bg as cacheMatildaCredentials,kq as canUseRipgrep,Pe as captureDaemonTelemetryContext,Tk as checkArgumentSafety,Nk as checkCommandPermissions,lr as checkForExtensionUpdate,Wl as checkHasEditorType,ir as checkNpmUpdate,So as claimTask,Bs as clampInlineMediaPart,Df as clampOutputToContextWindow,qo as classifyShutdownResponse,st as cleanSummary,Ju as cleanupTmpDir,lh as clearActiveGoal,Do as clearAllInboxes,od as clearAutoMemoryRootCache,hp as clearCacheSafeParams,Cg as clearCachedCredentialFile,rh as clearGoalTerminalObserver,Co as clearInbox,uc as clearMatildaCorrelationHashes,Yf as clearMatildaCredentials,Ti as clearRuntimeStatus,mo as clearTeammateColors,vu as clearWelcomeBackState,ds as clearWorktreeSession,Tr as cliSource,jr as cloneFromGit,zp as collectMemoryDiagnostics,Vj as collectToolCallIdsFromHistory,Rl as commandExists,$j as compactPendingUserContentToBudget,_j as compactTextMiddle,Rs as computeModelListVersion,xj as computeThresholds,fj as computeUniqueBranchTitle,Xr as computedSource,Xp as connectAndDiscover,bq as connectToMcpServer,nq as connectionIdOf,Bo as consumeUnread,rr as convertClaudeAgentConfig,tr as convertClaudePluginPackage,sr as convertClaudeToMatildaConfig,hm as convertColorToHex,Pm as convertToFunctionResponse,pr as convertTomlToMarkdown,Fr as copyExtension,cb as countFileLines,oi as countLines,fs as crawlCache,Hg as createContentGenerator,Gg as createContentGeneratorConfig,Te as createDaemonBridgeTelemetry,U as createDebugLogger,jk as createDefaultAutoMemoryExtractCursor,kk as createDefaultAutoMemoryIndex,ik as createDefaultAutoMemoryMetadata,wl as createDenialState,cu as createFollowupController,ip as createForkedChat,Zh as createGoalStopHookCallback,Dh as createHookOutput,Mr as createInstructionsLoadedCallback,Ip as createStreamableHttpCompatibilityFetch,Ko as createTask,to as createTeamFile,Iu as createTmpDir,ot as createToolUseSummaryMessage,cq as createTransport,ft as customProvider,$a as decodeBufferWithEncodingInfo,Is as decodeTagName,Xj as dedupeToolCallsById,$s as deepseekProvider,Wr as defaultSource,Oo as deleteTask,vo as deleteTeamDirs,Oi as deserializeSnapshots,_a as detectBOM,Jn as detectBackend,Jk as detectCommandSubstitution,Ya as detectEncodingFromBuffer,eb as detectFileEncoding,ib as detectFileType,vm as detectIdeFromEnv,rm as detectLineEnding,dg as detectRuntime,Th as detectTodoChanges,Vp as discoverMcpTools,_p as discoverPrompts,Yp as discoverTools,xo as disposeInboxLocks,xk as doesToolInvocationMatch,mr as downloadFromGitHubRelease,hr as downloadFromNpmRegistry,Sl as editorCommands,Oe as emitDaemonLog,Es as encodeInsightErrorMessage,Cs as encodeInsightProgressMessage,Ds as encodeInsightReadyMessage,Hs as encodeTagName,sm as encodeTextFileContent,lc as endHookSpan,$b as endInteractionSpan,cc as endLLMRequestSpan,oc as endSubagentSpan,jc as endToolBlockedOnUserSpan,hc as endToolExecutionSpan,fc as endToolSpan,lk as ensureAutoMemoryScaffold,qm as ensureCrlfLineEndings,jq as ensureMacBinarySigned,iq as ensureRipgrepHealthy,ou as ensureToolResultPairing,nk as ensureUserAutoMemoryScaffold,kf as enterReportedOperationContext,Yr as envLayer,B as escapePath,Ak as escapeShellArg,qe as estimateTokensFromChars,Pl as evaluateAutoMode,ol as evaluatePermissionFlow,ll as evaluatePermissionRules,iu as evaluateToolCall,Ok as execCommand,Ks as executeToolCall,pi as exists,y as expandHomeDir,Se as extractDaemonTraceContext,Sa as extractExtensionsFromPatterns,or as extractFile,Wi as extractJsonStringField,Yi as extractLastJsonStringField,Xi as extractLastJsonStringFields,ul as extractShellOperations,Om as extractToolFilePaths,Ei as fetchGitDiff,Fi as fetchGitDiffHunks,kb as fileExists,qu as filter,ri as findGitRoot,oo as findMemberById,po as findMemberByName,jt as findProviderByCredentials,it as findProviderById,nr as findReleaseAsset,uk as fireNotificationHook,vk as firePermissionRequestHook,tk as firePostToolUseFailureHook,sk as firePostToolUseHook,rk as firePreToolUseHook,Xg as flatMapTextParts,zc as forceFlushMetrics,jo as formatAgentId,Ol as formatClassifierBlockMessage,Ij as formatDateForContext,xl as formatDenialStateLog,On as formatLineStats,im as formatMemoryUsage,ei as formatStopHookBlockingCapWarning,P as formatTraceparent,ao as forwardApproval,vn as generateAgentWorktreeSlug,og as generateCodeChallenge,ng as generateCodeVerifier,et as generateCustomEnvKey,pg as generatePKCEPair,eu as generatePromptSuggestion,nt as generateSessionRecap,qk as generateToolUseId,qt as generateToolUseSummary,ko as generateUniqueTeammateName,Fd as generateValidName,re as generatedOutputTokens,jh as getActiveGoal,pc as getActiveInteractionSpan,Zm as getAgentName,Vo as getAgentStatuses,Ja as getAllGeminiMdFilenames,Sp as getAllMCPServerStatuses,kt as getAllProviderBaseUrls,vj as getArenaSystemReminder,ud as getAutoMemoryConsolidationLockPath,td as getAutoMemoryExtractCursorPath,xd as getAutoMemoryFilePath,rd as getAutoMemoryIndexPath,sd as getAutoMemoryMetadataPath,pd as getAutoMemoryProjectStateDir,nd as getAutoMemoryRoot,vd as getAutoMemoryTopicFilename,wd as getAutoMemoryTopicPath,Nl as getAutoModePermissionDeniedReason,gq as getBuiltinRipgrep,gp as getCacheSafeParams,Va as getCachedEncodingForBuffer,Ck as getCommandRoot,Dk as getCommandRoots,sj as getCompressionPrompt,rj as getCoreSystemPrompt,Ia as getCurrentGeminiMdFilename,qj as getCustomSystemPrompt,Ss as getDefaultBaseUrlForProtocol,Us as getDefaultModelIds,Zl as getDiffCommand,Jj as getDirectoryContextString,Tl as getEditorExecutable,ql as getEffectivePermissionForConfirmation,Ar as getEnvContents,Kj as getEnvironmentContext,c as getErrorMessage,d as getErrorStatus,e as getErrorType,Gr as getExtensionId,Vl as getExternalEditorCommand,fu as getFilterReason,Dj as getFolderStructure,$g as getFunctionCalls,bh as getFunctionCallsAsJson,ah as getFunctionCallsFromParts,ch as getFunctionCallsFromPartsAsJson,si as getGitBranch,ti as getGitRepoName,Ah as getHookKey,Gt as getIdeInstaller,Nm as getIdeServerHost,yo as getInboxPath,go as getInboxesDir,Rj as getInitialChatHistory,wj as getInsightPrompt,th as getLastGoalTerminal,_n as getLeader,Tp as getMCPDiscoveryState,au as getMCPServerPrompts,Rp as getMCPServerStatus,Kf as getMatildaAuthBaseUrl,Zf as getMatildaAuthStatus,tc as getMatildaCorrelationHashes,Vf as getMatildaCredentialsPath,zg as getMatildaOAuthClient,ys as getMaxInlineMediaBytes,md as getMemoryBaseDir,Nq as getMonitorOutputPath,eg as getOrCreateSharedDispatcher,uj as getPlanModeSystemReminder,D as getProjectHash,wu as getProjectSummaryInfo,tj as getProjectSummaryPrompt,Qg as getRateLimitErrorDetails,Rg as getRateLimitRetryDelayMs,ui as getRecentGitStatus,gf as getReportedOperationContext,Wg as getResponseText,_g as getResponseTextFromParts,dj as getResumePromptTokenCount,ej as getResumeTokenCounts,al as getRuleDisplayName,zr as getScopedEnvContents,lm as getShellAbortReasonKind,yk as getShellConfiguration,fb as getSpecificMimeType,Yk as getSpecifierKind,Sj as getStartupContextLength,dh as getStructuredResponse,eh as getStructuredResponseFromParts,jg as getSupportedImageFormatsString,Wa as getSystemEncoding,Lo as getTask,Ho as getTaskPath,ho as getTasksDir,eo as getTeamDir,fo as getTeamFilePath,_m as getTeamName,cn as getTeammateColor,Xm as getTeammateContext,co as getTeamsRootDir,lj as getThoughtText,zt as getTimeRangeBounds,O as getTraceContext,kg as getUnsupportedImageFormatWarning,zd as getUserAutoMemoryIndexPath,yd as getUserAutoMemoryRoot,Ad as getUserAutoMemoryTopicPath,$f as getValidMatildaAccessToken,tu as getWelcomeBackState,sp as globalMemoryManager,ia as hasCycleInSchema,Ff as hasExplicitOutputLimit,aq as hasNetworkTransport,Gk as hasNonFinalTopLevelBackgroundOperator,Lk as hasShellSubstitution,Ik as hasUnsafeMonitorBackgroundOperator,He as hashDaemonWorkspace,_t as hashMcpServerConfig,Hr as hashValue,Kr as hookEventSupportsMatcher,_q as hydrateString,Bm as ideContextStore,Ue as initializeDaemonMetrics,wc as initializeTelemetry,Re as injectDaemonTraceContext,ml as injectPermissionRulesIfMissing,$p as invokeMcpPrompt,b as isAbortError,Cd as isAnyAutoMemPath,Kg as isApiError,El as isApproveOutcome,sl as isAutoEditApproved,qd as isAutoMemPath,Ct as isBareMode,cm as isBinary,hb as isBinaryFile,Tf as isBrowserCommandBlocked,vr as isClaudePluginConfig,Rk as isCommandAllowed,Qk as isCommandAvailable,Sk as isCommandNeedsPermission,Q as isDebugLoggingDegraded,yl as isDenialFallbackReason,sg as isDeviceAuthorizationSuccess,ug as isDeviceTokenPending,tg as isDeviceTokenSuccess,Yl as isEditorAvailable,dq as isEnabled,vg as isErrorResponse,qs as isGatedMcpScope,Ng as isGenericQuotaExceededError,qi as isGitRepository,Ym as isInProcessTeammate,Hl as isInSafeToolAllowlist,fk as isInvalidArgumentError,Og as isMatildaQuotaExceededError,$l as isModifiableDeclarativeTool,a as isNodeError,An as isPathWithinRoot,Jb as isPerformanceMonitoringActive,rl as isPlanModeBlocked,Mg as isProQuotaExceededError,Pg as isRateLimitError,ff as isReportedOperationHeaderName,xe as isRuntimeDiagnosticsEnabled,ek as isSchemaDepthError,fr as isScopedNpmPackage,ss as isSdkMcpServerConfig,xa as isSettledStatus,Lg as isStructuredError,F as isSubpath,G as isSubpaths,wa as isSuccessStatus,ig as isSupportedImageMimeType,Tj as isSystemReminderContent,bn as isTeamLead,an as isTeammate,vc as isTelemetrySdkInitialized,Ul as isTerminalEditor,va as isTerminalStatus,qr as isTomlFormat,ha as isTool,wk as isToolEnabled,Sg as isTransientCapacityError,Tg as isUnattendedMode,Bd as isUserAutoMemPath,Ql as isValidEditorType,ak as isValidNonThoughtTextPart,zk as isWindows,gb as isWithinRoot,Uh as judgeGoal,Gf as knownTokenLimit,Zr as layer,Zp as listMcpPrompts,Po as listTasks,wo as listTeamNames,gs as loadIgnoreRules,Qr as loadServerHierarchicalMemory,yt as loadUsageHistory,Jc as logApiCancel,Ic as logApiError,Fc as logApiRequest,Kc as logApiResponse,$c as logArenaAgentCompleted,ad as logArenaSessionEnded,_c as logArenaSessionStarted,Xc as logAuth,Pc as logChatCompression,Oc as logConversationFinishedEvent,Wc as logExtensionDisable,Vc as logExtensionEnable,Sc as logExtensionInstallEvent,Tc as logExtensionUninstall,Uc as logExtensionUpdateEvent,Gc as logFlashFallback,Nc as logIdeConnection,Qc as logKittySequenceOverflow,ed as logMemoryDream,dd as logMemoryExtract,fd as logMemoryRecall,Rc as logModelSlashCommand,Lc as logNextSpeakerCheck,bd as logPromptSuggestion,Hc as logRipgrepFallback,Yc as logSkillLaunch,Mc as logSlashCommand,cd as logSpeculation,Ac as logStartSession,Dc as logToolCall,Ec as logToolOutputTruncated,Zc as logUserFeedback,Bc as logUserPrompt,Cc as logUserRetry,Lf as loginToMatilda,cg as loginToMatildaWithBrowser,_f as logoutMatilda,ie as makeArenaAgentCompletedEvent,je as makeArenaSessionEndedEvent,he as makeArenaSessionStartedEvent,Vd as makeChatCompressionEvent,Cu as makeFakeConfig,A as makeRelative,Td as makeSlashCommandEvent,el as matchesCommandPattern,hl as matchesDomainPattern,il as matchesMcpPattern,gl as matchesPathPattern,jl as matchesRule,yg as matildaOAuth2Events,Jf as matildaProvider,xr as maybePromptForSettings,Mp as mcpServerRequiresOAuth,vq as mcpTransportOf,ur as mergeClaudeConfigs,ut as metricsToUsageRecord,at as minimaxProvider,Vr as modelProvidersSource,Qf as modelRegistryKey,ct as modelscopeProvider,am as modifyWithEditor,pl as needsConfirmation,om as needsUtf8Bom,Ef as normalize,dm as normalizeContent,Wj as normalizeModelToolCallIds,Hk as normalizeMonitorCommand,Or as normalizeProxyUrl,Eq as normalizeSkillPriority,ci as normalizeStopHookBlockingCap,te as normalizeStoredModelUsage,vt as normalizeUsageRecord,sh as notifyGoalTerminal,Jo as notifyTasksUpdated,Io as onTasksUpdated,lg as openBrowserSecurely,_l as openDiff,_s as openRouterProvider,we as openaiLogger,As as oversizedMediaPlaceholder,Bq as parse,fi as parseAndFormatApiError,Ce as parseBooleanEnvFlag,oq as parseConnectionId,Ji as parseDeletedFromNameStatus,Hi as parseGitDiff,kr as parseGitHubRepoForReleases,Gi as parseGitNumstat,Fs as parseInsightMessage,$t as parseInstallSource,hi as parseLineTolerant,er as parseNpmPackageSource,_k as parseRule,$k as parseRules,Ii as parseShortstat,De as parseTelemetryTargetValue,kj as parseThought,ws as partListUnionToString,Vg as partToString,Kl as passesAcceptEditsFastPath,br as performVariableReplacement,nl as persistPermissionOutcome,tt as persistSessionUsage,Wp as populateMcpServerCommand,Zg as prependToFirstTextPart,jb as processSingleFileContent,yr as promptForSetting,jm as promptIdContext,Ws as providerMatchesCredentials,ji as read,mk as readAutoMemoryIndex,bb as readFileWithEncoding,ab as readFileWithEncodingInfo,db as readFileWithLineAndLimit,zo as readInbox,Zi as readLastJsonStringFieldSync,_i as readLastJsonStringFieldsSync,ii as readLines,xu as readManyFiles,Wf as readMatildaCredentials,su as readPathFromWorkspace,Si as readRuntimeStatus,ro as readTeamFile,ok as readUserAutoMemoryIndex,bs as readWorktreeSession,pn as readWorktreeSessionMarker,zl as recordAllow,tb as recordApiErrorMetrics,Fb as recordApiRequestBreakdown,sb as recordApiResponseMetrics,yb as recordApiRetry,Lb as recordArenaAgentCompletedMetrics,Mb as recordArenaSessionEndedMetrics,Kb as recordArenaSessionStartedMetrics,Ib as recordBaselineComparison,Al as recordBlock,wb as recordContentRetry,xb as recordContentRetryFailure,Bb as recordCpuUsage,$e as recordDaemonBridgeError,af as recordDaemonCancel,Ye as recordDaemonChannelLifecycle,Ne as recordDaemonError,We as recordDaemonHttpRequest,Le as recordDaemonHttpResponse,_e as recordDaemonPromptDuration,Ze as recordDaemonPromptQueueWait,Xe as recordDaemonSessionLifecycle,Dl as recordFallbackApprove,ub as recordFileOperationMetric,mh as recordGoalIteration,vb as recordInvalidChunk,Ob as recordMemoryDreamMetrics,Nb as recordMemoryExtractMetrics,Pb as recordMemoryRecallMetrics,Ab as recordMemoryUsage,Hb as recordPerformanceRegression,Gb as recordPerformanceScore,gh as recordStartupEvent,zb as recordStartupPerformance,Eb as recordTokenEfficiency,rb as recordTokenUsageMetrics,qb as recordToolCallMetrics,Db as recordToolExecutionBreakdown,Cb as recordToolQueueDepth,Bl as recordUnavailable,$q as recursivelyHydrateStrings,fg as redactProxyCredentials,Yj as redactStructuredOutputArgsForRecording,dr as redactUrlCredentials,wt as reestimateUsageFromAssistantRecord,ag as refreshMatildaCredentials,xc as refreshSessionContext,Ve as registerDaemonGaugeCallbacks,$h as registerGoalHook,Zn as registerLeader,To as releaseOwnedTask,Qp as removeMCPServerStatus,Op as removeMCPStatusChangeListener,V as renameWithRetry,Y as renameWithRetrySync,ck as repairOrphanedToolUseTurns,cj as replayUiTelemetryFromConversation,qf as reportCliAuthFunnelEvent,pf as reportCliClientEvent,up as reportedAttemptPurposeForSendMessageType,R as resetDebugLoggingState,Fl as resetDenialState,Ua as resetEncodingCache,Qo as resetTaskList,pm as resetUtf8BomCache,$m as resolveActiveTeamName,J as resolveAndValidatePath,Ts as resolveBaseUrl,fq as resolveBundleDir,Pk as resolveCommandPath,Eg as resolveContentGeneratorConfigWithSources,Rr as resolveField,Ki as resolveGitDir,oh as resolveGoalLifecycleStatus,_o as resolveMaxConcurrentBackgroundAgents,Os as resolveMetadataKey,_r as resolveModelConfig,Ig as resolveModelId,gr as resolveNpmRegistry,ue as resolveOpenAILogDir,Sr as resolveOptionalField,Ns as resolveOwnsModel,H as resolvePath,pj as resolvePathFromEnv,fl as resolvePathPattern,hq as resolveRipgrep,di as resolveStopHookBlockingCap,Ee as resolveTelemetrySettings,Xk as resolveToolName,es as restoreWorktreeContext,Ug as retryWithBackoff,ju as rewritePathArgs,xt as rewriteUsageHistoryFromChats,mf as runAsyncGeneratorWithReportedOperationContext,kp as runForkedAgent,nc as runInSubagentSpanContext,ec as runInToolSpanContext,lq as runRipgrep,vi as runSideQuery,Qe as runWithDaemonTelemetryContext,T as runWithDebugLogSession,jp as runWithForkedChatModel,lf as runWithReportedAttemptPurpose,jf as runWithReportedOperationContext,dn as runWithTeammateIdentity,ze as runtimeDiagnostics,sa as safeAgentId,bm as safeLiteralReplace,E as sanitizeCwd,Rb as sanitizeHookName,io as sanitizeName,hj as sanitizeTitle,ij as sanitizeToolCallResultForRecording,Ch as sanitizeUserPromptExpansionAdditionalContext,fp as saveCacheSafeParams,uu as saveWelcomeBackRestartChoice,Eo as sendStructuredMessage,Ni as serializeSnapshot,gm as serializeTerminalToObject,em as serializeTerminalToText,km as sessionIdContext,kh as setActiveGoal,S as setDebugLogSession,Ha as setGeminiMdFilename,qh as setGoalTerminalObserver,uh as setLastGoalTerminal,Up as setMCPDiscoveryState,sc as setMatildaCorrelationHashes,no as setMemberActive,fh as setStartupEventSink,Ur as settingsSource,z as shortenPath,Uf as shouldAttemptBrowserLaunch,Uk as shouldDefaultToNodePty,Cl as shouldFallback,gu as shouldFilterSuggestion,Ml as shouldFirePermissionDeniedForAutoMode,Jl as shouldForceAutoModeReviewForAllow,mg as shouldLaunchBrowser,Il as shouldRunAutoModeForCall,Vs as shouldShowStep,yc as shutdownTelemetry,zj as sleepInhibitor,Bk as splitCommands,dl as splitCompoundCommand,Fq as splitConditionalSkills,kc as startHookSpan,_b as startInteractionSpan,bc as startLLMRequestSpan,lu as startSpeculation,mc as startSubagentSpan,ic as startToolBlockedOnUserSpan,gc as startToolExecutionSpan,dc as startToolSpan,vp as startsReportedOperation,Cq as stringify,Nf as stripRuntimeSnapshotPrefix,Ek as stripShellWrapper,Uj as stripStartupContext,zi as stripTerminalControlSequences,Fk as stripTrailingBackgroundAmp,yu as subagentGenerator,ar as substituteHookVariables,Be as summarizeAnthropicWireRequest,Ae as summarizeOpenAIWireRequest,Mn as summarizeUnifiedDiff,Wm as teammateIdentityStore,Um as templateString,x as tildeifyPath,r as toFriendlyError,Hf as tokenLimit,Zk as toolMatchesRuleToolName,se as totalTokensFromBuckets,Sb as truncateContent,rt as truncateJson,Zb as truncateSpanError,gj as tryGenerateSessionTitle,uo as tryReclaimStaleTeam,pa as uiTelemetryService,Uo as unassignTeammateTasks,Vi as unescapeJsonString,C as unescapePath,_h as unregisterGoalHook,$n as unregisterLeader,nh as updateActiveGoalStatus,Pp as updateMCPServerStatus,Br as updateSetting,L as updateSymlink,No as updateTask,Fg as validateModelConfig,Ir as validateName,I as validatePath,Zq as validateVariables,bg as willOpenMatildaAuthBrowser,Xa as windowsCodePageToEncoding,Ke as withDaemonBridgeSpan,Je as withDaemonRequestSpan,Ie as withDaemonSpan,ac as withInteractionSpan,nf as withReportedAttemptPurpose,mn as worktreeBranchForSlug,bo as wrapConfirmWithBadge,ni as write,li as writeLine,mi as writeLineSync,Xf as writeMatildaCredentials,Ao as writeMessage,Ri as writeRuntimeStatus,so as writeTeamFile,Et as writeWorkspaceContextFile,cs as writeWorktreeSession,on as writeWorktreeSessionMarker,bt as zaiProvider};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{a as Q}from"./chunk-OCXGNAAT.js";import{a as K}from"./chunk-I55PXD4N.js";import{Kd as b,Ld as Z,Ob as z,de as R,ee as u,ja as D,ke as q,le as G,oe as H}from"./chunk-MAQJCFZU.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-GIIMOLLN.js";import"./chunk-RBG4ERTN.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-SS5WUOSJ.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import"./chunk-QKYGQLWC.js";import"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import"./chunk-RNKDFE2S.js";import"./chunk-EMWHQSMS.js";import"./chunk-S4K76QPI.js";import"./chunk-KFULPF66.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-XJDC3ZQZ.js";import{Lb as j,Oa as N,_c as B,ca as L,ha as E}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{w as U}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as W,i as $,p as M,q as O}from"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{A as P,C as A,Y as I,a as d,c as C,z as v}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as x}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";x();import w from"node:fs";import y from"node:path";var T=I("WRITE_FILE"),re=["filePath","filepath","path","file","filename"];function ne(g){if(!(typeof g.file_path=="string"&&g.file_path.trim()))for(let l of re){let i=g[l];if(typeof i=="string"&&i.trim()){g.file_path=i,delete g[l];return}}}function ae(g){let l=g.content;if(typeof l!="string"||!l.includes("<arg_")&&!l.includes("</arg_"))return;let i={},e=/<arg_key>\s*([A-Za-z_][\w]*)\s*<\/arg_key>\s*<arg_value>\s*([\s\S]+?)(?:<\/arg_value>|(?=<arg_key\b)|$)/gi,o;for(;(o=e.exec(l))!==null;){let f=o[1].toLowerCase(),a=o[2].trim();a&&(i[f]=a)}let s=/(?:^|[^>])([A-Za-z_][\w]*)\s*<\/arg_key>\s*<arg_value>\s*([\s\S]+?)(?:<\/arg_value>|(?=<arg_key\b)|(?=[A-Za-z_][\w]*\s*<\/arg_key>)|$)/gi;for(;(o=s.exec(l))!==null;){let f=o[1].toLowerCase(),a=o[2].trim();(a&&!i[f]||a&&a.length>=(i[f]?.length??0))&&(i[f]=a)}let p=[l.search(/<arg_key\b/i),l.search(/<\/arg_key\b/i),l.search(/<arg_value\b/i)].filter(f=>f>=0),n=p.length>0?Math.min(...p):-1;if(n>=0&&l.slice(n,n+10).startsWith("</arg_key")){let f=l.slice(0,n),a=/([A-Za-z_][\w]*)\s*$/.exec(f);a&&(n=a.index)}let m=n>=0?l.slice(0,n).trimEnd():l;m=m.replace(/<\/?arg_(?:key|value)\b[^>]*>/gi,"").trimEnd(),g.content=m;let r=new Set(["file_path","filepath","path","file","filename"]);for(let[f,a]of Object.entries(i))!r.has(f)||!a||!a.startsWith("/")&&!/^[A-Za-z]:[\\/]/.test(a)||(typeof g.file_path!="string"||!String(g.file_path).trim()||a.length>String(g.file_path).length)&&(g.file_path=a)}var S=class extends W{constructor(i,e){super(e);this.config=i}toolLocations(){return[{path:this.params.file_path}]}getDescription(){let i=P(this.params.file_path,this.config.getTargetDir());return`Writing to ${v(i)}`}async getDefaultPermission(){let i=this.config.getProjectRoot();return U(y.resolve(this.params.file_path),i)?"allow":"ask"}async getConfirmationDetails(i){let e="",o=await E(this.params.file_path);if(!this.config.getFileReadCacheDisabled()){let r=await u(this.config.getFileReadCache(),this.params.file_path,"overwriting");if(!r.ok)throw new R(r.rawMessage,r.type)}if(o)try{let{content:r}=await this.config.getFileSystemService().readTextFile({path:this.params.file_path});e=r}catch(r){if(d(r)&&r.code==="ENOENT")o=!1;else throw new Error(`Error reading existing file for confirmation: ${C(r)}`)}if(o&&!this.config.getFileReadCacheDisabled()){let r=await u(this.config.getFileReadCache(),this.params.file_path,"overwriting",{expectExisting:!0});if(!r.ok)throw T.warn("post-read TOCTOU rejection (confirmation)",{path:this.params.file_path,reason:r.type}),new R(r.rawMessage,r.type)}let s=P(this.params.file_path,this.config.getTargetDir()),p=y.basename(this.params.file_path),n=D(p,e,this.params.content,"Current","Proposed",b);return{type:"edit",title:`Confirm Write: ${v(s)}`,fileName:p,filePath:this.params.file_path,fileDiff:n,originalContent:e,newContent:this.params.content,onConfirm:async r=>{r==="proceed_always"&&this.config.setApprovalMode("auto-edit")}}}async execute(i){let{file_path:e,content:o,ai_proposed_content:s,modified_by_user:p}=this.params,n=await E(e),m="",r=!1,f,a,V=y.dirname(e);if(!this.config.getFileReadCacheDisabled()){let t=await u(this.config.getFileReadCache(),e,"overwriting");if(!t.ok)return{llmContent:t.rawMessage,returnDisplay:`Error: ${t.displayMessage}`,error:{message:t.rawMessage,type:t.type}}}if(n)try{let t=await this.config.getFileSystemService().readTextFile({path:e});t._meta?.bom!==void 0?r=t._meta.bom:r=t.content.length>0&&t.content.codePointAt(0)===65279,f=t._meta?.encoding||"utf-8",a=H(t.content),m=t.content,n=!0}catch(t){if(d(t)&&t.code==="ENOENT")n=!1;else{let c={message:C(t),code:d(t)?t.code:void 0},h=c.code?`Error checking existing file '${e}': ${c.message} (${c.code})`:`Error checking existing file: ${c.message}`;return{llmContent:h,returnDisplay:h,error:{message:h,type:"file_write_failure"}}}}if(n&&!this.config.getFileReadCacheDisabled()){let t=await u(this.config.getFileReadCache(),e,"overwriting",{expectExisting:!0});if(!t.ok)return T.warn("post-read TOCTOU rejection (execute)",{path:e,reason:t.type}),{llmContent:t.rawMessage,returnDisplay:`Error: ${t.displayMessage}`,error:{message:t.rawMessage,type:t.type}}}if(!n){let t=this.config.getDefaultFileEncoding();t===q.UTF8_BOM?r=!0:t===void 0&&(r=G(e)),f=void 0}try{await this.config.getFileHistoryService().trackEdit(e)}catch{}if(!this.config.getFileReadCacheDisabled()){let t=await u(this.config.getFileReadCache(),e,"overwriting",{expectExisting:n});if(!t.ok)return T.warn("pre-write TOCTOU rejection",{path:e,reason:t.type}),{llmContent:t.rawMessage,returnDisplay:`Error: ${t.displayMessage}`,error:{message:t.rawMessage,type:t.type}}}n||w.mkdirSync(V,{recursive:!0});try{await this.config.getFileSystemService().writeTextFile({path:e,content:o,_meta:{bom:r,encoding:f,lineEnding:a}}),p||z.getInstance().recordEdit(e,n?m:null,o);try{let _=w.statSync(e);this.config.getFileReadCache().recordWrite(e,_)}catch{}let t=y.basename(e),c=m,h=D(t,c,o,"Original","Written",b),Y=Z(t,c,s||o,o),F=[n?`Successfully overwrote file: ${e}.`:`Successfully created and wrote to new file: ${e}.`];p&&F.push(`User modified the \`content\` to be: ${o}`);let J=L(e),X=N(e),ee=y.extname(e),te=n?"update":"create",ie=o.split(`
|
|
4
|
-
`).length;j(this.config,new B(k.Name,te,ie,J,ee,X));let oe={fileDiff:h,fileName:t,originalContent:m,newContent:o,diffStat:Y};try{let _=await K(this.config,e);_&&F.push(`
|
|
5
|
-
|
|
6
|
-
${_}`)}catch{}return{llmContent:F.join(" "),returnDisplay:oe}}catch(t){let c,h="file_write_failure";return d(t)?(c=`Error writing to file '${e}': ${t.message} (${t.code})`,t.code==="EACCES"?(c=`Permission denied writing to file: ${e} (${t.code})`,h="permission_denied"):t.code==="ENOSPC"?(c=`No space left on device: ${e} (${t.code})`,h="no_space_left"):t.code==="EISDIR"&&(c=`Target is a directory, not a file: ${e} (${t.code})`,h="target_is_directory"),this.config.getDebugMode()&&t.stack&&T.debug("Write file error stack:",t.stack)):t instanceof Error?c=`Error writing to file: ${t.message}`:c=`Error writing to file: ${String(t)}`,{llmContent:c,returnDisplay:c,error:{message:c,type:h}}}}},k=class g extends ${constructor(i){super(g.Name,O.WRITE_FILE,`Writes content to a specified file in the local filesystem.
|
|
7
|
-
|
|
8
|
-
CRITICAL: Always emit file_path FIRST (absolute path), then content. Never omit file_path. Construct absolute paths from the project root + relative path (e.g. '/path/to/project/' + 'foo/bar.txt'). Relative paths are not supported.
|
|
9
|
-
|
|
10
|
-
The user has the ability to modify \`content\`. If modified, this will be stated in the response.`,"edit",{properties:{file_path:{description:"REQUIRED. Absolute path to write (e.g. '/home/user/project/src/auth.ts'). Emit this BEFORE content.",type:"string"},content:{description:"The full file contents to write. Only after file_path is set.",type:"string"}},required:["file_path","content"],type:"object"});this.config=i}static Name=M.WRITE_FILE;validateToolParams(i){let e=i;return ae(e),ne(e),(typeof i.file_path!="string"||!i.file_path.trim())&&typeof i.content=="string"&&i.content.length>0?'WriteFile requires absolute "file_path" (emit file_path first, then content). Retry with both file_path and content.':super.validateToolParams(i)}validateToolParamValues(i){let e=A(i.file_path.trim());if(i.file_path=e,!e)return'Missing or empty "file_path"';if(!y.isAbsolute(e))return`File path must be absolute: ${e}`;let o=Q(this.config,e);if(o)return o;try{if(w.existsSync(e)&&w.lstatSync(e).isDirectory())return`Path is a directory, not a file: ${e}`}catch(s){return`Error accessing path properties for validation: ${e}. Reason: ${s instanceof Error?s.message:String(s)}`}return null}createInvocation(i){return new S(this.config,i)}toAutoClassifierInput(i){let e=i.content??"";return{file_path:i.file_path,byte_count:Buffer.byteLength(e,"utf8"),content_preview:e.slice(0,300),content_truncated:e.length>300}}getModifyContext(i){return{getFilePath:e=>e.file_path,getCurrentContent:async e=>{if(await E(e.file_path))try{let{content:s}=await this.config.getFileSystemService().readTextFile({path:e.file_path});return s}catch(s){if(!d(s)||s.code!=="ENOENT")throw s;return""}else return""},getProposedContent:async e=>e.content,createUpdatedParams:(e,o,s)=>{let p=s.content;return{...s,ai_proposed_content:p,content:o,modified_by_user:!0}}}}};export{k as WriteFileTool,ne as normalizeWriteFilePathAliases,ae as repairLeakedWriteFileToolArgMarkup};
|
|
11
|
-
/**
|
|
12
|
-
* @license
|
|
13
|
-
* Copyright 2025 Google LLC
|
|
14
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
-
*/
|