@maincode-ai/matilda-code 0.21.2-nightly.20260823.b0c771373 → 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.
Files changed (39) hide show
  1. package/chunks/{agent-H26MWKNV.js → agent-WBKEN3MM.js} +1 -1
  2. package/chunks/{agent-headless-4PFHOQG6.js → agent-headless-OJM6RWIA.js} +1 -1
  3. package/chunks/{chunk-CFBZKYFB.js → chunk-6QP5C76Y.js} +52 -52
  4. package/chunks/{chunk-EBPJIU5O.js → chunk-7LNKXNEZ.js} +443 -443
  5. package/chunks/{chunk-CNRE4GFU.js → chunk-DBSJNFFU.js} +1 -1
  6. package/chunks/{chunk-5RG6AVD6.js → chunk-FU2PKCG5.js} +2 -2
  7. package/chunks/{chunk-FMNQXZTW.js → chunk-IZ6YBZWM.js} +1 -1
  8. package/chunks/{chunk-MKHNJ5O6.js → chunk-JDXISO3F.js} +2 -2
  9. package/chunks/{chunk-E5OOREZC.js → chunk-ZYW5GLYY.js} +1 -1
  10. package/chunks/{computer-use-SS2QBIWN.js → computer-use-MCXFHFTP.js} +1 -1
  11. package/chunks/{contextCommand-OUZMJMAI.js → contextCommand-G4LS5GW6.js} +1 -1
  12. package/chunks/{edit-TL5Y5RUA.js → edit-KNZAPSGJ.js} +1 -1
  13. package/chunks/{enter-worktree-BZBR2XNW.js → enter-worktree-LJ66TFYR.js} +1 -1
  14. package/chunks/{enterPlanMode-ZN5LSUSX.js → enterPlanMode-P6EIGU3Y.js} +1 -1
  15. package/chunks/{exit-worktree-YZ5EFC22.js → exit-worktree-QVQ3TLW5.js} +1 -1
  16. package/chunks/{exitPlanMode-PF2NGKDC.js → exitPlanMode-I7SGPSG4.js} +1 -1
  17. package/chunks/{geminiContentGenerator-KREJG645.js → geminiContentGenerator-SBVCQ423.js} +1 -1
  18. package/chunks/{glob-5KRIE6H7.js → glob-F5YOX6YA.js} +1 -1
  19. package/chunks/{grep-7DFZLLVF.js → grep-UOIHSM5U.js} +1 -1
  20. package/chunks/{matildaAgentContentGenerator-26CUAKWA.js → matildaAgentContentGenerator-EIQI4YCP.js} +1 -1
  21. package/chunks/{matildaContentGenerator-BSVWQR2W.js → matildaContentGenerator-QMMGDPIK.js} +1 -1
  22. package/chunks/{monitor-H2MC6NKG.js → monitor-GDKHPTET.js} +1 -1
  23. package/chunks/{notebook-edit-5QODZMUP.js → notebook-edit-LWH7H4WX.js} +1 -1
  24. package/chunks/{openaiContentGenerator-EKVEUZ2K.js → openaiContentGenerator-TNZ6SB7H.js} +1 -1
  25. package/chunks/{read-file-HEVXSNSO.js → read-file-URGJTANM.js} +1 -1
  26. package/chunks/{ripGrep-K7VQSLJ5.js → ripGrep-SL4ICAX6.js} +1 -1
  27. package/chunks/{scheduler-F3YFD46T.js → scheduler-EX674HYK.js} +1 -1
  28. package/chunks/{serve-4VYPXKC7.js → serve-FZ4FTA5D.js} +1 -1
  29. package/chunks/{shell-OCVLJZLW.js → shell-LLU55LCI.js} +1 -1
  30. package/chunks/{skill-OJXOVFQ2.js → skill-KSYY6BM6.js} +1 -1
  31. package/chunks/src-UXJDJ3RJ.js +3 -0
  32. package/chunks/{team-create-M4PATT2E.js → team-create-7PFAVYVV.js} +1 -1
  33. package/chunks/{tool-search-47TA6SG4.js → tool-search-7D46IF5G.js} +1 -1
  34. package/chunks/{workflow-7MKBMBDX.js → workflow-2TGFLD2R.js} +2 -2
  35. package/chunks/{write-file-XQIFTZC6.js → write-file-DQ6NYEJ7.js} +1 -1
  36. package/cli.js +402 -402
  37. package/package.json +2 -2
  38. package/sandbox-macos-restrictive-open.sb +22 -2
  39. package/chunks/src-7GFXY42I.js +0 -3
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as k}from"./chunk-ILBTI4K5.js";import{Hf as M,I as w,kg as $}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as G,i as R,p as T,q as _}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{Y as f}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as h}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";h();h();h();var E=f("GATE_REVIEW_AGENTS");function L(n){return`You are a Plan Design Reviewer for the Plan Approval Gate. Review the plan across three dimensions:
3
+ import{a as k}from"./chunk-ILBTI4K5.js";import{Hf as M,I as w,kg as $}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as G,i as R,p as T,q as _}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{Y as f}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as h}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";h();h();h();var E=f("GATE_REVIEW_AGENTS");function L(n){return`You are a Plan Design Reviewer for the Plan Approval Gate. Review the plan across three dimensions:
4
4
 
5
5
  1. **Request Fit** \u2014 Does the plan fulfill every part of the user's original request and respect all explicit constraints? Does it do anything the user explicitly asked NOT to do?
6
6
  2. **System Fit** \u2014 Does the plan align with the codebase structure, file paths, function names, permission model, and integration boundaries found during investigation?
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as g}from"./chunk-EMWHQSMS.js";import{g as u}from"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{f as d}from"./chunk-SDTWBD62.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-FWDMPRKU.js";import{b as m}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";m();m();var p=class{googleGenAI;contentGeneratorConfig;constructor(e,t){let r=t?.customHeaders,n=r?(()=>{let i=e.httpOptions,s=i?.headers??{},l=Object.fromEntries(Object.entries(r).filter(([a])=>!d(a)));return{...e,httpOptions:{...i??{},headers:{...s,...l}}}})():e;this.googleGenAI=new u(n),this.contentGeneratorConfig=t}buildGenerateContentConfig(e){let t=this.contentGeneratorConfig?.samplingParams,r=e.config||{},n=(i,s,l)=>{let a=r[s];return i!==void 0?i:a!==void 0?a:l};return{...r,temperature:n(t?.temperature,"temperature",1),topP:n(t?.top_p,"topP",.95),topK:n(t?.top_k,"topK",64),maxOutputTokens:n(t?.max_tokens,"maxOutputTokens"),presencePenalty:n(t?.presence_penalty,"presencePenalty"),frequencyPenalty:n(t?.frequency_penalty,"frequencyPenalty"),thinkingConfig:n(this.buildThinkingConfig(),"thinkingConfig",{includeThoughts:!0,thinkingLevel:"THINKING_LEVEL_UNSPECIFIED"})}}buildThinkingConfig(){let e=this.contentGeneratorConfig?.reasoning;if(e===!1)return{includeThoughts:!1};if(e)return{includeThoughts:!0,thinkingLevel:e.effort==="low"?"LOW":e.effort==="high"||e.effort==="max"?"HIGH":"THINKING_LEVEL_UNSPECIFIED"}}async generateContent(e,t){let r={...e,contents:this.stripUnsupportedFields(e.contents),config:this.buildGenerateContentConfig(e)};return this.googleGenAI.models.generateContent(r)}async generateContentStream(e,t){let r={...e,contents:this.stripUnsupportedFields(e.contents),config:this.buildGenerateContentConfig(e)};return this.googleGenAI.models.generateContentStream(r)}stripUnsupportedFields(e){return!e||typeof e=="string"?e:Array.isArray(e)?e.map(t=>this.stripContentFields(t)):this.stripContentFields(e)}stripContentFields(e){if(typeof e=="string")return e;if(!("role"in e)&&!("parts"in e))return this.stripPartFields(e);let t=e;return t.parts?{...t,parts:t.parts.map(r=>this.stripPartFields(r))}:t}stripPartFields(e){if(typeof e=="string")return e;let t={...e};if(t.inlineData){let{displayName:r,...n}=t.inlineData;t.inlineData=n}if(t.fileData){let{displayName:r,...n}=t.fileData;t.fileData=n}if(t.functionResponse?.parts){let r=t.functionResponse.parts.map(n=>{let i=this.convertUnsupportedMediaToText(n);return this.stripPartFields(i)});t.functionResponse={...t.functionResponse,parts:r}}return t}convertUnsupportedMediaToText(e){if(typeof e=="string")return e;let t=e.inlineData?.mimeType||"",r=e.fileData?.mimeType||"";if(t.startsWith("audio/")||t.startsWith("video/")){let n=e.inlineData?.displayName,i=n?` (${n})`:"";return{text:`Unsupported media type for Gemini: ${t}${i}.`}}if(r.startsWith("audio/")||r.startsWith("video/")){let n=e.fileData?.displayName,i=n?` (${n})`:"";return{text:`Unsupported media type for Gemini: ${r}${i}.`}}return e}async countTokens(e){return this.googleGenAI.models.countTokens(e)}async embedContent(e){return this.googleGenAI.models.embedContent(e)}useSummarizedThinking(){return!0}};function T(o,e){let i={...{"User-Agent":o.userAgent||`MatildaCode/0.21.2-nightly.20260823.b0c771373 (${process.platform}; ${process.arch})`}};if(e?.getUsageStatisticsEnabled()){let f=new g().getInstallationId();i={...i,"x-gemini-api-privileged-user-id":`${f}`}}let s=o.baseUrl?{headers:i,baseUrl:o.baseUrl}:{headers:i};return new p({apiKey:o.apiKey===""?void 0:o.apiKey,vertexai:o.vertexai,httpOptions:s},o)}export{p as GeminiContentGenerator,T as createGeminiContentGenerator};
3
+ import{a as g}from"./chunk-EMWHQSMS.js";import{g as u}from"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{f as d}from"./chunk-SDTWBD62.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-FWDMPRKU.js";import{b as m}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";m();m();var p=class{googleGenAI;contentGeneratorConfig;constructor(e,t){let r=t?.customHeaders,n=r?(()=>{let i=e.httpOptions,s=i?.headers??{},l=Object.fromEntries(Object.entries(r).filter(([a])=>!d(a)));return{...e,httpOptions:{...i??{},headers:{...s,...l}}}})():e;this.googleGenAI=new u(n),this.contentGeneratorConfig=t}buildGenerateContentConfig(e){let t=this.contentGeneratorConfig?.samplingParams,r=e.config||{},n=(i,s,l)=>{let a=r[s];return i!==void 0?i:a!==void 0?a:l};return{...r,temperature:n(t?.temperature,"temperature",1),topP:n(t?.top_p,"topP",.95),topK:n(t?.top_k,"topK",64),maxOutputTokens:n(t?.max_tokens,"maxOutputTokens"),presencePenalty:n(t?.presence_penalty,"presencePenalty"),frequencyPenalty:n(t?.frequency_penalty,"frequencyPenalty"),thinkingConfig:n(this.buildThinkingConfig(),"thinkingConfig",{includeThoughts:!0,thinkingLevel:"THINKING_LEVEL_UNSPECIFIED"})}}buildThinkingConfig(){let e=this.contentGeneratorConfig?.reasoning;if(e===!1)return{includeThoughts:!1};if(e)return{includeThoughts:!0,thinkingLevel:e.effort==="low"?"LOW":e.effort==="high"||e.effort==="max"?"HIGH":"THINKING_LEVEL_UNSPECIFIED"}}async generateContent(e,t){let r={...e,contents:this.stripUnsupportedFields(e.contents),config:this.buildGenerateContentConfig(e)};return this.googleGenAI.models.generateContent(r)}async generateContentStream(e,t){let r={...e,contents:this.stripUnsupportedFields(e.contents),config:this.buildGenerateContentConfig(e)};return this.googleGenAI.models.generateContentStream(r)}stripUnsupportedFields(e){return!e||typeof e=="string"?e:Array.isArray(e)?e.map(t=>this.stripContentFields(t)):this.stripContentFields(e)}stripContentFields(e){if(typeof e=="string")return e;if(!("role"in e)&&!("parts"in e))return this.stripPartFields(e);let t=e;return t.parts?{...t,parts:t.parts.map(r=>this.stripPartFields(r))}:t}stripPartFields(e){if(typeof e=="string")return e;let t={...e};if(t.inlineData){let{displayName:r,...n}=t.inlineData;t.inlineData=n}if(t.fileData){let{displayName:r,...n}=t.fileData;t.fileData=n}if(t.functionResponse?.parts){let r=t.functionResponse.parts.map(n=>{let i=this.convertUnsupportedMediaToText(n);return this.stripPartFields(i)});t.functionResponse={...t.functionResponse,parts:r}}return t}convertUnsupportedMediaToText(e){if(typeof e=="string")return e;let t=e.inlineData?.mimeType||"",r=e.fileData?.mimeType||"";if(t.startsWith("audio/")||t.startsWith("video/")){let n=e.inlineData?.displayName,i=n?` (${n})`:"";return{text:`Unsupported media type for Gemini: ${t}${i}.`}}if(r.startsWith("audio/")||r.startsWith("video/")){let n=e.fileData?.displayName,i=n?` (${n})`:"";return{text:`Unsupported media type for Gemini: ${r}${i}.`}}return e}async countTokens(e){return this.googleGenAI.models.countTokens(e)}async embedContent(e){return this.googleGenAI.models.embedContent(e)}useSummarizedThinking(){return!0}};function T(o,e){let i={...{"User-Agent":o.userAgent||`MatildaCode/0.21.3 (${process.platform}; ${process.arch})`}};if(e?.getUsageStatisticsEnabled()){let f=new g().getInstallationId();i={...i,"x-gemini-api-privileged-user-id":`${f}`}}let s=o.baseUrl?{headers:i,baseUrl:o.baseUrl}:{headers:i};return new p({apiKey:o.apiKey===""?void 0:o.apiKey,vertexai:o.vertexai,httpOptions:s},o)}export{p as GeminiContentGenerator,T as createGeminiContentGenerator};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Google LLC
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Pe as _,Qe as j}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import"./chunk-QKYGQLWC.js";import"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import{b as D}from"./chunk-RNKDFE2S.js";import"./chunk-EMWHQSMS.js";import"./chunk-S4K76QPI.js";import"./chunk-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{g as k}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as M,i as C,p as N,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{C as $,F as O,J as v,Y as R,c as x}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as L}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";L();import z from"node:fs";import T from"node:path";var V=R("GLOB"),Y=100,B=2e4,W=15e3,q=500;function K(u,g,t){let e=[...u];return e.sort((r,s)=>{let c=r.mtimeMs??0,a=s.mtimeMs??0,o=g-c<t,l=g-a<t;return o&&l?a-c:o?-1:l?1:r.fullpath().localeCompare(s.fullpath())}),e}var S=class extends M{constructor(t,e){super(e);this.config=t;this.fileService=t.getFileService()}fileService;getDescription(){let t=`'${this.params.pattern}'`;return this.params.path&&(t+=` in path '${this.params.path}'`),t}async getDefaultPermission(){if(!this.params.path)return"allow";let t=this.config.getWorkspaceContext(),e=T.resolve(this.config.getTargetDir(),this.params.path);return t.isPathWithinWorkspace(e)||O(k(),e)?"allow":"ask"}async globInDirectory(t,e,r){let s=e,c=T.join(t,s);z.existsSync(c)&&(s=_(s));let a=j(s,{cwd:t,withFileTypes:!0,nodir:!0,stat:!0,nocase:!0,dot:!0,ignore:this.config.getFileExclusions().getGlobExcludes(),follow:!1,signal:r}),o=[],l=Date.now(),p=null;for await(let n of a){if(o.push(n),o.length>=B){p="count";break}if(Date.now()-l>W){p="time";break}o.length%q===0&&await new Promise(b=>setImmediate(b))}p&&a.destroy?.();let d=this.config.getTargetDir(),P=o.map(n=>T.relative(d,n.fullpath())),{filteredPaths:m}=this.fileService.filterFilesWithReport(P,this.getFileFilteringOptions()),h=n=>process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n,f=new Set(m.map(n=>h(T.resolve(d,n))));return{entries:o.filter(n=>f.has(h(n.fullpath()))),limited:p}}async execute(t){try{let e=[],r;if(this.params.path){let i=v(this.config,this.params.path,{allowExternalPaths:!0});e.push(i),r=`within ${i}`}else{let i=this.config.getWorkspaceContext().getDirectories();e.push(...i),r=i.length>1?`across ${i.length} workspace directories`:"in the workspace directory"}let s=this.params.pattern,c=[],a=new Set,o=null;for(let i of e){let{entries:F,limited:E}=await this.globInDirectory(i,s,t);E&&(o=E);for(let G of F){let I=G.fullpath();a.has(I)||(a.add(I),c.push(G))}}let l=c,p=o==="time"?`
3
+ import{Pe as _,Qe as j}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import"./chunk-QKYGQLWC.js";import"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import{b as D}from"./chunk-RNKDFE2S.js";import"./chunk-EMWHQSMS.js";import"./chunk-S4K76QPI.js";import"./chunk-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{g as k}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as M,i as C,p as N,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{C as $,F as O,J as v,Y as R,c as x}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as L}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";L();import z from"node:fs";import T from"node:path";var V=R("GLOB"),Y=100,B=2e4,W=15e3,q=500;function K(u,g,t){let e=[...u];return e.sort((r,s)=>{let c=r.mtimeMs??0,a=s.mtimeMs??0,o=g-c<t,l=g-a<t;return o&&l?a-c:o?-1:l?1:r.fullpath().localeCompare(s.fullpath())}),e}var S=class extends M{constructor(t,e){super(e);this.config=t;this.fileService=t.getFileService()}fileService;getDescription(){let t=`'${this.params.pattern}'`;return this.params.path&&(t+=` in path '${this.params.path}'`),t}async getDefaultPermission(){if(!this.params.path)return"allow";let t=this.config.getWorkspaceContext(),e=T.resolve(this.config.getTargetDir(),this.params.path);return t.isPathWithinWorkspace(e)||O(k(),e)?"allow":"ask"}async globInDirectory(t,e,r){let s=e,c=T.join(t,s);z.existsSync(c)&&(s=_(s));let a=j(s,{cwd:t,withFileTypes:!0,nodir:!0,stat:!0,nocase:!0,dot:!0,ignore:this.config.getFileExclusions().getGlobExcludes(),follow:!1,signal:r}),o=[],l=Date.now(),p=null;for await(let n of a){if(o.push(n),o.length>=B){p="count";break}if(Date.now()-l>W){p="time";break}o.length%q===0&&await new Promise(b=>setImmediate(b))}p&&a.destroy?.();let d=this.config.getTargetDir(),P=o.map(n=>T.relative(d,n.fullpath())),{filteredPaths:m}=this.fileService.filterFilesWithReport(P,this.getFileFilteringOptions()),h=n=>process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n,f=new Set(m.map(n=>h(T.resolve(d,n))));return{entries:o.filter(n=>f.has(h(n.fullpath()))),limited:p}}async execute(t){try{let e=[],r;if(this.params.path){let i=v(this.config,this.params.path,{allowExternalPaths:!0});e.push(i),r=`within ${i}`}else{let i=this.config.getWorkspaceContext().getDirectories();e.push(...i),r=i.length>1?`across ${i.length} workspace directories`:"in the workspace directory"}let s=this.params.pattern,c=[],a=new Set,o=null;for(let i of e){let{entries:F,limited:E}=await this.globInDirectory(i,s,t);E&&(o=E);for(let G of F){let I=G.fullpath();a.has(I)||(a.add(I),c.push(G))}}let l=c,p=o==="time"?`
4
4
 
5
5
  [Search stopped after ${W/1e3}s before scanning the whole tree. Results may be incomplete \u2014 narrow the search by passing a more specific 'path' or pattern.]`:o==="count"?`
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Ij as K,Jj as Y,Qe as z,aa as q,ed as F}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{g as _}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as U,i as V,p as H,q as J}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{C as O,F as W,J as S,Y as j,a as I,c as P}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as B}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";B();import tt from"node:fs/promises";import y from"node:path";import{EOL as et}from"node:os";import{spawn as X}from"node:child_process";var k=j("GREP"),M=class extends U{constructor(e,s){super(s);this.config=e;this.fileExclusions=e.getFileExclusions()}fileExclusions;async getDefaultPermission(){if(!this.params.path)return"allow";let e=this.config.getWorkspaceContext(),s=y.resolve(this.config.getTargetDir(),this.params.path);return e.isPathWithinWorkspace(s)||W(_(),s)?"allow":"ask"}async execute(e){try{let s=[],i;if(this.params.path){let t=S(this.config,this.params.path,{allowExternalPaths:!0});s.push(t),i=`in path "${this.params.path}"`}else{let t=this.config.getWorkspaceContext().getDirectories();s.push(...t),i=t.length>1?`across ${t.length} workspace directories`:"in the workspace directory"}let l=[];for(let t of s){let o=await this.performGrepSearch({pattern:this.params.pattern,path:t,glob:this.params.glob,signal:e});if(s.length>1)for(let a of o)y.isAbsolute(a.filePath)||(a.filePath=y.resolve(t,a.filePath));l.push(...o)}if(s.length>1){let t=new Set;l=l.filter(o=>{let a=`${o.filePath}:${o.lineNumber}`;return t.has(a)?!1:(t.add(a),!0)})}let f=this.params.glob?` (filter: "${this.params.glob}")`:"";if(l.length===0)return{llmContent:`No matches found for pattern "${this.params.pattern}" ${i}${f}.`,returnDisplay:"No matches found"};let h=this.config.getTruncateToolOutputThreshold(),w=Math.min(this.config.getTruncateToolOutputLines(),this.params.limit??Number.POSITIVE_INFINITY),$=!1,C=l;l.length>w&&(C=l.slice(0,w),$=!0);let E=l.length,x=E===1?"match":"matches",G=`Found ${E} ${x} for pattern "${this.params.pattern}" ${i}${f}:
3
+ import{Jj as K,Kj as Y,Qe as z,aa as q,ed as F}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{g as _}from"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as U,i as V,p as H,q as J}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{C as O,F as W,J as S,Y as j,a as I,c as P}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as B}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";B();import tt from"node:fs/promises";import y from"node:path";import{EOL as et}from"node:os";import{spawn as X}from"node:child_process";var k=j("GREP"),M=class extends U{constructor(e,s){super(s);this.config=e;this.fileExclusions=e.getFileExclusions()}fileExclusions;async getDefaultPermission(){if(!this.params.path)return"allow";let e=this.config.getWorkspaceContext(),s=y.resolve(this.config.getTargetDir(),this.params.path);return e.isPathWithinWorkspace(s)||W(_(),s)?"allow":"ask"}async execute(e){try{let s=[],i;if(this.params.path){let t=S(this.config,this.params.path,{allowExternalPaths:!0});s.push(t),i=`in path "${this.params.path}"`}else{let t=this.config.getWorkspaceContext().getDirectories();s.push(...t),i=t.length>1?`across ${t.length} workspace directories`:"in the workspace directory"}let l=[];for(let t of s){let o=await this.performGrepSearch({pattern:this.params.pattern,path:t,glob:this.params.glob,signal:e});if(s.length>1)for(let a of o)y.isAbsolute(a.filePath)||(a.filePath=y.resolve(t,a.filePath));l.push(...o)}if(s.length>1){let t=new Set;l=l.filter(o=>{let a=`${o.filePath}:${o.lineNumber}`;return t.has(a)?!1:(t.add(a),!0)})}let f=this.params.glob?` (filter: "${this.params.glob}")`:"";if(l.length===0)return{llmContent:`No matches found for pattern "${this.params.pattern}" ${i}${f}.`,returnDisplay:"No matches found"};let h=this.config.getTruncateToolOutputThreshold(),w=Math.min(this.config.getTruncateToolOutputLines(),this.params.limit??Number.POSITIVE_INFINITY),$=!1,C=l;l.length>w&&(C=l.slice(0,w),$=!0);let E=l.length,x=E===1?"match":"matches",G=`Found ${E} ${x} for pattern "${this.params.pattern}" ${i}${f}:
4
4
  ---
5
5
  `,v=C.reduce((t,o)=>{let a=o.filePath;return t[a]||(t[a]=[]),t[a].push(o),t[a].sort((L,D)=>L.lineNumber-D.lineNumber),t},{}),n="",g=[],m=!1,c=(t,o)=>Number.isFinite(h)&&n.length+t.length>h?(n+=t.slice(0,Math.max(h-n.length,0)),n+="...",o&&g.push(o),m=!0,!1):(n+=t,o&&g.push(o),!0);for(let t in v){if(!c(`File: ${t}
6
6
  `))break;let o=!1;for(let a of v[t]){let L=a.line.trim();if(!c(`L${a.lineNumber}: ${L}
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{M as F,N as U,O as j,g as x,la as $}from"./chunk-5RG6AVD6.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import{b as m,e as b}from"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{k as O,n as I}from"./chunk-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{p as P}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as w}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";w();w();var W="2026-06-23",H="auto",J="instant",V=12e4,h=18e4,X=5e4,v=16e3,k=class extends Error{code="EMATILDA_STREAM_INCOMPLETE";constructor(){super("Matilda agent stream ended without an authoritative done signal."),this.name="MatildaAgentStreamProtocolError"}},B=["Treat this as Matilda Code traffic.","Prefer the code specialist path for implementation, debugging, refactoring, tests, repo edits, and code review.","Use the fast instruct path for simple coordination, status, clarification, or non-code conversational replies.","Keep the response concise and action-oriented."].join(" "),K=["You are powering Matilda Code, an interactive terminal coding agent.","Matilda Code owns the local agent loop: codebase reads, edits, shell commands, approvals, memory, subagents, skills, and MCP tools run through the CLI.","Use the conversation context and tool results as facts. Do not claim to have inspected files, run commands, or edited code unless that action appears in the provided context.",`When the user gives a vague starter such as "let's code" without a concrete development task, ask a concise clarifying question instead of inventing an app or dumping code.`].join(" ");function z(n){let e=(n||"https://matilda.maincode.com/api/v1").trim().replace(/\/+$/,"");return/\/api\/v1$/i.test(e)?e.replace(/\/api\/v1$/i,"/api"):/\/api$/i.test(e)?e:`${e}/api`}function T(n){try{let e=JSON.parse(n);return e&&typeof e=="object"?e:void 0}catch{return}}function u(n,e){let o=T(n)?.[e];return typeof o=="string"?o:void 0}function D(n){return S(n)}function S(n){return typeof n=="string"?n:Array.isArray(n)?n.map(e=>{if(typeof e=="string")return e;if(!e||typeof e!="object")return"";let t=e;return typeof t.text=="string"?t.text:t.image_url?"[image omitted: Matilda native chat accepts text only]":t.input_audio?"[audio omitted: Matilda native chat accepts text only]":t.file?"[file omitted: Matilda native chat accepts text only]":""}).filter(Boolean).join(`
3
+ import{M as F,N as U,O as j,g as x,la as $}from"./chunk-FU2PKCG5.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import{b as m,e as b}from"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{k as O,n as I}from"./chunk-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{p as P}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as w}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";w();w();var W="2026-06-23",H="auto",J="instant",V=12e4,h=18e4,X=5e4,v=16e3,k=class extends Error{code="EMATILDA_STREAM_INCOMPLETE";constructor(){super("Matilda agent stream ended without an authoritative done signal."),this.name="MatildaAgentStreamProtocolError"}},B=["Treat this as Matilda Code traffic.","Prefer the code specialist path for implementation, debugging, refactoring, tests, repo edits, and code review.","Use the fast instruct path for simple coordination, status, clarification, or non-code conversational replies.","Keep the response concise and action-oriented."].join(" "),K=["You are powering Matilda Code, an interactive terminal coding agent.","Matilda Code owns the local agent loop: codebase reads, edits, shell commands, approvals, memory, subagents, skills, and MCP tools run through the CLI.","Use the conversation context and tool results as facts. Do not claim to have inspected files, run commands, or edited code unless that action appears in the provided context.",`When the user gives a vague starter such as "let's code" without a concrete development task, ask a concise clarifying question instead of inventing an app or dumping code.`].join(" ");function z(n){let e=(n||"https://matilda.maincode.com/api/v1").trim().replace(/\/+$/,"");return/\/api\/v1$/i.test(e)?e.replace(/\/api\/v1$/i,"/api"):/\/api$/i.test(e)?e:`${e}/api`}function T(n){try{let e=JSON.parse(n);return e&&typeof e=="object"?e:void 0}catch{return}}function u(n,e){let o=T(n)?.[e];return typeof o=="string"?o:void 0}function D(n){return S(n)}function S(n){return typeof n=="string"?n:Array.isArray(n)?n.map(e=>{if(typeof e=="string")return e;if(!e||typeof e!="object")return"";let t=e;return typeof t.text=="string"?t.text:t.image_url?"[image omitted: Matilda native chat accepts text only]":t.input_audio?"[audio omitted: Matilda native chat accepts text only]":t.file?"[file omitted: Matilda native chat accepts text only]":""}).filter(Boolean).join(`
4
4
  `):""}function g(n,e){if(n.length<=e)return n;let t=`
5
5
  [...omitted to fit Matilda native agent context...]
6
6
  `,o=e-t.length,s=Math.floor(o*.6),i=o-s;return`${n.slice(0,s)}${t}${n.slice(-i)}`}function Q(n){return(n.candidates?.[0]?.content?.parts??[]).map(t=>typeof t=="string"?t:"thought"in t&&t.thought?"":"text"in t&&t.text||"").join("")}function Y(n){let e=T(n),t=typeof e?.output_tokens=="number"?e.output_tokens:void 0;if(t!==void 0)return{promptTokenCount:0,candidatesTokenCount:t,totalTokenCount:t,usageIsIncomplete:!0}}function C(n){return JSON.stringify(n).length}function Z(n){if(C(n)<=h)return n;let e=`
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as d,i as u}from"./chunk-FMNQXZTW.js";import"./chunk-QCIDUZV6.js";import"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.js";import"./chunk-4F4DA5UI.js";import{d as o}from"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{k as s}from"./chunk-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import{c}from"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{Y as i}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as a}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";a();var l=class extends u{debugLogger=i("MATILDA");matildaClient;sharedManager;currentToken;constructor(e,t,r){let n=new d(t,r);super(t,r,n),this.matildaClient=e,this.sharedManager=c.getInstance(),t?.baseUrl&&t?.apiKey&&(this.pipeline.client.baseURL=t?.baseUrl,this.pipeline.client.apiKey=t?.apiKey)}getCurrentEndpoint(e){let t=e||o,r="/v1",n=t.startsWith("http")?t:`https://${t}`;return n.endsWith(r)||n.endsWith("/api/v1")||n.endsWith("/api/v1/code")?n:`${n}${r}`}shouldSuppressErrorLogging(e,t){return this.isAuthError(e)}async getValidToken(){try{let e=await this.sharedManager.getValidCredentials(this.matildaClient);if(!e.access_token)throw new Error("No access token available");return{token:e.access_token,endpoint:this.getCurrentEndpoint(e.resource_url)}}catch(e){throw this.isAuthError(e)?e:(this.debugLogger.warn("Failed to get token from shared manager:",e),new Error("Failed to obtain a valid legacy OAuth access token. Please re-authenticate with Matilda."))}}async executeWithCredentialManagement(e){let t=async()=>{let{token:r,endpoint:n}=await this.getValidToken();return this.pipeline.client.apiKey=r,this.pipeline.client.baseURL=n,await e()};try{return await t()}catch(r){if(this.isAuthError(r))return await this.sharedManager.getValidCredentials(this.matildaClient,!0),await s("retry",t);throw r}}async generateContent(e,t){return this.executeWithCredentialManagement(()=>super.generateContent(e,t))}async generateContentStream(e,t){return this.executeWithCredentialManagement(()=>super.generateContentStream(e,t))}async countTokens(e){return super.countTokens(e)}async embedContent(e){return this.executeWithCredentialManagement(()=>super.embedContent(e))}isAuthError(e){if(!e)return!1;let t=e instanceof Error?e.message.toLowerCase():String(e).toLowerCase(),r=e,n=r?.status||r?.code;return n===401||n===403||n==="401"||n==="403"||t.includes("unauthorized")||t.includes("forbidden")||t.includes("invalid api key")||t.includes("invalid access token")||t.includes("token expired")||t.includes("authentication")||t.includes("access denied")||t.includes("token")&&t.includes("expired")}getCurrentToken(){return this.currentToken?this.currentToken:this.sharedManager.getCurrentCredentials()?.access_token||null}clearToken(){this.currentToken=void 0,this.sharedManager.clearCache()}};export{l as MatildaContentGenerator};
3
+ import{a as d,i as u}from"./chunk-IZ6YBZWM.js";import"./chunk-QCIDUZV6.js";import"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.js";import"./chunk-4F4DA5UI.js";import{d as o}from"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import{k as s}from"./chunk-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import{c}from"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{Y as i}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as a}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";a();var l=class extends u{debugLogger=i("MATILDA");matildaClient;sharedManager;currentToken;constructor(e,t,r){let n=new d(t,r);super(t,r,n),this.matildaClient=e,this.sharedManager=c.getInstance(),t?.baseUrl&&t?.apiKey&&(this.pipeline.client.baseURL=t?.baseUrl,this.pipeline.client.apiKey=t?.apiKey)}getCurrentEndpoint(e){let t=e||o,r="/v1",n=t.startsWith("http")?t:`https://${t}`;return n.endsWith(r)||n.endsWith("/api/v1")||n.endsWith("/api/v1/code")?n:`${n}${r}`}shouldSuppressErrorLogging(e,t){return this.isAuthError(e)}async getValidToken(){try{let e=await this.sharedManager.getValidCredentials(this.matildaClient);if(!e.access_token)throw new Error("No access token available");return{token:e.access_token,endpoint:this.getCurrentEndpoint(e.resource_url)}}catch(e){throw this.isAuthError(e)?e:(this.debugLogger.warn("Failed to get token from shared manager:",e),new Error("Failed to obtain a valid legacy OAuth access token. Please re-authenticate with Matilda."))}}async executeWithCredentialManagement(e){let t=async()=>{let{token:r,endpoint:n}=await this.getValidToken();return this.pipeline.client.apiKey=r,this.pipeline.client.baseURL=n,await e()};try{return await t()}catch(r){if(this.isAuthError(r))return await this.sharedManager.getValidCredentials(this.matildaClient,!0),await s("retry",t);throw r}}async generateContent(e,t){return this.executeWithCredentialManagement(()=>super.generateContent(e,t))}async generateContentStream(e,t){return this.executeWithCredentialManagement(()=>super.generateContentStream(e,t))}async countTokens(e){return super.countTokens(e)}async embedContent(e){return this.executeWithCredentialManagement(()=>super.embedContent(e))}isAuthError(e){if(!e)return!1;let t=e instanceof Error?e.message.toLowerCase():String(e).toLowerCase(),r=e,n=r?.status||r?.code;return n===401||n===403||n==="401"||n==="403"||t.includes("unauthorized")||t.includes("forbidden")||t.includes("invalid api key")||t.includes("invalid access token")||t.includes("token expired")||t.includes("authentication")||t.includes("access denied")||t.includes("token")&&t.includes("expired")}getCurrentToken(){return this.currentToken?this.currentToken:this.sharedManager.getCurrentCredentials()?.access_token||null}clearToken(){this.currentToken=void 0,this.sharedManager.clearCache()}};export{l as MatildaContentGenerator};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Matilda
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Dc as tt,Ie as st,Ne as L,Oc as et,Oe as at,Rc as ot,Sc as A,Xc as C,Yc as nt,ad as it,ni as P,pi as lt,xe as rt}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as Z,i as q,p as Y,q as Q}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{G as J,Y as K,c as m}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as H}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";H();import{spawn as ct}from"node:child_process";import mt from"node:path";import{randomUUID as wt}from"node:crypto";var u=K("MONITOR"),Et=1e3,O=1e4,St=3e5,N=6e5,dt=80,R=4096,ut=5,ft=1e3;function pt(l){return l.length>dt?l.slice(0,dt-1)+"\u2026":l}var kt=new Set(["task-notification","task-id","tool-use-id","kind","status","event-count","summary","result"]),xt=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)>/g;function gt(l){let y="";for(let t=0;t<l.length;t++){let o=l.charCodeAt(t);if(o===9){y+=l[t];continue}o<32||o>=128&&o<=159||(y+=l[t])}return y=y.replace(xt,(t,o,a)=>kt.has(String(a).toLowerCase())?o==="/"?`</\u200B${a}>`:`<\u200B${a}>`:t),y}var U=class extends Z{constructor(t,o){super(o);this.config=t}callId;setCallId(t){this.callId=t}getDescription(){let t=this.params.description||C(this.params.command).spawnCommand;return`Monitor: ${pt(t)}`}async getDefaultPermission(){let t=C(this.params.command).safetyCommand;try{if(await L(t))return"allow"}catch(o){u.warn("AST read-only check failed, falling back to ask:",o)}return"ask"}async getConfirmationDetails(t){let o=C(this.params.command),a=ot(o.safetyCommand),f=[];for(let s of a){let p=!1;try{p=await L(s)}catch(d){u.warn("AST read-only check failed for monitor sub-command, falling back to ask:",d)}p||f.push(s)}let S=f.length>0?f:a,M=[...new Set(S.map(s=>A(s)).filter(s=>!!s))],v=[];try{let s=[];for(let p of S){let d=await at(p);s.push(...d)}v=[...new Set(s)].map(p=>`Monitor(${p})`)}catch(s){u.warn("Failed to extract monitor command rules:",s),v=[`Monitor(${o.safetyCommand})`]}let i=it(o.safetyCommand,this.params.command),c={type:"exec",title:"Monitor",command:o.spawnCommand,rootCommand:M.join(", ")||(A(o.safetyCommand)??o.spawnCommand),permissionRules:v,onConfirm:async(s,p)=>{}};return i&&(c.warnings=i),c}async execute(t){if(t.aborted)return{llmContent:"Monitor was cancelled before it could start.",returnDisplay:"Monitor cancelled."};let o=C(this.params.command),a=o.spawnCommand;o.strippedTrailingAmp&&u.warn("Stripped trailing & from monitor command \u2014 monitor lifecycle handles backgrounding");let f=gt(this.params.description||a),S=pt(f),M=Math.min(this.params.max_events??Et,O),v=Math.min(this.params.idle_timeout_ms??St,N),i=`mon_${wt().replace(/-/g,"").slice(0,16)}`,c=this.config.getMonitorRegistry(),s=tt()??void 0;if(c.getRunning().length>=P)return{llmContent:`Cannot start monitor: maximum concurrent monitors (${P}) reached. Stop an existing monitor first.`,returnDisplay:"Monitor rejected: too many concurrent monitors."};let d=new AbortController,g={monitorId:i,command:a,description:f,status:"running",startTime:Date.now(),abortController:d,toolUseId:this.callId,eventCount:0,lastEventTime:0,maxEvents:M,idleTimeoutMs:v,droppedLines:0,outputFile:lt(this.config.storage.getProjectDir(),this.config.getSessionId(),i),...s?{ownerAgentId:s}:{}},{executable:yt,argsPrefix:vt}=et(),n;try{n=ct(yt,[...vt,a],{cwd:this.params.directory||this.config.getTargetDir(),stdio:["ignore","pipe","pipe"],detached:!0,env:{...process.env,MATILDA_CODE:"1",TERM:"dumb",PAGER:"cat",...st()}})}catch(e){return{llmContent:`Monitor failed to start: ${m(e)}`,returnDisplay:`Monitor failed: ${m(e)}`}}g.pid=n.pid;let b=!1,w,D=e=>{w??=e};n.on("error",D);let B={value:""},G={value:""},k=ut,I=Date.now(),$=e=>{let r=gt(e);if(r.length===0||r.trim().length===0)return;let T=Date.now(),_=T-I;if(_<0)u.warn(`Monitor ${i}: clock moved backwards by ${-_}ms, resetting refill timestamp`),I=T;else{let h=Math.floor(_/ft);h>0&&(k=Math.min(ut,k+h),I+=h*ft)}k>0?(k--,c.emitEvent(i,r)):g.droppedLines++},j=()=>{for(let e of[B,G]){let r=e.value.trim();r.length>0&&$(r),e.value=""}},Tt=()=>{if(!(b||!n.pid))if(process.platform==="win32")ct("taskkill",["/pid",n.pid.toString(),"/f","/t"],{stdio:"ignore"}).on("error",r=>u.warn(`Monitor taskkill failed for pid ${n.pid}: ${m(r)}`));else{try{process.kill(-n.pid,"SIGTERM")}catch(e){u.warn(`Monitor ${i} SIGTERM failed (pid=${n.pid}): ${m(e)}`)}setTimeout(()=>{if(!b&&n.pid)try{process.kill(-n.pid,"SIGKILL")}catch(e){u.warn(`Monitor ${i} SIGKILL escalation failed (pid=${n.pid}): ${m(e)}`)}},200).unref?.()}},E=()=>{j(),Tt()};d.signal.addEventListener("abort",E,{once:!0}),d.signal.aborted&&E();try{c.register(g)}catch(e){return E(),d.signal.removeEventListener("abort",E),n.stdout?.destroy?.(),n.stderr?.destroy?.(),n.removeListener("error",D),n.on("error",()=>{}),{llmContent:`Monitor failed to start: ${m(e)}`,returnDisplay:`Monitor failed: ${m(e)}`}}let z=(e,r)=>{if(g.status!=="running")return;let T=rt(r.toString("utf-8"));if(e.value+=T,!e.value.includes(`
3
+ import{Dc as tt,Ie as st,Ne as L,Oc as et,Oe as at,Rc as ot,Sc as A,Xc as C,Yc as nt,ad as it,oi as P,qi as lt,xe as rt}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as Z,i as q,p as Y,q as Q}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{G as J,Y as K,c as m}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as H}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";H();import{spawn as ct}from"node:child_process";import mt from"node:path";import{randomUUID as wt}from"node:crypto";var u=K("MONITOR"),Et=1e3,O=1e4,St=3e5,N=6e5,dt=80,R=4096,ut=5,ft=1e3;function pt(l){return l.length>dt?l.slice(0,dt-1)+"\u2026":l}var kt=new Set(["task-notification","task-id","tool-use-id","kind","status","event-count","summary","result"]),xt=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)>/g;function gt(l){let y="";for(let t=0;t<l.length;t++){let o=l.charCodeAt(t);if(o===9){y+=l[t];continue}o<32||o>=128&&o<=159||(y+=l[t])}return y=y.replace(xt,(t,o,a)=>kt.has(String(a).toLowerCase())?o==="/"?`</\u200B${a}>`:`<\u200B${a}>`:t),y}var U=class extends Z{constructor(t,o){super(o);this.config=t}callId;setCallId(t){this.callId=t}getDescription(){let t=this.params.description||C(this.params.command).spawnCommand;return`Monitor: ${pt(t)}`}async getDefaultPermission(){let t=C(this.params.command).safetyCommand;try{if(await L(t))return"allow"}catch(o){u.warn("AST read-only check failed, falling back to ask:",o)}return"ask"}async getConfirmationDetails(t){let o=C(this.params.command),a=ot(o.safetyCommand),f=[];for(let s of a){let p=!1;try{p=await L(s)}catch(d){u.warn("AST read-only check failed for monitor sub-command, falling back to ask:",d)}p||f.push(s)}let S=f.length>0?f:a,M=[...new Set(S.map(s=>A(s)).filter(s=>!!s))],v=[];try{let s=[];for(let p of S){let d=await at(p);s.push(...d)}v=[...new Set(s)].map(p=>`Monitor(${p})`)}catch(s){u.warn("Failed to extract monitor command rules:",s),v=[`Monitor(${o.safetyCommand})`]}let i=it(o.safetyCommand,this.params.command),c={type:"exec",title:"Monitor",command:o.spawnCommand,rootCommand:M.join(", ")||(A(o.safetyCommand)??o.spawnCommand),permissionRules:v,onConfirm:async(s,p)=>{}};return i&&(c.warnings=i),c}async execute(t){if(t.aborted)return{llmContent:"Monitor was cancelled before it could start.",returnDisplay:"Monitor cancelled."};let o=C(this.params.command),a=o.spawnCommand;o.strippedTrailingAmp&&u.warn("Stripped trailing & from monitor command \u2014 monitor lifecycle handles backgrounding");let f=gt(this.params.description||a),S=pt(f),M=Math.min(this.params.max_events??Et,O),v=Math.min(this.params.idle_timeout_ms??St,N),i=`mon_${wt().replace(/-/g,"").slice(0,16)}`,c=this.config.getMonitorRegistry(),s=tt()??void 0;if(c.getRunning().length>=P)return{llmContent:`Cannot start monitor: maximum concurrent monitors (${P}) reached. Stop an existing monitor first.`,returnDisplay:"Monitor rejected: too many concurrent monitors."};let d=new AbortController,g={monitorId:i,command:a,description:f,status:"running",startTime:Date.now(),abortController:d,toolUseId:this.callId,eventCount:0,lastEventTime:0,maxEvents:M,idleTimeoutMs:v,droppedLines:0,outputFile:lt(this.config.storage.getProjectDir(),this.config.getSessionId(),i),...s?{ownerAgentId:s}:{}},{executable:yt,argsPrefix:vt}=et(),n;try{n=ct(yt,[...vt,a],{cwd:this.params.directory||this.config.getTargetDir(),stdio:["ignore","pipe","pipe"],detached:!0,env:{...process.env,MATILDA_CODE:"1",TERM:"dumb",PAGER:"cat",...st()}})}catch(e){return{llmContent:`Monitor failed to start: ${m(e)}`,returnDisplay:`Monitor failed: ${m(e)}`}}g.pid=n.pid;let b=!1,w,D=e=>{w??=e};n.on("error",D);let B={value:""},G={value:""},k=ut,I=Date.now(),$=e=>{let r=gt(e);if(r.length===0||r.trim().length===0)return;let T=Date.now(),_=T-I;if(_<0)u.warn(`Monitor ${i}: clock moved backwards by ${-_}ms, resetting refill timestamp`),I=T;else{let h=Math.floor(_/ft);h>0&&(k=Math.min(ut,k+h),I+=h*ft)}k>0?(k--,c.emitEvent(i,r)):g.droppedLines++},j=()=>{for(let e of[B,G]){let r=e.value.trim();r.length>0&&$(r),e.value=""}},Tt=()=>{if(!(b||!n.pid))if(process.platform==="win32")ct("taskkill",["/pid",n.pid.toString(),"/f","/t"],{stdio:"ignore"}).on("error",r=>u.warn(`Monitor taskkill failed for pid ${n.pid}: ${m(r)}`));else{try{process.kill(-n.pid,"SIGTERM")}catch(e){u.warn(`Monitor ${i} SIGTERM failed (pid=${n.pid}): ${m(e)}`)}setTimeout(()=>{if(!b&&n.pid)try{process.kill(-n.pid,"SIGKILL")}catch(e){u.warn(`Monitor ${i} SIGKILL escalation failed (pid=${n.pid}): ${m(e)}`)}},200).unref?.()}},E=()=>{j(),Tt()};d.signal.addEventListener("abort",E,{once:!0}),d.signal.aborted&&E();try{c.register(g)}catch(e){return E(),d.signal.removeEventListener("abort",E),n.stdout?.destroy?.(),n.stderr?.destroy?.(),n.removeListener("error",D),n.on("error",()=>{}),{llmContent:`Monitor failed to start: ${m(e)}`,returnDisplay:`Monitor failed: ${m(e)}`}}let z=(e,r)=>{if(g.status!=="running")return;let T=rt(r.toString("utf-8"));if(e.value+=T,!e.value.includes(`
4
4
  `)&&e.value.length>R){let h=e.value.trim();h.length>0&&$(h.slice(0,R)+"..."),e.value="";return}let _=e.value.split(`
5
5
  `);e.value=_.pop()??"";for(let h of _){let x=h.trim();if(x.length===0)continue;let bt=x.length>R?x.slice(0,R)+"...":x;$(bt)}};n.stdout?.on("data",e=>z(B,e)),n.stderr?.on("data",e=>z(G,e));let F=!1,X=()=>{F||(F=!0,j(),d.signal.removeEventListener("abort",E),g.droppedLines>0&&u.info(`Monitor ${i} dropped ${g.droppedLines} lines due to throttling`))},V=null,_t=(e,r)=>{g.status==="running"&&(d.signal.aborted?c.cancel(i):e!==null&&e!==0?c.fail(i,`Exit code ${e}`):r?c.fail(i,`Killed by signal ${r}`):c.complete(i,e))},Ct=(e,r)=>{b=!0,V={code:e,sig:r}},Mt=(e,r)=>{b=!0,X();let T=V??{code:e,sig:r};_t(T.code,T.sig)},W=e=>{b=!0,X(),g.status==="running"&&c.fail(i,m(e))};return n.on("exit",Ct),n.on("close",Mt),n.on("error",W),n.removeListener("error",D),w?(W(w),{llmContent:`Monitor failed to start: ${m(w)}`,returnDisplay:`Monitor failed: ${m(w)}`}):{llmContent:`Monitor started.
6
6
  id: ${i}
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Le as y,We as X,Ze as Z,ja as R,qe as D,re as Y,tc as Q}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.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(`
3
+ import{Le as y,We as X,Ze as Z,ja as R,qe as D,re as Y,tc as Q}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.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-6QP5C76Y.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
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
5
 
6
6
  Updated source:
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m}from"./chunk-FMNQXZTW.js";import"./chunk-QCIDUZV6.js";import"./chunk-S4K76QPI.js";import{g as a}from"./chunk-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{h as ContentGenerationPipeline,c as DeepSeekOpenAICompatibleProvider,i as EnhancedErrorHandler,b as MatildaOpenAICompatibleProvider,k as MatildaOpenAIContentGenerator,g as MiMoOpenAICompatibleProvider,e as MiniMaxOpenAICompatibleProvider,f as MistralOpenAICompatibleProvider,a as OpenAIContentConverter,j as OpenAIContentGenerator,d as OpenRouterOpenAICompatibleProvider,l as createOpenAIContentGenerator,m as determineProvider};
3
+ import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m}from"./chunk-IZ6YBZWM.js";import"./chunk-QCIDUZV6.js";import"./chunk-S4K76QPI.js";import{g as a}from"./chunk-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{h as ContentGenerationPipeline,c as DeepSeekOpenAICompatibleProvider,i as EnhancedErrorHandler,b as MatildaOpenAICompatibleProvider,k as MatildaOpenAIContentGenerator,g as MiMoOpenAICompatibleProvider,e as MiniMaxOpenAICompatibleProvider,f as MistralOpenAICompatibleProvider,a as OpenAIContentConverter,j as OpenAIContentGenerator,d as OpenRouterOpenAICompatibleProvider,l as createOpenAIContentGenerator,m as determineProvider};
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{wc as a}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as ReadFileTool};
3
+ import{wc as a}from"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as ReadFileTool};
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Kj as a,Lj as b}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as RipGrepTool,a as _resetRipGrepCachesForTest};
3
+ import{Lj as a,Mj as b}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as RipGrepTool,a as _resetRipGrepCachesForTest};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{b as E}from"./chunk-7ZATDBWL.js";import{wa as P}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{L as l,Y as c}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as s}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";s();import{stat as V}from"node:fs/promises";import{join as p}from"node:path";s();import{readdir as N,stat as H,rm as F,rmdir as A}from"node:fs/promises";import{join as y}from"node:path";var k=c("HOUSEKEEPING"),U=24*60*60*1e3,$=60*60*1e3,_=20;function T(e){let t=e>0?e*U:$;return new Date(Date.now()-t)}async function b(e){let t={removed:0,errors:0},r=y(l.getGlobalMatildaDir(),P),i=e.excludeSessionIds??new Set,o;try{o=await N(r,{withFileTypes:!0})}catch(n){return G(n)||k.error("readdir failed",n),t}let a=o.filter(n=>n.isDirectory()&&!i.has(n.name)).map(n=>y(r,n.name));for(let n=0;n<a.length;n+=_){let v=a.slice(n,n+_);await Promise.all(v.map(async g=>{try{(await H(g)).mtime<e.cutoffDate&&(await F(g,{recursive:!0,force:!0}),t.removed++)}catch(w){t.errors++,k.error(`failed to sweep ${g}`,w)}}))}return await A(r).catch(()=>{}),t}function G(e){return e?.code==="ENOENT"}s();import{mkdir as Y,open as K,stat as I,unlink as D,writeFile as j}from"node:fs/promises";import{dirname as B}from"node:path";var m=c("HOUSEKEEPING"),q=24*60*60*1e3,J=60*60*1e3;async function R(e,t){let r=e.minIntervalMs??q,i=e.staleLockMs??J;if(await Y(B(e.lockPath),{recursive:!0,mode:448}).catch(()=>{}),await C(e.markerPath,r,e.name))return!1;let o=await h(e.lockPath);if(!o){try{let a=await I(e.lockPath);Date.now()-a.mtimeMs>i&&(await D(e.lockPath).catch(()=>{}),o=await h(e.lockPath))}catch{o=await h(e.lockPath)}if(!o)return m.debug(`${e.name}: skipping, lock held`),!1}try{if(await C(e.markerPath,r,e.name))return!1;let a=!1;try{await t(),a=!0}finally{if(a)try{await j(e.markerPath,new Date().toISOString())}catch(n){m.debug(`${e.name}: marker write failed (cleanup succeeded)`,n)}}return a}finally{await D(e.lockPath).catch(()=>{m.debug(`${e.name}: lock unlink failed (harmless)`)})}}async function C(e,t,r){try{let i=await I(e),o=Date.now()-i.mtimeMs;if(o<t)return m.debug(`${r}: skipping, ran ${o}ms ago`),!0}catch{}return!1}async function h(e){try{return await(await K(e,"wx")).close(),!0}catch(t){if(t?.code==="EEXIST")return!1;throw t}}var u=c("HOUSEKEEPING"),O=10*60*1e3,W=24*60*60*1e3,X=60*1e3,z=7*24*60*60*1e3,Q=60*1e3,f=".file-history-cleanup",d=!1;function pe(e,t){d||(d=!0,Z(e,t).catch(r=>{d=!1,u.error("scheduleFirstPass failed; chain will retry on next start",r)}))}async function Z(e,t){let r=p(l.getGlobalMatildaDir(),f),i=await L(r)?Q:O;u.debug(`first pass in ${i/1e3}s`),setTimeout(()=>S(e,t),i).unref()}async function L(e){try{let t=await V(e);return Date.now()-t.mtimeMs>z}catch{return!0}}async function M(e,t){if(E()<X){u.debug("user active, deferring 10 min"),setTimeout(()=>S(e,t),O).unref();return}try{await x(e,t)}catch(r){u.error("housekeeping pass failed; will retry next cycle",r)}setTimeout(()=>S(e,t),W).unref()}function S(e,t){M(e,t).catch(r=>{u.error("runPass rejected unexpectedly",r)})}async function x(e,t){let r=t.merged.general?.cleanupPeriodDays??30,i=T(r),o=e.getSessionId(),a=l.getGlobalMatildaDir();await R({name:"file-history-cleanup",markerPath:p(a,f),lockPath:p(a,f+".lock")},async()=>{let n=await b({cutoffDate:i,excludeSessionIds:new Set([o])});u.debug(`file-history: removed=${n.removed} errors=${n.errors}`)})}function Se(){d=!1}var we=L,Pe=x,Ee=M,ye=f;export{ye as _FILE_HISTORY_MARKER_FOR_TESTING,we as _needsCatchUpForTesting,Se as _resetForTesting,Pe as _runHousekeepingForTesting,Ee as _runPassForTesting,pe as startBackgroundHousekeeping};
3
+ import{b as E}from"./chunk-7ZATDBWL.js";import{wa as P}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{L as l,Y as c}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as s}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";s();import{stat as V}from"node:fs/promises";import{join as p}from"node:path";s();import{readdir as N,stat as H,rm as F,rmdir as A}from"node:fs/promises";import{join as y}from"node:path";var k=c("HOUSEKEEPING"),U=24*60*60*1e3,$=60*60*1e3,_=20;function T(e){let t=e>0?e*U:$;return new Date(Date.now()-t)}async function b(e){let t={removed:0,errors:0},r=y(l.getGlobalMatildaDir(),P),i=e.excludeSessionIds??new Set,o;try{o=await N(r,{withFileTypes:!0})}catch(n){return G(n)||k.error("readdir failed",n),t}let a=o.filter(n=>n.isDirectory()&&!i.has(n.name)).map(n=>y(r,n.name));for(let n=0;n<a.length;n+=_){let v=a.slice(n,n+_);await Promise.all(v.map(async g=>{try{(await H(g)).mtime<e.cutoffDate&&(await F(g,{recursive:!0,force:!0}),t.removed++)}catch(w){t.errors++,k.error(`failed to sweep ${g}`,w)}}))}return await A(r).catch(()=>{}),t}function G(e){return e?.code==="ENOENT"}s();import{mkdir as Y,open as K,stat as I,unlink as D,writeFile as j}from"node:fs/promises";import{dirname as B}from"node:path";var m=c("HOUSEKEEPING"),q=24*60*60*1e3,J=60*60*1e3;async function R(e,t){let r=e.minIntervalMs??q,i=e.staleLockMs??J;if(await Y(B(e.lockPath),{recursive:!0,mode:448}).catch(()=>{}),await C(e.markerPath,r,e.name))return!1;let o=await h(e.lockPath);if(!o){try{let a=await I(e.lockPath);Date.now()-a.mtimeMs>i&&(await D(e.lockPath).catch(()=>{}),o=await h(e.lockPath))}catch{o=await h(e.lockPath)}if(!o)return m.debug(`${e.name}: skipping, lock held`),!1}try{if(await C(e.markerPath,r,e.name))return!1;let a=!1;try{await t(),a=!0}finally{if(a)try{await j(e.markerPath,new Date().toISOString())}catch(n){m.debug(`${e.name}: marker write failed (cleanup succeeded)`,n)}}return a}finally{await D(e.lockPath).catch(()=>{m.debug(`${e.name}: lock unlink failed (harmless)`)})}}async function C(e,t,r){try{let i=await I(e),o=Date.now()-i.mtimeMs;if(o<t)return m.debug(`${r}: skipping, ran ${o}ms ago`),!0}catch{}return!1}async function h(e){try{return await(await K(e,"wx")).close(),!0}catch(t){if(t?.code==="EEXIST")return!1;throw t}}var u=c("HOUSEKEEPING"),O=10*60*1e3,W=24*60*60*1e3,X=60*1e3,z=7*24*60*60*1e3,Q=60*1e3,f=".file-history-cleanup",d=!1;function pe(e,t){d||(d=!0,Z(e,t).catch(r=>{d=!1,u.error("scheduleFirstPass failed; chain will retry on next start",r)}))}async function Z(e,t){let r=p(l.getGlobalMatildaDir(),f),i=await L(r)?Q:O;u.debug(`first pass in ${i/1e3}s`),setTimeout(()=>S(e,t),i).unref()}async function L(e){try{let t=await V(e);return Date.now()-t.mtimeMs>z}catch{return!0}}async function M(e,t){if(E()<X){u.debug("user active, deferring 10 min"),setTimeout(()=>S(e,t),O).unref();return}try{await x(e,t)}catch(r){u.error("housekeeping pass failed; will retry next cycle",r)}setTimeout(()=>S(e,t),W).unref()}function S(e,t){M(e,t).catch(r=>{u.error("runPass rejected unexpectedly",r)})}async function x(e,t){let r=t.merged.general?.cleanupPeriodDays??30,i=T(r),o=e.getSessionId(),a=l.getGlobalMatildaDir();await R({name:"file-history-cleanup",markerPath:p(a,f),lockPath:p(a,f+".lock")},async()=>{let n=await b({cutoffDate:i,excludeSessionIds:new Set([o])});u.debug(`file-history: removed=${n.removed} errors=${n.errors}`)})}function Se(){d=!1}var we=L,Pe=x,Ee=M,ye=f;export{ye as _FILE_HISTORY_MARKER_FOR_TESTING,we as _needsCatchUpForTesting,Se as _resetForTesting,Pe as _runHousekeepingForTesting,Ee as _runPassForTesting,pe as startBackgroundHousekeeping};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Google LLC
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as Ru}from"./chunk-PA6532AY.js";import{a as wv}from"./chunk-XMZIY7XX.js";import{$a as Ev,Aa as Gi,B as ns,Ba as or,Ca as an,D as Iu,Da as ar,Ea as Mr,Fa as mt,Ga as cr,Ha as Or,Ia as Dr,Ja as cn,Ka as dn,La as un,Ma as ot,Na as bv,Oa as Ki,Pa as ss,Qa as Mu,Ra as ke,Sa as fe,Ta as Sv,Ua as ln,V as xu,Va as pn,Wa as Ou,X as Tt,Xa as Ji,Ya as Xi,Za as Yi,_a as Qi,ab as Zi,bb as Mt,cb as Du,db as Fu,ga as _u,ha as Cu,hb as Lu,ia as Pt,ib as Nu,ja as Tu,ka as zi,la as Ye,ma as wt,oa as Pu,pa as ie,qa as nn,ra as sn,sa as sr,ta as Cr,ua as on,va as Tr,wa as bt,x as Ui,xa as St,ya as ir,za as Pr}from"./chunk-MKHNJ5O6.js";import{a as Su,b as D,d as Eu}from"./chunk-CNRE4GFU.js";import{a as ku,b as rn,d as Au,e as Vi}from"./chunk-JSFA3NEP.js";import{$a as au,Gl as Rr,Hi as yv,Jk as es,Ke as lu,Kk as ts,Lk as rs,Ma as kr,Nf as Ar,Of as Ve,Qh as yu,Re as pu,Rj as tt,Sj as Zn,We as Hi,Xa as iu,Xe as fu,Ye as hu,_a as ou,ab as cu,fg as Qn,mi as wu,nb as Wi,pb as du,tb as uu,vf as mu,wf as gu,xf as vu}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import{e as bu}from"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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{b as Yd,e as Qd}from"./chunk-S4K76QPI.js";import{C as Bd,D as qd,E as jd,F as Wd,G as Hd,H as Ud,I as Vd,J as zd,K as Gd,L as Kd,U as Jd,V as Xd,n as Fd,o as $i,p as Bi,q as Yn,s as Ld,u as Nd,v as $d,w as qi,x as _r}from"./chunk-5RG6AVD6.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import{b as Rd}from"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import{Cb as Md,Eb as Od,Fb as Dd,Y as Td,da as xr,ea as Pd,j as He,t as Cd}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import{f as Zd,h as ji,i as eu,j as tu,k as ru,m as nu,r as su}from"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{L as Xn,M as Ad}from"./chunk-QWBNNEV2.js";import{a as ht}from"./chunk-G7R2XEEF.js";import{a as vv}from"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as w}from"./chunk-GZPNIYVZ.js";import{a as se,d as L,f as gv}from"./chunk-OWGSC52X.js";var fn=L((k_,ju)=>{w();var Iv=se("path").relative;ju.exports=Rv;var xv=process.cwd();function Bu(t,e){for(var r=t.split(/[ ,]+/),n=String(e).toLowerCase(),s=0;s<r.length;s++){var i=r[s];if(i&&(i==="*"||i.toLowerCase()===n))return!0}return!1}function _v(t,e,r){var n=Object.getOwnPropertyDescriptor(t,e),s=n.value;return n.get=function(){return s},n.writable&&(n.set=function(o){return s=o}),delete n.value,delete n.writable,Object.defineProperty(t,e,n),n}function kv(t){for(var e="",r=0;r<t;r++)e+=", arg"+r;return e.substr(2)}function Av(t){var e=this.name+": "+this.namespace;this.message&&(e+=" deprecated "+this.message);for(var r=0;r<t.length;r++)e+=`
3
+ import{a as Ru}from"./chunk-PA6532AY.js";import{a as wv}from"./chunk-XMZIY7XX.js";import{$a as Qi,Aa as Pr,B as ns,Ba as Gi,Ca as or,D as Iu,Da as an,Ea as ar,Fa as Mr,Ga as mt,Ha as cr,Ia as Or,Ja as Dr,Ka as cn,La as dn,Ma as un,Na as ot,Oa as bv,Pa as Ki,Qa as ss,Ra as Mu,Sa as ke,Ta as fe,Ua as Sv,Va as ln,W as xu,Wa as pn,Xa as Ou,Y as Tt,Ya as Ji,Za as Xi,_a as Yi,ab as Ev,bb as Zi,cb as Mt,db as Du,eb as Fu,ha as _u,ia as Cu,ib as Lu,ja as Pt,jb as Nu,ka as Tu,la as zi,ma as Ye,na as wt,pa as Pu,qa as ie,ra as nn,sa as sn,ta as sr,ua as Cr,va as on,wa as Tr,x as Ui,xa as bt,ya as St,za as ir}from"./chunk-JDXISO3F.js";import{a as Su,b as D,d as Eu}from"./chunk-DBSJNFFU.js";import{a as ku,b as rn,d as Au,e as Vi}from"./chunk-JSFA3NEP.js";import{$a as au,Hl as Rr,Ii as yv,Ke as lu,Kk as es,Lk as ts,Ma as kr,Mk as rs,Nf as Ar,Of as Ve,Re as pu,Rh as yu,Sj as tt,Tj as Zn,We as Hi,Xa as iu,Xe as fu,Ye as hu,_a as ou,ab as cu,fg as Qn,nb as Wi,ni as wu,pb as du,tb as uu,vf as mu,wf as gu,xf as vu}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import{e as bu}from"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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{b as Yd,e as Qd}from"./chunk-S4K76QPI.js";import{C as Bd,D as qd,E as jd,F as Wd,G as Hd,H as Ud,I as Vd,J as zd,K as Gd,L as Kd,U as Jd,V as Xd,n as Fd,o as $i,p as Bi,q as Yn,s as Ld,u as Nd,v as $d,w as qi,x as _r}from"./chunk-FU2PKCG5.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-QLEJOI4X.js";import"./chunk-4J6DC24J.js";import{b as Rd}from"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import{Cb as Md,Eb as Od,Fb as Dd,Y as Td,da as xr,ea as Pd,j as He,t as Cd}from"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import{f as Zd,h as ji,i as eu,j as tu,k as ru,m as nu,r as su}from"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{L as Xn,M as Ad}from"./chunk-QWBNNEV2.js";import{a as ht}from"./chunk-G7R2XEEF.js";import{a as vv}from"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as w}from"./chunk-GZPNIYVZ.js";import{a as se,d as L,f as gv}from"./chunk-OWGSC52X.js";var fn=L((k_,ju)=>{w();var Iv=se("path").relative;ju.exports=Rv;var xv=process.cwd();function Bu(t,e){for(var r=t.split(/[ ,]+/),n=String(e).toLowerCase(),s=0;s<r.length;s++){var i=r[s];if(i&&(i==="*"||i.toLowerCase()===n))return!0}return!1}function _v(t,e,r){var n=Object.getOwnPropertyDescriptor(t,e),s=n.value;return n.get=function(){return s},n.writable&&(n.set=function(o){return s=o}),delete n.value,delete n.writable,Object.defineProperty(t,e,n),n}function kv(t){for(var e="",r=0;r<t;r++)e+=", arg"+r;return e.substr(2)}function Av(t){var e=this.name+": "+this.namespace;this.message&&(e+=" deprecated "+this.message);for(var r=0;r<t.length;r++)e+=`
4
4
  at `+t[r].toString();return e}function Rv(t){if(!t)throw new TypeError("argument namespace is required");var e=os(),r=Fr(e[1]),n=r[0];function s(i){is.call(s,i)}return s._file=n,s._ignored=Tv(t),s._namespace=t,s._traced=Pv(t),s._warned=Object.create(null),s.function=Fv,s.property=Lv,s}function Cv(t,e){var r=typeof t.listenerCount!="function"?t.listeners(e).length:t.listenerCount(e);return r>0}function Tv(t){if(process.noDeprecation)return!0;var e=process.env.NO_DEPRECATION||"";return Bu(e,t)}function Pv(t){if(process.traceDeprecation)return!0;var e=process.env.TRACE_DEPRECATION||"";return Bu(e,t)}function is(t,e){var r=Cv(process,"deprecation");if(!(!r&&this._ignored)){var n,s,i,o,a=0,c=!1,d=os(),u=this._file;for(e?(o=e,i=Fr(d[1]),i.name=o.name,u=i[0]):(a=2,o=Fr(d[a]),i=o);a<d.length;a++)if(n=Fr(d[a]),s=n[0],s===u)c=!0;else if(s===this._file)u=this._file;else if(c)break;var l=n?o.join(":")+"__"+n.join(":"):void 0;if(!(l!==void 0&&l in this._warned)){this._warned[l]=!0;var p=t;if(p||(p=i===o||!i.name?$u(o):$u(i)),r){var f=qu(this._namespace,p,d.slice(a));process.emit("deprecation",f);return}var g=process.stderr.isTTY?Ov:Mv,v=g.call(this,p,n,d.slice(a));process.stderr.write(v+`
5
5
  `,"utf8")}}}function Fr(t){var e=t.getFileName()||"<anonymous>",r=t.getLineNumber(),n=t.getColumnNumber();t.isEval()&&(e=t.getEvalOrigin()+", "+e);var s=[e,r,n];return s.callSite=t,s.name=t.getFunctionName(),s}function $u(t){var e=t.callSite,r=t.name;r||(r="<anonymous@"+eo(t)+">");var n=e.getThis(),s=n&&e.getTypeName();return s==="Object"&&(s=void 0),s==="Function"&&(s=n.name||s),s&&e.getMethodName()?s+"."+r:r}function Mv(t,e,r){var n=new Date().toUTCString(),s=n+" "+this._namespace+" deprecated "+t;if(this._traced){for(var i=0;i<r.length;i++)s+=`
6
6
  at `+r[i].toString();return s}return e&&(s+=" at "+eo(e)),s}function Ov(t,e,r){var n="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+t+"\x1B[39m";if(this._traced){for(var s=0;s<r.length;s++)n+=`
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{$e as b,_e as a,af as c,bf as d,cf as e,df as f,ef as g}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as OUTPUT_UPDATE_INTERVAL_MS,g as ShellTool,f as ShellToolInvocation,c as buildLongRunningForegroundHint,d as detectBlockedSleepPattern,a as parseNumstat,e as repairLeakedShellToolArgMarkup};
3
+ import{$e as b,_e as a,af as c,bf as d,cf as e,df as f,ef as g}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import"./chunk-FUNLOUYI.js";import"./chunk-R3H6IWFK.js";import"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import"./chunk-5U3A6KMU.js";import"./chunk-IMYUVCF7.js";import"./chunk-XKDGRW3K.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as OUTPUT_UPDATE_INTERVAL_MS,g as ShellTool,f as ShellToolInvocation,c as buildLongRunningForegroundHint,d as detectBlockedSleepPattern,a as parseNumstat,e as repairLeakedShellToolArgMarkup};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{c as p,d as C,f as E,g as I}from"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import"./chunk-5RG6AVD6.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-SDTWBD62.js";import{kc as o,ld as a}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as S,i as v,p as y,q as b}from"./chunk-5U3A6KMU.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{Y as f}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();import L from"path";var r=f("SKILL"),$=`Execute a skill within the main conversation
3
+ import{c as p,d as C,f as E,g as I}from"./chunk-MNGFXISD.js";import"./chunk-4R2OFVPK.js";import"./chunk-FU2PKCG5.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-SDTWBD62.js";import{kc as o,ld as a}from"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as S,i as v,p as y,q as b}from"./chunk-5U3A6KMU.js";import"./chunk-3YLXGE6T.js";import"./chunk-IOCF4XSR.js";import{Y as f}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();import L from"path";var r=f("SKILL"),$=`Execute a skill within the main conversation
4
4
 
5
5
  <skills_instructions>
6
6
  When users ask you to perform tasks, check if any of the available skills can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{$ as pi,$a as pj,$b as tk,$c as ql,$d as qm,$f as co,$g as aq,$h as br,$i as as,$j as $s,$k as $t,A as Zg,Aa as Qi,Ab as Qj,Ac as Tk,Ad as Rl,Ae as Lm,Af as tn,Ag as Fo,Ah as Cq,Ai as Er,Aj as zs,Ak as At,Al as zu,B as _g,Ba as Ri,Bb as Rj,Bc as Uk,Bd as Sl,Be as Mm,Bf as un,Bg as Cp,Bh as Dq,Bi as Fr,Bj as As,Bk as Bt,Bl as Au,C as $g,Ca as Si,Cb as Sj,Cc as Vk,Cd as Tl,Ce as Nm,Cf as vn,Cg as Dp,Ch as Eq,Ci as Gr,Cj as Bs,Ck as Ct,Cl as Bu,D as ah,Da as Ti,Db as Tj,Dd as Ul,De as Om,Df as wn,Dg as Ep,Dh as Fq,Di as Hr,Dj as Cs,Dk as Dt,Dl as Cu,E as bh,Ea as Ui,Eb as Uj,Ec as Wk,Ed as Vl,Ee as Pm,Ef as xn,Eg as Fp,Eh as Gq,Ei as Ir,Ej as Ds,Ek as Et,El as Du,F as ch,Fa as Vi,Fb as Vj,Fc as Xk,Fd as Wl,Fe as Qm,Ff as yn,Fg as Gp,Fh as Hq,Fi as Jr,Fj as Es,Fk as Ft,Fl as Eu,G as dh,Ga as Wi,Gb as Wj,Gc as Yk,Gd as Xl,Ge as Rm,Gf as zn,Gg as Hp,Gh as Iq,Gi as Kr,Gj as Fs,Gk as Gt,Gl as Fu,H as eh,Ha as Xi,Hb as Xj,Hc as Zk,Hd as Yl,He as Sm,Hf as An,Hg as Ip,Hh as Jq,Hj as Gs,Hk as Ht,Hl as Gu,Ia as Yi,Ib as Yj,Ic as _k,Id as Zl,If as Bn,Ig as Jp,Ih as Kq,Ij as Hs,Ik as It,Il as Hu,J as fh,Ja as Zi,Jb as Zj,Jc as $k,Jd as _l,Je as Tm,Jf as Cn,Jg as Kp,Jh as Lq,Ji as Lr,Jk as Jt,Jl as Iu,K as gh,Ka as _i,Kb as _j,Kc as al,Kd as $l,Ke as Um,Kf as Nn,Kg as Lp,Kh as Mq,Ki as Mr,Kk as Kt,Kl as Ju,L as hh,La as $i,Lb as $j,Ld as am,Lf as On,Lg as Mp,Lh as Nq,Li as Nr,Lj as Is,Lk as Lt,Ll as Ku,M as ai,Ma as aj,Mb as ak,Mc as bl,Md as bm,Mf as Pn,Mg as Np,Mh as Oq,Mi as Or,Mj as Js,Mk as Mt,Ml as Lu,N as bi,Na as bj,Nb as bk,Nc as cl,Nd as cm,Nf as Qn,Ng as Op,Nh as Pq,Ni as Pr,Nj as Ks,Nk as Nt,Nl as Mu,O as ci,Oa as cj,Ob as ck,Oc as dl,Od as dm,Of as Rn,Og as Pp,Oh as Qq,Oi as Qr,Oj as Ls,Ok as Ot,Ol as Nu,P as di,Pa as dj,Pb as dk,Pc as el,Pd as em,Pf as Sn,Pg as Qp,Ph as Rq,Pi as Rr,Pj as Ms,Pk as Pt,Pl as Ou,Q as ei,Qa as ej,Qb as ek,Qc as fl,Qd as fm,Qf as Tn,Qg as Rp,Qh as Sq,Qi as Sr,Qj as Ns,Qk as Qt,Ql as Pu,R as fi,Ra as fj,Rb as fk,Rc as gl,Rd as gm,Rf as Un,Rg as Sp,Rh as Tq,Ri as Tr,Rj as Rs,Rk as Rt,Rl as Qu,S as gi,Sa as gj,Sb as ik,Sc as hl,Sd as hm,Se as Vm,Sf as Vn,Sg as Tp,Sh as Uq,Si as Ur,Sj as Ss,Sk as St,T as hi,Ta as hj,Tb as lk,Tc as il,Td as im,Te as Wm,Tf as Wn,Tg as Up,Th as Vq,Ti as Vr,Tj as Ts,Tk as Tt,U as ii,Ua as ij,Ub as mk,Uc as jl,Ud as jm,Ue as Xm,Uf as Xn,Ug as Vp,Uh as Wq,Ui as Wr,Uj as Us,Uk as Ut,V as ji,Va as jj,Vb as nk,Vc as kl,Vd as km,Ve as Ym,Vf as Yn,Vg as Wp,Vh as Xq,Vi as Xr,Vj as Vs,Vk as Vt,W as ki,Wa as kj,Wb as ok,Wc as ll,Wd as lm,We as Zm,Wf as Zn,Wg as Xp,Wh as Yq,Wj as Ws,Wk as Wt,X as li,Xa as lj,Xb as pk,Xc as ml,Xd as mm,Xe as _m,Xf as _n,Xg as Yp,Xh as Zq,Xi as Yr,Xj as Xs,Xk as Xt,Y as mi,Ya as mj,Yb as qk,Yc as nl,Yd as nm,Ye as $m,Yf as $n,Yg as Zp,Yh as _q,Yi as Zr,Yj as Ys,Yk as Yt,Z as ni,Za as nj,Zb as rk,Zc as ol,Zd as om,Zf as ao,Zg as _p,Zh as $q,Zi as _r,Zj as Zs,Zk as Zt,_ as oi,_a as oj,_b as sk,_c as pl,_d as pm,_f as bo,_g as $p,_h as ar,_i as $r,_j as _s,_k as _t,a as qa,aa as qi,ab as qj,ac as uk,ad as rl,ae as rm,ag as eo,ah as bq,ai as cr,aj as bs,ak as at,al as au,b as ra,ba as ri,bb as rj,bc as vk,bd as sl,be as sm,bg as fo,bh as cq,bi as dr,bj as cs,bk as bt,bl as bu,c as sa,ca as si,cb as sj,cc as wk,cd as tl,ce as tm,cg as go,ch as dq,ci as er,ck as ct,cl as cu,d as ta,da as ti,db as tj,dc as xk,dd as ul,de as um,dg as ho,dh as eq,di as fr,dk as dt,dl as du,e as ua,ea as ui,eb as uj,ec as yk,ed as vl,ee as vm,eg as io,eh as fq,ei as ir,ej as ds,ek as et,el as eu,f as va,fa as wi,fb as vj,fc as zk,fd as wl,fe as wm,ff as an,fg as jo,fh as gq,fi as jr,fj as es,fk as ft,fl as fu,g as wa,ga as xi,gb as wj,gc as Ak,gd as xl,ge as xm,gf as bn,gh as iq,gi as kr,gj as fs,gk as gt,gl as gu,h as xa,ha as yi,hb as xj,hc as Bk,hd as yl,he as ym,hf as cn,hh as jq,hi as lr,hj as gs,hk as ht,hl as hu,i as ya,ia as zi,ib as yj,ic as Ck,id as zl,ie as zm,if as dn,ih as kq,ii as mr,ij as hs,ik as it,il as iu,j as Ig,jb as zj,jc as Dk,jd as Al,je as Am,jf as en,jh as lq,ji as nr,jj as is,jk as jt,jl as ju,k as Jg,ka as Ai,kb as Aj,kc as Ek,kd as Bl,ke as Bm,kf as fn,kh as mq,ki as or,kj as js,kk as kt,kl as ku,l as Kg,la as Bi,lb as Bj,lc as Fk,ld as Cl,le as Cm,lf as gn,lh as nq,li as pr,lj as ks,lk as lt,ll as lu,m as Lg,ma as Ci,mb as Cj,mc as Gk,md as Dl,me as Dm,mf as hn,mg as ko,mh as oq,mi as qr,mj as ls,mk as mt,ml as mu,n as Mg,na as Di,nb as Dj,nc as Hk,nd as El,ne as Em,nf as jn,ng as lo,nh as pq,ni as rr,nj as ms,nk as nt,nl as nu,o as Ng,oa as Ei,ob as Ej,oc as Ik,od as Fl,oe as Fm,of as kn,og as mo,oh as qq,oi as sr,oj as ns,ok as ot,ol as ou,p as Og,pa as Fi,pb as Fj,pc as Jk,pd as Gl,pe as Gm,pf as ln,pg as no,ph as rq,pi as tr,pj as os,pk as pt,pl as pu,q as Pg,qa as Gi,qb as Gj,qc as Kk,qd as Hl,qf as mn,qg as oo,qh as sq,qi as ur,qj as ps,qk as qt,ql as qu,r as Qg,ra as Hi,rb as Hj,rc as Lk,rd as Il,rf as nn,rg as po,rh as tq,ri as vr,rj as qs,rk as rt,rl as ru,s as Rg,sa as Ii,sb as Ij,sc as Mk,sd as Jl,se as Hm,sf as on,sg as qo,sh as uq,si as wr,sj as rs,sk as st,sl as su,t as Sg,ta as Ji,tb as Jj,td as Kl,te as Im,tf as pn,tg as ro,th as vq,ti as xr,tj as ss,tk as tt,tl as tu,u as Tg,ua as Ki,ub as Kj,uc as Nk,ud as Ll,uf as qn,ug as so,uh as wq,ui as yr,uj as ts,uk as ut,ul as uu,v as Ug,va as Li,vb as Lj,vc as Ok,vd as Ml,vg as to,vh as xq,vi as zr,vj as us,vk as vt,vl as vu,w as Vg,wa as Mi,wb as Mj,wc as Pk,wd as Nl,wg as uo,wh as yq,wi as Ar,wj as vs,wk as wt,x as Wg,xa as Ni,xb as Nj,xc as Qk,xd as Ol,xg as vo,xh as zq,xi as Br,xj as ws,xk as xt,xl as wu,y as Xg,ya as Oi,yb as Oj,yc as Rk,yd as Pl,ye as Jm,yf as rn,yg as wo,yh as Aq,yi as Cr,yj as xs,yk as yt,yl as xu,z as Yg,za as Pi,zb as Pj,zc as Sk,zd as Ql,ze as Km,zf as sn,zg as Eo,zh as Bq,zi as Dr,zj as ys,zk as zt,zl as yu}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import{a as Go,b as Ho,c as Io,d as Jo,e as Ko,f as dp,g as ep,h as fp,i as gp,j as hp,k as ip,l as jp,m as kp}from"./chunk-FUNLOUYI.js";import{a as lp,b as mp,c as np,d as op,e as pp,f as qp,g as rp,h as sp,i as tp,j as up,k as vp,l as wp,m as xp,n as yp,o as zp,p as Ap,q as Bp}from"./chunk-R3H6IWFK.js";import{a as Lo,b as Mo,c as No,d as Oo,e as Po,f as Qo,g as Ro,h as So,i as To,j as Uo,k as Vo,l as Wo,m as Xo,n as Yo,o as Zo,p as _o,q as $o,r as ap,s as bp,t as cp}from"./chunk-OMZ5SGMK.js";import{a as vi}from"./chunk-C2ZWB2NT.js";import{c as Os,e as Ps,f as Qs}from"./chunk-MTMU7JYZ.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-FT76AZPN.js";import{a as gr,b as hr}from"./chunk-47XR7IMP.js";import{b as hq}from"./chunk-QEI3OETI.js";import{a as Dn,b as En,c as Fn,d as Gn,e as Hn,f as In,g as Jn,h as Kn,i as Ln,j as Mn,k as xo,l as yo,m as zo,n as Ao,o as Bo,p as Co,q as Do}from"./chunk-QKYGQLWC.js";import{c as jk,f as kk}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 gk,b as hk}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-FU2PKCG5.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-SDTWBD62.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-6QP5C76Y.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,$n as AGENT_WORKTREE_HEX_LENGTH,_n as AGENT_WORKTREE_PREFIX,ao as AGENT_WORKTREE_SLUG_PATTERN,Dj as ALL_PROVIDERS,Ss as APPROVAL_MODES,Us 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,Ok as AUTO_MEMORY_SCHEMA_VERSION,Nk as AUTO_MEMORY_TYPES,bm as AUTO_MODE_DENIAL_LIMITS,Wp as AUTO_SKILL_THRESHOLD,wu as AbortError,Pn as AgentCore,zn as AgentEventEmitter,yn as AgentEventType,Cn as AgentHeadless,oo 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,Rs as ApprovalMode,ya as ArenaAgentClient,so as ArenaEventEmitter,ro as ArenaEventType,wo as ArenaManager,ra as ArenaSessionStatus,no as AsyncMessageQueue,de as AuthEvent,at as AuthProviderType,Dg as AuthType,Fp as BACKGROUND_AGENT_CONCURRENCY_ENV,Yn as BASELINE_COMMIT_MESSAGE,Ta as BINARY_EXTENSIONS,La as BINARY_FILE_PATTERNS,Gu as BTW_MAX_INPUT_LENGTH,Nq as BUNDLE_CHUNK_DIR,Mp as BackgroundAgentResumeService,yr as BackgroundShellRegistry,Kp as BackgroundTaskRegistry,q as BadRequestError,ga as BaseDeclarativeTool,ea as BaseToolInvocation,br as BudgetExhaustedError,jo as BuiltinAgentRegistry,Af as CAPPED_DEFAULT_MAX_TOKENS,_t as CODE_ACTION_KIND_LABELS,pl as COMMAND_SUBSTITUTION_WARNING,Na as COMMON_DIRECTORY_EXCLUDES,Ka as COMMON_IGNORE_PATTERNS,ma as CONCURRENCY_SAFE_KINDS,Aj as CUSTOM_API_KEY_ENV_PREFIX,Qj as ChatRecordingService,qn as CloseDiffRequestSchema,Nm as ColorMode,Uj as CompressionStatus,ws as ConditionalRulesRegistry,bt as Config,An as ContextState,Yd as ConversationFinishedEvent,xn as CoreToolScheduler,qg as CredentialsClearRequiredError,dq as CronScheduler,Fe as DAEMON_TRACEPARENT_META_KEY,Ge as DAEMON_TRACESTATE_META_KEY,Xp as DEFAULT_AUTO_DREAM_MIN_HOURS,Yp as DEFAULT_AUTO_DREAM_MIN_SESSIONS,Lp as DEFAULT_BACKGROUND_AGENT_CONTINUATION_MESSAGE,io as DEFAULT_BUILTIN_SUBAGENT_TYPE,Da as DEFAULT_CONTEXT_FILENAME,Za as DEFAULT_ENCODING,Qa as DEFAULT_FILE_EXCLUDES,hk as DEFAULT_FILE_FILTERING_OPTIONS,St as DEFAULT_LSP_COMMAND_CHECK_TIMEOUT_MS,Rt as DEFAULT_LSP_DOCUMENT_OPEN_DELAY_MS,Ut as DEFAULT_LSP_DOCUMENT_RETRY_DELAY_MS,Vt as DEFAULT_LSP_MAX_RESTARTS,Pt as DEFAULT_LSP_REQUEST_TIMEOUT_MS,Xt as DEFAULT_LSP_SOCKET_MAX_RETRY_DELAY_MS,Wt as DEFAULT_LSP_SOCKET_RETRY_DELAY_MS,Ot as DEFAULT_LSP_STARTUP_TIMEOUT_MS,Qt as DEFAULT_LSP_WARMUP_DELAY_MS,Tt 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,Ep as DEFAULT_MAX_CONCURRENT_BACKGROUND_AGENTS,et as DEFAULT_MAX_INLINE_MEDIA_BYTES,gk as DEFAULT_MEMORY_FILE_FILTERING_OPTIONS,tf as DEFAULT_OTLP_ENDPOINT,zf as DEFAULT_OUTPUT_TOKEN_LIMIT,Vs as DEFAULT_PR_ATTRIBUTION_MESSAGE,ai as DEFAULT_STOP_HOOK_BLOCK_CAP,sf as DEFAULT_TELEMETRY_TARGET,yf as DEFAULT_TOKEN_LIMIT,Ys as DEFAULT_TOOL_OUTPUT_BATCH_BUDGET,hh as DEFAULT_TOOL_RESULTS_TOTAL_CHARS_THRESHOLD,Xs as DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,Ws as DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,Zt as DIAGNOSTIC_SEVERITY_LABELS,ko as DISPLAY_MODE,Up as DREAM_TASK_TYPE,fa as DeclarativeTool,Eh as DefaultHookOutput,Ed as DiscoveredMCPTool,er as DiscoveredTool,Bf as ESCALATED_MAX_TOKENS,$ as EVENT_API_ERROR,aa as EVENT_API_RESPONSE,_ as EVENT_TOOL_CALL,Nn as EXCLUDED_TOOLS_FOR_SUBAGENTS,Dr as EXTENSIONS_CONFIG_FILENAME,Cr as EXTENSIONS_DIRECTORY_NAME,Fr as EXTENSION_SETTINGS_FILENAME,On as EXTERNAL_MESSAGE_PREFIX,Tp as EXTRACT_TASK_TYPE,Hd as EndSessionEvent,ke as ExtensionDisableEvent,be as ExtensionEnableEvent,_d as ExtensionInstallEvent,ls as ExtensionManager,ds as ExtensionSettingScope,ae as ExtensionUninstallEvent,ks as ExtensionUpdateState,Mi as FILE_HISTORY_DIR,Sn 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,fo as FileDiscoveryService,Vm as FileEncoding,Ra as FileExclusions,Pi as FileHistoryService,lb as FileOperation,Br as FileReadCache,jn as FileSchema,yu 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,Kk as GeminiChat,cq as GeminiClient,Tj as GeminiEventType,eo as GitIgnoreParser,co as GitWorktreeService,yh as HOOKS_CONFIG_FIELDS,wh as HookEventName,xh as HookPhase,qs as HookRegistry,ss as HookSystem,zh as HookType,vh as HooksConfigSource,rn as IDEConnectionStatus,an as IDE_DEFINITIONS,dn as IDE_MAX_OPEN_FILES,en as IDE_MAX_SELECTED_TEXT_LENGTH,fn as IDE_REQUEST_TIMEOUT_MS,ru as IDLE_SPECULATION,Co as INBOXES_DIR,iu as INITIAL_FOLLOWUP_STATE,Er as INSTALL_METADATA_FILENAME,mo as ITermBackend,sn as IdeClient,Xd as IdeConnectionEvent,Wd as IdeConnectionType,ln as IdeContextNotificationSchema,kn as IdeContextSchema,gn as IdeContextStore,mn as IdeDiffAcceptedNotificationSchema,on as IdeDiffClosedNotificationSchema,nn as IdeDiffRejectedNotificationSchema,Qs as Ignore,po as InProcessBackend,gr as InputFormat,_q as InvalidMcpConfigError,Ik as InvalidStreamError,ct as JsonFormatter,hq as KeychainTokenStorage,ka as Kind,Zd as KittySequenceOverflowEvent,yo as LEADER_NAME,Ui as LITE_READ_BUF_SIZE,Fa as LOCAL_CONTEXT_FILENAME,qt as Logger,Rd as LoopType,$t as LspConfigLoader,au as LspConnectionFactory,bu as LspResponseNormalizer,cu as LspServerManager,xf as MAINLINE_CODER_MODEL,na as MAIN_SOURCE,If as MATILDA_API_KEY_ENV_KEY,cn as MATILDA_CODE_COMPANION_EXTENSION_NAME,It 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,Hp as MAX_CONCURRENT_BACKGROUND_AGENTS,sr 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,wr as MAX_NOTIFICATION_OUTPUT_TAIL_BYTES,Ip as MAX_RETAINED_TERMINAL_AGENTS,tr as MAX_RETAINED_TERMINAL_MONITORS,xr as MAX_RETAINED_TERMINAL_SHELLS,zr as MAX_RETAINED_TERMINAL_WORKFLOWS,Li as MAX_SNAPSHOTS,xo as MAX_TEAMMATES,$l as MAX_TRANSCRIPT_MESSAGES,Bh as MAX_USER_PROMPT_EXPANSION_ADDITIONAL_CONTEXT_LENGTH,qq as MCPDiscoveryState,mq as MCPOAuthProvider,iq as MCPOAuthTokenStorage,_s as MCPServerConfig,pq as MCPServerStatus,ar as MCP_BUDGET_REARM_FRACTION,$q as MCP_BUDGET_WARN_FRACTION,nq as MCP_DEFAULT_TIMEOUT_MSEC,Ma as MEDIA_FILE_PATTERNS,Ga as MEMORY_SECTION_HEADER,Mu as MOCK_TOOL_GET_CONFIRMATION_DETAILS,Lu 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,Yq as McpBudgetWouldExceedError,rq as McpClient,dr as McpClientManager,Zq as McpServerSpawnFailedError,st as McpTransportPool,oe as MemoryDreamEvent,ne as MemoryExtractEvent,Zp as MemoryManager,nb as MemoryMetricType,pe as MemoryRecallEvent,us as MessageBus,Wk as MessageBusType,nt as MessageSenderType,Ou as MockModifiableTool,Nu as MockModifiableToolInvocation,Ku as MockTool,Rf as ModelRegistry,ce as ModelSlashCommandEvent,Sf as ModelsConfig,vr as MonitorRegistry,du as NativeLspClient,eu as NativeLspService,Sd as NextSpeakerCheckEvent,Mh as NotificationType,lq as OAUTH_AUTH_URL_EVENT,kq as OAUTH_DISPLAY_MESSAGE_EVENT,jq as OAuthUtils,uj as OPENROUTER_BASE_URL,tj as OPENROUTER_ENV_KEY,Cf as OUTPUT_TOKEN_SAFETY_MARGIN,ve as OpenAILogger,pn as OpenDiffRequestSchema,hr as OutputFormat,ou as OverlayFs,w as PATH_ARG_KEYS,Vq as POOLED_TRANSPORTS_DEFAULT,kj as PROVIDER_METADATA_NS,Oa as PYTHON_EXCLUDES,mb as PerformanceMetricType,pr 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,Ij as ProviderInstallError,lp as RECIPROCAL_CALLER,Lr 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,Js as RipGrepTool,Qd as RipgrepFallbackEvent,ye as RuntimeDiagnosticsCollector,mm as SAFE_TOOL_ALLOWLIST,$i as SESSION_TITLE_MAX_LENGTH,v as SHELL_SPECIAL_CHARS,Cl as SHELL_TOOL_NAMES,Vp as SKILL_REVIEW_TASK_TYPE,bi as STOP_HOOK_BLOCK_CAP_ENV,Pj as STREAM_RECOVERY_PARTIAL_DISPOSITION,Oj as STREAM_RECOVERY_SNAPSHOT_DISPOSITION,ku as SUGGESTION_PROMPT,hg as SUPPORTED_IMAGE_MIME_TYPES,Yt as SYMBOL_KIND_LABELS,Pa as SYSTEM_FILE_EXCLUDES,mk as SYSTEM_REMINDER_CLOSE,lk as SYSTEM_REMINDER_OPEN,ca as SchemaValidator,gq as SdkControlClientTransport,Qb as SemanticAttributes,$p as SendMessageType,Ph as SessionEndReason,aj as SessionService,Nh as SessionStartSource,js as SettingScope,Um as ShellExecutionService,nr as SkillActivationRegistry,kr as SkillError,ee as SkillLaunchEvent,or as SkillManager,Ud as SlashCommandStatus,dk as SleepInhibitor,N as SpanStatusCode,me as SpeculationEvent,$m as StandardFileSystemService,Gd as StartSessionEvent,Kh as StopHookOutput,K as Storage,Ek as StreamEventType,Qn as SubagentError,Rn as SubagentErrorCode,rr as SubagentManager,qr as SubagentValidator,Ao as TASKS_DIR,Do as TEAMMATE_COLORS,zo as TEAMS_DIR,Bo as TEAM_CONFIG_FILENAME,xi as TERMINAL_CSI_REGEX,wi as TERMINAL_OSC_REGEX,yi as TERMINAL_SHIFT_DCS_REGEX,Ej as THIRD_PARTY_PROVIDERS,Nj as THOUGHT_ONLY_MAX_TOKENS_DISPOSITION,Bl as TOOL_NAME_ALIASES,wt as TOOL_USE_SUMMARY_SYSTEM_PROMPT,sp as TaskOwnershipError,Fo as TeamEventEmitter,Eo as TeamEventType,Dp as TeamManager,rf as TelemetryTarget,gg as TextTokenizer,lo 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,fr as ToolRegistry,Ts as TrustGateError,Vj 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,Zn as WORKTREES_DIR,Tn as WORKTREE_BRANCH_PREFIX,Vn as WORKTREE_SESSION_FILE,Ar as WorkflowRunRegistry,go as WorkspaceContext,tt as WorkspaceMcpBudget,Mt as WorkspaceMemoryFileTooLargeError,Kt as WorkspaceMemoryWriteTimeoutError,ph as __resetActiveGoalStoreForTests,gi as _recoverObjectsFromLine,tn as _resetCachedIdeServerHost,ki as _resetEnsuredDirsCacheForTest,Is as _resetRipGrepCachesForTest,u as _resetValidatePathCacheForTest,Yh as abortGoalForStopHookCap,uu as abortSpeculation,tu as acceptSpeculation,fk as acquireSleepInhibitor,ih as activeGoalEquals,Me as addDaemonRequestAttribute,tq as addMCPStatusChangeListener,Wb as addModelOutputAttributes,Ub as addSystemPromptAttributes,Xb as addToolInputAttributes,Yb as addToolResultAttributes,Vb as addToolSchemaAttributes,Tb as addUserPromptAttributes,Ht as aggregateUsage,Dm as allowEditorTypeInSandbox,Yg as appendToLastTextPart,rm as applyAutoModeDecision,Jj as applyProviderInstallPlan,kk as applySkillAllowedTools,gt as approxBase64Bytes,mp as assertValidTaskId,To as assignTeammateColor,W as atomicWriteFile,Z as atomicWriteFileSync,X as atomicWriteJSON,xp as blockTask,rk as buildAddedMcpToolsReminder,uk as buildAddedSkillsReminder,bj as buildApiHistoryFromConversation,tk as buildAvailableSkillsReminder,Jp as buildBackgroundEntryLabel,Iu as buildBtwCacheSafeParams,Hu as buildBtwPrompt,qk as buildDeferredToolsReminder,uo as buildFallbackApproachSummary,Kl as buildHumanReadableRuleLabel,lj as buildInstallPlan,sk as buildMcpServerInstructionsReminder,eq as buildMissedCronNotification,Jg as buildModelIdContext,Sl as buildPermissionCheckContext,Jl as buildPermissionRules,sj as buildProviderTemplate,of as buildReportedOperationHeaders,rl as buildShellExecWarnings,jk as buildSkillLlmContent,vk as buildStartupContextReminder,Cp as buildTeammatePromptAddendum,Bg as cacheMatildaCredentials,Tq as canUseRipgrep,Pe as captureDaemonTelemetryContext,yl as checkArgumentSafety,sl as checkCommandPermissions,Ur as checkForExtensionUpdate,Cm as checkHasEditorType,Rr as checkNpmUpdate,yp as claimTask,it as clampInlineMediaPart,Df as clampOutputToContextWindow,Yo as classifyShutdownResponse,zt as cleanSummary,Qu as cleanupTmpDir,lh as clearActiveGoal,jp as clearAllInboxes,od as clearAutoMemoryRootCache,Pp as clearCacheSafeParams,Cg as clearCachedCredentialFile,rh as clearGoalTerminalObserver,ip as clearInbox,uc as clearMatildaCorrelationHashes,Yf as clearMatildaCredentials,Ti as clearRuntimeStatus,Uo as clearTeammateColors,Cu as clearWelcomeBackState,Ms as clearWorktreeSession,As as cliSource,Sr as cloneFromGit,fq as collectMemoryDiagnostics,Ak as collectToolCallIdsFromHistory,xm as commandExists,Gk as compactPendingUserContentToBudget,Fk as compactTextMiddle,mj as computeModelListVersion,ck as computeThresholds,fj as computeUniqueBranchTitle,Es as computedSource,Eq as connectAndDiscover,Kq as connectToMcpServer,Wq as connectionIdOf,hp as consumeUnread,_r as convertClaudeAgentConfig,as as convertClaudePluginPackage,$r as convertClaudeToMatildaConfig,Pm as convertColorToHex,wn as convertToFunctionResponse,Yr as convertTomlToMarkdown,ms as copyExtension,cb as countFileLines,oi as countLines,Os as crawlCache,Hg as createContentGenerator,Gg as createContentGeneratorConfig,Te as createDaemonBridgeTelemetry,U as createDebugLogger,Qk as createDefaultAutoMemoryExtractCursor,Rk as createDefaultAutoMemoryIndex,Pk as createDefaultAutoMemoryMetadata,cm as createDenialState,ju as createFollowupController,Qp as createForkedChat,Zh as createGoalStopHookCallback,Dh as createHookOutput,ts as createInstructionsLoadedCallback,oq as createStreamableHttpCompatibilityFetch,qp as createTask,$o as createTeamFile,Pu as createTmpDir,vt as createToolUseSummaryMessage,Lq as createTransport,Cj as customProvider,$a as decodeBufferWithEncodingInfo,pt as decodeTagName,Ck as dedupeToolCallsById,wj as deepseekProvider,Ds as defaultSource,up as deleteTask,bp as deleteTeamDirs,Oi as deserializeSnapshots,_a as detectBOM,qo as detectBackend,ol as detectCommandSubstitution,Ya as detectEncodingFromBuffer,eb as detectFileEncoding,ib as detectFileType,bn as detectIdeFromEnv,Zm as detectLineEnding,dg as detectRuntime,Th as detectTodoChanges,Cq as discoverMcpTools,Hq as discoverPrompts,Fq as discoverTools,dp as disposeInboxLocks,cl as doesToolInvocationMatch,Vr as downloadFromGitHubRelease,Qr as downloadFromNpmRegistry,ym as editorCommands,Oe as emitDaemonLog,lt as encodeInsightErrorMessage,jt as encodeInsightProgressMessage,kt as encodeInsightReadyMessage,ot as encodeTagName,_m as encodeTextFileContent,lc as endHookSpan,$b as endInteractionSpan,cc as endLLMRequestSpan,oc as endSubagentSpan,jc as endToolBlockedOnUserSpan,hc as endToolExecutionSpan,fc as endToolSpan,Sk as ensureAutoMemoryScaffold,Ym as ensureCrlfLineEndings,Sq as ensureMacBinarySigned,Rq as ensureRipgrepHealthy,vu as ensureToolResultPairing,Uk as ensureUserAutoMemoryScaffold,kf as enterReportedOperationContext,Fs as envLayer,B as escapePath,fl as escapeShellArg,qe as estimateTokensFromChars,vm as evaluateAutoMode,Wl as evaluatePermissionFlow,Tl as evaluatePermissionRules,pu as evaluateToolCall,tl as execCommand,rt as executeToolCall,pi as exists,y as expandHomeDir,Se as extractDaemonTraceContext,Sa as extractExtensionsFromPatterns,Xr as extractFile,Wi as extractJsonStringField,Yi as extractLastJsonStringField,Xi as extractLastJsonStringFields,am as extractShellOperations,vn as extractToolFilePaths,Ei as fetchGitDiff,Fi as fetchGitDiffHunks,kb as fileExists,xu as filter,ri as findGitRoot,Wo as findMemberById,Xo as findMemberByName,Gj as findProviderByCredentials,Fj as findProviderById,Wr as findReleaseAsset,$k as fireNotificationHook,al as firePermissionRequestHook,_k as firePostToolUseFailureHook,Zk as firePostToolUseHook,Yk as firePreToolUseHook,Xg as flatMapTextParts,zc as forceFlushMetrics,Ro as formatAgentId,um as formatClassifierBlockMessage,nk as formatDateForContext,dm as formatDenialStateLog,vo as formatLineStats,Qm as formatMemoryUsage,ei as formatStopHookBlockingCapWarning,P as formatTraceparent,Jo as forwardApproval,bo as generateAgentWorktreeSlug,og as generateCodeChallenge,ng as generateCodeVerifier,Bj as generateCustomEnvKey,pg as generatePKCEPair,lu as generatePromptSuggestion,ut as generateSessionRecap,Xk as generateToolUseId,xt as generateToolUseSummary,So as generateUniqueTeammateName,Fd as generateValidName,re as generatedOutputTokens,jh as getActiveGoal,pc as getActiveInteractionSpan,Gn as getAgentName,Bp as getAgentStatuses,Ja as getAllGeminiMdFilenames,yq as getAllMCPServerStatuses,Hj as getAllProviderBaseUrls,ak 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,tm as getAutoModePermissionDeniedReason,Pq as getBuiltinRipgrep,Op as getCacheSafeParams,Va as getCachedEncodingForBuffer,hl as getCommandRoot,il as getCommandRoots,Zj as getCompressionPrompt,Yj as getCoreSystemPrompt,Ia as getCurrentGeminiMdFilename,Xj as getCustomSystemPrompt,nj as getDefaultBaseUrlForProtocol,pj as getDefaultModelIds,Fm as getDiffCommand,ok as getDirectoryContextString,zm as getEditorExecutable,Yl as getEffectivePermissionForConfirmation,hs as getEnvContents,pk as getEnvironmentContext,c as getErrorMessage,d as getErrorStatus,e as getErrorType,ns as getExtensionId,Bm as getExternalEditorCommand,mu as getFilterReason,ik as getFolderStructure,$g as getFunctionCalls,bh as getFunctionCallsAsJson,ah as getFunctionCallsFromParts,ch as getFunctionCallsFromPartsAsJson,si as getGitBranch,ti as getGitRepoName,Ah as getHookKey,Nt as getIdeInstaller,un as getIdeServerHost,ep as getInboxPath,Oo as getInboxesDir,wk as getInitialChatHistory,bk as getInsightPrompt,th as getLastGoalTerminal,Ho as getLeader,zq as getMCPDiscoveryState,hu as getMCPServerPrompts,xq as getMCPServerStatus,Kf as getMatildaAuthBaseUrl,Zf as getMatildaAuthStatus,tc as getMatildaCorrelationHashes,Vf as getMatildaCredentialsPath,zg as getMatildaOAuthClient,ft as getMaxInlineMediaBytes,md as getMemoryBaseDir,ur as getMonitorOutputPath,eg as getOrCreateSharedDispatcher,$j as getPlanModeSystemReminder,D as getProjectHash,Du as getProjectSummaryInfo,_j 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,Il as getRuleDisplayName,gs as getScopedEnvContents,Tm as getShellAbortReasonKind,dl as getShellConfiguration,fb as getSpecificMimeType,El as getSpecifierKind,xk as getStartupContextLength,dh as getStructuredResponse,eh as getStructuredResponseFromParts,jg as getSupportedImageFormatsString,Wa as getSystemEncoding,rp as getTask,np as getTaskPath,Po as getTasksDir,Mo as getTeamDir,No as getTeamFilePath,Hn as getTeamName,Ln as getTeammateColor,En as getTeammateContext,Lo as getTeamsRootDir,Sj as getThoughtText,Gt as getTimeRangeBounds,O as getTraceContext,kg as getUnsupportedImageFormatWarning,zd as getUserAutoMemoryIndexPath,yd as getUserAutoMemoryRoot,Ad as getUserAutoMemoryTopicPath,$f as getValidMatildaAccessToken,Au as getWelcomeBackState,_p as globalMemoryManager,Bq as handleAutomaticOAuth,ia as hasCycleInSchema,Ff as hasExplicitOutputLimit,Jq as hasNetworkTransport,ll as hasNonFinalTopLevelBackgroundOperator,ql as hasShellSubstitution,nl as hasUnsafeMonitorBackgroundOperator,He as hashDaemonWorkspace,fu as hashMcpServerConfig,os as hashValue,rs as hookEventSupportsMatcher,Hr as hydrateString,hn as ideContextStore,Ue as initializeDaemonMetrics,wc as initializeTelemetry,Re as injectDaemonTraceContext,Ul as injectPermissionRulesIfMissing,Iq as invokeMcpPrompt,b as isAbortError,Cd as isAnyAutoMemPath,Kg as isApiError,km as isApproveOutcome,_l as isAutoEditApproved,qd as isAutoMemPath,Jt as isBareMode,Km as isBinary,hb as isBinaryFile,Tf as isBrowserCommandBlocked,cs as isClaudePluginConfig,wl as isCommandAllowed,vl as isCommandAvailable,xl as isCommandNeedsPermission,Q as isDebugLoggingDegraded,em as isDenialFallbackReason,sg as isDeviceAuthorizationSuccess,ug as isDeviceTokenPending,tg as isDeviceTokenSuccess,Em as isEditorAvailable,Mq as isEnabled,vg as isErrorResponse,Zs as isGatedMcpScope,Ng as isGenericQuotaExceededError,qi as isGitRepository,Fn as isInProcessTeammate,nm as isInSafeToolAllowlist,Mk as isInvalidArgumentError,Og as isMatildaQuotaExceededError,Hm as isModifiableDeclarativeTool,a as isNodeError,ho as isPathWithinRoot,Jb as isPerformanceMonitoringActive,Zl as isPlanModeBlocked,Mg as isProQuotaExceededError,Pg as isRateLimitError,ff as isReportedOperationHeaderName,xe as isRuntimeDiagnosticsEnabled,Lk as isSchemaDepthError,Or as isScopedNpmPackage,$s as isSdkMcpServerConfig,xa as isSettledStatus,Lg as isStructuredError,F as isSubpath,G as isSubpaths,wa as isSuccessStatus,ig as isSupportedImageMimeType,yk as isSystemReminderContent,Kn as isTeamLead,Jn as isTeammate,vc as isTelemetrySdkInitialized,Am as isTerminalEditor,va as isTerminalStatus,Zr as isTomlFormat,ha as isTool,bl as isToolEnabled,Sg as isTransientCapacityError,Tg as isUnattendedMode,Bd as isUserAutoMemPath,wm as isValidEditorType,Hk as isValidNonThoughtTextPart,el as isWindows,gb as isWithinRoot,Uh as judgeGoal,Gf as knownTokenLimit,Gs as layer,Gq as listMcpPrompts,vp as listTasks,cp as listTeamNames,Ps as loadIgnoreRules,xs as loadServerHierarchicalMemory,Ft 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,Ju as makeFakeConfig,A as makeRelative,Td as makeSlashCommandEvent,Ml as matchesCommandPattern,Pl as matchesDomainPattern,Ql as matchesMcpPattern,Ol as matchesPathPattern,Rl as matchesRule,yg as matildaOAuth2Events,Jf as matildaProvider,es as maybePromptForSettings,sq as mcpServerRequiresOAuth,cr as mcpTransportOf,bs as mergeClaudeConfigs,Bt as metricsToUsageRecord,xj as minimaxProvider,Cs as modelProvidersSource,Qf as modelRegistryKey,zj as modelscopeProvider,Im as modifyWithEditor,Xl as needsConfirmation,Wm as needsUtf8Bom,Ef as normalize,Lm as normalizeContent,Bk as normalizeModelToolCallIds,ml as normalizeMonitorCommand,vs as normalizeProxyUrl,lr as normalizeSkillPriority,ci as normalizeStopHookBlockingCap,te as normalizeStoredModelUsage,Ct as normalizeUsageRecord,sh as notifyGoalTerminal,pp as notifyTasksUpdated,op as onTasksUpdated,lg as openBrowserSecurely,Gm as openDiff,vj as openRouterProvider,we as openaiLogger,ht as oversizedMediaPlaceholder,ir as parse,fi as parseAndFormatApiError,Ce as parseBooleanEnvFlag,Xq as parseConnectionId,Ji as parseDeletedFromNameStatus,Hi as parseGitDiff,Tr as parseGitHubRepoForReleases,Gi as parseGitNumstat,mt as parseInsightMessage,gu as parseInstallSource,hi as parseLineTolerant,Nr as parseNpmPackageSource,Gl as parseRule,Hl as parseRules,Ii as parseShortstat,De as parseTelemetryTargetValue,Rj as parseThought,dt as partListUnionToString,Vg as partToString,qm as passesAcceptEditsFastPath,Kr as performVariableReplacement,Vl as persistPermissionOutcome,At as persistSessionUsage,Dq as populateMcpServerCommand,Zg as prependToFirstTextPart,jb as processSingleFileContent,fs as promptForSetting,Rm as promptIdContext,rj as providerMatchesCredentials,ji as read,Tk as readAutoMemoryIndex,bb as readFileWithEncoding,ab as readFileWithEncodingInfo,db as readFileWithLineAndLimit,fp as readInbox,Zi as readLastJsonStringFieldSync,_i as readLastJsonStringFieldsSync,ii as readLines,Eu as readManyFiles,Wf as readMatildaCredentials,zu as readPathFromWorkspace,Si as readRuntimeStatus,Zo as readTeamFile,Vk as readUserAutoMemoryIndex,Ks as readWorktreeSession,Xn as readWorktreeSessionMarker,fm 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,gm 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,jm 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,hm as recordUnavailable,Ir as recursivelyHydrateStrings,fg as redactProxyCredentials,Dk as redactStructuredOutputArgsForRecording,Mr as redactUrlCredentials,Dt as reestimateUsageFromAssistantRecord,ag as refreshMatildaCredentials,xc as refreshSessionContext,Ve as registerDaemonGaugeCallbacks,$h as registerGoalHook,Go as registerLeader,zp as releaseOwnedTask,wq as removeMCPServerStatus,uq as removeMCPStatusChangeListener,V as renameWithRetry,Y as renameWithRetrySync,Jk as repairOrphanedToolUseTurns,cj as replayUiTelemetryFromConversation,qf as reportCliAuthFunnelEvent,pf as reportCliClientEvent,aq as reportedAttemptPurposeForSendMessageType,R as resetDebugLoggingState,lm as resetDenialState,Ua as resetEncodingCache,wp as resetTaskList,Xm as resetUtf8BomCache,In as resolveActiveTeamName,J as resolveAndValidatePath,oj as resolveBaseUrl,Oq as resolveBundleDir,ul as resolveCommandPath,Eg as resolveContentGeneratorConfigWithSources,ys as resolveField,Ki as resolveGitDir,oh as resolveGoalLifecycleStatus,Kj as resolveLocalHistoryAccountScopeId,Lj as resolveLocalHistoryAccountScopeIdForCredentials,Gp as resolveMaxConcurrentBackgroundAgents,jj as resolveMetadataKey,Hs as resolveModelConfig,Ig as resolveModelId,Pr as resolveNpmRegistry,ue as resolveOpenAILogDir,zs as resolveOptionalField,ij as resolveOwnsModel,H as resolvePath,Wj as resolvePathFromEnv,Nl as resolvePathPattern,Qq as resolveRipgrep,di as resolveStopHookBlockingCap,Ee as resolveTelemetrySettings,Dl as resolveToolName,Ns as restoreWorktreeContext,Ug as retryWithBackoff,qu as rewritePathArgs,Et as rewriteUsageHistoryFromChats,mf as runAsyncGeneratorWithReportedOperationContext,Sp as runForkedAgent,nc as runInSubagentSpanContext,ec as runInToolSpanContext,Uq as runRipgrep,vi as runSideQuery,Qe as runWithDaemonTelemetryContext,T as runWithDebugLogSession,Rp as runWithForkedChatModel,lf as runWithReportedAttemptPurpose,jf as runWithReportedOperationContext,Mn as runWithTeammateIdentity,ze as runtimeDiagnostics,sa as safeAgentId,Jm as safeLiteralReplace,E as sanitizeCwd,Rb as sanitizeHookName,Qo as sanitizeName,hj as sanitizeTitle,Mj as sanitizeToolCallResultForRecording,Ch as sanitizeUserPromptExpansionAdditionalContext,Np as saveCacheSafeParams,Bu as saveWelcomeBackRestartChoice,kp as sendStructuredMessage,Ni as serializeSnapshot,Om as serializeTerminalToObject,Mm as serializeTerminalToText,Sm as sessionIdContext,kh as setActiveGoal,S as setDebugLogSession,Ha as setGeminiMdFilename,qh as setGoalTerminalObserver,uh as setLastGoalTerminal,Aq as setMCPDiscoveryState,sc as setMatildaCorrelationHashes,Vo as setMemberActive,fh as setStartupEventSink,Bs as settingsSource,z as shortenPath,Uf as shouldAttemptBrowserLaunch,zl as shouldDefaultToNodePty,im as shouldFallback,nu as shouldFilterSuggestion,sm as shouldFirePermissionDeniedForAutoMode,pm as shouldForceAutoModeReviewForAllow,mg as shouldLaunchBrowser,om as shouldRunAutoModeForCall,qj as shouldShowStep,yc as shutdownTelemetry,ek as sleepInhibitor,gl as splitCommands,Ll as splitCompoundCommand,mr as splitConditionalSkills,kc as startHookSpan,_b as startInteractionSpan,bc as startLLMRequestSpan,su as startSpeculation,mc as startSubagentSpan,ic as startToolBlockedOnUserSpan,gc as startToolExecutionSpan,dc as startToolSpan,bq as startsReportedOperation,jr as stringify,Nf as stripRuntimeSnapshotPrefix,jl as stripShellWrapper,zk as stripStartupContext,zi as stripTerminalControlSequences,kl as stripTrailingBackgroundAmp,Fu as subagentGenerator,Jr as substituteHookVariables,Be as summarizeAnthropicWireRequest,Ae as summarizeOpenAIWireRequest,to as summarizeUnifiedDiff,Dn as teammateIdentityStore,Bn as templateString,x as tildeifyPath,r as toFriendlyError,Al as toPosixPath,Hf as tokenLimit,Fl as toolMatchesRuleToolName,se as totalTokensFromBuckets,Sb as truncateContent,yt as truncateJson,Zb as truncateSpanError,gj as tryGenerateSessionTitle,ap as tryReclaimStaleTeam,pa as uiTelemetryService,Ap as unassignTeammateTasks,Vi as unescapeJsonString,C as unescapePath,_h as unregisterGoalHook,Io as unregisterLeader,nh as updateActiveGoalStatus,vq as updateMCPServerStatus,is as updateSetting,L as updateSymlink,tp as updateTask,Fg as validateModelConfig,ps as validateName,I as validatePath,Gr as validateVariables,bg as willOpenMatildaAuthBrowser,Xa as windowsCodePageToEncoding,Ke as withDaemonBridgeSpan,Je as withDaemonRequestSpan,Ie as withDaemonSpan,ac as withInteractionSpan,nf as withReportedAttemptPurpose,Un as worktreeBranchForSlug,Ko as wrapConfirmWithBadge,ni as write,li as writeLine,mi as writeLineSync,Xf as writeMatildaCredentials,gp as writeMessage,Ri as writeRuntimeStatus,_o as writeTeamFile,Lt as writeWorkspaceContextFile,Ls as writeWorktreeSession,Wn as writeWorktreeSessionMarker,yj as zaiProvider};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Cg as D,rg as u}from"./chunk-EBPJIU5O.js";import"./chunk-TZIDSCTF.js";import{l as A}from"./chunk-FUNLOUYI.js";import{l as C}from"./chunk-R3H6IWFK.js";import{b as w,e as T,f as k,g as b,q as o,r as v}from"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import{k as f,l as y}from"./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-5RG6AVD6.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-SDTWBD62.js";import"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as c,i as g,p as h,q as p}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 d}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as l}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";l();var i=class extends c{constructor(e,a){super(a);this.config=e}getDescription(){return`Create team "${this.params.team_name}"`}async execute(){let e=k(this.params.team_name);if(!e){let t="Team name is required.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getArenaManager()){let t="Cannot create a team while an Arena session is active. End the Arena session first.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getTeamManager()){let t="A team is already active. Delete it before creating a new one.";return{llmContent:t,returnDisplay:t,error:{message:t}}}let a=b(y,e),s={name:e,description:this.params.description,createdAt:Date.now(),leadAgentId:a,leadSessionId:this.config.getSessionId(),leadPid:process.pid,members:[]};try{await o(e,s)}catch(t){if(d(t)&&t.code==="EEXIST"){if(!await v(e)){let n=`Team "${e}" already exists and appears to be owned by a live matilda-code session. Pick a different name, or \u2014 if you're sure no other session is using it \u2014 remove the on-disk artifacts manually:
3
+ import{Cg as D,rg as u}from"./chunk-7LNKXNEZ.js";import"./chunk-TZIDSCTF.js";import{l as A}from"./chunk-FUNLOUYI.js";import{l as C}from"./chunk-R3H6IWFK.js";import{b as w,e as T,f as k,g as b,q as o,r as v}from"./chunk-OMZ5SGMK.js";import"./chunk-C2ZWB2NT.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-LQWORCPO.js";import"./chunk-TISQNFB5.js";import"./chunk-FT76AZPN.js";import"./chunk-47XR7IMP.js";import"./chunk-QEI3OETI.js";import{k as f,l as y}from"./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-FU2PKCG5.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-SDTWBD62.js";import"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as c,i as g,p as h,q as p}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 d}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as l}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";l();var i=class extends c{constructor(e,a){super(a);this.config=e}getDescription(){return`Create team "${this.params.team_name}"`}async execute(){let e=k(this.params.team_name);if(!e){let t="Team name is required.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getArenaManager()){let t="Cannot create a team while an Arena session is active. End the Arena session first.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getTeamManager()){let t="A team is already active. Delete it before creating a new one.";return{llmContent:t,returnDisplay:t,error:{message:t}}}let a=b(y,e),s={name:e,description:this.params.description,createdAt:Date.now(),leadAgentId:a,leadSessionId:this.config.getSessionId(),leadPid:process.pid,members:[]};try{await o(e,s)}catch(t){if(d(t)&&t.code==="EEXIST"){if(!await v(e)){let n=`Team "${e}" already exists and appears to be owned by a live matilda-code session. Pick a different name, or \u2014 if you're sure no other session is using it \u2014 remove the on-disk artifacts manually:
4
4
  rm -rf "${w(e)}" "${T(e)}"`;return{llmContent:n,returnDisplay:n,error:{message:n}}}await o(e,s)}else throw t}await C(e),await A(e);let m=new u(this.config);await m.init();let x=new D(m,s,this.config.getSubagentManager(),{maxTeammates:this.config.getAgentsSettings().team?.maxTeammates});this.config.setTeamManager(x);let N={teamName:e,leadAgentId:a,teammates:{}};this.config.setTeamContext(N);let E={type:"team_result",teamName:e,action:"created"};return{llmContent:`Team "${e}" created.`+(this.params.description?` Description: ${this.params.description}`:""),returnDisplay:E}}},I=class r extends g{constructor(e){super(r.Name,p.TEAM_CREATE,`# TeamCreate
5
5
 
6
6
  ## When to Use
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Cc as N}from"./chunk-CFBZKYFB.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as v,i as R,p as E,q as L}from"./chunk-5U3A6KMU.js";import"./chunk-IOCF4XSR.js";import{Y as S}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as C}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";C();var y=S("TOOL_SEARCH"),D=5,A=20,b=10,x=5,$=4,k=2,q=12,M=6,P=`Fetches function declarations for deferred tools and registers them with the active session so subsequent turns can call them.
3
+ import{Cc as N}from"./chunk-6QP5C76Y.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-UY2R3ZQ4.js";import"./chunk-NDR7ZFUA.js";import{g as v,i as R,p as E,q as L}from"./chunk-5U3A6KMU.js";import"./chunk-IOCF4XSR.js";import{Y as S}from"./chunk-QWBNNEV2.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as C}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";C();var y=S("TOOL_SEARCH"),D=5,A=20,b=10,x=5,$=4,k=2,q=12,M=6,P=`Fetches function declarations for deferred tools and registers them with the active session so subsequent turns can call them.
4
4
 
5
5
  Deferred tools appear by name in the deferred-tools startup reminder. Until fetched, only the name is known \u2014 there is no parameter schema, so the tool cannot be invoked. This tool takes a query, matches it against the deferred tool list, and returns the matched tools' function declarations (name + description + parameter schema) inside a <functions> block.
6
6