@beyondwork/wb-cli 0.1.57 → 0.1.58

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/out/extension.js CHANGED
@@ -149,7 +149,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
149
149
  `).map(e=>e.trim()).join(" ")};Wb.O=function(s){return this.inspectOpts.colors=this.useColors,oo.inspect(s,this.inspectOpts)}});var jb=E((Eq,vd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?vd.exports=Pb():vd.exports=$b()});var ys,Sd,zb,Ub,Vb,Hb=B(()=>{Sn();ys={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Sd={get(s){return{signature:j.get(s,0),compressedSize:j.get(s,8),uncompressedSize:j.get(s,12)}},len:16},zb={get(s){let e=z.get(s,6);return{signature:j.get(s,0),minVersion:z.get(s,4),dataDescriptor:!!(e&8),compressedMethod:z.get(s,8),compressedSize:j.get(s,18),uncompressedSize:j.get(s,22),filenameLength:z.get(s,26),extraFieldLength:z.get(s,28),filename:null}},len:30},Ub={get(s){return{signature:j.get(s,0),nrOfThisDisk:z.get(s,4),nrOfThisDiskWithTheStart:z.get(s,6),nrOfEntriesOnThisDisk:z.get(s,8),nrOfEntriesOfSize:z.get(s,10),sizeOfCd:j.get(s,12),offsetOfStartOfCd:j.get(s,16),zipFileCommentLength:z.get(s,20)}},len:22},Vb={get(s){let e=z.get(s,8);return{signature:j.get(s,0),minVersion:z.get(s,6),dataDescriptor:!!(e&8),compressedMethod:z.get(s,10),compressedSize:j.get(s,20),uncompressedSize:j.get(s,24),filenameLength:z.get(s,28),extraFieldLength:z.get(s,30),fileCommentLength:z.get(s,32),relativeOffsetOfLocalHeader:j.get(s,42),filename:null}},len:46}});function Kb(s){let e=new Uint8Array(j.len);return j.put(e,0,s),e}function iC(s,e){let t=s.length,i=e.length;if(i>t)return-1;for(let n=0;n<=t-i;n++){let r=!0;for(let a=0;a<i;a++)if(s[n+a]!==e[a]){r=!1;break}if(r)return n}return-1}function nC(s){let e=s.reduce((n,r)=>n+r.length,0),t=new Uint8Array(e),i=0;for(let n of s)t.set(n,i),i+=n.length;return t}var Gb,tt,Nd,sC,uo,vs,Jb=B(()=>{Sn();Gb=F(jb(),1);Hb();tt=(0,Gb.default)("tokenizer:inflate"),Nd=256*1024,sC=Kb(ys.DataDescriptor),uo=Kb(ys.EndOfCentralDirectory),vs=class s{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(Nd)}async isZip(){return await this.peekSignature()===ys.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(j)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),i=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(i,{position:e.fileInfo.size-t});for(let n=i.length-4;n>=0;n--)if(i[n]===uo[0]&&i[n+1]===uo[1]&&i[n+2]===uo[2]&&i[n+3]===uo[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){tt("Cannot reading central-directory without random-read support");return}tt("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){tt("Central-directory 32-bit signature found");let i=await this.tokenizer.readToken(Ub,t),n=[];this.tokenizer.setPosition(i.offsetOfStartOfCd);for(let r=0;r<i.nrOfEntriesOfSize;++r){let a=await this.tokenizer.readToken(Vb);if(a.signature!==ys.CentralFileHeader)throw new Error("Expected Central-File-Header signature");a.filename=await this.tokenizer.readToken(new ke(a.filenameLength,"utf-8")),await this.tokenizer.ignore(a.extraFieldLength),await this.tokenizer.ignore(a.fileCommentLength),n.push(a),tt(`Add central-directory file-entry: n=${r+1}/${n.length}: filename=${n[r].filename}`)}return this.tokenizer.setPosition(e),n}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let i=!1;do{let n=await this.readLocalFileHeader();if(!n)break;let r=e(n);i=!!r.stop;let a;if(await this.tokenizer.ignore(n.extraFieldLength),n.dataDescriptor&&n.compressedSize===0){let o=[],c=Nd;tt("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let u=-1;for(;u<0&&c===Nd;){c=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),u=iC(this.syncBuffer.subarray(0,c),sC);let l=u>=0?u:c;if(r.handler){let d=new Uint8Array(l);await this.tokenizer.readBuffer(d),o.push(d)}else await this.tokenizer.ignore(l)}tt(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),r.handler&&await this.inflate(n,nC(o),r.handler)}else r.handler?(tt(`Reading compressed-file-data: ${n.compressedSize} bytes`),a=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(a),await this.inflate(n,a,r.handler)):(tt(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize));if(tt(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor&&(await this.tokenizer.readToken(Sd)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Sd.len}`)}while(!i)}async iterateOverCentralDirectory(e,t){for(let i of e){let n=t(i);if(n.handler){this.tokenizer.setPosition(i.relativeOffsetOfLocalHeader);let r=await this.readLocalFileHeader();if(r){await this.tokenizer.ignore(r.extraFieldLength);let a=new Uint8Array(i.compressedSize);await this.tokenizer.readBuffer(a),await this.inflate(r,a,n.handler)}}if(n.stop)break}}async inflate(e,t,i){if(e.compressedMethod===0)return i(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);tt(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let n=await s.decompressDeflateRaw(t);return i(n)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(r){r.enqueue(e),r.close()}}),i=new DecompressionStream("deflate-raw"),n=t.pipeThrough(i);try{let a=await new Response(n).arrayBuffer();return new Uint8Array(a)}catch(r){let a=r instanceof Error?`Failed to deflate ZIP entry: ${r.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(a)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(j);if(e===ys.LocalFileHeader){let t=await this.tokenizer.readToken(zb);return t.filename=await this.tokenizer.readToken(new ke(t.filenameLength,"utf-8")),t}if(e===ys.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var Nn,Yb=B(()=>{Nn=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let i=new Uint8Array(1024),n=await e.readBuffer(i,{mayBeLess:!0});if(n===0){t.close();return}t.enqueue(i.subarray(0,n))}}).pipeThrough(new DecompressionStream("gzip"))}}});var Zb=B(()=>{Jb();Yb()});function Ed(s){let{byteLength:e}=s;if(e===6)return s.getUint16(0)*2**32+s.getUint32(2);if(e===5)return s.getUint8(0)*2**32+s.getUint32(1);if(e===4)return s.getUint32(0);if(e===3)return s.getUint8(0)*2**16+s.getUint16(1);if(e===2)return s.getUint16(0);if(e===1)return s.getUint8(0)}var Fq,Mq,Lq,Qb=B(()=>{Fq={utf8:new globalThis.TextDecoder("utf8")},Mq=new globalThis.TextEncoder,Lq=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"))});function Xb(s,e){if(e==="utf-16le"){let t=[];for(let i=0;i<s.length;i++){let n=s.charCodeAt(i);t.push(n&255,n>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let i=0;i<s.length;i++){let n=s.charCodeAt(i);t.push(n>>8&255,n&255)}return t}return[...s].map(t=>t.charCodeAt(0))}function ek(s,e=0){let t=Number.parseInt(new ke(6).get(s,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let i=256;for(let n=e;n<e+148;n++)i+=s[n];for(let n=e+156;n<e+512;n++)i+=s[n];return t===i}var tk,sk=B(()=>{Sn();tk={get:(s,e)=>s[e+3]&127|s[e+2]<<7|s[e+1]<<14|s[e]<<21,len:4}});var ik,nk,rk=B(()=>{ik=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],nk=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function kC(s){let e=s?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return s;let{reader:t}=e,i=async()=>{await t.cancel(),t.releaseLock()};return e.close=i,e.abort=async()=>{e.interrupted=!0,await i()},s}function Ad(s,e,t){if(!Number.isFinite(s)||s<0||s>e)throw new bt(`${t} has invalid size ${s} (maximum ${e} bytes)`);return s}async function $t(s,e,{maximumLength:t=Oe,reason:i="skip"}={}){let n=Ad(e,t,i);await s.ignore(n)}async function Rd(s,e,t,{maximumLength:i=e.length,reason:n="read"}={}){let r=t?.length??e.length,a=Ad(r,i,n);return s.readBuffer(e,{...t,length:a})}async function _C(s,{maximumLength:e=it}={}){let n=new ReadableStream({start(u){u.enqueue(s),u.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),r=[],a=0;try{for(;;){let{done:u,value:l}=await n.read();if(u)break;if(a+=l.length,a>e)throw await n.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);r.push(l)}}finally{n.releaseLock()}let o=new Uint8Array(a),c=0;for(let u of r)o.set(u,c),c+=u.length;return o}function wC(s,e){if(s.length<lo)return-1;let t=s.length-lo;for(let i=0;i<=t;i++)if(j.get(s,i)===kk&&j.get(s,i+8)===e+i)return i;return-1}function yC(s){return(s.codePointAt(0)&32)!==0}function vC(s,e){let t=new Uint8Array(e),i=0;for(let n of s)t.set(n,i),i+=n.length;return t}async function SC(s,{shouldBuffer:e,maximumLength:t=it}={}){let{syncBuffer:i}=s,{length:n}=i,r=[],a=0;for(;;){let o=await s.tokenizer.peekBuffer(i,{mayBeLess:!0}),c=wC(i.subarray(0,o),a),u=c>=0?0:o===n?Math.min(xC,o-1):0,l=c>=0?c:o-u;if(l===0)break;if(a+=l,a>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let d=new Uint8Array(l);await s.tokenizer.readBuffer(d),r.push(d)}else await s.tokenizer.ignore(l);if(c>=0)break}if(de(s.tokenizer)||(s.knownSizeDescriptorScannedBytes+=a),!!e)return vC(r,a)}function NC(s,e){return de(s.tokenizer)?Math.max(0,Oe-(s.tokenizer.position-e)):Math.max(0,it-s.knownSizeDescriptorScannedBytes)}async function EC(s,e,{shouldBuffer:t,maximumDescriptorLength:i=it}={}){if(e.dataDescriptor&&e.compressedSize===0)return SC(s,{shouldBuffer:t,maximumLength:i});if(!t){await $t(s.tokenizer,e.compressedSize,{maximumLength:de(s.tokenizer)?it:s.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let n=TC(s.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>n)throw new Error(`ZIP entry compressed data exceeds ${n} bytes`);let r=new Uint8Array(e.compressedSize);return await s.tokenizer.readBuffer(r),r}function CC(s,e){let t=s.getReader(),i=0,n=!1,r=!1,a=async o=>{n||r||(r=!0,await t.cancel(o))};return new ReadableStream({async pull(o){if(i>=e){o.close(),await a();return}let{done:c,value:u}=await t.read();if(c||!u){n=!0,o.close();return}let l=e-i;if(u.length>l){o.enqueue(u.subarray(0,l)),i+=l,o.close(),await a();return}o.enqueue(u),i+=u.length},async cancel(o){await a(o)}})}async function _k(s,e){return new Ns(e).fromBuffer(s)}async function xk(s,e){return new Ns(e).fromBlob(s)}function fk(s){switch(s=s.toLowerCase(),s){case"application/epub+zip":return{ext:"epub",mime:s};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:s};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:s};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:s};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:s};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:s};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:s};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:s};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:s};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:s};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:s};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:s};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:s};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:s};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:s};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:s};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function st(s,e,t){t={offset:0,...t};for(let[i,n]of e.entries())if(t.mask){if(n!==(t.mask[i]&s[i+t.offset]))return!1}else if(n!==s[i+t.offset])return!1;return!0}function Id(s){return Number.isFinite(s)?Math.max(1,Math.trunc(s)):Ss}function RC(s,e,t){return t===void 0?s.read(e):(t.throwIfAborted(),new Promise((i,n)=>{let r=()=>{t.removeEventListener("abort",a)},a=()=>{let o=t.reason;r(),(async()=>{try{await s.cancel(o)}catch{}})(),n(o)};t.addEventListener("abort",a,{once:!0}),(async()=>{try{let o=await s.read(e);r(),i(o)}catch(o){r(),n(o)}})()}))}function AC(s){return Number.isFinite(s)?Math.max(0,Math.min(rC,Math.trunc(s))):0}function IC(s){return Number.isFinite(s)?Math.max(0,s):Number.MAX_SAFE_INTEGER}function de(s){let e=s.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function En(s,e,t){return de(s)&&s.position-e>t}function TC(s){let e=s.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-s.position):Number.MAX_SAFE_INTEGER;return Math.min(t,aC)}function OC(s){if(s instanceof P||s instanceof bt)return!0;if(!(s instanceof Error))return!1;if(fC.has(s.message)||bC.has(s.code))return!0;for(let e of gC)if(s.message.startsWith(e))return!0;return!1}function gk(s,e=it){let t=[s.compressedSize,s.uncompressedSize];for(let i of t)if(!Number.isFinite(i)||i<0||i>e)return!1;return!0}function qC(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function PC(s,e){e.startsWith("word/")&&(s.hasWordDirectory=!0),e.startsWith("ppt/")&&(s.hasPresentationDirectory=!0),e.startsWith("xl/")&&(s.hasSpreadsheetDirectory=!0),e.startsWith("3D/")&&e.endsWith(".model")&&(s.hasThreeDimensionalModelEntry=!0)}function bk(s){if(!(!s.hasContentTypesEntry||s.hasUnparseableContentTypes||s.isParsingContentTypes||s.hasParsedContentTypesEntry)){if(s.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(s.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(s.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(s.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function DC(s){let e=s.indexOf('.main+xml"');if(e===-1){let n="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return s.includes(`ContentType="${n}"`)?n:void 0}let t=s.slice(0,e),i=t.lastIndexOf('"');return t.slice(i+1)}async function wk(s,e){return new Ns(e).fromTokenizer(s)}var Ss,rC,it,ak,aC,Oe,po,ok,oC,cC,ck,Cd,uk,lk,uC,lC,dC,pC,hC,dk,pk,hk,mC,mk,fC,gC,bC,bt,kk,lo,xC,Ns,yk,vk,Td=B(()=>{Sn();so();Zb();Qb();sk();rk();Ss=4100,rC=Ss-2,it=1024*1024,ak=1024,aC=2**31-1,Oe=16*1024*1024,po=it,ok=it,oC=Oe,cC=1,ck=100,Cd=Oe,uk=64,lk=po,uC=256,lC=512,dC=Oe,pC=512,hC=512,dk=256,pk=po,hk=po,mC=po,mk=Oe,fC=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),gC=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],bC=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),bt=class extends Error{};kk=134695760,lo=16,xC=lo-1;vs.prototype.inflate=async function(s,e,t){if(s.compressedMethod===0)return t(e);if(s.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${s.compressedMethod}`);let i=await _C(e,{maximumLength:it});return t(i)};vs.prototype.unzip=async function(s){let e=!1,t=0,i=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(En(this.tokenizer,i,Oe))throw new bt(`ZIP stream probing exceeds ${Oe} bytes`);let n=await this.readLocalFileHeader();if(!n)break;if(t++,t>ak)throw new Error(`ZIP entry count exceeds ${ak}`);let r=s(n);e=!!r.stop,await this.tokenizer.ignore(n.extraFieldLength);let a=await EC(this,n,{shouldBuffer:!!r.handler,maximumDescriptorLength:Math.min(it,NC(this,i))});if(r.handler&&await this.inflate(n,a,r.handler),n.dataDescriptor){let o=new Uint8Array(lo);if(await this.tokenizer.readBuffer(o),j.get(o,0)!==kk)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-o.length}`)}if(En(this.tokenizer,i,Oe))throw new bt(`ZIP stream probing exceeds ${Oe} bytes`)}while(!e)};Ns=class s{constructor(e){let t=AC(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return kC(gb(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let i=e.position;for(let n of this.detectors){let r;try{r=await n.detect(e)}catch(a){if(a instanceof P||a instanceof bt)return;throw a}if(r)return r;if(i!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(bb(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=kb(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let i=Id(t?.sampleSize??Ss),n,r,a=e.getReader({mode:"byob"});try{let{value:u,done:l}=await RC(a,new Uint8Array(i),this.options.signal);if(r=u,!l&&u)try{n=await this.fromBuffer(u.subarray(0,i))}catch(d){if(!(d instanceof P))throw d;n=void 0}r=u}finally{a.releaseLock()}let o=new TransformStream({async start(u){u.enqueue(r)},transform(u,l){l.enqueue(u)}}),c=e.pipeThrough(o);return c.fileType=n,c}async detectGzip(e){if(this.gzipProbeDepth>=cC)return{ext:"gz",mime:"application/gzip"};let t=new Nn(e),i=CC(t.inflate(),oC),n=de(e),r,a,o,c;if(n){let u=new AbortController;r=setTimeout(()=>{u.abort(new DOMException(`Operation timed out after ${ck} ms`,"TimeoutError"))},ck),a=this.options.signal===void 0?u.signal:AbortSignal.any([this.options.signal,u.signal]),o=new s({...this.options,signal:a}),o.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{c=await(o??this).fromStream(i)}catch(u){if(u?.name==="AbortError"&&a?.reason?.name!=="TimeoutError")throw u}finally{clearTimeout(r),n||this.gzipProbeDepth--}return c?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return st(this.buffer,e,t)}checkString(e,t){return this.check(Xb(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(Ss),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,de(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=dk?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await $t(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(tk),i=de(e);if(!Number.isFinite(t)||t<0||i&&(t>Cd||e.position+t>Cd))return;if(e.position+t>e.fileInfo.size)return i?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await $t(e,t,{maximumLength:i?Cd:e.fileInfo.size,reason:"ID3 payload"})}catch(n){if(n instanceof P)return;throw n}return this.detectionReentryCount>=dk?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t,i=qC();try{await new vs(e).unzip(n=>{PC(i,n.filename);let r=n.filename==="[Content_Types].xml",a=bk(i);if(!r&&a)return t=a,{stop:!0};switch(n.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return gk(n,ok)?{async handler(o){let c=new TextDecoder("utf-8").decode(o).trim();t=fk(c)},stop:!0}:{};case"[Content_Types].xml":return i.hasContentTypesEntry=!0,gk(n,ok)?(i.isParsingContentTypes=!0,{async handler(o){let c=new TextDecoder("utf-8").decode(o),u=DC(c);u&&(t=fk(u)),i.hasParsedContentTypesEntry=!0,i.isParsingContentTypes=!1},stop:!0}):(i.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(n.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(n){if(!OC(n))throw n;i.isParsingContentTypes&&(i.isParsingContentTypes=!1,i.hasUnparseableContentTypes=!0)}return t??bk(i)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),st(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:st(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:st(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:st(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:st(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:st(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let c=await e.peekNumber(Rb),u=128,l=0;for(;(c&u)===0&&u!==0;)++l,u>>=1;let d=new Uint8Array(l+1);return await Rd(e,d,void 0,{maximumLength:d.length,reason:"EBML field"}),d}async function i(){let c=await t(),u=await t();u[0]^=128>>u.length-1;let l=Math.min(6,u.length),d=new DataView(c.buffer),p=new DataView(u.buffer,u.length-l,l);return{id:Ed(d),len:Ed(p)}}async function n(c){let u=0;for(;c>0;){if(u++,u>uC||En(e,a,Oe))return;let l=e.position,d=await i();if(d.id===17026){if(d.len>uk)return;let p=Ad(d.len,uk,"EBML DocType");return(await e.readToken(new ke(p))).replaceAll(/\00.*$/g,"")}if(de(e)&&(!Number.isFinite(d.len)||d.len<0||d.len>lk)||(await $t(e,d.len,{maximumLength:de(e)?lk:e.fileInfo.size,reason:"EBML payload"}),--c,e.position<=l))return}}let r=await i(),a=e.position;switch(await n(r.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=xd.get(this.buffer,4),i=xs.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(i>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let t=new ke(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new ke(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
150
150
  `,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},i={ext:"apng",mime:"image/apng"};await e.ignore(8);async function n(){return{length:await e.readToken(Ab),type:await e.readToken(new ke(4,"latin1"))}}let r=de(e),a=e.position,o=0,c=!1;do{if(o++,o>lC||En(e,a,dC))break;let u=e.position,l=await n();if(l.length<0)return;if(l.type==="IHDR"){if(l.length!==13)return;c=!0}switch(l.type){case"IDAT":return t;case"acTL":return i;default:if(!c&&l.type!=="CgBI")return;if(r&&l.length>pk)return c&&yC(l.type)?t:void 0;try{await $t(e,l.length+4,{maximumLength:r?pk+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(d){if(!r&&(d instanceof bt||d instanceof P))return t;throw d}}if(e.position<=u)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new ke(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
151
151
  `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function i(){let o=new Uint8Array(16);return await Rd(e,o,void 0,{maximumLength:o.length,reason:"ASF header GUID"}),{id:o,size:Number(await e.readToken(Ib))}}await $t(e,30,{maximumLength:30,reason:"ASF header prelude"});let n=de(e),r=e.position,a=0;for(;e.position+24<e.fileInfo.size&&(a++,!(a>pC||En(e,r,Oe)));){let o=e.position,c=await i(),u=c.size-24;if(!Number.isFinite(u)||u<0){t=!0;break}if(st(c.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let l=new Uint8Array(16);if(u-=await Rd(e,l,void 0,{maximumLength:l.length,reason:"ASF stream type GUID"}),st(l,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(st(l,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(n&&u>hk){t=!0;break}if(await $t(e,u,{maximumLength:n?hk:e.fileInfo.size,reason:"ASF header payload"}),e.position<=o){t=!0;break}}}catch(i){if(i instanceof P||i instanceof bt)de(e)&&(t=!0);else throw i}return t?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new ke(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let i=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(i).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&ek(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:t})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:t})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
152
- `,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(Ss);let t=IC(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let i=0;i<=this.options.mpegOffsetTolerance;++i){let n=this.scanMpeg(i);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?xs:z);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?xs:z);if(!(t>hC)&&!(de(this.tokenizer)&&2+t*12>mk))for(let i=0;i<t;++i){let n=await this.readTiffTag(e);if(n)return n}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},i=(e?xs:z).get(this.buffer,2),n=(e?xd:j).get(this.buffer,4);if(i===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let o=(e?xs:z).get(this.buffer,8),c=(e?xs:z).get(this.buffer,10);if(o===28&&c===254||o===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(de(this.tokenizer)&&n>mC)return t;let r=de(this.tokenizer)?mk:this.tokenizer.fileInfo.size;try{await $t(this.tokenizer,n,{maximumLength:r,reason:"TIFF IFD offset"})}catch(o){if(o instanceof P)return;throw o}let a;try{a=await this.readTiffIFD(e)}catch(o){if(o instanceof P)return;throw o}return a??t}if(i===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},yk=new Set(ik),vk=new Set(nk)});var Ek={};Ps(Ek,{FileTypeParser:()=>bi,fileTypeFromBlob:()=>xk,fileTypeFromBuffer:()=>_k,fileTypeFromFile:()=>MC,fileTypeFromStream:()=>LC,fileTypeFromTokenizer:()=>wk,fileTypeStream:()=>BC,supportedExtensions:()=>yk,supportedMimeTypes:()=>vk});function FC(s){return!(s instanceof RangeError)||s.message!=="offset is out of bounds"||typeof s.stack!="string"?!1:/strtok3[/\\]lib[/\\]stream[/\\]/.test(s.stack)}async function MC(s,e){return new bi(e).fromFile(s,e)}async function LC(s,e){return new bi(e).fromStream(s)}async function BC(s,e={}){return new bi(e).toDetectionStream(s,e)}var Sk,jt,Nk,Od,bi,Ck=B(()=>{Sk=require("node:stream/web"),jt=require("node:stream"),Nk=F(require("node:fs/promises"),1),Od=require("node:fs");yb();Td();Td();bi=class extends Ns{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof Sk.ReadableStream?this.createTokenizerFromWebStream(e):wb(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(i){if(FC(i))return;throw i}finally{e instanceof jt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await Nk.default.open(e,Od.constants.O_RDONLY|Od.constants.O_NONBLOCK),i=await t.stat();if(!i.isFile()){await t.close();return}let n=new _s(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:i.size}});return super.fromTokenizer(n)}async toDetectionStream(e,t={}){if(!(e instanceof jt.Readable))return super.toDetectionStream(e,t);let{sampleSize:i=Ss}=t,{signal:n}=this.options,r=Id(i);return n?.throwIfAborted(),new Promise((a,o)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",h),n?.removeEventListener("abort",p)},l=(m,f)=>{c||(c=!0,u(),m(f))},d=m=>{l(o,m)},p=()=>{e.destroyed||e.destroy(),l(o,n.reason)},h=()=>{(async()=>{try{let m=new jt.PassThrough,f=jt.pipeline?(0,jt.pipeline)(e,m,()=>{}):e.pipe(m),g=e.read(r)??e.read()??new Uint8Array(0);try{m.fileType=await this.fromBuffer(g)}catch(b){b instanceof P?m.fileType=void 0:l(o,b)}l(a,f)}catch(m){l(o,m)}})()};e.on("error",d),e.once("readable",h),n?.addEventListener("abort",p,{once:!0})})}}});var z6={};Ps(z6,{activate:()=>$6,connectToHost:()=>Uo,deactivate:()=>j6});module.exports=gx(z6);var N=F(require("vscode"));var mr=F(require("vscode"));var Ww=F(fh(),1),$w=F(rr(),1),jw=F(Ls(),1),zw=F(ic(),1),Uw=F(ac(),1),Vw=F(dc(),1),Sh=F(ur(),1),Hw=F(vh(),1);var dr=Sh.default;var hc=s=>s.replace("work_block","workblock"),pr=["module_id","parent_task_def_id","parent_task_id","run_id","stream_id","wcb_id"],Gw={ask_agent:["conversation_id","message_id","run_id"],authz_schema_apply:["version_id"],authz_schema_draft_emit_event:["workblock_id"],authz_schema_force_apply:["version_id"],authz_schema_initialize_for_workblock:["schema_id"],authz_schema_propose:["draft_id"],cancel_child:pr,complete_child:pr,continue_from_message:["thread_id"],convert_legacy_stream:["editing_task_id","id","parent_id"],create_access_token:["access_token"],create_group:["id"],create_oauth_client:["client"],create_oauth_registration_token:["registration_token"],create_stream:["run_id","stream_id"],create_studio_workspace:["stream","workspace"],create_user:["id"],create_workblock:["stream","workspace"],create_workblock_schedule:["id","user","wcb_id"],create_workblock_version:["stream","workspace"],discard_permission_request:["request_id"],get_edit_stream:["editing_task_id","id","parent_id"],get_space_stream:["run_id","stream_id"],initiate_credential_oauth:["attempt_id"],initiate_task_credential_oauth:["attempt_id"],interrupt_child:pr,message_child:pr,publish_to_registry:["id"],recreate_edit_stream:["stream"],register_workblock_event:["id","stream_id","workblock_id"],remix_workblock_v2:["workblock_id"],rename_data_environment:["environment"],request_permission:["request_id"],restart_studio_workspace_thread:["previous_thread_id","thread_id"],run_module:["run_id"],run_workblock_replay_tests:["workflow_id"],set_legal_hold:["run_id"],set_retention_policy:["workblock_id"],set_work_block:["work_block"],set_work_block_v2:["work_block"],start_branch_thread:["thread_id"],update_task:["task"],update_workblock_schedule:["id","user","wcb_id"],upsert_space:["id"]},hr=class{constructor(e,t){this.client=e,this.analyticsClient=t??null}async acceptThreadWorkblock(e,t){return await this.requestWithTracking("accept_thread_workblock",e,t)}async acceptTos(e,t){return await this.requestWithTracking("accept_tos",e,t)}async addGroupMember(e,t){return await this.requestWithTracking("add_group_member",e,t)}async applyWorkblockDataModelDraft(e,t){return await this.requestWithTracking("apply_workblock_data_model_draft",e,t)}async applyWorkblockDeployedUpdates(e,t){return await this.requestWithTracking("apply_workblock_deployed_updates",e,t)}async applyWorkblockVersionUpdates(e,t){return await this.requestWithTracking("apply_workblock_version_updates",e,t)}async approveLearningData(e,t){return await this.requestWithTracking("approve_learning_data",e,t)}async askAgent(e,t){return await this.requestWithTracking("ask_agent",e,t)}async assign(e,t){return await this.requestWithTracking("assign",e,t)}async assignEditStream(e,t){return await this.requestWithTracking("assign_edit_stream",e,t)}async assignWorkBlockRuns(e,t){return await this.requestWithTracking("assign_work_block_runs",e,t)}async authzSchemaApply(e,t){return await this.requestWithTracking("authz_schema_apply",e,t)}async authzSchemaDiscardPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_discard_policy_draft",e,t)}async authzSchemaDraftEmitAwarenessEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_awareness_event",e,t)}async authzSchemaDraftEmitEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_event",e,t)}async authzSchemaForceApply(e,t){return await this.requestWithTracking("authz_schema_force_apply",e,t)}async authzSchemaGrantRoleMembership(e,t){return await this.requestWithTracking("authz_schema_grant_role_membership",e,t)}async authzSchemaImportPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_import_policy_draft",e,t)}async authzSchemaInitializeForWorkblock(e,t){return await this.requestWithTracking("authz_schema_initialize_for_workblock",e,t)}async authzSchemaOpenPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_open_policy_draft",e,t)}async authzSchemaPropose(e,t){return await this.requestWithTracking("authz_schema_propose",e,t)}async authzSchemaRevokeRoleMembership(e,t){return await this.requestWithTracking("authz_schema_revoke_role_membership",e,t)}async authzSchemaSavePolicyDraft(e,t){return await this.requestWithTracking("authz_schema_save_policy_draft",e,t)}async bulkTagLearningExamples(e,t){return await this.requestWithTracking("bulk_tag_learning_examples",e,t)}async callWorkblockTask(e,t){return await this.requestWithTracking("call_workblock_task",e,t)}async cancelAgent(e,t){return await this.requestWithTracking("cancel_agent",e,t)}async cancelChild(e,t){return await this.requestWithTracking("cancel_child",e,t)}async cancelWb(e,t){return await this.requestWithTracking("cancel_wb",e,t)}async cancelWorkblockDataEnvironmentCloneOperation(e,t){return await this.requestWithTracking("cancel_workblock_data_environment_clone_operation",e,t)}async cancelWorkblockNotification(e,t){return await this.requestWithTracking("cancel_workblock_notification",e,t)}async changelogMarkSeen(e,t){return await this.requestWithTracking("changelog_mark_seen",e,t)}async chatQueue(e,t){return await this.requestWithTracking("chat_queue",e,t)}async cloneWorkblockDataEnvironment(e,t){return await this.requestWithTracking("clone_workblock_data_environment",e,t)}async closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",e,t)}async completeConfigCredentialOauth(e,t){return await this.requestWithTracking("complete_config_credential_oauth",e,t)}async completeCredentialOauth(e,t){return await this.requestWithTracking("complete_credential_oauth",e,t)}async completeRunCredentialOauth(e,t){return await this.requestWithTracking("complete_run_credential_oauth",e,t)}async continueFromMessage(e,t){return await this.requestWithTracking("continue_from_message",e,t)}async continueUi(e,t){return await this.requestWithTracking("continue_ui",e,t)}async convertLegacyStream(e,t){return await this.requestWithTracking("convert_legacy_stream",e,t)}async createAccessToken(e,t){return await this.requestWithTracking("create_access_token",e,t)}async createCredential(e,t){return await this.requestWithTracking("create_credential",e,t)}async createGroup(e,t){return await this.requestWithTracking("create_group",e,t)}async createOauthClient(e,t){return await this.requestWithTracking("create_oauth_client",e,t)}async createOauthRegistrationToken(e,t){return await this.requestWithTracking("create_oauth_registration_token",e,t)}async createStream(e,t){return await this.requestWithTracking("create_stream",e,t)}async createStudioWorkspace(e,t){return await this.requestWithTracking("create_studio_workspace",e,t)}async createUser(e,t){return await this.requestWithTracking("create_user",e,t)}async createWorkblock(e,t){return await this.requestWithTracking("create_workblock",e,t)}async createWorkblockDataEnvironment(e,t){return await this.requestWithTracking("create_workblock_data_environment",e,t)}async createWorkblockSchedule(e,t){return await this.requestWithTracking("create_workblock_schedule",e,t)}async createWorkblockVersion(e,t){return await this.requestWithTracking("create_workblock_version",e,t)}async createWorkblockVersionUpdate(e,t){return await this.requestWithTracking("create_workblock_version_update",e,t)}async dataEnvironmentRequestApply(e,t){return await this.requestWithTracking("data_environment_request_apply",e,t)}async deleteAccessToken(e,t){return await this.requestWithTracking("delete_access_token",e,t)}async deleteAllWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("delete_all_workblock_registration_events",e,t)}async deleteCapturedEmail(e,t){return await this.requestWithTracking("delete_captured_email",e,t)}async deleteCredential(e,t){return await this.requestWithTracking("delete_credential",e,t)}async deleteDataEnvironment(e,t){return await this.requestWithTracking("delete_data_environment",e,t)}async deleteGroup(e,t){return await this.requestWithTracking("delete_group",e,t)}async deleteLearningExample(e,t){return await this.requestWithTracking("delete_learning_example",e,t)}async deleteOauthClient(e,t){return await this.requestWithTracking("delete_oauth_client",e,t)}async deleteSpace(e,t){return await this.requestWithTracking("delete_space",e,t)}async deleteStudioWorkspace(e,t){return await this.requestWithTracking("delete_studio_workspace",e,t)}async deleteWorkblock(e,t){return await this.requestWithTracking("delete_workblock",e,t)}async deleteWorkblockBranch(e,t){return await this.requestWithTracking("delete_workblock_branch",e,t)}async deleteWorkblockRegistration(e,t){return await this.requestWithTracking("delete_workblock_registration",e,t)}async deleteWorkblockRegistrationEvent(e,t){return await this.requestWithTracking("delete_workblock_registration_event",e,t)}async deleteWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("delete_workblock_run_data_truncation",e,t)}async deleteWorkblockSchedule(e,t){return await this.requestWithTracking("delete_workblock_schedule",e,t)}async deployWorkblockVersion(e,t){return await this.requestWithTracking("deploy_workblock_version",e,t)}async disableWorkblockRegistration(e,t){return await this.requestWithTracking("disable_workblock_registration",e,t)}async discardPermissionRequest(e,t){return await this.requestWithTracking("discard_permission_request",e,t)}async dismissAllNotifications(e,t){return await this.requestWithTracking("dismiss_all_notifications",e,t)}async dismissNotification(e,t){return await this.requestWithTracking("dismiss_notification",e,t)}async enableWorkblockRegistration(e,t){return await this.requestWithTracking("enable_workblock_registration",e,t)}async ensureDefaultWorkblockDataEnvironments(e,t){return await this.requestWithTracking("ensure_default_workblock_data_environments",e,t)}async ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",e,t)}async ensureWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("ensure_workblock_data_environment_namespace",e,t)}async executeWorkblockEntityStore(e,t){return await this.requestWithTracking("execute_workblock_entity_store",e,t)}async getEditStream(e,t){return await this.requestWithTracking("get_edit_stream",e,t)}async getSpaceStream(e,t){return await this.requestWithTracking("get_space_stream",e,t)}async grantWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("grant_workblock_data_environment_start",e,t)}async initiateConfigCredentialOauth(e,t){return await this.requestWithTracking("initiate_config_credential_oauth",e,t)}async initiateCredentialOauth(e,t){return await this.requestWithTracking("initiate_credential_oauth",e,t)}async initiateTaskCredentialOauth(e,t){return await this.requestWithTracking("initiate_task_credential_oauth",e,t)}async insertTasks(e,t){return await this.requestWithTracking("insert_tasks",e,t)}async installWorkblock(e,t){return await this.requestWithTracking("install_workblock",e,t)}async interruptChild(e,t){return await this.requestWithTracking("interrupt_child",e,t)}async invokeRunTask(e,t){return await this.requestWithTracking("invoke_run_task",e,t)}async invokeWorkblockTask(e,t){return await this.requestWithTracking("invoke_workblock_task",e,t)}async join(e,t){return await this.requestWithTracking("join",e,t)}async leave(e,t){return await this.requestWithTracking("leave",e,t)}async markAllNotificationsRead(e,t){return await this.requestWithTracking("mark_all_notifications_read",e,t)}async markNotificationRead(e,t){return await this.requestWithTracking("mark_notification_read",e,t)}async mergeWorkblockBranch(e,t){return await this.requestWithTracking("merge_workblock_branch",e,t)}async messageChild(e,t){return await this.requestWithTracking("message_child",e,t)}async peekWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("peek_workblock_registration_events",e,t)}async permissionsGrant(e,t){return await this.requestWithTracking("permissions_grant",e,t)}async permissionsRevoke(e,t){return await this.requestWithTracking("permissions_revoke",e,t)}async prepareWorkblockVersionDataEnvironment(e,t){return await this.requestWithTracking("prepare_workblock_version_data_environment",e,t)}async promoteWorkblockDataModel(e,t){return await this.requestWithTracking("promote_workblock_data_model",e,t)}async publishToRegistry(e,t){return await this.requestWithTracking("publish_to_registry",e,t)}async recreateEditStream(e,t){return await this.requestWithTracking("recreate_edit_stream",e,t)}async reembedValidationSet(e,t){return await this.requestWithTracking("reembed_validation_set",e,t)}async registerWorkblockEvent(e,t){return await this.requestWithTracking("register_workblock_event",e,t)}async registrySearch(e,t){return await this.requestWithTracking("registry_search",e,t)}async registrySetParameters(e,t){return await this.requestWithTracking("registry_set_parameters",e,t)}async registrySetTags(e,t){return await this.requestWithTracking("registry_set_tags",e,t)}async rejectLearningData(e,t){return await this.requestWithTracking("reject_learning_data",e,t)}async rejectThreadWorkblock(e,t){return await this.requestWithTracking("reject_thread_workblock",e,t)}async remixWorkblockV2(e,t){return await this.requestWithTracking("remix_workblock_v2",e,t)}async removeGroupMember(e,t){return await this.requestWithTracking("remove_group_member",e,t)}async removeThread(e,t){return await this.requestWithTracking("remove_thread",e,t)}async removeWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("remove_workblock_data_environment_namespace",e,t)}async renameDataEnvironment(e,t){return await this.requestWithTracking("rename_data_environment",e,t)}async requestPermission(e,t){return await this.requestWithTracking("request_permission",e,t)}async resetTask(e,t){return await this.requestWithTracking("reset_task",e,t)}async resetWorkblockBranch(e,t){return await this.requestWithTracking("reset_workblock_branch",e,t)}async resetWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("reset_workblock_data_environment_namespace",e,t)}async resolveWorkblockMergeConflicts(e,t){return await this.requestWithTracking("resolve_workblock_merge_conflicts",e,t)}async restartStudioWorkspaceThread(e,t){return await this.requestWithTracking("restart_studio_workspace_thread",e,t)}async restartWorkblock(e,t){return await this.requestWithTracking("restart_workblock",e,t)}async resumeRetry(e,t){return await this.requestWithTracking("resume_retry",e,t)}async retryWorkblockDataModelApply(e,t){return await this.requestWithTracking("retry_workblock_data_model_apply",e,t)}async revertWorkblockCommit(e,t){return await this.requestWithTracking("revert_workblock_commit",e,t)}async revokeAllOauthConsents(e,t){return await this.requestWithTracking("revoke_all_oauth_consents",e,t)}async revokeOauthConsent(e,t){return await this.requestWithTracking("revoke_oauth_consent",e,t)}async revokeOauthRegistrationToken(e,t){return await this.requestWithTracking("revoke_oauth_registration_token",e,t)}async revokeWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("revoke_workblock_data_environment_start",e,t)}async rotateOauthClientSecret(e,t){return await this.requestWithTracking("rotate_oauth_client_secret",e,t)}async runModule(e,t){return await this.requestWithTracking("run_module",e,t)}async runSingleTask(e,t){return await this.requestWithTracking("run_single_task",e,t)}async runSubgraph(e,t){return await this.requestWithTracking("run_subgraph",e,t)}async runTask(e,t){return await this.requestWithTracking("run_task",e,t)}async runWorkblockReplayTests(e,t){return await this.requestWithTracking("run_workblock_replay_tests",e,t)}async runtimeAuthzAttachRole(e,t){return await this.requestWithTracking("runtime_authz_attach_role",e,t)}async runtimeAuthzDeleteRelation(e,t){return await this.requestWithTracking("runtime_authz_delete_relation",e,t)}async runtimeAuthzDetachRole(e,t){return await this.requestWithTracking("runtime_authz_detach_role",e,t)}async runtimeAuthzStoreRelation(e,t){return await this.requestWithTracking("runtime_authz_store_relation",e,t)}async sendCapturedEmail(e,t){return await this.requestWithTracking("send_captured_email",e,t)}async sendMessage(e,t){return await this.requestWithTracking("send_message",e,t)}async sendWorkblockNotification(e,t){return await this.requestWithTracking("send_workblock_notification",e,t)}async setActiveWorkblockSetting(e,t){return await this.requestWithTracking("set_active_workblock_setting",e,t)}async setAutoApproveConfig(e,t){return await this.requestWithTracking("set_auto_approve_config",e,t)}async setConsumptionLimits(e,t){return await this.requestWithTracking("set_consumption_limits",e,t)}async setEditing(e,t){return await this.requestWithTracking("set_editing",e,t)}async setEmailCapture(e,t){return await this.requestWithTracking("set_email_capture",e,t)}async setKeepOpenOnComplete(e,t){return await this.requestWithTracking("set_keep_open_on_complete",e,t)}async setLegalHold(e,t){return await this.requestWithTracking("set_legal_hold",e,t)}async setLogging(e,t){return await this.requestWithTracking("set_logging",e,t)}async setNotificationChannelMuted(e,t){return await this.requestWithTracking("set_notification_channel_muted",e,t)}async setOauthClientEnabled(e,t){return await this.requestWithTracking("set_oauth_client_enabled",e,t)}async setRetentionPolicy(e,t){return await this.requestWithTracking("set_retention_policy",e,t)}async setStudioWorkspaceArchived(e,t){return await this.requestWithTracking("set_studio_workspace_archived",e,t)}async setStudioWorkspaceThread(e,t){return await this.requestWithTracking("set_studio_workspace_thread",e,t)}async setUserSetting(e,t){return await this.requestWithTracking("set_user_setting",e,t)}async setWorkBlock(e,t){return await this.requestWithTracking("set_work_block",e,t)}async setWorkBlockV2(e,t){return await this.requestWithTracking("set_work_block_v2",e,t)}async setWorkblockCommitMessage(e,t){return await this.requestWithTracking("set_workblock_commit_message",e,t)}async setWorkblockConfig(e,t){return await this.requestWithTracking("set_workblock_config",e,t)}async setWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("set_workblock_run_data_truncation",e,t)}async setWorkblockSchedulePaused(e,t){return await this.requestWithTracking("set_workblock_schedule_paused",e,t)}async simulateCapturedEmailReply(e,t){return await this.requestWithTracking("simulate_captured_email_reply",e,t)}async sqlAuthorizationCloneCancel(e,t){return await this.requestWithTracking("sql_authorization_clone_cancel",e,t)}async sqlAuthorizationClonePrepare(e,t){return await this.requestWithTracking("sql_authorization_clone_prepare",e,t)}async sqlAuthorizationCloneStart(e,t){return await this.requestWithTracking("sql_authorization_clone_start",e,t)}async sqlAuthorizationConversionApprove(e,t){return await this.requestWithTracking("sql_authorization_conversion_approve",e,t)}async sqlAuthorizationConversionCancel(e,t){return await this.requestWithTracking("sql_authorization_conversion_cancel",e,t)}async sqlAuthorizationConversionPrepare(e,t){return await this.requestWithTracking("sql_authorization_conversion_prepare",e,t)}async sqlAuthorizationInstallApprove(e,t){return await this.requestWithTracking("sql_authorization_install_approve",e,t)}async sqlAuthorizationInstallCancel(e,t){return await this.requestWithTracking("sql_authorization_install_cancel",e,t)}async sqlAuthorizationInstallPrepare(e,t){return await this.requestWithTracking("sql_authorization_install_prepare",e,t)}async sqlAuthorizationNamespaceApprove(e,t){return await this.requestWithTracking("sql_authorization_namespace_approve",e,t)}async sqlAuthorizationNamespaceCancel(e,t){return await this.requestWithTracking("sql_authorization_namespace_cancel",e,t)}async sqlAuthorizationNamespacePrepare(e,t){return await this.requestWithTracking("sql_authorization_namespace_prepare",e,t)}async sqlAuthorizationNamespaceRetryCleanup(e,t){return await this.requestWithTracking("sql_authorization_namespace_retry_cleanup",e,t)}async startBranchThread(e,t){return await this.requestWithTracking("start_branch_thread",e,t)}async startChild(e,t){return await this.requestWithTracking("start_child",e,t)}async startWb(e,t){return await this.requestWithTracking("start_wb",e,t)}async storeWorkBlock(e,t){return await this.requestWithTracking("store_work_block",e,t)}async switchStreamBranch(e,t){return await this.requestWithTracking("switch_stream_branch",e,t)}async syncWorkblock(e,t){return await this.requestWithTracking("sync_workblock",e,t)}async syncWorkblockVersion(e,t){return await this.requestWithTracking("sync_workblock_version",e,t)}async temporalCancelWorkflow(e,t){return await this.requestWithTracking("temporal_cancel_workflow",e,t)}async temporalResetWorkflow(e,t){return await this.requestWithTracking("temporal_reset_workflow",e,t)}async temporalSignalWorkflow(e,t){return await this.requestWithTracking("temporal_signal_workflow",e,t)}async temporalTerminateWorkflow(e,t){return await this.requestWithTracking("temporal_terminate_workflow",e,t)}async transcribeAudio(e,t){return await this.requestWithTracking("transcribe_audio",e,t)}async triggerWorkblockSchedule(e,t){return await this.requestWithTracking("trigger_workblock_schedule",e,t)}async uninstallWorkblock(e,t){return await this.requestWithTracking("uninstall_workblock",e,t)}async updateAccessToken(e,t){return await this.requestWithTracking("update_access_token",e,t)}async updateAccount(e,t){return await this.requestWithTracking("update_account",e,t)}async updateCredential(e,t){return await this.requestWithTracking("update_credential",e,t)}async updateGroup(e,t){return await this.requestWithTracking("update_group",e,t)}async updateLearningExample(e,t){return await this.requestWithTracking("update_learning_example",e,t)}async updateOauthClient(e,t){return await this.requestWithTracking("update_oauth_client",e,t)}async updateProfile(e,t){return await this.requestWithTracking("update_profile",e,t)}async updateStudioWorkspaceTitle(e,t){return await this.requestWithTracking("update_studio_workspace_title",e,t)}async updateTask(e,t){return await this.requestWithTracking("update_task",e,t)}async updateUser(e,t){return await this.requestWithTracking("update_user",e,t)}async updateWorkblockEntityStoreRow(e,t){return await this.requestWithTracking("update_workblock_entity_store_row",e,t)}async updateWorkblockSchedule(e,t){return await this.requestWithTracking("update_workblock_schedule",e,t)}async upsertSpace(e,t){return await this.requestWithTracking("upsert_space",e,t)}async addLearningData(e,t){return await this.client.sendMessage({type:"add_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async addStreamLogs(e,t){return await this.client.sendMessage({type:"add_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDiffVersions(e,t){return await this.client.sendMessage({type:"authz_schema_diff_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftGetEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGet(e,t){return await this.client.sendMessage({type:"authz_schema_get",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetAppliedEnvelope(e,t){return await this.client.sendMessage({type:"authz_schema_get_applied_envelope",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetDraftState(e,t){return await this.client.sendMessage({type:"authz_schema_get_draft_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetForWorkblock(e,t){return await this.client.sendMessage({type:"authz_schema_get_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetVersion(e,t){return await this.client.sendMessage({type:"authz_schema_get_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaImpactReport(e,t){return await this.client.sendMessage({type:"authz_schema_impact_report",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListOrphanedResources(e,t){return await this.client.sendMessage({type:"authz_schema_list_orphaned_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListRoleMemberships(e,t){return await this.client.sendMessage({type:"authz_schema_list_role_memberships",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListVersions(e,t){return await this.client.sendMessage({type:"authz_schema_list_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaPreviewValidation(e,t){return await this.client.sendMessage({type:"authz_schema_preview_validation",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaQueryAudit(e,t){return await this.client.sendMessage({type:"authz_schema_query_audit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaValidate(e,t){return await this.client.sendMessage({type:"authz_schema_validate",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchCheckWorkblockMergeability(e,t){return await this.client.sendMessage({type:"batch_check_workblock_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchGetEvents(e,t){return await this.client.sendMessage({type:"batch_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async changelogList(e,t){return await this.client.sendMessage({type:"changelog_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkChild(e,t){return await this.client.sendMessage({type:"check_child",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkCredential(e,t){return await this.client.sendMessage({type:"check_credential",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkPermission(e,t){return await this.client.sendMessage({type:"check_permission",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkStreamAccess(e,t){return await this.client.sendMessage({type:"check_stream_access",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkWorkblockBranchMergeability(e,t){return await this.client.sendMessage({type:"check_workblock_branch_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async closeWorkblockRunDataSession(e,t){return await this.client.sendMessage({type:"close_workblock_run_data_session",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async consoleLog(e,t){return await this.client.sendMessage({type:"console_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async countWorkblockRegistrationEvents(e,t){return await this.client.sendMessage({type:"count_workblock_registration_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async createWorkblockTokenUrl(e,t){return await this.client.sendMessage({type:"create_workblock_token_url",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async diffWorkblockReplayTest(e,t){return await this.client.sendMessage({type:"diff_workblock_replay_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async discoverCredentialOauth(e,t){return await this.client.sendMessage({type:"discover_credential_oauth",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async evaluateWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"evaluate_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findLearningDuplicates(e,t){return await this.client.sendMessage({type:"find_learning_duplicates",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findStudioWorkspaceOnBranch(e,t){return await this.client.sendMessage({type:"find_studio_workspace_on_branch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findWorkblockRows(e,t){return await this.client.sendMessage({type:"find_workblock_rows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAccount(e,t){return await this.client.sendMessage({type:"get_account",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getActiveWorkblockSetting(e,t){return await this.client.sendMessage({type:"get_active_workblock_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAffectedRunsCount(e,t){return await this.client.sendMessage({type:"get_affected_runs_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAgentTurn(e,t){return await this.client.sendMessage({type:"get_agent_turn",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAutoApproveConfig(e,t){return await this.client.sendMessage({type:"get_auto_approve_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAvailableModels(e,t){return await this.client.sendMessage({type:"get_available_models",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getBaseWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_base_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getCapturedEmail(e,t){return await this.client.sendMessage({type:"get_captured_email",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getConsumptionStatus(e,t){return await this.client.sendMessage({type:"get_consumption_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getCredentialForEdit(e,t){return await this.client.sendMessage({type:"get_credential_for_edit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDefaultWorkblockRegistration(e,t){return await this.client.sendMessage({type:"get_default_workblock_registration",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDocsContent(e,t){return await this.client.sendMessage({type:"get_docs_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEditStreamId(e,t){return await this.client.sendMessage({type:"get_edit_stream_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEvents(e,t){return await this.client.sendMessage({type:"get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getInstalledWorkblock(e,t){return await this.client.sendMessage({type:"get_installed_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExample(e,t){return await this.client.sendMessage({type:"get_learning_example",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExamples(e,t){return await this.client.sendMessage({type:"get_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLlmRawCall(e,t){return await this.client.sendMessage({type:"get_llm_raw_call",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLoginHistory(e,t){return await this.client.sendMessage({type:"get_login_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getPendingLearningData(e,t){return await this.client.sendMessage({type:"get_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblock(e,t){return await this.client.sendMessage({type:"get_registry_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblockInfo(e,t){return await this.client.sendMessage({type:"get_registry_workblock_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getReplayTestRunState(e,t){return await this.client.sendMessage({type:"get_replay_test_run_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRetentionPolicy(e,t){return await this.client.sendMessage({type:"get_retention_policy",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpace(e,t){return await this.client.sendMessage({type:"get_space",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpaceId(e,t){return await this.client.sendMessage({type:"get_space_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStream(e,t){return await this.client.sendMessage({type:"get_stream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStreamLogs(e,t){return await this.client.sendMessage({type:"get_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspace(e,t){return await this.client.sendMessage({type:"get_studio_workspace",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspacePresence(e,t){return await this.client.sendMessage({type:"get_studio_workspace_presence",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTaskLogs(e,t){return await this.client.sendMessage({type:"get_task_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineAffectedCount(e,t){return await this.client.sendMessage({type:"get_timeline_affected_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineEventTypes(e,t){return await this.client.sendMessage({type:"get_timeline_event_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTos(e,t){return await this.client.sendMessage({type:"get_tos",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUserSetting(e,t){return await this.client.sendMessage({type:"get_user_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUsers(e,t){return await this.client.sendMessage({type:"get_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkBlockRuns(e,t){return await this.client.sendMessage({type:"get_work_block_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblock(e,t){return await this.client.sendMessage({type:"get_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockBranchInfo(e,t){return await this.client.sendMessage({type:"get_workblock_branch_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitLog(e,t){return await this.client.sendMessage({type:"get_workblock_commit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitPatch(e,t){return await this.client.sendMessage({type:"get_workblock_commit_patch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockConfig(e,t){return await this.client.sendMessage({type:"get_workblock_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModel(e,t){return await this.client.sendMessage({type:"get_workblock_data_model",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelDeployPreview(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_deploy_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelRunReadiness(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_run_readiness",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelStatus(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataSchema(e,t){return await this.client.sendMessage({type:"get_workblock_data_schema",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockFileContent(e,t){return await this.client.sendMessage({type:"get_workblock_file_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockHistoryBundle(e,t){return await this.client.sendMessage({type:"get_workblock_history_bundle",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockMissingCredentials(e,t){return await this.client.sendMessage({type:"get_workblock_missing_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsConsumption(e,t){return await this.client.sendMessage({type:"get_workblock_operations_consumption",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsCurrent(e,t){return await this.client.sendMessage({type:"get_workblock_operations_current",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsFailures(e,t){return await this.client.sendMessage({type:"get_workblock_operations_failures",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsOutcomes(e,t){return await this.client.sendMessage({type:"get_workblock_operations_outcomes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsRpc(e,t){return await this.client.sendMessage({type:"get_workblock_operations_rpc",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsRuns(e,t){return await this.client.sendMessage({type:"get_workblock_operations_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRun(e,t){return await this.client.sendMessage({type:"get_workblock_run",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunDataSchemaVersionDetails(e,t){return await this.client.sendMessage({type:"get_workblock_run_data_schema_version_details",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunInputs(e,t){return await this.client.sendMessage({type:"get_workblock_run_inputs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunResult(e,t){return await this.client.sendMessage({type:"get_workblock_run_result",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockSchedule(e,t){return await this.client.sendMessage({type:"get_workblock_schedule",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockTaskErrors(e,t){return await this.client.sendMessage({type:"get_workblock_task_errors",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUi(e,t){return await this.client.sendMessage({type:"get_workblock_ui",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUpstream(e,t){return await this.client.sendMessage({type:"get_workblock_upstream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockV2(e,t){return await this.client.sendMessage({type:"get_workblock_v2",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeCatalog(e,t){return await this.client.sendMessage({type:"graphlake_catalog",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeExplore(e,t){return await this.client.sendMessage({type:"graphlake_explore",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeIntrospect(e,t){return await this.client.sendMessage({type:"graphlake_introspect",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeNode(e,t){return await this.client.sendMessage({type:"graphlake_node",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeQuery(e,t){return await this.client.sendMessage({type:"graphlake_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeSearchNodes(e,t){return await this.client.sendMessage({type:"graphlake_search_nodes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiQuery(e,t){return await this.client.sendMessage({type:"graphlake_ui_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiSubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_subscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiUnsubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_unsubscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async help(e,t){return await this.client.sendMessage({type:"help",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async inspectFile(e,t){return await this.client.sendMessage({type:"inspect_file",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async invokeTask(e,t){return await this.client.sendMessage({type:"invoke_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listAccessTokens(e,t){return await this.client.sendMessage({type:"list_access_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listApprovedLearningSets(e,t){return await this.client.sendMessage({type:"list_approved_learning_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCapturedEmails(e,t){return await this.client.sendMessage({type:"list_captured_emails",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCategories(e,t){return await this.client.sendMessage({type:"list_categories",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentialTypes(e,t){return await this.client.sendMessage({type:"list_credential_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentials(e,t){return await this.client.sendMessage({type:"list_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listExportedWorkblocks(e,t){return await this.client.sendMessage({type:"list_exported_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroupMembers(e,t){return await this.client.sendMessage({type:"list_group_members",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroups(e,t){return await this.client.sendMessage({type:"list_groups",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listInstalledWorkblocks(e,t){return await this.client.sendMessage({type:"list_installed_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningDataSets(e,t){return await this.client.sendMessage({type:"list_learning_data_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamples(e,t){return await this.client.sendMessage({type:"list_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamplesByScore(e,t){return await this.client.sendMessage({type:"list_learning_examples_by_score",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningSetsForWorkblock(e,t){return await this.client.sendMessage({type:"list_learning_sets_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLlmRawCalls(e,t){return await this.client.sendMessage({type:"list_llm_raw_calls",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyOauthConsents(e,t){return await this.client.sendMessage({type:"list_my_oauth_consents",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyPermissionRequests(e,t){return await this.client.sendMessage({type:"list_my_permission_requests",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotificationChannels(e,t){return await this.client.sendMessage({type:"list_notification_channels",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotifications(e,t){return await this.client.sendMessage({type:"list_notifications",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthClients(e,t){return await this.client.sendMessage({type:"list_oauth_clients",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthRegistrationTokens(e,t){return await this.client.sendMessage({type:"list_oauth_registration_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOwnedRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_owned_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listPendingLearningData(e,t){return await this.client.sendMessage({type:"list_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listQdrantCollections(e,t){return await this.client.sendMessage({type:"list_qdrant_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRowstoreCollections(e,t){return await this.client.sendMessage({type:"list_rowstore_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listSpaces(e,t){return await this.client.sendMessage({type:"list_spaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listStudioWorkspaces(e,t){return await this.client.sendMessage({type:"list_studio_workspaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockBranches(e,t){return await this.client.sendMessage({type:"list_workblock_branches",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentCloneOperations(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_clone_operations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartOptions(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_options",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironments(e,t){return await this.client.sendMessage({type:"list_workblock_data_environments",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDefinitions(e,t){return await this.client.sendMessage({type:"list_workblock_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockEntityStoreSavedQueries(e,t){return await this.client.sendMessage({type:"list_workblock_entity_store_saved_queries",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockPermissionRequests(e,t){return await this.client.sendMessage({type:"list_workblock_permission_requests",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRegistrations(e,t){return await this.client.sendMessage({type:"list_workblock_registrations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRowCollections(e,t){return await this.client.sendMessage({type:"list_workblock_row_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataSchemaVersions(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_schema_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataTruncations(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_truncations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunners(e,t){return await this.client.sendMessage({type:"list_workblock_runners",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockSchedules(e,t){return await this.client.sendMessage({type:"list_workblock_schedules",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockVersions(e,t){return await this.client.sendMessage({type:"list_workblock_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsCheck(e,t){return await this.client.sendMessage({type:"permissions_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsDefinitions(e,t){return await this.client.sendMessage({type:"permissions_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsListSubjects(e,t){return await this.client.sendMessage({type:"permissions_list_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsLookupResources(e,t){return await this.client.sendMessage({type:"permissions_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async previewContinueFromMessage(e,t){return await this.client.sendMessage({type:"preview_continue_from_message",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryAuditLog(e,t){return await this.client.sendMessage({type:"query_audit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockEntityStore(e,t){return await this.client.sendMessage({type:"query_workblock_entity_store",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockRunData(e,t){return await this.client.sendMessage({type:"query_workblock_run_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async repeatDone(e,t){return await this.client.sendMessage({type:"repeat_done",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockByTask(e,t){return await this.client.sendMessage({type:"resolve_workblock_by_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockContent(e,t){return await this.client.sendMessage({type:"resolve_workblock_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzCheck(e,t){return await this.client.sendMessage({type:"runtime_authz_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupResources(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupSubjects(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTest(e,t){return await this.client.sendMessage({type:"sandbox_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTestResponse(e,t){return await this.client.sendMessage({type:"sandbox_test_response",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async searchLearningExamples(e,t){return await this.client.sendMessage({type:"search_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskProgress(e,t){return await this.client.sendMessage({type:"send_task_progress",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskRunEvent(e,t){return await this.client.sendMessage({type:"send_task_run_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setAgentComplete(e,t){return await this.client.sendMessage({type:"set_agent_complete",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"set_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationCloneGetPlan(e,t){return await this.client.sendMessage({type:"sql_authorization_clone_get_plan",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationConversionPreview(e,t){return await this.client.sendMessage({type:"sql_authorization_conversion_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationGetPlan(e,t){return await this.client.sendMessage({type:"sql_authorization_get_plan",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationInstallPreview(e,t){return await this.client.sendMessage({type:"sql_authorization_install_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationNamespaceGetPlan(e,t){return await this.client.sendMessage({type:"sql_authorization_namespace_get_plan",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationStatus(e,t){return await this.client.sendMessage({type:"sql_authorization_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalExportHistory(e,t){return await this.client.sendMessage({type:"temporal_export_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetStack(e,t){return await this.client.sendMessage({type:"temporal_get_stack",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetWorkflow(e,t){return await this.client.sendMessage({type:"temporal_get_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalListWorkflowTypes(e,t){return await this.client.sendMessage({type:"temporal_list_workflow_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalQueryWorkflow(e,t){return await this.client.sendMessage({type:"temporal_query_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalSearchWorkflows(e,t){return await this.client.sendMessage({type:"temporal_search_workflows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalStreamHistory(e,t){return await this.client.sendMessage({type:"temporal_stream_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async upsertMemo(e,t){return await this.client.sendMessage({type:"upsert_memo",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateTask(e,t){return await this.client.sendMessage({type:"validate_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateWorkblock(e,t){return await this.client.sendMessage({type:"validate_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async wbRunTest(e,t){return await this.client.sendMessage({type:"wb_run_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async workblockReleaseList(e,t){return await this.client.sendMessage({type:"workblock_release_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsGetEvents(e,t){return await this.client.sendMessage({type:"yjs_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsResetEvents(e,t){return await this.client.sendMessage({type:"yjs_reset_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_stream_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async requestWithTracking(e,t,i){let n=Date.now(),r={...this.analyticsClient?.now?.(),...this.requestAnalyticsContext(i),trigger:i?.trigger??"user",stream_id:i?.streamId,thread_id:i?.threadId,...this.sanitizeForAnalytics(t)};try{let a=await this.client.sendMessage({type:e,stream_id:i?.streamId,thread_id:i?.threadId,timeout:i?.timeoutSeconds,task_id:i?.taskId,model:i?.model,reasoning_effort:i?.reasoningEffort,request:t});return this.trackEventSafely(`user-action/${e}`,{...r,...typeof i?.analyticsContext=="function"?this.requestAnalyticsContext(i,a):{},...this.resultIdsForAnalytics(e,a),...this.mergeOutcomeForAnalytics(e,a),success:!0,duration_ms:Date.now()-n}),a}catch(a){throw this.trackEventSafely(`user-action/${e}`,{...r,success:!1,duration_ms:Date.now()-n,error_type:a instanceof Error?a.name:"Unknown",error_code:a instanceof Error&&"code"in a&&typeof a.code=="string"&&a.code?a.code:void 0}),a}}requestAnalyticsContext(e,t){try{return typeof e?.analyticsContext=="function"?e.analyticsContext(t):e?.analyticsContext??{}}catch{return{}}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(i){console.error("Analytics tracking failed:",i)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[i,n]of Object.entries(e))(i.endsWith("_id")||i.endsWith("_ids")||i==="id")&&(t[hc(i)]=n);return t}resultIdsForAnalytics(e,t){if(!t||typeof t!="object"||Array.isArray(t))return{};let i=t,n={},r=Gw[e]??[];for(let a of r){let o=i[a];typeof o=="string"?n[`result_${hc(a)}`]=o:o&&typeof o=="object"&&"id"in o&&typeof o.id=="string"&&(n[`result_${hc(a)}_id`]=o.id)}return n}mergeOutcomeForAnalytics(e,t){if(!t||typeof t!="object")return{};let i={};return"merge_success"in t&&typeof t.merge_success=="boolean"?i.merge_success=t.merge_success:(e==="accept_thread_workblock"||e==="merge_workblock_branch"||e==="revert_workblock_commit")&&"success"in t&&typeof t.success=="boolean"&&(i.merge_success=t.success),"conflict_files"in t&&Array.isArray(t.conflict_files)&&(i.conflict_count=t.conflict_files.length),i}};var Us=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Fe=180,qi=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];pushHandlers=new Map;ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new hr({sendMessage:e=>this.send(e)});constructor(e=!1){this.debug=e}addStreamHandler(e){this.streamHandlers.push(e)}addEventHandler(e){this.eventHandlers.push(e)}addCurrentUserHandler(e){this.currentUserHandlers.push(e)}addErrorHandler(e){this.errorHandlers.push(e)}addConnectionErrorHandler(e){this.connectionErrorHandlers.push(e)}addOnDisconnect(e){this.onDisconnect.push(e)}useTokenSource(e){this.tokenSource=e}addPushHandler(e,t){this.pushHandlers.set(e,[...this.pushHandlers.get(e)??[],t])}close(){this.closing=!0,this.ws?.close()}connect(e,t){this.connectionHost=e,this.lastConnectionError=void 0,this.connected=!1,this.closing=!1,e.indexOf("://")===-1&&(e=`https://${e}`),this.token=t;let i=new URL(e);i.protocol==="ws:"?i.protocol="http:":i.protocol==="wss:"&&(i.protocol="https:"),!i.hostname.startsWith("api.")&&!i.hostname.startsWith("localhost")&&(i.hostname=`api.${i.hostname}`),i.pathname=i.pathname.replace("/workblocks/streams",""),i.pathname.endsWith("/")&&(i.pathname=i.pathname.slice(0,-1)),i.pathname=i.pathname+"/blobs",this.blobURL=i.toString();let n=new URL(e);switch(n.protocol){case"https:":n.protocol="wss:";break;case"http:":n.protocol="ws:";break}!n.hostname.startsWith("api.")&&!n.hostname.startsWith("localhost")&&(n.hostname=`api.${n.hostname}`),n.pathname.endsWith("/streams")||(n.pathname="/workblocks/streams"),this.connectionUrl=n.toString();let r=new dr(n.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=r,r.on("open",()=>{this.ws===r&&(this.connected=!0,this.lastConnectionError=void 0)}),r.on("unexpected-response",(a,o)=>{this.ws===r&&this.reportConnectionError(`Unexpected server response: ${o.statusCode}`,o.statusCode),r.terminate()}),r.on("message",a=>{if(this.ws!==r)return;let o=JSON.parse(a.toString());if(this.debug&&console.error("Received message","type"in o?o.type:"error","reply_to"in o?o.reply_to:void 0),"reply_to"in o){if(o.reply_to===void 0)return;let c=this.store[o.reply_to];c&&(delete this.store[o.reply_to],clearTimeout(c.timeoutHandle),"error"in o?c.reject(new Us(o.error,o.error_type??"")):c.resolve(o.response));return}if("error"in o){this.errorHandlers.forEach(c=>c(o.error));return}o.type==="streams"?this.handleListStreams(o.response):o.type==="events"?this.handleEvents(o.response).catch(c=>{console.error(c)}):o.type==="whoami"&&this.handleCurrentUser(o.response),this.pushHandlers.get(o.type)?.forEach(c=>{try{c(o.response)}catch(u){console.error(u)}})}),r.on("close",(a,o)=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(`Connection closed before it was established. Code: ${a}, Reason: ${o||"none"}`),this.rejectAllPending(new Error(`WebSocket disconnected. Code: ${a}, Reason: ${o}`)),this.onDisconnect.forEach(c=>c()))}),r.on("error",async a=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(a.message),this.rejectAllPending(new Error(`WebSocket error: ${a.message}`)))})}waitForOpen(){if(this.connected)return Promise.resolve();let e=this.ws;return e?e.readyState===dr.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,i)=>{let n=()=>{c(),t()},r=u=>{c(),i(new Error(`WebSocket error: ${u.message}`))},a=(u,l)=>{c(),i(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},o=(u,l)=>{c(),i(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",n),e.removeListener("error",r),e.removeListener("unexpected-response",a),e.removeListener("close",o)};e.on("open",n),e.on("error",r),e.on("unexpected-response",a),e.on("close",o)}):Promise.reject(new Error("WebSocket not connected"))}fetchWithCache(e,t){return fetch(e,t)}async _send(e,t){return this.ws&&this.ws.readyState===dr.OPEN?(this.SequenceID++,new Promise((i,n)=>{let r=this.SequenceID,a=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,o=setTimeout(()=>{let c=this.store[r];c&&(delete this.store[r],c.reject(new Error(`Request timed out after ${a}ms${c.type?` (type=${c.type})`:""}`)))},a);this.store[r]={resolve:i,reject:n,timeoutHandle:o,type:e.type},this.ws?.send(JSON.stringify({...e,seq:r}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,i={}){let n=i.timeoutSeconds;return await this._send({type:e,stream_id:i.streamId,timeout:n,request:t},n===void 0?void 0:(n+5)*1e3)}async send(e){let t=e.timeout===void 0?void 0:(e.timeout+5)*1e3;return await this._send(e,t)}async setWorkblock(e,t){let i=await this.requests.setWorkBlockV2({workblock:t},{streamId:e,timeoutSeconds:Fe});return{errors:i.errors??[],warnings:i.warnings??[]}}async getWorkblock(e){return await this.requests.getWorkblock({},{streamId:e})??void 0}async getWorkblockById(e){return await this.requests.getWorkblock({id:e})??void 0}async storeWorkblock(e){let t;try{if(t=await this.getWorkblockById(e.id),!t)throw new Error(`Workblock lookup for ${e.id} returned no definition`)}catch(r){if(!(r instanceof Us&&r.code==="NotFound"))throw r;t=void 0}if(!t)return await this.createWorkblock(e);let i=await this.requests.getEditStream({workblock_id:e.id}),n=await this.setWorkblock(i.id,e);if(n.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(n.errors)}`);return{stream:i,warnings:n.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Fe})}async createWorkblock(e,t){let i=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Fe});if(i.errors?.length)throw new Error(`Validation errors: ${JSON.stringify(i.errors)}`);return{stream:i.stream,warnings:i.warnings??[]}}async listWorkblockDefinitions(){return await this.requests.listWorkblockDefinitions({include_branches:!0})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}async listWorkblockDataEnvironments(e){return await this.requests.listWorkblockDataEnvironments({workblock_id:e})}async queryWorkblockEntityStore(e){return await this.requests.queryWorkblockEntityStore(e)}async listWorkblockEntityStoreSavedQueries(e){return await this.requests.listWorkblockEntityStoreSavedQueries(e)}async getSpace(e){return await this.requests.getSpace({slug:e})}async getActiveWorkblockSetting(e){return(await this.requests.getActiveWorkblockSetting({workblock_id:e})).branch}async setActiveWorkblockSetting(e,t){await this.requests.setActiveWorkblockSetting({workblock_id:e,branch:t})}async createStudioWorkspace(e,t,i,n=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:i,create_user_branch:n})).stream}async createWorkblockVersion(e,t,i,n){return(await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,source_ref:i,workspace_name:n},{timeoutSeconds:Fe})).stream}async findStudioWorkspaceOnBranch(e,t){return(await this.requests.findStudioWorkspaceOnBranch({workblock_id:e,target_branch:t})).stream_id}async getStudioWorkspace(e){return(await this.requests.getStudioWorkspace({stream_id:e})).workspace??void 0}async listStudioWorkspaces(e,t){if(!e&&!t)throw new Error("listStudioWorkspaces requires a user id or a workblock id");return(await this.requests.listStudioWorkspaces({user_id:e,workblock_id:t})).workspaces??[]}async getBlob(e){return this.debug&&console.error(`Getting blob ${e}`),e.startsWith("::bw:data:")?(await this.getBlobContent(e)).text:e}async getBlobContent(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",text:await t.text()}}async getBlobBytes(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",bytes:new Uint8Array(await t.arrayBuffer())}}async fetchBlob(e){let t=this.tokenSource?await this.tokenSource():this.token,i=await this.fetchWithCache(`${this.blobURL}?key=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`Failed to fetch blob ${e}: ${i.status} ${i.statusText}`);return i}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,i)=>{let n=setTimeout(()=>i(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(r=>{clearTimeout(n),t(r)})})}async getWorkblockV2ById(e){return await this.requests.getWorkblockV2({id:e,resolve_blobs:!0})??void 0}async resolveWorkblockContent(e,t){return await this.requests.resolveWorkblockContent({workblock_id:e,commit_ref:t})}async setWorkblockV2(e,t,i){return await this.requests.setWorkBlockV2({workblock:t,branch:i.branch,expected_commit_ref:i.expectedCommitRef,advance_version:i.advanceVersion||void 0,commit_message:i.commitMessage},{streamId:e,timeoutSeconds:Fe})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Fe})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Fe})}async checkWorkblockBranchMergeability(e,t,i,n={}){return await this.requests.checkWorkblockBranchMergeability({workblock_id:e,base_branch:t,head_branch:i,compute_file_merges:n.computeFileMerges||void 0},{timeoutSeconds:Fe})}async mergeWorkblockBranch(e,t,i,n={}){return await this.requests.mergeWorkblockBranch({workblock_id:e,base_branch:t,head_branch:i,commit_message:n.commitMessage},{streamId:n.streamId,timeoutSeconds:Fe})}async resolveWorkblockMergeConflicts(e,t,i,n,r){return await this.requests.resolveWorkblockMergeConflicts({workblock_id:e,base_branch:t,head_branch:i,resolved_files:n,base_branch_commit:r.baseBranchCommit,head_branch_commit:r.headBranchCommit,commit_message:r.commitMessage},{streamId:r.streamId,timeoutSeconds:Fe})}async resetWorkblockBranch(e,t,i,n){await this.requests.resetWorkblockBranch({workblock_id:e,branch_name:t,source_ref:i,expected_commit_ref:n})}async setWorkblockCommitMessage(e,t,i){await this.requests.setWorkblockCommitMessage({workblock_id:e,commit_hash:t,title:i.split(`
152
+ `,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(Ss);let t=IC(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let i=0;i<=this.options.mpegOffsetTolerance;++i){let n=this.scanMpeg(i);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?xs:z);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?xs:z);if(!(t>hC)&&!(de(this.tokenizer)&&2+t*12>mk))for(let i=0;i<t;++i){let n=await this.readTiffTag(e);if(n)return n}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},i=(e?xs:z).get(this.buffer,2),n=(e?xd:j).get(this.buffer,4);if(i===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let o=(e?xs:z).get(this.buffer,8),c=(e?xs:z).get(this.buffer,10);if(o===28&&c===254||o===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(de(this.tokenizer)&&n>mC)return t;let r=de(this.tokenizer)?mk:this.tokenizer.fileInfo.size;try{await $t(this.tokenizer,n,{maximumLength:r,reason:"TIFF IFD offset"})}catch(o){if(o instanceof P)return;throw o}let a;try{a=await this.readTiffIFD(e)}catch(o){if(o instanceof P)return;throw o}return a??t}if(i===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},yk=new Set(ik),vk=new Set(nk)});var Ek={};Ps(Ek,{FileTypeParser:()=>bi,fileTypeFromBlob:()=>xk,fileTypeFromBuffer:()=>_k,fileTypeFromFile:()=>MC,fileTypeFromStream:()=>LC,fileTypeFromTokenizer:()=>wk,fileTypeStream:()=>BC,supportedExtensions:()=>yk,supportedMimeTypes:()=>vk});function FC(s){return!(s instanceof RangeError)||s.message!=="offset is out of bounds"||typeof s.stack!="string"?!1:/strtok3[/\\]lib[/\\]stream[/\\]/.test(s.stack)}async function MC(s,e){return new bi(e).fromFile(s,e)}async function LC(s,e){return new bi(e).fromStream(s)}async function BC(s,e={}){return new bi(e).toDetectionStream(s,e)}var Sk,jt,Nk,Od,bi,Ck=B(()=>{Sk=require("node:stream/web"),jt=require("node:stream"),Nk=F(require("node:fs/promises"),1),Od=require("node:fs");yb();Td();Td();bi=class extends Ns{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof Sk.ReadableStream?this.createTokenizerFromWebStream(e):wb(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(i){if(FC(i))return;throw i}finally{e instanceof jt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await Nk.default.open(e,Od.constants.O_RDONLY|Od.constants.O_NONBLOCK),i=await t.stat();if(!i.isFile()){await t.close();return}let n=new _s(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:i.size}});return super.fromTokenizer(n)}async toDetectionStream(e,t={}){if(!(e instanceof jt.Readable))return super.toDetectionStream(e,t);let{sampleSize:i=Ss}=t,{signal:n}=this.options,r=Id(i);return n?.throwIfAborted(),new Promise((a,o)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",h),n?.removeEventListener("abort",p)},l=(m,f)=>{c||(c=!0,u(),m(f))},d=m=>{l(o,m)},p=()=>{e.destroyed||e.destroy(),l(o,n.reason)},h=()=>{(async()=>{try{let m=new jt.PassThrough,f=jt.pipeline?(0,jt.pipeline)(e,m,()=>{}):e.pipe(m),g=e.read(r)??e.read()??new Uint8Array(0);try{m.fileType=await this.fromBuffer(g)}catch(b){b instanceof P?m.fileType=void 0:l(o,b)}l(a,f)}catch(m){l(o,m)}})()};e.on("error",d),e.once("readable",h),n?.addEventListener("abort",p,{once:!0})})}}});var z6={};Ps(z6,{activate:()=>$6,connectToHost:()=>Uo,deactivate:()=>j6});module.exports=gx(z6);var N=F(require("vscode"));var mr=F(require("vscode"));var Ww=F(fh(),1),$w=F(rr(),1),jw=F(Ls(),1),zw=F(ic(),1),Uw=F(ac(),1),Vw=F(dc(),1),Sh=F(ur(),1),Hw=F(vh(),1);var dr=Sh.default;var hc=s=>s.replace("work_block","workblock"),pr=["module_id","parent_task_def_id","parent_task_id","run_id","stream_id","wcb_id"],Gw={ask_agent:["conversation_id","message_id","run_id"],authz_schema_apply:["version_id"],authz_schema_draft_emit_event:["workblock_id"],authz_schema_force_apply:["version_id"],authz_schema_initialize_for_workblock:["schema_id"],authz_schema_propose:["draft_id"],cancel_child:pr,complete_child:pr,continue_from_message:["thread_id"],convert_legacy_stream:["editing_task_id","id","parent_id"],create_access_token:["access_token"],create_group:["id"],create_oauth_client:["client"],create_oauth_registration_token:["registration_token"],create_stream:["run_id","stream_id"],create_studio_workspace:["stream","workspace"],create_user:["id"],create_workblock:["stream","workspace"],create_workblock_schedule:["id","user","wcb_id"],create_workblock_version:["stream","workspace"],discard_permission_request:["request_id"],get_edit_stream:["editing_task_id","id","parent_id"],get_space_stream:["run_id","stream_id"],initiate_credential_oauth:["attempt_id"],initiate_task_credential_oauth:["attempt_id"],interrupt_child:pr,message_child:pr,publish_to_registry:["id"],recreate_edit_stream:["stream"],register_workblock_event:["id","stream_id","workblock_id"],remix_workblock_v2:["workblock_id"],rename_data_environment:["environment"],request_permission:["request_id"],restart_studio_workspace_thread:["previous_thread_id","thread_id"],run_module:["run_id"],run_workblock_replay_tests:["workflow_id"],set_legal_hold:["run_id"],set_retention_policy:["workblock_id"],set_work_block:["work_block"],set_work_block_v2:["work_block"],start_branch_thread:["thread_id"],update_task:["task"],update_workblock_schedule:["id","user","wcb_id"],upsert_space:["id"]},hr=class{client;analyticsClient;constructor(e,t){this.client=e,this.analyticsClient=t??null}async acceptThreadWorkblock(e,t){return await this.requestWithTracking("accept_thread_workblock",e,t)}async acceptTos(e,t){return await this.requestWithTracking("accept_tos",e,t)}async addGroupMember(e,t){return await this.requestWithTracking("add_group_member",e,t)}async applyWorkblockDataModelDraft(e,t){return await this.requestWithTracking("apply_workblock_data_model_draft",e,t)}async applyWorkblockDeployedUpdates(e,t){return await this.requestWithTracking("apply_workblock_deployed_updates",e,t)}async applyWorkblockVersionUpdates(e,t){return await this.requestWithTracking("apply_workblock_version_updates",e,t)}async approveLearningData(e,t){return await this.requestWithTracking("approve_learning_data",e,t)}async askAgent(e,t){return await this.requestWithTracking("ask_agent",e,t)}async assign(e,t){return await this.requestWithTracking("assign",e,t)}async assignEditStream(e,t){return await this.requestWithTracking("assign_edit_stream",e,t)}async assignWorkBlockRuns(e,t){return await this.requestWithTracking("assign_work_block_runs",e,t)}async authzSchemaApply(e,t){return await this.requestWithTracking("authz_schema_apply",e,t)}async authzSchemaDiscardPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_discard_policy_draft",e,t)}async authzSchemaDraftEmitAwarenessEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_awareness_event",e,t)}async authzSchemaDraftEmitEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_event",e,t)}async authzSchemaForceApply(e,t){return await this.requestWithTracking("authz_schema_force_apply",e,t)}async authzSchemaGrantRoleMembership(e,t){return await this.requestWithTracking("authz_schema_grant_role_membership",e,t)}async authzSchemaImportPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_import_policy_draft",e,t)}async authzSchemaInitializeForWorkblock(e,t){return await this.requestWithTracking("authz_schema_initialize_for_workblock",e,t)}async authzSchemaOpenPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_open_policy_draft",e,t)}async authzSchemaPropose(e,t){return await this.requestWithTracking("authz_schema_propose",e,t)}async authzSchemaRevokeRoleMembership(e,t){return await this.requestWithTracking("authz_schema_revoke_role_membership",e,t)}async authzSchemaSavePolicyDraft(e,t){return await this.requestWithTracking("authz_schema_save_policy_draft",e,t)}async bulkTagLearningExamples(e,t){return await this.requestWithTracking("bulk_tag_learning_examples",e,t)}async callWorkblockTask(e,t){return await this.requestWithTracking("call_workblock_task",e,t)}async cancelAgent(e,t){return await this.requestWithTracking("cancel_agent",e,t)}async cancelChild(e,t){return await this.requestWithTracking("cancel_child",e,t)}async cancelWb(e,t){return await this.requestWithTracking("cancel_wb",e,t)}async cancelWorkblockDataEnvironmentCloneOperation(e,t){return await this.requestWithTracking("cancel_workblock_data_environment_clone_operation",e,t)}async cancelWorkblockNotification(e,t){return await this.requestWithTracking("cancel_workblock_notification",e,t)}async changelogMarkSeen(e,t){return await this.requestWithTracking("changelog_mark_seen",e,t)}async chatQueue(e,t){return await this.requestWithTracking("chat_queue",e,t)}async cloneWorkblockDataEnvironment(e,t){return await this.requestWithTracking("clone_workblock_data_environment",e,t)}async closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",e,t)}async completeConfigCredentialOauth(e,t){return await this.requestWithTracking("complete_config_credential_oauth",e,t)}async completeCredentialOauth(e,t){return await this.requestWithTracking("complete_credential_oauth",e,t)}async completeRunCredentialOauth(e,t){return await this.requestWithTracking("complete_run_credential_oauth",e,t)}async continueFromMessage(e,t){return await this.requestWithTracking("continue_from_message",e,t)}async continueUi(e,t){return await this.requestWithTracking("continue_ui",e,t)}async convertLegacyStream(e,t){return await this.requestWithTracking("convert_legacy_stream",e,t)}async createAccessToken(e,t){return await this.requestWithTracking("create_access_token",e,t)}async createCredential(e,t){return await this.requestWithTracking("create_credential",e,t)}async createGroup(e,t){return await this.requestWithTracking("create_group",e,t)}async createOauthClient(e,t){return await this.requestWithTracking("create_oauth_client",e,t)}async createOauthRegistrationToken(e,t){return await this.requestWithTracking("create_oauth_registration_token",e,t)}async createStream(e,t){return await this.requestWithTracking("create_stream",e,t)}async createStudioWorkspace(e,t){return await this.requestWithTracking("create_studio_workspace",e,t)}async createUser(e,t){return await this.requestWithTracking("create_user",e,t)}async createWorkblock(e,t){return await this.requestWithTracking("create_workblock",e,t)}async createWorkblockDataEnvironment(e,t){return await this.requestWithTracking("create_workblock_data_environment",e,t)}async createWorkblockSchedule(e,t){return await this.requestWithTracking("create_workblock_schedule",e,t)}async createWorkblockVersion(e,t){return await this.requestWithTracking("create_workblock_version",e,t)}async createWorkblockVersionUpdate(e,t){return await this.requestWithTracking("create_workblock_version_update",e,t)}async dataEnvironmentRequestApply(e,t){return await this.requestWithTracking("data_environment_request_apply",e,t)}async deleteAccessToken(e,t){return await this.requestWithTracking("delete_access_token",e,t)}async deleteAllWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("delete_all_workblock_registration_events",e,t)}async deleteCapturedEmail(e,t){return await this.requestWithTracking("delete_captured_email",e,t)}async deleteCredential(e,t){return await this.requestWithTracking("delete_credential",e,t)}async deleteDataEnvironment(e,t){return await this.requestWithTracking("delete_data_environment",e,t)}async deleteGroup(e,t){return await this.requestWithTracking("delete_group",e,t)}async deleteLearningExample(e,t){return await this.requestWithTracking("delete_learning_example",e,t)}async deleteOauthClient(e,t){return await this.requestWithTracking("delete_oauth_client",e,t)}async deleteSpace(e,t){return await this.requestWithTracking("delete_space",e,t)}async deleteStudioWorkspace(e,t){return await this.requestWithTracking("delete_studio_workspace",e,t)}async deleteWorkblock(e,t){return await this.requestWithTracking("delete_workblock",e,t)}async deleteWorkblockBranch(e,t){return await this.requestWithTracking("delete_workblock_branch",e,t)}async deleteWorkblockRegistration(e,t){return await this.requestWithTracking("delete_workblock_registration",e,t)}async deleteWorkblockRegistrationEvent(e,t){return await this.requestWithTracking("delete_workblock_registration_event",e,t)}async deleteWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("delete_workblock_run_data_truncation",e,t)}async deleteWorkblockSchedule(e,t){return await this.requestWithTracking("delete_workblock_schedule",e,t)}async deployWorkblockVersion(e,t){return await this.requestWithTracking("deploy_workblock_version",e,t)}async disableWorkblockRegistration(e,t){return await this.requestWithTracking("disable_workblock_registration",e,t)}async discardPermissionRequest(e,t){return await this.requestWithTracking("discard_permission_request",e,t)}async dismissAllNotifications(e,t){return await this.requestWithTracking("dismiss_all_notifications",e,t)}async dismissNotification(e,t){return await this.requestWithTracking("dismiss_notification",e,t)}async enableWorkblockRegistration(e,t){return await this.requestWithTracking("enable_workblock_registration",e,t)}async ensureDefaultWorkblockDataEnvironments(e,t){return await this.requestWithTracking("ensure_default_workblock_data_environments",e,t)}async ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",e,t)}async ensureWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("ensure_workblock_data_environment_namespace",e,t)}async executeWorkblockEntityStore(e,t){return await this.requestWithTracking("execute_workblock_entity_store",e,t)}async getEditStream(e,t){return await this.requestWithTracking("get_edit_stream",e,t)}async getSpaceStream(e,t){return await this.requestWithTracking("get_space_stream",e,t)}async grantWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("grant_workblock_data_environment_start",e,t)}async initiateConfigCredentialOauth(e,t){return await this.requestWithTracking("initiate_config_credential_oauth",e,t)}async initiateCredentialOauth(e,t){return await this.requestWithTracking("initiate_credential_oauth",e,t)}async initiateTaskCredentialOauth(e,t){return await this.requestWithTracking("initiate_task_credential_oauth",e,t)}async insertTasks(e,t){return await this.requestWithTracking("insert_tasks",e,t)}async installWorkblock(e,t){return await this.requestWithTracking("install_workblock",e,t)}async interruptChild(e,t){return await this.requestWithTracking("interrupt_child",e,t)}async invokeRunTask(e,t){return await this.requestWithTracking("invoke_run_task",e,t)}async invokeWorkblockTask(e,t){return await this.requestWithTracking("invoke_workblock_task",e,t)}async join(e,t){return await this.requestWithTracking("join",e,t)}async leave(e,t){return await this.requestWithTracking("leave",e,t)}async markAllNotificationsRead(e,t){return await this.requestWithTracking("mark_all_notifications_read",e,t)}async markNotificationRead(e,t){return await this.requestWithTracking("mark_notification_read",e,t)}async mergeWorkblockBranch(e,t){return await this.requestWithTracking("merge_workblock_branch",e,t)}async messageChild(e,t){return await this.requestWithTracking("message_child",e,t)}async peekWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("peek_workblock_registration_events",e,t)}async permissionsGrant(e,t){return await this.requestWithTracking("permissions_grant",e,t)}async permissionsRevoke(e,t){return await this.requestWithTracking("permissions_revoke",e,t)}async prepareWorkblockVersionDataEnvironment(e,t){return await this.requestWithTracking("prepare_workblock_version_data_environment",e,t)}async promoteWorkblockDataModel(e,t){return await this.requestWithTracking("promote_workblock_data_model",e,t)}async publishToRegistry(e,t){return await this.requestWithTracking("publish_to_registry",e,t)}async recreateEditStream(e,t){return await this.requestWithTracking("recreate_edit_stream",e,t)}async reembedValidationSet(e,t){return await this.requestWithTracking("reembed_validation_set",e,t)}async registerWorkblockEvent(e,t){return await this.requestWithTracking("register_workblock_event",e,t)}async registrySearch(e,t){return await this.requestWithTracking("registry_search",e,t)}async registrySetParameters(e,t){return await this.requestWithTracking("registry_set_parameters",e,t)}async registrySetTags(e,t){return await this.requestWithTracking("registry_set_tags",e,t)}async rejectLearningData(e,t){return await this.requestWithTracking("reject_learning_data",e,t)}async rejectThreadWorkblock(e,t){return await this.requestWithTracking("reject_thread_workblock",e,t)}async remixWorkblockV2(e,t){return await this.requestWithTracking("remix_workblock_v2",e,t)}async removeGroupMember(e,t){return await this.requestWithTracking("remove_group_member",e,t)}async removeThread(e,t){return await this.requestWithTracking("remove_thread",e,t)}async removeWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("remove_workblock_data_environment_namespace",e,t)}async renameDataEnvironment(e,t){return await this.requestWithTracking("rename_data_environment",e,t)}async requestPermission(e,t){return await this.requestWithTracking("request_permission",e,t)}async resetTask(e,t){return await this.requestWithTracking("reset_task",e,t)}async resetWorkblockBranch(e,t){return await this.requestWithTracking("reset_workblock_branch",e,t)}async resetWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("reset_workblock_data_environment_namespace",e,t)}async resolveWorkblockMergeConflicts(e,t){return await this.requestWithTracking("resolve_workblock_merge_conflicts",e,t)}async restartStudioWorkspaceThread(e,t){return await this.requestWithTracking("restart_studio_workspace_thread",e,t)}async restartWorkblock(e,t){return await this.requestWithTracking("restart_workblock",e,t)}async resumeRetry(e,t){return await this.requestWithTracking("resume_retry",e,t)}async retryWorkblockDataModelApply(e,t){return await this.requestWithTracking("retry_workblock_data_model_apply",e,t)}async revertWorkblockCommit(e,t){return await this.requestWithTracking("revert_workblock_commit",e,t)}async revokeAllOauthConsents(e,t){return await this.requestWithTracking("revoke_all_oauth_consents",e,t)}async revokeOauthConsent(e,t){return await this.requestWithTracking("revoke_oauth_consent",e,t)}async revokeOauthRegistrationToken(e,t){return await this.requestWithTracking("revoke_oauth_registration_token",e,t)}async revokeWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("revoke_workblock_data_environment_start",e,t)}async rotateOauthClientSecret(e,t){return await this.requestWithTracking("rotate_oauth_client_secret",e,t)}async runModule(e,t){return await this.requestWithTracking("run_module",e,t)}async runSingleTask(e,t){return await this.requestWithTracking("run_single_task",e,t)}async runSubgraph(e,t){return await this.requestWithTracking("run_subgraph",e,t)}async runTask(e,t){return await this.requestWithTracking("run_task",e,t)}async runWorkblockReplayTests(e,t){return await this.requestWithTracking("run_workblock_replay_tests",e,t)}async runtimeAuthzAttachRole(e,t){return await this.requestWithTracking("runtime_authz_attach_role",e,t)}async runtimeAuthzDeleteRelation(e,t){return await this.requestWithTracking("runtime_authz_delete_relation",e,t)}async runtimeAuthzDetachRole(e,t){return await this.requestWithTracking("runtime_authz_detach_role",e,t)}async runtimeAuthzStoreRelation(e,t){return await this.requestWithTracking("runtime_authz_store_relation",e,t)}async sendCapturedEmail(e,t){return await this.requestWithTracking("send_captured_email",e,t)}async sendMessage(e,t){return await this.requestWithTracking("send_message",e,t)}async sendWorkblockNotification(e,t){return await this.requestWithTracking("send_workblock_notification",e,t)}async setActiveWorkblockSetting(e,t){return await this.requestWithTracking("set_active_workblock_setting",e,t)}async setAutoApproveConfig(e,t){return await this.requestWithTracking("set_auto_approve_config",e,t)}async setConsumptionLimits(e,t){return await this.requestWithTracking("set_consumption_limits",e,t)}async setEditing(e,t){return await this.requestWithTracking("set_editing",e,t)}async setEmailCapture(e,t){return await this.requestWithTracking("set_email_capture",e,t)}async setKeepOpenOnComplete(e,t){return await this.requestWithTracking("set_keep_open_on_complete",e,t)}async setLegalHold(e,t){return await this.requestWithTracking("set_legal_hold",e,t)}async setLogging(e,t){return await this.requestWithTracking("set_logging",e,t)}async setNotificationChannelMuted(e,t){return await this.requestWithTracking("set_notification_channel_muted",e,t)}async setOauthClientEnabled(e,t){return await this.requestWithTracking("set_oauth_client_enabled",e,t)}async setRetentionPolicy(e,t){return await this.requestWithTracking("set_retention_policy",e,t)}async setStudioWorkspaceArchived(e,t){return await this.requestWithTracking("set_studio_workspace_archived",e,t)}async setStudioWorkspaceThread(e,t){return await this.requestWithTracking("set_studio_workspace_thread",e,t)}async setUserSetting(e,t){return await this.requestWithTracking("set_user_setting",e,t)}async setWorkBlock(e,t){return await this.requestWithTracking("set_work_block",e,t)}async setWorkBlockV2(e,t){return await this.requestWithTracking("set_work_block_v2",e,t)}async setWorkblockCommitMessage(e,t){return await this.requestWithTracking("set_workblock_commit_message",e,t)}async setWorkblockConfig(e,t){return await this.requestWithTracking("set_workblock_config",e,t)}async setWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("set_workblock_run_data_truncation",e,t)}async setWorkblockSchedulePaused(e,t){return await this.requestWithTracking("set_workblock_schedule_paused",e,t)}async simulateCapturedEmailReply(e,t){return await this.requestWithTracking("simulate_captured_email_reply",e,t)}async sqlAuthorizationCloneCancel(e,t){return await this.requestWithTracking("sql_authorization_clone_cancel",e,t)}async sqlAuthorizationClonePrepare(e,t){return await this.requestWithTracking("sql_authorization_clone_prepare",e,t)}async sqlAuthorizationCloneStart(e,t){return await this.requestWithTracking("sql_authorization_clone_start",e,t)}async sqlAuthorizationConversionApprove(e,t){return await this.requestWithTracking("sql_authorization_conversion_approve",e,t)}async sqlAuthorizationConversionCancel(e,t){return await this.requestWithTracking("sql_authorization_conversion_cancel",e,t)}async sqlAuthorizationConversionPrepare(e,t){return await this.requestWithTracking("sql_authorization_conversion_prepare",e,t)}async sqlAuthorizationInstallApprove(e,t){return await this.requestWithTracking("sql_authorization_install_approve",e,t)}async sqlAuthorizationInstallCancel(e,t){return await this.requestWithTracking("sql_authorization_install_cancel",e,t)}async sqlAuthorizationInstallPrepare(e,t){return await this.requestWithTracking("sql_authorization_install_prepare",e,t)}async sqlAuthorizationNamespaceApprove(e,t){return await this.requestWithTracking("sql_authorization_namespace_approve",e,t)}async sqlAuthorizationNamespaceCancel(e,t){return await this.requestWithTracking("sql_authorization_namespace_cancel",e,t)}async sqlAuthorizationNamespacePrepare(e,t){return await this.requestWithTracking("sql_authorization_namespace_prepare",e,t)}async sqlAuthorizationNamespaceRetryCleanup(e,t){return await this.requestWithTracking("sql_authorization_namespace_retry_cleanup",e,t)}async startBranchThread(e,t){return await this.requestWithTracking("start_branch_thread",e,t)}async startChild(e,t){return await this.requestWithTracking("start_child",e,t)}async startWb(e,t){return await this.requestWithTracking("start_wb",e,t)}async storeWorkBlock(e,t){return await this.requestWithTracking("store_work_block",e,t)}async switchStreamBranch(e,t){return await this.requestWithTracking("switch_stream_branch",e,t)}async syncWorkblock(e,t){return await this.requestWithTracking("sync_workblock",e,t)}async syncWorkblockVersion(e,t){return await this.requestWithTracking("sync_workblock_version",e,t)}async temporalCancelWorkflow(e,t){return await this.requestWithTracking("temporal_cancel_workflow",e,t)}async temporalResetWorkflow(e,t){return await this.requestWithTracking("temporal_reset_workflow",e,t)}async temporalSignalWorkflow(e,t){return await this.requestWithTracking("temporal_signal_workflow",e,t)}async temporalTerminateWorkflow(e,t){return await this.requestWithTracking("temporal_terminate_workflow",e,t)}async transcribeAudio(e,t){return await this.requestWithTracking("transcribe_audio",e,t)}async triggerWorkblockSchedule(e,t){return await this.requestWithTracking("trigger_workblock_schedule",e,t)}async uninstallWorkblock(e,t){return await this.requestWithTracking("uninstall_workblock",e,t)}async updateAccessToken(e,t){return await this.requestWithTracking("update_access_token",e,t)}async updateAccount(e,t){return await this.requestWithTracking("update_account",e,t)}async updateCredential(e,t){return await this.requestWithTracking("update_credential",e,t)}async updateGroup(e,t){return await this.requestWithTracking("update_group",e,t)}async updateLearningExample(e,t){return await this.requestWithTracking("update_learning_example",e,t)}async updateOauthClient(e,t){return await this.requestWithTracking("update_oauth_client",e,t)}async updateProfile(e,t){return await this.requestWithTracking("update_profile",e,t)}async updateStudioWorkspaceTitle(e,t){return await this.requestWithTracking("update_studio_workspace_title",e,t)}async updateTask(e,t){return await this.requestWithTracking("update_task",e,t)}async updateUser(e,t){return await this.requestWithTracking("update_user",e,t)}async updateWorkblockEntityStoreRow(e,t){return await this.requestWithTracking("update_workblock_entity_store_row",e,t)}async updateWorkblockSchedule(e,t){return await this.requestWithTracking("update_workblock_schedule",e,t)}async upsertSpace(e,t){return await this.requestWithTracking("upsert_space",e,t)}async addLearningData(e,t){return await this.client.sendMessage({type:"add_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async addStreamLogs(e,t){return await this.client.sendMessage({type:"add_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDiffVersions(e,t){return await this.client.sendMessage({type:"authz_schema_diff_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftGetEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGet(e,t){return await this.client.sendMessage({type:"authz_schema_get",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetAppliedEnvelope(e,t){return await this.client.sendMessage({type:"authz_schema_get_applied_envelope",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetDraftState(e,t){return await this.client.sendMessage({type:"authz_schema_get_draft_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetForWorkblock(e,t){return await this.client.sendMessage({type:"authz_schema_get_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetVersion(e,t){return await this.client.sendMessage({type:"authz_schema_get_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaImpactReport(e,t){return await this.client.sendMessage({type:"authz_schema_impact_report",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListOrphanedResources(e,t){return await this.client.sendMessage({type:"authz_schema_list_orphaned_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListRoleMemberships(e,t){return await this.client.sendMessage({type:"authz_schema_list_role_memberships",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListVersions(e,t){return await this.client.sendMessage({type:"authz_schema_list_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaPreviewValidation(e,t){return await this.client.sendMessage({type:"authz_schema_preview_validation",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaQueryAudit(e,t){return await this.client.sendMessage({type:"authz_schema_query_audit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaValidate(e,t){return await this.client.sendMessage({type:"authz_schema_validate",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchCheckWorkblockMergeability(e,t){return await this.client.sendMessage({type:"batch_check_workblock_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchGetEvents(e,t){return await this.client.sendMessage({type:"batch_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async changelogList(e,t){return await this.client.sendMessage({type:"changelog_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkChild(e,t){return await this.client.sendMessage({type:"check_child",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkCredential(e,t){return await this.client.sendMessage({type:"check_credential",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkPermission(e,t){return await this.client.sendMessage({type:"check_permission",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkStreamAccess(e,t){return await this.client.sendMessage({type:"check_stream_access",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkWorkblockBranchMergeability(e,t){return await this.client.sendMessage({type:"check_workblock_branch_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async closeWorkblockRunDataSession(e,t){return await this.client.sendMessage({type:"close_workblock_run_data_session",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async consoleLog(e,t){return await this.client.sendMessage({type:"console_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async countWorkblockRegistrationEvents(e,t){return await this.client.sendMessage({type:"count_workblock_registration_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async createWorkblockTokenUrl(e,t){return await this.client.sendMessage({type:"create_workblock_token_url",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async diffWorkblockReplayTest(e,t){return await this.client.sendMessage({type:"diff_workblock_replay_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async discoverCredentialOauth(e,t){return await this.client.sendMessage({type:"discover_credential_oauth",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async evaluateWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"evaluate_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findLearningDuplicates(e,t){return await this.client.sendMessage({type:"find_learning_duplicates",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findStudioWorkspaceOnBranch(e,t){return await this.client.sendMessage({type:"find_studio_workspace_on_branch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findWorkblockRows(e,t){return await this.client.sendMessage({type:"find_workblock_rows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAccount(e,t){return await this.client.sendMessage({type:"get_account",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getActiveWorkblockSetting(e,t){return await this.client.sendMessage({type:"get_active_workblock_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAffectedRunsCount(e,t){return await this.client.sendMessage({type:"get_affected_runs_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAgentTurn(e,t){return await this.client.sendMessage({type:"get_agent_turn",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAutoApproveConfig(e,t){return await this.client.sendMessage({type:"get_auto_approve_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAvailableModels(e,t){return await this.client.sendMessage({type:"get_available_models",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getBaseWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_base_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getCapturedEmail(e,t){return await this.client.sendMessage({type:"get_captured_email",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getConsumptionStatus(e,t){return await this.client.sendMessage({type:"get_consumption_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getCredentialForEdit(e,t){return await this.client.sendMessage({type:"get_credential_for_edit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDefaultWorkblockRegistration(e,t){return await this.client.sendMessage({type:"get_default_workblock_registration",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDocsContent(e,t){return await this.client.sendMessage({type:"get_docs_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEditStreamId(e,t){return await this.client.sendMessage({type:"get_edit_stream_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEvents(e,t){return await this.client.sendMessage({type:"get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getInstalledWorkblock(e,t){return await this.client.sendMessage({type:"get_installed_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExample(e,t){return await this.client.sendMessage({type:"get_learning_example",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExamples(e,t){return await this.client.sendMessage({type:"get_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLlmRawCall(e,t){return await this.client.sendMessage({type:"get_llm_raw_call",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLoginHistory(e,t){return await this.client.sendMessage({type:"get_login_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getPendingLearningData(e,t){return await this.client.sendMessage({type:"get_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblock(e,t){return await this.client.sendMessage({type:"get_registry_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblockInfo(e,t){return await this.client.sendMessage({type:"get_registry_workblock_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getReplayTestRunState(e,t){return await this.client.sendMessage({type:"get_replay_test_run_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRetentionPolicy(e,t){return await this.client.sendMessage({type:"get_retention_policy",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpace(e,t){return await this.client.sendMessage({type:"get_space",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpaceId(e,t){return await this.client.sendMessage({type:"get_space_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStream(e,t){return await this.client.sendMessage({type:"get_stream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStreamLogs(e,t){return await this.client.sendMessage({type:"get_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspace(e,t){return await this.client.sendMessage({type:"get_studio_workspace",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspacePresence(e,t){return await this.client.sendMessage({type:"get_studio_workspace_presence",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTaskLogs(e,t){return await this.client.sendMessage({type:"get_task_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineAffectedCount(e,t){return await this.client.sendMessage({type:"get_timeline_affected_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineEventTypes(e,t){return await this.client.sendMessage({type:"get_timeline_event_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTos(e,t){return await this.client.sendMessage({type:"get_tos",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUserSetting(e,t){return await this.client.sendMessage({type:"get_user_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUsers(e,t){return await this.client.sendMessage({type:"get_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkBlockRuns(e,t){return await this.client.sendMessage({type:"get_work_block_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblock(e,t){return await this.client.sendMessage({type:"get_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockBranchInfo(e,t){return await this.client.sendMessage({type:"get_workblock_branch_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitLog(e,t){return await this.client.sendMessage({type:"get_workblock_commit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitPatch(e,t){return await this.client.sendMessage({type:"get_workblock_commit_patch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockConfig(e,t){return await this.client.sendMessage({type:"get_workblock_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModel(e,t){return await this.client.sendMessage({type:"get_workblock_data_model",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelDeployPreview(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_deploy_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelRunReadiness(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_run_readiness",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelStatus(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataSchema(e,t){return await this.client.sendMessage({type:"get_workblock_data_schema",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockFileContent(e,t){return await this.client.sendMessage({type:"get_workblock_file_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockHistoryBundle(e,t){return await this.client.sendMessage({type:"get_workblock_history_bundle",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockMissingCredentials(e,t){return await this.client.sendMessage({type:"get_workblock_missing_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsConsumption(e,t){return await this.client.sendMessage({type:"get_workblock_operations_consumption",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsCurrent(e,t){return await this.client.sendMessage({type:"get_workblock_operations_current",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsFailures(e,t){return await this.client.sendMessage({type:"get_workblock_operations_failures",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsOutcomes(e,t){return await this.client.sendMessage({type:"get_workblock_operations_outcomes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsRpc(e,t){return await this.client.sendMessage({type:"get_workblock_operations_rpc",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsRuns(e,t){return await this.client.sendMessage({type:"get_workblock_operations_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRun(e,t){return await this.client.sendMessage({type:"get_workblock_run",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunDataSchemaVersionDetails(e,t){return await this.client.sendMessage({type:"get_workblock_run_data_schema_version_details",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunInputs(e,t){return await this.client.sendMessage({type:"get_workblock_run_inputs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunResult(e,t){return await this.client.sendMessage({type:"get_workblock_run_result",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockSchedule(e,t){return await this.client.sendMessage({type:"get_workblock_schedule",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockTaskErrors(e,t){return await this.client.sendMessage({type:"get_workblock_task_errors",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUi(e,t){return await this.client.sendMessage({type:"get_workblock_ui",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUpstream(e,t){return await this.client.sendMessage({type:"get_workblock_upstream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockV2(e,t){return await this.client.sendMessage({type:"get_workblock_v2",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeCatalog(e,t){return await this.client.sendMessage({type:"graphlake_catalog",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeExplore(e,t){return await this.client.sendMessage({type:"graphlake_explore",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeIntrospect(e,t){return await this.client.sendMessage({type:"graphlake_introspect",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeNode(e,t){return await this.client.sendMessage({type:"graphlake_node",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeQuery(e,t){return await this.client.sendMessage({type:"graphlake_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeSearchNodes(e,t){return await this.client.sendMessage({type:"graphlake_search_nodes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiQuery(e,t){return await this.client.sendMessage({type:"graphlake_ui_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiSubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_subscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiUnsubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_unsubscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async help(e,t){return await this.client.sendMessage({type:"help",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async inspectFile(e,t){return await this.client.sendMessage({type:"inspect_file",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async invokeTask(e,t){return await this.client.sendMessage({type:"invoke_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listAccessTokens(e,t){return await this.client.sendMessage({type:"list_access_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listApprovedLearningSets(e,t){return await this.client.sendMessage({type:"list_approved_learning_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCapturedEmails(e,t){return await this.client.sendMessage({type:"list_captured_emails",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCategories(e,t){return await this.client.sendMessage({type:"list_categories",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentialTypes(e,t){return await this.client.sendMessage({type:"list_credential_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentials(e,t){return await this.client.sendMessage({type:"list_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listExportedWorkblocks(e,t){return await this.client.sendMessage({type:"list_exported_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroupMembers(e,t){return await this.client.sendMessage({type:"list_group_members",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroups(e,t){return await this.client.sendMessage({type:"list_groups",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listInstalledWorkblocks(e,t){return await this.client.sendMessage({type:"list_installed_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningDataSets(e,t){return await this.client.sendMessage({type:"list_learning_data_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamples(e,t){return await this.client.sendMessage({type:"list_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamplesByScore(e,t){return await this.client.sendMessage({type:"list_learning_examples_by_score",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningSetsForWorkblock(e,t){return await this.client.sendMessage({type:"list_learning_sets_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLlmRawCalls(e,t){return await this.client.sendMessage({type:"list_llm_raw_calls",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyOauthConsents(e,t){return await this.client.sendMessage({type:"list_my_oauth_consents",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyPermissionRequests(e,t){return await this.client.sendMessage({type:"list_my_permission_requests",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotificationChannels(e,t){return await this.client.sendMessage({type:"list_notification_channels",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotifications(e,t){return await this.client.sendMessage({type:"list_notifications",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthClients(e,t){return await this.client.sendMessage({type:"list_oauth_clients",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthRegistrationTokens(e,t){return await this.client.sendMessage({type:"list_oauth_registration_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOwnedRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_owned_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listPendingLearningData(e,t){return await this.client.sendMessage({type:"list_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listQdrantCollections(e,t){return await this.client.sendMessage({type:"list_qdrant_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRowstoreCollections(e,t){return await this.client.sendMessage({type:"list_rowstore_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listSpaces(e,t){return await this.client.sendMessage({type:"list_spaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listStudioWorkspaces(e,t){return await this.client.sendMessage({type:"list_studio_workspaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockBranches(e,t){return await this.client.sendMessage({type:"list_workblock_branches",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentCloneOperations(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_clone_operations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartOptions(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_options",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironments(e,t){return await this.client.sendMessage({type:"list_workblock_data_environments",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDefinitions(e,t){return await this.client.sendMessage({type:"list_workblock_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockEntityStoreSavedQueries(e,t){return await this.client.sendMessage({type:"list_workblock_entity_store_saved_queries",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockPermissionRequests(e,t){return await this.client.sendMessage({type:"list_workblock_permission_requests",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRegistrations(e,t){return await this.client.sendMessage({type:"list_workblock_registrations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRowCollections(e,t){return await this.client.sendMessage({type:"list_workblock_row_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataSchemaVersions(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_schema_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataTruncations(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_truncations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunners(e,t){return await this.client.sendMessage({type:"list_workblock_runners",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockSchedules(e,t){return await this.client.sendMessage({type:"list_workblock_schedules",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockVersions(e,t){return await this.client.sendMessage({type:"list_workblock_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsCheck(e,t){return await this.client.sendMessage({type:"permissions_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsDefinitions(e,t){return await this.client.sendMessage({type:"permissions_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsListSubjects(e,t){return await this.client.sendMessage({type:"permissions_list_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsLookupResources(e,t){return await this.client.sendMessage({type:"permissions_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async previewContinueFromMessage(e,t){return await this.client.sendMessage({type:"preview_continue_from_message",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryAuditLog(e,t){return await this.client.sendMessage({type:"query_audit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockEntityStore(e,t){return await this.client.sendMessage({type:"query_workblock_entity_store",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockRunData(e,t){return await this.client.sendMessage({type:"query_workblock_run_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async repeatDone(e,t){return await this.client.sendMessage({type:"repeat_done",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockByTask(e,t){return await this.client.sendMessage({type:"resolve_workblock_by_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockContent(e,t){return await this.client.sendMessage({type:"resolve_workblock_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzCheck(e,t){return await this.client.sendMessage({type:"runtime_authz_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupResources(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupSubjects(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTest(e,t){return await this.client.sendMessage({type:"sandbox_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTestResponse(e,t){return await this.client.sendMessage({type:"sandbox_test_response",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async searchLearningExamples(e,t){return await this.client.sendMessage({type:"search_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskProgress(e,t){return await this.client.sendMessage({type:"send_task_progress",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskRunEvent(e,t){return await this.client.sendMessage({type:"send_task_run_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setAgentComplete(e,t){return await this.client.sendMessage({type:"set_agent_complete",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"set_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationCloneGetPlan(e,t){return await this.client.sendMessage({type:"sql_authorization_clone_get_plan",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationConversionPreview(e,t){return await this.client.sendMessage({type:"sql_authorization_conversion_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationGetPlan(e,t){return await this.client.sendMessage({type:"sql_authorization_get_plan",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationInstallPreview(e,t){return await this.client.sendMessage({type:"sql_authorization_install_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationNamespaceGetPlan(e,t){return await this.client.sendMessage({type:"sql_authorization_namespace_get_plan",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sqlAuthorizationStatus(e,t){return await this.client.sendMessage({type:"sql_authorization_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalExportHistory(e,t){return await this.client.sendMessage({type:"temporal_export_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetStack(e,t){return await this.client.sendMessage({type:"temporal_get_stack",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetWorkflow(e,t){return await this.client.sendMessage({type:"temporal_get_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalListWorkflowTypes(e,t){return await this.client.sendMessage({type:"temporal_list_workflow_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalQueryWorkflow(e,t){return await this.client.sendMessage({type:"temporal_query_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalSearchWorkflows(e,t){return await this.client.sendMessage({type:"temporal_search_workflows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalStreamHistory(e,t){return await this.client.sendMessage({type:"temporal_stream_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async upsertMemo(e,t){return await this.client.sendMessage({type:"upsert_memo",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateTask(e,t){return await this.client.sendMessage({type:"validate_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateWorkblock(e,t){return await this.client.sendMessage({type:"validate_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async wbRunTest(e,t){return await this.client.sendMessage({type:"wb_run_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async workblockReleaseList(e,t){return await this.client.sendMessage({type:"workblock_release_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsGetEvents(e,t){return await this.client.sendMessage({type:"yjs_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsResetEvents(e,t){return await this.client.sendMessage({type:"yjs_reset_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_stream_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async requestWithTracking(e,t,i){let n=Date.now(),r={...this.analyticsClient?.now?.(),...this.requestAnalyticsContext(i),trigger:i?.trigger??"user",stream_id:i?.streamId,thread_id:i?.threadId,...this.sanitizeForAnalytics(t)};try{let a=await this.client.sendMessage({type:e,stream_id:i?.streamId,thread_id:i?.threadId,timeout:i?.timeoutSeconds,task_id:i?.taskId,model:i?.model,reasoning_effort:i?.reasoningEffort,request:t});return this.trackEventSafely(`user-action/${e}`,{...r,...typeof i?.analyticsContext=="function"?this.requestAnalyticsContext(i,a):{},...this.resultIdsForAnalytics(e,a),...this.mergeOutcomeForAnalytics(e,a),success:!0,duration_ms:Date.now()-n}),a}catch(a){throw this.trackEventSafely(`user-action/${e}`,{...r,success:!1,duration_ms:Date.now()-n,error_type:a instanceof Error?a.name:"Unknown",error_code:a instanceof Error&&"code"in a&&typeof a.code=="string"&&a.code?a.code:void 0}),a}}requestAnalyticsContext(e,t){try{return typeof e?.analyticsContext=="function"?e.analyticsContext(t):e?.analyticsContext??{}}catch{return{}}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(i){console.error("Analytics tracking failed:",i)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[i,n]of Object.entries(e))(i.endsWith("_id")||i.endsWith("_ids")||i==="id")&&(t[hc(i)]=n);return t}resultIdsForAnalytics(e,t){if(!t||typeof t!="object"||Array.isArray(t))return{};let i=t,n={},r=Gw[e]??[];for(let a of r){let o=i[a];typeof o=="string"?n[`result_${hc(a)}`]=o:o&&typeof o=="object"&&"id"in o&&typeof o.id=="string"&&(n[`result_${hc(a)}_id`]=o.id)}return n}mergeOutcomeForAnalytics(e,t){if(!t||typeof t!="object")return{};let i={};return"merge_success"in t&&typeof t.merge_success=="boolean"?i.merge_success=t.merge_success:(e==="accept_thread_workblock"||e==="merge_workblock_branch"||e==="revert_workblock_commit")&&"success"in t&&typeof t.success=="boolean"&&(i.merge_success=t.success),"conflict_files"in t&&Array.isArray(t.conflict_files)&&(i.conflict_count=t.conflict_files.length),i}};var Us=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Fe=180,qi=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];pushHandlers=new Map;ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new hr({sendMessage:e=>this.send(e)});constructor(e=!1){this.debug=e}addStreamHandler(e){this.streamHandlers.push(e)}addEventHandler(e){this.eventHandlers.push(e)}addCurrentUserHandler(e){this.currentUserHandlers.push(e)}addErrorHandler(e){this.errorHandlers.push(e)}addConnectionErrorHandler(e){this.connectionErrorHandlers.push(e)}addOnDisconnect(e){this.onDisconnect.push(e)}useTokenSource(e){this.tokenSource=e}addPushHandler(e,t){this.pushHandlers.set(e,[...this.pushHandlers.get(e)??[],t])}close(){this.closing=!0,this.ws?.close()}connect(e,t){this.connectionHost=e,this.lastConnectionError=void 0,this.connected=!1,this.closing=!1,e.indexOf("://")===-1&&(e=`https://${e}`),this.token=t;let i=new URL(e);i.protocol==="ws:"?i.protocol="http:":i.protocol==="wss:"&&(i.protocol="https:"),!i.hostname.startsWith("api.")&&!i.hostname.startsWith("localhost")&&(i.hostname=`api.${i.hostname}`),i.pathname=i.pathname.replace("/workblocks/streams",""),i.pathname.endsWith("/")&&(i.pathname=i.pathname.slice(0,-1)),i.pathname=i.pathname+"/blobs",this.blobURL=i.toString();let n=new URL(e);switch(n.protocol){case"https:":n.protocol="wss:";break;case"http:":n.protocol="ws:";break}!n.hostname.startsWith("api.")&&!n.hostname.startsWith("localhost")&&(n.hostname=`api.${n.hostname}`),n.pathname.endsWith("/streams")||(n.pathname="/workblocks/streams"),this.connectionUrl=n.toString();let r=new dr(n.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=r,r.on("open",()=>{this.ws===r&&(this.connected=!0,this.lastConnectionError=void 0)}),r.on("unexpected-response",(a,o)=>{this.ws===r&&this.reportConnectionError(`Unexpected server response: ${o.statusCode}`,o.statusCode),r.terminate()}),r.on("message",a=>{if(this.ws!==r)return;let o=JSON.parse(a.toString());if(this.debug&&console.error("Received message","type"in o?o.type:"error","reply_to"in o?o.reply_to:void 0),"reply_to"in o){if(o.reply_to===void 0)return;let c=this.store[o.reply_to];c&&(delete this.store[o.reply_to],clearTimeout(c.timeoutHandle),"error"in o?c.reject(new Us(o.error,o.error_type??"")):c.resolve(o.response));return}if("error"in o){this.errorHandlers.forEach(c=>c(o.error));return}o.type==="streams"?this.handleListStreams(o.response):o.type==="events"?this.handleEvents(o.response).catch(c=>{console.error(c)}):o.type==="whoami"&&this.handleCurrentUser(o.response),this.pushHandlers.get(o.type)?.forEach(c=>{try{c(o.response)}catch(u){console.error(u)}})}),r.on("close",(a,o)=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(`Connection closed before it was established. Code: ${a}, Reason: ${o||"none"}`),this.rejectAllPending(new Error(`WebSocket disconnected. Code: ${a}, Reason: ${o}`)),this.onDisconnect.forEach(c=>c()))}),r.on("error",async a=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(a.message),this.rejectAllPending(new Error(`WebSocket error: ${a.message}`)))})}waitForOpen(){if(this.connected)return Promise.resolve();let e=this.ws;return e?e.readyState===dr.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,i)=>{let n=()=>{c(),t()},r=u=>{c(),i(new Error(`WebSocket error: ${u.message}`))},a=(u,l)=>{c(),i(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},o=(u,l)=>{c(),i(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",n),e.removeListener("error",r),e.removeListener("unexpected-response",a),e.removeListener("close",o)};e.on("open",n),e.on("error",r),e.on("unexpected-response",a),e.on("close",o)}):Promise.reject(new Error("WebSocket not connected"))}fetchWithCache(e,t){return fetch(e,t)}async _send(e,t){return this.ws&&this.ws.readyState===dr.OPEN?(this.SequenceID++,new Promise((i,n)=>{let r=this.SequenceID,a=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,o=setTimeout(()=>{let c=this.store[r];c&&(delete this.store[r],c.reject(new Error(`Request timed out after ${a}ms${c.type?` (type=${c.type})`:""}`)))},a);this.store[r]={resolve:i,reject:n,timeoutHandle:o,type:e.type},this.ws?.send(JSON.stringify({...e,seq:r}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,i={}){let n=i.timeoutSeconds;return await this._send({type:e,stream_id:i.streamId,timeout:n,request:t},n===void 0?void 0:(n+5)*1e3)}async send(e){let t=e.timeout===void 0?void 0:(e.timeout+5)*1e3;return await this._send(e,t)}async setWorkblock(e,t){let i=await this.requests.setWorkBlockV2({workblock:t},{streamId:e,timeoutSeconds:Fe});return{errors:i.errors??[],warnings:i.warnings??[]}}async getWorkblock(e){return await this.requests.getWorkblock({},{streamId:e})??void 0}async getWorkblockById(e){return await this.requests.getWorkblock({id:e})??void 0}async storeWorkblock(e){let t;try{if(t=await this.getWorkblockById(e.id),!t)throw new Error(`Workblock lookup for ${e.id} returned no definition`)}catch(r){if(!(r instanceof Us&&r.code==="NotFound"))throw r;t=void 0}if(!t)return await this.createWorkblock(e);let i=await this.requests.getEditStream({workblock_id:e.id}),n=await this.setWorkblock(i.id,e);if(n.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(n.errors)}`);return{stream:i,warnings:n.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Fe})}async createWorkblock(e,t){let i=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Fe});if(i.errors?.length)throw new Error(`Validation errors: ${JSON.stringify(i.errors)}`);return{stream:i.stream,warnings:i.warnings??[]}}async listWorkblockDefinitions(){return await this.requests.listWorkblockDefinitions({include_branches:!0})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}async listWorkblockDataEnvironments(e){return await this.requests.listWorkblockDataEnvironments({workblock_id:e})}async queryWorkblockEntityStore(e){return await this.requests.queryWorkblockEntityStore(e)}async listWorkblockEntityStoreSavedQueries(e){return await this.requests.listWorkblockEntityStoreSavedQueries(e)}async getSpace(e){return await this.requests.getSpace({slug:e})}async getActiveWorkblockSetting(e){return(await this.requests.getActiveWorkblockSetting({workblock_id:e})).branch}async setActiveWorkblockSetting(e,t){await this.requests.setActiveWorkblockSetting({workblock_id:e,branch:t})}async createStudioWorkspace(e,t,i,n=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:i,create_user_branch:n})).stream}async createWorkblockVersion(e,t,i,n){return(await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,source_ref:i,workspace_name:n},{timeoutSeconds:Fe})).stream}async findStudioWorkspaceOnBranch(e,t){return(await this.requests.findStudioWorkspaceOnBranch({workblock_id:e,target_branch:t})).stream_id}async getStudioWorkspace(e){return(await this.requests.getStudioWorkspace({stream_id:e})).workspace??void 0}async listStudioWorkspaces(e,t){if(!e&&!t)throw new Error("listStudioWorkspaces requires a user id or a workblock id");return(await this.requests.listStudioWorkspaces({user_id:e,workblock_id:t})).workspaces??[]}async getBlob(e){return this.debug&&console.error(`Getting blob ${e}`),e.startsWith("::bw:data:")?(await this.getBlobContent(e)).text:e}async getBlobContent(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",text:await t.text()}}async getBlobBytes(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",bytes:new Uint8Array(await t.arrayBuffer())}}async fetchBlob(e){let t=this.tokenSource?await this.tokenSource():this.token,i=await this.fetchWithCache(`${this.blobURL}?key=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`Failed to fetch blob ${e}: ${i.status} ${i.statusText}`);return i}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,i)=>{let n=setTimeout(()=>i(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(r=>{clearTimeout(n),t(r)})})}async getWorkblockV2ById(e){return await this.requests.getWorkblockV2({id:e,resolve_blobs:!0})??void 0}async resolveWorkblockContent(e,t){return await this.requests.resolveWorkblockContent({workblock_id:e,commit_ref:t})}async setWorkblockV2(e,t,i){return await this.requests.setWorkBlockV2({workblock:t,branch:i.branch,expected_commit_ref:i.expectedCommitRef,advance_version:i.advanceVersion||void 0,commit_message:i.commitMessage},{streamId:e,timeoutSeconds:Fe})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Fe})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Fe})}async checkWorkblockBranchMergeability(e,t,i,n={}){return await this.requests.checkWorkblockBranchMergeability({workblock_id:e,base_branch:t,head_branch:i,compute_file_merges:n.computeFileMerges||void 0},{timeoutSeconds:Fe})}async mergeWorkblockBranch(e,t,i,n={}){return await this.requests.mergeWorkblockBranch({workblock_id:e,base_branch:t,head_branch:i,commit_message:n.commitMessage},{streamId:n.streamId,timeoutSeconds:Fe})}async resolveWorkblockMergeConflicts(e,t,i,n,r){return await this.requests.resolveWorkblockMergeConflicts({workblock_id:e,base_branch:t,head_branch:i,resolved_files:n,base_branch_commit:r.baseBranchCommit,head_branch_commit:r.headBranchCommit,commit_message:r.commitMessage},{streamId:r.streamId,timeoutSeconds:Fe})}async resetWorkblockBranch(e,t,i,n){await this.requests.resetWorkblockBranch({workblock_id:e,branch_name:t,source_ref:i,expected_commit_ref:n})}async setWorkblockCommitMessage(e,t,i){await this.requests.setWorkblockCommitMessage({workblock_id:e,commit_hash:t,title:i.split(`
153
153
  `)[0],message:i})}async getWorkblockCommitLog(e,t,i){return(await this.requests.getWorkblockCommitLog({workblock_id:e,ref:t,max_count:i})).entries}async getWorkblockHistoryBundle(e,t){return await this.requests.getWorkblockHistoryBundle({workblock_id:e,branch:t})}async getWorkspaceWorkblock(e){return await this.requests.getWorkblockV2({},{streamId:e})??void 0}async getWorkspaceWorkblockWithBlobs(e){return await this.requests.getWorkblockV2({resolve_blobs:!0},{streamId:e})??void 0}async getDocsContent(){return(await this.requests.getDocsContent({})).content}async runModule(e,t,i){let n=await this.requests.runModule({module_id:t,inputs:i},{streamId:e});if(!n.run_id)throw new Error(`Module ${t} is UI-only and starts no run. Open it in Studio or in a Space.`);return n.run_id}async runSingleTask(e,t,i,n,r){return await this.requests.runSingleTask({module_id:t,task_id:i,run_id:n,inputs:r},{streamId:e})}async invokeWorkblockTask(e){return(await this.requests.invokeWorkblockTask({workblock_id:e.workblockId,module_id:e.moduleId,task_id:e.taskId,commit_ref:e.commitRef,inputs:e.inputs},{streamId:e.streamId,timeoutSeconds:e.timeoutSeconds})).outputs??{}}async runModuleTests(e,t,i,n){return(await this.requests.wbRunTest({module_id:i,workblock_id:t,test_ids:n},{streamId:e,timeoutSeconds:Fe})).result??[]}async getWorkblockRun(e){return await this.requests.getWorkblockRun({id:e.runId,stream_id:e.runId?void 0:e.streamId,include_ephemeral:!0,nil_on_no_run:!0})??void 0}async getTaskLogs(e,t){return await this.requests.getTaskLogs({run_id:e,task_id:t})??[]}async cancelWorkblockRun(e,t){await this.requests.cancelWb({workblock_run_id:t},{streamId:e})}async getStream(e){return await this.requests.getStream({id:e,nil_on_not_found:!0})??void 0}async getMessageEvents(e,t,i){return await this.requests.getEvents({type:["message"],limit:t,asc:!1,before_id:i},{streamId:e})??[]}async sendChatMessage(e){await this.requests.sendMessage({body:e.body,agent:e.workblockId,agent_module_id:e.moduleId,agent_config_id:e.agentConfigId,agent_load_ref:e.loadRef,module_inputs:e.inputs},{streamId:e.streamId,threadId:e.threadId})}async sendToAgent(e){await this.requests.sendMessage({body:e.body,client_message_id:e.clientMessageId,agent_config_id:e.agentConfigId},{streamId:e.agentStreamId})}async cancelAgent(e,t){await this.requests.cancelAgent({thread_id:t},{streamId:e})}disconnect(){this.connected=!1,this.closing=!0,this.rejectAllPending(new Error("WebSocket disconnected")),this.ws?.close(),this.streamHandlers=[],this.eventHandlers=[],this.currentUserHandlers=[],this.pushHandlers=new Map,this.store={},this.SequenceID=0}handleListStreams(e){let t=[];(e??[]).forEach(i=>{i.editing&&t.push(i)}),this.streamHandlers.forEach(i=>i(t))}async handleEvents(e){for(let t of this.eventHandlers)await t(e)}handleCurrentUser(e){this.currentUser=e,this.currentUserHandlers.forEach(t=>t(e))}rejectAllPending(e){for(let[t,i]of Object.entries(this.store))i&&(clearTimeout(i.timeoutHandle),i.reject(e),delete this.store[Number(t)])}reportConnectionError(e,t){this.lastConnectionError=e,this.connectionErrorHandlers.forEach(i=>i({host:this.connectionHost,url:this.connectionUrl,reason:e,statusCode:t}))}};var Nh=3600*1e3,Kw=600*1e3;function Jw(s){return typeof s=="object"&&s!==null&&"data"in s&&typeof s.data=="string"&&"timestamp"in s&&typeof s.timestamp=="number"}var fr=class extends qi{context;constructor(e=!0){super(e)}connect(e,t,i){this.context=i,super.connect(e,t),this.ws?.on("open",()=>{this.cleanupExpiredCache().catch(console.error),this.lastCleanup=Date.now()}),this.ws?.on("close",(n,r)=>{this.connected&&mr.window.showErrorMessage(`WebSocket disconnected. Code: ${n}, Reason: ${r}`)}),this.ws?.on("error",n=>{this.connected&&mr.window.showErrorMessage(`WebSocket error: ${n.message}`)})}async fetchWithCache(e,t){let i=Date.now();i-this.lastCleanup>Kw&&(await this.cleanupExpiredCache(),this.lastCleanup=i);let n=`${e}${JSON.stringify(t)}`;try{let r=this.context?.globalState.get(n);if(r&&Date.now()-r.timestamp<Nh)return new Response(r.data);let a=await fetch(e,t),o=await a.text();return a.ok&&await this.context?.globalState.update(n,{data:o,timestamp:Date.now()}),new Response(o,a)}catch(r){return mr.window.showErrorMessage(`Cache error: ${r}`),fetch(e,t)}}async cleanupExpiredCache(){if(!this.context)return;let e=this.context.globalState.keys(),t=Date.now();for(let i of e){let n=this.context.globalState.get(i);Jw(n)&&t-n.timestamp>Nh&&await this.context.globalState.update(i,void 0)}}};var W=F(require("vscode"));var fc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Yw=new RegExp(`^(.+)@users/${fc}$`,"i"),Zw=new RegExp(`^.+@stream/${fc}$`,"i"),Ch=new RegExp(`@thread/${fc}$`,"i"),Qw="AlreadyExists",Xw="PermissionDenied";var ey="already exists on this branch";function St(s){return s.replace(Ch,"")}function ty(s){return Ch.test(s)}function Nt(s){return s?Zw.test(St(s)):!1}function Pi(s){return s.startsWith("features/")&&s!=="features/"&&!s.includes("@users/")&&!s.includes("@stream/")&&!s.includes("@thread/")}function es(s){let e=St(s),t=e.lastIndexOf("@stream/");if(t!==-1)return e.slice(0,t);let i=e.lastIndexOf("@users/");return i!==-1?e.slice(0,i):e}function ts(s){return es(s).replace(/^features\//,"")}function gr(s){let e=es(s);return Pi(e)?e:void 0}function sy(s){if(ty(s)||Nt(s))return;let e=s.match(Yw);return e?{branch:e[1],createUserBranch:!0}:{branch:s,createUserBranch:!1}}function Rh(s){return!s.archived&&Nt(s.branch)}function iy(s,e){return s.filter(t=>Rh(t)&&es(t.branch??"")===e).reduce((t,i)=>{if(!t)return i;let n=Date.parse(t.updated_at||t.created_at);return Date.parse(i.updated_at||i.created_at)>n?i:t},void 0)}function Ah(s,e,t){let i=new Map(e.map(r=>[r.name,r])),n=new Map(s.map(r=>[r.name,r]));for(let r of t){if(!r.branch||!Rh(r))continue;let a=i.get(r.branch);a&&n.set(a.name,{...a,workspace:r})}return[...n.values()]}function Ih(s){if(typeof s=="object"&&s!==null&&"code"in s){let e=s.code;if(typeof e=="string")return e}}function br(s){return s instanceof Error?s.message:String(s)}function Th(s){return Ih(s)===Qw||br(s).includes(ey)}function ny(s){return Ih(s)===Xw}async function mc(s,e,t){try{return{ok:!0,value:await s}}catch(i){return e?.(`[workspace] ${t??"request"} failed: ${br(i)}`),{ok:!1,error:i}}}async function Oh(s,e,t,i){let n=await mc(s,t,i);return n.ok?n.value:e}async function Eh(s,e,t){try{await s.getStudioWorkspace(e);return}catch(r){if(!ny(r)){t.log?.(`[workspace] could not verify access to ${e}: ${br(r)}`);return}}let i=(await Oh(s.listStudioWorkspaces(void 0,t.workblockId),[],t.log,"list_studio_workspaces")).find(r=>r.id===e),n=i?.title?.trim()?`"${i.title.trim()}"`:e;throw new Error(`Branch ${t.branch} is open in Studio workspace ${n}, which you are not a member of. Ask its owner to share it, or work on your own branch.`)}async function gc(s,e){let{workblockId:t,branch:i,log:n}=e,r=St(i),a=await mc(s.findStudioWorkspaceOnBranch(t,r),n,"find_studio_workspace_on_branch"),o=a.ok?void 0:a.error,c=a.ok?a.value:void 0;if(c)return await Eh(s,c,e),{streamId:c,created:!1};let u=sy(i);if(!u)throw o?new Error(`Could not look up the Studio workspace for ${i}: ${br(o)}`):new Error(`No active Studio workspace on ${i}. Open ${es(i)} instead to start a new conversation on it.`);let l=e.title,d=!u.createUserBranch&&Pi(u.branch);if(d){let p=e.userId?await mc(s.listStudioWorkspaces(e.userId,t),n,"list_studio_workspaces"):{ok:!0,value:[]};if(p.ok){let h=iy(p.value,u.branch);if(h?.branch){let m=await Oh(s.findStudioWorkspaceOnBranch(t,h.branch),void 0,n,"find_studio_workspace_on_branch");if(m)return{streamId:m,created:!1}}}l=void 0}try{return{streamId:(await s.createStudioWorkspace(t,u.branch,l,u.createUserBranch)).id,created:!0}}catch(p){if(!Th(p)||d)throw p;let h=await s.findStudioWorkspaceOnBranch(t,r);if(!h)throw p;return await Eh(s,h,e),{streamId:h,created:!1}}}async function qh(s,e,t){if(!Pi(t))throw new Error(`Conversations fork from a version branch; ${t} is not one.`);return s.createStudioWorkspace(e,t)}var ry="00000000-0000-0000-0000-000000000000";function Di(s){return s.replace(/^features\//,"").includes("@users/")}function kr(s){let e=new Set(s.filter(t=>t.name.startsWith("features/")).filter(t=>!t.name.includes("@thread/")).filter(t=>!t.name.includes("@stream/")).filter(t=>!Di(t.name)).map(t=>ts(t.name)));return s.filter(t=>t.name==="main"?!0:!t.name.startsWith("features/")||t.name.includes("@thread/")||t.name.includes("@stream/")?!1:Di(t.name)?e.has(ts(t.name)):!0)}function Ph(s){let e=St(s),t=e.lastIndexOf("@users/");return t!==-1?e.slice(0,t):e}function bc(s){let e=St(s.name),t=e.lastIndexOf("@users/");if(t!==-1)return e.slice(t+7);if(e.startsWith("users/"))return e.slice(6);if(s.owner_id&&s.owner_id!==ry)return s.owner_id}function Dh(s,e){return s.filter(t=>t.name.startsWith("features/")||t.name.startsWith("users/")).filter(t=>!t.name.includes("@thread/")).filter(t=>bc(t)===e)}function ay(s,e){let t=new Set(s.filter(i=>i.name.startsWith("features/")).filter(i=>!i.name.includes("@thread/")).filter(i=>!bc(i)).map(i=>Ph(i.name)));return s.filter(i=>i.name.startsWith("features/")).filter(i=>!i.name.includes("@thread/")).filter(i=>bc(i)===e).filter(i=>t.has(Ph(i.name)))}function oy(s,e,t){let i=kr(s),n=ay(s,e);return n.length>0?n:t?i.filter(r=>r.name==="main"):[]}function Fh(s){let e={};for(let t of s)t.archived||!Nt(t.branch)||(e[t.workblock_id]??=[]).push(t);return e}function Mh(s,e,t,i){return Ah(oy(s,t,i),s,e)}var ce={ChooseDirectory:"Choose a directory for the branch",NewConversation:"New conversation",RemoveDirectoryBinding:"Remove directory binding",GetBranch:"Get workblock branch",StoreBranch:"Store workblock branch",EnableSync:"Enable sync",DisableSync:"Disable sync",CompareChanges:"Compare changes"};function kc(s){return s?`Change directory from ${s}`:ce.ChooseDirectory}function Lh(s){let e=[kc(s.dir)];return gr(s.branch)&&e.push(ce.NewConversation),s.dir&&(e.push(ce.RemoveDirectoryBinding),e.push(ce.GetBranch),e.push(ce.StoreBranch),e.push(s.syncEnabled?ce.DisableSync:ce.EnableSync),s.modified&&e.push(ce.CompareChanges)),e}function Me(s,e,t){return[s,e,t].map(encodeURIComponent).join("|")}var _r=class extends W.TreeItem{constructor(t){super(t.host,W.TreeItemCollapsibleState.Collapsed);this.connection=t;this.description=t.status,this.contextValue=t.status,this.iconPath=this.getIcon(),this.command={command:"beyondwork.beyondwork.connectToTenant",title:"Connect to Tenant",arguments:[t]}}getIcon(){switch(this.connection.status){case"connected":return new W.ThemeIcon("pass-filled",new W.ThemeColor("charts.blue"));case"disconnected":return new W.ThemeIcon("circle-outline",new W.ThemeColor("charts.red"));case"connecting":return new W.ThemeIcon("sync~spin",new W.ThemeColor("charts.yellow"))}}},xr=class extends W.TreeItem{constructor(t,i){super(t.name,W.TreeItemCollapsibleState.Collapsed);this.workblock=t;this.connection=i;this.contextValue="beyondwork.workblock",this.description=t.state,this.iconPath=new W.ThemeIcon("package"),this.tooltip=`${t.name}
154
154
  ${t.id}`}},_c=class extends W.TreeItem{constructor(t,i,n,r,a,o){let c=Nt(i.name),u=c?i.workspace?.title?.trim()||"New conversation":Di(i.name)?ts(i.name):i.name;super({label:u,highlights:o?[[0,u.length]]:[]},W.TreeItemCollapsibleState.None);this.workblock=t;this.branch=i;this.connection=r;this.syncEnabled=a;this.modified=o;this.contextValue="beyondwork.branch",this.key=Me(r.host,t.id,i.name),this.dir=n,this.iconPath=this.getIcon(),this.command={command:"beyondwork.beyondwork.showStreamOptions",title:"Show options",arguments:[this]},this.description=c?ts(i.name):Di(i.name)?"your branch":i.last_changed,n?(this.tooltip=`Bound to ${n}`,o&&(this.tooltip+=" (out of sync)")):this.tooltip=c?`${t.name}
155
155
  ${u}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publisher": "beyondwork",
4
4
  "displayName": "Beyond Work",
5
5
  "description": "Tool for interacting with Beyond Work workblocks from VS Code and CLI.",
6
- "version": "0.1.57",
6
+ "version": "0.1.58",
7
7
  "vsce": {
8
8
  "baseContentUrl": "https://github.com/bwllaming/code/blob/HEAD/src/vscode/beyondwork",
9
9
  "baseImagesUrl": "https://github.com/bwllaming/code/raw/HEAD/src/vscode/beyondwork"