alchemylab 2.2.0 → 2.3.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/dist/912.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict"
2
+ exports.ids=[912],exports.modules={47912(t,exports,e){function n(t,e){return new Promise(n=>{(0,s.execFile)("git",e,{cwd:t,timeout:1e4,maxBuffer:8388608,windowsHide:!0},(t,e)=>{n({code:t?1:0,stdout:String(e??"")})})})}async function i(t,e,i){if(!f.test(e))return null
3
+ const s=(0,o.join)(t,l.ALCHEMY_DIR_NAME,"worktrees",e)
4
+ if((0,r.existsSync)((0,o.join)(s,".git"))){const t=(await n(s,["merge-base",i,"HEAD"])).stdout.trim()
5
+ if(/^[0-9a-f]{40,64}$/.test(t)){const[e,i]=await Promise.all([n(s,["diff","--name-only",t]),n(s,["ls-files","--others","--exclude-standard"])])
6
+ if(0===e.code)return Array.from(new Set([...c(e.stdout),...c(i.stdout)])).sort()}}const a=await n(t,["diff","--name-only",`${i}...requests/${e}`])
7
+ return 0===a.code?c(a.stdout).sort():null}exports.N$=void 0,exports.withInFlightFiles=async function(t,e,n){const s=Array.isArray(n)?n.filter(t=>"string"==typeof t&&f.test(t)).slice(0,8):[]
8
+ if(!e||!t||0===s.length)return e
9
+ try{const n=await(0,a.resolveDefaultBranch)(t),r=function(t){const e=t.filter(t=>t.files&&t.files.length>0)
10
+ return 0===e.length?null:"[files the work in flight has changed so far, from git]\n"+e.map(t=>{const e=t.files,n=e.length>exports.N$?`, and ${e.length-exports.N$} more`:""
11
+ return`- ${t.requestId}: ${e.slice(0,exports.N$).join(", ")}${n}`}).join("\n")}(await Promise.all(s.map(async e=>({requestId:e,files:await i(t,e,n)}))))
12
+ if(!r)return e
13
+ const o=e.split("\n\n"),l=o.findIndex(t=>t.startsWith("[work in flight beside "))
14
+ return l<0?`${e}\n\n${r}`:(o.splice(l+1,0,r),o.join("\n\n"))}catch{return e}}
15
+ const s=e(31421),r=e(73024),o=e(76760),l=e(14139),a=e(52232)
16
+ exports.N$=20
17
+ const f=/^req\d{6}$/,c=t=>t.split("\n").map(t=>t.trim()).filter(Boolean)}}