@maincode-ai/matilda-code 0.22.0-nightly.20261102.db95a17c4 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/agent-JDATO222.js +3 -0
- package/chunks/agent-headless-ZOFNY4CF.js +3 -0
- package/chunks/{askUserQuestion-7PM7G5YF.js → askUserQuestion-A46IDHKS.js} +1 -1
- package/chunks/{chunk-7MUWF4DK.js → chunk-2LVAK6TV.js} +1 -1
- package/chunks/{chunk-QUYQBKDE.js → chunk-5JCW6FH6.js} +1 -1
- package/chunks/{chunk-WENVHSCJ.js → chunk-6RK6IJY5.js} +1 -1
- package/chunks/{chunk-ESNPNLMQ.js → chunk-7AEOFDY3.js} +1 -1
- package/chunks/{chunk-ZABH4QIL.js → chunk-AEYNMLMW.js} +1 -1
- package/chunks/{chunk-4KS2KEXK.js → chunk-CI5CVVGI.js} +62 -62
- package/chunks/{chunk-4MLFC664.js → chunk-DEN6RR3B.js} +1 -1
- package/chunks/{chunk-QBXL5UBB.js → chunk-FI2FSW7J.js} +1 -1
- package/chunks/{chunk-BVTXZTL3.js → chunk-GCMUSGTT.js} +1 -1
- package/chunks/{chunk-66WJUORA.js → chunk-HRCRNKY2.js} +1 -1
- package/chunks/{chunk-JR5CSCG4.js → chunk-IV6PS6DB.js} +1 -1
- package/chunks/{chunk-CVGGYRNK.js → chunk-KYNP66YS.js} +1 -1
- package/chunks/{chunk-QDWS3VZT.js → chunk-LONWTJOE.js} +1 -1
- package/chunks/{chunk-35BBGAHD.js → chunk-QNXNECWR.js} +458 -460
- package/chunks/{chunk-2QIC3OCV.js → chunk-RH3AEZWO.js} +1 -1
- package/chunks/{chunk-QMZREVY3.js → chunk-SMTY6M3W.js} +1 -1
- package/chunks/{chunk-VVUY7VKR.js → chunk-TDFF4ZGY.js} +1 -1
- package/chunks/chunk-TKEFJ3O3.js +9 -0
- package/chunks/{chunk-S2E5ZRPH.js → chunk-UICLGQTV.js} +1 -1
- package/chunks/{chunk-6U5VOTWB.js → chunk-V2V3OF76.js} +1 -1
- package/chunks/chunk-XPVKH5TC.js +10 -0
- package/chunks/{chunk-33UVJMVE.js → chunk-Y3SZK63U.js} +16 -16
- package/chunks/{chunk-KRVXBQRC.js → chunk-ZABAV4XA.js} +1 -1
- package/chunks/{computer-use-IZGLKENV.js → computer-use-V2DT2IKO.js} +1 -1
- package/chunks/{cron-create-BTSJUVNT.js → cron-create-JINCFLKY.js} +1 -1
- package/chunks/{cron-delete-PTE3RC2W.js → cron-delete-RF6JLUAV.js} +1 -1
- package/chunks/{cron-list-SINKHOIZ.js → cron-list-VXLBAXZ3.js} +1 -1
- package/chunks/{edit-MDQEZ7BA.js → edit-ZB4SONLT.js} +3 -3
- package/chunks/{enter-worktree-SZK65VXF.js → enter-worktree-CAFTW46C.js} +1 -1
- package/chunks/{enterPlanMode-5VWIIVHI.js → enterPlanMode-XSNXJJMC.js} +1 -1
- package/chunks/{exit-worktree-OBHUK4TF.js → exit-worktree-U37YLKJC.js} +1 -1
- package/chunks/{exitPlanMode-SXFQC4G2.js → exitPlanMode-XKAZCVAV.js} +1 -1
- package/chunks/{glob-JKIZ3ZJQ.js → glob-LPIFPVGX.js} +1 -1
- package/chunks/{goal-tools-YJMECZYD.js → goal-tools-VAH424PW.js} +1 -1
- package/chunks/{grep-Q4T5AE6K.js → grep-IF4GTD5A.js} +1 -1
- package/chunks/{keychain-token-storage-4PY5J6U6.js → keychain-token-storage-UTWIIKCK.js} +1 -1
- package/chunks/{ls-BQCCCPIX.js → ls-3EEHZY4W.js} +1 -1
- package/chunks/{lsp-MHJJJ7K3.js → lsp-H4EXPHFD.js} +1 -1
- package/chunks/mcp-client-EUPXG3VF.js +3 -0
- package/chunks/monitor-KBWRPPZ5.js +32 -0
- package/chunks/notebook-edit-K3KNR6DI.js +17 -0
- package/chunks/{openaiContentGenerator-DTKOYRBL.js → openaiContentGenerator-2NF5JGUC.js} +8 -8
- package/chunks/read-file-SRDZKBNS.js +3 -0
- package/chunks/ripGrep-675JNT4W.js +3 -0
- package/chunks/scheduler-O36AJTWS.js +8 -0
- package/chunks/{send-message-S4P5QKSW.js → send-message-5XHDGHSN.js} +1 -1
- package/chunks/shell-A7NRVDCY.js +3 -0
- package/chunks/{skill-V6NTJ4O4.js → skill-FCVSGCSN.js} +1 -1
- package/chunks/{symbol-search-5QJNW7PY.js → symbol-search-ZM3HFCUV.js} +1 -1
- package/chunks/{syntheticOutput-3XIAIUIR.js → syntheticOutput-OIPRFBVD.js} +1 -1
- package/chunks/{task-create-KGPY7O4J.js → task-create-QP44DKH4.js} +1 -1
- package/chunks/{task-detach-ZD3A7225.js → task-detach-AUTU6C4G.js} +1 -1
- package/chunks/{task-list-P7GQWYAD.js → task-list-U2WAGMM7.js} +1 -1
- package/chunks/{task-stop-VFJRBA6P.js → task-stop-GN5WZ3IA.js} +1 -1
- package/chunks/{task-update-OOMH4WRA.js → task-update-26N2AUQT.js} +1 -1
- package/chunks/{team-create-POMZOM44.js → team-create-TN2KN27J.js} +1 -1
- package/chunks/{team-delete-ZJBEQDPE.js → team-delete-XCKD5FBZ.js} +1 -1
- package/chunks/todoWrite-JN3ZV5O2.js +3 -0
- package/chunks/{tool-search-5Z7MO565.js → tool-search-VPMEQKAS.js} +1 -1
- package/chunks/{web-fetch-M4TUYAFG.js → web-fetch-CVAOVOZM.js} +1 -1
- package/chunks/{web-search-CBKF36JM.js → web-search-77CUPTFY.js} +3 -3
- package/chunks/{workflow-F57TWWPS.js → workflow-JNZRGHJ4.js} +2 -2
- package/chunks/write-file-FJCU2PYT.js +15 -0
- package/cli.js +391 -391
- package/package.json +2 -2
- package/chunks/agent-4GIFJO5G.js +0 -3
- package/chunks/agent-headless-DXJESNI4.js +0 -3
- package/chunks/chunk-JNHB73E3.js +0 -9
- package/chunks/mcp-client-CSF5QZEY.js +0 -3
- package/chunks/monitor-JUAVWVLY.js +0 -32
- package/chunks/notebook-edit-NNOMEUER.js +0 -17
- package/chunks/read-file-4EX4B3TB.js +0 -3
- package/chunks/ripGrep-JL6UDNCR.js +0 -3
- package/chunks/scheduler-GCGZAI7D.js +0 -8
- package/chunks/shell-J7EX7B57.js +0 -3
- package/chunks/todoWrite-EWYRFK7W.js +0 -3
- package/chunks/write-file-UK4BVL3M.js +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{
|
|
3
|
+
import{Y as d}from"./chunk-AEYNMLMW.js";import{b as n}from"./chunk-GZPNIYVZ.js";n();import*as w from"node:crypto";n();var l=class{serviceName;constructor(e){this.serviceName=e}validateCredentials(e){if(!e.serverName)throw new Error("Server name is required");if(!e.token)throw new Error("Token is required");if(!e.token.accessToken)throw new Error("Access token is required");if(!e.token.tokenType)throw new Error("Token type is required")}isTokenExpired(e){if(!e.token.expiresAt)return!1;let t=5*60*1e3;return Date.now()>e.token.expiresAt-t}sanitizeServerName(e){return e.replace(/[^a-zA-Z0-9-_.]/g,"_")}};var o=d("MCP_KEYCHAIN"),c="__keychain_test__",s="__secret__",y=class extends l{keychainAvailable=null;keytarModule=null;keytarLoadAttempted=!1;async getKeytar(){if(this.keytarLoadAttempted)return this.keytarModule;this.keytarLoadAttempted=!0;try{let t=await import("keytar");this.keytarModule=t.default||t}catch(e){o.error(`Failed to load keytar module: ${e}`)}return this.keytarModule}async getCredentials(e){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let t=await this.getKeytar();if(!t)throw new Error("Keytar module not available");try{let r=this.sanitizeServerName(e),a=await t.getPassword(this.serviceName,r);if(!a)return null;let i=JSON.parse(a);return this.isTokenExpired(i)?null:i}catch(r){throw r instanceof SyntaxError?new Error(`Failed to parse stored credentials for ${e}`):r}}async setCredentials(e){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let t=await this.getKeytar();if(!t)throw new Error("Keytar module not available");this.validateCredentials(e);let r=this.sanitizeServerName(e.serverName),a={...e,updatedAt:Date.now()},i=JSON.stringify(a);await t.setPassword(this.serviceName,r,i)}async deleteCredentials(e){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let t=await this.getKeytar();if(!t)throw new Error("Keytar module not available");let r=this.sanitizeServerName(e);if(!await t.deletePassword(this.serviceName,r))throw new Error(`No credentials found for ${e}`)}async listServers(){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let e=await this.getKeytar();if(!e)throw new Error("Keytar module not available");try{return(await e.findCredentials(this.serviceName)).filter(r=>!r.account.startsWith(c)).filter(r=>!r.account.startsWith(s)).map(r=>r.account)}catch(t){return o.error(`Failed to list servers from keychain: ${t}`),[]}}async getAllCredentials(){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let e=await this.getKeytar();if(!e)throw new Error("Keytar module not available");let t=new Map;try{let r=(await e.findCredentials(this.serviceName)).filter(a=>!a.account.startsWith(c)).filter(a=>!a.account.startsWith(s));for(let a of r)try{let i=JSON.parse(a.password);this.isTokenExpired(i)||t.set(a.account,i)}catch(i){o.error(`Failed to parse credentials for ${a.account}: ${i}`)}}catch(r){o.error(`Failed to get all credentials from keychain: ${r}`)}return t}async clearAll(){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let e=this.keytarModule?await this.keytarModule.findCredentials(this.serviceName).then(r=>r.map(a=>a.account)).catch(r=>{throw new Error(`Failed to list servers for clearing: ${r.message}`)}):[],t=[];for(let r of e)try{await this.deleteCredentials(r)}catch(a){t.push(a)}if(t.length>0)throw new Error(`Failed to clear some credentials: ${t.map(r=>r.message).join(", ")}`)}async checkKeychainAvailability(){if(this.keychainAvailable!==null)return this.keychainAvailable;try{let e=await this.getKeytar();if(!e)return this.keychainAvailable=!1,!1;let t=`${c}${w.randomBytes(8).toString("hex")}`,r="test";await e.setPassword(this.serviceName,t,r);let a=await e.getPassword(this.serviceName,t),h=await e.deletePassword(this.serviceName,t)&&a===r;return this.keychainAvailable=h,h}catch{return this.keychainAvailable=!1,!1}}async isAvailable(){return this.checkKeychainAvailability()}async setSecret(e,t){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let r=await this.getKeytar();if(!r)throw new Error("Keytar module not available");await r.setPassword(this.serviceName,`${s}${e}`,t)}async getSecret(e){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let t=await this.getKeytar();if(!t)throw new Error("Keytar module not available");return t.getPassword(this.serviceName,`${s}${e}`)}async deleteSecret(e){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let t=await this.getKeytar();if(!t)throw new Error("Keytar module not available");if(!await t.deletePassword(this.serviceName,`${s}${e}`))throw new Error(`No secret found for key: ${e}`)}async listSecrets(){if(!await this.checkKeychainAvailability())throw new Error("Keychain is not available");let e=await this.getKeytar();if(!e)throw new Error("Keytar module not available");try{return(await e.findCredentials(this.serviceName)).filter(r=>r.account.startsWith(s)).map(r=>r.account.substring(s.length))}catch(t){return o.error(`Failed to list secrets from keychain: ${t}`),[]}}};export{l as a,y as b};
|
|
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{f as o,g as a,m as u,n}from"./chunk-
|
|
3
|
+
import{f as o,g as a,m as u,n}from"./chunk-KYNP66YS.js";import{b as s}from"./chunk-GZPNIYVZ.js";s();var i=`Submit your final answer as structured JSON that conforms to the provided schema.
|
|
4
4
|
|
|
5
5
|
CRITICAL: In structured-output mode, this is the ONLY way to deliver the final result. Call this tool to deliver the final result; the first call with valid arguments ends the session. Do not emit the final answer as plain text \u2014 it will be discarded. Use other tools (Read, Grep, etc.) to gather the information you need before calling this tool.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{
|
|
3
|
+
import{Y as M,c as u}from"./chunk-AEYNMLMW.js";import{b as I}from"./chunk-GZPNIYVZ.js";I();import*as P from"node:crypto";import*as n from"node:fs";import*as f from"node:fs/promises";import*as O from"node:path";var C=M("ATOMIC_WRITE");async function L(t,o,e,i,w=f.rename){for(let a=0;a<=e;a++)try{await w(t,o);return}catch(c){if(!(u(c)&&(c.code==="EPERM"||c.code==="EACCES"))||a===e)throw c;await new Promise(v=>setTimeout(v,i*2**a))}}async function $(t){let e=t;for(let w=0;w<40;w++){let a;try{a=await f.lstat(e)}catch(l){if(u(l)&&l.code==="ENOENT")return e;throw l}if(!a.isSymbolicLink())return e;let c=await f.readlink(e);if(O.isAbsolute(c))e=c;else{let l=await f.realpath(O.dirname(e));e=O.resolve(l,c)}}let i=new Error(`ELOOP: too many levels of symbolic links, resolve '${t}'`);throw i.code="ELOOP",i}async function B(t,o,e,i){let w=e?.retries??3,a=e?.delayMs??50,c=e?.flush??!0,l=e?.encoding??"utf-8",v=i?.rename??f.rename,F=i?.writeFile??f.writeFile,x=i?.open??f.open,T=i?.chmod??f.chmod,A=i?.fchmod??((d,s)=>d.chmod(s)),b=i?.unlink??f.unlink,r=e?.noFollow?t:await $(t).catch(d=>{throw N(d,t)}),S;try{S=await f.stat(r)}catch(d){if(!u(d)||d.code!=="ENOENT")throw d}let W;(!e?.forceMode||e?.mode===void 0)&&(W=S!==void 0?S.mode&4095:void 0);let y=W??e?.mode,p={};typeof o=="string"&&(p.encoding=l),c&&(p.flush=!0),y!==void 0&&(p.mode=y);let k=async d=>{if(y!==void 0)try{await T(d,y)}catch(s){if(!u(s)||s.code!=="ENOSYS"&&s.code!=="ENOTSUP")throw s}},h=()=>{if(S===void 0||process.platform==="win32")return!1;let d=process.geteuid?.();return d===void 0?!1:S.uid!==d};if(S!==void 0&&S.isFile()&&h()){await f.writeFile(r,o,p),await k(r);return}let m=`${r}.${P.randomBytes(6).toString("hex")}.tmp`;try{await F(m,o,p),await k(m),await L(m,r,w,a,v)}catch(d){try{await b(m)}catch{}if(u(d)&&d.code==="EXDEV")try{if(e?.noFollow){try{await b(r)}catch(g){if(!u(g)||g.code!=="ENOENT")throw g}let s=await x(r,n.constants.O_WRONLY|n.constants.O_CREAT|n.constants.O_EXCL,y??438),E=!1;try{try{if(await s.writeFile(typeof o=="string"?Buffer.from(o,l):o),c&&await s.sync(),y!==void 0)try{await A(s,y)}catch(g){if(!u(g)||g.code!=="ENOSYS"&&g.code!=="ENOTSUP")throw g}E=!0}finally{await s.close()}}catch(g){if(!E)try{await b(r)}catch(R){C.debug(`orphan unlink failed for ${r}:`,R)}throw g}}else await F(r,o,p),await k(r);return}catch(s){throw N(s,r)}throw N(d,r)}}function N(t,o,e="atomicWriteFile"){return t instanceof Error&&!t.message.startsWith(`${e}(`)&&(t.message=`${e}(${JSON.stringify(o)}): ${t.message}`),t}async function X(t,o,e){await B(t,JSON.stringify(o,null,2),{encoding:"utf-8",...e})}function H(t){if(t<=0)return;let o=new SharedArrayBuffer(4),e=new Int32Array(o);Atomics.wait(e,0,0,t)}function Y(t,o,e,i,w=n.renameSync){for(let a=0;a<=e;a++)try{w(t,o);return}catch(c){if(!(u(c)&&(c.code==="EPERM"||c.code==="EACCES"))||a===e)throw c;H(i*2**a)}}function D(t){let e=t;for(let w=0;w<40;w++){let a;try{a=n.lstatSync(e)}catch(l){if(u(l)&&l.code==="ENOENT")return e;throw l}if(!a.isSymbolicLink())return e;let c=n.readlinkSync(e);if(O.isAbsolute(c))e=c;else{let l=n.realpathSync(O.dirname(e));e=O.resolve(l,c)}}let i=new Error(`ELOOP: too many levels of symbolic links, resolve '${t}'`);throw i.code="ELOOP",i}function V(t,o,e,i){let w=e?.retries??3,a=e?.delayMs??50,c=e?.flush??!0,l=e?.encoding??"utf-8",v=i?.rename??n.renameSync,F=i?.writeFile??n.writeFileSync,x=i?.open??n.openSync,T=i?.chmod??n.chmodSync,A=i?.fchmod??n.fchmodSync,b=i?.unlink??n.unlinkSync,r;if(e?.noFollow)r=t;else try{r=D(t)}catch(h){throw N(h,t,"atomicWriteFileSync")}let S=`${r}.${P.randomBytes(6).toString("hex")}.tmp`,W;if(!e?.forceMode||e?.mode===void 0)try{W=n.statSync(r).mode&4095}catch(h){if(!u(h)||h.code!=="ENOENT")throw h}let y=W??e?.mode,p={};typeof o=="string"&&(p.encoding=l),c&&(p.flush=!0),y!==void 0&&(p.mode=y);let k=h=>{if(y!==void 0)try{T(h,y)}catch(m){if(!u(m)||m.code!=="ENOSYS"&&m.code!=="ENOTSUP")throw m}};try{F(S,o,p),k(S),Y(S,r,w,a,v)}catch(h){try{b(S)}catch{}if(u(h)&&h.code==="EXDEV")try{if(e?.noFollow){try{b(r)}catch(s){if(!u(s)||s.code!=="ENOENT")throw s}let m=x(r,n.constants.O_WRONLY|n.constants.O_CREAT|n.constants.O_EXCL,y??438),d=!1;try{try{let s=typeof o=="string"?Buffer.from(o,l):o;if(n.writeFileSync(m,s),c&&n.fsyncSync(m),y!==void 0)try{A(m,y)}catch(E){if(!u(E)||E.code!=="ENOSYS"&&E.code!=="ENOTSUP")throw E}d=!0}finally{n.closeSync(m)}}catch(s){if(!d)try{b(r)}catch(E){C.debug(`orphan unlink failed for ${r}:`,E)}throw s}}else F(r,o,p),k(r);return}catch(m){throw N(m,r,"atomicWriteFileSync")}throw N(h,r,"atomicWriteFileSync")}}export{B as a,X as b,V as c};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Matilda Team
|
|
@@ -23,7 +23,7 @@ new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
|
|
|
23
23
|
|
|
24
24
|
https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
25
25
|
`);this.baseURL=l.baseURL,this.timeout=l.timeout??En.DEFAULT_TIMEOUT,this.logger=l.logger??console;let u="warn";this.logLevel=u,this.logLevel=tn(l.logLevel,"ClientOptions.logLevel",this)??tn(xe("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??u,this.fetchOptions=l.fetchOptions,this.maxRetries=l.maxRetries??2,this.fetch=l.fetch??Vn(),w(this,Fr,Kn,"f"),this._options=l,this.apiKey=t,this.organization=n,this.project=s,this.webhookSecret=o}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){}async authHeaders(e){return g([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return Zr(e,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${ge}`}defaultIdempotencyKey(){return`stainless-node-retry-${qr()}`}makeStatusError(e,t,n,s){return N.generate(e,t,n,s)}buildURL(e,t,n){let s=!c(this,Rn,"m",Ms).call(this)&&n||this.baseURL,o=Fn(e)?new URL(e):new URL(s+(s.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),a=this.defaultQuery();return Ln(a)||(t={...a,...t}),typeof t=="object"&&t&&!Array.isArray(t)&&(o.search=this.stringifyQuery(t)),o.toString()}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(s=>({method:e,path:t,...s})))}request(e,t=null){return new ke(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let s=await e,o=s.maxRetries??this.maxRetries;t==null&&(t=o),await this.prepareOptions(s);let{req:a,url:l,timeout:u}=await this.buildRequest(s,{retryCount:o-t});await this.prepareRequest(a,{url:l,options:s});let m="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),_=n===void 0?"":`, retryOf: ${n}`,p=Date.now();if(k(this).debug(`[${m}] sending request`,ce({retryOfRequestLogID:n,method:s.method,url:l,options:s,headers:a.headers})),s.signal?.aborted)throw new v;let y=new AbortController,f=await this.fetchWithTimeout(l,a,u,y).catch(Bt),P=Date.now();if(f instanceof Error){let E=`retrying, ${t} attempts remaining`;if(s.signal?.aborted)throw new v;let x=Lt(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(t)return k(this).info(`[${m}] connection ${x?"timed out":"failed"} - ${E}`),k(this).debug(`[${m}] connection ${x?"timed out":"failed"} (${E})`,ce({retryOfRequestLogID:n,url:l,durationMs:P-p,message:f.message})),this.retryRequest(s,t,n??m);throw k(this).info(`[${m}] connection ${x?"timed out":"failed"} - error; no more retries left`),k(this).debug(`[${m}] connection ${x?"timed out":"failed"} (error; no more retries left)`,ce({retryOfRequestLogID:n,url:l,durationMs:P-p,message:f.message})),x?new me:new he({cause:f})}let A=[...f.headers.entries()].filter(([E])=>E==="x-request-id").map(([E,x])=>", "+E+": "+JSON.stringify(x)).join(""),T=`[${m}${_}${A}] ${a.method} ${l} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${P-p}ms`;if(!f.ok){let E=await this.shouldRetry(f);if(t&&E){let O=`retrying, ${t} attempts remaining`;return await zn(f.body),k(this).info(`${T} - ${O}`),k(this).debug(`[${m}] response error (${O})`,ce({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:P-p})),this.retryRequest(s,t,n??m,f.headers)}let x=E?"error; no more retries left":"error; not retryable";k(this).info(`${T} - ${x}`);let j=await f.text().catch(O=>Bt(O).message),C=Wn(j),J=C?void 0:j;throw k(this).debug(`[${m}] response error (${x})`,ce({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:J,durationMs:Date.now()-p})),this.makeStatusError(f.status,C,J,f.headers)}return k(this).info(T),k(this).debug(`[${m}] response start`,ce({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:P-p})),{response:f,options:s,controller:y,requestLogID:m,retryOfRequestLogID:n,startTime:p}}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}requestAPIList(e,t){let n=this.makeRequest(t,null,void 0);return new Gt(this,n,e)}async fetchWithTimeout(e,t,n,s){let{signal:o,method:a,...l}=t||{};o&&o.addEventListener("abort",()=>s.abort());let u=setTimeout(()=>s.abort(),n),m=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,_={signal:s.signal,...m?{duplex:"half"}:{},method:"GET",...l};a&&(_.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,_)}finally{clearTimeout(u)}}async shouldRetry(e){let t=e.headers.get("x-should-retry");return t==="true"?!0:t==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,n,s){let o,a=s?.get("retry-after-ms");if(a){let u=parseFloat(a);Number.isNaN(u)||(o=u)}let l=s?.get("retry-after");if(l&&!o){let u=parseFloat(l);Number.isNaN(u)?o=Date.parse(l)-Date.now():o=u*1e3}if(!(o&&0<=o&&o<60*1e3)){let u=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(t,u)}return await te(o),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){let o=t-e,a=Math.min(.5*Math.pow(2,o),8),l=1-Math.random()*.25;return a*l*1e3}async buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:s,path:o,query:a,defaultBaseURL:l}=n,u=this.buildURL(o,a,l);"timeout"in n&&Un("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:m,body:_}=this.buildBody({options:n}),p=await this.buildHeaders({options:e,method:s,bodyHeaders:m,retryCount:t});return{req:{method:s,headers:p,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&_ instanceof globalThis.ReadableStream&&{duplex:"half"},..._&&{body:_},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:s}){let o={};this.idempotencyHeader&&t!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let a=g([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Xn(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(a),a.values}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=g([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:lr(e)}:c(this,Fr,"f").call(this,{body:e,headers:n})}};En=R,Fr=new WeakMap,Rn=new WeakSet,Ms=function(){return this.baseURL!=="https://api.openai.com/v1"};R.OpenAI=En;R.DEFAULT_TIMEOUT=6e5;R.OpenAIError=b;R.APIError=N;R.APIConnectionError=he;R.APIConnectionTimeoutError=me;R.APIUserAbortError=v;R.NotFoundError=nt;R.ConflictError=st;R.RateLimitError=it;R.BadRequestError=et;R.AuthenticationError=tt;R.InternalServerError=at;R.PermissionDeniedError=rt;R.UnprocessableEntityError=ot;R.InvalidWebhookSignatureError=ee;R.toFile=br;R.Completions=Be;R.Chat=ye;R.Embeddings=We;R.Files=qe;R.Images=Ve;R.Audio=oe;R.Moderations=Ke;R.Models=ze;R.FineTuning=Z;R.Graders=Se;R.VectorStores=pe;R.Webhooks=Qe;R.Beta=ae;R.Batches=Ne;R.Uploads=Ce;R.Responses=Ee;R.Evals=Pe;R.Containers=Ie;i();function On(r){return r instanceof Error&&"code"in r}function Um(r){return!r||typeof r!="object"?!1:!!(r instanceof v||r instanceof Error&&r.name==="AbortError"||On(r)&&r.code==="ABORT_ERR")}function Wm(r){if(r instanceof Error){let e=r.cause;return e instanceof Error&&e.message!==r.message?`${r.message} (cause: ${e.message})`:r.message}try{return String(r)}catch{return"Failed to get error details"}}function Hm(r){if(typeof r!="object"||r===null)return;let e=r,t=e.status??e.statusCode??e.response?.status??e.error?.code;if(typeof t=="number"&&t>=100&&t<=599)return t;if(typeof e.message=="string"){let n=e.message.match(/HTTP_STATUS\/(\d{3})\b/);if(n){let s=Number(n[1]);if(s>=100&&s<=599)return s}}}function qm(r){if(typeof r!="object"||r===null)return"unknown";let e=r instanceof Error&&r.constructor.name!=="Error"?r.constructor.name:void 0,t=r.type,n=e??t??(r instanceof Error?r.name:"unknown"),s=r instanceof Error?r.cause:void 0,o=s&&typeof s=="object"&&"code"in s?s.code:void 0;return o?`${n}:${o}`:n}var ve=class extends Error{constructor(t,n){super(t);this.exitCode=n}};var Fs=class extends ve{constructor(e){super(e,42)}},js=class extends ve{constructor(e){super(e,44)}},sr=class extends ve{constructor(e){super(e,52)}},Ls=class extends ve{constructor(e){super(e,53)}};var Bs=class extends ve{constructor(e){super(e,55)}},Us=class extends ve{constructor(e){super(e,130)}},Cn=class extends Error{},jr=class extends Error{},vn=class extends Error{},or=class extends Error{constructor(t,n,s,o=403){super(s);this.code=t;this.title=n;this.status=o;this.name="MatildaAccessError"}},Ws=class extends or{constructor(e,t){super("insufficient_quota","Usage limit reached",`You have reached your usage limit on ${e}. ${t===null?"Try again later.":`Try again ${vi(t)}.`}`,429),this.name="MatildaUsageLimitError"}};function vi(r){let e=Math.ceil(r/6e4);if(e<=1)return"in a minute";if(e<90)return`in about ${e} minutes`;let t=Math.round(e/60);return t<36?`in about ${t} hours`:`in about ${Math.round(t/24)} days`}var Hs=class extends Error{constructor(t,n){super(t);this.code=n;this.name="MatildaServerUnreachableError"}},qs=class extends or{constructor(){super("ACCOUNT_INACTIVE","Account access restricted","Your account is suspended or restricted from sending messages. Contact Matilda support to review your access. Signing in again will not remove this restriction."),this.name="AccountRestrictedError"}},Gs=class extends or{constructor(){super("organization_access_unavailable","Organisation access refused","Matilda refused access to this run's organisation: you are not an active member of it, or no seat in it is assigned to you. Ask the organisation's admin."),this.name="OrganizationAccessError"}};function Gm(r){if(!r||typeof r!="object")return!1;let e=r;return Number(e.status)===403&&e.code==="organization_access_unavailable"}var Js=class extends jr{code="invalid_grant";constructor(e){super("Your Matilda sign-in has ended. Run /login to sign in again.",e),this.name="MatildaSignInEndedError"}};function Jm(r){if(!r||typeof r!="object")return!1;let e=r;if(e.status!==void 0&&Number(e.status)!==403)return!1;let t=e.error;return e.code==="ACCOUNT_INACTIVE"||e.code==="account_inactive"||t==="account_inactive"||typeof t=="object"&&t!==null&&"code"in t&&t.code==="ACCOUNT_INACTIVE"}var Xs=class extends Error{constructor(t,n,s,o){super(t);this.categories=n;this.severity=s;this.assistantMessage=o;this.name="ContentBlockedError"}};function Xm(r){if(r&&typeof r=="object"&&"response"in r){let t=Oi(r);if(t.error&&t.error.message&&t.error.code)switch(t.error.code){case 400:return new vn(t.error.message);case 401:return new jr(t.error.message);case 403:return new Cn(t.error.message);default:}}return r}function Oi(r){return typeof r.response?.data=="string"?JSON.parse(r.response?.data):r.response?.data}i();import ki from"node:fs";import Q from"node:path";import jt from"node:os";import*as Vs from"node:crypto";var ar=".matilda",ir=new Map,Ti=1024;var zs=/[ \t()[\]{};|*?$`'"#&<>!~,]/,eg=["file_path","path","filePath","notebook_path"],$i=(()=>{let r=zs.source.slice(1,-1);return new RegExp(`\\\\([${r}])`,"g")})();function tg(r){let e=jt.homedir();return r.startsWith(e)?r.replace(e,"~"):r}function rg(r,e=80){if(r.length<=e)return r;let t=Q.sep,n="...";if(e<10)return r.substring(0,e-3)+n;let o=Q.parse(r).root,l=r.substring(o.length).split(t).filter(_=>_!=="");if(l.length===0)return o.length<=e?o:o.substring(0,e-3)+n;if(l.length===1){let _=o+l[0];if(_.length<=e)return _;let p=Math.floor((e-3)/2),y=_.substring(0,p),f=_.substring(_.length-p);return`${y}${n}${f}`}let u=o+l[0],m=[];for(let _=l.length-1;_>=1;_--){let p=l[_],y=[p,...m].join(t),f=_>1,P;if(f?P=u+t+n+t+y:P=u+t+y,P.length<=e){if(m.unshift(p),_===1)return P}else break}if(m.length===0){let _=Math.floor((e-3)/2),p=r.substring(0,_),y=r.substring(r.length-_);return`${p}${n}${y}`}return u+t+n+t+m.join(t)}function ng(r,e){let t=Q.resolve(r),n=Q.resolve(e);return Ys(n,t)?Q.relative(n,t)||".":t}function sg(r){let e="";for(let t=0;t<r.length;t++){let n=r[t],s=0;for(let a=t-1;a>=0&&r[a]==="\\";a--)s++;!(s%2===1)&&zs.test(n)?e+="\\"+n:e+=n}return e}function og(r){return jt.platform()==="win32"?r:r.replace($i,"$1")}function Ks(r){let e=jt.platform()==="win32"?r.toLowerCase():r;return Vs.createHash("sha256").update(e).digest("hex")}function Qs(r){return(jt.platform()==="win32"?r.toLowerCase():r).replace(/[^a-zA-Z0-9]/g,"-")}function Ys(r,e){let n=jt.platform()==="win32"?Q.win32:Q,s=n.relative(r,e);return!s.startsWith(`..${n.sep}`)&&s!==".."&&!n.isAbsolute(s)}function ig(r,e){return r.some(t=>Ys(t,e))}function Di(r=process.cwd(),e){let t=jt.homedir();return e==="~"?t:e.startsWith("~/")?Q.join(t,e.slice(2)):Q.isAbsolute(e)?e:Q.resolve(r,e)}function Ni(r,e,t={}){let{allowFiles:n=!1,allowExternalPaths:s=!1}=t,a=r.getWorkspaceContext().isPathWithinWorkspace(e);if(!s&&!a)throw new Error("Path is not within workspace");if(s&&!a)return;let l=ir.get(e);if(l===void 0){try{l=ki.statSync(e).isDirectory()}catch(u){throw On(u)&&u.code==="ENOENT"?new Error(`Path does not exist: ${e}`):u}if(ir.size>=Ti){let u=ir.keys().next().value;u!==void 0&&ir.delete(u)}ir.set(e,l)}if(!n&&!l)throw new Error(`Path is not a directory: ${e}`)}function ag(r,e){let t=r.getTranscriptPath?.();return!!t&&Q.resolve(e)===Q.resolve(t)}function cg(r,e,t={}){let n=r.getTargetDir();if(!e)return n;let s=Di(n,e);return Ni(r,s,t),s}i();import*as I from"node:path";import*as Ye from"node:os";import*as Lr from"node:fs";import{AsyncLocalStorage as Mi}from"node:async_hooks";var Fi=[".matilda",".agents"],Zs="tmp",ji="bin",Li="projects",Bi="ide",Ui="plans",Wi="debug",Hi="crash",Ze=class r{targetDir;pinnedRuntimeBaseDir;static runtimeBaseDir=null;static runtimeBaseDirContext=new Mi;constructor(e,t){this.targetDir=e,this.pinnedRuntimeBaseDir=t?r.resolvePath(t):void 0}getRuntimeBaseDir(){return this.pinnedRuntimeBaseDir??r.getRuntimeBaseDir()}static resolvePath(e,t){let n=e;if(n==="~"||n.startsWith("~/")||n.startsWith("~\\")){let s=n==="~"?[]:n.slice(2).split(/[/\\]+/).filter(Boolean);n=I.join(Ye.homedir(),...s)}return I.isAbsolute(n)||(n=t?I.resolve(t,n):I.resolve(n)),n}static sanitizePlanSessionId(e){return I.basename(e.replace(/\\/g,"/")).replace(/^\.+/g,"_").replace(/[<>:"|?*\x00-\x1F]/g,"_")||"_"}static resolveRuntimeBaseDir(e,t){return e?r.resolvePath(e,t):null}static setRuntimeBaseDir(e,t){r.runtimeBaseDir=r.resolveRuntimeBaseDir(e,t)}static runWithRuntimeBaseDir(e,t,n){let s=r.resolveRuntimeBaseDir(e,t);return r.runtimeBaseDirContext.run(s,n)}static getRuntimeBaseDir(){let e=process.env.MATILDA_RUNTIME_DIR;if(e)return r.resolveRuntimeBaseDir(e)??r.getGlobalMatildaDir();let t=r.runtimeBaseDirContext.getStore();return t!==void 0?t??r.getGlobalMatildaDir():r.runtimeBaseDir?r.runtimeBaseDir:r.getGlobalMatildaDir()}static getGlobalMatildaDir(){let e=process.env.MATILDA_HOME;if(e)return r.resolvePath(e);let t=Ye.homedir();return t?I.join(t,ar):I.join(Ye.tmpdir(),".matilda")}static getMcpOAuthTokensPath(){return I.join(r.getGlobalMatildaDir(),"mcp-oauth-tokens.json")}static getGlobalSettingsPath(){return I.join(r.getGlobalMatildaDir(),"settings.json")}static getInstallationIdPath(){return I.join(r.getGlobalMatildaDir(),"installation_id")}static getUserCommandsDir(){return I.join(r.getGlobalMatildaDir(),"commands")}static getGlobalMemoryFilePath(){return I.join(r.getGlobalMatildaDir(),"memory.md")}static getGlobalTempDir(){return I.join(r.getRuntimeBaseDir(),Zs)}static getGlobalDebugDir(){return I.join(r.getRuntimeBaseDir(),Wi)}static getDebugLogPath(e){return I.join(r.getGlobalDebugDir(),`${e}.txt`)}static getGlobalCrashDir(){return I.join(r.getRuntimeBaseDir(),Hi)}static getGlobalIdeDir(){return I.join(r.getGlobalMatildaDir(),Bi)}static resolvePathThroughExistingAncestor(e){let t=e;for(;;)try{let n=Lr.realpathSync(t),s=I.relative(t,e);return I.join(n,s)}catch(n){if(n.code!=="ENOENT")throw n;let s=I.dirname(t);if(s===t)return e;t=s}}static isPathWithinDirectory(e,t){let n=r.resolvePathThroughExistingAncestor(t),s=r.resolvePathThroughExistingAncestor(e),o=I.relative(n,s);return o===""||!o.startsWith("..")&&!I.isAbsolute(o)}static assertPathWithinDirectory(e,t,n){if(!r.isPathWithinDirectory(e,t))throw new sr(n)}static getPlansDir(e,t){let n=t?.trim();if(n){if(!e)throw new sr("projectRoot is required when plansDirectory is configured.");let s=I.resolve(e),o=r.resolvePath(n,s);return r.assertPathWithinDirectory(o,s,"plansDirectory must resolve within the project root."),o}return I.join(r.getGlobalMatildaDir(),Ui)}static getPlanFilePath(e,t,n){return I.join(r.getPlansDir(t,n),`${r.sanitizePlanSessionId(e)}.md`)}static getGlobalBinDir(){return I.join(r.getGlobalMatildaDir(),ji)}getMatildaDir(){return I.join(this.targetDir,ar)}getProjectDir(){let e=Qs(this.getProjectRoot()),t=I.join(this.getRuntimeBaseDir(),Li);return I.join(t,e)}getProjectTempDir(){let e=Ks(this.getProjectRoot()),t=I.join(this.getRuntimeBaseDir(),Zs);return I.join(t,e)}getToolResultsDir(){return I.join(this.getProjectTempDir(),"tool-results")}ensureProjectTempDirExists(){Lr.mkdirSync(this.getProjectTempDir(),{recursive:!0})}getProjectRoot(){return this.targetDir}getWorkspaceSettingsPath(){return I.join(this.getMatildaDir(),"settings.json")}getProjectCommandsDir(){return I.join(this.getMatildaDir(),"commands")}getRuntimeStatusPath(e){return I.join(this.getProjectDir(),"chats",`${e}.runtime.json`)}getProjectTempCheckpointsDir(){return I.join(this.getProjectTempDir(),"checkpoints")}getExtensionsDir(){return I.join(this.getMatildaDir(),"extensions")}getExtensionsConfigPath(){return I.join(this.getExtensionsDir(),"matilda-extension.json")}getUserSkillsDirs(){let e=Ye.homedir()||Ye.tmpdir();return Fi.map(t=>t===ar?I.join(r.getGlobalMatildaDir(),"skills"):I.join(e,t,"skills"))}static getUserExtensionsDir(){return I.join(r.getGlobalMatildaDir(),"extensions")}getHistoryFilePath(){return I.join(this.getProjectTempDir(),"shell_history")}};i();import{promises as co}from"node:fs";import Ji from"node:path";import{AsyncLocalStorage as Xi}from"node:async_hooks";import Vi from"node:util";i();import{promises as kn}from"node:fs";import eo from"node:path";async function to(r,e,t){let{fallbackCopy:n=!0}=t??{},s=eo.dirname(r),o=eo.relative(s,e);try{await kn.unlink(r)}catch{}try{await kn.symlink(o,r);return}catch{}if(n)try{await kn.copyFile(e,r)}catch{}}i();ho();i();var ro,no;function xg(r,e){ro=r,no=e}function so(){return ro}function Ag(){return no}function oo(r){let e=r?.spanContext();return e&&Mn(e)?{traceId:e.traceId,spanId:e.spanId,traceFlags:e.traceFlags}:null}function qi(){try{return oo(Hr.getActiveSpan())}catch{return null}}function Gi(){try{let r=so();return oo(r?Hr.getSpan(r):void 0)}catch{return null}}function io(){return qi()??Gi()}function Cg(r){let e=(r.traceFlags&255).toString(16).padStart(2,"0");return`00-${r.traceId}-${r.spanId}-${e}`}var ao=!1;function vg(r){ao=r}function Og(){return ao}var Br=null,Tn=null,$n=!1,lo=null,zi=new Xi;function uo(){let r=process.env.MATILDA_DEBUG_LOG_FILE;if(!r)return!1;let e=r.trim().toLowerCase();return!["","0","false","off","no"].includes(e)}function cr(){return zi.getStore()??lo}function fo(){let r=Ze.getGlobalDebugDir();return(!Br||Tn!==r)&&(Tn=r,Br=co.mkdir(r,{recursive:!0}).then(()=>{}).catch(()=>{$n=!0,Br=null,Tn=null})),Br??Promise.resolve()}function Ki(r){return r.map(e=>e instanceof Error?e.stack??`${e.name}: ${e.message}`:e).map(e=>typeof e=="string"?e:Vi.inspect(e)).join(" ")}function Qi(r,e,t,n){let s=new Date().toISOString(),o=t?` [${t}]`:"",a=n?` [trace_id=${n.traceId} span_id=${n.spanId}]`:"";return`${s} [${r}]${o}${a} ${e}
|
|
26
|
-
`}function Ur(r,e,t,n){if(!uo())return;let s=r.getSessionId(),o=Ze.getDebugLogPath(s),a=Ki(n),l=io(),u=Qi(e,a,t,l);fo().then(()=>co.appendFile(o,u,"utf8")).catch(()=>{$n=!0})}function Bg(){return $n}var Yi="latest";function Zi(r){if(!uo())return;let e=Ji.join(Ze.getGlobalDebugDir(),Yi),t=Ze.getDebugLogPath(r);fo().then(()=>to(e,t,{fallbackCopy:!1})).catch(()=>{})}function Ug(r){lo=r??null,r&&Zi(r.getSessionId())}function Wg(r){return{isEnabled:()=>cr()!==null,debug:(...e)=>{let t=cr();t&&Ur(t,"DEBUG",r,e)},info:(...e)=>{let t=cr();t&&Ur(t,"INFO",r,e)},warn:(...e)=>{let t=cr();t&&Ur(t,"WARN",r,e)},error:(...e)=>{let t=cr();t&&Ur(t,"ERROR",r,e)}}}export{
|
|
26
|
+
`}function Ur(r,e,t,n){if(!uo())return;let s=r.getSessionId(),o=Ze.getDebugLogPath(s),a=Ki(n),l=io(),u=Qi(e,a,t,l);fo().then(()=>co.appendFile(o,u,"utf8")).catch(()=>{$n=!0})}function Bg(){return $n}var Yi="latest";function Zi(r){if(!uo())return;let e=Ji.join(Ze.getGlobalDebugDir(),Yi),t=Ze.getDebugLogPath(r);fo().then(()=>to(e,t,{fallbackCopy:!1})).catch(()=>{})}function Ug(r){lo=r??null,r&&Zi(r.getSessionId())}function Wg(r){return{isEnabled:()=>cr()!==null,debug:(...e)=>{let t=cr();t&&Ur(t,"DEBUG",r,e)},info:(...e)=>{let t=cr();t&&Ur(t,"INFO",r,e)},warn:(...e)=>{let t=cr();t&&Ur(t,"WARN",r,e)},error:(...e)=>{let t=cr();t&&Ur(t,"ERROR",r,e)}}}export{me as a,R as b,On as c,Um as d,Wm as e,Hm as f,qm as g,ve as h,Fs as i,js as j,sr as k,Ls as l,Bs as m,Us as n,jr as o,or as p,Ws as q,Hs as r,qs as s,Gs as t,Gm as u,Js as v,Jm as w,Xs as x,Xm as y,ar as z,eg as A,tg as B,rg as C,ng as D,sg as E,og as F,Ks as G,Qs as H,Ys as I,ig as J,Di as K,ag as L,cg as M,Fi as N,Ze as O,to as P,xg as Q,Ag as R,io as S,Cg as T,vg as U,Og as V,Bg as W,Ug as X,Wg as Y};
|
|
27
27
|
/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2025 Google LLC
|