@scolladon/tsgit 0.9.0 → 1.1.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.
Files changed (143) hide show
  1. package/README.md +116 -1
  2. package/dist/cjs/adapters/browser/index.cjs +1 -1
  3. package/dist/cjs/adapters/browser/index.cjs.map +1 -1
  4. package/dist/cjs/adapters/memory/index.cjs +1 -1
  5. package/dist/cjs/adapters/memory/index.cjs.map +1 -1
  6. package/dist/cjs/adapters/node/index.cjs +1 -1
  7. package/dist/cjs/adapters/node/index.cjs.map +1 -1
  8. package/dist/cjs/chunks/{browser-http-transport-BBF8uw-f.cjs → browser-http-transport-DcG05jw3.cjs} +2 -2
  9. package/dist/cjs/chunks/{browser-http-transport-BBF8uw-f.cjs.map → browser-http-transport-DcG05jw3.cjs.map} +1 -1
  10. package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +1 -1
  11. package/dist/cjs/chunks/error-CqLvhejR.cjs +2 -0
  12. package/dist/cjs/chunks/error-CqLvhejR.cjs.map +1 -0
  13. package/dist/cjs/chunks/index-BcxdLkNe.cjs +2 -0
  14. package/dist/cjs/chunks/index-BcxdLkNe.cjs.map +1 -0
  15. package/dist/cjs/chunks/index-D5Nd-Mks.cjs +2 -0
  16. package/dist/cjs/chunks/index-D5Nd-Mks.cjs.map +1 -0
  17. package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs → logger-C8Z5BfFF.cjs} +2 -2
  18. package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs.map → logger-C8Z5BfFF.cjs.map} +1 -1
  19. package/dist/cjs/chunks/memory-http-transport-Pjyme5KN.cjs +2 -0
  20. package/dist/cjs/chunks/memory-http-transport-Pjyme5KN.cjs.map +1 -0
  21. package/dist/cjs/chunks/node-http-transport-UkW5eEm3.cjs +2 -0
  22. package/dist/cjs/chunks/node-http-transport-UkW5eEm3.cjs.map +1 -0
  23. package/dist/cjs/chunks/{progress-CK7CT9vU.cjs → progress-CntEbiuo.cjs} +2 -2
  24. package/dist/cjs/chunks/{progress-CK7CT9vU.cjs.map → progress-CntEbiuo.cjs.map} +1 -1
  25. package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs +2 -0
  26. package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs.map +1 -0
  27. package/dist/cjs/chunks/repository-B_jx2AKW.cjs +2 -0
  28. package/dist/cjs/chunks/repository-B_jx2AKW.cjs.map +1 -0
  29. package/dist/cjs/commands/index.cjs +1 -1
  30. package/dist/cjs/index.browser.cjs +1 -1
  31. package/dist/cjs/index.browser.cjs.map +1 -1
  32. package/dist/cjs/index.cjs +1 -1
  33. package/dist/cjs/index.default.cjs +1 -1
  34. package/dist/cjs/index.default.cjs.map +1 -1
  35. package/dist/cjs/index.node.cjs +1 -1
  36. package/dist/cjs/index.node.cjs.map +1 -1
  37. package/dist/cjs/operators/index.cjs +1 -1
  38. package/dist/cjs/operators/index.cjs.map +1 -1
  39. package/dist/cjs/primitives/index.cjs +1 -1
  40. package/dist/cjs/primitives/index.cjs.map +1 -1
  41. package/dist/cjs/transport/index.cjs.map +1 -1
  42. package/dist/esm/adapters/browser/index.js +1 -1
  43. package/dist/esm/adapters/browser/index.js.map +1 -1
  44. package/dist/esm/adapters/memory/index.js +1 -1
  45. package/dist/esm/adapters/memory/index.js.map +1 -1
  46. package/dist/esm/adapters/node/index.js +1 -1
  47. package/dist/esm/adapters/node/index.js.map +1 -1
  48. package/dist/esm/chunks/{browser-http-transport-CRPPmib5.js → browser-http-transport-COFgnEyq.js} +2 -2
  49. package/dist/esm/chunks/{browser-http-transport-CRPPmib5.js.map → browser-http-transport-COFgnEyq.js.map} +1 -1
  50. package/dist/esm/chunks/context-CumKOV7K.js.map +1 -1
  51. package/dist/esm/chunks/error-BN9rdQ33.js +2 -0
  52. package/dist/esm/chunks/error-BN9rdQ33.js.map +1 -0
  53. package/dist/esm/chunks/index-BdV37p4e.js +2 -0
  54. package/dist/esm/chunks/index-BdV37p4e.js.map +1 -0
  55. package/dist/esm/chunks/index-BkRJ9-Im.js +2 -0
  56. package/dist/esm/chunks/index-BkRJ9-Im.js.map +1 -0
  57. package/dist/esm/chunks/{logger-Cg7fUh8D.js → logger-BLZbLzva.js} +2 -2
  58. package/dist/esm/chunks/{logger-Cg7fUh8D.js.map → logger-BLZbLzva.js.map} +1 -1
  59. package/dist/esm/chunks/memory-http-transport-DRYdYgiE.js +2 -0
  60. package/dist/esm/chunks/memory-http-transport-DRYdYgiE.js.map +1 -0
  61. package/dist/esm/chunks/node-http-transport-Bp5cFZCt.js +2 -0
  62. package/dist/esm/chunks/node-http-transport-Bp5cFZCt.js.map +1 -0
  63. package/dist/esm/chunks/progress-DJU_f66N.js +2 -0
  64. package/dist/esm/chunks/{progress-OxUHmDV4.js.map → progress-DJU_f66N.js.map} +1 -1
  65. package/dist/esm/chunks/readable-stream-CGuf8k1J.js +2 -0
  66. package/dist/esm/chunks/readable-stream-CGuf8k1J.js.map +1 -0
  67. package/dist/esm/chunks/repository-DiagDiT_.js +2 -0
  68. package/dist/esm/chunks/repository-DiagDiT_.js.map +1 -0
  69. package/dist/esm/commands/index.js +1 -1
  70. package/dist/esm/index.browser.js +1 -1
  71. package/dist/esm/index.browser.js.map +1 -1
  72. package/dist/esm/index.default.js +1 -1
  73. package/dist/esm/index.default.js.map +1 -1
  74. package/dist/esm/index.js +1 -1
  75. package/dist/esm/index.node.js +1 -1
  76. package/dist/esm/index.node.js.map +1 -1
  77. package/dist/esm/operators/index.js +1 -1
  78. package/dist/esm/operators/index.js.map +1 -1
  79. package/dist/esm/primitives/index.js +1 -1
  80. package/dist/esm/primitives/index.js.map +1 -1
  81. package/dist/esm/transport/index.js.map +1 -1
  82. package/dist/types/adapters/browser/index.d.cts +2 -2
  83. package/dist/types/adapters/browser/index.d.ts +2 -2
  84. package/dist/types/adapters/memory/index.d.cts +4 -2
  85. package/dist/types/adapters/memory/index.d.ts +4 -2
  86. package/dist/types/adapters/node/index.d.cts +117 -3
  87. package/dist/types/adapters/node/index.d.ts +117 -3
  88. package/dist/types/chunks/{context-Ku1aP8Ie.d.cts → context-D84z1i5F.d.cts} +39 -21
  89. package/dist/types/chunks/{context-C6df52Qs.d.ts → context-o5TPfMB2.d.ts} +39 -21
  90. package/dist/types/chunks/{diff-change-BwO75AgS.d.cts → diff-change-Bm1zvVsC.d.cts} +1 -1
  91. package/dist/types/chunks/{diff-change-CUWN3OSK.d.ts → diff-change-alGRzD_j.d.ts} +1 -1
  92. package/dist/types/chunks/{http-transport--_NdQOiw.d.cts → http-transport-DirKfK2S.d.cts} +1 -1
  93. package/dist/types/chunks/{http-transport--_NdQOiw.d.ts → http-transport-DirKfK2S.d.ts} +1 -1
  94. package/dist/types/chunks/{repository-Cv4Y0T9t.d.cts → repository-23evW2h-.d.cts} +5 -4
  95. package/dist/types/chunks/{repository-BBKJnr8a.d.ts → repository-BT7Xq1kJ.d.ts} +5 -4
  96. package/dist/types/chunks/write-tree-DNjhjS3t.d.ts +282 -0
  97. package/dist/types/chunks/write-tree-DVp0RJ_r.d.cts +282 -0
  98. package/dist/types/commands/index.d.cts +82 -36
  99. package/dist/types/commands/index.d.ts +82 -36
  100. package/dist/types/index.browser.d.cts +5 -5
  101. package/dist/types/index.browser.d.ts +5 -5
  102. package/dist/types/index.d.cts +5 -5
  103. package/dist/types/index.d.ts +5 -5
  104. package/dist/types/index.default.d.cts +5 -5
  105. package/dist/types/index.default.d.ts +5 -5
  106. package/dist/types/index.node.d.cts +5 -5
  107. package/dist/types/index.node.d.ts +5 -5
  108. package/dist/types/operators/index.d.cts +17 -1
  109. package/dist/types/operators/index.d.ts +17 -1
  110. package/dist/types/primitives/index.d.cts +223 -186
  111. package/dist/types/primitives/index.d.ts +223 -186
  112. package/dist/types/transport/index.d.cts +1 -1
  113. package/dist/types/transport/index.d.ts +1 -1
  114. package/package.json +70 -23
  115. package/dist/cjs/chunks/error-DL4SHCBJ.cjs +0 -2
  116. package/dist/cjs/chunks/error-DL4SHCBJ.cjs.map +0 -1
  117. package/dist/cjs/chunks/error-DN8Vnwr4.cjs +0 -2
  118. package/dist/cjs/chunks/error-DN8Vnwr4.cjs.map +0 -1
  119. package/dist/cjs/chunks/index-iUd-bwwm.cjs +0 -2
  120. package/dist/cjs/chunks/index-iUd-bwwm.cjs.map +0 -1
  121. package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs +0 -2
  122. package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs.map +0 -1
  123. package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs +0 -2
  124. package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs.map +0 -1
  125. package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs +0 -2
  126. package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs.map +0 -1
  127. package/dist/cjs/chunks/repository-Cbzk-Qwz.cjs +0 -2
  128. package/dist/cjs/chunks/repository-Cbzk-Qwz.cjs.map +0 -1
  129. package/dist/esm/chunks/error-CAlAXhN3.js +0 -2
  130. package/dist/esm/chunks/error-CAlAXhN3.js.map +0 -1
  131. package/dist/esm/chunks/error-DVZkS_ub.js +0 -2
  132. package/dist/esm/chunks/error-DVZkS_ub.js.map +0 -1
  133. package/dist/esm/chunks/index-gUdap5AF.js +0 -2
  134. package/dist/esm/chunks/index-gUdap5AF.js.map +0 -1
  135. package/dist/esm/chunks/memory-http-transport-Cv1sbkCX.js +0 -2
  136. package/dist/esm/chunks/memory-http-transport-Cv1sbkCX.js.map +0 -1
  137. package/dist/esm/chunks/merge-base-opORz-S1.js +0 -2
  138. package/dist/esm/chunks/merge-base-opORz-S1.js.map +0 -1
  139. package/dist/esm/chunks/node-http-transport-CuXVJf0s.js +0 -2
  140. package/dist/esm/chunks/node-http-transport-CuXVJf0s.js.map +0 -1
  141. package/dist/esm/chunks/progress-OxUHmDV4.js +0 -2
  142. package/dist/esm/chunks/repository-BaEhU6zt.js +0 -2
  143. package/dist/esm/chunks/repository-BaEhU6zt.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.js","sources":["../../src/index.node.ts"],"sourcesContent":[null],"names":["openRepository","async","opts","cwd","process","resolvedCwd","realpath","nodePath","resolve","catch","layout","discoverLayout","workDir","gitDir","join","bare","fallback","fs","NodeFileSystem","hash","NodeHashService","compressor","NodeCompressor","transport","NodeHttpTransport","allowInsecureHttp","runtime","hashConfig","SHA1_CONFIG","deltaCache","createLruCache","deltaCacheMaxBytes","deltaCacheMaxEntries","_cwd","_a","_b","_c","coreOpts","openRepositoryCore","start","current","candidate","result","stat","isDirectory","parent","dirname"],"mappings":"ytBAqBA,MAeaA,EAAiBC,MAAOC,EAAkC,MACrE,MAAMC,EAAMD,EAAKC,KAAOC,QAAQD,MAQ1BE,QAAoBC,EAASC,EAASC,QAAQL,IAAMM,MAAM,IAAMF,EAASC,QAAQL,IAKjFO,QAAgBC,EAAeN,IAAiB,CACpDO,QAASP,EACTQ,OAAQN,EAASO,KAAKT,EAAa,QACnCU,MAAM,GAQFC,EAAW,CACfC,GAPS,IAAIC,EAAeR,EAAOE,SAQnCO,KAPW,IAAIC,EAQfC,WAPiB,IAAIC,EAQrBC,UAPgB,IAAIC,EAAkB,CACtCC,kBAAmBvB,EAAKuB,oBAAqB,IAO7CC,QAAS,OACThB,SACAiB,WAAYC,EACZC,WAAYC,EACV5B,EAAK6B,oBAjDuB,SAkD5B7B,EAAK8B,sBAjDyB,SAuDhC7B,IAAK8B,EACLR,kBAAmBS,EACnBH,mBAAoBI,EACpBH,qBAAsBI,KACnBC,GACDnC,EACJ,OAAOoC,EAAmB,IAAKD,EAAUlC,IAAKE,GAAeW,IAQzDL,EAAiBV,MACrBsC,IAEA,IAAIC,EAAUD,EACd,OAAa,CACX,MAAME,EAAYlC,EAASO,KAAK0B,EAAS,QACnCE,QAAeC,EAAKF,GAAWhC,MAAM,QAC3C,GAAIiC,GAAQE,cACV,MAAO,CAAEhC,QAAS4B,EAAS3B,OAAQ4B,EAAW1B,MAAM,GAEtD,MAAM8B,EAAStC,EAASuC,QAAQN,GAChC,GAAIK,IAAWL,EAAS,OACxBA,EAAUK,CACZ"}
1
+ {"version":3,"file":"index.node.js","sources":["../../src/index.node.ts"],"sourcesContent":[null],"names":["openRepository","async","opts","cwd","process","resolvedCwd","realpath","nodePath","resolve","catch","layout","discoverLayout","workDir","gitDir","join","bare","fallback","fs","NodeFileSystem","hash","NodeHashService","compressor","NodeCompressor","transport","NodeHttpTransport","allowInsecureHttp","runtime","hashConfig","SHA1_CONFIG","deltaCache","createLruCache","deltaCacheMaxBytes","deltaCacheMaxEntries","_cwd","_a","_b","_c","coreOpts","openRepositoryCore","start","current","candidate","result","stat","isDirectory","parent","dirname"],"mappings":"6tBAqBA,MAeaA,EAAiBC,MAAOC,EAAkC,MACrE,MAAMC,EAAMD,EAAKC,KAAOC,QAAQD,MAQ1BE,QAAoBC,EAASC,EAASC,QAAQL,IAAMM,MAAM,IAAMF,EAASC,QAAQL,IAKjFO,QAAgBC,EAAeN,IAAiB,CACpDO,QAASP,EACTQ,OAAQN,EAASO,KAAKT,EAAa,QACnCU,MAAM,GAQFC,EAAW,CACfC,GAPS,IAAIC,EAAeR,EAAOE,SAQnCO,KAPW,IAAIC,EAQfC,WAPiB,IAAIC,EAQrBC,UAPgB,IAAIC,EAAkB,CACtCC,kBAAmBvB,EAAKuB,oBAAqB,IAO7CC,QAAS,OACThB,SACAiB,WAAYC,EACZC,WAAYC,EACV5B,EAAK6B,oBAjDuB,SAkD5B7B,EAAK8B,sBAjDyB,SAuDhC7B,IAAK8B,EACLR,kBAAmBS,EACnBH,mBAAoBI,EACpBH,qBAAsBI,KACnBC,GACDnC,EACJ,OAAOoC,EAAmB,IAAKD,EAAUlC,IAAKE,GAAeW,IAQzDL,EAAiBV,MACrBsC,IAEA,IAAIC,EAAUD,EACd,OAAa,CACX,MAAME,EAAYlC,EAASO,KAAK0B,EAAS,QACnCE,QAAeC,EAAKF,GAAWhC,MAAM,QAC3C,GAAIiC,GAAQE,cACV,MAAO,CAAEhC,QAAS4B,EAAS3B,OAAQ4B,EAAW1B,MAAM,GAEtD,MAAM8B,EAAStC,EAASuC,QAAQN,GAChC,GAAIK,IAAWL,EAAS,OACxBA,EAAUK,CACZ"}
@@ -1,2 +1,2 @@
1
- function n(n){return async function*(t){for await(const r of t)await n(r)&&(yield r)}}function t(n){return async t=>{for await(const r of t)if(await n(r))return r}}function r(n){return async function*(t){for await(const r of t){const t=await n(r);for await(const n of t)yield n}}}function e(n,t=Number.POSITIVE_INFINITY){if(Number.isNaN(t)||t<0)throw new RangeError("groupBy(limit): must be a non-negative number or Infinity");return async r=>{const e=new Map;let o=0;for await(const i of r){if(o>=t)throw new RangeError(`groupBy: exceeded limit of ${t} items`);const r=await n(i),a=e.get(r);a?a.push(i):e.set(r,[i]),o+=1}return e}}function o(n){return async function*(t){for await(const r of t)yield await n(r)}}function i(n,...t){return t.reduce((n,t)=>t(n),n)}function a(n){if(!Number.isInteger(n)||n<0)throw new RangeError("take(count): count must be a non-negative integer");return async function*(t){if(0===n)return;let r=0;for await(const e of t)if(yield e,r+=1,r>=n)return}}async function u(n,t=Number.POSITIVE_INFINITY){if(Number.isNaN(t)||t<0)throw new RangeError("toArray(limit): must be a non-negative number or Infinity");const r=[];for await(const e of n){if(r.length>=t)throw new RangeError(`toArray: exceeded limit of ${t} items`);r.push(e)}return r}export{n as filter,t as find,r as flatMap,e as groupBy,o as map,i as pipe,a as take,u as toArray};
1
+ export{r as readableStreamToAsyncIterable}from"../chunks/readable-stream-CGuf8k1J.js";function n(n){return async function*(t){for await(const r of t)await n(r)&&(yield r)}}function t(n){return async t=>{for await(const r of t)if(await n(r))return r}}function e(n){return async function*(t){for await(const r of t){const t=await n(r);for await(const n of t)yield n}}}function o(n,t=Number.POSITIVE_INFINITY){if(Number.isNaN(t)||t<0)throw new RangeError("groupBy(limit): must be a non-negative number or Infinity");return async r=>{const e=new Map;let o=0;for await(const a of r){if(o>=t)throw new RangeError(`groupBy: exceeded limit of ${t} items`);const r=await n(a),i=e.get(r);i?i.push(a):e.set(r,[a]),o+=1}return e}}function a(n){return async function*(t){for await(const r of t)yield await n(r)}}function i(n,...t){return t.reduce((n,t)=>t(n),n)}function u(n){if(!Number.isInteger(n)||n<0)throw new RangeError("take(count): count must be a non-negative integer");return async function*(t){if(0===n)return;let r=0;for await(const e of t)if(yield e,r+=1,r>=n)return}}async function f(n,t=Number.POSITIVE_INFINITY){if(Number.isNaN(t)||t<0)throw new RangeError("toArray(limit): must be a non-negative number or Infinity");const r=[];for await(const e of n){if(r.length>=t)throw new RangeError(`toArray: exceeded limit of ${t} items`);r.push(e)}return r}export{n as filter,t as find,e as flatMap,o as groupBy,a as map,i as pipe,u as take,f as toArray};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/operators/filter.ts","../../../src/operators/find.ts","../../../src/operators/flat-map.ts","../../../src/operators/group-by.ts","../../../src/operators/map.ts","../../../src/operators/pipe.ts","../../../src/operators/take.ts","../../../src/operators/to-array.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["filter","predicate","async","source","value","find","flatMap","mapper","inner","item","groupBy","keyFn","limit","Number","POSITIVE_INFINITY","isNaN","RangeError","result","Map","count","key","bucket","get","push","set","map","pipe","initial","fns","reduce","acc","fn","take","isInteger","yielded","toArray","length"],"mappings":"AAEM,SAAUA,EACdC,GAEA,OAAOC,gBAAiBC,GACtB,UAAW,MAAMC,KAASD,QACdF,EAAUG,WACZA,EAGZ,CACF,CCVM,SAAUC,EACdJ,GAEA,OAAOC,MAAOC,IACZ,UAAW,MAAMC,KAASD,EACxB,SAAUF,EAAUG,GAClB,OAAOA,EAKf,CCXM,SAAUE,EACdC,GAEA,OAAOL,gBAAiBC,GACtB,UAAW,MAAMC,KAASD,EAAQ,CAChC,MAAMK,QAAcD,EAAOH,GAC3B,UAAW,MAAMK,KAAQD,QACjBC,CAEV,CACF,CACF,CCXM,SAAUC,EACdC,EACAC,EAAgBC,OAAOC,mBAEvB,GAAID,OAAOE,MAAMH,IAAUA,EAAQ,EACjC,MAAM,IAAII,WAAW,6DAEvB,OAAOd,MAAOC,IACZ,MAAMc,EAAS,IAAIC,IACnB,IAAIC,EAAQ,EACZ,UAAW,MAAMf,KAASD,EAAQ,CAEhC,GAAIgB,GAASP,EACX,MAAM,IAAII,WAAW,8BAA8BJ,WAErD,MAAMQ,QAAYT,EAAMP,GAClBiB,EAASJ,EAAOK,IAAIF,GAEtBC,EACFA,EAAOE,KAAKnB,GAEZa,EAAOO,IAAIJ,EAAK,CAAChB,IAEnBe,GAAS,CACX,CACA,OAAOF,EAEX,CC3BM,SAAUQ,EACdlB,GAEA,OAAOL,gBAAiBC,GACtB,UAAW,MAAMC,KAASD,cACZI,EAAOH,EAEvB,CACF,UCqDgBsB,EAAKC,KAAqBC,GAExC,OAAOA,EAAIC,OAAO,CAACC,EAAKC,IAAOA,EAAGD,GAAMH,EAC1C,CClEM,SAAUK,EAAQb,GACtB,IAAKN,OAAOoB,UAAUd,IAAUA,EAAQ,EACtC,MAAM,IAAIH,WAAW,qDAEvB,OAAOd,gBAAiBC,GACtB,GAAc,IAAVgB,EAAa,OACjB,IAAIe,EAAU,EACd,UAAW,MAAM9B,KAASD,EAIxB,SAHMC,EACN8B,GAAW,EAEPA,GAAWf,EAAO,MAE1B,CACF,CCdOjB,eAAeiC,EACpBhC,EACAS,EAAgBC,OAAOC,mBAEvB,GAAID,OAAOE,MAAMH,IAAUA,EAAQ,EACjC,MAAM,IAAII,WAAW,6DAEvB,MAAMC,EAAc,GACpB,UAAW,MAAMb,KAASD,EAAQ,CAEhC,GAAIc,EAAOmB,QAAUxB,EACnB,MAAM,IAAII,WAAW,8BAA8BJ,WAErDK,EAAOM,KAAKnB,EACd,CACA,OAAOa,CACT"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/operators/filter.ts","../../../src/operators/find.ts","../../../src/operators/flat-map.ts","../../../src/operators/group-by.ts","../../../src/operators/map.ts","../../../src/operators/pipe.ts","../../../src/operators/take.ts","../../../src/operators/to-array.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["filter","predicate","async","source","value","find","flatMap","mapper","inner","item","groupBy","keyFn","limit","Number","POSITIVE_INFINITY","isNaN","RangeError","result","Map","count","key","bucket","get","push","set","map","pipe","initial","fns","reduce","acc","fn","take","isInteger","yielded","toArray","length"],"mappings":"sFAEM,SAAUA,EACdC,GAEA,OAAOC,gBAAiBC,GACtB,UAAW,MAAMC,KAASD,QACdF,EAAUG,WACZA,EAGZ,CACF,CCVM,SAAUC,EACdJ,GAEA,OAAOC,MAAOC,IACZ,UAAW,MAAMC,KAASD,EACxB,SAAUF,EAAUG,GAClB,OAAOA,EAKf,CCXM,SAAUE,EACdC,GAEA,OAAOL,gBAAiBC,GACtB,UAAW,MAAMC,KAASD,EAAQ,CAChC,MAAMK,QAAcD,EAAOH,GAC3B,UAAW,MAAMK,KAAQD,QACjBC,CAEV,CACF,CACF,CCXM,SAAUC,EACdC,EACAC,EAAgBC,OAAOC,mBAEvB,GAAID,OAAOE,MAAMH,IAAUA,EAAQ,EACjC,MAAM,IAAII,WAAW,6DAEvB,OAAOd,MAAOC,IACZ,MAAMc,EAAS,IAAIC,IACnB,IAAIC,EAAQ,EACZ,UAAW,MAAMf,KAASD,EAAQ,CAEhC,GAAIgB,GAASP,EACX,MAAM,IAAII,WAAW,8BAA8BJ,WAErD,MAAMQ,QAAYT,EAAMP,GAClBiB,EAASJ,EAAOK,IAAIF,GAEtBC,EACFA,EAAOE,KAAKnB,GAEZa,EAAOO,IAAIJ,EAAK,CAAChB,IAEnBe,GAAS,CACX,CACA,OAAOF,EAEX,CC3BM,SAAUQ,EACdlB,GAEA,OAAOL,gBAAiBC,GACtB,UAAW,MAAMC,KAASD,cACZI,EAAOH,EAEvB,CACF,UCqDgBsB,EAAKC,KAAqBC,GAExC,OAAOA,EAAIC,OAAO,CAACC,EAAKC,IAAOA,EAAGD,GAAMH,EAC1C,CClEM,SAAUK,EAAQb,GACtB,IAAKN,OAAOoB,UAAUd,IAAUA,EAAQ,EACtC,MAAM,IAAIH,WAAW,qDAEvB,OAAOd,gBAAiBC,GACtB,GAAc,IAAVgB,EAAa,OACjB,IAAIe,EAAU,EACd,UAAW,MAAM9B,KAASD,EAIxB,SAHMC,EACN8B,GAAW,EAEPA,GAAWf,EAAO,MAE1B,CACF,CCdOjB,eAAeiC,EACpBhC,EACAS,EAAgBC,OAAOC,mBAEvB,GAAID,OAAOE,MAAMH,IAAUA,EAAQ,EACjC,MAAM,IAAII,WAAW,6DAEvB,MAAMC,EAAc,GACpB,UAAW,MAAMb,KAASD,EAAQ,CAEhC,GAAIc,EAAOmB,QAAUxB,EACnB,MAAM,IAAII,WAAW,8BAA8BJ,WAErDK,EAAOM,KAAKnB,EACd,CACA,OAAOa,CACT"}
@@ -1,2 +1,2 @@
1
- import{e,j as t,t as s,k as o,l as n,n as p,o as l,p as y,q as x,M as v}from"../chunks/merge-base-opORz-S1.js";export{i as createCommit,h as diffTrees,g as getRepoRoot,m as mergeBase,f as readIndex,d as readTree,r as resolveRef,u as updateRef,c as walkCommits,b as writeObject,a as writeSymbolicRef,w as writeTree}from"../chunks/merge-base-opORz-S1.js";import{o as j}from"../chunks/error-DVZkS_ub.js";async function k(a,s,r){const i=await e(a,s,r);if("blob"!==i.type)throw t("blob",i.type,s);return i}async function*R(a,s,r){const i={ctx:a,recursive:r?.recursive??!0,maxDepth:r?.maxDepth??1024,maxEntries:r?.maxEntries??v},o="string"==typeof s?await async function(a,s){const r=await e(a,s);if("tree"!==r.type)throw t("tree",r.type,s);return r}(a,s):s;yield*E(i,{value:0},o,"",0,[])}async function*E(t,a,r,i,c,m){if(m.includes(r.id))throw s(r.id);if(o(c,t.maxDepth))throw n(c);const f=[...m,r.id];for(const s of r.entries){if(t.ctx.signal?.aborted)throw j();const r=""===i?s.name:`${i}/${s.name}`;if(a.value+=1,p(a.value,t.maxEntries))throw l(a.value,t.maxEntries);if(yield{path:r,id:s.id,mode:s.mode},!D(t.recursive,s.mode))continue;const o=await e(t.ctx,s.id);"tree"===o.type&&(yield*E(t,a,o,r,c+1,f))}}function D(e,t){return!!e&&!y(t)&&x(t)}export{k as readBlob,e as readObject,R as walkTree};
1
+ export{f as applyChangeset,h as buildIndexFromTree,i as buildPack,k as computeChangeset,l as createCommit,n as diffTrees,r as enumeratePushObjects,s as fetchPack,u as getRepoRoot,D as materializeTree,E as mergeBase,L as readBlob,N as readIndex,P as readObject,Q as readShallow,S as readTree,V as resolveRef,X as synthesizeTreeFromIndex,_ as updateRef,$ as updateShallow,a2 as walkCommits,a3 as walkTree,a4 as walkWorkingTree,a5 as writeObject,a6 as writeSymbolicRef,a7 as writeTree}from"../chunks/index-BdV37p4e.js";import"../chunks/error-BN9rdQ33.js";import"../chunks/readable-stream-CGuf8k1J.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/application/primitives/read-blob.ts","../../../src/application/primitives/walk-tree.ts"],"sourcesContent":[null,null],"names":["async","readBlob","ctx","id","options","object","readObject","type","unexpectedObjectType","walkTree","treeIdOrObject","config","recursive","maxDepth","maxEntries","MAX_FLAT_TREE_ENTRIES","rootTree","obj","resolveTree","walkInternal","value","counter","tree","prefix","depth","stack","includes","treeCycleDetected","exceedsMaxTreeDepth","treeDepthExceeded","descentStack","entry","entries","signal","aborted","operationAborted","path","name","exceedsMaxTreeEntries","treeEntryLimitExceeded","mode","shouldRecurse","subtreeObj","isGitlink","isDirectory"],"mappings":"iZAMOA,eAAeC,EACpBC,EACAC,EACAC,GAEA,MAAMC,QAAeC,EAAWJ,EAAKC,EAAIC,GACzC,GAAoB,SAAhBC,EAAOE,KACT,MAAMC,EAAqB,OAAQH,EAAOE,KAAMJ,GAElD,OAAOE,CACT,CCeOL,eAAgBS,EACrBP,EACAQ,EACAN,GAEA,MAAMO,EAAqB,CACzBT,MACAU,UAAWR,GAASQ,YAAa,EACjCC,SAAUT,GAASS,UAA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js","sources":["../../../src/transport/with-auth.ts","../../../src/transport/with-logging.ts","../../../src/transport/with-retry.ts"],"sourcesContent":[null,null,null],"names":["TEXT_ENCODER","TextEncoder","withAuth","config","type","token","TypeError","validateBearer","username","includes","validateBasic","validateConfig","inner","request","async","req","Object","keys","headers","some","k","toLowerCase","value","s","bytes","encode","bin","i","byteLength","String","fromCharCode","btoa","base64Utf8","password","header","resolveHeader","authorization","addAuthorization","FORCED_REDACT","Set","REDACT_QUERY_KEYS","redactHeaders","extra","extraLower","map","h","out","v","entries","low","has","safeLog","logger","event","log","errorMessage","err","Error","message","withLogging","now","performance","extraRedact","redactedUrl","url","parsed","URL","keysToDelete","key","searchParams","test","push","delete","toString","redactUrl","safeHeaders","start","kind","method","bodyBytes","body","buildRequestEvent","res","safeResHeaders","elapsedMs","statusCode","buildResponseEvent","buildErrorEvent","defaultIsRetryable","error","response","DOMException","name","undefined","tryCancelBody","cancel","catch","defaultDelay","ms","signal","aborted","Promise","reject","reason","resolve","timer","onAbort","clearTimeout","setTimeout","removeEventListener","addEventListener","once","computeDelay","attempt","baseMs","jitter","clamped","Math","min","backoff","maxDelayMs","factor","random","floor","performAttempt","finalize","outcome","shouldStop","ctx","isRetryable","e","isLast","withRetry","attempts","Number","isFinite","isInteger","RangeError","validateAttempts","validateBaseMs","base","validateMaxDelay","validateJitter","delay"],"mappings":"AAGA,MAAMA,EAAe,IAAIC,YAgDZC,EAAYC,IAxBF,CAACA,IACF,WAAhBA,EAAOC,MAXU,CAACC,IACtB,GAAc,KAAVA,EAAc,MAAM,IAAIC,UAAU,6BAURC,CAAeJ,EAAOE,OAChC,UAAhBF,EAAOC,MARS,CAACI,IACrB,GAAIA,EAASC,SAAS,KACpB,MAAM,IAAIH,UAAU,kDAMOI,CAAcP,EAAOK,WAuBlDG,CAAeR,GACPS,IAAoB,CAC1BC,QAASC,MAAOC,IACd,GAxCJC,OAAOC,KAwCeF,EAAIG,SAxCLC,KAAMC,GAA0B,kBAApBA,EAAEC,eA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,EAAcgC,EAAQpC,SAASV,YAC7D+D,EAAM/B,EAAaC,EAAS9G,GAASY,EAAIoF,OACjD,CACA,OAAO0B,EAASC"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/transport/with-auth.ts","../../../src/transport/with-logging.ts","../../../src/transport/with-retry.ts"],"sourcesContent":[null,null,null],"names":["TEXT_ENCODER","TextEncoder","withAuth","config","type","token","TypeError","validateBearer","username","includes","validateBasic","validateConfig","inner","request","async","req","Object","keys","headers","some","k","toLowerCase","value","s","bytes","encode","bin","i","byteLength","String","fromCharCode","btoa","base64Utf8","password","header","resolveHeader","authorization","addAuthorization","FORCED_REDACT","Set","REDACT_QUERY_KEYS","redactHeaders","extra","extraLower","map","h","out","v","entries","low","has","safeLog","logger","event","log","errorMessage","err","Error","message","withLogging","now","performance","extraRedact","redactedUrl","url","parsed","URL","keysToDelete","key","searchParams","test","push","delete","toString","redactUrl","safeHeaders","start","kind","method","bodyBytes","body","buildRequestEvent","res","safeResHeaders","elapsedMs","statusCode","buildResponseEvent","buildErrorEvent","defaultIsRetryable","error","response","DOMException","name","undefined","tryCancelBody","cancel","catch","defaultDelay","ms","signal","aborted","Promise","reject","reason","resolve","timer","onAbort","clearTimeout","setTimeout","removeEventListener","addEventListener","once","computeDelay","attempt","baseMs","jitter","clamped","Math","min","backoff","maxDelayMs","factor","random","floor","performAttempt","finalize","outcome","shouldStop","ctx","isRetryable","e","isLast","withRetry","attempts","Number","isFinite","isInteger","RangeError","validateAttempts","validateBaseMs","base","validateMaxDelay","validateJitter","delay"],"mappings":"AAGA,MAAMA,EAAe,IAAIC,YAgDZC,EAAYC,IAxBF,CAACA,IACF,WAAhBA,EAAOC,MAXU,CAACC,IACtB,GAAc,KAAVA,EAAc,MAAM,IAAIC,UAAU,6BAURC,CAAeJ,EAAOE,OAChC,UAAhBF,EAAOC,MARS,CAACI,IACrB,GAAIA,EAASC,SAAS,KACpB,MAAM,IAAIH,UAAU,kDAMOI,CAAcP,EAAOK,WAuBlDG,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wB,CAC1Bd,UACAkB,OAAQlB,IAAY9G,EAAOkI,SAC3BP,WAEkBG,GAAc,OAAOJ,EAASC,QACzBjC,IAArBiC,EAAQpC,UAAwBI,EAAcgC,EAAQpC,SAASV,YAC7D+D,EAAM/B,EAAaC,EAAS9G,GAASY,EAAIoF,OACjD,CACA,OAAO0B,EAASC"}
@@ -1,5 +1,5 @@
1
- import { a as Context, C as Compressor, I as InflateStreamResult, F as FileSystem, c as FileStat, D as DirEntry, d as FileHandle, H as HashService, e as Hasher } from '../../chunks/context-Ku1aP8Ie.cjs';
2
- import { H as HttpTransport, a as HttpRequest, b as HttpResponse } from '../../chunks/http-transport--_NdQOiw.cjs';
1
+ import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-D84z1i5F.cjs';
2
+ import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
3
3
 
4
4
  interface BrowserAdapterOptions {
5
5
  readonly rootHandle: FileSystemDirectoryHandle;
@@ -1,5 +1,5 @@
1
- import { a as Context, C as Compressor, I as InflateStreamResult, F as FileSystem, c as FileStat, D as DirEntry, d as FileHandle, H as HashService, e as Hasher } from '../../chunks/context-C6df52Qs.js';
2
- import { H as HttpTransport, a as HttpRequest, b as HttpResponse } from '../../chunks/http-transport--_NdQOiw.js';
1
+ import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-o5TPfMB2.js';
2
+ import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
3
3
 
4
4
  interface BrowserAdapterOptions {
5
5
  readonly rootHandle: FileSystemDirectoryHandle;
@@ -1,5 +1,5 @@
1
- import { a as Context, C as Compressor, I as InflateStreamResult, F as FileSystem, c as FileStat, D as DirEntry, d as FileHandle, H as HashService, e as Hasher } from '../../chunks/context-Ku1aP8Ie.cjs';
2
- import { H as HttpTransport, a as HttpRequest, b as HttpResponse } from '../../chunks/http-transport--_NdQOiw.cjs';
1
+ import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-D84z1i5F.cjs';
2
+ import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
3
3
 
4
4
  interface MemoryAdapterOptions {
5
5
  readonly files?: Readonly<Record<string, Uint8Array>>;
@@ -7,6 +7,8 @@ interface MemoryAdapterOptions {
7
7
  readonly signal?: AbortSignal;
8
8
  readonly deltaCacheMaxBytes?: number;
9
9
  readonly deltaCacheMaxEntries?: number;
10
+ /** Optional home directory exposed via `ctx.layout.homeDir` (default: undefined). */
11
+ readonly homeDir?: string;
10
12
  }
11
13
  declare function createMemoryContext(options?: MemoryAdapterOptions): Context;
12
14
 
@@ -1,5 +1,5 @@
1
- import { a as Context, C as Compressor, I as InflateStreamResult, F as FileSystem, c as FileStat, D as DirEntry, d as FileHandle, H as HashService, e as Hasher } from '../../chunks/context-C6df52Qs.js';
2
- import { H as HttpTransport, a as HttpRequest, b as HttpResponse } from '../../chunks/http-transport--_NdQOiw.js';
1
+ import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-o5TPfMB2.js';
2
+ import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
3
3
 
4
4
  interface MemoryAdapterOptions {
5
5
  readonly files?: Readonly<Record<string, Uint8Array>>;
@@ -7,6 +7,8 @@ interface MemoryAdapterOptions {
7
7
  readonly signal?: AbortSignal;
8
8
  readonly deltaCacheMaxBytes?: number;
9
9
  readonly deltaCacheMaxEntries?: number;
10
+ /** Optional home directory exposed via `ctx.layout.homeDir` (default: undefined). */
11
+ readonly homeDir?: string;
10
12
  }
11
13
  declare function createMemoryContext(options?: MemoryAdapterOptions): Context;
12
14
 
@@ -1,5 +1,5 @@
1
- import { a as Context, C as Compressor, I as InflateStreamResult, F as FileSystem, c as FileStat, D as DirEntry, d as FileHandle, H as HashService, e as Hasher } from '../../chunks/context-Ku1aP8Ie.cjs';
2
- import { H as HttpTransport, a as HttpRequest, b as HttpResponse } from '../../chunks/http-transport--_NdQOiw.cjs';
1
+ import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-D84z1i5F.cjs';
2
+ import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
3
3
 
4
4
  interface NodeAdapterOptions {
5
5
  readonly workDir: string;
@@ -25,9 +25,121 @@ declare class NodeCompressor implements Compressor {
25
25
  createInflateStream: () => TransformStream<Uint8Array, Uint8Array>;
26
26
  }
27
27
 
28
+ /**
29
+ * Injectable surface for the Node `fs/promises` calls that `NodeFileSystem`
30
+ * needs. Production code uses `realFsOps`; tests inject a partial fake.
31
+ *
32
+ * Why this exists:
33
+ * - `vi.mock('node:fs/promises')` is file-scoped and patches the module
34
+ * system. It dumps every test that "needs to mock fs" into one bucket
35
+ * (the previous `node-file-system-containment.test.ts` smell).
36
+ * - Dependency injection at the adapter constructor makes the dependency
37
+ * explicit, scoped per-instance, and cross-platform by construction —
38
+ * tests don't depend on Vitest's mock machinery to swap the fs surface.
39
+ * - The interface is a `Pick` of `fsPromises` so production code can just
40
+ * pass the real module without writing any glue. Tests pass a fake
41
+ * object that satisfies the subset they exercise.
42
+ *
43
+ * @internal — not re-exported from `src/adapters/node/index.ts`.
44
+ */
45
+ type FsOperations = Pick<typeof fsPromises, 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
46
+
47
+ /**
48
+ * Path-policy abstraction.
49
+ *
50
+ * Encapsulates every platform-aware path operation the Node adapter needs.
51
+ * Production code uses `nativePolicy` (host-matching). Tests inject
52
+ * `windowsPolicy` or `posixPolicy` to simulate either platform on any host,
53
+ * eliminating the "host vs. simulated platform" confusion that was
54
+ * leaking into containment / cache / errno code paths.
55
+ *
56
+ * Design notes:
57
+ * - `sep` is the platform separator string, used for prefix containment.
58
+ * - `caseInsensitive` drives `normalizeForCompare`; Windows + macOS HFS+
59
+ * could share this in theory, but tsgit treats macOS as case-sensitive
60
+ * per Git's `core.ignorecase` default and POSIX convention.
61
+ * - `rootOf` returns the volume/drive prefix produced by `path.parse`.
62
+ * Examples: `/` on POSIX, `'C:\\'` on Windows, `'\\\\server\\share\\'`
63
+ * for UNC paths.
64
+ * - The interface is *only* the subset NodeFileSystem actually needs; we
65
+ * intentionally do not expose all of `nodePath`'s surface so callers
66
+ * can't smuggle host-bound calls back in.
67
+ */
68
+ interface PathPolicy {
69
+ readonly sep: '\\' | '/';
70
+ readonly caseInsensitive: boolean;
71
+ isAbsolute(path: string): boolean;
72
+ resolve(...parts: string[]): string;
73
+ join(...parts: string[]): string;
74
+ dirname(path: string): string;
75
+ basename(path: string): string;
76
+ /**
77
+ * Returns the volume/drive prefix produced by `path.parse(p).root`.
78
+ * POSIX: `/` for absolute, `''` for relative.
79
+ * Windows: `'C:\\'`, `'\\\\server\\share\\'`, or `''` for relative.
80
+ */
81
+ rootOf(path: string): string;
82
+ /** Case-fold on case-insensitive platforms; identity otherwise. */
83
+ normalizeForCompare(path: string): string;
84
+ }
85
+
28
86
  declare class NodeFileSystem implements FileSystem {
29
87
  private readonly rootDir;
30
- constructor(rootDir: string);
88
+ private readonly pathPolicy;
89
+ private readonly fsOps;
90
+ /**
91
+ * Memoised realpath of an *existing* parent directory, keyed by the raw
92
+ * (pre-realpath) parent path. Populated on every cache-miss inside
93
+ * `resolveForCreation` so a clone/checkout that writes N files into the
94
+ * same tree pays the realpath walk-up once per parent rather than once
95
+ * per file.
96
+ *
97
+ * Invariants:
98
+ * - Only EXISTING parents are cached. ENOENT walks fall back to
99
+ * `realpathNearestExisting` and are never recorded.
100
+ * - `rmRecursive` and `rename` clear the cache, which is correct (the
101
+ * parent realpath may have changed) and cheap (the cache holds at
102
+ * most a handful of small strings).
103
+ */
104
+ private readonly creationParentCache;
105
+ /**
106
+ * Lazy long-name canonicalisation of `rootDir` for containment checks.
107
+ * Promise so concurrent first calls share one `realpath`; cleared on
108
+ * rejection so a transient ENOENT can be retried.
109
+ */
110
+ private canonicalRootPromise;
111
+ /**
112
+ * Memoised result of `pathPolicy.normalizeForCompare(rootDir)`. The
113
+ * rootDir is `readonly` for the adapter's lifetime, so a single
114
+ * normalisation is amortised across every containment check.
115
+ */
116
+ private normalizedRootDir;
117
+ /**
118
+ * Memoised result of `pathPolicy.normalizeForCompare(canonicalRoot)`.
119
+ * Tracked alongside the canonical-root promise: when the promise
120
+ * resolves we cache the normalised form once. The promise's
121
+ * rejection-clears-cache rule means a transient ENOENT also clears
122
+ * this field (so the next call re-normalises against the retried
123
+ * canonical root).
124
+ */
125
+ private normalizedCanonicalRoot;
126
+ constructor(rootDir: string, pathPolicy?: PathPolicy, fsOps?: FsOperations);
127
+ private getNormalizedRootDir;
128
+ /**
129
+ * Returns the cached normalised canonical root. Caller must have
130
+ * `await this.getCanonicalRoot()` immediately prior — the cache is
131
+ * populated by the promise's success arm and cleared on rejection, so
132
+ * a successful `await` guarantees the field is set.
133
+ *
134
+ * Kept synchronous (vs `async` + `await this.getCanonicalRoot()`
135
+ * inside) so the hot path doesn't pay an extra microtask suspension
136
+ * per containment check on a settled promise. The `!` is the only
137
+ * machine-readable form of "trust the post-await invariant"; the
138
+ * private `await getCanonicalRoot()` discipline at every call site is
139
+ * what makes it safe.
140
+ */
141
+ private getResolvedNormalizedCanonicalRoot;
142
+ private getCanonicalRoot;
31
143
  read: (path: string) => Promise<Uint8Array>;
32
144
  readSlice: (path: string, offset: number, length: number) => Promise<Uint8Array>;
33
145
  readUtf8: (path: string) => Promise<string>;
@@ -46,8 +158,10 @@ declare class NodeFileSystem implements FileSystem {
46
158
  chmod: (path: string, mode: number) => Promise<void>;
47
159
  rmRecursive: (path: string) => Promise<void>;
48
160
  openWithNoFollow: (path: string, mode: "read" | "write") => Promise<FileHandle>;
161
+ private isSymlinkLeaf;
49
162
  private removeTree;
50
163
  private resolveForCreation;
164
+ private realpathForCreation;
51
165
  private resolveForMode;
52
166
  private checkContainment;
53
167
  }
@@ -1,5 +1,5 @@
1
- import { a as Context, C as Compressor, I as InflateStreamResult, F as FileSystem, c as FileStat, D as DirEntry, d as FileHandle, H as HashService, e as Hasher } from '../../chunks/context-C6df52Qs.js';
2
- import { H as HttpTransport, a as HttpRequest, b as HttpResponse } from '../../chunks/http-transport--_NdQOiw.js';
1
+ import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-o5TPfMB2.js';
2
+ import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
3
3
 
4
4
  interface NodeAdapterOptions {
5
5
  readonly workDir: string;
@@ -25,9 +25,121 @@ declare class NodeCompressor implements Compressor {
25
25
  createInflateStream: () => TransformStream<Uint8Array, Uint8Array>;
26
26
  }
27
27
 
28
+ /**
29
+ * Injectable surface for the Node `fs/promises` calls that `NodeFileSystem`
30
+ * needs. Production code uses `realFsOps`; tests inject a partial fake.
31
+ *
32
+ * Why this exists:
33
+ * - `vi.mock('node:fs/promises')` is file-scoped and patches the module
34
+ * system. It dumps every test that "needs to mock fs" into one bucket
35
+ * (the previous `node-file-system-containment.test.ts` smell).
36
+ * - Dependency injection at the adapter constructor makes the dependency
37
+ * explicit, scoped per-instance, and cross-platform by construction —
38
+ * tests don't depend on Vitest's mock machinery to swap the fs surface.
39
+ * - The interface is a `Pick` of `fsPromises` so production code can just
40
+ * pass the real module without writing any glue. Tests pass a fake
41
+ * object that satisfies the subset they exercise.
42
+ *
43
+ * @internal — not re-exported from `src/adapters/node/index.ts`.
44
+ */
45
+ type FsOperations = Pick<typeof fsPromises, 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
46
+
47
+ /**
48
+ * Path-policy abstraction.
49
+ *
50
+ * Encapsulates every platform-aware path operation the Node adapter needs.
51
+ * Production code uses `nativePolicy` (host-matching). Tests inject
52
+ * `windowsPolicy` or `posixPolicy` to simulate either platform on any host,
53
+ * eliminating the "host vs. simulated platform" confusion that was
54
+ * leaking into containment / cache / errno code paths.
55
+ *
56
+ * Design notes:
57
+ * - `sep` is the platform separator string, used for prefix containment.
58
+ * - `caseInsensitive` drives `normalizeForCompare`; Windows + macOS HFS+
59
+ * could share this in theory, but tsgit treats macOS as case-sensitive
60
+ * per Git's `core.ignorecase` default and POSIX convention.
61
+ * - `rootOf` returns the volume/drive prefix produced by `path.parse`.
62
+ * Examples: `/` on POSIX, `'C:\\'` on Windows, `'\\\\server\\share\\'`
63
+ * for UNC paths.
64
+ * - The interface is *only* the subset NodeFileSystem actually needs; we
65
+ * intentionally do not expose all of `nodePath`'s surface so callers
66
+ * can't smuggle host-bound calls back in.
67
+ */
68
+ interface PathPolicy {
69
+ readonly sep: '\\' | '/';
70
+ readonly caseInsensitive: boolean;
71
+ isAbsolute(path: string): boolean;
72
+ resolve(...parts: string[]): string;
73
+ join(...parts: string[]): string;
74
+ dirname(path: string): string;
75
+ basename(path: string): string;
76
+ /**
77
+ * Returns the volume/drive prefix produced by `path.parse(p).root`.
78
+ * POSIX: `/` for absolute, `''` for relative.
79
+ * Windows: `'C:\\'`, `'\\\\server\\share\\'`, or `''` for relative.
80
+ */
81
+ rootOf(path: string): string;
82
+ /** Case-fold on case-insensitive platforms; identity otherwise. */
83
+ normalizeForCompare(path: string): string;
84
+ }
85
+
28
86
  declare class NodeFileSystem implements FileSystem {
29
87
  private readonly rootDir;
30
- constructor(rootDir: string);
88
+ private readonly pathPolicy;
89
+ private readonly fsOps;
90
+ /**
91
+ * Memoised realpath of an *existing* parent directory, keyed by the raw
92
+ * (pre-realpath) parent path. Populated on every cache-miss inside
93
+ * `resolveForCreation` so a clone/checkout that writes N files into the
94
+ * same tree pays the realpath walk-up once per parent rather than once
95
+ * per file.
96
+ *
97
+ * Invariants:
98
+ * - Only EXISTING parents are cached. ENOENT walks fall back to
99
+ * `realpathNearestExisting` and are never recorded.
100
+ * - `rmRecursive` and `rename` clear the cache, which is correct (the
101
+ * parent realpath may have changed) and cheap (the cache holds at
102
+ * most a handful of small strings).
103
+ */
104
+ private readonly creationParentCache;
105
+ /**
106
+ * Lazy long-name canonicalisation of `rootDir` for containment checks.
107
+ * Promise so concurrent first calls share one `realpath`; cleared on
108
+ * rejection so a transient ENOENT can be retried.
109
+ */
110
+ private canonicalRootPromise;
111
+ /**
112
+ * Memoised result of `pathPolicy.normalizeForCompare(rootDir)`. The
113
+ * rootDir is `readonly` for the adapter's lifetime, so a single
114
+ * normalisation is amortised across every containment check.
115
+ */
116
+ private normalizedRootDir;
117
+ /**
118
+ * Memoised result of `pathPolicy.normalizeForCompare(canonicalRoot)`.
119
+ * Tracked alongside the canonical-root promise: when the promise
120
+ * resolves we cache the normalised form once. The promise's
121
+ * rejection-clears-cache rule means a transient ENOENT also clears
122
+ * this field (so the next call re-normalises against the retried
123
+ * canonical root).
124
+ */
125
+ private normalizedCanonicalRoot;
126
+ constructor(rootDir: string, pathPolicy?: PathPolicy, fsOps?: FsOperations);
127
+ private getNormalizedRootDir;
128
+ /**
129
+ * Returns the cached normalised canonical root. Caller must have
130
+ * `await this.getCanonicalRoot()` immediately prior — the cache is
131
+ * populated by the promise's success arm and cleared on rejection, so
132
+ * a successful `await` guarantees the field is set.
133
+ *
134
+ * Kept synchronous (vs `async` + `await this.getCanonicalRoot()`
135
+ * inside) so the hot path doesn't pay an extra microtask suspension
136
+ * per containment check on a settled promise. The `!` is the only
137
+ * machine-readable form of "trust the post-await invariant"; the
138
+ * private `await getCanonicalRoot()` discipline at every call site is
139
+ * what makes it safe.
140
+ */
141
+ private getResolvedNormalizedCanonicalRoot;
142
+ private getCanonicalRoot;
31
143
  read: (path: string) => Promise<Uint8Array>;
32
144
  readSlice: (path: string, offset: number, length: number) => Promise<Uint8Array>;
33
145
  readUtf8: (path: string) => Promise<string>;
@@ -46,8 +158,10 @@ declare class NodeFileSystem implements FileSystem {
46
158
  chmod: (path: string, mode: number) => Promise<void>;
47
159
  rmRecursive: (path: string) => Promise<void>;
48
160
  openWithNoFollow: (path: string, mode: "read" | "write") => Promise<FileHandle>;
161
+ private isSymlinkLeaf;
49
162
  private removeTree;
50
163
  private resolveForCreation;
164
+ private realpathForCreation;
51
165
  private resolveForMode;
52
166
  private checkContainment;
53
167
  }
@@ -1,4 +1,4 @@
1
- import { H as HttpTransport } from './http-transport--_NdQOiw.cjs';
1
+ import { b as HttpTransport } from './http-transport-DirKfK2S.cjs';
2
2
 
3
3
  interface InflateStreamResult {
4
4
  /** The fully-inflated output bytes. */
@@ -83,16 +83,16 @@ interface FileSystem {
83
83
  /**
84
84
  * Write bytes to file. Fails with FILE_EXISTS if the file already exists (exclusive create).
85
85
  *
86
- * Contract obligations (Phase 7 §14.17):
86
+ * Contract obligations:
87
87
  * - **Parent-directory creation:** the adapter MUST ensure parent directories exist before the
88
- * exclusive write. Equivalent to `mkdir -p dirname(path)` before `open(path, O_EXCL)`. If the
89
- * parent is removed between the implicit mkdir and the open (e.g. concurrent `git gc` prunes
90
- * the fanout), the adapter retries once: re-create the parent, re-attempt the open. On a second
91
- * ENOENT the error propagates as FILE_NOT_FOUND.
88
+ * exclusive write. Equivalent to `mkdir -p dirname(path)` before `open(path, O_EXCL)`. If the
89
+ * parent is removed between the implicit mkdir and the open (e.g. concurrent `git gc` prunes
90
+ * the fanout), the adapter retries once: re-create the parent, re-attempt the open. On a second
91
+ * ENOENT the error propagates as FILE_NOT_FOUND.
92
92
  * - **Symlink-safe ancestor check:** the adapter MUST reject writes where any ancestor directory
93
- * of `path` is a symbolic link whose resolved target is outside the containment root. This
94
- * closes the attack where an attacker replaces `objects/xx/` with a symlink pointing elsewhere.
95
- * Implementation: lstat-walk the ancestor chain, or use `openat`-style relative opens.
93
+ * of `path` is a symbolic link whose resolved target is outside the containment root. This
94
+ * closes the attack where an attacker replaces `objects/xx/` with a symlink pointing elsewhere.
95
+ * Implementation: lstat-walk the ancestor chain, or use `openat`-style relative opens.
96
96
  */
97
97
  readonly writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
98
98
  /** Write UTF-8 string to file, creating parent directories as needed. */
@@ -140,7 +140,7 @@ interface FileSystem {
140
140
  * - Node: `fs.open(path, O_NOFOLLOW | (mode === 'write' ? O_WRONLY : O_RDONLY))`.
141
141
  * - Memory: rejects with `PERMISSION_DENIED` when the leaf is a memory symlink entry.
142
142
  * - Browser OPFS: throws `UNSUPPORTED_OPERATION` (OPFS has no symlinks; callers can
143
- * fall back to a plain `read`/`write` because the no-follow guarantee holds vacuously).
143
+ * fall back to a plain `read`/`write` because the no-follow guarantee holds vacuously).
144
144
  *
145
145
  * Throws `FILE_NOT_FOUND` if the leaf does not exist (in `read` mode).
146
146
  * Throws `PERMISSION_DENIED` if the leaf is a symlink.
@@ -212,7 +212,7 @@ interface LruCache<V> {
212
212
  * `Logger` in `transport/types.ts`, which is event-based and HTTP-shaped.
213
213
  *
214
214
  * The facade wraps user-supplied loggers with sanitization at construction time
215
- * (see Phase 10 design §8.5). Implementations should be tolerant of high call
215
+ * . Implementations should be tolerant of high call
216
216
  * frequency and MUST NOT throw — a throwing logger crashes nothing.
217
217
  */
218
218
  interface Logger {
@@ -225,8 +225,8 @@ interface Logger {
225
225
  declare const noopLogger: Logger;
226
226
  /**
227
227
  * Wrap a user-supplied logger so every `message` + every string value in the
228
- * `context` object passes through `sanitize()` (Phase 9 §4.7) before reaching
229
- * the sink. Per design §8.5 the facade applies this at construction time so no
228
+ * `context` object passes through `sanitize()` before reaching
229
+ * the sink. the facade applies this at construction time so no
230
230
  * downstream caller ever feeds raw control bytes to a user-controlled sink.
231
231
  *
232
232
  * Methods that the user did not supply are absent on the wrapper (preserves
@@ -237,7 +237,7 @@ declare const wrapLoggerSanitizer: (logger: Logger) => Logger;
237
237
 
238
238
  /**
239
239
  * Progress reporter shape consumed by long-running commands. The facade
240
- * (Phase 10) accepts a user-supplied implementation via
240
+ * accepts a user-supplied implementation via
241
241
  * `OpenRepositoryOptions.progress` and plumbs it onto `Context.progress`.
242
242
  *
243
243
  * Reporters are synchronous and fire-and-forget. The facade wraps every call
@@ -261,20 +261,28 @@ interface ProgressReporter {
261
261
  }
262
262
 
263
263
  /**
264
- * Repository physical layout — where the working tree and .git directory live.
265
- * Renamed in Phase 10 from the previous `RepositoryConfig` (port-tier) to free that
264
+ * Repository physical layout — where the working tree and.git directory live.
265
+ * Renamed in from the previous `RepositoryConfig` (port-tier) to free that
266
266
  * name for the facade-tier `RepositoryConfig` shape (auth/parallelism/etc.).
267
267
  */
268
268
  interface RepositoryLayout {
269
269
  /** Absolute path to the repository root (working tree). */
270
270
  readonly workDir: string;
271
- /** Absolute path to the .git directory (usually `${workDir}/.git`, but may differ for bare repos or worktrees). */
271
+ /** Absolute path to the.git directory (usually `${workDir}/.git`, but may differ for bare repos or worktrees). */
272
272
  readonly gitDir: string;
273
273
  /** Whether this is a bare repository. */
274
274
  readonly bare: boolean;
275
+ /**
276
+ * Home directory for `~`-expansion in config-driven paths (e.g.
277
+ * `core.excludesFile = ~/.config/git/ignore`). Populated by the node
278
+ * shim from `os.homedir()`; memory adapter accepts an option; browser
279
+ * leaves it `undefined`. When `undefined`, loaders that need home
280
+ * expansion treat the source as missing.
281
+ */
282
+ readonly homeDir?: string;
275
283
  }
276
284
  /**
277
- * Author / committer identity — Phase 9 §4.7 shape.
285
+ * Author / committer identity shape.
278
286
  */
279
287
  interface AuthorIdentity {
280
288
  readonly name: string;
@@ -292,7 +300,7 @@ type AuthStrategy = {
292
300
  readonly password: string;
293
301
  };
294
302
  /**
295
- * Facade-tier configuration. Phase 10 introduces this shape; it carries the
303
+ * Facade-tier configuration. introduces this shape; it carries the
296
304
  * auth/parallelism/SSRF/network options the facade plumbs into network-pipeline.
297
305
  * All fields are optional — primitives and commands consult only the keys they need.
298
306
  */
@@ -304,7 +312,17 @@ interface RepositoryConfig {
304
312
  readonly upstreamRef?: RefName;
305
313
  readonly allowInsecure?: boolean;
306
314
  readonly allowPrivateNetworks?: boolean;
315
+ /**
316
+ * Hard cap (bytes) on a single pack body buffered in memory by `fetchPack`.
317
+ * Server-controlled byte counts above this raise `PACK_TOO_LARGE`. Default
318
+ * 512 MiB. Lower it for hardened deployments that clone only small repos.
319
+ */
307
320
  readonly maxResponseBytes?: number;
321
+ /**
322
+ * Hard cap on the entry-count field declared in a received pack header.
323
+ * Server-controlled `uint32` values above this raise `PACK_TOO_LARGE` before
324
+ * `fetchPack` allocates per-entry state. Default 50_000_000.
325
+ */
308
326
  readonly maxObjectsPerPack?: number;
309
327
  readonly detectRenames?: boolean;
310
328
  readonly breakStaleLockMs?: number;
@@ -350,5 +368,5 @@ interface CreateContextParts {
350
368
  /** Assemble a frozen Context from its constituent ports + layout. */
351
369
  declare function createContext(parts: CreateContextParts): Context;
352
370
 
353
- export { ObjectId as O, FilePath as b, createContext as i, RefName as j, noopLogger as n, wrapLoggerSanitizer as w };
354
- export type { AuthStrategy as A, Compressor as C, DirEntry as D, FileSystem as F, HashService as H, InflateStreamResult as I, Logger as L, ProgressReporter as P, RepositoryConfig as R, Context as a, FileStat as c, FileHandle as d, Hasher as e, AuthorIdentity as f, CreateContextParts as g, RepositoryLayout as h };
371
+ export { ObjectId as O, RefName as R, FilePath as d, createContext as j, noopLogger as n, wrapLoggerSanitizer as w };
372
+ export type { AuthStrategy as A, Compressor as C, DirEntry as D, FileHandle as F, HashService as H, InflateStreamResult as I, Logger as L, ProgressReporter as P, AuthorIdentity as a, Context as b, CreateContextParts as c, FileStat as e, FileSystem as f, Hasher as g, RepositoryConfig as h, RepositoryLayout as i };