@beyondwork/wb-cli 0.1.37 → 0.1.38

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
@@ -147,7 +147,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
147
147
  `).map(e=>e.trim()).join(" ")};rh.O=function(s){return this.inspectOpts.colors=this.useColors,Vi.inspect(s,this.inspectOpts)}});var ah=N((c8,Cu)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Cu.exports=X0():Cu.exports=ih()});var $t,Eu,oh,ch,uh,lh=B(()=>{Dn();$t={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Eu={get(s){return{signature:j.get(s,0),compressedSize:j.get(s,8),uncompressedSize:j.get(s,12)}},len:16},oh={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},ch={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},uh={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 ph(s){let e=new Uint8Array(j.len);return j.put(e,0,s),e}function I2(s,e){let t=s.length,n=e.length;if(n>t)return-1;for(let r=0;r<=t-n;r++){let i=!0;for(let a=0;a<n;a++)if(s[r+a]!==e[a]){i=!1;break}if(i)return r}return-1}function T2(s){let e=s.reduce((r,i)=>r+i.length,0),t=new Uint8Array(e),n=0;for(let r of s)t.set(r,n),n+=r.length;return t}var dh,Fe,Au,R2,Gi,jt,mh=B(()=>{Dn();dh=M(ah(),1);lh();Fe=(0,dh.default)("tokenizer:inflate"),Au=256*1024,R2=ph($t.DataDescriptor),Gi=ph($t.EndOfCentralDirectory),jt=class s{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(Au)}async isZip(){return await this.peekSignature()===$t.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(j)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),n=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(n,{position:e.fileInfo.size-t});for(let r=n.length-4;r>=0;r--)if(n[r]===Gi[0]&&n[r+1]===Gi[1]&&n[r+2]===Gi[2]&&n[r+3]===Gi[3])return e.fileInfo.size-t+r;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Fe("Cannot reading central-directory without random-read support");return}Fe("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){Fe("Central-directory 32-bit signature found");let n=await this.tokenizer.readToken(ch,t),r=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let i=0;i<n.nrOfEntriesOfSize;++i){let a=await this.tokenizer.readToken(uh);if(a.signature!==$t.CentralFileHeader)throw new Error("Expected Central-File-Header signature");a.filename=await this.tokenizer.readToken(new ce(a.filenameLength,"utf-8")),await this.tokenizer.ignore(a.extraFieldLength),await this.tokenizer.ignore(a.fileCommentLength),r.push(a),Fe(`Add central-directory file-entry: n=${i+1}/${r.length}: filename=${r[i].filename}`)}return this.tokenizer.setPosition(e),r}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{let r=await this.readLocalFileHeader();if(!r)break;let i=e(r);n=!!i.stop;let a;if(await this.tokenizer.ignore(r.extraFieldLength),r.dataDescriptor&&r.compressedSize===0){let o=[],c=Au;Fe("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let u=-1;for(;u<0&&c===Au;){c=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),u=I2(this.syncBuffer.subarray(0,c),R2);let l=u>=0?u:c;if(i.handler){let d=new Uint8Array(l);await this.tokenizer.readBuffer(d),o.push(d)}else await this.tokenizer.ignore(l)}Fe(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),i.handler&&await this.inflate(r,T2(o),i.handler)}else i.handler?(Fe(`Reading compressed-file-data: ${r.compressedSize} bytes`),a=new Uint8Array(r.compressedSize),await this.tokenizer.readBuffer(a),await this.inflate(r,a,i.handler)):(Fe(`Ignoring compressed-file-data: ${r.compressedSize} bytes`),await this.tokenizer.ignore(r.compressedSize));if(Fe(`Reading data-descriptor at pos=${this.tokenizer.position}`),r.dataDescriptor&&(await this.tokenizer.readToken(Eu)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Eu.len}`)}while(!n)}async iterateOverCentralDirectory(e,t){for(let n of e){let r=t(n);if(r.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);let i=await this.readLocalFileHeader();if(i){await this.tokenizer.ignore(i.extraFieldLength);let a=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(a),await this.inflate(i,a,r.handler)}}if(r.stop)break}}async inflate(e,t,n){if(e.compressedMethod===0)return n(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);Fe(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let r=await s.decompressDeflateRaw(t);return n(r)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(i){i.enqueue(e),i.close()}}),n=new DecompressionStream("deflate-raw"),r=t.pipeThrough(n);try{let a=await new Response(r).arrayBuffer();return new Uint8Array(a)}catch(i){let a=i instanceof Error?`Failed to deflate ZIP entry: ${i.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(a)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(j);if(e===$t.LocalFileHeader){let t=await this.tokenizer.readToken(oh);return t.filename=await this.tokenizer.readToken(new ce(t.filenameLength,"utf-8")),t}if(e===$t.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var qn,fh=B(()=>{qn=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let n=new Uint8Array(1024),r=await e.readBuffer(n,{mayBeLess:!0});if(r===0){t.close();return}t.enqueue(n.subarray(0,r))}}).pipeThrough(new DecompressionStream("gzip"))}}});var hh=B(()=>{mh();fh()});function Ru(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 x8,k8,_8,gh=B(()=>{x8={utf8:new globalThis.TextDecoder("utf8")},k8=new globalThis.TextEncoder,_8=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"))});function bh(s,e){if(e==="utf-16le"){let t=[];for(let n=0;n<s.length;n++){let r=s.charCodeAt(n);t.push(r&255,r>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let n=0;n<s.length;n++){let r=s.charCodeAt(n);t.push(r>>8&255,r&255)}return t}return[...s].map(t=>t.charCodeAt(0))}function xh(s,e=0){let t=Number.parseInt(new ce(6).get(s,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let n=256;for(let r=e;r<e+148;r++)n+=s[r];for(let r=e+156;r<e+512;r++)n+=s[r];return t===n}var kh,_h=B(()=>{Dn();kh={get:(s,e)=>s[e+3]&127|s[e+2]<<7|s[e+1]<<14|s[e]<<21,len:4}});var yh,wh,vh=B(()=>{yh=["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"],wh=["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 V2(s){let e=s?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return s;let{reader:t}=e,n=async()=>{await t.cancel(),t.releaseLock()};return e.close=n,e.abort=async()=>{e.interrupted=!0,await n()},s}function Ou(s,e,t){if(!Number.isFinite(s)||s<0||s>e)throw new Je(`${t} has invalid size ${s} (maximum ${e} bytes)`);return s}async function gt(s,e,{maximumLength:t=ke,reason:n="skip"}={}){let r=Ou(e,t,n);await s.ignore(r)}async function Tu(s,e,t,{maximumLength:n=e.length,reason:r="read"}={}){let i=t?.length??e.length,a=Ou(i,n,r);return s.readBuffer(e,{...t,length:a})}async function H2(s,{maximumLength:e=Be}={}){let r=new ReadableStream({start(u){u.enqueue(s),u.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),i=[],a=0;try{for(;;){let{done:u,value:l}=await r.read();if(u)break;if(a+=l.length,a>e)throw await r.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);i.push(l)}}finally{r.releaseLock()}let o=new Uint8Array(a),c=0;for(let u of i)o.set(u,c),c+=u.length;return o}function K2(s,e){if(s.length<Ki)return-1;let t=s.length-Ki;for(let n=0;n<=t;n++)if(j.get(s,n)===Fh&&j.get(s,n+8)===e+n)return n;return-1}function J2(s){return(s.codePointAt(0)&32)!==0}function Y2(s,e){let t=new Uint8Array(e),n=0;for(let r of s)t.set(r,n),n+=r.length;return t}async function Z2(s,{shouldBuffer:e,maximumLength:t=Be}={}){let{syncBuffer:n}=s,{length:r}=n,i=[],a=0;for(;;){let o=await s.tokenizer.peekBuffer(n,{mayBeLess:!0}),c=K2(n.subarray(0,o),a),u=c>=0?0:o===r?Math.min(G2,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),i.push(d)}else await s.tokenizer.ignore(l);if(c>=0)break}if(ne(s.tokenizer)||(s.knownSizeDescriptorScannedBytes+=a),!!e)return Y2(i,a)}function X2(s,e){return ne(s.tokenizer)?Math.max(0,ke-(s.tokenizer.position-e)):Math.max(0,Be-s.knownSizeDescriptorScannedBytes)}async function Q2(s,e,{shouldBuffer:t,maximumDescriptorLength:n=Be}={}){if(e.dataDescriptor&&e.compressedSize===0)return Z2(s,{shouldBuffer:t,maximumLength:n});if(!t){await gt(s.tokenizer,e.compressedSize,{maximumLength:ne(s.tokenizer)?Be:s.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let r=rS(s.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>r)throw new Error(`ZIP entry compressed data exceeds ${r} bytes`);let i=new Uint8Array(e.compressedSize);return await s.tokenizer.readBuffer(i),i}function eS(s,e){let t=s.getReader(),n=0,r=!1,i=!1,a=async o=>{r||i||(i=!0,await t.cancel(o))};return new ReadableStream({async pull(o){if(n>=e){o.close(),await a();return}let{done:c,value:u}=await t.read();if(c||!u){r=!0,o.close();return}let l=e-n;if(u.length>l){o.enqueue(u.subarray(0,l)),n+=l,o.close(),await a();return}o.enqueue(u),n+=u.length},async cancel(o){await a(o)}})}async function Lh(s,e){return new Ut(e).fromBuffer(s)}async function Bh(s,e){return new Ut(e).fromBlob(s)}function Dh(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 Le(s,e,t){t={offset:0,...t};for(let[n,r]of e.entries())if(t.mask){if(r!==(t.mask[n]&s[n+t.offset]))return!1}else if(r!==s[n+t.offset])return!1;return!0}function Du(s){return Number.isFinite(s)?Math.max(1,Math.trunc(s)):zt}function tS(s,e,t){return t===void 0?s.read(e):(t.throwIfAborted(),new Promise((n,r)=>{let i=()=>{t.removeEventListener("abort",a)},a=()=>{let o=t.reason;i(),(async()=>{try{await s.cancel(o)}catch{}})(),r(o)};t.addEventListener("abort",a,{once:!0}),(async()=>{try{let o=await s.read(e);i(),n(o)}catch(o){i(),r(o)}})()}))}function sS(s){return Number.isFinite(s)?Math.max(0,Math.min(O2,Math.trunc(s))):0}function nS(s){return Number.isFinite(s)?Math.max(0,s):Number.MAX_SAFE_INTEGER}function ne(s){let e=s.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function Pn(s,e,t){return ne(s)&&s.position-e>t}function rS(s){let e=s.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-s.position):Number.MAX_SAFE_INTEGER;return Math.min(t,D2)}function iS(s){if(s instanceof q||s instanceof Je)return!0;if(!(s instanceof Error))return!1;if(j2.has(s.message)||U2.has(s.code))return!0;for(let e of z2)if(s.message.startsWith(e))return!0;return!1}function qh(s,e=Be){let t=[s.compressedSize,s.uncompressedSize];for(let n of t)if(!Number.isFinite(n)||n<0||n>e)return!1;return!0}function aS(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function oS(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 Ph(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 cS(s){let e=s.indexOf('.main+xml"');if(e===-1){let r="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return s.includes(`ContentType="${r}"`)?r:void 0}let t=s.slice(0,e),n=t.lastIndexOf('"');return t.slice(n+1)}async function Mh(s,e){return new Ut(e).fromTokenizer(s)}var zt,O2,Be,Sh,D2,ke,Ji,Nh,q2,P2,Ch,Iu,Eh,Ah,F2,L2,B2,M2,W2,Rh,Ih,Th,$2,Oh,j2,z2,U2,Je,Fh,Ki,G2,Ut,Wh,$h,qu=B(()=>{Dn();Wi();hh();gh();_h();vh();zt=4100,O2=zt-2,Be=1024*1024,Sh=1024,D2=2**31-1,ke=16*1024*1024,Ji=Be,Nh=Be,q2=ke,P2=1,Ch=100,Iu=ke,Eh=64,Ah=Ji,F2=256,L2=512,B2=ke,M2=512,W2=512,Rh=256,Ih=Ji,Th=Ji,$2=Ji,Oh=ke,j2=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),z2=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],U2=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),Je=class extends Error{};Fh=134695760,Ki=16,G2=Ki-1;jt.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 n=await H2(e,{maximumLength:Be});return t(n)};jt.prototype.unzip=async function(s){let e=!1,t=0,n=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Pn(this.tokenizer,n,ke))throw new Je(`ZIP stream probing exceeds ${ke} bytes`);let r=await this.readLocalFileHeader();if(!r)break;if(t++,t>Sh)throw new Error(`ZIP entry count exceeds ${Sh}`);let i=s(r);e=!!i.stop,await this.tokenizer.ignore(r.extraFieldLength);let a=await Q2(this,r,{shouldBuffer:!!i.handler,maximumDescriptorLength:Math.min(Be,X2(this,n))});if(i.handler&&await this.inflate(r,a,i.handler),r.dataDescriptor){let o=new Uint8Array(Ki);if(await this.tokenizer.readBuffer(o),j.get(o,0)!==Fh)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-o.length}`)}if(Pn(this.tokenizer,n,ke))throw new Je(`ZIP stream probing exceeds ${ke} bytes`)}while(!e)};Ut=class s{constructor(e){let t=sS(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 V2(q0(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let n=e.position;for(let r of this.detectors){let i;try{i=await r.detect(e)}catch(a){if(a instanceof q||a instanceof Je)return;throw a}if(i)return i;if(n!==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(P0(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=F0(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 n=Du(t?.sampleSize??zt),r,i,a=e.getReader({mode:"byob"});try{let{value:u,done:l}=await tS(a,new Uint8Array(n),this.options.signal);if(i=u,!l&&u)try{r=await this.fromBuffer(u.subarray(0,n))}catch(d){if(!(d instanceof q))throw d;r=void 0}i=u}finally{a.releaseLock()}let o=new TransformStream({async start(u){u.enqueue(i)},transform(u,l){l.enqueue(u)}}),c=e.pipeThrough(o);return c.fileType=r,c}async detectGzip(e){if(this.gzipProbeDepth>=P2)return{ext:"gz",mime:"application/gzip"};let t=new qn(e),n=eS(t.inflate(),q2),r=ne(e),i,a,o,c;if(r){let u=new AbortController;i=setTimeout(()=>{u.abort(new DOMException(`Operation timed out after ${Ch} ms`,"TimeoutError"))},Ch),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(n)}catch(u){if(u?.name==="AbortError"&&a?.reason?.name!=="TimeoutError")throw u}finally{clearTimeout(i),r||this.gzipProbeDepth--}return c?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return Le(this.buffer,e,t)}checkString(e,t){return this.check(bh(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(zt),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,ne(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>=Rh?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 gt(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(kh),n=ne(e);if(!Number.isFinite(t)||t<0||n&&(t>Iu||e.position+t>Iu))return;if(e.position+t>e.fileInfo.size)return n?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await gt(e,t,{maximumLength:n?Iu:e.fileInfo.size,reason:"ID3 payload"})}catch(r){if(r instanceof q)return;throw r}return this.detectionReentryCount>=Rh?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,n=aS();try{await new jt(e).unzip(r=>{oS(n,r.filename);let i=r.filename==="[Content_Types].xml",a=Ph(n);if(!i&&a)return t=a,{stop:!0};switch(r.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 qh(r,Nh)?{async handler(o){let c=new TextDecoder("utf-8").decode(o).trim();t=Dh(c)},stop:!0}:{};case"[Content_Types].xml":return n.hasContentTypesEntry=!0,qh(r,Nh)?(n.isParsingContentTypes=!0,{async handler(o){let c=new TextDecoder("utf-8").decode(o),u=cS(c);u&&(t=Dh(u)),n.hasParsedContentTypesEntry=!0,n.isParsingContentTypes=!1},stop:!0}):(n.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(r.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(r){if(!iS(r))throw r;n.isParsingContentTypes&&(n.isParsingContentTypes=!1,n.hasUnparseableContentTypes=!0)}return t??Ph(n)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),Le(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Le(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Le(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Le(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Le(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Le(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(H0),u=128,l=0;for(;(c&u)===0&&u!==0;)++l,u>>=1;let d=new Uint8Array(l+1);return await Tu(e,d,void 0,{maximumLength:d.length,reason:"EBML field"}),d}async function n(){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:Ru(d),len:Ru(p)}}async function r(c){let u=0;for(;c>0;){if(u++,u>F2||Pn(e,a,ke))return;let l=e.position,d=await n();if(d.id===17026){if(d.len>Eh)return;let p=Ou(d.len,Eh,"EBML DocType");return(await e.readToken(new ce(p))).replaceAll(/\00.*$/g,"")}if(ne(e)&&(!Number.isFinite(d.len)||d.len<0||d.len>Ah)||(await gt(e,d.len,{maximumLength:ne(e)?Ah:e.fileInfo.size,reason:"EBML payload"}),--c,e.position<=l))return}}let i=await n(),a=e.position;switch(await r(i.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=vu.get(this.buffer,4),n=Mt.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(n>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 ce(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 ce(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
148
148
  `,"\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"},n={ext:"apng",mime:"image/apng"};await e.ignore(8);async function r(){return{length:await e.readToken(G0),type:await e.readToken(new ce(4,"latin1"))}}let i=ne(e),a=e.position,o=0,c=!1;do{if(o++,o>L2||Pn(e,a,B2))break;let u=e.position,l=await r();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 n;default:if(!c&&l.type!=="CgBI")return;if(i&&l.length>Ih)return c&&J2(l.type)?t:void 0;try{await gt(e,l.length+4,{maximumLength:i?Ih+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(d){if(!i&&(d instanceof Je||d instanceof q))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 ce(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
149
149
  `))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 n(){let o=new Uint8Array(16);return await Tu(e,o,void 0,{maximumLength:o.length,reason:"ASF header GUID"}),{id:o,size:Number(await e.readToken(K0))}}await gt(e,30,{maximumLength:30,reason:"ASF header prelude"});let r=ne(e),i=e.position,a=0;for(;e.position+24<e.fileInfo.size&&(a++,!(a>M2||Pn(e,i,ke)));){let o=e.position,c=await n(),u=c.size-24;if(!Number.isFinite(u)||u<0){t=!0;break}if(Le(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 Tu(e,l,void 0,{maximumLength:l.length,reason:"ASF stream type GUID"}),Le(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(Le(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(r&&u>Th){t=!0;break}if(await gt(e,u,{maximumLength:r?Th:e.fileInfo.size,reason:"ASF header payload"}),e.position<=o){t=!0;break}}}catch(n){if(n instanceof q||n instanceof Je)ne(e)&&(t=!0);else throw n}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 ce(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 n=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(n).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})&&xh(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
150
- `,{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(zt);let t=nS(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 n=0;n<=this.options.mpegOffsetTolerance;++n){let r=this.scanMpeg(n);if(r)return r}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?Mt: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?Mt:z);if(!(t>W2)&&!(ne(this.tokenizer)&&2+t*12>Oh))for(let n=0;n<t;++n){let r=await this.readTiffTag(e);if(r)return r}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},n=(e?Mt:z).get(this.buffer,2),r=(e?vu:j).get(this.buffer,4);if(n===42){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8){let o=(e?Mt:z).get(this.buffer,8),c=(e?Mt:z).get(this.buffer,10);if(o===28&&c===254||o===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(ne(this.tokenizer)&&r>$2)return t;let i=ne(this.tokenizer)?Oh:this.tokenizer.fileInfo.size;try{await gt(this.tokenizer,r,{maximumLength:i,reason:"TIFF IFD offset"})}catch(o){if(o instanceof q)return;throw o}let a;try{a=await this.readTiffIFD(e)}catch(o){if(o instanceof q)return;throw o}return a??t}if(n===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"}}}},Wh=new Set(yh),$h=new Set(wh)});var Uh={};Kt(Uh,{FileTypeParser:()=>Is,fileTypeFromBlob:()=>Bh,fileTypeFromBuffer:()=>Lh,fileTypeFromFile:()=>lS,fileTypeFromStream:()=>dS,fileTypeFromTokenizer:()=>Mh,fileTypeStream:()=>pS,supportedExtensions:()=>Wh,supportedMimeTypes:()=>$h});function uS(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 lS(s,e){return new Is(e).fromFile(s,e)}async function dS(s,e){return new Is(e).fromStream(s)}async function pS(s,e={}){return new Is(e).toDetectionStream(s,e)}var jh,bt,zh,Pu,Is,Vh=B(()=>{jh=require("node:stream/web"),bt=require("node:stream"),zh=M(require("node:fs/promises"),1),Pu=require("node:fs");W0();qu();qu();Is=class extends Ut{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof jh.ReadableStream?this.createTokenizerFromWebStream(e):M0(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(n){if(uS(n))return;throw n}finally{e instanceof bt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await zh.default.open(e,Pu.constants.O_RDONLY|Pu.constants.O_NONBLOCK),n=await t.stat();if(!n.isFile()){await t.close();return}let r=new Bt(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:n.size}});return super.fromTokenizer(r)}async toDetectionStream(e,t={}){if(!(e instanceof bt.Readable))return super.toDetectionStream(e,t);let{sampleSize:n=zt}=t,{signal:r}=this.options,i=Du(n);return r?.throwIfAborted(),new Promise((a,o)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",m),r?.removeEventListener("abort",p)},l=(f,h)=>{c||(c=!0,u(),f(h))},d=f=>{l(o,f)},p=()=>{e.destroyed||e.destroy(),l(o,r.reason)},m=()=>{(async()=>{try{let f=new bt.PassThrough,h=bt.pipeline?(0,bt.pipeline)(e,f,()=>{}):e.pipe(f),b=e.read(i)??e.read()??new Uint8Array(0);try{f.fileType=await this.fromBuffer(b)}catch(_){_ instanceof q?f.fileType=void 0:l(o,_)}l(a,h)}catch(f){l(o,f)}})()};e.on("error",d),e.once("readable",m),r?.addEventListener("abort",p,{once:!0})})}}});var AS={};Kt(AS,{activate:()=>CS,connectToHost:()=>ta,deactivate:()=>ES});module.exports=cg(AS);var C=M(require("vscode"));var or=M(require("vscode"));var Rb=M(Pl(),1),Ib=M(Qn(),1),Tb=M(Zt(),1),Ob=M(pa(),1),Db=M(ha(),1),qb=M(ya(),1),Ul=M(nr(),1),Pb=M(zl(),1);var ir=Ul.default;var ar=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 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 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 authzSchemaInitializeForWorkblock(e,t){return await this.requestWithTracking("authz_schema_initialize_for_workblock",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 bulkTagLearningExamples(e,t){return await this.requestWithTracking("bulk_tag_learning_examples",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 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 closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",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 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 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 deleteCredential(e,t){return await this.requestWithTracking("delete_credential",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 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 ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",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 help(e,t){return await this.requestWithTracking("help",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 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 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 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 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 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 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 sendMessage(e,t){return await this.requestWithTracking("send_message",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 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 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 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 startBranchThread(e,t){return await this.requestWithTracking("start_branch_thread",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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 startChild(e,t){return await this.client.sendMessage({type:"start_child",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 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,n){let r=Date.now(),i={options_streamId:n?.streamId,options_threadId:n?.threadId,...this.sanitizeForAnalytics(t)};try{let a=await this.client.sendMessage({type:e,stream_id:n?.streamId,thread_id:n?.threadId,timeout:n?.timeoutSeconds,task_id:n?.taskId,model:n?.model,reasoning_effort:n?.reasoningEffort,request:t});return this.trackEventSafely(`user-action/${e}`,{...i,success:!0,duration:Date.now()-r}),a}catch(a){throw this.trackEventSafely(`user-action/${e}`,{...i,success:!1,duration:Date.now()-r,errorType:a instanceof Error?a.name:"Unknown"}),a}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(n){console.error("Analytics tracking failed:",n)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[n,r]of Object.entries(e))(n.endsWith("_id")||n.endsWith("_ids")||n==="id")&&(t[n]=r);return t}};var $s=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Xe=180,js=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new ar({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}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 n=new URL(e);n.protocol==="ws:"?n.protocol="http:":n.protocol==="wss:"&&(n.protocol="https:"),!n.hostname.startsWith("api.")&&!n.hostname.startsWith("localhost")&&(n.hostname=`api.${n.hostname}`),n.pathname=n.pathname.replace("/workblocks/streams",""),n.pathname.endsWith("/")&&(n.pathname=n.pathname.slice(0,-1)),n.pathname=n.pathname+"/blobs",this.blobURL=n.toString();let r=new URL(e);switch(r.protocol){case"https:":r.protocol="wss:";break;case"http:":r.protocol="ws:";break}!r.hostname.startsWith("api.")&&!r.hostname.startsWith("localhost")&&(r.hostname=`api.${r.hostname}`),r.pathname.endsWith("/streams")||(r.pathname="/workblocks/streams"),this.connectionUrl=r.toString();let i=new ir(r.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=i,i.on("open",()=>{this.ws===i&&(this.connected=!0,this.lastConnectionError=void 0)}),i.on("unexpected-response",(a,o)=>{this.ws===i&&this.reportConnectionError(`Unexpected server response: ${o.statusCode}`,o.statusCode),i.terminate()}),i.on("message",a=>{if(this.ws!==i)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 $s(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)}),i.on("close",(a,o)=>{this.ws===i&&(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()))}),i.on("error",async a=>{this.ws===i&&(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===ir.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,n)=>{let r=()=>{c(),t()},i=u=>{c(),n(new Error(`WebSocket error: ${u.message}`))},a=(u,l)=>{c(),n(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},o=(u,l)=>{c(),n(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",r),e.removeListener("error",i),e.removeListener("unexpected-response",a),e.removeListener("close",o)};e.on("open",r),e.on("error",i),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===ir.OPEN?(this.SequenceID++,new Promise((n,r)=>{let i=this.SequenceID,a=t??this.requestTimeoutMs,o=setTimeout(()=>{let c=this.store[i];c&&(delete this.store[i],c.reject(new Error(`Request timed out after ${a}ms${c.type?` (type=${c.type})`:""}`)))},a);this.store[i]={resolve:n,reject:r,timeoutHandle:o,type:e.type},this.ws?.send(JSON.stringify({...e,seq:i}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,n={}){let r=n.timeoutSeconds;return await this._send({type:e,stream_id:n.streamId,timeout:r,request:t},r===void 0?void 0:(r+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 n=await this.requests.setWorkBlockV2({workblock:t},{streamId:e,timeoutSeconds:Xe});return{errors:n.errors??[],warnings:n.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(i){if(!(i instanceof $s&&i.code==="NotFound"))throw i;t=void 0}if(!t)return await this.createWorkblock(e);let n=await this.requests.getEditStream({workblock_id:e.id}),r=await this.setWorkblock(n.id,e);if(r.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(r.errors)}`);return{stream:n,warnings:r.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Xe})}async createWorkblock(e,t){let n=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Xe});if(n.errors?.length)throw new Error(`Validation errors: ${JSON.stringify(n.errors)}`);return{stream:n.stream,warnings:n.warnings??[]}}async listWorkblockDefinitions(){return await this.requests.listWorkblockDefinitions({})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}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,n,r=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:n,create_user_branch:r})).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=this.tokenSource?await this.tokenSource():this.token,n=await this.fetchWithCache(`${this.blobURL}?key=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!n.ok)throw new Error(`Failed to fetch blob ${e}: ${n.status} ${n.statusText}`);return{contentType:n.headers.get("content-type")??"",text:await n.text()}}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,n)=>{let r=setTimeout(()=>n(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(i=>{clearTimeout(r),t(i)})})}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 createWorkblockVersion(e,t,n){return await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,workspace_name:n},{timeoutSeconds:Xe})}async setWorkblockV2(e,t,n){return await this.requests.setWorkBlockV2({workblock:t,branch:n.branch,expected_commit_ref:n.expectedCommitRef,advance_version:n.advanceVersion||void 0},{streamId:e,timeoutSeconds:Xe})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Xe})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Xe})}async getWorkspaceWorkblock(e){return await this.requests.getWorkblockV2({},{streamId:e})??void 0}async getDocsContent(){return(await this.requests.getDocsContent({})).content}async runModule(e,t,n){return(await this.requests.runModule({module_id:t,inputs:n},{streamId:e})).run_id}async runSingleTask(e,t,n,r){return await this.requests.runSingleTask({module_id:t,task_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,n){return(await this.requests.wbRunTest({module_id:n,workblock_id:t},{streamId:e,timeoutSeconds:Xe})).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})}disconnect(){this.connected=!1,this.closing=!0,this.rejectAllPending(new Error("WebSocket disconnected")),this.ws?.close(),this.streamHandlers=[],this.eventHandlers=[],this.currentUserHandlers=[],this.store={},this.SequenceID=0}handleListStreams(e){let t=[];(e??[]).forEach(n=>{n.editing&&t.push(n)}),this.streamHandlers.forEach(n=>n(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,n]of Object.entries(this.store))n&&(clearTimeout(n.timeoutHandle),n.reject(e),delete this.store[Number(t)])}reportConnectionError(e,t){this.lastConnectionError=e,this.connectionErrorHandlers.forEach(n=>n({host:this.connectionHost,url:this.connectionUrl,reason:e,statusCode:t}))}};var Vl=3600*1e3,Fb=600*1e3;function Lb(s){return typeof s=="object"&&s!==null&&"data"in s&&typeof s.data=="string"&&"timestamp"in s&&typeof s.timestamp=="number"}var cr=class extends js{context;constructor(e=!0){super(e)}connect(e,t,n){this.context=n,super.connect(e,t),this.ws?.on("open",()=>{this.cleanupExpiredCache().catch(console.error),this.lastCleanup=Date.now()}),this.ws?.on("close",(r,i)=>{this.connected&&or.window.showErrorMessage(`WebSocket disconnected. Code: ${r}, Reason: ${i}`)}),this.ws?.on("error",r=>{this.connected&&or.window.showErrorMessage(`WebSocket error: ${r.message}`)})}async fetchWithCache(e,t){let n=Date.now();n-this.lastCleanup>Fb&&(await this.cleanupExpiredCache(),this.lastCleanup=n);let r=`${e}${JSON.stringify(t)}`;try{let i=this.context?.globalState.get(r);if(i&&Date.now()-i.timestamp<Vl)return new Response(i.data);let a=await fetch(e,t),o=await a.text();return a.ok&&await this.context?.globalState.update(r,{data:o,timestamp:Date.now()}),new Response(o,a)}catch(i){return or.window.showErrorMessage(`Cache error: ${i}`),fetch(e,t)}}async cleanupExpiredCache(){if(!this.context)return;let e=this.context.globalState.keys(),t=Date.now();for(let n of e){let r=this.context.globalState.get(n);Lb(r)&&t-r.timestamp>Vl&&await this.context.globalState.update(n,void 0)}}};var W=M(require("vscode"));var Sa="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Bb=new RegExp(`^(.+)@users/${Sa}$`,"i"),Mb=new RegExp(`^.+@stream/${Sa}$`,"i"),Gl=new RegExp(`@thread/${Sa}$`,"i"),Wb="AlreadyExists",$b="PermissionDenied",jb="already exists on this branch";function Qe(s){return s.replace(Gl,"")}function zb(s){return Gl.test(s)}function et(s){return s?Mb.test(Qe(s)):!1}function zs(s){return s.startsWith("features/")&&s!=="features/"&&!s.includes("@users/")&&!s.includes("@stream/")&&!s.includes("@thread/")}function ns(s){let e=Qe(s),t=e.lastIndexOf("@stream/");if(t!==-1)return e.slice(0,t);let n=e.lastIndexOf("@users/");return n!==-1?e.slice(0,n):e}function vt(s){return ns(s).replace(/^features\//,"")}function ur(s){let e=ns(s);return zs(e)?e:void 0}function Ub(s){if(zb(s)||et(s))return;let e=s.match(Bb);return e?{branch:e[1],createUserBranch:!0}:{branch:s,createUserBranch:!1}}function Kl(s){return!s.archived&&et(s.branch)}function Vb(s,e){return s.filter(t=>Kl(t)&&ns(t.branch??"")===e).reduce((t,n)=>{if(!t)return n;let r=Date.parse(t.updated_at||t.created_at);return Date.parse(n.updated_at||n.created_at)>r?n:t},void 0)}function Jl(s,e,t){let n=new Map(e.map(i=>[i.name,i])),r=new Map(s.map(i=>[i.name,i]));for(let i of t){if(!i.branch||!Kl(i))continue;let a=n.get(i.branch);a&&r.set(a.name,{...a,workspace:i})}return[...r.values()]}function Yl(s){if(typeof s=="object"&&s!==null&&"code"in s){let e=s.code;if(typeof e=="string")return e}}function lr(s){return s instanceof Error?s.message:String(s)}function Zl(s){return Yl(s)===Wb||lr(s).includes(jb)}function Hb(s){return Yl(s)===$b}async function va(s,e,t){try{return{ok:!0,value:await s}}catch(n){return e?.(`[workspace] ${t??"request"} failed: ${lr(n)}`),{ok:!1,error:n}}}async function Xl(s,e,t,n){let r=await va(s,t,n);return r.ok?r.value:e}async function Hl(s,e,t){try{await s.getStudioWorkspace(e);return}catch(i){if(!Hb(i)){t.log?.(`[workspace] could not verify access to ${e}: ${lr(i)}`);return}}let n=(await Xl(s.listStudioWorkspaces(void 0,t.workblockId),[],t.log,"list_studio_workspaces")).find(i=>i.id===e),r=n?.title?.trim()?`"${n.title.trim()}"`:e;throw new Error(`Branch ${t.branch} is open in Studio workspace ${r}, which you are not a member of. Ask its owner to share it, or work on your own branch.`)}async function Na(s,e){let{workblockId:t,branch:n,log:r}=e,i=Qe(n),a=await va(s.findStudioWorkspaceOnBranch(t,i),r,"find_studio_workspace_on_branch"),o=a.ok?void 0:a.error,c=a.ok?a.value:void 0;if(c)return await Hl(s,c,e),{streamId:c,created:!1};let u=Ub(n);if(!u)throw o?new Error(`Could not look up the Studio workspace for ${n}: ${lr(o)}`):new Error(`No active Studio workspace on ${n}. Open ${ns(n)} instead to start a new conversation on it.`);let l=e.title,d=!u.createUserBranch&&zs(u.branch);if(d){let p=e.userId?await va(s.listStudioWorkspaces(e.userId,t),r,"list_studio_workspaces"):{ok:!0,value:[]};if(p.ok){let m=Vb(p.value,u.branch);if(m?.branch){let f=await Xl(s.findStudioWorkspaceOnBranch(t,m.branch),void 0,r,"find_studio_workspace_on_branch");if(f)return{streamId:f,created:!1}}}l=void 0}try{return{streamId:(await s.createStudioWorkspace(t,u.branch,l,u.createUserBranch)).id,created:!0}}catch(p){if(!Zl(p)||d)throw p;let m=await s.findStudioWorkspaceOnBranch(t,i);if(!m)throw p;return await Hl(s,m,e),{streamId:m,created:!1}}}async function Ql(s,e,t){if(!zs(t))throw new Error(`Conversations fork from a version branch; ${t} is not one.`);return s.createStudioWorkspace(e,t)}var Gb="00000000-0000-0000-0000-000000000000";function Us(s){return s.replace(/^features\//,"").includes("@users/")}function dr(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=>!Us(t.name)).map(t=>vt(t.name)));return s.filter(t=>t.name==="main"?!0:!t.name.startsWith("features/")||t.name.includes("@thread/")||t.name.includes("@stream/")?!1:Us(t.name)?e.has(vt(t.name)):!0)}function ed(s){let e=Qe(s),t=e.lastIndexOf("@users/");return t!==-1?e.slice(0,t):e}function Ca(s){let e=Qe(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!==Gb)return s.owner_id}function td(s,e){return s.filter(t=>t.name.startsWith("features/")||t.name.startsWith("users/")).filter(t=>!t.name.includes("@thread/")).filter(t=>Ca(t)===e)}function Kb(s,e){let t=new Set(s.filter(n=>n.name.startsWith("features/")).filter(n=>!n.name.includes("@thread/")).filter(n=>!Ca(n)).map(n=>ed(n.name)));return s.filter(n=>n.name.startsWith("features/")).filter(n=>!n.name.includes("@thread/")).filter(n=>Ca(n)===e).filter(n=>t.has(ed(n.name)))}function Jb(s,e,t){let n=dr(s),r=Kb(s,e);return r.length>0?r:t?n.filter(i=>i.name==="main"):[]}function sd(s){let e={};for(let t of s)t.archived||!et(t.branch)||(e[t.workblock_id]??=[]).push(t);return e}function nd(s,e,t,n){return Jl(Jb(s,t,n),s,e)}var se={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 Ea(s){return s?`Change directory from ${s}`:se.ChooseDirectory}function rd(s){let e=[Ea(s.dir)];return ur(s.branch)&&e.push(se.NewConversation),s.dir&&(e.push(se.RemoveDirectoryBinding),e.push(se.GetBranch),e.push(se.StoreBranch),e.push(s.syncEnabled?se.DisableSync:se.EnableSync),s.modified&&e.push(se.CompareChanges)),e}function ye(s,e,t){return[s,e,t].map(encodeURIComponent).join("|")}var pr=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"))}}},mr=class extends W.TreeItem{constructor(t,n){super(t.name,W.TreeItemCollapsibleState.Collapsed);this.workblock=t;this.connection=n;this.contextValue="beyondwork.workblock",this.description=t.state,this.iconPath=new W.ThemeIcon("package"),this.tooltip=`${t.name}
150
+ `,{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(zt);let t=nS(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 n=0;n<=this.options.mpegOffsetTolerance;++n){let r=this.scanMpeg(n);if(r)return r}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?Mt: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?Mt:z);if(!(t>W2)&&!(ne(this.tokenizer)&&2+t*12>Oh))for(let n=0;n<t;++n){let r=await this.readTiffTag(e);if(r)return r}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},n=(e?Mt:z).get(this.buffer,2),r=(e?vu:j).get(this.buffer,4);if(n===42){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8){let o=(e?Mt:z).get(this.buffer,8),c=(e?Mt:z).get(this.buffer,10);if(o===28&&c===254||o===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(ne(this.tokenizer)&&r>$2)return t;let i=ne(this.tokenizer)?Oh:this.tokenizer.fileInfo.size;try{await gt(this.tokenizer,r,{maximumLength:i,reason:"TIFF IFD offset"})}catch(o){if(o instanceof q)return;throw o}let a;try{a=await this.readTiffIFD(e)}catch(o){if(o instanceof q)return;throw o}return a??t}if(n===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"}}}},Wh=new Set(yh),$h=new Set(wh)});var Uh={};Kt(Uh,{FileTypeParser:()=>Is,fileTypeFromBlob:()=>Bh,fileTypeFromBuffer:()=>Lh,fileTypeFromFile:()=>lS,fileTypeFromStream:()=>dS,fileTypeFromTokenizer:()=>Mh,fileTypeStream:()=>pS,supportedExtensions:()=>Wh,supportedMimeTypes:()=>$h});function uS(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 lS(s,e){return new Is(e).fromFile(s,e)}async function dS(s,e){return new Is(e).fromStream(s)}async function pS(s,e={}){return new Is(e).toDetectionStream(s,e)}var jh,bt,zh,Pu,Is,Vh=B(()=>{jh=require("node:stream/web"),bt=require("node:stream"),zh=M(require("node:fs/promises"),1),Pu=require("node:fs");W0();qu();qu();Is=class extends Ut{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof jh.ReadableStream?this.createTokenizerFromWebStream(e):M0(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(n){if(uS(n))return;throw n}finally{e instanceof bt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await zh.default.open(e,Pu.constants.O_RDONLY|Pu.constants.O_NONBLOCK),n=await t.stat();if(!n.isFile()){await t.close();return}let r=new Bt(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:n.size}});return super.fromTokenizer(r)}async toDetectionStream(e,t={}){if(!(e instanceof bt.Readable))return super.toDetectionStream(e,t);let{sampleSize:n=zt}=t,{signal:r}=this.options,i=Du(n);return r?.throwIfAborted(),new Promise((a,o)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",m),r?.removeEventListener("abort",p)},l=(f,h)=>{c||(c=!0,u(),f(h))},d=f=>{l(o,f)},p=()=>{e.destroyed||e.destroy(),l(o,r.reason)},m=()=>{(async()=>{try{let f=new bt.PassThrough,h=bt.pipeline?(0,bt.pipeline)(e,f,()=>{}):e.pipe(f),b=e.read(i)??e.read()??new Uint8Array(0);try{f.fileType=await this.fromBuffer(b)}catch(_){_ instanceof q?f.fileType=void 0:l(o,_)}l(a,h)}catch(f){l(o,f)}})()};e.on("error",d),e.once("readable",m),r?.addEventListener("abort",p,{once:!0})})}}});var AS={};Kt(AS,{activate:()=>CS,connectToHost:()=>ta,deactivate:()=>ES});module.exports=cg(AS);var C=M(require("vscode"));var or=M(require("vscode"));var Rb=M(Pl(),1),Ib=M(Qn(),1),Tb=M(Zt(),1),Ob=M(pa(),1),Db=M(ha(),1),qb=M(ya(),1),Ul=M(nr(),1),Pb=M(zl(),1);var ir=Ul.default;var ar=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 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 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 authzSchemaInitializeForWorkblock(e,t){return await this.requestWithTracking("authz_schema_initialize_for_workblock",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 bulkTagLearningExamples(e,t){return await this.requestWithTracking("bulk_tag_learning_examples",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 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 closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",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 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 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 deleteCredential(e,t){return await this.requestWithTracking("delete_credential",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 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 ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",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 help(e,t){return await this.requestWithTracking("help",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 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 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 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 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 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 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 sendMessage(e,t){return await this.requestWithTracking("send_message",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 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 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 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 startBranchThread(e,t){return await this.requestWithTracking("start_branch_thread",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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 startChild(e,t){return await this.client.sendMessage({type:"start_child",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 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,n){let r=Date.now(),i={options_streamId:n?.streamId,options_threadId:n?.threadId,...this.sanitizeForAnalytics(t)};try{let a=await this.client.sendMessage({type:e,stream_id:n?.streamId,thread_id:n?.threadId,timeout:n?.timeoutSeconds,task_id:n?.taskId,model:n?.model,reasoning_effort:n?.reasoningEffort,request:t});return this.trackEventSafely(`user-action/${e}`,{...i,success:!0,duration:Date.now()-r}),a}catch(a){throw this.trackEventSafely(`user-action/${e}`,{...i,success:!1,duration:Date.now()-r,errorType:a instanceof Error?a.name:"Unknown"}),a}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(n){console.error("Analytics tracking failed:",n)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[n,r]of Object.entries(e))(n.endsWith("_id")||n.endsWith("_ids")||n==="id")&&(t[n]=r);return t}};var $s=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Xe=180,js=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new ar({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}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 n=new URL(e);n.protocol==="ws:"?n.protocol="http:":n.protocol==="wss:"&&(n.protocol="https:"),!n.hostname.startsWith("api.")&&!n.hostname.startsWith("localhost")&&(n.hostname=`api.${n.hostname}`),n.pathname=n.pathname.replace("/workblocks/streams",""),n.pathname.endsWith("/")&&(n.pathname=n.pathname.slice(0,-1)),n.pathname=n.pathname+"/blobs",this.blobURL=n.toString();let r=new URL(e);switch(r.protocol){case"https:":r.protocol="wss:";break;case"http:":r.protocol="ws:";break}!r.hostname.startsWith("api.")&&!r.hostname.startsWith("localhost")&&(r.hostname=`api.${r.hostname}`),r.pathname.endsWith("/streams")||(r.pathname="/workblocks/streams"),this.connectionUrl=r.toString();let i=new ir(r.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=i,i.on("open",()=>{this.ws===i&&(this.connected=!0,this.lastConnectionError=void 0)}),i.on("unexpected-response",(a,o)=>{this.ws===i&&this.reportConnectionError(`Unexpected server response: ${o.statusCode}`,o.statusCode),i.terminate()}),i.on("message",a=>{if(this.ws!==i)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 $s(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)}),i.on("close",(a,o)=>{this.ws===i&&(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()))}),i.on("error",async a=>{this.ws===i&&(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===ir.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,n)=>{let r=()=>{c(),t()},i=u=>{c(),n(new Error(`WebSocket error: ${u.message}`))},a=(u,l)=>{c(),n(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},o=(u,l)=>{c(),n(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",r),e.removeListener("error",i),e.removeListener("unexpected-response",a),e.removeListener("close",o)};e.on("open",r),e.on("error",i),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===ir.OPEN?(this.SequenceID++,new Promise((n,r)=>{let i=this.SequenceID,a=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,o=setTimeout(()=>{let c=this.store[i];c&&(delete this.store[i],c.reject(new Error(`Request timed out after ${a}ms${c.type?` (type=${c.type})`:""}`)))},a);this.store[i]={resolve:n,reject:r,timeoutHandle:o,type:e.type},this.ws?.send(JSON.stringify({...e,seq:i}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,n={}){let r=n.timeoutSeconds;return await this._send({type:e,stream_id:n.streamId,timeout:r,request:t},r===void 0?void 0:(r+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 n=await this.requests.setWorkBlockV2({workblock:t},{streamId:e,timeoutSeconds:Xe});return{errors:n.errors??[],warnings:n.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(i){if(!(i instanceof $s&&i.code==="NotFound"))throw i;t=void 0}if(!t)return await this.createWorkblock(e);let n=await this.requests.getEditStream({workblock_id:e.id}),r=await this.setWorkblock(n.id,e);if(r.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(r.errors)}`);return{stream:n,warnings:r.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Xe})}async createWorkblock(e,t){let n=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Xe});if(n.errors?.length)throw new Error(`Validation errors: ${JSON.stringify(n.errors)}`);return{stream:n.stream,warnings:n.warnings??[]}}async listWorkblockDefinitions(){return await this.requests.listWorkblockDefinitions({})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}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,n,r=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:n,create_user_branch:r})).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=this.tokenSource?await this.tokenSource():this.token,n=await this.fetchWithCache(`${this.blobURL}?key=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!n.ok)throw new Error(`Failed to fetch blob ${e}: ${n.status} ${n.statusText}`);return{contentType:n.headers.get("content-type")??"",text:await n.text()}}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,n)=>{let r=setTimeout(()=>n(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(i=>{clearTimeout(r),t(i)})})}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 createWorkblockVersion(e,t,n){return await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,workspace_name:n},{timeoutSeconds:Xe})}async setWorkblockV2(e,t,n){return await this.requests.setWorkBlockV2({workblock:t,branch:n.branch,expected_commit_ref:n.expectedCommitRef,advance_version:n.advanceVersion||void 0},{streamId:e,timeoutSeconds:Xe})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Xe})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Xe})}async getWorkspaceWorkblock(e){return await this.requests.getWorkblockV2({},{streamId:e})??void 0}async getDocsContent(){return(await this.requests.getDocsContent({})).content}async runModule(e,t,n){return(await this.requests.runModule({module_id:t,inputs:n},{streamId:e})).run_id}async runSingleTask(e,t,n,r){return await this.requests.runSingleTask({module_id:t,task_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,n){return(await this.requests.wbRunTest({module_id:n,workblock_id:t},{streamId:e,timeoutSeconds:Xe})).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})}disconnect(){this.connected=!1,this.closing=!0,this.rejectAllPending(new Error("WebSocket disconnected")),this.ws?.close(),this.streamHandlers=[],this.eventHandlers=[],this.currentUserHandlers=[],this.store={},this.SequenceID=0}handleListStreams(e){let t=[];(e??[]).forEach(n=>{n.editing&&t.push(n)}),this.streamHandlers.forEach(n=>n(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,n]of Object.entries(this.store))n&&(clearTimeout(n.timeoutHandle),n.reject(e),delete this.store[Number(t)])}reportConnectionError(e,t){this.lastConnectionError=e,this.connectionErrorHandlers.forEach(n=>n({host:this.connectionHost,url:this.connectionUrl,reason:e,statusCode:t}))}};var Vl=3600*1e3,Fb=600*1e3;function Lb(s){return typeof s=="object"&&s!==null&&"data"in s&&typeof s.data=="string"&&"timestamp"in s&&typeof s.timestamp=="number"}var cr=class extends js{context;constructor(e=!0){super(e)}connect(e,t,n){this.context=n,super.connect(e,t),this.ws?.on("open",()=>{this.cleanupExpiredCache().catch(console.error),this.lastCleanup=Date.now()}),this.ws?.on("close",(r,i)=>{this.connected&&or.window.showErrorMessage(`WebSocket disconnected. Code: ${r}, Reason: ${i}`)}),this.ws?.on("error",r=>{this.connected&&or.window.showErrorMessage(`WebSocket error: ${r.message}`)})}async fetchWithCache(e,t){let n=Date.now();n-this.lastCleanup>Fb&&(await this.cleanupExpiredCache(),this.lastCleanup=n);let r=`${e}${JSON.stringify(t)}`;try{let i=this.context?.globalState.get(r);if(i&&Date.now()-i.timestamp<Vl)return new Response(i.data);let a=await fetch(e,t),o=await a.text();return a.ok&&await this.context?.globalState.update(r,{data:o,timestamp:Date.now()}),new Response(o,a)}catch(i){return or.window.showErrorMessage(`Cache error: ${i}`),fetch(e,t)}}async cleanupExpiredCache(){if(!this.context)return;let e=this.context.globalState.keys(),t=Date.now();for(let n of e){let r=this.context.globalState.get(n);Lb(r)&&t-r.timestamp>Vl&&await this.context.globalState.update(n,void 0)}}};var W=M(require("vscode"));var Sa="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Bb=new RegExp(`^(.+)@users/${Sa}$`,"i"),Mb=new RegExp(`^.+@stream/${Sa}$`,"i"),Gl=new RegExp(`@thread/${Sa}$`,"i"),Wb="AlreadyExists",$b="PermissionDenied",jb="already exists on this branch";function Qe(s){return s.replace(Gl,"")}function zb(s){return Gl.test(s)}function et(s){return s?Mb.test(Qe(s)):!1}function zs(s){return s.startsWith("features/")&&s!=="features/"&&!s.includes("@users/")&&!s.includes("@stream/")&&!s.includes("@thread/")}function ns(s){let e=Qe(s),t=e.lastIndexOf("@stream/");if(t!==-1)return e.slice(0,t);let n=e.lastIndexOf("@users/");return n!==-1?e.slice(0,n):e}function vt(s){return ns(s).replace(/^features\//,"")}function ur(s){let e=ns(s);return zs(e)?e:void 0}function Ub(s){if(zb(s)||et(s))return;let e=s.match(Bb);return e?{branch:e[1],createUserBranch:!0}:{branch:s,createUserBranch:!1}}function Kl(s){return!s.archived&&et(s.branch)}function Vb(s,e){return s.filter(t=>Kl(t)&&ns(t.branch??"")===e).reduce((t,n)=>{if(!t)return n;let r=Date.parse(t.updated_at||t.created_at);return Date.parse(n.updated_at||n.created_at)>r?n:t},void 0)}function Jl(s,e,t){let n=new Map(e.map(i=>[i.name,i])),r=new Map(s.map(i=>[i.name,i]));for(let i of t){if(!i.branch||!Kl(i))continue;let a=n.get(i.branch);a&&r.set(a.name,{...a,workspace:i})}return[...r.values()]}function Yl(s){if(typeof s=="object"&&s!==null&&"code"in s){let e=s.code;if(typeof e=="string")return e}}function lr(s){return s instanceof Error?s.message:String(s)}function Zl(s){return Yl(s)===Wb||lr(s).includes(jb)}function Hb(s){return Yl(s)===$b}async function va(s,e,t){try{return{ok:!0,value:await s}}catch(n){return e?.(`[workspace] ${t??"request"} failed: ${lr(n)}`),{ok:!1,error:n}}}async function Xl(s,e,t,n){let r=await va(s,t,n);return r.ok?r.value:e}async function Hl(s,e,t){try{await s.getStudioWorkspace(e);return}catch(i){if(!Hb(i)){t.log?.(`[workspace] could not verify access to ${e}: ${lr(i)}`);return}}let n=(await Xl(s.listStudioWorkspaces(void 0,t.workblockId),[],t.log,"list_studio_workspaces")).find(i=>i.id===e),r=n?.title?.trim()?`"${n.title.trim()}"`:e;throw new Error(`Branch ${t.branch} is open in Studio workspace ${r}, which you are not a member of. Ask its owner to share it, or work on your own branch.`)}async function Na(s,e){let{workblockId:t,branch:n,log:r}=e,i=Qe(n),a=await va(s.findStudioWorkspaceOnBranch(t,i),r,"find_studio_workspace_on_branch"),o=a.ok?void 0:a.error,c=a.ok?a.value:void 0;if(c)return await Hl(s,c,e),{streamId:c,created:!1};let u=Ub(n);if(!u)throw o?new Error(`Could not look up the Studio workspace for ${n}: ${lr(o)}`):new Error(`No active Studio workspace on ${n}. Open ${ns(n)} instead to start a new conversation on it.`);let l=e.title,d=!u.createUserBranch&&zs(u.branch);if(d){let p=e.userId?await va(s.listStudioWorkspaces(e.userId,t),r,"list_studio_workspaces"):{ok:!0,value:[]};if(p.ok){let m=Vb(p.value,u.branch);if(m?.branch){let f=await Xl(s.findStudioWorkspaceOnBranch(t,m.branch),void 0,r,"find_studio_workspace_on_branch");if(f)return{streamId:f,created:!1}}}l=void 0}try{return{streamId:(await s.createStudioWorkspace(t,u.branch,l,u.createUserBranch)).id,created:!0}}catch(p){if(!Zl(p)||d)throw p;let m=await s.findStudioWorkspaceOnBranch(t,i);if(!m)throw p;return await Hl(s,m,e),{streamId:m,created:!1}}}async function Ql(s,e,t){if(!zs(t))throw new Error(`Conversations fork from a version branch; ${t} is not one.`);return s.createStudioWorkspace(e,t)}var Gb="00000000-0000-0000-0000-000000000000";function Us(s){return s.replace(/^features\//,"").includes("@users/")}function dr(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=>!Us(t.name)).map(t=>vt(t.name)));return s.filter(t=>t.name==="main"?!0:!t.name.startsWith("features/")||t.name.includes("@thread/")||t.name.includes("@stream/")?!1:Us(t.name)?e.has(vt(t.name)):!0)}function ed(s){let e=Qe(s),t=e.lastIndexOf("@users/");return t!==-1?e.slice(0,t):e}function Ca(s){let e=Qe(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!==Gb)return s.owner_id}function td(s,e){return s.filter(t=>t.name.startsWith("features/")||t.name.startsWith("users/")).filter(t=>!t.name.includes("@thread/")).filter(t=>Ca(t)===e)}function Kb(s,e){let t=new Set(s.filter(n=>n.name.startsWith("features/")).filter(n=>!n.name.includes("@thread/")).filter(n=>!Ca(n)).map(n=>ed(n.name)));return s.filter(n=>n.name.startsWith("features/")).filter(n=>!n.name.includes("@thread/")).filter(n=>Ca(n)===e).filter(n=>t.has(ed(n.name)))}function Jb(s,e,t){let n=dr(s),r=Kb(s,e);return r.length>0?r:t?n.filter(i=>i.name==="main"):[]}function sd(s){let e={};for(let t of s)t.archived||!et(t.branch)||(e[t.workblock_id]??=[]).push(t);return e}function nd(s,e,t,n){return Jl(Jb(s,t,n),s,e)}var se={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 Ea(s){return s?`Change directory from ${s}`:se.ChooseDirectory}function rd(s){let e=[Ea(s.dir)];return ur(s.branch)&&e.push(se.NewConversation),s.dir&&(e.push(se.RemoveDirectoryBinding),e.push(se.GetBranch),e.push(se.StoreBranch),e.push(s.syncEnabled?se.DisableSync:se.EnableSync),s.modified&&e.push(se.CompareChanges)),e}function ye(s,e,t){return[s,e,t].map(encodeURIComponent).join("|")}var pr=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"))}}},mr=class extends W.TreeItem{constructor(t,n){super(t.name,W.TreeItemCollapsibleState.Collapsed);this.workblock=t;this.connection=n;this.contextValue="beyondwork.workblock",this.description=t.state,this.iconPath=new W.ThemeIcon("package"),this.tooltip=`${t.name}
151
151
  ${t.id}`}},Aa=class extends W.TreeItem{constructor(t,n,r,i,a,o){let c=et(n.name),u=c?n.workspace?.title?.trim()||"New conversation":Us(n.name)?vt(n.name):n.name;super({label:u,highlights:o?[[0,u.length]]:[]},W.TreeItemCollapsibleState.None);this.workblock=t;this.branch=n;this.connection=i;this.syncEnabled=a;this.modified=o;this.contextValue="beyondwork.branch",this.key=ye(i.host,t.id,n.name),this.dir=r,this.iconPath=this.getIcon(),this.command={command:"beyondwork.beyondwork.showStreamOptions",title:"Show options",arguments:[this]},this.description=c?vt(n.name):Us(n.name)?"your branch":n.last_changed,r?(this.tooltip=`Bound to ${r}`,o&&(this.tooltip+=" (out of sync)")):this.tooltip=c?`${t.name}
152
152
  ${u}
153
153
  ${n.name}
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.37",
6
+ "version": "0.1.38",
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"
@@ -41,7 +41,9 @@ done from Studio.
41
41
  checkout). Without `--update`, or when the CLI reports the push as not published, the version
42
42
  stays behind, and a deploy in Studio would ship it without your change.
43
43
  7. **Prove it.** Run `wb-cli test [<module>]` when the module has tests, then `wb-cli run
44
- <module>`, or `wb-cli run <module>/<task> --inputs '{...}'`, for what you changed. A run never
44
+ <module>`, or `wb-cli run <module>/<task> --inputs '{...}'`, for what you changed. Since wb-cli
45
+ 0.1.36, `wb-cli run <module>/<task>` calls an invokable task without a run. It returns no run id
46
+ and no logs, and the active run stays unchanged. A run never
45
47
  passes through Studio's Start and stops at a task UI. Drive what a person sees, from Start
46
48
  through each task UI to the result, in a browser as `references/browser-validation.md` next to
47
49
  this file describes. That needs a browser tool that acts where the user is signed in to the