@beyondwork/wb-cli 0.1.47 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/extension.js CHANGED
@@ -149,7 +149,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
149
149
  `).map(e=>e.trim()).join(" ")};Ob.O=function(s){return this.inspectOpts.colors=this.useColors,ma.inspect(s,this.inspectOpts)}});var Pb=E((BO,vd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?vd.exports=Eb():vd.exports=Db()});var Ss,Sd,Fb,qb,Mb,Lb=B(()=>{Ii();Ss={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Sd={get(s){return{signature:j.get(s,0),compressedSize:j.get(s,8),uncompressedSize:j.get(s,12)}},len:16},Fb={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},qb={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},Mb={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 Wb(s){let e=new Uint8Array(j.len);return j.put(e,0,s),e}function kE(s,e){let t=s.length,n=e.length;if(n>t)return-1;for(let i=0;i<=t-n;i++){let r=!0;for(let o=0;o<n;o++)if(s[i+o]!==e[o]){r=!1;break}if(r)return i}return-1}function xE(s){let e=s.reduce((i,r)=>i+r.length,0),t=new Uint8Array(e),n=0;for(let i of s)t.set(i,n),n+=i.length;return t}var Bb,ot,Nd,bE,ba,Ns,$b=B(()=>{Ii();Bb=q(Pb(),1);Lb();ot=(0,Bb.default)("tokenizer:inflate"),Nd=256*1024,bE=Wb(Ss.DataDescriptor),ba=Wb(Ss.EndOfCentralDirectory),Ns=class s{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(Nd)}async isZip(){return await this.peekSignature()===Ss.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 i=n.length-4;i>=0;i--)if(n[i]===ba[0]&&n[i+1]===ba[1]&&n[i+2]===ba[2]&&n[i+3]===ba[3])return e.fileInfo.size-t+i;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){ot("Cannot reading central-directory without random-read support");return}ot("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){ot("Central-directory 32-bit signature found");let n=await this.tokenizer.readToken(qb,t),i=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let r=0;r<n.nrOfEntriesOfSize;++r){let o=await this.tokenizer.readToken(Mb);if(o.signature!==Ss.CentralFileHeader)throw new Error("Expected Central-File-Header signature");o.filename=await this.tokenizer.readToken(new xe(o.filenameLength,"utf-8")),await this.tokenizer.ignore(o.extraFieldLength),await this.tokenizer.ignore(o.fileCommentLength),i.push(o),ot(`Add central-directory file-entry: n=${r+1}/${i.length}: filename=${i[r].filename}`)}return this.tokenizer.setPosition(e),i}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{let i=await this.readLocalFileHeader();if(!i)break;let r=e(i);n=!!r.stop;let o;if(await this.tokenizer.ignore(i.extraFieldLength),i.dataDescriptor&&i.compressedSize===0){let a=[],c=Nd;ot("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let u=-1;for(;u<0&&c===Nd;){c=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),u=kE(this.syncBuffer.subarray(0,c),bE);let l=u>=0?u:c;if(r.handler){let d=new Uint8Array(l);await this.tokenizer.readBuffer(d),a.push(d)}else await this.tokenizer.ignore(l)}ot(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),r.handler&&await this.inflate(i,xE(a),r.handler)}else r.handler?(ot(`Reading compressed-file-data: ${i.compressedSize} bytes`),o=new Uint8Array(i.compressedSize),await this.tokenizer.readBuffer(o),await this.inflate(i,o,r.handler)):(ot(`Ignoring compressed-file-data: ${i.compressedSize} bytes`),await this.tokenizer.ignore(i.compressedSize));if(ot(`Reading data-descriptor at pos=${this.tokenizer.position}`),i.dataDescriptor&&(await this.tokenizer.readToken(Sd)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Sd.len}`)}while(!n)}async iterateOverCentralDirectory(e,t){for(let n of e){let i=t(n);if(i.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);let r=await this.readLocalFileHeader();if(r){await this.tokenizer.ignore(r.extraFieldLength);let o=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(o),await this.inflate(r,o,i.handler)}}if(i.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}`);ot(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let i=await s.decompressDeflateRaw(t);return n(i)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(r){r.enqueue(e),r.close()}}),n=new DecompressionStream("deflate-raw"),i=t.pipeThrough(n);try{let o=await new Response(i).arrayBuffer();return new Uint8Array(o)}catch(r){let o=r instanceof Error?`Failed to deflate ZIP entry: ${r.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(o)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(j);if(e===Ss.LocalFileHeader){let t=await this.tokenizer.readToken(Fb);return t.filename=await this.tokenizer.readToken(new xe(t.filenameLength,"utf-8")),t}if(e===Ss.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var Ti,jb=B(()=>{Ti=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let n=new Uint8Array(1024),i=await e.readBuffer(n,{mayBeLess:!0});if(i===0){t.close();return}t.enqueue(n.subarray(0,i))}}).pipeThrough(new DecompressionStream("gzip"))}}});var zb=B(()=>{$b();jb()});function Ed(s){let{byteLength:e}=s;if(e===6)return s.getUint16(0)*2**32+s.getUint32(2);if(e===5)return s.getUint8(0)*2**32+s.getUint32(1);if(e===4)return s.getUint32(0);if(e===3)return s.getUint8(0)*2**16+s.getUint16(1);if(e===2)return s.getUint16(0);if(e===1)return s.getUint8(0)}var JO,YO,ZO,Ub=B(()=>{JO={utf8:new globalThis.TextDecoder("utf8")},YO=new globalThis.TextEncoder,ZO=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"))});function Vb(s,e){if(e==="utf-16le"){let t=[];for(let n=0;n<s.length;n++){let i=s.charCodeAt(n);t.push(i&255,i>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let n=0;n<s.length;n++){let i=s.charCodeAt(n);t.push(i>>8&255,i&255)}return t}return[...s].map(t=>t.charCodeAt(0))}function Gb(s,e=0){let t=Number.parseInt(new xe(6).get(s,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let n=256;for(let i=e;i<e+148;i++)n+=s[i];for(let i=e+156;i<e+512;i++)n+=s[i];return t===n}var Hb,Kb=B(()=>{Ii();Hb={get:(s,e)=>s[e+3]&127|s[e+2]<<7|s[e+1]<<14|s[e]<<21,len:4}});var Jb,Yb,Zb=B(()=>{Jb=["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"],Yb=["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 DE(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 Ad(s,e,t){if(!Number.isFinite(s)||s<0||s>e)throw new yt(`${t} has invalid size ${s} (maximum ${e} bytes)`);return s}async function Ut(s,e,{maximumLength:t=Pe,reason:n="skip"}={}){let i=Ad(e,t,n);await s.ignore(i)}async function Rd(s,e,t,{maximumLength:n=e.length,reason:i="read"}={}){let r=t?.length??e.length,o=Ad(r,n,i);return s.readBuffer(e,{...t,length:o})}async function PE(s,{maximumLength:e=ct}={}){let i=new ReadableStream({start(u){u.enqueue(s),u.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),r=[],o=0;try{for(;;){let{done:u,value:l}=await i.read();if(u)break;if(o+=l.length,o>e)throw await i.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);r.push(l)}}finally{i.releaseLock()}let a=new Uint8Array(o),c=0;for(let u of r)a.set(u,c),c+=u.length;return a}function qE(s,e){if(s.length<ka)return-1;let t=s.length-ka;for(let n=0;n<=t;n++)if(j.get(s,n)===lk&&j.get(s,n+8)===e+n)return n;return-1}function ME(s){return(s.codePointAt(0)&32)!==0}function LE(s,e){let t=new Uint8Array(e),n=0;for(let i of s)t.set(i,n),n+=i.length;return t}async function BE(s,{shouldBuffer:e,maximumLength:t=ct}={}){let{syncBuffer:n}=s,{length:i}=n,r=[],o=0;for(;;){let a=await s.tokenizer.peekBuffer(n,{mayBeLess:!0}),c=qE(n.subarray(0,a),o),u=c>=0?0:a===i?Math.min(FE,a-1):0,l=c>=0?c:a-u;if(l===0)break;if(o+=l,o>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let d=new Uint8Array(l);await s.tokenizer.readBuffer(d),r.push(d)}else await s.tokenizer.ignore(l);if(c>=0)break}if(de(s.tokenizer)||(s.knownSizeDescriptorScannedBytes+=o),!!e)return LE(r,o)}function WE(s,e){return de(s.tokenizer)?Math.max(0,Pe-(s.tokenizer.position-e)):Math.max(0,ct-s.knownSizeDescriptorScannedBytes)}async function $E(s,e,{shouldBuffer:t,maximumDescriptorLength:n=ct}={}){if(e.dataDescriptor&&e.compressedSize===0)return BE(s,{shouldBuffer:t,maximumLength:n});if(!t){await Ut(s.tokenizer,e.compressedSize,{maximumLength:de(s.tokenizer)?ct:s.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let i=GE(s.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>i)throw new Error(`ZIP entry compressed data exceeds ${i} bytes`);let r=new Uint8Array(e.compressedSize);return await s.tokenizer.readBuffer(r),r}function jE(s,e){let t=s.getReader(),n=0,i=!1,r=!1,o=async a=>{i||r||(r=!0,await t.cancel(a))};return new ReadableStream({async pull(a){if(n>=e){a.close(),await o();return}let{done:c,value:u}=await t.read();if(c||!u){i=!0,a.close();return}let l=e-n;if(u.length>l){a.enqueue(u.subarray(0,l)),n+=l,a.close(),await o();return}a.enqueue(u),n+=u.length},async cancel(a){await o(a)}})}async function dk(s,e){return new Cs(e).fromBuffer(s)}async function pk(s,e){return new Cs(e).fromBlob(s)}function ak(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 at(s,e,t){t={offset:0,...t};for(let[n,i]of e.entries())if(t.mask){if(i!==(t.mask[n]&s[n+t.offset]))return!1}else if(i!==s[n+t.offset])return!1;return!0}function Id(s){return Number.isFinite(s)?Math.max(1,Math.trunc(s)):Es}function zE(s,e,t){return t===void 0?s.read(e):(t.throwIfAborted(),new Promise((n,i)=>{let r=()=>{t.removeEventListener("abort",o)},o=()=>{let a=t.reason;r(),(async()=>{try{await s.cancel(a)}catch{}})(),i(a)};t.addEventListener("abort",o,{once:!0}),(async()=>{try{let a=await s.read(e);r(),n(a)}catch(a){r(),i(a)}})()}))}function UE(s){return Number.isFinite(s)?Math.max(0,Math.min(_E,Math.trunc(s))):0}function VE(s){return Number.isFinite(s)?Math.max(0,s):Number.MAX_SAFE_INTEGER}function de(s){let e=s.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function Oi(s,e,t){return de(s)&&s.position-e>t}function GE(s){let e=s.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-s.position):Number.MAX_SAFE_INTEGER;return Math.min(t,wE)}function HE(s){if(s instanceof P||s instanceof yt)return!0;if(!(s instanceof Error))return!1;if(IE.has(s.message)||OE.has(s.code))return!0;for(let e of TE)if(s.message.startsWith(e))return!0;return!1}function ck(s,e=ct){let t=[s.compressedSize,s.uncompressedSize];for(let n of t)if(!Number.isFinite(n)||n<0||n>e)return!1;return!0}function KE(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function JE(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 uk(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 YE(s){let e=s.indexOf('.main+xml"');if(e===-1){let i="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return s.includes(`ContentType="${i}"`)?i:void 0}let t=s.slice(0,e),n=t.lastIndexOf('"');return t.slice(n+1)}async function fk(s,e){return new Cs(e).fromTokenizer(s)}var Es,_E,ct,Xb,wE,Pe,xa,Qb,yE,vE,ek,Cd,tk,sk,SE,NE,EE,CE,RE,nk,ik,rk,AE,ok,IE,TE,OE,yt,lk,ka,FE,Cs,hk,mk,Td=B(()=>{Ii();la();zb();Ub();Kb();Zb();Es=4100,_E=Es-2,ct=1024*1024,Xb=1024,wE=2**31-1,Pe=16*1024*1024,xa=ct,Qb=ct,yE=Pe,vE=1,ek=100,Cd=Pe,tk=64,sk=xa,SE=256,NE=512,EE=Pe,CE=512,RE=512,nk=256,ik=xa,rk=xa,AE=xa,ok=Pe,IE=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),TE=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],OE=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),yt=class extends Error{};lk=134695760,ka=16,FE=ka-1;Ns.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 PE(e,{maximumLength:ct});return t(n)};Ns.prototype.unzip=async function(s){let e=!1,t=0,n=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Oi(this.tokenizer,n,Pe))throw new yt(`ZIP stream probing exceeds ${Pe} bytes`);let i=await this.readLocalFileHeader();if(!i)break;if(t++,t>Xb)throw new Error(`ZIP entry count exceeds ${Xb}`);let r=s(i);e=!!r.stop,await this.tokenizer.ignore(i.extraFieldLength);let o=await $E(this,i,{shouldBuffer:!!r.handler,maximumDescriptorLength:Math.min(ct,WE(this,n))});if(r.handler&&await this.inflate(i,o,r.handler),i.dataDescriptor){let a=new Uint8Array(ka);if(await this.tokenizer.readBuffer(a),j.get(a,0)!==lk)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(Oi(this.tokenizer,n,Pe))throw new yt(`ZIP stream probing exceeds ${Pe} bytes`)}while(!e)};Cs=class s{constructor(e){let t=UE(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 DE(cb(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let n=e.position;for(let i of this.detectors){let r;try{r=await i.detect(e)}catch(o){if(o instanceof P||o instanceof yt)return;throw o}if(r)return r;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(ub(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=lb(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=Id(t?.sampleSize??Es),i,r,o=e.getReader({mode:"byob"});try{let{value:u,done:l}=await zE(o,new Uint8Array(n),this.options.signal);if(r=u,!l&&u)try{i=await this.fromBuffer(u.subarray(0,n))}catch(d){if(!(d instanceof P))throw d;i=void 0}r=u}finally{o.releaseLock()}let a=new TransformStream({async start(u){u.enqueue(r)},transform(u,l){l.enqueue(u)}}),c=e.pipeThrough(a);return c.fileType=i,c}async detectGzip(e){if(this.gzipProbeDepth>=vE)return{ext:"gz",mime:"application/gzip"};let t=new Ti(e),n=jE(t.inflate(),yE),i=de(e),r,o,a,c;if(i){let u=new AbortController;r=setTimeout(()=>{u.abort(new DOMException(`Operation timed out after ${ek} ms`,"TimeoutError"))},ek),o=this.options.signal===void 0?u.signal:AbortSignal.any([this.options.signal,u.signal]),a=new s({...this.options,signal:o}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{c=await(a??this).fromStream(n)}catch(u){if(u?.name==="AbortError"&&o?.reason?.name!=="TimeoutError")throw u}finally{clearTimeout(r),i||this.gzipProbeDepth--}return c?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return at(this.buffer,e,t)}checkString(e,t){return this.check(Vb(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(Es),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,de(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=nk?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 Ut(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(Hb),n=de(e);if(!Number.isFinite(t)||t<0||n&&(t>Cd||e.position+t>Cd))return;if(e.position+t>e.fileInfo.size)return n?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await Ut(e,t,{maximumLength:n?Cd:e.fileInfo.size,reason:"ID3 payload"})}catch(i){if(i instanceof P)return;throw i}return this.detectionReentryCount>=nk?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=KE();try{await new Ns(e).unzip(i=>{JE(n,i.filename);let r=i.filename==="[Content_Types].xml",o=uk(n);if(!r&&o)return t=o,{stop:!0};switch(i.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 ck(i,Qb)?{async handler(a){let c=new TextDecoder("utf-8").decode(a).trim();t=ak(c)},stop:!0}:{};case"[Content_Types].xml":return n.hasContentTypesEntry=!0,ck(i,Qb)?(n.isParsingContentTypes=!0,{async handler(a){let c=new TextDecoder("utf-8").decode(a),u=YE(c);u&&(t=ak(u)),n.hasParsedContentTypesEntry=!0,n.isParsingContentTypes=!1},stop:!0}):(n.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(i.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(i){if(!HE(i))throw i;n.isParsingContentTypes&&(n.isParsingContentTypes=!1,n.hasUnparseableContentTypes=!0)}return t??uk(n)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),at(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:at(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:at(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:at(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:at(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:at(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(_b),u=128,l=0;for(;(c&u)===0&&u!==0;)++l,u>>=1;let d=new Uint8Array(l+1);return await Rd(e,d,void 0,{maximumLength:d.length,reason:"EBML field"}),d}async function 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:Ed(d),len:Ed(p)}}async function i(c){let u=0;for(;c>0;){if(u++,u>SE||Oi(e,o,Pe))return;let l=e.position,d=await n();if(d.id===17026){if(d.len>tk)return;let p=Ad(d.len,tk,"EBML DocType");return(await e.readToken(new xe(p))).replaceAll(/\00.*$/g,"")}if(de(e)&&(!Number.isFinite(d.len)||d.len<0||d.len>sk)||(await Ut(e,d.len,{maximumLength:de(e)?sk:e.fileInfo.size,reason:"EBML payload"}),--c,e.position<=l))return}}let r=await n(),o=e.position;switch(await i(r.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=_d.get(this.buffer,4),n=ys.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 xe(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 xe(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
150
150
  `,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},n={ext:"apng",mime:"image/apng"};await e.ignore(8);async function i(){return{length:await e.readToken(wb),type:await e.readToken(new xe(4,"latin1"))}}let r=de(e),o=e.position,a=0,c=!1;do{if(a++,a>NE||Oi(e,o,EE))break;let u=e.position,l=await i();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(r&&l.length>ik)return c&&ME(l.type)?t:void 0;try{await Ut(e,l.length+4,{maximumLength:r?ik+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(d){if(!r&&(d instanceof yt||d instanceof P))return t;throw d}}if(e.position<=u)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new xe(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
151
151
  `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function n(){let a=new Uint8Array(16);return await Rd(e,a,void 0,{maximumLength:a.length,reason:"ASF header GUID"}),{id:a,size:Number(await e.readToken(yb))}}await Ut(e,30,{maximumLength:30,reason:"ASF header prelude"});let i=de(e),r=e.position,o=0;for(;e.position+24<e.fileInfo.size&&(o++,!(o>CE||Oi(e,r,Pe)));){let a=e.position,c=await n(),u=c.size-24;if(!Number.isFinite(u)||u<0){t=!0;break}if(at(c.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let l=new Uint8Array(16);if(u-=await Rd(e,l,void 0,{maximumLength:l.length,reason:"ASF stream type GUID"}),at(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(at(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(i&&u>rk){t=!0;break}if(await Ut(e,u,{maximumLength:i?rk:e.fileInfo.size,reason:"ASF header payload"}),e.position<=a){t=!0;break}}}catch(n){if(n instanceof P||n instanceof yt)de(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 xe(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})&&Gb(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:t})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:t})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
152
- `,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(Es);let t=VE(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 i=this.scanMpeg(n);if(i)return i}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?ys: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?ys:z);if(!(t>RE)&&!(de(this.tokenizer)&&2+t*12>ok))for(let n=0;n<t;++n){let i=await this.readTiffTag(e);if(i)return i}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},n=(e?ys:z).get(this.buffer,2),i=(e?_d:j).get(this.buffer,4);if(n===42){if(i>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(i>=8){let a=(e?ys:z).get(this.buffer,8),c=(e?ys:z).get(this.buffer,10);if(a===28&&c===254||a===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(de(this.tokenizer)&&i>AE)return t;let r=de(this.tokenizer)?ok:this.tokenizer.fileInfo.size;try{await Ut(this.tokenizer,i,{maximumLength:r,reason:"TIFF IFD offset"})}catch(a){if(a instanceof P)return;throw a}let o;try{o=await this.readTiffIFD(e)}catch(a){if(a instanceof P)return;throw a}return o??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"}}}},hk=new Set(Jb),mk=new Set(Yb)});var kk={};Fs(kk,{FileTypeParser:()=>kn,fileTypeFromBlob:()=>pk,fileTypeFromBuffer:()=>dk,fileTypeFromFile:()=>XE,fileTypeFromStream:()=>QE,fileTypeFromTokenizer:()=>fk,fileTypeStream:()=>eC,supportedExtensions:()=>hk,supportedMimeTypes:()=>mk});function ZE(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 XE(s,e){return new kn(e).fromFile(s,e)}async function QE(s,e){return new kn(e).fromStream(s)}async function eC(s,e={}){return new kn(e).toDetectionStream(s,e)}var gk,Vt,bk,Od,kn,xk=B(()=>{gk=require("node:stream/web"),Vt=require("node:stream"),bk=q(require("node:fs/promises"),1),Od=require("node:fs");hb();Td();Td();kn=class extends Cs{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof gk.ReadableStream?this.createTokenizerFromWebStream(e):fb(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(n){if(ZE(n))return;throw n}finally{e instanceof Vt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await bk.default.open(e,Od.constants.O_RDONLY|Od.constants.O_NONBLOCK),n=await t.stat();if(!n.isFile()){await t.close();return}let i=new ws(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:n.size}});return super.fromTokenizer(i)}async toDetectionStream(e,t={}){if(!(e instanceof Vt.Readable))return super.toDetectionStream(e,t);let{sampleSize:n=Es}=t,{signal:i}=this.options,r=Id(n);return i?.throwIfAborted(),new Promise((o,a)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",h),i?.removeEventListener("abort",p)},l=(m,f)=>{c||(c=!0,u(),m(f))},d=m=>{l(a,m)},p=()=>{e.destroyed||e.destroy(),l(a,i.reason)},h=()=>{(async()=>{try{let m=new Vt.PassThrough,f=Vt.pipeline?(0,Vt.pipeline)(e,m,()=>{}):e.pipe(m),g=e.read(r)??e.read()??new Uint8Array(0);try{m.fileType=await this.fromBuffer(g)}catch(b){b instanceof P?m.fileType=void 0:l(a,b)}l(o,f)}catch(m){l(a,m)}})()};e.on("error",d),e.once("readable",h),i?.addEventListener("abort",p,{once:!0})})}}});var iR={};Fs(iR,{activate:()=>sR,connectToHost:()=>Ha,deactivate:()=>nR});module.exports=qx(iR);var N=q(require("vscode"));var yr=q(require("vscode"));var nw=q(df(),1),iw=q(fr(),1),rw=q(Ls(),1),ow=q(ic(),1),aw=q(ac(),1),cw=q(fc(),1),_f=q(br(),1),uw=q(xf(),1);var xr=_f.default;var mc=s=>s.replace("work_block","workblock"),_r=["module_id","parent_task_def_id","parent_task_id","run_id","stream_id","wcb_id"],lw={ask_agent:["conversation_id","message_id","run_id"],authz_schema_apply:["version_id"],authz_schema_draft_emit_event:["workblock_id"],authz_schema_force_apply:["version_id"],authz_schema_initialize_for_workblock:["schema_id"],authz_schema_propose:["parent_version_id","schema_id"],cancel_child:_r,complete_child:_r,continue_from_message:["thread_id"],convert_legacy_stream:["editing_task_id","id","parent_id"],create_access_token:["access_token"],create_group:["id"],create_oauth_client:["client"],create_oauth_registration_token:["registration_token"],create_stream:["run_id","stream_id"],create_studio_workspace:["stream","workspace"],create_user:["id"],create_workblock:["stream","workspace"],create_workblock_schedule:["id","user","wcb_id"],create_workblock_version:["stream","workspace"],discard_permission_request:["request_id"],get_edit_stream:["editing_task_id","id","parent_id"],get_space_stream:["run_id","stream_id"],initiate_credential_oauth:["attempt_id"],initiate_task_credential_oauth:["attempt_id"],interrupt_child:_r,message_child:_r,publish_to_registry:["id"],recreate_edit_stream:["stream"],register_workblock_event:["id","stream_id","workblock_id"],remix_workblock_v2:["workblock_id"],rename_data_environment:["environment"],request_permission:["request_id"],restart_studio_workspace_thread:["previous_thread_id","thread_id"],run_module:["run_id"],run_workblock_replay_tests:["workflow_id"],set_legal_hold:["run_id"],set_retention_policy:["workblock_id"],set_work_block:["work_block"],set_work_block_v2:["work_block"],start_branch_thread:["thread_id"],update_task:["task"],update_workblock_schedule:["id","user","wcb_id"],upsert_space:["id"]},wr=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 cancelWorkblockNotification(e,t){return await this.requestWithTracking("cancel_workblock_notification",e,t)}async changelogMarkSeen(e,t){return await this.requestWithTracking("changelog_mark_seen",e,t)}async chatQueue(e,t){return await this.requestWithTracking("chat_queue",e,t)}async closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",e,t)}async completeConfigCredentialOauth(e,t){return await this.requestWithTracking("complete_config_credential_oauth",e,t)}async completeCredentialOauth(e,t){return await this.requestWithTracking("complete_credential_oauth",e,t)}async completeRunCredentialOauth(e,t){return await this.requestWithTracking("complete_run_credential_oauth",e,t)}async continueFromMessage(e,t){return await this.requestWithTracking("continue_from_message",e,t)}async continueUi(e,t){return await this.requestWithTracking("continue_ui",e,t)}async convertLegacyStream(e,t){return await this.requestWithTracking("convert_legacy_stream",e,t)}async createAccessToken(e,t){return await this.requestWithTracking("create_access_token",e,t)}async createCredential(e,t){return await this.requestWithTracking("create_credential",e,t)}async createGroup(e,t){return await this.requestWithTracking("create_group",e,t)}async createOauthClient(e,t){return await this.requestWithTracking("create_oauth_client",e,t)}async createOauthRegistrationToken(e,t){return await this.requestWithTracking("create_oauth_registration_token",e,t)}async createStream(e,t){return await this.requestWithTracking("create_stream",e,t)}async createStudioWorkspace(e,t){return await this.requestWithTracking("create_studio_workspace",e,t)}async createUser(e,t){return await this.requestWithTracking("create_user",e,t)}async createWorkblock(e,t){return await this.requestWithTracking("create_workblock",e,t)}async createWorkblockDataEnvironment(e,t){return await this.requestWithTracking("create_workblock_data_environment",e,t)}async createWorkblockSchedule(e,t){return await this.requestWithTracking("create_workblock_schedule",e,t)}async createWorkblockVersion(e,t){return await this.requestWithTracking("create_workblock_version",e,t)}async createWorkblockVersionUpdate(e,t){return await this.requestWithTracking("create_workblock_version_update",e,t)}async 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 deleteDataEnvironment(e,t){return await this.requestWithTracking("delete_data_environment",e,t)}async deleteGroup(e,t){return await this.requestWithTracking("delete_group",e,t)}async deleteLearningExample(e,t){return await this.requestWithTracking("delete_learning_example",e,t)}async deleteOauthClient(e,t){return await this.requestWithTracking("delete_oauth_client",e,t)}async deleteSpace(e,t){return await this.requestWithTracking("delete_space",e,t)}async deleteStudioWorkspace(e,t){return await this.requestWithTracking("delete_studio_workspace",e,t)}async deleteWorkblock(e,t){return await this.requestWithTracking("delete_workblock",e,t)}async deleteWorkblockBranch(e,t){return await this.requestWithTracking("delete_workblock_branch",e,t)}async deleteWorkblockRegistration(e,t){return await this.requestWithTracking("delete_workblock_registration",e,t)}async deleteWorkblockRegistrationEvent(e,t){return await this.requestWithTracking("delete_workblock_registration_event",e,t)}async deleteWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("delete_workblock_run_data_truncation",e,t)}async deleteWorkblockSchedule(e,t){return await this.requestWithTracking("delete_workblock_schedule",e,t)}async deployWorkblockVersion(e,t){return await this.requestWithTracking("deploy_workblock_version",e,t)}async disableWorkblockRegistration(e,t){return await this.requestWithTracking("disable_workblock_registration",e,t)}async discardPermissionRequest(e,t){return await this.requestWithTracking("discard_permission_request",e,t)}async dismissAllNotifications(e,t){return await this.requestWithTracking("dismiss_all_notifications",e,t)}async dismissNotification(e,t){return await this.requestWithTracking("dismiss_notification",e,t)}async enableWorkblockRegistration(e,t){return await this.requestWithTracking("enable_workblock_registration",e,t)}async ensureDefaultWorkblockDataEnvironments(e,t){return await this.requestWithTracking("ensure_default_workblock_data_environments",e,t)}async ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",e,t)}async ensureWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("ensure_workblock_data_environment_namespace",e,t)}async getEditStream(e,t){return await this.requestWithTracking("get_edit_stream",e,t)}async getSpaceStream(e,t){return await this.requestWithTracking("get_space_stream",e,t)}async grantWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("grant_workblock_data_environment_start",e,t)}async help(e,t){return await this.requestWithTracking("help",e,t)}async initiateConfigCredentialOauth(e,t){return await this.requestWithTracking("initiate_config_credential_oauth",e,t)}async initiateCredentialOauth(e,t){return await this.requestWithTracking("initiate_credential_oauth",e,t)}async initiateTaskCredentialOauth(e,t){return await this.requestWithTracking("initiate_task_credential_oauth",e,t)}async insertTasks(e,t){return await this.requestWithTracking("insert_tasks",e,t)}async installWorkblock(e,t){return await this.requestWithTracking("install_workblock",e,t)}async interruptChild(e,t){return await this.requestWithTracking("interrupt_child",e,t)}async invokeRunTask(e,t){return await this.requestWithTracking("invoke_run_task",e,t)}async invokeWorkblockTask(e,t){return await this.requestWithTracking("invoke_workblock_task",e,t)}async join(e,t){return await this.requestWithTracking("join",e,t)}async leave(e,t){return await this.requestWithTracking("leave",e,t)}async markAllNotificationsRead(e,t){return await this.requestWithTracking("mark_all_notifications_read",e,t)}async markNotificationRead(e,t){return await this.requestWithTracking("mark_notification_read",e,t)}async mergeWorkblockBranch(e,t){return await this.requestWithTracking("merge_workblock_branch",e,t)}async messageChild(e,t){return await this.requestWithTracking("message_child",e,t)}async peekWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("peek_workblock_registration_events",e,t)}async permissionsGrant(e,t){return await this.requestWithTracking("permissions_grant",e,t)}async permissionsRevoke(e,t){return await this.requestWithTracking("permissions_revoke",e,t)}async promoteWorkblockDataModel(e,t){return await this.requestWithTracking("promote_workblock_data_model",e,t)}async publishToRegistry(e,t){return await this.requestWithTracking("publish_to_registry",e,t)}async recreateEditStream(e,t){return await this.requestWithTracking("recreate_edit_stream",e,t)}async reembedValidationSet(e,t){return await this.requestWithTracking("reembed_validation_set",e,t)}async registerWorkblockEvent(e,t){return await this.requestWithTracking("register_workblock_event",e,t)}async registrySearch(e,t){return await this.requestWithTracking("registry_search",e,t)}async registrySetParameters(e,t){return await this.requestWithTracking("registry_set_parameters",e,t)}async registrySetTags(e,t){return await this.requestWithTracking("registry_set_tags",e,t)}async rejectLearningData(e,t){return await this.requestWithTracking("reject_learning_data",e,t)}async rejectThreadWorkblock(e,t){return await this.requestWithTracking("reject_thread_workblock",e,t)}async remixWorkblockV2(e,t){return await this.requestWithTracking("remix_workblock_v2",e,t)}async removeGroupMember(e,t){return await this.requestWithTracking("remove_group_member",e,t)}async removeThread(e,t){return await this.requestWithTracking("remove_thread",e,t)}async removeWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("remove_workblock_data_environment_namespace",e,t)}async renameDataEnvironment(e,t){return await this.requestWithTracking("rename_data_environment",e,t)}async requestPermission(e,t){return await this.requestWithTracking("request_permission",e,t)}async resetTask(e,t){return await this.requestWithTracking("reset_task",e,t)}async resetWorkblockBranch(e,t){return await this.requestWithTracking("reset_workblock_branch",e,t)}async resetWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("reset_workblock_data_environment_namespace",e,t)}async resolveWorkblockMergeConflicts(e,t){return await this.requestWithTracking("resolve_workblock_merge_conflicts",e,t)}async restartStudioWorkspaceThread(e,t){return await this.requestWithTracking("restart_studio_workspace_thread",e,t)}async restartWorkblock(e,t){return await this.requestWithTracking("restart_workblock",e,t)}async resumeRetry(e,t){return await this.requestWithTracking("resume_retry",e,t)}async retryWorkblockDataModelApply(e,t){return await this.requestWithTracking("retry_workblock_data_model_apply",e,t)}async revertWorkblockCommit(e,t){return await this.requestWithTracking("revert_workblock_commit",e,t)}async revokeAllOauthConsents(e,t){return await this.requestWithTracking("revoke_all_oauth_consents",e,t)}async revokeOauthConsent(e,t){return await this.requestWithTracking("revoke_oauth_consent",e,t)}async revokeOauthRegistrationToken(e,t){return await this.requestWithTracking("revoke_oauth_registration_token",e,t)}async revokeWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("revoke_workblock_data_environment_start",e,t)}async rotateOauthClientSecret(e,t){return await this.requestWithTracking("rotate_oauth_client_secret",e,t)}async runModule(e,t){return await this.requestWithTracking("run_module",e,t)}async runSingleTask(e,t){return await this.requestWithTracking("run_single_task",e,t)}async runSubgraph(e,t){return await this.requestWithTracking("run_subgraph",e,t)}async runTask(e,t){return await this.requestWithTracking("run_task",e,t)}async runWorkblockReplayTests(e,t){return await this.requestWithTracking("run_workblock_replay_tests",e,t)}async runtimeAuthzAttachRole(e,t){return await this.requestWithTracking("runtime_authz_attach_role",e,t)}async runtimeAuthzDeleteRelation(e,t){return await this.requestWithTracking("runtime_authz_delete_relation",e,t)}async runtimeAuthzDetachRole(e,t){return await this.requestWithTracking("runtime_authz_detach_role",e,t)}async runtimeAuthzStoreRelation(e,t){return await this.requestWithTracking("runtime_authz_store_relation",e,t)}async sendMessage(e,t){return await this.requestWithTracking("send_message",e,t)}async sendWorkblockNotification(e,t){return await this.requestWithTracking("send_workblock_notification",e,t)}async setActiveWorkblockSetting(e,t){return await this.requestWithTracking("set_active_workblock_setting",e,t)}async setAutoApproveConfig(e,t){return await this.requestWithTracking("set_auto_approve_config",e,t)}async setConsumptionLimits(e,t){return await this.requestWithTracking("set_consumption_limits",e,t)}async setEditing(e,t){return await this.requestWithTracking("set_editing",e,t)}async setKeepOpenOnComplete(e,t){return await this.requestWithTracking("set_keep_open_on_complete",e,t)}async setLegalHold(e,t){return await this.requestWithTracking("set_legal_hold",e,t)}async setLogging(e,t){return await this.requestWithTracking("set_logging",e,t)}async setNotificationChannelMuted(e,t){return await this.requestWithTracking("set_notification_channel_muted",e,t)}async setOauthClientEnabled(e,t){return await this.requestWithTracking("set_oauth_client_enabled",e,t)}async setRetentionPolicy(e,t){return await this.requestWithTracking("set_retention_policy",e,t)}async setStudioWorkspaceArchived(e,t){return await this.requestWithTracking("set_studio_workspace_archived",e,t)}async setStudioWorkspaceThread(e,t){return await this.requestWithTracking("set_studio_workspace_thread",e,t)}async setUserSetting(e,t){return await this.requestWithTracking("set_user_setting",e,t)}async setWorkBlock(e,t){return await this.requestWithTracking("set_work_block",e,t)}async setWorkBlockV2(e,t){return await this.requestWithTracking("set_work_block_v2",e,t)}async setWorkblockCommitMessage(e,t){return await this.requestWithTracking("set_workblock_commit_message",e,t)}async setWorkblockConfig(e,t){return await this.requestWithTracking("set_workblock_config",e,t)}async setWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("set_workblock_run_data_truncation",e,t)}async setWorkblockSchedulePaused(e,t){return await this.requestWithTracking("set_workblock_schedule_paused",e,t)}async 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 getWorkblockConfig(e,t){return await this.client.sendMessage({type:"get_workblock_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelDeployPreview(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_deploy_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelStatus(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataSchema(e,t){return await this.client.sendMessage({type:"get_workblock_data_schema",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockFileContent(e,t){return await this.client.sendMessage({type:"get_workblock_file_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockHistoryBundle(e,t){return await this.client.sendMessage({type:"get_workblock_history_bundle",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async 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 graphlakeCatalog(e,t){return await this.client.sendMessage({type:"graphlake_catalog",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeExplore(e,t){return await this.client.sendMessage({type:"graphlake_explore",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeIntrospect(e,t){return await this.client.sendMessage({type:"graphlake_introspect",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeNode(e,t){return await this.client.sendMessage({type:"graphlake_node",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeQuery(e,t){return await this.client.sendMessage({type:"graphlake_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeSearchNodes(e,t){return await this.client.sendMessage({type:"graphlake_search_nodes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiQuery(e,t){return await this.client.sendMessage({type:"graphlake_ui_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiSubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_subscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiUnsubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_unsubscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async 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 listNotificationChannels(e,t){return await this.client.sendMessage({type:"list_notification_channels",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotifications(e,t){return await this.client.sendMessage({type:"list_notifications",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthClients(e,t){return await this.client.sendMessage({type:"list_oauth_clients",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthRegistrationTokens(e,t){return await this.client.sendMessage({type:"list_oauth_registration_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOwnedRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_owned_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listPendingLearningData(e,t){return await this.client.sendMessage({type:"list_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listQdrantCollections(e,t){return await this.client.sendMessage({type:"list_qdrant_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRowstoreCollections(e,t){return await this.client.sendMessage({type:"list_rowstore_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listSpaces(e,t){return await this.client.sendMessage({type:"list_spaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listStudioWorkspaces(e,t){return await this.client.sendMessage({type:"list_studio_workspaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockBranches(e,t){return await this.client.sendMessage({type:"list_workblock_branches",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartOptions(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_options",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartUsers(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironments(e,t){return await this.client.sendMessage({type:"list_workblock_data_environments",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDefinitions(e,t){return await this.client.sendMessage({type:"list_workblock_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockEntityStoreSavedQueries(e,t){return await this.client.sendMessage({type:"list_workblock_entity_store_saved_queries",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRegistrations(e,t){return await this.client.sendMessage({type:"list_workblock_registrations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRowCollections(e,t){return await this.client.sendMessage({type:"list_workblock_row_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataSchemaVersions(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_schema_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataTruncations(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_truncations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunners(e,t){return await this.client.sendMessage({type:"list_workblock_runners",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockSchedules(e,t){return await this.client.sendMessage({type:"list_workblock_schedules",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockVersions(e,t){return await this.client.sendMessage({type:"list_workblock_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsCheck(e,t){return await this.client.sendMessage({type:"permissions_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsDefinitions(e,t){return await this.client.sendMessage({type:"permissions_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsListSubjects(e,t){return await this.client.sendMessage({type:"permissions_list_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsLookupResources(e,t){return await this.client.sendMessage({type:"permissions_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async previewContinueFromMessage(e,t){return await this.client.sendMessage({type:"preview_continue_from_message",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryAuditLog(e,t){return await this.client.sendMessage({type:"query_audit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockEntityStore(e,t){return await this.client.sendMessage({type:"query_workblock_entity_store",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockRunData(e,t){return await this.client.sendMessage({type:"query_workblock_run_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async repeatDone(e,t){return await this.client.sendMessage({type:"repeat_done",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockByTask(e,t){return await this.client.sendMessage({type:"resolve_workblock_by_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockContent(e,t){return await this.client.sendMessage({type:"resolve_workblock_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzCheck(e,t){return await this.client.sendMessage({type:"runtime_authz_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupResources(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupSubjects(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTest(e,t){return await this.client.sendMessage({type:"sandbox_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTestResponse(e,t){return await this.client.sendMessage({type:"sandbox_test_response",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async searchLearningExamples(e,t){return await this.client.sendMessage({type:"search_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskProgress(e,t){return await this.client.sendMessage({type:"send_task_progress",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskRunEvent(e,t){return await this.client.sendMessage({type:"send_task_run_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setAgentComplete(e,t){return await this.client.sendMessage({type:"set_agent_complete",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"set_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async 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 i=Date.now(),r={...this.analyticsClient?.now?.(),...this.requestAnalyticsContext(n),trigger:n?.trigger??"user",stream_id:n?.streamId,thread_id:n?.threadId,...this.sanitizeForAnalytics(t)};try{let o=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}`,{...r,...typeof n?.analyticsContext=="function"?this.requestAnalyticsContext(n,o):{},...this.resultIdsForAnalytics(e,o),...this.mergeOutcomeForAnalytics(e,o),success:!0,duration_ms:Date.now()-i}),o}catch(o){throw this.trackEventSafely(`user-action/${e}`,{...r,success:!1,duration_ms:Date.now()-i,error_type:o instanceof Error?o.name:"Unknown",error_code:o instanceof Error&&"code"in o&&typeof o.code=="string"&&o.code?o.code:void 0}),o}}requestAnalyticsContext(e,t){try{return typeof e?.analyticsContext=="function"?e.analyticsContext(t):e?.analyticsContext??{}}catch{return{}}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(n){console.error("Analytics tracking failed:",n)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[n,i]of Object.entries(e))(n.endsWith("_id")||n.endsWith("_ids")||n==="id")&&(t[mc(n)]=i);return t}resultIdsForAnalytics(e,t){if(!t||typeof t!="object"||Array.isArray(t))return{};let n=t,i={},r=lw[e]??[];for(let o of r){let a=n[o];typeof a=="string"?i[`result_${mc(o)}`]=a:a&&typeof a=="object"&&"id"in a&&typeof a.id=="string"&&(i[`result_${mc(o)}_id`]=a.id)}return i}mergeOutcomeForAnalytics(e,t){if(!t||typeof t!="object")return{};let n={};return"merge_success"in t&&typeof t.merge_success=="boolean"?n.merge_success=t.merge_success:(e==="accept_thread_workblock"||e==="merge_workblock_branch"||e==="revert_workblock_commit")&&"success"in t&&typeof t.success=="boolean"&&(n.merge_success=t.success),"conflict_files"in t&&Array.isArray(t.conflict_files)&&(n.conflict_count=t.conflict_files.length),n}};var Us=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Ie=180,Wn=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];pushHandlers=new Map;ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new wr({sendMessage:e=>this.send(e)});constructor(e=!1){this.debug=e}addStreamHandler(e){this.streamHandlers.push(e)}addEventHandler(e){this.eventHandlers.push(e)}addCurrentUserHandler(e){this.currentUserHandlers.push(e)}addErrorHandler(e){this.errorHandlers.push(e)}addConnectionErrorHandler(e){this.connectionErrorHandlers.push(e)}addOnDisconnect(e){this.onDisconnect.push(e)}useTokenSource(e){this.tokenSource=e}addPushHandler(e,t){this.pushHandlers.set(e,[...this.pushHandlers.get(e)??[],t])}close(){this.closing=!0,this.ws?.close()}connect(e,t){this.connectionHost=e,this.lastConnectionError=void 0,this.connected=!1,this.closing=!1,e.indexOf("://")===-1&&(e=`https://${e}`),this.token=t;let 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 i=new URL(e);switch(i.protocol){case"https:":i.protocol="wss:";break;case"http:":i.protocol="ws:";break}!i.hostname.startsWith("api.")&&!i.hostname.startsWith("localhost")&&(i.hostname=`api.${i.hostname}`),i.pathname.endsWith("/streams")||(i.pathname="/workblocks/streams"),this.connectionUrl=i.toString();let r=new xr(i.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=r,r.on("open",()=>{this.ws===r&&(this.connected=!0,this.lastConnectionError=void 0)}),r.on("unexpected-response",(o,a)=>{this.ws===r&&this.reportConnectionError(`Unexpected server response: ${a.statusCode}`,a.statusCode),r.terminate()}),r.on("message",o=>{if(this.ws!==r)return;let a=JSON.parse(o.toString());if(this.debug&&console.error("Received message","type"in a?a.type:"error","reply_to"in a?a.reply_to:void 0),"reply_to"in a){if(a.reply_to===void 0)return;let c=this.store[a.reply_to];c&&(delete this.store[a.reply_to],clearTimeout(c.timeoutHandle),"error"in a?c.reject(new Us(a.error,a.error_type??"")):c.resolve(a.response));return}if("error"in a){this.errorHandlers.forEach(c=>c(a.error));return}a.type==="streams"?this.handleListStreams(a.response):a.type==="events"?this.handleEvents(a.response).catch(c=>{console.error(c)}):a.type==="whoami"&&this.handleCurrentUser(a.response),this.pushHandlers.get(a.type)?.forEach(c=>{try{c(a.response)}catch(u){console.error(u)}})}),r.on("close",(o,a)=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(`Connection closed before it was established. Code: ${o}, Reason: ${a||"none"}`),this.rejectAllPending(new Error(`WebSocket disconnected. Code: ${o}, Reason: ${a}`)),this.onDisconnect.forEach(c=>c()))}),r.on("error",async o=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(o.message),this.rejectAllPending(new Error(`WebSocket error: ${o.message}`)))})}waitForOpen(){if(this.connected)return Promise.resolve();let e=this.ws;return e?e.readyState===xr.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,n)=>{let i=()=>{c(),t()},r=u=>{c(),n(new Error(`WebSocket error: ${u.message}`))},o=(u,l)=>{c(),n(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},a=(u,l)=>{c(),n(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",i),e.removeListener("error",r),e.removeListener("unexpected-response",o),e.removeListener("close",a)};e.on("open",i),e.on("error",r),e.on("unexpected-response",o),e.on("close",a)}):Promise.reject(new Error("WebSocket not connected"))}fetchWithCache(e,t){return fetch(e,t)}async _send(e,t){return this.ws&&this.ws.readyState===xr.OPEN?(this.SequenceID++,new Promise((n,i)=>{let r=this.SequenceID,o=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,a=setTimeout(()=>{let c=this.store[r];c&&(delete this.store[r],c.reject(new Error(`Request timed out after ${o}ms${c.type?` (type=${c.type})`:""}`)))},o);this.store[r]={resolve:n,reject:i,timeoutHandle:a,type:e.type},this.ws?.send(JSON.stringify({...e,seq:r}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,n={}){let i=n.timeoutSeconds;return await this._send({type:e,stream_id:n.streamId,timeout:i,request:t},i===void 0?void 0:(i+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:Ie});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(r){if(!(r instanceof Us&&r.code==="NotFound"))throw r;t=void 0}if(!t)return await this.createWorkblock(e);let n=await this.requests.getEditStream({workblock_id:e.id}),i=await this.setWorkblock(n.id,e);if(i.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(i.errors)}`);return{stream:n,warnings:i.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Ie})}async createWorkblock(e,t){let n=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Ie});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({include_branches:!0})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}async listWorkblockDataEnvironments(e){return await this.requests.listWorkblockDataEnvironments({workblock_id:e})}async queryWorkblockEntityStore(e){return await this.requests.queryWorkblockEntityStore(e)}async listWorkblockEntityStoreSavedQueries(e){return await this.requests.listWorkblockEntityStoreSavedQueries(e)}async getSpace(e){return await this.requests.getSpace({slug:e})}async getActiveWorkblockSetting(e){return(await this.requests.getActiveWorkblockSetting({workblock_id:e})).branch}async setActiveWorkblockSetting(e,t){await this.requests.setActiveWorkblockSetting({workblock_id:e,branch:t})}async createStudioWorkspace(e,t,n,i=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:n,create_user_branch:i})).stream}async createWorkblockVersion(e,t,n,i){return(await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,source_ref:n,workspace_name:i},{timeoutSeconds:Ie})).stream}async findStudioWorkspaceOnBranch(e,t){return(await this.requests.findStudioWorkspaceOnBranch({workblock_id:e,target_branch:t})).stream_id}async getStudioWorkspace(e){return(await this.requests.getStudioWorkspace({stream_id:e})).workspace??void 0}async listStudioWorkspaces(e,t){if(!e&&!t)throw new Error("listStudioWorkspaces requires a user id or a workblock id");return(await this.requests.listStudioWorkspaces({user_id:e,workblock_id:t})).workspaces??[]}async getBlob(e){return this.debug&&console.error(`Getting blob ${e}`),e.startsWith("::bw:data:")?(await this.getBlobContent(e)).text:e}async getBlobContent(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",text:await t.text()}}async getBlobBytes(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",bytes:new Uint8Array(await t.arrayBuffer())}}async fetchBlob(e){let t=this.tokenSource?await this.tokenSource():this.token,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 n}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,n)=>{let i=setTimeout(()=>n(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(r=>{clearTimeout(i),t(r)})})}async getWorkblockV2ById(e){return await this.requests.getWorkblockV2({id:e,resolve_blobs:!0})??void 0}async resolveWorkblockContent(e,t){return await this.requests.resolveWorkblockContent({workblock_id:e,commit_ref:t})}async setWorkblockV2(e,t,n){return await this.requests.setWorkBlockV2({workblock:t,branch:n.branch,expected_commit_ref:n.expectedCommitRef,advance_version:n.advanceVersion||void 0,commit_message:n.commitMessage},{streamId:e,timeoutSeconds:Ie})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Ie})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Ie})}async checkWorkblockBranchMergeability(e,t,n,i={}){return await this.requests.checkWorkblockBranchMergeability({workblock_id:e,base_branch:t,head_branch:n,compute_file_merges:i.computeFileMerges||void 0},{timeoutSeconds:Ie})}async mergeWorkblockBranch(e,t,n,i={}){return await this.requests.mergeWorkblockBranch({workblock_id:e,base_branch:t,head_branch:n,commit_message:i.commitMessage},{streamId:i.streamId,timeoutSeconds:Ie})}async resolveWorkblockMergeConflicts(e,t,n,i,r){return await this.requests.resolveWorkblockMergeConflicts({workblock_id:e,base_branch:t,head_branch:n,resolved_files:i,base_branch_commit:r.baseBranchCommit,head_branch_commit:r.headBranchCommit,commit_message:r.commitMessage},{streamId:r.streamId,timeoutSeconds:Ie})}async resetWorkblockBranch(e,t,n,i){await this.requests.resetWorkblockBranch({workblock_id:e,branch_name:t,source_ref:n,expected_commit_ref:i})}async setWorkblockCommitMessage(e,t,n){await this.requests.setWorkblockCommitMessage({workblock_id:e,commit_hash:t,title:n.split(`
152
+ `,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(Es);let t=VE(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 i=this.scanMpeg(n);if(i)return i}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?ys: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?ys:z);if(!(t>RE)&&!(de(this.tokenizer)&&2+t*12>ok))for(let n=0;n<t;++n){let i=await this.readTiffTag(e);if(i)return i}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},n=(e?ys:z).get(this.buffer,2),i=(e?_d:j).get(this.buffer,4);if(n===42){if(i>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(i>=8){let a=(e?ys:z).get(this.buffer,8),c=(e?ys:z).get(this.buffer,10);if(a===28&&c===254||a===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(de(this.tokenizer)&&i>AE)return t;let r=de(this.tokenizer)?ok:this.tokenizer.fileInfo.size;try{await Ut(this.tokenizer,i,{maximumLength:r,reason:"TIFF IFD offset"})}catch(a){if(a instanceof P)return;throw a}let o;try{o=await this.readTiffIFD(e)}catch(a){if(a instanceof P)return;throw a}return o??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"}}}},hk=new Set(Jb),mk=new Set(Yb)});var kk={};Fs(kk,{FileTypeParser:()=>kn,fileTypeFromBlob:()=>pk,fileTypeFromBuffer:()=>dk,fileTypeFromFile:()=>XE,fileTypeFromStream:()=>QE,fileTypeFromTokenizer:()=>fk,fileTypeStream:()=>eC,supportedExtensions:()=>hk,supportedMimeTypes:()=>mk});function ZE(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 XE(s,e){return new kn(e).fromFile(s,e)}async function QE(s,e){return new kn(e).fromStream(s)}async function eC(s,e={}){return new kn(e).toDetectionStream(s,e)}var gk,Vt,bk,Od,kn,xk=B(()=>{gk=require("node:stream/web"),Vt=require("node:stream"),bk=q(require("node:fs/promises"),1),Od=require("node:fs");hb();Td();Td();kn=class extends Cs{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof gk.ReadableStream?this.createTokenizerFromWebStream(e):fb(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(n){if(ZE(n))return;throw n}finally{e instanceof Vt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await bk.default.open(e,Od.constants.O_RDONLY|Od.constants.O_NONBLOCK),n=await t.stat();if(!n.isFile()){await t.close();return}let i=new ws(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:n.size}});return super.fromTokenizer(i)}async toDetectionStream(e,t={}){if(!(e instanceof Vt.Readable))return super.toDetectionStream(e,t);let{sampleSize:n=Es}=t,{signal:i}=this.options,r=Id(n);return i?.throwIfAborted(),new Promise((o,a)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",h),i?.removeEventListener("abort",p)},l=(m,f)=>{c||(c=!0,u(),m(f))},d=m=>{l(a,m)},p=()=>{e.destroyed||e.destroy(),l(a,i.reason)},h=()=>{(async()=>{try{let m=new Vt.PassThrough,f=Vt.pipeline?(0,Vt.pipeline)(e,m,()=>{}):e.pipe(m),g=e.read(r)??e.read()??new Uint8Array(0);try{m.fileType=await this.fromBuffer(g)}catch(b){b instanceof P?m.fileType=void 0:l(a,b)}l(o,f)}catch(m){l(a,m)}})()};e.on("error",d),e.once("readable",h),i?.addEventListener("abort",p,{once:!0})})}}});var iR={};Fs(iR,{activate:()=>sR,connectToHost:()=>Ha,deactivate:()=>nR});module.exports=qx(iR);var N=q(require("vscode"));var yr=q(require("vscode"));var nw=q(df(),1),iw=q(fr(),1),rw=q(Ls(),1),ow=q(ic(),1),aw=q(ac(),1),cw=q(fc(),1),_f=q(br(),1),uw=q(xf(),1);var xr=_f.default;var mc=s=>s.replace("work_block","workblock"),_r=["module_id","parent_task_def_id","parent_task_id","run_id","stream_id","wcb_id"],lw={ask_agent:["conversation_id","message_id","run_id"],authz_schema_apply:["version_id"],authz_schema_draft_emit_event:["workblock_id"],authz_schema_force_apply:["version_id"],authz_schema_initialize_for_workblock:["schema_id"],authz_schema_propose:["parent_version_id","schema_id"],cancel_child:_r,complete_child:_r,continue_from_message:["thread_id"],convert_legacy_stream:["editing_task_id","id","parent_id"],create_access_token:["access_token"],create_group:["id"],create_oauth_client:["client"],create_oauth_registration_token:["registration_token"],create_stream:["run_id","stream_id"],create_studio_workspace:["stream","workspace"],create_user:["id"],create_workblock:["stream","workspace"],create_workblock_schedule:["id","user","wcb_id"],create_workblock_version:["stream","workspace"],discard_permission_request:["request_id"],get_edit_stream:["editing_task_id","id","parent_id"],get_space_stream:["run_id","stream_id"],initiate_credential_oauth:["attempt_id"],initiate_task_credential_oauth:["attempt_id"],interrupt_child:_r,message_child:_r,publish_to_registry:["id"],recreate_edit_stream:["stream"],register_workblock_event:["id","stream_id","workblock_id"],remix_workblock_v2:["workblock_id"],rename_data_environment:["environment"],request_permission:["request_id"],restart_studio_workspace_thread:["previous_thread_id","thread_id"],run_module:["run_id"],run_workblock_replay_tests:["workflow_id"],set_legal_hold:["run_id"],set_retention_policy:["workblock_id"],set_work_block:["work_block"],set_work_block_v2:["work_block"],start_branch_thread:["thread_id"],update_task:["task"],update_workblock_schedule:["id","user","wcb_id"],upsert_space:["id"]},wr=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 cancelWorkblockDataEnvironmentCloneOperation(e,t){return await this.requestWithTracking("cancel_workblock_data_environment_clone_operation",e,t)}async cancelWorkblockNotification(e,t){return await this.requestWithTracking("cancel_workblock_notification",e,t)}async changelogMarkSeen(e,t){return await this.requestWithTracking("changelog_mark_seen",e,t)}async chatQueue(e,t){return await this.requestWithTracking("chat_queue",e,t)}async cloneWorkblockDataEnvironment(e,t){return await this.requestWithTracking("clone_workblock_data_environment",e,t)}async closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",e,t)}async completeConfigCredentialOauth(e,t){return await this.requestWithTracking("complete_config_credential_oauth",e,t)}async completeCredentialOauth(e,t){return await this.requestWithTracking("complete_credential_oauth",e,t)}async completeRunCredentialOauth(e,t){return await this.requestWithTracking("complete_run_credential_oauth",e,t)}async continueFromMessage(e,t){return await this.requestWithTracking("continue_from_message",e,t)}async continueUi(e,t){return await this.requestWithTracking("continue_ui",e,t)}async convertLegacyStream(e,t){return await this.requestWithTracking("convert_legacy_stream",e,t)}async createAccessToken(e,t){return await this.requestWithTracking("create_access_token",e,t)}async createCredential(e,t){return await this.requestWithTracking("create_credential",e,t)}async createGroup(e,t){return await this.requestWithTracking("create_group",e,t)}async createOauthClient(e,t){return await this.requestWithTracking("create_oauth_client",e,t)}async createOauthRegistrationToken(e,t){return await this.requestWithTracking("create_oauth_registration_token",e,t)}async createStream(e,t){return await this.requestWithTracking("create_stream",e,t)}async createStudioWorkspace(e,t){return await this.requestWithTracking("create_studio_workspace",e,t)}async createUser(e,t){return await this.requestWithTracking("create_user",e,t)}async createWorkblock(e,t){return await this.requestWithTracking("create_workblock",e,t)}async createWorkblockDataEnvironment(e,t){return await this.requestWithTracking("create_workblock_data_environment",e,t)}async createWorkblockSchedule(e,t){return await this.requestWithTracking("create_workblock_schedule",e,t)}async createWorkblockVersion(e,t){return await this.requestWithTracking("create_workblock_version",e,t)}async createWorkblockVersionUpdate(e,t){return await this.requestWithTracking("create_workblock_version_update",e,t)}async 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 deleteDataEnvironment(e,t){return await this.requestWithTracking("delete_data_environment",e,t)}async deleteGroup(e,t){return await this.requestWithTracking("delete_group",e,t)}async deleteLearningExample(e,t){return await this.requestWithTracking("delete_learning_example",e,t)}async deleteOauthClient(e,t){return await this.requestWithTracking("delete_oauth_client",e,t)}async deleteSpace(e,t){return await this.requestWithTracking("delete_space",e,t)}async deleteStudioWorkspace(e,t){return await this.requestWithTracking("delete_studio_workspace",e,t)}async deleteWorkblock(e,t){return await this.requestWithTracking("delete_workblock",e,t)}async deleteWorkblockBranch(e,t){return await this.requestWithTracking("delete_workblock_branch",e,t)}async deleteWorkblockRegistration(e,t){return await this.requestWithTracking("delete_workblock_registration",e,t)}async deleteWorkblockRegistrationEvent(e,t){return await this.requestWithTracking("delete_workblock_registration_event",e,t)}async deleteWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("delete_workblock_run_data_truncation",e,t)}async deleteWorkblockSchedule(e,t){return await this.requestWithTracking("delete_workblock_schedule",e,t)}async deployWorkblockVersion(e,t){return await this.requestWithTracking("deploy_workblock_version",e,t)}async disableWorkblockRegistration(e,t){return await this.requestWithTracking("disable_workblock_registration",e,t)}async discardPermissionRequest(e,t){return await this.requestWithTracking("discard_permission_request",e,t)}async dismissAllNotifications(e,t){return await this.requestWithTracking("dismiss_all_notifications",e,t)}async dismissNotification(e,t){return await this.requestWithTracking("dismiss_notification",e,t)}async enableWorkblockRegistration(e,t){return await this.requestWithTracking("enable_workblock_registration",e,t)}async ensureDefaultWorkblockDataEnvironments(e,t){return await this.requestWithTracking("ensure_default_workblock_data_environments",e,t)}async ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",e,t)}async ensureWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("ensure_workblock_data_environment_namespace",e,t)}async getEditStream(e,t){return await this.requestWithTracking("get_edit_stream",e,t)}async getSpaceStream(e,t){return await this.requestWithTracking("get_space_stream",e,t)}async grantWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("grant_workblock_data_environment_start",e,t)}async help(e,t){return await this.requestWithTracking("help",e,t)}async initiateConfigCredentialOauth(e,t){return await this.requestWithTracking("initiate_config_credential_oauth",e,t)}async initiateCredentialOauth(e,t){return await this.requestWithTracking("initiate_credential_oauth",e,t)}async initiateTaskCredentialOauth(e,t){return await this.requestWithTracking("initiate_task_credential_oauth",e,t)}async insertTasks(e,t){return await this.requestWithTracking("insert_tasks",e,t)}async installWorkblock(e,t){return await this.requestWithTracking("install_workblock",e,t)}async interruptChild(e,t){return await this.requestWithTracking("interrupt_child",e,t)}async invokeRunTask(e,t){return await this.requestWithTracking("invoke_run_task",e,t)}async invokeWorkblockTask(e,t){return await this.requestWithTracking("invoke_workblock_task",e,t)}async join(e,t){return await this.requestWithTracking("join",e,t)}async leave(e,t){return await this.requestWithTracking("leave",e,t)}async markAllNotificationsRead(e,t){return await this.requestWithTracking("mark_all_notifications_read",e,t)}async markNotificationRead(e,t){return await this.requestWithTracking("mark_notification_read",e,t)}async mergeWorkblockBranch(e,t){return await this.requestWithTracking("merge_workblock_branch",e,t)}async messageChild(e,t){return await this.requestWithTracking("message_child",e,t)}async peekWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("peek_workblock_registration_events",e,t)}async permissionsGrant(e,t){return await this.requestWithTracking("permissions_grant",e,t)}async permissionsRevoke(e,t){return await this.requestWithTracking("permissions_revoke",e,t)}async promoteWorkblockDataModel(e,t){return await this.requestWithTracking("promote_workblock_data_model",e,t)}async publishToRegistry(e,t){return await this.requestWithTracking("publish_to_registry",e,t)}async recreateEditStream(e,t){return await this.requestWithTracking("recreate_edit_stream",e,t)}async reembedValidationSet(e,t){return await this.requestWithTracking("reembed_validation_set",e,t)}async registerWorkblockEvent(e,t){return await this.requestWithTracking("register_workblock_event",e,t)}async registrySearch(e,t){return await this.requestWithTracking("registry_search",e,t)}async registrySetParameters(e,t){return await this.requestWithTracking("registry_set_parameters",e,t)}async registrySetTags(e,t){return await this.requestWithTracking("registry_set_tags",e,t)}async rejectLearningData(e,t){return await this.requestWithTracking("reject_learning_data",e,t)}async rejectThreadWorkblock(e,t){return await this.requestWithTracking("reject_thread_workblock",e,t)}async remixWorkblockV2(e,t){return await this.requestWithTracking("remix_workblock_v2",e,t)}async removeGroupMember(e,t){return await this.requestWithTracking("remove_group_member",e,t)}async removeThread(e,t){return await this.requestWithTracking("remove_thread",e,t)}async removeWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("remove_workblock_data_environment_namespace",e,t)}async renameDataEnvironment(e,t){return await this.requestWithTracking("rename_data_environment",e,t)}async requestPermission(e,t){return await this.requestWithTracking("request_permission",e,t)}async resetTask(e,t){return await this.requestWithTracking("reset_task",e,t)}async resetWorkblockBranch(e,t){return await this.requestWithTracking("reset_workblock_branch",e,t)}async resetWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("reset_workblock_data_environment_namespace",e,t)}async resolveWorkblockMergeConflicts(e,t){return await this.requestWithTracking("resolve_workblock_merge_conflicts",e,t)}async restartStudioWorkspaceThread(e,t){return await this.requestWithTracking("restart_studio_workspace_thread",e,t)}async restartWorkblock(e,t){return await this.requestWithTracking("restart_workblock",e,t)}async resumeRetry(e,t){return await this.requestWithTracking("resume_retry",e,t)}async retryWorkblockDataModelApply(e,t){return await this.requestWithTracking("retry_workblock_data_model_apply",e,t)}async revertWorkblockCommit(e,t){return await this.requestWithTracking("revert_workblock_commit",e,t)}async revokeAllOauthConsents(e,t){return await this.requestWithTracking("revoke_all_oauth_consents",e,t)}async revokeOauthConsent(e,t){return await this.requestWithTracking("revoke_oauth_consent",e,t)}async revokeOauthRegistrationToken(e,t){return await this.requestWithTracking("revoke_oauth_registration_token",e,t)}async revokeWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("revoke_workblock_data_environment_start",e,t)}async rotateOauthClientSecret(e,t){return await this.requestWithTracking("rotate_oauth_client_secret",e,t)}async runModule(e,t){return await this.requestWithTracking("run_module",e,t)}async runSingleTask(e,t){return await this.requestWithTracking("run_single_task",e,t)}async runSubgraph(e,t){return await this.requestWithTracking("run_subgraph",e,t)}async runTask(e,t){return await this.requestWithTracking("run_task",e,t)}async runWorkblockReplayTests(e,t){return await this.requestWithTracking("run_workblock_replay_tests",e,t)}async runtimeAuthzAttachRole(e,t){return await this.requestWithTracking("runtime_authz_attach_role",e,t)}async runtimeAuthzDeleteRelation(e,t){return await this.requestWithTracking("runtime_authz_delete_relation",e,t)}async runtimeAuthzDetachRole(e,t){return await this.requestWithTracking("runtime_authz_detach_role",e,t)}async runtimeAuthzStoreRelation(e,t){return await this.requestWithTracking("runtime_authz_store_relation",e,t)}async sendMessage(e,t){return await this.requestWithTracking("send_message",e,t)}async sendWorkblockNotification(e,t){return await this.requestWithTracking("send_workblock_notification",e,t)}async setActiveWorkblockSetting(e,t){return await this.requestWithTracking("set_active_workblock_setting",e,t)}async setAutoApproveConfig(e,t){return await this.requestWithTracking("set_auto_approve_config",e,t)}async setConsumptionLimits(e,t){return await this.requestWithTracking("set_consumption_limits",e,t)}async setEditing(e,t){return await this.requestWithTracking("set_editing",e,t)}async setKeepOpenOnComplete(e,t){return await this.requestWithTracking("set_keep_open_on_complete",e,t)}async setLegalHold(e,t){return await this.requestWithTracking("set_legal_hold",e,t)}async setLogging(e,t){return await this.requestWithTracking("set_logging",e,t)}async setNotificationChannelMuted(e,t){return await this.requestWithTracking("set_notification_channel_muted",e,t)}async setOauthClientEnabled(e,t){return await this.requestWithTracking("set_oauth_client_enabled",e,t)}async setRetentionPolicy(e,t){return await this.requestWithTracking("set_retention_policy",e,t)}async setStudioWorkspaceArchived(e,t){return await this.requestWithTracking("set_studio_workspace_archived",e,t)}async setStudioWorkspaceThread(e,t){return await this.requestWithTracking("set_studio_workspace_thread",e,t)}async setUserSetting(e,t){return await this.requestWithTracking("set_user_setting",e,t)}async setWorkBlock(e,t){return await this.requestWithTracking("set_work_block",e,t)}async setWorkBlockV2(e,t){return await this.requestWithTracking("set_work_block_v2",e,t)}async setWorkblockCommitMessage(e,t){return await this.requestWithTracking("set_workblock_commit_message",e,t)}async setWorkblockConfig(e,t){return await this.requestWithTracking("set_workblock_config",e,t)}async setWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("set_workblock_run_data_truncation",e,t)}async setWorkblockSchedulePaused(e,t){return await this.requestWithTracking("set_workblock_schedule_paused",e,t)}async 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 getWorkblockConfig(e,t){return await this.client.sendMessage({type:"get_workblock_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelDeployPreview(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_deploy_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelStatus(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataSchema(e,t){return await this.client.sendMessage({type:"get_workblock_data_schema",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockFileContent(e,t){return await this.client.sendMessage({type:"get_workblock_file_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockHistoryBundle(e,t){return await this.client.sendMessage({type:"get_workblock_history_bundle",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async 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 graphlakeCatalog(e,t){return await this.client.sendMessage({type:"graphlake_catalog",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeExplore(e,t){return await this.client.sendMessage({type:"graphlake_explore",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeIntrospect(e,t){return await this.client.sendMessage({type:"graphlake_introspect",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeNode(e,t){return await this.client.sendMessage({type:"graphlake_node",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeQuery(e,t){return await this.client.sendMessage({type:"graphlake_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeSearchNodes(e,t){return await this.client.sendMessage({type:"graphlake_search_nodes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiQuery(e,t){return await this.client.sendMessage({type:"graphlake_ui_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiSubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_subscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiUnsubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_unsubscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async 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 listNotificationChannels(e,t){return await this.client.sendMessage({type:"list_notification_channels",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotifications(e,t){return await this.client.sendMessage({type:"list_notifications",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthClients(e,t){return await this.client.sendMessage({type:"list_oauth_clients",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthRegistrationTokens(e,t){return await this.client.sendMessage({type:"list_oauth_registration_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOwnedRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_owned_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listPendingLearningData(e,t){return await this.client.sendMessage({type:"list_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listQdrantCollections(e,t){return await this.client.sendMessage({type:"list_qdrant_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRowstoreCollections(e,t){return await this.client.sendMessage({type:"list_rowstore_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listSpaces(e,t){return await this.client.sendMessage({type:"list_spaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listStudioWorkspaces(e,t){return await this.client.sendMessage({type:"list_studio_workspaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockBranches(e,t){return await this.client.sendMessage({type:"list_workblock_branches",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentCloneOperations(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_clone_operations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartOptions(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_options",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartUsers(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironments(e,t){return await this.client.sendMessage({type:"list_workblock_data_environments",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDefinitions(e,t){return await this.client.sendMessage({type:"list_workblock_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockEntityStoreSavedQueries(e,t){return await this.client.sendMessage({type:"list_workblock_entity_store_saved_queries",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRegistrations(e,t){return await this.client.sendMessage({type:"list_workblock_registrations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRowCollections(e,t){return await this.client.sendMessage({type:"list_workblock_row_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataSchemaVersions(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_schema_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataTruncations(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_truncations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunners(e,t){return await this.client.sendMessage({type:"list_workblock_runners",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockSchedules(e,t){return await this.client.sendMessage({type:"list_workblock_schedules",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockVersions(e,t){return await this.client.sendMessage({type:"list_workblock_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsCheck(e,t){return await this.client.sendMessage({type:"permissions_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsDefinitions(e,t){return await this.client.sendMessage({type:"permissions_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsListSubjects(e,t){return await this.client.sendMessage({type:"permissions_list_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsLookupResources(e,t){return await this.client.sendMessage({type:"permissions_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async previewContinueFromMessage(e,t){return await this.client.sendMessage({type:"preview_continue_from_message",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryAuditLog(e,t){return await this.client.sendMessage({type:"query_audit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockEntityStore(e,t){return await this.client.sendMessage({type:"query_workblock_entity_store",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockRunData(e,t){return await this.client.sendMessage({type:"query_workblock_run_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async repeatDone(e,t){return await this.client.sendMessage({type:"repeat_done",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockByTask(e,t){return await this.client.sendMessage({type:"resolve_workblock_by_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockContent(e,t){return await this.client.sendMessage({type:"resolve_workblock_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzCheck(e,t){return await this.client.sendMessage({type:"runtime_authz_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupResources(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupSubjects(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTest(e,t){return await this.client.sendMessage({type:"sandbox_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTestResponse(e,t){return await this.client.sendMessage({type:"sandbox_test_response",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async searchLearningExamples(e,t){return await this.client.sendMessage({type:"search_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskProgress(e,t){return await this.client.sendMessage({type:"send_task_progress",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskRunEvent(e,t){return await this.client.sendMessage({type:"send_task_run_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setAgentComplete(e,t){return await this.client.sendMessage({type:"set_agent_complete",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"set_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async 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 i=Date.now(),r={...this.analyticsClient?.now?.(),...this.requestAnalyticsContext(n),trigger:n?.trigger??"user",stream_id:n?.streamId,thread_id:n?.threadId,...this.sanitizeForAnalytics(t)};try{let o=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}`,{...r,...typeof n?.analyticsContext=="function"?this.requestAnalyticsContext(n,o):{},...this.resultIdsForAnalytics(e,o),...this.mergeOutcomeForAnalytics(e,o),success:!0,duration_ms:Date.now()-i}),o}catch(o){throw this.trackEventSafely(`user-action/${e}`,{...r,success:!1,duration_ms:Date.now()-i,error_type:o instanceof Error?o.name:"Unknown",error_code:o instanceof Error&&"code"in o&&typeof o.code=="string"&&o.code?o.code:void 0}),o}}requestAnalyticsContext(e,t){try{return typeof e?.analyticsContext=="function"?e.analyticsContext(t):e?.analyticsContext??{}}catch{return{}}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(n){console.error("Analytics tracking failed:",n)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[n,i]of Object.entries(e))(n.endsWith("_id")||n.endsWith("_ids")||n==="id")&&(t[mc(n)]=i);return t}resultIdsForAnalytics(e,t){if(!t||typeof t!="object"||Array.isArray(t))return{};let n=t,i={},r=lw[e]??[];for(let o of r){let a=n[o];typeof a=="string"?i[`result_${mc(o)}`]=a:a&&typeof a=="object"&&"id"in a&&typeof a.id=="string"&&(i[`result_${mc(o)}_id`]=a.id)}return i}mergeOutcomeForAnalytics(e,t){if(!t||typeof t!="object")return{};let n={};return"merge_success"in t&&typeof t.merge_success=="boolean"?n.merge_success=t.merge_success:(e==="accept_thread_workblock"||e==="merge_workblock_branch"||e==="revert_workblock_commit")&&"success"in t&&typeof t.success=="boolean"&&(n.merge_success=t.success),"conflict_files"in t&&Array.isArray(t.conflict_files)&&(n.conflict_count=t.conflict_files.length),n}};var Us=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Ie=180,Wn=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];pushHandlers=new Map;ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new wr({sendMessage:e=>this.send(e)});constructor(e=!1){this.debug=e}addStreamHandler(e){this.streamHandlers.push(e)}addEventHandler(e){this.eventHandlers.push(e)}addCurrentUserHandler(e){this.currentUserHandlers.push(e)}addErrorHandler(e){this.errorHandlers.push(e)}addConnectionErrorHandler(e){this.connectionErrorHandlers.push(e)}addOnDisconnect(e){this.onDisconnect.push(e)}useTokenSource(e){this.tokenSource=e}addPushHandler(e,t){this.pushHandlers.set(e,[...this.pushHandlers.get(e)??[],t])}close(){this.closing=!0,this.ws?.close()}connect(e,t){this.connectionHost=e,this.lastConnectionError=void 0,this.connected=!1,this.closing=!1,e.indexOf("://")===-1&&(e=`https://${e}`),this.token=t;let 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 i=new URL(e);switch(i.protocol){case"https:":i.protocol="wss:";break;case"http:":i.protocol="ws:";break}!i.hostname.startsWith("api.")&&!i.hostname.startsWith("localhost")&&(i.hostname=`api.${i.hostname}`),i.pathname.endsWith("/streams")||(i.pathname="/workblocks/streams"),this.connectionUrl=i.toString();let r=new xr(i.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=r,r.on("open",()=>{this.ws===r&&(this.connected=!0,this.lastConnectionError=void 0)}),r.on("unexpected-response",(o,a)=>{this.ws===r&&this.reportConnectionError(`Unexpected server response: ${a.statusCode}`,a.statusCode),r.terminate()}),r.on("message",o=>{if(this.ws!==r)return;let a=JSON.parse(o.toString());if(this.debug&&console.error("Received message","type"in a?a.type:"error","reply_to"in a?a.reply_to:void 0),"reply_to"in a){if(a.reply_to===void 0)return;let c=this.store[a.reply_to];c&&(delete this.store[a.reply_to],clearTimeout(c.timeoutHandle),"error"in a?c.reject(new Us(a.error,a.error_type??"")):c.resolve(a.response));return}if("error"in a){this.errorHandlers.forEach(c=>c(a.error));return}a.type==="streams"?this.handleListStreams(a.response):a.type==="events"?this.handleEvents(a.response).catch(c=>{console.error(c)}):a.type==="whoami"&&this.handleCurrentUser(a.response),this.pushHandlers.get(a.type)?.forEach(c=>{try{c(a.response)}catch(u){console.error(u)}})}),r.on("close",(o,a)=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(`Connection closed before it was established. Code: ${o}, Reason: ${a||"none"}`),this.rejectAllPending(new Error(`WebSocket disconnected. Code: ${o}, Reason: ${a}`)),this.onDisconnect.forEach(c=>c()))}),r.on("error",async o=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(o.message),this.rejectAllPending(new Error(`WebSocket error: ${o.message}`)))})}waitForOpen(){if(this.connected)return Promise.resolve();let e=this.ws;return e?e.readyState===xr.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,n)=>{let i=()=>{c(),t()},r=u=>{c(),n(new Error(`WebSocket error: ${u.message}`))},o=(u,l)=>{c(),n(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},a=(u,l)=>{c(),n(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",i),e.removeListener("error",r),e.removeListener("unexpected-response",o),e.removeListener("close",a)};e.on("open",i),e.on("error",r),e.on("unexpected-response",o),e.on("close",a)}):Promise.reject(new Error("WebSocket not connected"))}fetchWithCache(e,t){return fetch(e,t)}async _send(e,t){return this.ws&&this.ws.readyState===xr.OPEN?(this.SequenceID++,new Promise((n,i)=>{let r=this.SequenceID,o=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,a=setTimeout(()=>{let c=this.store[r];c&&(delete this.store[r],c.reject(new Error(`Request timed out after ${o}ms${c.type?` (type=${c.type})`:""}`)))},o);this.store[r]={resolve:n,reject:i,timeoutHandle:a,type:e.type},this.ws?.send(JSON.stringify({...e,seq:r}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,n={}){let i=n.timeoutSeconds;return await this._send({type:e,stream_id:n.streamId,timeout:i,request:t},i===void 0?void 0:(i+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:Ie});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(r){if(!(r instanceof Us&&r.code==="NotFound"))throw r;t=void 0}if(!t)return await this.createWorkblock(e);let n=await this.requests.getEditStream({workblock_id:e.id}),i=await this.setWorkblock(n.id,e);if(i.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(i.errors)}`);return{stream:n,warnings:i.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Ie})}async createWorkblock(e,t){let n=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Ie});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({include_branches:!0})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}async listWorkblockDataEnvironments(e){return await this.requests.listWorkblockDataEnvironments({workblock_id:e})}async queryWorkblockEntityStore(e){return await this.requests.queryWorkblockEntityStore(e)}async listWorkblockEntityStoreSavedQueries(e){return await this.requests.listWorkblockEntityStoreSavedQueries(e)}async getSpace(e){return await this.requests.getSpace({slug:e})}async getActiveWorkblockSetting(e){return(await this.requests.getActiveWorkblockSetting({workblock_id:e})).branch}async setActiveWorkblockSetting(e,t){await this.requests.setActiveWorkblockSetting({workblock_id:e,branch:t})}async createStudioWorkspace(e,t,n,i=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:n,create_user_branch:i})).stream}async createWorkblockVersion(e,t,n,i){return(await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,source_ref:n,workspace_name:i},{timeoutSeconds:Ie})).stream}async findStudioWorkspaceOnBranch(e,t){return(await this.requests.findStudioWorkspaceOnBranch({workblock_id:e,target_branch:t})).stream_id}async getStudioWorkspace(e){return(await this.requests.getStudioWorkspace({stream_id:e})).workspace??void 0}async listStudioWorkspaces(e,t){if(!e&&!t)throw new Error("listStudioWorkspaces requires a user id or a workblock id");return(await this.requests.listStudioWorkspaces({user_id:e,workblock_id:t})).workspaces??[]}async getBlob(e){return this.debug&&console.error(`Getting blob ${e}`),e.startsWith("::bw:data:")?(await this.getBlobContent(e)).text:e}async getBlobContent(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",text:await t.text()}}async getBlobBytes(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",bytes:new Uint8Array(await t.arrayBuffer())}}async fetchBlob(e){let t=this.tokenSource?await this.tokenSource():this.token,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 n}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,n)=>{let i=setTimeout(()=>n(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(r=>{clearTimeout(i),t(r)})})}async getWorkblockV2ById(e){return await this.requests.getWorkblockV2({id:e,resolve_blobs:!0})??void 0}async resolveWorkblockContent(e,t){return await this.requests.resolveWorkblockContent({workblock_id:e,commit_ref:t})}async setWorkblockV2(e,t,n){return await this.requests.setWorkBlockV2({workblock:t,branch:n.branch,expected_commit_ref:n.expectedCommitRef,advance_version:n.advanceVersion||void 0,commit_message:n.commitMessage},{streamId:e,timeoutSeconds:Ie})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Ie})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Ie})}async checkWorkblockBranchMergeability(e,t,n,i={}){return await this.requests.checkWorkblockBranchMergeability({workblock_id:e,base_branch:t,head_branch:n,compute_file_merges:i.computeFileMerges||void 0},{timeoutSeconds:Ie})}async mergeWorkblockBranch(e,t,n,i={}){return await this.requests.mergeWorkblockBranch({workblock_id:e,base_branch:t,head_branch:n,commit_message:i.commitMessage},{streamId:i.streamId,timeoutSeconds:Ie})}async resolveWorkblockMergeConflicts(e,t,n,i,r){return await this.requests.resolveWorkblockMergeConflicts({workblock_id:e,base_branch:t,head_branch:n,resolved_files:i,base_branch_commit:r.baseBranchCommit,head_branch_commit:r.headBranchCommit,commit_message:r.commitMessage},{streamId:r.streamId,timeoutSeconds:Ie})}async resetWorkblockBranch(e,t,n,i){await this.requests.resetWorkblockBranch({workblock_id:e,branch_name:t,source_ref:n,expected_commit_ref:i})}async setWorkblockCommitMessage(e,t,n){await this.requests.setWorkblockCommitMessage({workblock_id:e,commit_hash:t,title:n.split(`
153
153
  `)[0],message:n})}async getWorkblockCommitLog(e,t,n){return(await this.requests.getWorkblockCommitLog({workblock_id:e,ref:t,max_count:n})).entries}async getWorkblockHistoryBundle(e,t){return await this.requests.getWorkblockHistoryBundle({workblock_id:e,branch:t})}async getWorkspaceWorkblock(e){return await this.requests.getWorkblockV2({},{streamId:e})??void 0}async getWorkspaceWorkblockWithBlobs(e){return await this.requests.getWorkblockV2({resolve_blobs:!0},{streamId:e})??void 0}async getDocsContent(){return(await this.requests.getDocsContent({})).content}async runModule(e,t,n){let i=await this.requests.runModule({module_id:t,inputs:n},{streamId:e});if(!i.run_id)throw new Error(`Module ${t} is UI-only and starts no run. Open it in Studio or in a Space.`);return i.run_id}async runSingleTask(e,t,n,i,r){return await this.requests.runSingleTask({module_id:t,task_id:n,run_id:i,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:Ie})).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 getWorkblockUI(e){return await this.requests.getWorkblockUi(e,{timeoutSeconds:Ie})}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.pushHandlers=new Map,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 wf=3600*1e3,dw=600*1e3;function pw(s){return typeof s=="object"&&s!==null&&"data"in s&&typeof s.data=="string"&&"timestamp"in s&&typeof s.timestamp=="number"}var vr=class extends Wn{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",(i,r)=>{this.connected&&yr.window.showErrorMessage(`WebSocket disconnected. Code: ${i}, Reason: ${r}`)}),this.ws?.on("error",i=>{this.connected&&yr.window.showErrorMessage(`WebSocket error: ${i.message}`)})}async fetchWithCache(e,t){let n=Date.now();n-this.lastCleanup>dw&&(await this.cleanupExpiredCache(),this.lastCleanup=n);let i=`${e}${JSON.stringify(t)}`;try{let r=this.context?.globalState.get(i);if(r&&Date.now()-r.timestamp<wf)return new Response(r.data);let o=await fetch(e,t),a=await o.text();return o.ok&&await this.context?.globalState.update(i,{data:a,timestamp:Date.now()}),new Response(a,o)}catch(r){return yr.window.showErrorMessage(`Cache error: ${r}`),fetch(e,t)}}async cleanupExpiredCache(){if(!this.context)return;let e=this.context.globalState.keys(),t=Date.now();for(let n of e){let i=this.context.globalState.get(n);pw(i)&&t-i.timestamp>wf&&await this.context.globalState.update(n,void 0)}}};var W=q(require("vscode"));var bc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",fw=new RegExp(`^(.+)@users/${bc}$`,"i"),hw=new RegExp(`^.+@stream/${bc}$`,"i"),vf=new RegExp(`@thread/${bc}$`,"i"),mw="AlreadyExists",gw="PermissionDenied";var bw="already exists on this branch";function Ct(s){return s.replace(vf,"")}function kw(s){return vf.test(s)}function Rt(s){return s?hw.test(Ct(s)):!1}function $n(s){return s.startsWith("features/")&&s!=="features/"&&!s.includes("@users/")&&!s.includes("@stream/")&&!s.includes("@thread/")}function ns(s){let e=Ct(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 is(s){return ns(s).replace(/^features\//,"")}function Sr(s){let e=ns(s);return $n(e)?e:void 0}function xw(s){if(kw(s)||Rt(s))return;let e=s.match(fw);return e?{branch:e[1],createUserBranch:!0}:{branch:s,createUserBranch:!1}}function Sf(s){return!s.archived&&Rt(s.branch)}function _w(s,e){return s.filter(t=>Sf(t)&&ns(t.branch??"")===e).reduce((t,n)=>{if(!t)return n;let i=Date.parse(t.updated_at||t.created_at);return Date.parse(n.updated_at||n.created_at)>i?n:t},void 0)}function Nf(s,e,t){let n=new Map(e.map(r=>[r.name,r])),i=new Map(s.map(r=>[r.name,r]));for(let r of t){if(!r.branch||!Sf(r))continue;let o=n.get(r.branch);o&&i.set(o.name,{...o,workspace:r})}return[...i.values()]}function Ef(s){if(typeof s=="object"&&s!==null&&"code"in s){let e=s.code;if(typeof e=="string")return e}}function Nr(s){return s instanceof Error?s.message:String(s)}function Cf(s){return Ef(s)===mw||Nr(s).includes(bw)}function ww(s){return Ef(s)===gw}async function gc(s,e,t){try{return{ok:!0,value:await s}}catch(n){return e?.(`[workspace] ${t??"request"} failed: ${Nr(n)}`),{ok:!1,error:n}}}async function Rf(s,e,t,n){let i=await gc(s,t,n);return i.ok?i.value:e}async function yf(s,e,t){try{await s.getStudioWorkspace(e);return}catch(r){if(!ww(r)){t.log?.(`[workspace] could not verify access to ${e}: ${Nr(r)}`);return}}let n=(await Rf(s.listStudioWorkspaces(void 0,t.workblockId),[],t.log,"list_studio_workspaces")).find(r=>r.id===e),i=n?.title?.trim()?`"${n.title.trim()}"`:e;throw new Error(`Branch ${t.branch} is open in Studio workspace ${i}, which you are not a member of. Ask its owner to share it, or work on your own branch.`)}async function kc(s,e){let{workblockId:t,branch:n,log:i}=e,r=Ct(n),o=await gc(s.findStudioWorkspaceOnBranch(t,r),i,"find_studio_workspace_on_branch"),a=o.ok?void 0:o.error,c=o.ok?o.value:void 0;if(c)return await yf(s,c,e),{streamId:c,created:!1};let u=xw(n);if(!u)throw a?new Error(`Could not look up the Studio workspace for ${n}: ${Nr(a)}`):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&&$n(u.branch);if(d){let p=e.userId?await gc(s.listStudioWorkspaces(e.userId,t),i,"list_studio_workspaces"):{ok:!0,value:[]};if(p.ok){let h=_w(p.value,u.branch);if(h?.branch){let m=await Rf(s.findStudioWorkspaceOnBranch(t,h.branch),void 0,i,"find_studio_workspace_on_branch");if(m)return{streamId:m,created:!1}}}l=void 0}try{return{streamId:(await s.createStudioWorkspace(t,u.branch,l,u.createUserBranch)).id,created:!0}}catch(p){if(!Cf(p)||d)throw p;let h=await s.findStudioWorkspaceOnBranch(t,r);if(!h)throw p;return await yf(s,h,e),{streamId:h,created:!1}}}async function Af(s,e,t){if(!$n(t))throw new Error(`Conversations fork from a version branch; ${t} is not one.`);return s.createStudioWorkspace(e,t)}var yw="00000000-0000-0000-0000-000000000000";function jn(s){return s.replace(/^features\//,"").includes("@users/")}function Er(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=>!jn(t.name)).map(t=>is(t.name)));return s.filter(t=>t.name==="main"?!0:!t.name.startsWith("features/")||t.name.includes("@thread/")||t.name.includes("@stream/")?!1:jn(t.name)?e.has(is(t.name)):!0)}function If(s){let e=Ct(s),t=e.lastIndexOf("@users/");return t!==-1?e.slice(0,t):e}function xc(s){let e=Ct(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!==yw)return s.owner_id}function Tf(s,e){return s.filter(t=>t.name.startsWith("features/")||t.name.startsWith("users/")).filter(t=>!t.name.includes("@thread/")).filter(t=>xc(t)===e)}function vw(s,e){let t=new Set(s.filter(n=>n.name.startsWith("features/")).filter(n=>!n.name.includes("@thread/")).filter(n=>!xc(n)).map(n=>If(n.name)));return s.filter(n=>n.name.startsWith("features/")).filter(n=>!n.name.includes("@thread/")).filter(n=>xc(n)===e).filter(n=>t.has(If(n.name)))}function Sw(s,e,t){let n=Er(s),i=vw(s,e);return i.length>0?i:t?n.filter(r=>r.name==="main"):[]}function Of(s){let e={};for(let t of s)t.archived||!Rt(t.branch)||(e[t.workblock_id]??=[]).push(t);return e}function Df(s,e,t,n){return Nf(Sw(s,t,n),s,e)}var ae={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 _c(s){return s?`Change directory from ${s}`:ae.ChooseDirectory}function Pf(s){let e=[_c(s.dir)];return Sr(s.branch)&&e.push(ae.NewConversation),s.dir&&(e.push(ae.RemoveDirectoryBinding),e.push(ae.GetBranch),e.push(ae.StoreBranch),e.push(s.syncEnabled?ae.DisableSync:ae.EnableSync),s.modified&&e.push(ae.CompareChanges)),e}function We(s,e,t){return[s,e,t].map(encodeURIComponent).join("|")}var Cr=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"))}}},Rr=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}
154
154
  ${t.id}`}},wc=class extends W.TreeItem{constructor(t,n,i,r,o,a){let c=Rt(n.name),u=c?n.workspace?.title?.trim()||"New conversation":jn(n.name)?is(n.name):n.name;super({label:u,highlights:a?[[0,u.length]]:[]},W.TreeItemCollapsibleState.None);this.workblock=t;this.branch=n;this.connection=r;this.syncEnabled=o;this.modified=a;this.contextValue="beyondwork.branch",this.key=We(r.host,t.id,n.name),this.dir=i,this.iconPath=this.getIcon(),this.command={command:"beyondwork.beyondwork.showStreamOptions",title:"Show options",arguments:[this]},this.description=c?is(n.name):jn(n.name)?"your branch":n.last_changed,i?(this.tooltip=`Bound to ${i}`,a&&(this.tooltip+=" (out of sync)")):this.tooltip=c?`${t.name}
155
155
  ${u}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publisher": "beyondwork",
4
4
  "displayName": "Beyond Work",
5
5
  "description": "Tool for interacting with Beyond Work workblocks from VS Code and CLI.",
6
- "version": "0.1.47",
6
+ "version": "0.1.48",
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"
@@ -55,7 +55,12 @@ so that the user can deploy it from Studio.
55
55
  browser checks can publish to it. `.bw/workblock.json` binds the checkout to the platform; do not edit it.
56
56
  2. **Read before writing.** `AGENTS.md`, then the `.skills/` entries for the area you touch, then
57
57
  `.docs/docs.md` for each platform API you call. The platform changes faster than your memory of
58
- it, and validation catches only part of what the docs would have told you.
58
+ it, and validation catches only part of what the docs would have told you. The code shows what
59
+ the workblock does; its history shows what users asked for and why. Before you change or extend
60
+ a workblock that has history, read its commit messages with `git log`, and the patches of the
61
+ files you touch with `git log -p -- <path>`. Skip this only for a request that gives the exact
62
+ new text or styling. A condition from an earlier request stays in effect until a request changes
63
+ it, also in new tasks and as the default of a value that you make configurable.
59
64
  3. **Design the experience** of every new workblock and module before you write code: read
60
65
  `.skills/workblock-architecture`, choose the pattern, and decide who starts each module and what a
61
66
  person sees at the start, during input, while it runs and at the result. A module that a person
@@ -72,8 +77,11 @@ so that the user can deploy it from Studio.
72
77
  fixes to nearby tasks, no tidying of files you did not need to touch, and no tasks beyond the
73
78
  request and the experience of step 3.
74
79
  5. **Validate** with `wb-cli validate` until it reports no errors. Warnings are advisory.
75
- 6. **Push** with `wb-cli push -m "<what changed>" -m "<why>"`. Each push saves one commit, and other
76
- agents and people read its message with `wb-cli log` and in Studio.
80
+ 6. **Push** with `wb-cli push -m "<title: what the user wanted>" -m "Requested: <the user's goal>"
81
+ -m "- <each condition the user stated, with the user's reason and scope>" -m "Changed: <what the
82
+ push does for each condition>"`. Each push saves one commit, and later agents learn the user's
83
+ intent from its message, in `git log`, `wb-cli log` and Studio. Studio's own messages use the
84
+ same shape.
77
85
  7. **Prove it.** `wb-cli test` and `wb-cli run` check only what you pushed, and print the commit they
78
86
  ran on. Run `wb-cli test [<module>]` when the module has tests, then `wb-cli run <module>`, or
79
87
  `wb-cli run <module>/<task> --inputs '{...}'`, for what you changed. Since wb-cli 0.1.36, `wb-cli