@testmuai/kane-cli 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/{ChromeProfilePicker-HGRJNQDM.js → ChromeProfilePicker-J6QIIHIE.js} +1 -1
  2. package/dist/{CliFeedbackPrompt-JXEPBJ63.js → CliFeedbackPrompt-SEH4MXTF.js} +1 -1
  3. package/dist/{CliUploadProgress-L5VJUXUC.js → CliUploadProgress-U6QLD76Y.js} +1 -1
  4. package/dist/{ConfigView-LOEAT3HQ.js → ConfigView-5ZCHVYM2.js} +1 -1
  5. package/dist/FolderPicker-VYJDEDN7.js +2 -0
  6. package/dist/HelpView-3ESCWBPB.js +2 -0
  7. package/dist/{InfoBox-MK7EEGCH.js → InfoBox-OVAOOQHC.js} +1 -1
  8. package/dist/{LinksBox-RSWQWL6G.js → LinksBox-P3VETMP6.js} +1 -1
  9. package/dist/{ProfilesView-KCOMTDR5.js → ProfilesView-UBVNEYVE.js} +1 -1
  10. package/dist/ProjectPicker-NJKUWRET.js +2 -0
  11. package/dist/{SaveSessionPrompt-RGL3LAEB.js → SaveSessionPrompt-S5RCU5DX.js} +1 -1
  12. package/dist/SingleShotApp-WOJWOQSV.js +2 -0
  13. package/dist/{SummaryBox-5YPKUIHB.js → SummaryBox-M4UFKKMD.js} +1 -1
  14. package/dist/{TestMdRunView-QS7IUANM.js → TestMdRunView-PI433EGP.js} +1 -1
  15. package/dist/{WhoamiView-GL3HZQ4Q.js → WhoamiView-VJBEYTCF.js} +1 -1
  16. package/dist/changelog-EFAQANXW.js +4 -0
  17. package/dist/chunk-4QLJMIBA.js +13 -0
  18. package/dist/{chunk-ZLQ7YLXO.js → chunk-53K3BK7I.js} +1 -1
  19. package/dist/chunk-AH4AXJML.js +2 -0
  20. package/dist/{chunk-NOH6RERF.js → chunk-D4P6GLSX.js} +1 -1
  21. package/dist/chunk-FAPS5ACQ.js +9 -0
  22. package/dist/chunk-FSIJOBVB.js +2 -0
  23. package/dist/chunk-G5HHHYH7.js +2 -0
  24. package/dist/chunk-GCAHPH2E.js +2 -0
  25. package/dist/chunk-H33BV5YV.js +2 -0
  26. package/dist/{chunk-TK7ZJ7YX.js → chunk-HNIH3GSQ.js} +1 -1
  27. package/dist/{chunk-ZX3PMRMO.js → chunk-IROWNPDG.js} +1 -1
  28. package/dist/chunk-IXWVTWOR.js +5 -0
  29. package/dist/{chunk-XP5SMOND.js → chunk-J3SCNSXX.js} +1 -1
  30. package/dist/chunk-JI7KJKG4.js +2 -0
  31. package/dist/{chunk-THNGNS36.js → chunk-JPEICMHK.js} +1 -1
  32. package/dist/chunk-KKZRPFWO.js +2 -0
  33. package/dist/chunk-L3MOXBKE.js +5 -0
  34. package/dist/chunk-L5LI2JF4.js +38 -0
  35. package/dist/chunk-N7YALZKA.js +17 -0
  36. package/dist/{chunk-QO6VFDI4.js → chunk-NOQKUOEK.js} +1 -1
  37. package/dist/chunk-OQZG3V6B.js +2 -0
  38. package/dist/{chunk-KVDOQY2Q.js → chunk-PNQ5YMED.js} +1 -1
  39. package/dist/{chunk-L4GAZTAQ.js → chunk-RHXWME7G.js} +1 -1
  40. package/dist/{chunk-VUBZQUP4.js → chunk-RURXFEOD.js} +1 -1
  41. package/dist/{chunk-34DK2AUH.js → chunk-SR5UDUMJ.js} +1 -1
  42. package/dist/{chunk-MEB2KLWF.js → chunk-TEH6AVF4.js} +1 -1
  43. package/dist/{chunk-3ELBJPHQ.js → chunk-TL4SB7MQ.js} +1 -1
  44. package/dist/{chunk-L4OZRHUT.js → chunk-U4QMSR5Z.js} +1 -1
  45. package/dist/{chunk-L2HVRWIT.js → chunk-UFNKCPUB.js} +11 -11
  46. package/dist/chunk-V7QXJKX7.js +3 -0
  47. package/dist/{chunk-BR2S57O2.js → chunk-WM6GZFTC.js} +1 -1
  48. package/dist/chunk-X7VI7KK3.js +11 -0
  49. package/dist/{chunk-RXMOIIQD.js → chunk-XM4H4TJD.js} +1 -1
  50. package/dist/{chunk-3QD3LA72.js → chunk-YF4OL463.js} +1 -1
  51. package/dist/{chunk-HJ3CHMEM.js → chunk-YVLFHMUW.js} +1 -1
  52. package/dist/chunk-YZTCCQHR.js +2 -0
  53. package/dist/{chunk-XMK4GYI7.js → chunk-ZYVYAIBS.js} +1 -1
  54. package/dist/controller-client-OMKEBP4B.js +2 -0
  55. package/dist/index.js +23 -23
  56. package/dist/logging-AIQHWRNQ.js +2 -0
  57. package/dist/login-flow-E6WMJ25A.js +2 -0
  58. package/dist/persist-recorded-session-V5DXMRKC.js +3 -0
  59. package/dist/pipeline-EUZIM2ZO.js +2 -0
  60. package/dist/{recording-banner-IDLY2FM6.js → recording-banner-7ZKIORL5.js} +1 -1
  61. package/dist/resolver-F6HCOZOX.js +2 -0
  62. package/dist/run-test-md-BQS5SZ7E.js +65 -0
  63. package/dist/testmd-actions-322GQYAH.js +20 -0
  64. package/dist/tms-client-XOARLBEP.js +2 -0
  65. package/dist/{validate-basic-27BIMJ2F.js → validate-basic-XKTSGLFO.js} +1 -1
  66. package/dist/version-check-LUCKH72U.js +2 -0
  67. package/package.json +5 -5
  68. package/dist/FolderPicker-I6JTRNAU.js +0 -2
  69. package/dist/HelpView-UEUKYHFR.js +0 -2
  70. package/dist/ProjectPicker-AX6H5MX3.js +0 -2
  71. package/dist/SingleShotApp-YTFAGVZD.js +0 -2
  72. package/dist/changelog-CLQ7HCB3.js +0 -4
  73. package/dist/chunk-BM4COXQU.js +0 -53
  74. package/dist/chunk-BQKDPI6L.js +0 -2
  75. package/dist/chunk-DUR6AFYA.js +0 -5
  76. package/dist/chunk-DXKKUGFG.js +0 -2
  77. package/dist/chunk-F6HEB4PA.js +0 -2
  78. package/dist/chunk-FFO5XXKV.js +0 -4
  79. package/dist/chunk-GTFULP6B.js +0 -13
  80. package/dist/chunk-K7MSPKEM.js +0 -5
  81. package/dist/chunk-KULEBWMB.js +0 -2
  82. package/dist/chunk-L5Y2GUO6.js +0 -2
  83. package/dist/chunk-NZSHFIZX.js +0 -3
  84. package/dist/chunk-PWGEMRBD.js +0 -2
  85. package/dist/chunk-SLA75N5B.js +0 -2
  86. package/dist/chunk-WAFO4MT4.js +0 -20
  87. package/dist/chunk-YUUZDFT7.js +0 -2
  88. package/dist/controller-client-7BIK5FYL.js +0 -2
  89. package/dist/logging-GG23EW5G.js +0 -2
  90. package/dist/login-flow-ZUZUZIXD.js +0 -2
  91. package/dist/persist-recorded-session-ZXKA4H7E.js +0 -5
  92. package/dist/pipeline-BVH3R7YP.js +0 -2
  93. package/dist/resolver-QLDOAIXU.js +0 -2
  94. package/dist/run-test-md-UPAR3DQY.js +0 -54
  95. package/dist/testmd-actions-YYFFNNIH.js +0 -20
  96. package/dist/tms-client-CTH4NVFM.js +0 -2
  97. package/dist/version-check-6DXFF6IN.js +0 -2
@@ -0,0 +1,38 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ function Ce(e){return typeof e>"u"||e===null}function $e(e){return typeof e=="object"&&e!==null}function Qe(e){return Array.isArray(e)?e:Ce(e)?[]:[e]}function Ve(e,n){var i,l,r,u;if(n)for(u=Object.keys(n),i=0,l=u.length;i<l;i+=1)r=u[i],e[r]=n[r];return e}function Xe(e,n){var i="",l;for(l=0;l<n;l+=1)i+=e;return i}function Ze(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var ze=Ce,Je=$e,en=Qe,nn=Xe,rn=Ze,ln=Ve,y={isNothing:ze,isObject:Je,toArray:en,repeat:nn,isNegativeZero:rn,extend:ln};function _e(e,n){var i="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`
3
+
4
+ `+e.mark.snippet),l+" "+i):l}function Y(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=_e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Y.prototype=Object.create(Error.prototype);Y.prototype.constructor=Y;Y.prototype.toString=function(n){return this.name+": "+_e(this,n)};var w=Y;function $(e,n,i,l,r){var u="",o="",f=Math.floor(r/2)-1;return l-n>f&&(u=" ... ",n=l-f+u.length),i-l>f&&(o=" ...",i=l+f-o.length),{str:u+e.slice(n,i).replace(/\t/g,"\u2192")+o,pos:l-n+u.length}}function Q(e,n){return y.repeat(" ",n-e.length)+e}function on(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,l=[0],r=[],u,o=-1;u=i.exec(e.buffer);)r.push(u.index),l.push(u.index+u[0].length),e.position<=u.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var f="",c,a,t=Math.min(e.line+n.linesAfter,r.length).toString().length,p=n.maxLength-(n.indent+t+3);for(c=1;c<=n.linesBefore&&!(o-c<0);c++)a=$(e.buffer,l[o-c],r[o-c],e.position-(l[o]-l[o-c]),p),f=y.repeat(" ",n.indent)+Q((e.line-c+1).toString(),t)+" | "+a.str+`
5
+ `+f;for(a=$(e.buffer,l[o],r[o],e.position,p),f+=y.repeat(" ",n.indent)+Q((e.line+1).toString(),t)+" | "+a.str+`
6
+ `,f+=y.repeat("-",n.indent+t+3+a.pos)+`^
7
+ `,c=1;c<=n.linesAfter&&!(o+c>=r.length);c++)a=$(e.buffer,l[o+c],r[o+c],e.position-(l[o]-l[o+c]),p),f+=y.repeat(" ",n.indent)+Q((e.line+c+1).toString(),t)+" | "+a.str+`
8
+ `;return f.replace(/\n$/,"")}var un=on,fn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],cn=["scalar","sequence","mapping"];function an(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(l){n[String(l)]=i})}),n}function pn(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(fn.indexOf(i)===-1)throw new w('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=an(n.styleAliases||null),cn.indexOf(this.kind)===-1)throw new w('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var C=pn;function ue(e,n){var i=[];return e[n].forEach(function(l){var r=i.length;i.forEach(function(u,o){u.tag===l.tag&&u.kind===l.kind&&u.multi===l.multi&&(r=o)}),i[r]=l}),i}function tn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function l(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(l);return e}function X(e){return this.extend(e)}X.prototype.extend=function(n){var i=[],l=[];if(n instanceof C)l.push(n);else if(Array.isArray(n))l=l.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(l=l.concat(n.explicit));else throw new w("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(u){if(!(u instanceof C))throw new w("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(u.loadKind&&u.loadKind!=="scalar")throw new w("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(u.multi)throw new w("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(u){if(!(u instanceof C))throw new w("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(X.prototype);return r.implicit=(this.implicit||[]).concat(i),r.explicit=(this.explicit||[]).concat(l),r.compiledImplicit=ue(r,"implicit"),r.compiledExplicit=ue(r,"explicit"),r.compiledTypeMap=tn(r.compiledImplicit,r.compiledExplicit),r};var hn=X,dn=new C("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),sn=new C("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),mn=new C("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),xn=new hn({explicit:[dn,sn,mn]});function gn(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function An(){return null}function vn(e){return e===null}var yn=new C("tag:yaml.org,2002:null",{kind:"scalar",resolve:gn,construct:An,predicate:vn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Cn(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function _n(e){return e==="true"||e==="True"||e==="TRUE"}function wn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var En=new C("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Cn,construct:_n,predicate:wn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Sn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Fn(e){return 48<=e&&e<=55}function bn(e){return 48<=e&&e<=57}function Tn(e){if(e===null)return!1;var n=e.length,i=0,l=!1,r;if(!n)return!1;if(r=e[i],(r==="-"||r==="+")&&(r=e[++i]),r==="0"){if(i+1===n)return!0;if(r=e[++i],r==="b"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(r!=="0"&&r!=="1")return!1;l=!0}return l&&r!=="_"}if(r==="x"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!Sn(e.charCodeAt(i)))return!1;l=!0}return l&&r!=="_"}if(r==="o"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!Fn(e.charCodeAt(i)))return!1;l=!0}return l&&r!=="_"}}if(r==="_")return!1;for(;i<n;i++)if(r=e[i],r!=="_"){if(!bn(e.charCodeAt(i)))return!1;l=!0}return!(!l||r==="_")}function On(e){var n=e,i=1,l;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),l=n[0],(l==="-"||l==="+")&&(l==="-"&&(i=-1),n=n.slice(1),l=n[0]),n==="0")return 0;if(l==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function In(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!y.isNegativeZero(e)}var Ln=new C("tag:yaml.org,2002:int",{kind:"scalar",resolve:Tn,construct:On,predicate:In,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),kn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Nn(e){return!(e===null||!kn.test(e)||e[e.length-1]==="_")}function Rn(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var Dn=/^[-+]?[0-9]+e/;function Mn(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(y.isNegativeZero(e))return"-0.0";return i=e.toString(10),Dn.test(i)?i.replace("e",".e"):i}function Yn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||y.isNegativeZero(e))}var Bn=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:Nn,construct:Rn,predicate:Yn,represent:Mn,defaultStyle:"lowercase"}),Pn=xn.extend({implicit:[yn,En,Ln,Bn]}),Hn=Pn,we=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ee=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function jn(e){return e===null?!1:we.exec(e)!==null||Ee.exec(e)!==null}function Un(e){var n,i,l,r,u,o,f,c=0,a=null,t,p,d;if(n=we.exec(e),n===null&&(n=Ee.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],l=+n[2]-1,r=+n[3],!n[4])return new Date(Date.UTC(i,l,r));if(u=+n[4],o=+n[5],f=+n[6],n[7]){for(c=n[7].slice(0,3);c.length<3;)c+="0";c=+c}return n[9]&&(t=+n[10],p=+(n[11]||0),a=(t*60+p)*6e4,n[9]==="-"&&(a=-a)),d=new Date(Date.UTC(i,l,r,u,o,f,c)),a&&d.setTime(d.getTime()-a),d}function Kn(e){return e.toISOString()}var qn=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:jn,construct:Un,instanceOf:Date,represent:Kn});function Gn(e){return e==="<<"||e===null}var Wn=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Gn}),ne=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function $n(e){if(e===null)return!1;var n,i,l=0,r=e.length,u=ne;for(i=0;i<r;i++)if(n=u.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;l+=6}return l%8===0}function Qn(e){var n,i,l=e.replace(/[\r\n=]/g,""),r=l.length,u=ne,o=0,f=[];for(n=0;n<r;n++)n%4===0&&n&&(f.push(o>>16&255),f.push(o>>8&255),f.push(o&255)),o=o<<6|u.indexOf(l.charAt(n));return i=r%4*6,i===0?(f.push(o>>16&255),f.push(o>>8&255),f.push(o&255)):i===18?(f.push(o>>10&255),f.push(o>>2&255)):i===12&&f.push(o>>4&255),new Uint8Array(f)}function Vn(e){var n="",i=0,l,r,u=e.length,o=ne;for(l=0;l<u;l++)l%3===0&&l&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]),i=(i<<8)+e[l];return r=u%3,r===0?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]):r===2?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):r===1&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function Xn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Zn=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:$n,construct:Qn,predicate:Xn,represent:Vn}),zn=Object.prototype.hasOwnProperty,Jn=Object.prototype.toString;function ei(e){if(e===null)return!0;var n=[],i,l,r,u,o,f=e;for(i=0,l=f.length;i<l;i+=1){if(r=f[i],o=!1,Jn.call(r)!=="[object Object]")return!1;for(u in r)if(zn.call(r,u))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(u)===-1)n.push(u);else return!1}return!0}function ni(e){return e!==null?e:[]}var ii=new C("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ei,construct:ni}),ri=Object.prototype.toString;function li(e){if(e===null)return!0;var n,i,l,r,u,o=e;for(u=new Array(o.length),n=0,i=o.length;n<i;n+=1){if(l=o[n],ri.call(l)!=="[object Object]"||(r=Object.keys(l),r.length!==1))return!1;u[n]=[r[0],l[r[0]]]}return!0}function oi(e){if(e===null)return[];var n,i,l,r,u,o=e;for(u=new Array(o.length),n=0,i=o.length;n<i;n+=1)l=o[n],r=Object.keys(l),u[n]=[r[0],l[r[0]]];return u}var ui=new C("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:li,construct:oi}),fi=Object.prototype.hasOwnProperty;function ci(e){if(e===null)return!0;var n,i=e;for(n in i)if(fi.call(i,n)&&i[n]!==null)return!1;return!0}function ai(e){return e!==null?e:{}}var pi=new C("tag:yaml.org,2002:set",{kind:"mapping",resolve:ci,construct:ai}),Se=Hn.extend({implicit:[qn,Wn],explicit:[Zn,ii,ui,pi]}),O=Object.prototype.hasOwnProperty,j=1,Fe=2,be=3,U=4,V=1,ti=2,fe=3,hi=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,di=/[\x85\u2028\u2029]/,si=/[,\[\]\{\}]/,Te=/^(?:!|!!|![a-z\-]+!)$/i,Oe=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ce(e){return Object.prototype.toString.call(e)}function F(e){return e===10||e===13}function L(e){return e===9||e===32}function E(e){return e===9||e===32||e===10||e===13}function N(e){return e===44||e===91||e===93||e===123||e===125}function mi(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function xi(e){return e===120?2:e===117?4:e===85?8:0}function gi(e){return 48<=e&&e<=57?e-48:-1}function ae(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
10
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Ai(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Ie(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var Le=new Array(256),ke=new Array(256);for(I=0;I<256;I++)Le[I]=ae(I)?1:0,ke[I]=ae(I);var I;function vi(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Se,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ne(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=un(i),new w(n,i)}function h(e,n){throw Ne(e,n)}function K(e,n){e.onWarning&&e.onWarning.call(null,Ne(e,n))}var pe={YAML:function(n,i,l){var r,u,o;n.version!==null&&h(n,"duplication of %YAML directive"),l.length!==1&&h(n,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(l[0]),r===null&&h(n,"ill-formed argument of the YAML directive"),u=parseInt(r[1],10),o=parseInt(r[2],10),u!==1&&h(n,"unacceptable YAML version of the document"),n.version=l[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&K(n,"unsupported YAML version of the document")},TAG:function(n,i,l){var r,u;l.length!==2&&h(n,"TAG directive accepts exactly two arguments"),r=l[0],u=l[1],Te.test(r)||h(n,"ill-formed tag handle (first argument) of the TAG directive"),O.call(n.tagMap,r)&&h(n,'there is a previously declared suffix for "'+r+'" tag handle'),Oe.test(u)||h(n,"ill-formed tag prefix (second argument) of the TAG directive");try{u=decodeURIComponent(u)}catch{h(n,"tag prefix is malformed: "+u)}n.tagMap[r]=u}};function T(e,n,i,l){var r,u,o,f;if(n<i){if(f=e.input.slice(n,i),l)for(r=0,u=f.length;r<u;r+=1)o=f.charCodeAt(r),o===9||32<=o&&o<=1114111||h(e,"expected valid JSON character");else hi.test(f)&&h(e,"the stream contains non-printable characters");e.result+=f}}function te(e,n,i,l){var r,u,o,f;for(y.isObject(i)||h(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(i),o=0,f=r.length;o<f;o+=1)u=r[o],O.call(n,u)||(Ie(n,u,i[u]),l[u]=!0)}function R(e,n,i,l,r,u,o,f,c){var a,t;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),a=0,t=r.length;a<t;a+=1)Array.isArray(r[a])&&h(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ce(r[a])==="[object Object]"&&(r[a]="[object Object]");if(typeof r=="object"&&ce(r)==="[object Object]"&&(r="[object Object]"),r=String(r),n===null&&(n={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(u))for(a=0,t=u.length;a<t;a+=1)te(e,n,u[a],i);else te(e,n,u,i);else!e.json&&!O.call(i,r)&&O.call(n,r)&&(e.line=o||e.line,e.lineStart=f||e.lineStart,e.position=c||e.position,h(e,"duplicated mapping key")),Ie(n,r,u),delete i[r];return n}function ie(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):h(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function v(e,n,i){for(var l=0,r=e.input.charCodeAt(e.position);r!==0;){for(;L(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(n&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(F(r))for(ie(e),r=e.input.charCodeAt(e.position),l++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return i!==-1&&l!==0&&e.lineIndent<i&&K(e,"deficient indentation"),l}function W(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||E(i)))}function re(e,n){n===1?e.result+=" ":n>1&&(e.result+=y.repeat(`
11
+ `,n-1))}function yi(e,n,i){var l,r,u,o,f,c,a,t,p=e.kind,d=e.result,s;if(s=e.input.charCodeAt(e.position),E(s)||N(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(r=e.input.charCodeAt(e.position+1),E(r)||i&&N(r)))return!1;for(e.kind="scalar",e.result="",u=o=e.position,f=!1;s!==0;){if(s===58){if(r=e.input.charCodeAt(e.position+1),E(r)||i&&N(r))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),E(l))break}else{if(e.position===e.lineStart&&W(e)||i&&N(s))break;if(F(s))if(c=e.line,a=e.lineStart,t=e.lineIndent,v(e,!1,-1),e.lineIndent>=n){f=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=a,e.lineIndent=t;break}}f&&(T(e,u,o,!1),re(e,e.line-c),u=o=e.position,f=!1),L(s)||(o=e.position+1),s=e.input.charCodeAt(++e.position)}return T(e,u,o,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function Ci(e,n){var i,l,r;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(T(e,l,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)l=e.position,e.position++,r=e.position;else return!0;else F(i)?(T(e,l,r,!0),re(e,v(e,!1,n)),l=r=e.position):e.position===e.lineStart&&W(e)?h(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);h(e,"unexpected end of the stream within a single quoted scalar")}function _i(e,n){var i,l,r,u,o,f;if(f=e.input.charCodeAt(e.position),f!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=l=e.position;(f=e.input.charCodeAt(e.position))!==0;){if(f===34)return T(e,i,e.position,!0),e.position++,!0;if(f===92){if(T(e,i,e.position,!0),f=e.input.charCodeAt(++e.position),F(f))v(e,!1,n);else if(f<256&&Le[f])e.result+=ke[f],e.position++;else if((o=xi(f))>0){for(r=o,u=0;r>0;r--)f=e.input.charCodeAt(++e.position),(o=mi(f))>=0?u=(u<<4)+o:h(e,"expected hexadecimal character");e.result+=Ai(u),e.position++}else h(e,"unknown escape sequence");i=l=e.position}else F(f)?(T(e,i,l,!0),re(e,v(e,!1,n)),i=l=e.position):e.position===e.lineStart&&W(e)?h(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}h(e,"unexpected end of the stream within a double quoted scalar")}function wi(e,n){var i=!0,l,r,u,o=e.tag,f,c=e.anchor,a,t,p,d,s,m=Object.create(null),g,A,S,x;if(x=e.input.charCodeAt(e.position),x===91)t=93,s=!1,f=[];else if(x===123)t=125,s=!0,f={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),x=e.input.charCodeAt(++e.position);x!==0;){if(v(e,!0,n),x=e.input.charCodeAt(e.position),x===t)return e.position++,e.tag=o,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=f,!0;i?x===44&&h(e,"expected the node content, but found ','"):h(e,"missed comma between flow collection entries"),A=g=S=null,p=d=!1,x===63&&(a=e.input.charCodeAt(e.position+1),E(a)&&(p=d=!0,e.position++,v(e,!0,n))),l=e.line,r=e.lineStart,u=e.position,D(e,n,j,!1,!0),A=e.tag,g=e.result,v(e,!0,n),x=e.input.charCodeAt(e.position),(d||e.line===l)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),v(e,!0,n),D(e,n,j,!1,!0),S=e.result),s?R(e,f,m,A,g,S,l,r,u):p?f.push(R(e,null,m,A,g,S,l,r,u)):f.push(g),v(e,!0,n),x=e.input.charCodeAt(e.position),x===44?(i=!0,x=e.input.charCodeAt(++e.position)):i=!1}h(e,"unexpected end of the stream within a flow collection")}function Ei(e,n){var i,l,r=V,u=!1,o=!1,f=n,c=0,a=!1,t,p;if(p=e.input.charCodeAt(e.position),p===124)l=!1;else if(p===62)l=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)V===r?r=p===43?fe:ti:h(e,"repeat of a chomping mode identifier");else if((t=gi(p))>=0)t===0?h(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?h(e,"repeat of an indentation width identifier"):(f=n+t-1,o=!0);else break;if(L(p)){do p=e.input.charCodeAt(++e.position);while(L(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!F(p)&&p!==0)}for(;p!==0;){for(ie(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!o||e.lineIndent<f)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>f&&(f=e.lineIndent),F(p)){c++;continue}if(e.lineIndent<f){r===fe?e.result+=y.repeat(`
12
+ `,u?1+c:c):r===V&&u&&(e.result+=`
13
+ `);break}for(l?L(p)?(a=!0,e.result+=y.repeat(`
14
+ `,u?1+c:c)):a?(a=!1,e.result+=y.repeat(`
15
+ `,c+1)):c===0?u&&(e.result+=" "):e.result+=y.repeat(`
16
+ `,c):e.result+=y.repeat(`
17
+ `,u?1+c:c),u=!0,o=!0,c=0,i=e.position;!F(p)&&p!==0;)p=e.input.charCodeAt(++e.position);T(e,i,e.position,!1)}return!0}function he(e,n){var i,l=e.tag,r=e.anchor,u=[],o,f=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,h(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!E(o))));){if(f=!0,e.position++,v(e,!0,-1)&&e.lineIndent<=n){u.push(null),c=e.input.charCodeAt(e.position);continue}if(i=e.line,D(e,n,be,!1,!0),u.push(e.result),v(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&c!==0)h(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return f?(e.tag=l,e.anchor=r,e.kind="sequence",e.result=u,!0):!1}function Si(e,n,i){var l,r,u,o,f,c,a=e.tag,t=e.anchor,p={},d=Object.create(null),s=null,m=null,g=null,A=!1,S=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),x=e.input.charCodeAt(e.position);x!==0;){if(!A&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,h(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),u=e.line,(x===63||x===58)&&E(l))x===63?(A&&(R(e,p,d,s,m,null,o,f,c),s=m=g=null),S=!0,A=!0,r=!0):A?(A=!1,r=!0):h(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=l;else{if(o=e.line,f=e.lineStart,c=e.position,!D(e,i,Fe,!1,!0))break;if(e.line===u){for(x=e.input.charCodeAt(e.position);L(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),E(x)||h(e,"a whitespace character is expected after the key-value separator within a block mapping"),A&&(R(e,p,d,s,m,null,o,f,c),s=m=g=null),S=!0,A=!1,r=!1,s=e.tag,m=e.result;else if(S)h(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=a,e.anchor=t,!0}else if(S)h(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=a,e.anchor=t,!0}if((e.line===u||e.lineIndent>n)&&(A&&(o=e.line,f=e.lineStart,c=e.position),D(e,n,U,!0,r)&&(A?m=e.result:g=e.result),A||(R(e,p,d,s,m,g,o,f,c),s=m=g=null),v(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===u||e.lineIndent>n)&&x!==0)h(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return A&&R(e,p,d,s,m,null,o,f,c),S&&(e.tag=a,e.anchor=t,e.kind="mapping",e.result=p),S}function Fi(e){var n,i=!1,l=!1,r,u,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&h(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(i=!0,o=e.input.charCodeAt(++e.position)):o===33?(l=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",n=e.position,i){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(u=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):h(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!E(o);)o===33&&(l?h(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(n-1,e.position+1),Te.test(r)||h(e,"named tag handle cannot contain such characters"),l=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);u=e.input.slice(n,e.position),si.test(u)&&h(e,"tag suffix cannot contain flow indicator characters")}u&&!Oe.test(u)&&h(e,"tag name cannot contain such characters: "+u);try{u=decodeURIComponent(u)}catch{h(e,"tag name is malformed: "+u)}return i?e.tag=u:O.call(e.tagMap,r)?e.tag=e.tagMap[r]+u:r==="!"?e.tag="!"+u:r==="!!"?e.tag="tag:yaml.org,2002:"+u:h(e,'undeclared tag handle "'+r+'"'),!0}function bi(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&h(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!E(i)&&!N(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&h(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Ti(e){var n,i,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),n=e.position;l!==0&&!E(l)&&!N(l);)l=e.input.charCodeAt(++e.position);return e.position===n&&h(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),O.call(e.anchorMap,i)||h(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],v(e,!0,-1),!0}function D(e,n,i,l,r){var u,o,f,c=1,a=!1,t=!1,p,d,s,m,g,A;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,u=o=f=U===i||be===i,l&&v(e,!0,-1)&&(a=!0,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)),c===1)for(;Fi(e)||bi(e);)v(e,!0,-1)?(a=!0,f=u,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)):f=!1;if(f&&(f=a||r),(c===1||U===i)&&(j===i||Fe===i?g=n:g=n+1,A=e.position-e.lineStart,c===1?f&&(he(e,A)||Si(e,A,g))||wi(e,g)?t=!0:(o&&Ei(e,g)||Ci(e,g)||_i(e,g)?t=!0:Ti(e)?(t=!0,(e.tag!==null||e.anchor!==null)&&h(e,"alias node should not have any properties")):yi(e,g,j===i)&&(t=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(t=f&&he(e,A))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&h(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,d=e.implicitTypes.length;p<d;p+=1)if(m=e.implicitTypes[p],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(O.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,s=e.typeMap.multi[e.kind||"fallback"],p=0,d=s.length;p<d;p+=1)if(e.tag.slice(0,s[p].tag.length)===s[p].tag){m=s[p];break}m||h(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&h(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):h(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||t}function Oi(e){var n=e.position,i,l,r,u=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(v(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(u=!0,o=e.input.charCodeAt(++e.position),i=e.position;o!==0&&!E(o);)o=e.input.charCodeAt(++e.position);for(l=e.input.slice(i,e.position),r=[],l.length<1&&h(e,"directive name must not be less than one character in length");o!==0;){for(;L(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!F(o));break}if(F(o))break;for(i=e.position;o!==0&&!E(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(i,e.position))}o!==0&&ie(e),O.call(pe,l)?pe[l](e,l,r):K(e,'unknown document directive "'+l+'"')}if(v(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,v(e,!0,-1)):u&&h(e,"directives end mark is expected"),D(e,e.lineIndent-1,U,!1,!0),v(e,!0,-1),e.checkLineBreaks&&di.test(e.input.slice(n,e.position))&&K(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&W(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,v(e,!0,-1));return}if(e.position<e.length-1)h(e,"end of the stream or a document separator is expected");else return}function Re(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new vi(e,n),l=e.indexOf("\0");for(l!==-1&&(i.position=l,h(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)Oi(i);return i.documents}function Ii(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var l=Re(e,i);if(typeof n!="function")return l;for(var r=0,u=l.length;r<u;r+=1)n(l[r])}function Li(e,n){var i=Re(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new w("expected a single document in the stream, but found more")}}var ki=Ii,Ni=Li,De={loadAll:ki,load:Ni},Me=Object.prototype.toString,Ye=Object.prototype.hasOwnProperty,le=65279,Ri=9,B=10,Di=13,Mi=32,Yi=33,Bi=34,Z=35,Pi=37,Hi=38,ji=39,Ui=42,Be=44,Ki=45,q=58,qi=61,Gi=62,Wi=63,$i=64,Pe=91,He=93,Qi=96,je=123,Vi=124,Ue=125,_={};_[0]="\\0";_[7]="\\a";_[8]="\\b";_[9]="\\t";_[10]="\\n";_[11]="\\v";_[12]="\\f";_[13]="\\r";_[27]="\\e";_[34]='\\"';_[92]="\\\\";_[133]="\\N";_[160]="\\_";_[8232]="\\L";_[8233]="\\P";var Xi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Zi=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function zi(e,n){var i,l,r,u,o,f,c;if(n===null)return{};for(i={},l=Object.keys(n),r=0,u=l.length;r<u;r+=1)o=l[r],f=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&Ye.call(c.styleAliases,f)&&(f=c.styleAliases[f]),i[o]=f;return i}function Ji(e){var n,i,l;if(n=e.toString(16).toUpperCase(),e<=255)i="x",l=2;else if(e<=65535)i="u",l=4;else if(e<=4294967295)i="U",l=8;else throw new w("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+y.repeat("0",l-n.length)+n}var er=1,P=2;function nr(e){this.schema=e.schema||Se,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=y.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=zi(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?P:er,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function de(e,n){for(var i=y.repeat(" ",n),l=0,r=-1,u="",o,f=e.length;l<f;)r=e.indexOf(`
19
+ `,l),r===-1?(o=e.slice(l),l=f):(o=e.slice(l,r+1),l=r+1),o.length&&o!==`
20
+ `&&(u+=i),u+=o;return u}function z(e,n){return`
21
+ `+y.repeat(" ",e.indent*n)}function ir(e,n){var i,l,r;for(i=0,l=e.implicitTypes.length;i<l;i+=1)if(r=e.implicitTypes[i],r.resolve(n))return!0;return!1}function G(e){return e===Mi||e===Ri}function H(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==le||65536<=e&&e<=1114111}function se(e){return H(e)&&e!==le&&e!==Di&&e!==B}function me(e,n,i){var l=se(e),r=l&&!G(e);return(i?l:l&&e!==Be&&e!==Pe&&e!==He&&e!==je&&e!==Ue)&&e!==Z&&!(n===q&&!r)||se(n)&&!G(n)&&e===Z||n===q&&r}function rr(e){return H(e)&&e!==le&&!G(e)&&e!==Ki&&e!==Wi&&e!==q&&e!==Be&&e!==Pe&&e!==He&&e!==je&&e!==Ue&&e!==Z&&e!==Hi&&e!==Ui&&e!==Yi&&e!==Vi&&e!==qi&&e!==Gi&&e!==ji&&e!==Bi&&e!==Pi&&e!==$i&&e!==Qi}function lr(e){return!G(e)&&e!==q}function M(e,n){var i=e.charCodeAt(n),l;return i>=55296&&i<=56319&&n+1<e.length&&(l=e.charCodeAt(n+1),l>=56320&&l<=57343)?(i-55296)*1024+l-56320+65536:i}function Ke(e){var n=/^\n* /;return n.test(e)}var qe=1,J=2,Ge=3,We=4,k=5;function or(e,n,i,l,r,u,o,f){var c,a=0,t=null,p=!1,d=!1,s=l!==-1,m=-1,g=rr(M(e,0))&&lr(M(e,e.length-1));if(n||o)for(c=0;c<e.length;a>=65536?c+=2:c++){if(a=M(e,c),!H(a))return k;g=g&&me(a,t,f),t=a}else{for(c=0;c<e.length;a>=65536?c+=2:c++){if(a=M(e,c),a===B)p=!0,s&&(d=d||c-m-1>l&&e[m+1]!==" ",m=c);else if(!H(a))return k;g=g&&me(a,t,f),t=a}d=d||s&&c-m-1>l&&e[m+1]!==" "}return!p&&!d?g&&!o&&!r(e)?qe:u===P?k:J:i>9&&Ke(e)?k:o?u===P?k:J:d?We:Ge}function ur(e,n,i,l,r){e.dump=(function(){if(n.length===0)return e.quotingType===P?'""':"''";if(!e.noCompatMode&&(Xi.indexOf(n)!==-1||Zi.test(n)))return e.quotingType===P?'"'+n+'"':"'"+n+"'";var u=e.indent*Math.max(1,i),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-u),f=l||e.flowLevel>-1&&i>=e.flowLevel;function c(a){return ir(e,a)}switch(or(n,f,e.indent,o,c,e.quotingType,e.forceQuotes&&!l,r)){case qe:return n;case J:return"'"+n.replace(/'/g,"''")+"'";case Ge:return"|"+xe(n,e.indent)+ge(de(n,u));case We:return">"+xe(n,e.indent)+ge(de(fr(n,o),u));case k:return'"'+cr(n)+'"';default:throw new w("impossible error: invalid scalar style")}})()}function xe(e,n){var i=Ke(e)?String(n):"",l=e[e.length-1]===`
22
+ `,r=l&&(e[e.length-2]===`
23
+ `||e===`
24
+ `),u=r?"+":l?"":"-";return i+u+`
25
+ `}function ge(e){return e[e.length-1]===`
26
+ `?e.slice(0,-1):e}function fr(e,n){for(var i=/(\n+)([^\n]*)/g,l=(function(){var a=e.indexOf(`
27
+ `);return a=a!==-1?a:e.length,i.lastIndex=a,Ae(e.slice(0,a),n)})(),r=e[0]===`
28
+ `||e[0]===" ",u,o;o=i.exec(e);){var f=o[1],c=o[2];u=c[0]===" ",l+=f+(!r&&!u&&c!==""?`
29
+ `:"")+Ae(c,n),r=u}return l}function Ae(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,l,r=0,u,o=0,f=0,c="";l=i.exec(e);)f=l.index,f-r>n&&(u=o>r?o:f,c+=`
30
+ `+e.slice(r,u),r=u+1),o=f;return c+=`
31
+ `,e.length-r>n&&o>r?c+=e.slice(r,o)+`
32
+ `+e.slice(o+1):c+=e.slice(r),c.slice(1)}function cr(e){for(var n="",i=0,l,r=0;r<e.length;i>=65536?r+=2:r++)i=M(e,r),l=_[i],!l&&H(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=l||Ji(i);return n}function ar(e,n,i){var l="",r=e.tag,u,o,f;for(u=0,o=i.length;u<o;u+=1)f=i[u],e.replacer&&(f=e.replacer.call(i,String(u),f)),(b(e,n,f,!1,!1)||typeof f>"u"&&b(e,n,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=r,e.dump="["+l+"]"}function ve(e,n,i,l){var r="",u=e.tag,o,f,c;for(o=0,f=i.length;o<f;o+=1)c=i[o],e.replacer&&(c=e.replacer.call(i,String(o),c)),(b(e,n+1,c,!0,!0,!1,!0)||typeof c>"u"&&b(e,n+1,null,!0,!0,!1,!0))&&((!l||r!=="")&&(r+=z(e,n)),e.dump&&B===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=u,e.dump=r||"[]"}function pr(e,n,i){var l="",r=e.tag,u=Object.keys(i),o,f,c,a,t;for(o=0,f=u.length;o<f;o+=1)t="",l!==""&&(t+=", "),e.condenseFlow&&(t+='"'),c=u[o],a=i[c],e.replacer&&(a=e.replacer.call(i,c,a)),b(e,n,c,!1,!1)&&(e.dump.length>1024&&(t+="? "),t+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),b(e,n,a,!1,!1)&&(t+=e.dump,l+=t));e.tag=r,e.dump="{"+l+"}"}function tr(e,n,i,l){var r="",u=e.tag,o=Object.keys(i),f,c,a,t,p,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new w("sortKeys must be a boolean or a function");for(f=0,c=o.length;f<c;f+=1)d="",(!l||r!=="")&&(d+=z(e,n)),a=o[f],t=i[a],e.replacer&&(t=e.replacer.call(i,a,t)),b(e,n+1,a,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&B===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=z(e,n)),b(e,n+1,t,!0,p)&&(e.dump&&B===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,r+=d));e.tag=u,e.dump=r||"{}"}function ye(e,n,i){var l,r,u,o,f,c;for(r=i?e.explicitTypes:e.implicitTypes,u=0,o=r.length;u<o;u+=1)if(f=r[u],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof n=="object"&&n instanceof f.instanceOf)&&(!f.predicate||f.predicate(n))){if(i?f.multi&&f.representName?e.tag=f.representName(n):e.tag=f.tag:e.tag="?",f.represent){if(c=e.styleMap[f.tag]||f.defaultStyle,Me.call(f.represent)==="[object Function]")l=f.represent(n,c);else if(Ye.call(f.represent,c))l=f.represent[c](n,c);else throw new w("!<"+f.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function b(e,n,i,l,r,u,o){e.tag=null,e.dump=i,ye(e,i,!1)||ye(e,i,!0);var f=Me.call(e.dump),c=l,a;l&&(l=e.flowLevel<0||e.flowLevel>n);var t=f==="[object Object]"||f==="[object Array]",p,d;if(t&&(p=e.duplicates.indexOf(i),d=p!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&n>0)&&(r=!1),d&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(t&&d&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),f==="[object Object]")l&&Object.keys(e.dump).length!==0?(tr(e,n,e.dump,r),d&&(e.dump="&ref_"+p+e.dump)):(pr(e,n,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(f==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?ve(e,n-1,e.dump,r):ve(e,n,e.dump,r),d&&(e.dump="&ref_"+p+e.dump)):(ar(e,n,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(f==="[object String]")e.tag!=="?"&&ur(e,e.dump,n,u,c);else{if(f==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new w("unacceptable kind of an object to dump "+f)}e.tag!==null&&e.tag!=="?"&&(a=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?a="!"+a:a.slice(0,18)==="tag:yaml.org,2002:"?a="!!"+a.slice(18):a="!<"+a+">",e.dump=a+" "+e.dump)}return!0}function hr(e,n){var i=[],l=[],r,u;for(ee(e,i,l),r=0,u=l.length;r<u;r+=1)n.duplicates.push(i[l[r]]);n.usedDuplicates=new Array(u)}function ee(e,n,i){var l,r,u;if(e!==null&&typeof e=="object")if(r=n.indexOf(e),r!==-1)i.indexOf(r)===-1&&i.push(r);else if(n.push(e),Array.isArray(e))for(r=0,u=e.length;r<u;r+=1)ee(e[r],n,i);else for(l=Object.keys(e),r=0,u=l.length;r<u;r+=1)ee(e[l[r]],n,i)}function dr(e,n){n=n||{};var i=new nr(n);i.noRefs||hr(e,i);var l=e;return i.replacer&&(l=i.replacer.call({"":l},"",l)),b(i,0,l,!0,!0)?i.dump+`
33
+ `:""}var sr=dr,mr={dump:sr};function oe(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var xr=De.load,gr=De.loadAll,Ar=mr.dump;var vr=oe("safeLoad","load"),yr=oe("safeLoadAll","loadAll"),Cr=oe("safeDump","dump");export{xr as a,Ar as b};
34
+ /*! Bundled license information:
35
+
36
+ js-yaml/dist/js-yaml.mjs:
37
+ (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
38
+ */
@@ -0,0 +1,17 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as m}from"./chunk-L5LI2JF4.js";import{c as p}from"./chunk-TL4SB7MQ.js";import{randomUUID as L}from"crypto";import{mkdirSync as j,writeFileSync as _,appendFileSync as $,existsSync as f}from"fs";import{join as a}from"path";import{writeFileSync as R,mkdirSync as S,existsSync as b}from"fs";import{join as h,relative as w}from"path";var I=new Set(["username","access_key","oauth","profile","project_id","folder_id"]),x=new Set(["model","env"]),d=class{constructor(e){this.opts=e}objectives=[];flushed=!1;lastWrittenPath=null;lastCollisionSuffixed=!1;appendObjective(e){this.objectives.push(e)}flush(){if(this.flushed||(this.flushed=!0,this.objectives.length===0))return;let e=this.opts.getName();if(!e)return;let t=h(this.opts.cwd,".testmuai","tests");try{S(t,{recursive:!0})}catch(l){process.stderr.write(`
3
+ \u26A0 Failed to create ${w(this.opts.cwd,t)}/
4
+ ${l.message}
5
+ Your test recording was NOT saved.
6
+
7
+ `);return}let s=h(t,`${e}_test.md`),r=2,n=!1;for(;b(s);)s=h(t,`${e}-${r}_test.md`),r++,n=!0;let u=y(this.opts.getResolvedGlobal()),o=m(u).trimEnd(),i=[];i.push("---"),o&&i.push(o),i.push("---",""),i.push(`# Session: ${e}`,""),this.objectives.forEach((l,c)=>{i.push(`## Step ${c+1}`,l,"")});try{R(s,i.join(`
8
+ `),"utf8")}catch(l){process.stderr.write(`
9
+ \u26A0 Failed to save your test recording.
10
+ ${l.message}
11
+ Path: ${s}
12
+
13
+ `);return}this.lastWrittenPath=s,this.lastCollisionSuffixed=n}};function y(g){let e={};for(let[t,s]of Object.entries(g))I.has(t)||x.has(t)||(e[t]=s);return e}var E=a(p,"sessions"),v=class{sessionId;sessionDir;runs=[];_flows=[];_nextIndex=0;_started=!1;_testId=null;_testcaseId=null;_projectId=null;_orgId=null;_uploadStatus="pending";_uploadAttempts=0;_uploadError=null;_firstObjective=null;_firstUrl=null;_auteurVariables={};_screenshotSas=null;_model="";_environment="";_profile=null;_startedAt="";_remoteLogger=null;_earlyLogBuffer=[];_recorder=null;_resolvedGlobal={};_sessionName=null;_recordingEnabled=!0;_stepRunRecords=[];constructor(){this.sessionId=L(),this.sessionDir=a(E,this.sessionId)}setResolvedGlobal(e){this._resolvedGlobal={...this._resolvedGlobal,...e}}setSessionName(e){this._sessionName=e}get sessionName(){return this._sessionName}setRecordingEnabled(e){this._recordingEnabled=e}get recorder(){return this._recorder}flushRecorder(){try{this._recorder?.flush()}catch(e){process.stderr.write(`[recorder] flush failed: ${e.message}
14
+ `)}}start(e){if(!this._started){this._started=!0,this._model=e.model,this._environment=e.environment,this._profile=e.profile,this._startedAt=new Date().toISOString();try{j(this.sessionDir,{recursive:!0}),this._recorder=new d({cwd:process.cwd(),getResolvedGlobal:()=>this._resolvedGlobal,getName:()=>this._sessionName});let t={session_id:this.sessionId,started_at:this._startedAt,model:e.model,environment:e.environment,profile:e.profile,objectives:[],runs:[],status:"in_progress"};_(a(this.sessionDir,"session.json"),JSON.stringify(t,null,2)+`
15
+ `)}catch{}this._log(`SESSION START session_id=${this.sessionId}`),this._log(`CONFIG model=${e.model} env=${e.environment} profile=${e.profile}`),this._earlyLogBuffer.push({level:"info",event:"SESSION_START",message:"Session started",context:{session_id:this.sessionId}},{level:"info",event:"CONFIG",message:"Session config",context:{model:e.model,environment:e.environment,profile:e.profile}})}}setRemoteLogger(e){this._remoteLogger=e;for(let t of this._earlyLogBuffer)e.log(t.level,t.event,t.message,t.context);this._earlyLogBuffer=[]}get hasRemoteLogger(){return this._remoteLogger!==null}setAuteurVariables(e){Object.assign(this._auteurVariables,e)}get auteurVariables(){return this._auteurVariables}setScreenshotSas(e){this._screenshotSas=e}get screenshotSas(){return this._screenshotSas}get screenshotBaseUrl(){return this._screenshotSas?`${this._screenshotSas.base_url}/${this._screenshotSas.container}`:""}get startedAt(){return this._startedAt||new Date().toISOString()}log(e,t,s,r){if(t===void 0){this._log(e);let o=e.indexOf(" "),i=o>0?e.slice(0,o):e,l=o>0?e.slice(o+1):"",c=/fail|error/i.test(e)?"error":"info";this._remoteLogger?.log(c,i,l||e);return}let n=e,u=s;this._log(`${t} ${u}`),this._remoteLogger?.log(n,t,u,r)}logStep(e,t,s){this._log(`${e} ${t}`);let r=this._nextIndex>0?this._nextIndex-1:0;this._remoteLogger?.logStep(r,e,t,s)}logCommand(e){this._log(`COMMAND ${e}`)}logRunStart(e,t,s){this._log(`RUN ${e} START objective="${t.slice(0,100)}" url=${s}`),this._remoteLogger?.setRunIndex(e),this._remoteLogger?.log("info","RUN_START",`Run ${e} started`,{run_index:e,objective:t,url:s})}logRunEnd(e,t,s,r){let n=(s??0).toFixed(1),u=(r??"").slice(0,100);this._log(`RUN ${e} END status=${t} duration=${n}s summary="${u}"`),this._remoteLogger?.log("info","RUN_END",`Run ${e} ended`,{run_index:e,status:t,duration:s??0,summary:r??""}),t!=="failed"&&t!=="error"&&this._remoteLogger?.discardSteps(e)}escalateRun(e){this._remoteLogger?.escalate(e)}logChromeLaunch(e,t){this._log(`CHROME LAUNCH port=${e} endpoint=${t}`),this._remoteLogger?.log("info","CHROME_LAUNCH","Chrome launched",{port:e,cdp_endpoint:t})}async finish(e="complete"){this._log(`SESSION END status=${e} total_runs=${this.runs.length}`),this._remoteLogger?.log("info","SESSION_END","Session ended",{status:e,total_runs:this.runs.length}),await this._remoteLogger?.shutdown();let t={session_id:this.sessionId,started_at:this._startedAt,ended_at:new Date().toISOString(),model:this._model,environment:this._environment,profile:this._profile,status:e,total_runs:this.runs.length,test_id:this._testId,testcase_id:this._testcaseId,commit_id:this.sessionId,project_id:this._projectId,upload_status:this._uploadStatus,upload_attempts:this._uploadAttempts,last_upload_attempt:this._uploadAttempts>0?new Date().toISOString():null,upload_error:this._uploadError,runs:this.runs.map(s=>({index:s.index,objective:s.objective,status:s.status,summary:s.summary,run_dir:s.run_dir}))};f(this.sessionDir)&&_(a(this.sessionDir,"session.json"),JSON.stringify(t,null,2)+`
16
+ `),this.flushRecorder(),this._recorder=null}nextRunIndex(){return this._nextIndex}addRunResult(e,t){this.runs.push(e),this._nextIndex+=t??1,this._recordingEnabled&&this._recorder?.appendObjective(e.objective)}getContext(){return{prior_runs:this.runs.map(e=>({index:e.index,objective:e.objective,summary:e.summary,status:e.status,memory:e.context.memory,variables:e.context.variables,pointer:e.context.pointer}))}}addFlow(e){let t={...e,index:this._flows.length+1};return this._flows.push(t),t}getFlows(){return[...this._flows]}getFlow(e){return this._flows.find(t=>t.index===e)}clearFlows(){this._flows=[]}recordStepRun(e){this._stepRunRecords.push(e)}getStepRunRecords(){return[...this._stepRunRecords]}getRunsAsStepRecords(){return this.runs.map((e,t)=>({testmdStepIndex:t+1,runIndex:e.index,totalRunDirs:e.run_dirs?.length??1}))}snapshot(){return{runsLen:this.runs.length,nextRunIndex:this._nextIndex,stepRunRecordsLen:this._stepRunRecords.length}}rollback(e){this.runs.length=e.runsLen,this._nextIndex=e.nextRunIndex,this._stepRunRecords.length=e.stepRunRecordsLen}setTestId(e){this._testId=e}get testId(){return this._testId}setTestcaseId(e){this._testcaseId=e}get testcaseId(){return this._testcaseId}setProjectId(e){this._projectId=e}setOrgId(e){this._orgId=e}get orgId(){return this._orgId}setFirstRun(e,t){this._firstObjective||(this._firstObjective=e,this._firstUrl=t)}get firstObjective(){return this._firstObjective}get firstUrl(){return this._firstUrl}getRunDirs(){let e=[];for(let t of this.runs)t.run_dirs&&t.run_dirs.length>0?e.push(...t.run_dirs):t.run_dir&&e.push(t.run_dir);return e}getRunObjectives(){let e=[];for(let t of this.runs)t.flow_objectives&&t.flow_objectives.length>0?e.push(...t.flow_objectives):e.push(t.objective);return e}getRunMetadata(){let e=[];for(let t of this.runs)if(t.perFlowMetadata&&t.perFlowMetadata.length>0)e.push(...t.perFlowMetadata);else{let s={resultCode:t.resultCode,reasonCode:t.reasonCode,errorMessage:t.status==="failed"?t.summary??null:null,summary:t.summary,oneLiner:t.oneLiner},r=t.run_dirs?.length??1;for(let n=0;n<r;n++)e.push(s)}return e}setUploadStatus(e,t){this._uploadStatus=e,this._uploadAttempts+=1,this._uploadError=t??null}_log(e){if(!(!this._started||!f(this.sessionDir)))try{let t=new Date().toISOString().slice(0,19).replace("T"," "),s=a(this.sessionDir,"tui.log");$(s,`[${t}] ${e}
17
+ `)}catch{}}};export{v as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as h}from"./chunk-HJ3CHMEM.js";import{a as A}from"./chunk-HCBYKLMW.js";import{t as a}from"./chunk-3ELBJPHQ.js";import{a as c,b as f,i as P}from"./chunk-C44QQJR4.js";import{a as y}from"./chunk-6YGTRKDT.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(y(),1);var r=x(A(),1);function B(i,d,l,u,p){let g=l==="basic"&&u?`basic (${u})`:l,n=20,s=`${i} [${d}]`,m="\xB7".repeat(Math.max(2,n-s.length+3));return{label:`${s} ${m} ${g}`,profile:i,env:d,isActive:p}}function I({creds:i,onSwitch:d,onCancel:l}){let u=i.listProfiles(),p=i.getActiveProfile(),g=i.getDefaultEnv(),n=u.map(e=>{let t=i.loadBasicAuth(e.profile,e.env),o=i.loadCredentials(e.profile,e.env)!==null,v=t?"basic":o?"oauth":"none",b=t?t.username:null,w=e.profile===p&&e.env===g;return B(e.profile,e.env,v,b,w)}),[s,m]=(0,L.useState)(()=>{let e=n.findIndex(t=>t.isActive);return e>=0?e:0});return P((e,t)=>{if(t.escape){l();return}if(t.upArrow){m(o=>Math.max(0,o-1));return}if(t.downArrow){m(o=>Math.min(n.length-1,o+1));return}if(t.return&&n[s]){let o=n[s];o.isActive||d(o.profile,o.env),l();return}}),n.length===0?(0,r.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:a.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(f,{color:a.primary,bold:!0,children:"Profiles"}),(0,r.jsx)(c,{marginTop:1,children:(0,r.jsx)(f,{color:a.dim,children:"No profiles \u2014 use Login to create one"})}),(0,r.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,r.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:a.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(f,{color:a.primary,bold:!0,children:"Profiles"}),(0,r.jsx)(c,{flexDirection:"column",marginTop:1,children:n.map((e,t)=>{let o=t===s,v=o?"\u276F ":" ",b=e.isActive?a.statusPass:o?a.primary:void 0;return(0,r.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,r.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{B as a,I as b};
2
+ import{a as h}from"./chunk-YVLFHMUW.js";import{a as A}from"./chunk-HCBYKLMW.js";import{t as a}from"./chunk-TL4SB7MQ.js";import{a as c,b as f,i as P}from"./chunk-C44QQJR4.js";import{a as y}from"./chunk-6YGTRKDT.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(y(),1);var r=x(A(),1);function B(i,d,l,u,p){let g=l==="basic"&&u?`basic (${u})`:l,n=20,s=`${i} [${d}]`,m="\xB7".repeat(Math.max(2,n-s.length+3));return{label:`${s} ${m} ${g}`,profile:i,env:d,isActive:p}}function I({creds:i,onSwitch:d,onCancel:l}){let u=i.listProfiles(),p=i.getActiveProfile(),g=i.getDefaultEnv(),n=u.map(e=>{let t=i.loadBasicAuth(e.profile,e.env),o=i.loadCredentials(e.profile,e.env)!==null,v=t?"basic":o?"oauth":"none",b=t?t.username:null,w=e.profile===p&&e.env===g;return B(e.profile,e.env,v,b,w)}),[s,m]=(0,L.useState)(()=>{let e=n.findIndex(t=>t.isActive);return e>=0?e:0});return P((e,t)=>{if(t.escape){l();return}if(t.upArrow){m(o=>Math.max(0,o-1));return}if(t.downArrow){m(o=>Math.min(n.length-1,o+1));return}if(t.return&&n[s]){let o=n[s];o.isActive||d(o.profile,o.env),l();return}}),n.length===0?(0,r.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:a.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(f,{color:a.primary,bold:!0,children:"Profiles"}),(0,r.jsx)(c,{marginTop:1,children:(0,r.jsx)(f,{color:a.dim,children:"No profiles \u2014 use Login to create one"})}),(0,r.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,r.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:a.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(f,{color:a.primary,bold:!0,children:"Profiles"}),(0,r.jsx)(c,{flexDirection:"column",marginTop:1,children:n.map((e,t)=>{let o=t===s,v=o?"\u276F ":" ",b=e.isActive?a.statusPass:o?a.primary:void 0;return(0,r.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,r.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{B as a,I as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{f as l}from"./chunk-X7VI7KK3.js";import{readFileSync as y,existsSync as S}from"fs";import{basename as f,dirname as R,isAbsolute as w,resolve as g}from"path";var h=["target","chrome_profile","cdp_endpoint","ws_endpoint","headless"],r=class extends Error{constructor(t){super(t),this.name="TestMdResolveError"}};function $(o){let t=g(o),n=m(t),s=x(n.global),i=[];return u(n,[],i,[],t),i.forEach((e,p)=>e.flatIndex=p+1),{rootPath:t,rootTitle:n.title,rootGlobal:n.global,rootSteps:n.steps,chrome:s,steps:i}}function m(o){if(!S(o))throw new r(`@import path not found: ${o}`);let t=y(o,"utf8");return l(o,t)}function u(o,t,n,s,i){if(t.includes(o.path)){let e=[...t,o.path].map(p=>f(p)).join(" \u2192 ");throw new r(`cyclic reference: ${e}`)}t.push(o.path);let a=s.length===0;for(let e of o.steps){let p=e.body.kind!=="objective";if(e.optional&&p&&!a)throw new r(`intermediate-ref 'optional' is not supported in v1: ${o.path}:${e.headingLine}`);let d={file:o.path,stepIndex:e.index,heading:e.heading,optional:e.optional??!1};if(e.body.kind==="objective"){let v=F(o.global,e.config);n.push({flatIndex:0,objective:e.body.text,sourceFile:o.path,trace:[...s,d],config:v,parsedConfig:e.config,optional:e.optional??!1});continue}let b=R(o.path),c=w(e.body.path)?e.body.path:g(b,e.body.path);if(f(c).endsWith("_test.md"))throw new r(`cannot @import a test file: only helpers may be imported (got ${c})`);let C=m(c);u(C,t,n,[...s,d],i)}t.pop()}function x(o){let t={};for(let n of h)o[n]!==void 0&&(t[n]=o[n]);return t}function F(o,t){let n={};for(let[s,i]of Object.entries(o))h.includes(s)||(n[s]=i);return{...n,...t??{}}}export{$ as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{d as a,h as c}from"./chunk-3ELBJPHQ.js";import{readFileSync as g,writeFileSync as n,mkdirSync as i,existsSync as p}from"fs";import{dirname as s}from"path";var o={window_size:{width:1920,height:1080},chrome_profile_path:"",default_url:c,model:"v16-alpha",project_id:null,project_name:null,folder_id:null,folder_name:null,mode:"testing",code_export:{enabled:!0,language:"python",skip_validation:!0},last_seen_version:""},l=class{constructor(r=a){this.path=r}exists(){return p(this.path)}load(){try{let r=g(this.path,"utf-8"),e=JSON.parse(r);return{...o,...e,code_export:{...o.code_export,...e.code_export??{}}}}catch{return{...o,code_export:{...o.code_export}}}}set(r,e){try{let t=this.load();t[r]=e,i(s(this.path),{recursive:!0}),n(this.path,JSON.stringify(t,null,2)+`
2
+ import{d as a,h as c}from"./chunk-TL4SB7MQ.js";import{readFileSync as g,writeFileSync as n,mkdirSync as i,existsSync as p}from"fs";import{dirname as s}from"path";var o={window_size:{width:1920,height:1080},chrome_profile_path:"",default_url:c,model:"v16-alpha",project_id:null,project_name:null,folder_id:null,folder_name:null,mode:"testing",code_export:{enabled:!0,language:"python",skip_validation:!0},last_seen_version:""},l=class{constructor(r=a){this.path=r}exists(){return p(this.path)}load(){try{let r=g(this.path,"utf-8"),e=JSON.parse(r);return{...o,...e,code_export:{...o.code_export,...e.code_export??{}}}}catch{return{...o,code_export:{...o.code_export}}}}set(r,e){try{let t=this.load();t[r]=e,i(s(this.path),{recursive:!0}),n(this.path,JSON.stringify(t,null,2)+`
3
3
  `)}catch(t){let d=t instanceof Error?t.message:String(t);process.stderr.write(`[config] Failed to save config: ${d}
4
4
  `)}}save(r){try{let t={...this.load(),...r};i(s(this.path),{recursive:!0}),n(this.path,JSON.stringify(t,null,2)+`
5
5
  `)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`[config] Failed to save config: ${t}
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-HJ3CHMEM.js";import{a as p}from"./chunk-HCBYKLMW.js";import{t}from"./chunk-3ELBJPHQ.js";import{a,b as o,i as u}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var c=n(b(),1);var e=n(p(),1);function T({onSubmit:l}){let[r,f]=(0,c.useState)(0),s=(0,c.useRef)(!1);return u((x,i)=>{s.current||(i.leftArrow||i.rightArrow?f(d=>d===0?1:0):i.return?(s.current=!0,l(r===0?"positive":"negative")):i.escape&&(s.current=!0,l(null)))}),(0,e.jsxs)(a,{flexDirection:"column",marginTop:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(o,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(o,{color:r===0?t.primary:t.dim,children:r===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(o,{children:" "}),(0,e.jsx)(o,{color:r===1?t.primary:t.dim,children:r===1?"[ \u{1F44E} ]":" \u{1F44E} "})]}),(0,e.jsx)(m,{bindings:[{keys:"\u2190/\u2192",label:"select"},{keys:"\u21B5",label:"submit"}],escBackLabel:"skip"})]})}export{T as a};
2
+ import{a as m}from"./chunk-YVLFHMUW.js";import{a as p}from"./chunk-HCBYKLMW.js";import{t}from"./chunk-TL4SB7MQ.js";import{a,b as o,i as u}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var c=n(b(),1);var e=n(p(),1);function T({onSubmit:l}){let[r,f]=(0,c.useState)(0),s=(0,c.useRef)(!1);return u((x,i)=>{s.current||(i.leftArrow||i.rightArrow?f(d=>d===0?1:0):i.return?(s.current=!0,l(r===0?"positive":"negative")):i.escape&&(s.current=!0,l(null)))}),(0,e.jsxs)(a,{flexDirection:"column",marginTop:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(o,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(o,{color:r===0?t.primary:t.dim,children:r===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(o,{children:" "}),(0,e.jsx)(o,{color:r===1?t.primary:t.dim,children:r===1?"[ \u{1F44E} ]":" \u{1F44E} "})]}),(0,e.jsx)(m,{bindings:[{keys:"\u2190/\u2192",label:"select"},{keys:"\u21B5",label:"submit"}],escBackLabel:"skip"})]})}export{T as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as f}from"./chunk-RXMOIIQD.js";import{a as x}from"./chunk-HCBYKLMW.js";import{t}from"./chunk-3ELBJPHQ.js";import{a as r,b as n}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(B(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,a){return s.map(l=>l.name===o?{...l,status:d,detail:a}:l)}function R(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),a=Math.round(o%60);return`${d}m ${a}s`}function D(s){let[o,d]=(0,p.useState)(0),a=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;a.current=Date.now();let l=setInterval(()=>{d(Date.now()-a.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:a}){let l=D(o==="uploading");return o==="uploading"?(0,e.jsxs)(r,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(r,{children:[(0,e.jsx)(n,{color:t.primary,children:"\u2601 "}),(0,e.jsx)(n,{color:t.primary,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dimmed,children:[" ",R(l)]})]}),(0,e.jsx)(r,{flexDirection:"column",marginTop:1,children:s.filter(i=>i.status!=="skipped").map((i,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",m=i.status==="done",u=i.status==="running",g=i.status==="failed";return(0,e.jsxs)(r,{children:[(0,e.jsxs)(n,{color:t.dimmed,children:[" ",b," "]}),(0,e.jsx)(r,{width:3,children:u?(0,e.jsx)(f,{}):m?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:m?t.dim:u?t.base:g?t.red:t.muted,children:i.label}),i.detail&&(0,e.jsxs)(n,{color:t.dimmed,children:[" ",i.detail]})]},i.name)})}),(0,e.jsx)(r,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(r,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(r,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),a&&(0,e.jsxs)(r,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dimmed,children:" "}),(0,e.jsx)(n,{color:t.dim,children:a})]})]})}export{v as a,U as b,h as c};
2
+ import{b as f}from"./chunk-XM4H4TJD.js";import{a as x}from"./chunk-HCBYKLMW.js";import{t}from"./chunk-TL4SB7MQ.js";import{a as r,b as n}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(B(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,a){return s.map(l=>l.name===o?{...l,status:d,detail:a}:l)}function R(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),a=Math.round(o%60);return`${d}m ${a}s`}function D(s){let[o,d]=(0,p.useState)(0),a=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;a.current=Date.now();let l=setInterval(()=>{d(Date.now()-a.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:a}){let l=D(o==="uploading");return o==="uploading"?(0,e.jsxs)(r,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(r,{children:[(0,e.jsx)(n,{color:t.primary,children:"\u2601 "}),(0,e.jsx)(n,{color:t.primary,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dimmed,children:[" ",R(l)]})]}),(0,e.jsx)(r,{flexDirection:"column",marginTop:1,children:s.filter(i=>i.status!=="skipped").map((i,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",m=i.status==="done",u=i.status==="running",g=i.status==="failed";return(0,e.jsxs)(r,{children:[(0,e.jsxs)(n,{color:t.dimmed,children:[" ",b," "]}),(0,e.jsx)(r,{width:3,children:u?(0,e.jsx)(f,{}):m?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:m?t.dim:u?t.base:g?t.red:t.muted,children:i.label}),i.detail&&(0,e.jsxs)(n,{color:t.dimmed,children:[" ",i.detail]})]},i.name)})}),(0,e.jsx)(r,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(r,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(r,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),a&&(0,e.jsxs)(r,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dimmed,children:" "}),(0,e.jsx)(n,{color:t.dim,children:a})]})]})}export{v as a,U as b,h as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-3ELBJPHQ.js";import{a as r,b as i}from"./chunk-C44QQJR4.js";import{e as a}from"./chunk-UR6MHSHU.js";var e=a(m(),1),u={default:o.muted,error:o.red,success:o.green,info:o.purple,warning:o.yellow};function T({title:t,titleColor:l,borderColor:d,variant:n="default",children:c,width:s,paddingX:x=2,paddingY:g=0,marginBottom:p=0}){let f=d??u[n],B=l??(n==="default"?o.purple:u[n]);return(0,e.jsxs)(r,{flexDirection:"column",marginBottom:p,children:[t&&(0,e.jsx)(r,{marginBottom:0,children:(0,e.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,e.jsx)(r,{borderStyle:"round",borderColor:f,flexDirection:"column",paddingX:x,paddingY:g,width:s,children:c})]})}function h({label:t,value:l,labelColor:d=o.dimmed,valueColor:n,labelWidth:c=14}){return(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:c,children:(0,e.jsx)(i,{color:d,children:t})}),(0,e.jsx)(i,{color:n,children:l})]})}function C({label:t}){return(0,e.jsx)(r,{marginTop:1,marginBottom:0,children:(0,e.jsx)(i,{bold:!0,children:t})})}export{T as a,h as b,C as c};
2
+ import{a as m}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-TL4SB7MQ.js";import{a as r,b as i}from"./chunk-C44QQJR4.js";import{e as a}from"./chunk-UR6MHSHU.js";var e=a(m(),1),u={default:o.muted,error:o.red,success:o.green,info:o.purple,warning:o.yellow};function T({title:t,titleColor:l,borderColor:d,variant:n="default",children:c,width:s,paddingX:x=2,paddingY:g=0,marginBottom:p=0}){let f=d??u[n],B=l??(n==="default"?o.purple:u[n]);return(0,e.jsxs)(r,{flexDirection:"column",marginBottom:p,children:[t&&(0,e.jsx)(r,{marginBottom:0,children:(0,e.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,e.jsx)(r,{borderStyle:"round",borderColor:f,flexDirection:"column",paddingX:x,paddingY:g,width:s,children:c})]})}function h({label:t,value:l,labelColor:d=o.dimmed,valueColor:n,labelWidth:c=14}){return(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:c,children:(0,e.jsx)(i,{color:d,children:t})}),(0,e.jsx)(i,{color:n,children:l})]})}function C({label:t}){return(0,e.jsx)(r,{marginTop:1,marginBottom:0,children:(0,e.jsx)(i,{bold:!0,children:t})})}export{T as a,h as b,C as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as b}from"./chunk-HJ3CHMEM.js";import{a as A}from"./chunk-HCBYKLMW.js";import{k as p,t as i}from"./chunk-3ELBJPHQ.js";import{a as u,b as a,i as S}from"./chunk-C44QQJR4.js";import{a as D}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var g=h(D(),1);import{readdirSync as N,mkdirSync as L,statSync as k}from"fs";import{join as P}from"path";var r=h(A(),1);function O(n){try{return N(n).filter(s=>{try{return k(P(n,s)).isDirectory()}catch{return!1}})}catch{return[]}}function E(n,s,m,v){return{name:n,path:s,label:n,isActive:v}}function H({currentPath:n,onSelect:s,onCancel:m}){let l=O(p).map(o=>{let e=P(p,o);return E(o,e,n,e===n)}),d=!n,B=l.length+2,[c,C]=(0,g.useState)(()=>{if(d)return 0;let o=l.findIndex(e=>e.isActive);return o>=0?o+1:0}),[y,T]=(0,g.useState)(!1),[I,x]=(0,g.useState)("");return S((o,e)=>{if(y){if(e.escape){T(!1),x("");return}if(e.return){let t=I.trim();if(t){let f=P(p,t);L(f,{recursive:!0}),s(f),m()}return}if(e.backspace||e.delete){x(t=>t.slice(0,-1));return}o&&!e.ctrl&&!e.meta&&x(t=>t+o);return}if(e.escape){m();return}if(e.upArrow){C(t=>Math.max(0,t-1));return}if(e.downArrow){C(t=>Math.min(B-1,t+1));return}if(e.return){if(c===0){d||s(""),m();return}if(c===l.length+1){L(p,{recursive:!0}),T(!0),x("");return}let t=l[c-1];t&&!t.isActive&&s(t.path),m();return}}),y?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(a,{color:i.primary,bold:!0,children:"Chrome Profile \u203A New"}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(a,{color:i.secondary,children:"Name: "}),(0,r.jsx)(a,{children:I}),(0,r.jsx)(a,{color:i.dimmed,children:"\u2588"})]}),(0,r.jsx)(b,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:"back"})]}):(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(a,{color:i.primary,bold:!0,children:"Chrome Profile"}),(0,r.jsxs)(u,{flexDirection:"column",marginTop:1,children:[(0,r.jsxs)(a,{color:d?i.statusPass:c===0?i.primary:i.dim,children:[c===0?"\u276F ":" ","Use temporary (no profile)",d?" \u25CF active":""]}),l.map((o,e)=>{let f=e+1===c,R=f?"\u276F ":" ",w=o.isActive?i.statusPass:f?i.primary:void 0;return(0,r.jsxs)(a,{color:w,children:[R,o.label,o.isActive?" \u25CF active":""]},o.name)}),(0,r.jsxs)(a,{color:c===l.length+1?i.primary:i.dim,children:[c===l.length+1?"\u276F ":" ","+ Create new"]})]}),(0,r.jsx)(b,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}export{O as a,E as b,H as c};
2
+ import{a as b}from"./chunk-YVLFHMUW.js";import{a as A}from"./chunk-HCBYKLMW.js";import{k as p,t as i}from"./chunk-TL4SB7MQ.js";import{a as u,b as a,i as S}from"./chunk-C44QQJR4.js";import{a as D}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var g=h(D(),1);import{readdirSync as N,mkdirSync as L,statSync as k}from"fs";import{join as P}from"path";var r=h(A(),1);function O(n){try{return N(n).filter(s=>{try{return k(P(n,s)).isDirectory()}catch{return!1}})}catch{return[]}}function E(n,s,m,v){return{name:n,path:s,label:n,isActive:v}}function H({currentPath:n,onSelect:s,onCancel:m}){let l=O(p).map(o=>{let e=P(p,o);return E(o,e,n,e===n)}),d=!n,B=l.length+2,[c,C]=(0,g.useState)(()=>{if(d)return 0;let o=l.findIndex(e=>e.isActive);return o>=0?o+1:0}),[y,T]=(0,g.useState)(!1),[I,x]=(0,g.useState)("");return S((o,e)=>{if(y){if(e.escape){T(!1),x("");return}if(e.return){let t=I.trim();if(t){let f=P(p,t);L(f,{recursive:!0}),s(f),m()}return}if(e.backspace||e.delete){x(t=>t.slice(0,-1));return}o&&!e.ctrl&&!e.meta&&x(t=>t+o);return}if(e.escape){m();return}if(e.upArrow){C(t=>Math.max(0,t-1));return}if(e.downArrow){C(t=>Math.min(B-1,t+1));return}if(e.return){if(c===0){d||s(""),m();return}if(c===l.length+1){L(p,{recursive:!0}),T(!0),x("");return}let t=l[c-1];t&&!t.isActive&&s(t.path),m();return}}),y?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(a,{color:i.primary,bold:!0,children:"Chrome Profile \u203A New"}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(a,{color:i.secondary,children:"Name: "}),(0,r.jsx)(a,{children:I}),(0,r.jsx)(a,{color:i.dimmed,children:"\u2588"})]}),(0,r.jsx)(b,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:"back"})]}):(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,r.jsx)(a,{color:i.primary,bold:!0,children:"Chrome Profile"}),(0,r.jsxs)(u,{flexDirection:"column",marginTop:1,children:[(0,r.jsxs)(a,{color:d?i.statusPass:c===0?i.primary:i.dim,children:[c===0?"\u276F ":" ","Use temporary (no profile)",d?" \u25CF active":""]}),l.map((o,e)=>{let f=e+1===c,R=f?"\u276F ":" ",w=o.isActive?i.statusPass:f?i.primary:void 0;return(0,r.jsxs)(a,{color:w,children:[R,o.label,o.isActive?" \u25CF active":""]},o.name)}),(0,r.jsxs)(a,{color:c===l.length+1?i.primary:i.dim,children:[c===l.length+1?"\u276F ":" ","+ Create new"]})]}),(0,r.jsx)(b,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}export{O as a,E as b,H as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{homedir as s}from"os";import{join as t}from"path";var c="0.3.1",l="kane-cli",e=t(s(),".testmuai","kaneai"),m=t(e,"profiles"),i=t(e,"tui-config.json"),d="https://registry.npmjs.org/@testmuai/kane-cli",h="https://api.github.com/repos/LambdaTest/kane-cli/releases",f="https://dd-proxy.lambdatest.com/intake/kane-cli",u="https://kaneai-playground.lambdatest.io",_=9222,b=9230,U=t(e,"chrome-profiles"),r="127.0.0.1",x=18392,g=18400,o="/callback";function A(a){return`http://${r}:${a}${o}`}var R="KANE CLI",L="*",C={prod:{authBaseUrl:"https://auth.lambdatest.com",consentUrl:"https://accounts.lambdatest.com",controllerBaseUrl:"https://kaneai-api.lambdatest.com/v16-controller/v1",tmsBaseUrl:"https://test-manager-api.lambdatest.com/api",secretsBaseUrl:"https://api-hyperexecute.lambdatest.com",testManagerUiUrl:"https://test-manager.lambdatest.com",shareApiBaseUrl:"https://api.lambdatest.com",v16ServerHost:"https://kaneai-api.lambdatest.com/v16-server"},stage:{authBaseUrl:"https://stage-auth.lambdatestinternal.com",consentUrl:"https://stage-accounts.lambdatestinternal.com",controllerBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-controller/v1",tmsBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com/api",secretsBaseUrl:"https://api-stage-hyperexecute.lambdatestinternal.com",testManagerUiUrl:"https://stage-test-manager.lambdatestinternal.com",shareApiBaseUrl:"https://stage-api.lambdatestinternal.com",v16ServerHost:"https://auteur-stage-automind.lambdatestinternal.com/v16-server"}},E={base:"#ffffff",primary:"#ff9500",secondary:"#888888",accent:"#ffffff",dim:"#666666",ambient:"#444444",statusPass:"#4ade80",statusFail:"#ef4444",purple:"#ff9500",cyan:"#ff9500",yellow:"#ff9500",green:"#4ade80",greenDim:"#666666",red:"#ef4444",redDim:"#666666",dimmed:"#666666",muted:"#444444"};export{c as a,l as b,e as c,i as d,d as e,h as f,f as g,u as h,_ as i,b as j,U as k,r as l,x as m,g as n,o,A as p,R as q,L as r,C as s,E as t};
2
+ import{homedir as s}from"os";import{join as t}from"path";var c="0.3.3",l="kane-cli",e=t(s(),".testmuai","kaneai"),m=t(e,"profiles"),i=t(e,"tui-config.json"),d="https://registry.npmjs.org/@testmuai/kane-cli",h="https://api.github.com/repos/LambdaTest/kane-cli/releases",f="https://dd-proxy.lambdatest.com/intake/kane-cli",u="https://kaneai-playground.lambdatest.io",_=9222,b=9230,U=t(e,"chrome-profiles"),r="127.0.0.1",x=18392,g=18400,o="/callback";function A(a){return`http://${r}:${a}${o}`}var R="KANE CLI",L="*",C={prod:{authBaseUrl:"https://auth.lambdatest.com",consentUrl:"https://accounts.lambdatest.com",controllerBaseUrl:"https://kaneai-api.lambdatest.com/v16-controller/v1",tmsBaseUrl:"https://test-manager-api.lambdatest.com/api",secretsBaseUrl:"https://api-hyperexecute.lambdatest.com",testManagerUiUrl:"https://test-manager.lambdatest.com",shareApiBaseUrl:"https://api.lambdatest.com",v16ServerHost:"https://kaneai-api.lambdatest.com/v16-server"},stage:{authBaseUrl:"https://stage-auth.lambdatestinternal.com",consentUrl:"https://stage-accounts.lambdatestinternal.com",controllerBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-controller/v1",tmsBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com/api",secretsBaseUrl:"https://api-stage-hyperexecute.lambdatestinternal.com",testManagerUiUrl:"https://stage-test-manager.lambdatestinternal.com",shareApiBaseUrl:"https://stage-api.lambdatestinternal.com",v16ServerHost:"https://auteur-stage-automind.lambdatestinternal.com/v16-server"}},E={base:"#ffffff",primary:"#ff9500",secondary:"#888888",accent:"#ffffff",dim:"#666666",ambient:"#444444",statusPass:"#4ade80",statusFail:"#ef4444",purple:"#ff9500",cyan:"#ff9500",yellow:"#ff9500",green:"#4ade80",greenDim:"#666666",red:"#ef4444",redDim:"#666666",dimmed:"#666666",muted:"#444444"};export{c as a,l as b,e as c,i as d,d as e,h as f,f as g,u as h,_ as i,b as j,U as k,r as l,x as m,g as n,o,A as p,R as q,L as r,C as s,E as t};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as se,b as Te}from"./chunk-RXMOIIQD.js";import{b as ke}from"./chunk-DUR6AFYA.js";import{d as Be,e as ae}from"./chunk-G7VF5SDK.js";import{a as Re}from"./chunk-34DK2AUH.js";import{a as N}from"./chunk-HCBYKLMW.js";import{t as s}from"./chunk-3ELBJPHQ.js";import{a as c,b as o,d as ye,k as ue}from"./chunk-C44QQJR4.js";import{a as le}from"./chunk-6YGTRKDT.js";import{e as j}from"./chunk-UR6MHSHU.js";var G=j(N(),1),Le=64;function Pe(t){return t.split(`
2
+ import{a as se,b as Te}from"./chunk-XM4H4TJD.js";import{b as ke}from"./chunk-L3MOXBKE.js";import{d as Be,e as ae}from"./chunk-G7VF5SDK.js";import{a as Re}from"./chunk-SR5UDUMJ.js";import{a as N}from"./chunk-HCBYKLMW.js";import{t as s}from"./chunk-TL4SB7MQ.js";import{a as c,b as o,d as ye,k as ue}from"./chunk-C44QQJR4.js";import{a as le}from"./chunk-6YGTRKDT.js";import{e as j}from"./chunk-UR6MHSHU.js";var G=j(N(),1),Le=64;function Pe(t){return t.split(`
3
3
  `).map(i=>i.replace(/^[-–•]\s*/,"").trim()).filter(i=>i.length>0)}function Ge({status:t,summary:i,duration:l,steps:u,stepsPassed:S,stepsFailed:f,reason:x,creditsConsumed:d}){let D=t==="passed",E=D?s.green:s.red,P=D?"\u2713":"\u2717",F=t.toUpperCase(),H=S??(D?u:Math.max(0,u-1)),I=f??(D?0:1),M=I>0?`${u} steps (${H} passed, ${I} failed)`:`${u} steps`,Q=l<60?`${l.toFixed(1)}s`:`${Math.floor(l/60)}m ${Math.round(l%60)}s`,V=Pe(i);return(0,G.jsx)(c,{flexDirection:"column",marginTop:1,children:(0,G.jsxs)(c,{borderStyle:"round",borderColor:E,flexDirection:"column",paddingX:2,paddingY:1,width:Le+6,children:[(0,G.jsxs)(c,{flexDirection:"column",children:[(0,G.jsxs)(o,{bold:!0,color:E,children:[P," ",F]}),(0,G.jsxs)(o,{color:s.dimmed,wrap:"wrap",children:[M," \xB7 ",Q,typeof d=="number"&&d>0?` \xB7 ${parseFloat(d.toFixed(4))} credits`:""]})]}),V.length>0&&(0,G.jsx)(c,{flexDirection:"column",marginTop:1,marginLeft:1,children:V.map((Z,W)=>(0,G.jsxs)(c,{marginBottom:W<V.length-1?1:0,children:[(0,G.jsx)(o,{color:s.primary,children:"\u25CF "}),(0,G.jsx)(c,{flexShrink:1,children:(0,G.jsx)(o,{wrap:"wrap",children:Z})})]},W))}),x&&!D&&(0,G.jsx)(c,{marginTop:1,children:(0,G.jsxs)(o,{color:s.red,wrap:"wrap",children:["Reason: ",x]})})]})})}var A=j(N(),1);function Ke({message:t,code:i,remediation:l,docsUrl:u}){return(0,A.jsx)(Re,{title:"Error",variant:"error",children:(0,A.jsxs)(c,{flexDirection:"column",paddingY:1,children:[(0,A.jsxs)(o,{color:s.red,bold:!0,children:[" \u2717 ",t]}),i&&(0,A.jsxs)(c,{marginTop:0,marginLeft:5,children:[(0,A.jsx)(o,{color:s.muted,children:"Code: "}),(0,A.jsx)(o,{color:s.dimmed,children:i})]}),l&&(0,A.jsxs)(c,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,A.jsx)(o,{color:s.green,bold:!0,children:"Fix:"}),(0,A.jsxs)(o,{color:s.cyan,children:["$ ",l]})]}),u&&(0,A.jsxs)(c,{marginTop:1,marginLeft:5,children:[(0,A.jsx)(o,{color:s.muted,children:"Docs: "}),(0,A.jsx)(o,{color:s.cyan,underline:!0,children:u})]})]})})}var $=j(le(),1);var we=j(le(),1);var de=j(N(),1),De="#ffc580",Fe="#ffd9a8",ve="#ffffff";function _e({text:t,active:i=!0}){let[l,u]=(0,we.useState)(0),S=4;if(se(()=>{u(x=>(x+1)%(t.length+S*2))},i?80:null),!i)return(0,de.jsx)(o,{color:ve,children:t});let f=t.split("").map((x,d)=>{let D=l-S,E=Math.abs(d-D-S/2),P;return E<=S/2?P=De:E<=S?P=Fe:P=ve,(0,de.jsx)(o,{color:P,children:x},d)});return(0,de.jsx)(o,{children:f})}var O=j(N(),1),Oe={starting:s.cyan,running:s.purple,passed:s.green,failed:s.red,cancelled:s.dimmed,timed_out:s.yellow};function fe({currentStep:t,maxSteps:i,elapsed:l,status:u}){let{stdout:S}=ue(),f=S?.columns??80,x=Oe[u]??s.purple,d=l<60?`${l.toFixed(1)}s`:`${Math.floor(l/60)}m ${Math.round(l%60)}s`;return(0,O.jsxs)(c,{flexDirection:"column",marginTop:1,children:[(0,O.jsx)(o,{color:s.muted,children:"\u2500".repeat(Math.min(f,60))}),(0,O.jsxs)(c,{children:[(0,O.jsx)(o,{children:" "}),(0,O.jsx)(o,{color:s.dimmed,children:"Steps "}),(0,O.jsx)(o,{bold:!0,children:t}),(0,O.jsxs)(o,{color:s.dimmed,children:["/",i]}),(0,O.jsx)(o,{children:" "}),(0,O.jsx)(o,{color:s.dimmed,children:"Elapsed "}),(0,O.jsx)(o,{bold:!0,children:d}),(0,O.jsx)(o,{children:" "}),(0,O.jsx)(o,{color:s.dimmed,children:"Status "}),(0,O.jsx)(o,{bold:!0,color:x,children:u})]})]})}var Me={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function $e(t){return Me[t]??"\u25CF"}var ne=j(N(),1);function xe({steps:t,flows:i,cmInitCounts:l,renderStep:u}){return(0,ne.jsxs)(c,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,ne.jsxs)(o,{color:s.dimmed,children:["\u2501\u2501 Bifurcated into ",i?.length??t.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),t.map((S,f)=>(0,ne.jsxs)(c,{flexDirection:"column",marginTop:f>0?1:0,children:[(0,ne.jsxs)(o,{color:s.purple,children:["Flow ",f+1,": ",i?.[f]??S.objective]}),l&&l[f]!=null&&(0,ne.jsxs)(o,{color:s.dimmed,children:[" \u25AA Generated task with ",l[f]," checkpoints"]}),S.children&&S.children.length>0?S.children.map(x=>u(x,`f${f}-${x.index}`)):S.status==="pending"&&(0,ne.jsx)(o,{color:s.dimmed,children:" \u25CB Waiting..."})]},f))]})}var r=j(N(),1);function U({step:t,indent:i=2}){let l=t.actionType?$e(t.actionType):null,u=t.status==="running",S=t.status==="passed",f=t.status==="failed",x=t.status==="pending"||t.status==="stopped",{stdout:d}=ue(),D=d?.columns??80,E=Math.max(20,D-i-21),P=t.objective??"",F=P.length>E?P.slice(0,E-1)+"\u2026":P,H=(t.duration??0)*1e3,I=t.duration!=null?H<1e3?`${Math.round(H)}ms`:`${(H/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsxs)(c,{marginLeft:i,children:[(0,r.jsx)(c,{width:4,children:(0,r.jsxs)(o,{color:s.muted,children:[String(t.index).padStart(2," ")," "]})}),(0,r.jsx)(c,{width:3,children:u?(0,r.jsx)(Te,{}):S?(0,r.jsx)(o,{color:s.green,bold:!0,children:"\u2713"}):f?(0,r.jsx)(o,{color:s.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:s.muted,children:"\u25CB"})}),(0,r.jsx)(c,{flexGrow:1,children:u?(0,r.jsx)(_e,{text:F,active:!0}):f?(0,r.jsx)(o,{color:s.red,children:F}):x?(0,r.jsx)(o,{color:s.dimmed,children:F}):(0,r.jsx)(o,{color:s.greenDim,children:F})}),(S||f)&&l?(0,r.jsx)(c,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:s.muted,children:l})}):(0,r.jsx)(c,{width:3,marginLeft:1}),(0,r.jsx)(c,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:s.dimmed,children:I})})]}),t.children&&t.children.length>0&&(0,r.jsx)(c,{flexDirection:"column",children:t.children.map((M,Q)=>(0,r.jsx)(U,{step:M,indent:i+2},`child-${Q}`))})]})}function ft({steps:t,bifurcated:i,flows:l,cmInitCounts:u,maxSteps:S=50,staticSteps:f=!1,onStepCommit:x}){let d=(0,$.useRef)(new Set),D=(0,$.useRef)(!1),E=(0,$.useRef)(new Set),P=(0,$.useRef)(!1),F=(0,$.useRef)(new Set),H=(0,$.useRef)(0);(0,$.useEffect)(()=>{t.length===0&&H.current>0&&(d.current.clear(),D.current=!1,E.current.clear(),P.current=!1,F.current.clear()),H.current=t.length},[t.length]);let I=t.flatMap(n=>[n,...n.children??[]]),M=I.some(n=>n.status==="running"),Q=I.some(n=>n.status==="failed"),V=I.length===0||I.every(n=>n.status==="pending"),Z=I.filter(n=>n.status==="passed"||n.status==="failed").length,W;V?W="starting":M?W="running":Q?W="failed":W="passed";let ee=(0,$.useRef)(null),[ie,ce]=(0,$.useState)(0);(0,$.useEffect)(()=>{I.length===0||V?(ee.current=null,ce(0)):M&&ee.current==null&&(ee.current=Date.now())},[M,V,I.length]),(0,$.useEffect)(()=>{if(!M)return;let n=setInterval(()=>{ee.current!=null&&ce((Date.now()-ee.current)/1e3)},500);return()=>clearInterval(n)},[M]);let v=(0,$.useRef)(new Set),[C,K]=(0,$.useState)([]),re=(0,$.useRef)(!1);(0,$.useEffect)(()=>{if(!f||i)return;let n=[];if(!i&&!re.current&&u&&u[0]!=null&&(re.current=!0,u[0]>0&&n.push({key:"cm_init_0",type:"cm_init",count:u[0]})),i){!v.current.has(-1)&&t.length>0&&(v.current.add(-1),n.push({key:"bif_header",type:"bifurcation_header",flowCount:l?.length??t.length}));for(let p=0;p<t.length;p++){let a=t[p],y=-(p+10);v.current.has(y)||(v.current.add(y),n.push({key:`flow_header_${p}`,type:"flow_header",flowIdx:p,label:l?.[p]??a.objective,cmCount:u?.[p]}));for(let B of a.children??[])(B.status==="passed"||B.status==="failed")&&!v.current.has(B.index)&&(v.current.add(B.index),n.push({key:`step_f${p}_${B.index}`,type:"step",step:{...B}}))}}else for(let p of t)(p.status==="passed"||p.status==="failed")&&!v.current.has(p.index)&&(v.current.add(p.index),n.push({key:`step_${p.index}`,type:"step",step:{...p,children:p.children?[...p.children]:void 0}}));n.length>0&&K(p=>[...p,...n])},[t,i,l,u,f]),(0,$.useEffect)(()=>{if(x)if(!i&&!P.current&&u&&u[0]!=null&&(P.current=!0,u[0]>0&&x((0,r.jsx)(c,{marginLeft:2,children:(0,r.jsxs)(o,{color:s.dimmed,children:["\u25A0 Generated task with ",u[0]," checkpoints"]})}))),i&&l&&!D.current&&(D.current=!0,x((0,r.jsx)(o,{color:"#b388ff",children:"\u2501\u2501 Bifurcated into "+l.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),i){let n=t.flatMap((p,a)=>{let y=p.children??[];return!E.current.has(a)&&y.length>0&&(E.current.add(a),x((0,r.jsx)(o,{color:"#b388ff",children:" Flow "+(a+1)+": "+(l?.[a]??"")})),u?.[a]!=null&&u[a]>0&&!F.current.has(a)&&(F.current.add(a),x((0,r.jsx)(c,{marginLeft:2,children:(0,r.jsxs)(o,{color:s.dimmed,children:[" \u25AA Generated task with ",u[a]," checkpoints"]})})))),u?.[a]!=null&&u[a]>0&&E.current.has(a)&&!F.current.has(a)&&(F.current.add(a),x((0,r.jsx)(c,{marginLeft:2,children:(0,r.jsxs)(o,{color:s.dimmed,children:[" \u25AA Generated task with ",u[a]," checkpoints"]})}))),y});for(let p of n){let a=`${p.index}-${p.objective}`;d.current.has(a)||(p.status==="passed"||p.status==="failed"||p.status==="stopped")&&(d.current.add(a),x((0,r.jsx)(c,{marginLeft:2,children:(0,r.jsx)(U,{step:p})})))}}else for(let n of t){let p=`${n.index}-${n.objective}`,a=!!n.branchObjective;a&&!d.current.has(p)&&(d.current.add(p),x((0,r.jsx)(c,{marginLeft:2,children:(0,r.jsx)(U,{step:{...n,children:void 0}})})));for(let y of n.children??[]){let B=`child-${n.index}-${y.index}-${y.objective}`;d.current.has(B)||(y.status==="passed"||y.status==="failed"||y.status==="stopped")&&(d.current.add(B),x((0,r.jsx)(c,{marginLeft:4,children:(0,r.jsx)(U,{step:y})})))}!a&&!d.current.has(p)&&(n.status==="passed"||n.status==="failed"||n.status==="stopped")&&(d.current.add(p),x((0,r.jsx)(c,{marginLeft:2,children:(0,r.jsx)(U,{step:{...n,children:void 0}})})))}},[t,x,i,l,u]);let Y=[];if(x)if(i)for(let n of t){let a=(n.children??[]).filter(y=>{let B=`${y.index}-${y.objective}`;return!d.current.has(B)});a.length>0&&Y.push({...n,children:a})}else for(let n of t){let p=`${n.index}-${n.objective}`,a=d.current.has(p),y=(n.children??[]).filter(B=>{let L=`child-${n.index}-${B.index}-${B.objective}`;return!d.current.has(L)});a?y.length>0&&Y.push({...n,children:y}):Y.push({...n,children:y})}else if(f){if(!i)for(let n of t)v.current.has(n.index)||Y.push(n)}if(!f){let n=x?Y:t;return(0,r.jsxs)(c,{flexDirection:"column",children:[i?x?n.length>0?(0,r.jsx)(c,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:n.map((a,y)=>(0,r.jsx)(c,{flexDirection:"column",marginTop:y>0?1:0,children:a.children&&a.children.length>0?a.children.map(B=>(0,r.jsx)(U,{step:B},`f${y}-${B.index}`)):a.status==="pending"&&(0,r.jsx)(o,{color:s.dimmed,children:" \u25CB Waiting..."})},y))}):null:(0,r.jsx)(xe,{steps:t,flows:l,cmInitCounts:u,renderStep:(a,y)=>(0,r.jsx)(U,{step:a},y)}):(0,r.jsxs)(c,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!x&&u&&u[0]!=null&&(0,r.jsxs)(o,{color:s.dimmed,children:["\u25AA Generated task with ",u[0]," checkpoints"]}),n.map(a=>{let y=`${a.index}-${a.objective}`;return x&&d.current.has(y)?(0,r.jsx)(c,{flexDirection:"column",children:(a.children??[]).map(B=>(0,r.jsx)(c,{marginLeft:2,children:(0,r.jsx)(U,{step:B})},B.index))},`branch-children-${a.index}`):(0,r.jsx)(U,{step:a},a.index)})]}),M&&(0,r.jsx)(fe,{currentStep:Z,maxSteps:S,elapsed:ie,status:W})]})}return i?(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(xe,{steps:t,flows:l,cmInitCounts:u,renderStep:(n,p)=>(0,r.jsx)(U,{step:n},p)}),M&&(0,r.jsx)(fe,{currentStep:Z,maxSteps:S,elapsed:ie,status:W})]}):(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(ye,{items:C,children:n=>n.type==="cm_init"?(0,r.jsx)(c,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:s.dimmed,children:["\u25AA Generated task with ",n.count," checkpoints"]})},n.key):n.type==="bifurcation_header"?(0,r.jsx)(c,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:s.dimmed,children:["\u2501\u2501 Bifurcated into ",n.flowCount," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]})},n.key):n.type==="flow_header"?(0,r.jsxs)(c,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,r.jsxs)(o,{color:s.purple,children:["Flow ",n.flowIdx+1,": ",n.label]}),n.cmCount!=null&&(0,r.jsxs)(o,{color:s.dimmed,children:[" \u25AA Generated task with ",n.cmCount," checkpoints"]})]},n.key):(0,r.jsx)(c,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(U,{step:n.step})},n.key)}),Y.length>0&&(0,r.jsx)(c,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Y.map(n=>(0,r.jsx)(U,{step:n},n.index))}),M&&(0,r.jsx)(fe,{currentStep:Z,maxSteps:S,elapsed:ie,status:W})]})}var ge=j(le(),1);var pe=j(N(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function bt({label:t,hasBifurcation:i=!1}){let[l,u]=(0,ge.useState)(0),[S,f]=(0,ge.useState)(0);se(()=>{u(d=>(d+1)%Ee.length)},80),se(()=>{f(d=>(d+1)%4)},400);let x=t??(i?"Planning approach":"Analyzing objective");return(0,pe.jsxs)(c,{marginLeft:1,children:[(0,pe.jsxs)(o,{color:s.primary,children:[Ee[l]," "]}),(0,pe.jsxs)(o,{color:s.dim,children:[x,".".repeat(S+1)]})]})}function yt(t){if(!t.isRunning||t.replayInfo)return null;let i=t.bifurcationInfo;if(i&&!i.isSingleFlow){let l=t.steps.findIndex(S=>S.status==="running");return(l===-1?t.cmInitCounts.length===0:l>=t.cmInitCounts.length)?{label:l>0?`Planning flow ${l+1}`:void 0,hasBifurcation:!0}:null}return t.cmInitCounts.length>0||t.steps.some(l=>l.children?.length)?null:{hasBifurcation:!!i}}var _=j(le(),1);function be(t){let i=t.indexOf(": ");return i>0&&i<15?t.slice(i+2):t}function Se(t){return t.map(i=>{let l=i.children?Se(i.children):i.children;return i.status==="running"?{...i,status:"stopped",phase:void 0,children:l}:l!==i.children?{...i,children:l}:i})}function kt(t,i,l,u){let[S,f]=(0,_.useState)(!1),[x,d]=(0,_.useState)([]),[D,E]=(0,_.useState)(null),[P,F]=(0,_.useState)(null),[H,I]=(0,_.useState)(null),[M,Q]=(0,_.useState)(null),[V,Z]=(0,_.useState)([]),[W,ee]=(0,_.useState)(null),[ie,ce]=(0,_.useState)(void 0),v=(0,_.useRef)(null),C=(0,_.useRef)(null),K=(0,_.useRef)(0),re=(0,_.useRef)(!1),Y=(0,_.useCallback)(async(a,y)=>{let B=v.current;if(B){try{await B.exited}catch{}v.current=null}d([]),E(null),F(null),I(null),Q(null),Z([]),ee(null),ce(a.max_steps),f(!0),C.current=null,K.current=0;let L;try{L=ke(a,y)}catch(te){I(te instanceof Error?te.message:String(te)),f(!1);return}v.current=L,Be("runner",()=>L.cancel()),(async()=>{re.current=!1;let te=!1;for await(let e of L.events){if(re.current)break;switch(e.type){case"run_start":if(C.current&&!C.current.isSingleFlow){let R=K.current;K.current++,d(T=>T.map((h,b)=>b===R?{...h,status:"running"}:h.status==="running"&&!h.children?.some(m=>m.status==="running")?{...h,status:h.children?.some(m=>m.status==="failed")?"failed":"passed"}:h))}break;case"bifurcation":{let R=e.flows??[],T=e.count??R.length,h={flows:R,isSingleFlow:e.is_single_flow??T<=1};Q(h),C.current=h,K.current=0,d(R.map((b,m)=>({index:m+1,objective:b??`Flow ${m+1}`,status:"pending"})));break}case"step_start":{i?.("STEP_START",`Step ${e.index} started`,{index:e.index,objective:e.objective,child_id:e.child_id});let R=e.index,T=e.objective??`Step ${R}`,h=e.child_id,b=C.current&&!C.current.isSingleFlow;if(h)d(m=>{let g=m.findIndex(z=>z.status==="running"||z.children?.some(je=>je.status==="running"));if(g===-1)return m;let k=[...m],w={...k[g]},J=[...w.children??[]].map(z=>z.status==="running"?{...z,status:"stopped",phase:void 0}:z);return J.push({index:R,objective:T,status:"running"}),w.children=J,k[g]=w,k});else if(b){let m=Math.max(0,K.current-1);d(g=>{let k=[...g];if(m>=k.length)return g;let w={...k[m]},J=[...w.children??[]].map(z=>z.status==="running"?{...z,status:"stopped",phase:void 0}:z);return J.push({index:R,objective:T,status:"running"}),w.children=J,w.status="running",k[m]=w,k})}else d(m=>{let g=Se(m);return g.some(w=>w.index===R)?g.map(w=>w.index===R?{...w,status:"running",objective:T}:w):[...g,{index:R,objective:T,status:"running"}]});break}case"step_event":{i?.("STEP_EVENT",`Step ${e.index} ${e.event}`,{index:e.index,phase:e.event,action_type:e.action_type,detail:e.detail,child_id:e.child_id});let R=e.child_id,T=C.current&&!C.current.isSingleFlow;if(e.event==="cm_init"&&e.checkpoint_count!=null){Z(h=>[...h,e.checkpoint_count]);break}if(e.event==="replay_started"){ee({recordingLength:e.recording_length??0});break}if(e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&l?.(e.detail),R)d(h=>h.map(b=>{if(!b.children)return b;let m=b.children.map(g=>{if(g.index!==e.index)return g;let k={phase:e.event};return e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&(k.objective=e.detail),e.action_type&&(k.actionType=e.action_type),{...g,...k}});return{...b,children:m}}));else if(T){let h=Math.max(0,K.current-1);d(b=>{let m=[...b];if(h>=m.length)return b;let g={...m[h]},k=[...g.children??[]];if(!k.some(X=>X.index===e.index))k.push({index:e.index,objective:`Step ${e.index}`,status:"running",phase:e.event,actionType:e.action_type});else for(let X=0;X<k.length;X++){if(k[X].index!==e.index)continue;let J={phase:e.event};e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&(J.objective=e.detail),e.action_type&&(J.actionType=e.action_type),k[X]={...k[X],...J}}return g.children=k,m[h]=g,m})}else d(h=>h.some(m=>m.index===e.index)?h.map(m=>{if(m.index!==e.index)return m;let g={phase:e.event};return e.event==="reasoning"&&e.detail&&e.detail!=="reasoning"&&(g.objective=e.detail),e.action_type&&(g.actionType=e.action_type),{...m,...g}}):[...Se(h),{index:e.index,objective:`Step ${e.index}`,status:"running",phase:e.event,actionType:e.action_type}]);break}case"step_end":{i?.("STEP_END",`Step ${e.index} ${e.status}`,{index:e.index,status:e.status,duration:e.duration,summary:e.summary,child_id:e.child_id}),u?.();let R=e.child_id,T=C.current&&!C.current.isSingleFlow;if(R)d(h=>h.map(b=>{if(!b.children)return b;let m=b.children.map(g=>g.index===e.index?{...g,status:e.status,duration:e.duration,phase:void 0,objective:g.objective.startsWith("Step ")?be(e.summary||g.objective):g.objective}:g);return{...b,children:m}}));else if(T){let h=Math.max(0,K.current-1);d(b=>{let m=[...b];if(h>=m.length)return b;let g={...m[h]},k=(g.children??[]).map(w=>w.index===e.index?{...w,status:e.status,duration:e.duration,phase:void 0,objective:w.objective.startsWith("Step ")?be(e.summary||w.objective):w.objective}:w);return g.children=k,m[h]=g,m})}else d(h=>h.map(b=>b.index===e.index?{...b,status:e.status,duration:e.duration,phase:void 0,objective:b.objective.startsWith("Step ")?be(e.summary||b.objective):b.objective}:b));{let b=C.current&&!C.current.isSingleFlow?Math.max(0,K.current-1):0;t?.(e.index,b,e.child_id)}break}case"child_agent_start":{let R=e.objective??"";d(T=>T.map(h=>h.status==="running"?{...h,objective:`${R} (branch)`,phase:`child: ${R.slice(0,50)}`,branchObjective:R}:h));break}case"child_agent_end":d(R=>R.map(T=>T.phase?.startsWith("child:")?{...T,phase:`child ${e.success?"done":"failed"}`}:T));break;case"ask_user":E(e.question??"");break;case"run_end":d(R=>R.map(T=>T.status==="running"?{...T,status:e.status,phase:void 0}:T)),f(!1),F(e),te=!0;break;case"error":f(!1),I(e.message??"Runner error"),d(R=>R.map(T=>T.status==="running"?{...T,status:"failed",phase:void 0}:T));break}}let{code:q,signal:me}=await L.exited,he=L.stderr,Ie=q===0&&!me,oe=[];q!==null&&q!==0&&oe.push(`Runner exited with code ${q}`),me&&oe.push(`Runner killed by signal ${me}`),he&&(!Ie||!te?oe.push(he):y?.log?.("debug","RUNNER_STDERR_BENIGN","Runner stderr on clean exit",{stderr:he})),v.current===L&&(oe.length>0&&I(oe.join(`
4
4
  `)),f(!1),ae("runner","Event stream ended"),v.current=null)})().catch(te=>{let q=[`Runner event loop error: ${te}`];L.exitCode!==null&&L.exitCode!==0&&q.push(`Exit code: ${L.exitCode}`),L.exitSignal&&q.push(`Signal: ${L.exitSignal}`),L.stderr&&q.push(L.stderr),v.current===L&&(I(q.join(`
5
5
  `)),f(!1),ae("runner","Event loop error"),v.current=null)})},[t,i,l,u]),n=(0,_.useCallback)(a=>{v.current?.sendUserResponse(a),E(null)},[]),p=(0,_.useCallback)(()=>{let a=v.current;a&&(a.sendCancel("user"),f(!1),E(null),setTimeout(()=>{v.current===a&&(ae("runner","User cancelled run"),v.current=null)},5e3))},[]);return(0,_.useEffect)(()=>()=>{re.current=!0,ae("runner","Component unmounted"),v.current=null},[]),{isRunning:S,steps:x,askingUser:D,lastRunEnd:P,runError:H,bifurcationInfo:M,cmInitCounts:V,replayInfo:W,maxSteps:ie,startRun:Y,sendAnswer:n,cancelRun:p}}function wt(t){let i=t.flatMap(f=>[f,...f.children??[]]),l=i.filter(f=>f.status==="passed").length,u=i.filter(f=>f.status==="failed").length,S=i.filter(f=>f.status==="passed"||f.status==="failed").length;return{passed:l,failed:u,total:S}}export{ft as a,bt as b,yt as c,kt as d,wt as e,Ge as f,Ke as g};