conductor-remote 1.108.3 → 1.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -445,7 +445,9 @@ choices previously read from Conductor's real picker; a missing or ambiguous lab
445
445
  stays red and Start is refused before the relay opens a tab. The shipped
446
446
  `exploration` placeholder is intentionally invalid when several Spark rows exist,
447
447
  so choose the exact one once. Start freezes all three roles for that run; editing a
448
- definition later affects only the next run. In the sidebar, a Workflow workspace
448
+ definition later affects only the next run. The root receives those frozen model labels
449
+ and responsibilities in its first prompt; it does not need to call `list_roles`, whose
450
+ output describes mutable defaults for later runs. In the sidebar, a Workflow workspace
449
451
  replaces the active model label with an ordered icon stack: Workflow, planning,
450
452
  exploration, then implementation; the frozen stack remains after completion. In
451
453
  **New workspace** and the composer of
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-syntax/cpp-DddhVWhK.js","assets/diff-syntax/c-BIGW1oBm.js","assets/diff-syntax/html-pp8916En.js","assets/diff-syntax/javascript-wDzz0qaB.js","assets/diff-syntax/css-CLj8gQPS.js","assets/diff-syntax/php-Csjmro_R.js","assets/diff-syntax/xml-sdJ4AIDG.js","assets/diff-syntax/java-CylS5w8V.js","assets/diff-syntax/sql-CRqJ_cUM.js","assets/diff-syntax/json-Cp-IABpG.js","assets/diff-syntax/ruby-C-9S-GLb.js","assets/diff-syntax/typescript-BPQ3VLAy.js","assets/diff-syntax/jsx-g9-lgVsj.js","assets/diff-syntax/tsx-COt5Ahok.js","assets/diff-syntax/zsh-Yzrsuije.js","assets/diff-syntax/yml-DbVfSbck.js","assets/diff-syntax/scss-D5BDwBP9.js"])))=>i.map(i=>d[i]);
2
- import{w as er,s as Xs,f as Ba,a as Ga,b as za,c as gr,h as ja,_ as D,r as Q,j,p as Wa,d as Va}from"./index-C_iOZKdw.js";const mr={}.hasOwnProperty;function qa(e,t){const n=t||{};function i(r,...s){let o=i.invalid;const l=i.handlers;if(r&&mr.call(r,e)){const a=String(r[e]);o=mr.call(l,a)?l[a]:i.unknown}if(o)return o.call(this,r,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Ys="diffs-container";(()=>{try{return!1}catch{return!1}})();const Ka=/(?=^From [a-f0-9]+ .+$)/m,Qs=/(?=^diff --git)/gm,Xa=new RegExp("(?<=\\n)"),Ya=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Qa=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Za=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Ja=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Zs="header-prefix",Js="header-filename-suffix",eo="header-metadata",tr="header-custom",le={dark:"pierre-dark",light:"pierre-light"},el="data-theme-css",tl="data-unsafe-css",nl="data-diffs-scrollbar-measure",to="--diffs-scrollbar-gutter-measured",il=1e5,rl={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},sl=Object.freeze({fromStart:0,fromEnd:0}),br={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ol={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},gt=new Set;let mt=null;function no(e){gt.add(e),mt??=requestAnimationFrame(io)}function Ci(e){gt.delete(e)&&gt.size===0&&mt!=null&&(cancelAnimationFrame(mt),mt=null)}function io(e){const t=new Set(gt);gt.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}gt.size>0?mt=requestAnimationFrame(io):mt=null}function Si(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),s=new Set(Object.keys(t));for(const o of r)if(s.delete(o),!i.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(s))if(!i.has(o))return!1;return!0}function nr(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ro(e,t){const n=e?.theme??le,i=t?.theme??le,r=vr(e),s=vr(t);return nr(n,i)&&Si(e,t,["theme","parseDiffOptions"])&&Si(r,s)}function vr(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function wi(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Pe(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const al=new TextEncoder,ll=new TextDecoder("utf-8",{ignoreBOM:!0}),dl=/[\uD800-\uDFFF]/,xi=1024;let ft=new Uint8Array(xi);function so(){ft.length!==xi&&(ft=new Uint8Array(xi))}function W(e){if(e.length===0)return e;if(dl.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;ft.length<t&&(ft=new Uint8Array(t));const{written:n}=al.encodeInto(e,ft);return ll.decode(ft.subarray(0,n))}function Se(e,t){return e-(t===0?0:1)}function ie(e,t){return Se(e,t)+t}const cl=4096,ul=.5;function hl(e){for(const t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){const i=t.hunkContent[n];if(i.type!=="change")continue;const r=pl(e,i);r!=null&&(t.hunkContent.splice(n,1,...r),n+=r.length-1)}fl(t,e)}}function fl(e,t){const{hunkContent:n}=e;for(let i=1;i<n.length;i++){const r=n[i],s=n[i-1];if(r.type!=="change"||r.additions>0&&r.deletions>0||s.type!=="context")continue;const o=r.additions>0,l=o?t.additionLines:t.deletionLines,a=o?r.additionLineIndex:r.deletionLineIndex,d=o?r.additions:r.deletions,c=l[a]??"";if(c.trim()!=="")continue;let u=!0;for(let v=1;v<d;v++)if(l[a+v]!==c){u=!1;break}if(!u)continue;let h=0;for(;h<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-h]===c;)h++;if(h===0||i===1&&h===s.lines)continue;r.additionLineIndex-=h,r.deletionLineIndex-=h;const f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,g=n[i+1];g?.type==="context"?(g.lines+=h,g.additionLineIndex=f,g.deletionLineIndex=p):n.splice(i+1,0,{type:"context",lines:h,additionLineIndex:f,deletionLineIndex:p}),s.lines-=h,s.lines===0&&(n.splice(i-1,1),i--)}}function pl(e,t){const{deletions:n,additions:i,deletionLineIndex:r,additionLineIndex:s}=t,o=Math.min(n,i),l=Math.abs(i-n);if(o===0||l===0||o*(l+1)>cl)return null;const a=[];for(let g=0;g<n;g++)a.push(yr(e.deletionLines[r+g]??""));const d=[];for(let g=0;g<i;g++)d.push(yr(e.additionLines[s+g]??""));const c=i>n;let u=0,h=-1;for(let g=0;g<=l;g++){let v=0;for(let m=0;m<o;m++)v+=ml(a[m+(c?0:g)],d[m+(c?g:0)]);g===0?h=v+o*ul:v>h&&(h=v,u=g)}if(u===0)return null;const f=[],p=(g,v,m,b)=>{(g>0||v>0)&&f.push({type:"change",deletions:g,additions:v,deletionLineIndex:m,additionLineIndex:b})};return c?(p(0,u,r,s),p(o,o,r,s+u),p(0,i-o-u,r+o,s+u+o)):(p(u,0,r,s),p(o,o,r+u,s),p(n-o-u,0,r+u+o,s+o)),f}const gl=/\s+/g;function yr(e){return e.replace(gl,"")}function ml(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r<i&&e[r]===t[r];)r++;let s=0;for(;s<i-r&&e[e.length-1-s]===t[t.length-1-s];)s++;return(r+s)/n}function bl(e,t,n){try{return vl(e,t,n)}finally{so()}}function vl(e,t,n=!1){const i=_l(e),r=i?wl(e):xl(e);let s;const o=[];for(const l of r){if(i&&!Qs.test(l)){if(s==null)s=W(l);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",l)}continue}else if(!i&&!kl(l)){if(s==null)s=W(l);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",l)}continue}const a=oo(l,{cacheKey:void 0,isGitDiff:i,throwOnError:n});a!=null&&o.push(a)}return{patchMetadata:s,files:o}}function yl(e,t){try{return oo(e,t)}finally{so()}}function oo(e,{cacheKey:t,isGitDiff:n=Qs.test(e),oldFile:i,newFile:r,throwOnError:s=!1}={}){let o=0;const l=uo(e,"@@ ");let a;const d=i==null||r==null;let c=0,u=0;for(const h of l){const f=ao(h),p=f[0];if(p==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",h);continue}const g=co(p);let v=0,m=0;if(g==null||a==null){if(a!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",h);continue}a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&i!=null&&r!=null?Cr(r.contents):[],deletionLines:!d&&i!=null&&r!=null?Cr(i.contents):[],cacheKey:xr(t)},a.additionLines.length===1&&r?.contents===""&&(a.additionLines.length=0),a.deletionLines.length===1&&i?.contents===""&&(a.deletionLines.length=0);for(const k of f){if(k.startsWith("diff --git")){const F=k.trim().match(Za),L=F?.[1]??F?.[2],A=F?.[3]??F?.[4];if(L==null||A==null){if(s)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",k);continue}a.name=W(A.trim()),L!==A&&(a.prevName=W(L.trim()));continue}const _=k.startsWith("---")||k.startsWith("+++")?k.match(n?Qa:Ya):null;if(_!=null){const[,F,L]=_;if(F==="---"&&L!=="/dev/null"){const A=W(L.trim());a.prevName=A,a.name=A}else F==="+++"&&L!=="/dev/null"&&(a.name=W(L.trim()))}else if(n){if(k.startsWith("new mode ")&&(a.mode=W(k.slice(8).trim())),k.startsWith("old mode ")&&(a.prevMode=W(k.slice(8).trim())),k.startsWith("new file mode")&&(a.type="new",a.mode=W(k.slice(13).trim())),k.startsWith("deleted file mode")&&(a.type="deleted",a.mode=W(k.slice(17).trim())),k.startsWith("similarity index")&&(k.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),k.startsWith("index ")){const[,F,L,A]=k.trim().match(Ja)??[];F!=null&&(a.prevObjectId=W(F)),L!=null&&(a.newObjectId=W(L)),A!=null&&(a.mode=W(A))}k.startsWith("rename from ")&&(a.prevName=W(k.slice(12).trim())),k.startsWith("rename to ")&&(a.name=W(k.slice(10).trim()))}}continue}let b,y;for(;f.length>0&&(f[f.length-1]===`
2
+ import{w as er,s as Xs,f as Ba,a as Ga,b as za,c as gr,h as ja,_ as D,r as Q,j,p as Wa,d as Va}from"./index-Bbv8DA0_.js";const mr={}.hasOwnProperty;function qa(e,t){const n=t||{};function i(r,...s){let o=i.invalid;const l=i.handlers;if(r&&mr.call(r,e)){const a=String(r[e]);o=mr.call(l,a)?l[a]:i.unknown}if(o)return o.call(this,r,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Ys="diffs-container";(()=>{try{return!1}catch{return!1}})();const Ka=/(?=^From [a-f0-9]+ .+$)/m,Qs=/(?=^diff --git)/gm,Xa=new RegExp("(?<=\\n)"),Ya=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Qa=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Za=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Ja=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Zs="header-prefix",Js="header-filename-suffix",eo="header-metadata",tr="header-custom",le={dark:"pierre-dark",light:"pierre-light"},el="data-theme-css",tl="data-unsafe-css",nl="data-diffs-scrollbar-measure",to="--diffs-scrollbar-gutter-measured",il=1e5,rl={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},sl=Object.freeze({fromStart:0,fromEnd:0}),br={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ol={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},gt=new Set;let mt=null;function no(e){gt.add(e),mt??=requestAnimationFrame(io)}function Ci(e){gt.delete(e)&&gt.size===0&&mt!=null&&(cancelAnimationFrame(mt),mt=null)}function io(e){const t=new Set(gt);gt.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}gt.size>0?mt=requestAnimationFrame(io):mt=null}function Si(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),s=new Set(Object.keys(t));for(const o of r)if(s.delete(o),!i.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(s))if(!i.has(o))return!1;return!0}function nr(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ro(e,t){const n=e?.theme??le,i=t?.theme??le,r=vr(e),s=vr(t);return nr(n,i)&&Si(e,t,["theme","parseDiffOptions"])&&Si(r,s)}function vr(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function wi(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Pe(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const al=new TextEncoder,ll=new TextDecoder("utf-8",{ignoreBOM:!0}),dl=/[\uD800-\uDFFF]/,xi=1024;let ft=new Uint8Array(xi);function so(){ft.length!==xi&&(ft=new Uint8Array(xi))}function W(e){if(e.length===0)return e;if(dl.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;ft.length<t&&(ft=new Uint8Array(t));const{written:n}=al.encodeInto(e,ft);return ll.decode(ft.subarray(0,n))}function Se(e,t){return e-(t===0?0:1)}function ie(e,t){return Se(e,t)+t}const cl=4096,ul=.5;function hl(e){for(const t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){const i=t.hunkContent[n];if(i.type!=="change")continue;const r=pl(e,i);r!=null&&(t.hunkContent.splice(n,1,...r),n+=r.length-1)}fl(t,e)}}function fl(e,t){const{hunkContent:n}=e;for(let i=1;i<n.length;i++){const r=n[i],s=n[i-1];if(r.type!=="change"||r.additions>0&&r.deletions>0||s.type!=="context")continue;const o=r.additions>0,l=o?t.additionLines:t.deletionLines,a=o?r.additionLineIndex:r.deletionLineIndex,d=o?r.additions:r.deletions,c=l[a]??"";if(c.trim()!=="")continue;let u=!0;for(let v=1;v<d;v++)if(l[a+v]!==c){u=!1;break}if(!u)continue;let h=0;for(;h<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-h]===c;)h++;if(h===0||i===1&&h===s.lines)continue;r.additionLineIndex-=h,r.deletionLineIndex-=h;const f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,g=n[i+1];g?.type==="context"?(g.lines+=h,g.additionLineIndex=f,g.deletionLineIndex=p):n.splice(i+1,0,{type:"context",lines:h,additionLineIndex:f,deletionLineIndex:p}),s.lines-=h,s.lines===0&&(n.splice(i-1,1),i--)}}function pl(e,t){const{deletions:n,additions:i,deletionLineIndex:r,additionLineIndex:s}=t,o=Math.min(n,i),l=Math.abs(i-n);if(o===0||l===0||o*(l+1)>cl)return null;const a=[];for(let g=0;g<n;g++)a.push(yr(e.deletionLines[r+g]??""));const d=[];for(let g=0;g<i;g++)d.push(yr(e.additionLines[s+g]??""));const c=i>n;let u=0,h=-1;for(let g=0;g<=l;g++){let v=0;for(let m=0;m<o;m++)v+=ml(a[m+(c?0:g)],d[m+(c?g:0)]);g===0?h=v+o*ul:v>h&&(h=v,u=g)}if(u===0)return null;const f=[],p=(g,v,m,b)=>{(g>0||v>0)&&f.push({type:"change",deletions:g,additions:v,deletionLineIndex:m,additionLineIndex:b})};return c?(p(0,u,r,s),p(o,o,r,s+u),p(0,i-o-u,r+o,s+u+o)):(p(u,0,r,s),p(o,o,r+u,s),p(n-o-u,0,r+u+o,s+o)),f}const gl=/\s+/g;function yr(e){return e.replace(gl,"")}function ml(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r<i&&e[r]===t[r];)r++;let s=0;for(;s<i-r&&e[e.length-1-s]===t[t.length-1-s];)s++;return(r+s)/n}function bl(e,t,n){try{return vl(e,t,n)}finally{so()}}function vl(e,t,n=!1){const i=_l(e),r=i?wl(e):xl(e);let s;const o=[];for(const l of r){if(i&&!Qs.test(l)){if(s==null)s=W(l);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",l)}continue}else if(!i&&!kl(l)){if(s==null)s=W(l);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",l)}continue}const a=oo(l,{cacheKey:void 0,isGitDiff:i,throwOnError:n});a!=null&&o.push(a)}return{patchMetadata:s,files:o}}function yl(e,t){try{return oo(e,t)}finally{so()}}function oo(e,{cacheKey:t,isGitDiff:n=Qs.test(e),oldFile:i,newFile:r,throwOnError:s=!1}={}){let o=0;const l=uo(e,"@@ ");let a;const d=i==null||r==null;let c=0,u=0;for(const h of l){const f=ao(h),p=f[0];if(p==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",h);continue}const g=co(p);let v=0,m=0;if(g==null||a==null){if(a!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",h);continue}a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&i!=null&&r!=null?Cr(r.contents):[],deletionLines:!d&&i!=null&&r!=null?Cr(i.contents):[],cacheKey:xr(t)},a.additionLines.length===1&&r?.contents===""&&(a.additionLines.length=0),a.deletionLines.length===1&&i?.contents===""&&(a.deletionLines.length=0);for(const k of f){if(k.startsWith("diff --git")){const F=k.trim().match(Za),L=F?.[1]??F?.[2],A=F?.[3]??F?.[4];if(L==null||A==null){if(s)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",k);continue}a.name=W(A.trim()),L!==A&&(a.prevName=W(L.trim()));continue}const _=k.startsWith("---")||k.startsWith("+++")?k.match(n?Qa:Ya):null;if(_!=null){const[,F,L]=_;if(F==="---"&&L!=="/dev/null"){const A=W(L.trim());a.prevName=A,a.name=A}else F==="+++"&&L!=="/dev/null"&&(a.name=W(L.trim()))}else if(n){if(k.startsWith("new mode ")&&(a.mode=W(k.slice(8).trim())),k.startsWith("old mode ")&&(a.prevMode=W(k.slice(8).trim())),k.startsWith("new file mode")&&(a.type="new",a.mode=W(k.slice(13).trim())),k.startsWith("deleted file mode")&&(a.type="deleted",a.mode=W(k.slice(17).trim())),k.startsWith("similarity index")&&(k.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),k.startsWith("index ")){const[,F,L,A]=k.trim().match(Ja)??[];F!=null&&(a.prevObjectId=W(F)),L!=null&&(a.newObjectId=W(L)),A!=null&&(a.mode=W(A))}k.startsWith("rename from ")&&(a.prevName=W(k.slice(12).trim())),k.startsWith("rename to ")&&(a.name=W(k.slice(10).trim()))}}continue}let b,y;for(;f.length>0&&(f[f.length-1]===`
3
3
  `||f[f.length-1]==="\r"||f[f.length-1]===`\r
4
4
  `||f[f.length-1]==="");)f.pop();const{additionStart:S,deletionStart:C}=g;c=d?c:C-1,u=d?u:S-1;const w={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:S,additionLines:v,deletionCount:g.deletionCount,deletionStart:C,deletionLines:m,deletionLineIndex:c,additionLineIndex:u,hunkContent:[],hunkContext:xr(g.hunkContext),hunkSpecs:W(p),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let x=0,E=0;for(let k=1;k<f.length;k++){const _=f[k];if(x>=w.additionCount&&E>=w.deletionCount&&!_.startsWith("\\")){if(s&&Ll(_)&&!El(_))throw Error("parsePatchContent: hunk has more lines than expected");break}const F=_[0];if(F!=="+"&&F!=="-"&&F!==" "&&F!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${F}", full line: "${_}"`),console.error("processFile: invalid rawLine:",_);continue}const L=Rl(F);if(L==="addition"){if(s&&x>=w.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const A=jn(_);(b==null||b.type!=="change")&&(b=Wn("change",c,u),w.hunkContent.push(b)),u++,x++,d&&a.additionLines.push(A),b.additions++,v++,y="addition"}else if(L==="deletion"){if(s&&E>=w.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const A=jn(_);(b==null||b.type!=="change")&&(b=Wn("change",c,u),w.hunkContent.push(b)),c++,E++,d&&a.deletionLines.push(A),b.deletions++,m++,y="deletion"}else if(L==="context"){if(s&&(E>=w.deletionCount||x>=w.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const A=jn(_);(b==null||b.type!=="context")&&(b=Wn("context",c,u),w.hunkContent.push(b)),u++,c++,x++,E++,d&&(a.deletionLines.push(A),a.additionLines.push(A)),b.lines++,y="context"}else if(L==="metadata"&&b!=null){if(b.type==="context"?(w.noEOFCRAdditions=!0,w.noEOFCRDeletions=!0):y==="deletion"?w.noEOFCRDeletions=!0:y==="addition"&&(w.noEOFCRAdditions=!0),d&&(y==="addition"||y==="context")){const A=a.additionLines.length-1;A>=0&&(a.additionLines[A]=Pe(a.additionLines[A]))}if(d&&(y==="deletion"||y==="context")){const A=a.deletionLines.length-1;A>=0&&(a.deletionLines[A]=Pe(a.deletionLines[A]))}}}if(s&&(x!==w.additionCount||E!==w.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");w.additionLines=v,w.deletionLines=m,w.collapsedBefore=Math.max(Se(w.additionStart,w.additionCount)-o,0),a.hunks.push(w),o=ie(w.additionStart,w.additionCount);for(const k of w.hunkContent)k.type==="context"?(w.splitLineCount+=k.lines,w.unifiedLineCount+=k.lines):(w.splitLineCount+=Math.max(k.additions,k.deletions),w.unifiedLineCount+=k.deletions+k.additions);w.splitLineStart=a.splitLineCount+w.collapsedBefore,w.unifiedLineStart=a.unifiedLineCount+w.collapsedBefore,a.splitLineCount+=w.collapsedBefore+w.splitLineCount,a.unifiedLineCount+=w.collapsedBefore+w.unifiedLineCount}if(a!=null){if(s&&d&&!n&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){const h=a.hunks[a.hunks.length-1],f=ie(h.additionStart,h.additionCount),p=a.additionLines.length,g=Math.max(p-f,0);a.splitLineCount+=g,a.unifiedLineCount+=g}return n||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(i==null||i.contents==="")&&r!=null&&r.contents!==""?a.type="new":i!=null&&i.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),hl(a),a}}function Cl(e,t,n=!1){const i=[],r=Sl(e)?e.split(Ka):[e];for(const s of r)try{i.push(bl(s,t!=null?`${t}-${i.length}`:void 0,n))}catch(o){if(n)throw o;console.error(o)}return i}function Sl(e){return e.startsWith("From ")||e.includes(`
5
5
  From `)}function Cr(e){const t=ao(e);for(let n=0;n<t.length;n++)t[n]=W(t[n]);return t}function ao(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const i=e.indexOf(`