@scolladon/tsgit 1.0.0 → 1.2.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 (144) hide show
  1. package/README.md +29 -137
  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-D4NH-8oJ.cjs +2 -0
  9. package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs.map +1 -0
  10. package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +1 -1
  11. package/dist/cjs/chunks/error-CDLOBdNU.cjs +2 -0
  12. package/dist/cjs/chunks/error-CDLOBdNU.cjs.map +1 -0
  13. package/dist/cjs/chunks/index-BVArBKuk.cjs +2 -0
  14. package/dist/cjs/chunks/index-BVArBKuk.cjs.map +1 -0
  15. package/dist/cjs/chunks/index-DE9HSiWf.cjs +2 -0
  16. package/dist/cjs/chunks/index-DE9HSiWf.cjs.map +1 -0
  17. package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs → logger-CVG0zcPH.cjs} +2 -2
  18. package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs.map → logger-CVG0zcPH.cjs.map} +1 -1
  19. package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs +2 -0
  20. package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs.map +1 -0
  21. package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs +2 -0
  22. package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs.map +1 -0
  23. package/dist/cjs/chunks/{progress-CK7CT9vU.cjs → progress-Bj2w-90A.cjs} +2 -2
  24. package/dist/cjs/chunks/{progress-CK7CT9vU.cjs.map → progress-Bj2w-90A.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-BJwTSiGf.cjs +2 -0
  28. package/dist/cjs/chunks/repository-BJwTSiGf.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-DL8bkNdg.js +2 -0
  49. package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js.map +1 -0
  50. package/dist/esm/chunks/context-CumKOV7K.js.map +1 -1
  51. package/dist/esm/chunks/error-MOmSzp9Z.js +2 -0
  52. package/dist/esm/chunks/error-MOmSzp9Z.js.map +1 -0
  53. package/dist/esm/chunks/index-BjmofbKE.js +2 -0
  54. package/dist/esm/chunks/index-BjmofbKE.js.map +1 -0
  55. package/dist/esm/chunks/index-Jh5R-UmU.js +2 -0
  56. package/dist/esm/chunks/index-Jh5R-UmU.js.map +1 -0
  57. package/dist/esm/chunks/{logger-84ixEPbQ.js → logger-DP2cCpvL.js} +2 -2
  58. package/dist/esm/chunks/{logger-84ixEPbQ.js.map → logger-DP2cCpvL.js.map} +1 -1
  59. package/dist/esm/chunks/memory-http-transport-COJU6VOL.js +2 -0
  60. package/dist/esm/chunks/memory-http-transport-COJU6VOL.js.map +1 -0
  61. package/dist/esm/chunks/node-http-transport-DYCFIJbc.js +2 -0
  62. package/dist/esm/chunks/node-http-transport-DYCFIJbc.js.map +1 -0
  63. package/dist/esm/chunks/{progress-OTDhgmPO.js → progress-NePjO3Kd.js} +2 -2
  64. package/dist/esm/chunks/{progress-OTDhgmPO.js.map → progress-NePjO3Kd.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-Cs-dbHqO.js +2 -0
  68. package/dist/esm/chunks/repository-Cs-dbHqO.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 -1
  83. package/dist/types/adapters/browser/index.d.ts +2 -1
  84. package/dist/types/adapters/memory/index.d.cts +23 -2
  85. package/dist/types/adapters/memory/index.d.ts +23 -2
  86. package/dist/types/adapters/node/index.d.cts +178 -3
  87. package/dist/types/adapters/node/index.d.ts +178 -3
  88. package/dist/types/chunks/{context-CTaXSPiP.d.ts → context-BORy7yXb.d.ts} +133 -20
  89. package/dist/types/chunks/{context-d36639-i.d.cts → context-CMrHCVwK.d.cts} +133 -20
  90. package/dist/types/chunks/reflog-entry-BIf-zt__.d.cts +331 -0
  91. package/dist/types/chunks/reflog-entry-D9P2hCgv.d.ts +331 -0
  92. package/dist/types/chunks/{repository-CFT9j9H6.d.cts → repository-BqibvTOu.d.cts} +23 -4
  93. package/dist/types/chunks/{repository-ntg7eXb2.d.ts → repository-C4rN09Am.d.ts} +23 -4
  94. package/dist/types/chunks/write-tree-B8G6kgTy.d.cts +154 -0
  95. package/dist/types/chunks/write-tree-BXCDChvv.d.ts +154 -0
  96. package/dist/types/commands/index.d.cts +229 -37
  97. package/dist/types/commands/index.d.ts +229 -37
  98. package/dist/types/index.browser.d.cts +4 -4
  99. package/dist/types/index.browser.d.ts +4 -4
  100. package/dist/types/index.d.cts +4 -4
  101. package/dist/types/index.d.ts +4 -4
  102. package/dist/types/index.default.d.cts +4 -4
  103. package/dist/types/index.default.d.ts +4 -4
  104. package/dist/types/index.node.d.cts +4 -4
  105. package/dist/types/index.node.d.ts +4 -4
  106. package/dist/types/operators/index.d.cts +17 -1
  107. package/dist/types/operators/index.d.ts +17 -1
  108. package/dist/types/primitives/index.d.cts +393 -171
  109. package/dist/types/primitives/index.d.ts +393 -171
  110. package/package.json +76 -10
  111. package/dist/cjs/chunks/browser-http-transport-BBF8uw-f.cjs +0 -2
  112. package/dist/cjs/chunks/browser-http-transport-BBF8uw-f.cjs.map +0 -1
  113. package/dist/cjs/chunks/error-DL4SHCBJ.cjs +0 -2
  114. package/dist/cjs/chunks/error-DL4SHCBJ.cjs.map +0 -1
  115. package/dist/cjs/chunks/error-DN8Vnwr4.cjs +0 -2
  116. package/dist/cjs/chunks/error-DN8Vnwr4.cjs.map +0 -1
  117. package/dist/cjs/chunks/index-iUd-bwwm.cjs +0 -2
  118. package/dist/cjs/chunks/index-iUd-bwwm.cjs.map +0 -1
  119. package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs +0 -2
  120. package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs.map +0 -1
  121. package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs +0 -2
  122. package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs.map +0 -1
  123. package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs +0 -2
  124. package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs.map +0 -1
  125. package/dist/cjs/chunks/repository-Cfo6Bj8T.cjs +0 -2
  126. package/dist/cjs/chunks/repository-Cfo6Bj8T.cjs.map +0 -1
  127. package/dist/esm/chunks/browser-http-transport-mZQKkInJ.js +0 -2
  128. package/dist/esm/chunks/browser-http-transport-mZQKkInJ.js.map +0 -1
  129. package/dist/esm/chunks/error-CnIcr6IG.js +0 -2
  130. package/dist/esm/chunks/error-CnIcr6IG.js.map +0 -1
  131. package/dist/esm/chunks/error-DTEP18A3.js +0 -2
  132. package/dist/esm/chunks/error-DTEP18A3.js.map +0 -1
  133. package/dist/esm/chunks/index-CJc-SKMj.js +0 -2
  134. package/dist/esm/chunks/index-CJc-SKMj.js.map +0 -1
  135. package/dist/esm/chunks/memory-http-transport-BmHjaEWj.js +0 -2
  136. package/dist/esm/chunks/memory-http-transport-BmHjaEWj.js.map +0 -1
  137. package/dist/esm/chunks/merge-base-DmuOYxfP.js +0 -2
  138. package/dist/esm/chunks/merge-base-DmuOYxfP.js.map +0 -1
  139. package/dist/esm/chunks/node-http-transport-Bz3noIS3.js +0 -2
  140. package/dist/esm/chunks/node-http-transport-Bz3noIS3.js.map +0 -1
  141. package/dist/esm/chunks/repository-qcX3-LkP.js +0 -2
  142. package/dist/esm/chunks/repository-qcX3-LkP.js.map +0 -1
  143. package/dist/types/chunks/diff-change-B09vxnxy.d.cts +0 -59
  144. package/dist/types/chunks/diff-change-D7xSeCn9.d.ts +0 -59
@@ -1,2 +1,2 @@
1
- import{M as s,b as r,a as o,c as e}from"./chunks/memory-http-transport-BmHjaEWj.js";import{a as t,S as m,c as p}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as h}from"./chunks/repository-qcX3-LkP.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-84ixEPbQ.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-OTDhgmPO.js";import"./chunks/error-CnIcr6IG.js";import"./chunks/error-DTEP18A3.js";import"./chunks/index-CJc-SKMj.js";import"./chunks/merge-base-DmuOYxfP.js";import"./primitives/index.js";const u="/repo",f=async(i={})=>{const a=i.algorithm??"sha1",n={fs:new o(void 0===i.files?{rootDir:u}:{rootDir:u,files:i.files}),hash:new r(a),compressor:new s,transport:new e,runtime:"memory",layout:{workDir:u,gitDir:"/repo/.git",bare:!1},hashConfig:"sha256"===a?t:m,deltaCache:p(16777216)},{files:c,algorithm:f,...g}=i;return h({cwd:u,...g},n)};export{f as openRepository};
1
+ import{M as s,b as r,a as o,c as e}from"./chunks/memory-http-transport-COJU6VOL.js";import{a as t,S as m,c as p}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as h}from"./chunks/repository-Cs-dbHqO.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";import"./chunks/error-MOmSzp9Z.js";import"./chunks/index-Jh5R-UmU.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";const u="/repo",l=async(a={})=>{const i=a.algorithm??"sha1",n={fs:new o(void 0===a.files?{rootDir:u}:{rootDir:u,files:a.files}),hash:new r(i),compressor:new s,transport:new e,runtime:"memory",layout:{workDir:u,gitDir:"/repo/.git",bare:!1},hashConfig:"sha256"===i?t:m,deltaCache:p(16777216)},{files:c,algorithm:l,...f}=a;return h({cwd:u,...f},n)};export{l as openRepository};
2
2
  //# sourceMappingURL=index.default.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.default.js","sources":["../../src/index.default.ts"],"sourcesContent":[null],"names":["DEFAULT_WORK_DIR","openRepository","async","opts","algorithm","fallback","fs","MemoryFileSystem","undefined","files","rootDir","hash","MemoryHashService","compressor","MemoryCompressor","transport","MemoryHttpTransport","runtime","layout","workDir","gitDir","bare","hashConfig","SHA256_CONFIG","SHA1_CONFIG","deltaCache","createLruCache","_f","_a","coreOpts","openRepositoryCore","cwd"],"mappings":"iiBAuBA,MAAMA,EAAmB,QAiBZC,EAAiBC,MAC5BC,EAAoC,MAEpC,MAAMC,EAAYD,EAAKC,WAAa,OAK9BC,EAAW,CACfC,GAAI,IAAIC,OAJOC,IAAfL,EAAKM,MACD,CAAEC,QAASV,GACX,CAAEU,QAASV,EAAkBS,MAAON,EAAKM,QAG7CE,KAAM,IAAIC,EAAkBR,GAC5BS,WAAY,IAAIC,EAChBC,UAAW,IAAIC,EACfC,QAAS,SACTC,OAAQ,CAAEC,QAASnB,EAAkBoB,OA9BjB,aA8B0CC,MAAM,GACpEC,WAA0B,WAAdlB,EAAyBmB,EAAgBC,EACrDC,WAAYC,EA/BkB,YAmCxBjB,MAAOkB,EAAIvB,UAAWwB,KAAOC,GAAa1B,EAClD,OAAO2B,EAAmB,CAAEC,IAAK/B,KAAqB6B,GAAYxB"}
1
+ {"version":3,"file":"index.default.js","sources":["../../src/index.default.ts"],"sourcesContent":[null],"names":["DEFAULT_WORK_DIR","openRepository","async","opts","algorithm","fallback","fs","MemoryFileSystem","undefined","files","rootDir","hash","MemoryHashService","compressor","MemoryCompressor","transport","MemoryHttpTransport","runtime","layout","workDir","gitDir","bare","hashConfig","SHA256_CONFIG","SHA1_CONFIG","deltaCache","createLruCache","_f","_a","coreOpts","openRepositoryCore","cwd"],"mappings":"qiBAuBA,MAAMA,EAAmB,QAiBZC,EAAiBC,MAC5BC,EAAoC,MAEpC,MAAMC,EAAYD,EAAKC,WAAa,OAK9BC,EAAW,CACfC,GAAI,IAAIC,OAJOC,IAAfL,EAAKM,MACD,CAAEC,QAASV,GACX,CAAEU,QAASV,EAAkBS,MAAON,EAAKM,QAG7CE,KAAM,IAAIC,EAAkBR,GAC5BS,WAAY,IAAIC,EAChBC,UAAW,IAAIC,EACfC,QAAS,SACTC,OAAQ,CAAEC,QAASnB,EAAkBoB,OA9BjB,aA8B0CC,MAAM,GACpEC,WAA0B,WAAdlB,EAAyBmB,EAAgBC,EACrDC,WAAYC,EA/BkB,YAmCxBjB,MAAOkB,EAAIvB,UAAWwB,KAAOC,GAAa1B,EAClD,OAAO2B,EAAmB,CAAEC,IAAK/B,KAAqB6B,GAAYxB"}
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{d as detectRuntime,i as isBrowser,a as isNode,n as noopLogger,w as wrapLoggerSanitizer}from"./chunks/logger-84ixEPbQ.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-OTDhgmPO.js";export{a as add,b as branch,c as checkout,d as clone,e as commit,f as diff,g as fetch,i as init,l as log,m as merge,p as push,r as reset,h as revParse,j as rm,s as status,t as tag}from"./chunks/index-CJc-SKMj.js";export{c as createContext}from"./chunks/context-CumKOV7K.js";import"./chunks/error-DTEP18A3.js";import"./chunks/error-CnIcr6IG.js";import"./chunks/merge-base-DmuOYxfP.js";
1
+ export{d as detectRuntime,i as isBrowser,a as isNode,n as noopLogger,w as wrapLoggerSanitizer}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";export{a as add,b as branch,c as catFile,d as checkout,e as clone,f as commit,g as createPromisorRemote,h as diff,i as fetch,j as fetchMissing,k as init,l as log,m as merge,p as push,r as reflog,n as reset,o as revParse,q as rm,s as sparseCheckout,t as status,u as submodules,v as tag}from"./chunks/index-Jh5R-UmU.js";export{c as createContext}from"./chunks/context-CumKOV7K.js";import"./chunks/error-MOmSzp9Z.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{realpath as r,stat as o}from"node:fs/promises";import*as s from"node:path";import{a as e,b as t,N as p,c as m}from"./chunks/node-http-transport-Bz3noIS3.js";import{S as h,c as l}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as u}from"./chunks/repository-qcX3-LkP.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-84ixEPbQ.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-OTDhgmPO.js";import"node:zlib";import"./chunks/error-CnIcr6IG.js";import"node:fs";import"node:crypto";import"node:http";import"node:https";import"node:stream";import"./chunks/error-DTEP18A3.js";import"./chunks/index-CJc-SKMj.js";import"./chunks/merge-base-DmuOYxfP.js";import"./primitives/index.js";const w=async(o={})=>{const a=o.cwd??process.cwd(),i=await r(s.resolve(a)).catch(()=>s.resolve(a)),n=await f(i)??{workDir:i,gitDir:s.join(i,".git"),bare:!1},c={fs:new e(n.workDir),hash:new t,compressor:new p,transport:new m({allowInsecureHttp:o.allowInsecureHttp??!1}),runtime:"node",layout:n,hashConfig:h,deltaCache:l(o.deltaCacheMaxBytes??16777216,o.deltaCacheMaxEntries??65536)},{cwd:d,allowInsecureHttp:w,deltaCacheMaxBytes:j,deltaCacheMaxEntries:k,...g}=o;return u({...g,cwd:i},c)},f=async r=>{let e=r;for(;;){const r=s.join(e,".git"),t=await o(r).catch(()=>{});if(t?.isDirectory())return{workDir:e,gitDir:r,bare:!1};const a=s.dirname(e);if(a===e)return;e=a}};export{w as openRepository};
1
+ import{realpath as r,stat as o}from"node:fs/promises";import*as s from"node:path";import{c as e,a as t,b as p,N as m,d as h}from"./chunks/node-http-transport-DYCFIJbc.js";import{S as l,c as u}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as w}from"./chunks/repository-Cs-dbHqO.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";import"node:zlib";import"./chunks/error-MOmSzp9Z.js";import"node:fs";import"node:crypto";import"node:child_process";import"node:http";import"node:https";import"node:stream";import"./chunks/index-Jh5R-UmU.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";const f=async(o={})=>{const a=o.cwd??process.cwd(),n=await r(s.resolve(a)).catch(()=>s.resolve(a)),i=await k(n)??{workDir:n,gitDir:s.join(n,".git"),bare:!1},c={fs:new t(i.workDir),hash:new p,compressor:new m,transport:new h({allowInsecureHttp:o.allowInsecureHttp??!1}),hooks:new e,runtime:"node",layout:i,hashConfig:l,deltaCache:u(o.deltaCacheMaxBytes??16777216,o.deltaCacheMaxEntries??65536)},{cwd:d,allowInsecureHttp:f,deltaCacheMaxBytes:j,deltaCacheMaxEntries:g,...x}=o;return w({...x,cwd:n},c)},k=async r=>{let e=r;for(;;){const r=s.join(e,".git"),t=await o(r).catch(()=>{});if(t?.isDirectory())return{workDir:e,gitDir:r,bare:!1};const a=s.dirname(e);if(a===e)return;e=a}};export{f as openRepository};
2
2
  //# sourceMappingURL=index.node.js.map
@@ -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","hooks","NodeHookRunner","runtime","hashConfig","SHA1_CONFIG","deltaCache","createLruCache","deltaCacheMaxBytes","deltaCacheMaxEntries","_cwd","_a","_b","_c","coreOpts","openRepositoryCore","start","current","candidate","result","stat","isDirectory","parent","dirname"],"mappings":"+vBAsBA,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,MAAO,IAAIC,EACXC,QAAS,OACTlB,SACAmB,WAAYC,EACZC,WAAYC,EACV9B,EAAK+B,oBAlDuB,SAmD5B/B,EAAKgC,sBAlDyB,SAwDhC/B,IAAKgC,EACLV,kBAAmBW,EACnBH,mBAAoBI,EACpBH,qBAAsBI,KACnBC,GACDrC,EACJ,OAAOsC,EAAmB,IAAKD,EAAUpC,IAAKE,GAAeW,IAQzDL,EAAiBV,MACrBwC,IAEA,IAAIC,EAAUD,EACd,OAAa,CACX,MAAME,EAAYpC,EAASO,KAAK4B,EAAS,QACnCE,QAAeC,EAAKF,GAAWlC,MAAM,QAC3C,GAAImC,GAAQE,cACV,MAAO,CAAElC,QAAS8B,EAAS7B,OAAQ8B,EAAW5B,MAAM,GAEtD,MAAMgC,EAASxC,EAASyC,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,UA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u as o,b as f,v as u,j as p,f as w,M as l}from"../chunks/merge-base-DmuOYxfP.js";export{c as createCommit,d as diffTrees,g as getRepoRoot,m as mergeBase,r as readIndex,n as readTree,s as resolveRef,x as updateRef,z as walkCommits,A as writeObject,B as writeSymbolicRef,C as writeTree}from"../chunks/merge-base-DmuOYxfP.js";import{o as y}from"../chunks/error-CnIcr6IG.js";async function h(a,s,r){const i=await e(a,s,r);if("blob"!==i.type)throw t("blob",i.type,s);return i}async function*b(a,s,r){const i={ctx:a,recursive:r?.recursive??!0,maxDepth:r?.maxDepth??1024,maxEntries:r?.maxEntries??l},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*v(i,{value:0},o,"",0,[])}async function*v(t,s,r,n,c,m){if(m.includes(r.id))throw a(r.id);if(i(c,t.maxDepth))throw o(c);const d=[...m,r.id];for(const a of r.entries){if(t.ctx.signal?.aborted)throw y();const r=""===n?a.name:`${n}/${a.name}`;if(s.value+=1,f(s.value,t.maxEntries))throw u(s.value,t.maxEntries);if(yield{path:r,id:a.id,mode:a.mode},!j(t.recursive,a.mode))continue;const i=await e(t.ctx,a.id);"tree"===i.type&&(yield*v(t,s,i,r,c+1,d))}}function j(e,t){return!!e&&!p(t)&&w(t)}export{h as readBlob,e as readObject,b as walkTree};
1
+ export{d as MAX_SPARSE_PATTERN_FILE_BYTES,g as appendReflog,h as applyChangeset,k as buildIndexFromTree,l as buildPack,n as catFileBatch,q as computeChangeset,s as createCommit,v as deleteReflog,w as diffTrees,z as enumeratePushObjects,B as enumerateRefs,D as fetchPack,G as getRepoRoot,L as invalidateConfigCache,P as isWorkingTreeDirty,Q as listReflogs,T as loadSparseMatcher,X as materializeTree,Y as mergeBase,a5 as readBlob,a6 as readConfig,a7 as readIndex,a8 as readObject,a9 as readReflog,aa as readShallow,ab as readSparsePatternText,ac as readTree,ad as recordRefUpdate,ag as reflogExists,ak as resolveRef,al as resolveReflogIdentity,am as runHook,ap as setConfigEntry,aq as setCoreConfigEntry,at as sparseCheckoutPath,au as synthesizeTreeFromIndex,ax as updateConfigEntries,ay as updateCoreConfig,az as updateRef,aA as updateShallow,aD as walkCommits,aE as walkSubmodules,aF as walkTree,aG as walkWorkingTree,aH as writeObject,aI as writeReflog,aJ as writeSparsePatternText,aK as writeSymbolicRef,aL as writeTree}from"../chunks/index-BjmofbKE.js";import"../chunks/error-MOmSzp9Z.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":"sZAMOA,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,UAAY,KAC/BC,WAAYV,GAASU,YAAcC,GAG/BC,EACsB,iBAAnBN,QAuCXV,eAA2BE,EAAcC,GACvC,MAAMc,QAAYX,EAAWJ,EAAKC,GAClC,GAAiB,SAAbc,EAAIV,KACN,MAAMC,EAAqB,OAAQS,EAAIV,KAAMJ,GAE/C,OAAOc,CACT,CA5CcC,CAAYhB,EAAKQ,GACvBA,QACCS,EAAaR,EALK,CAAES,MAAO,GAKGJ,EAAU,GAAI,EAAG,GACxD,CAEAhB,eAAgBmB,EACdR,EACAU,EACAC,EACAC,EACAC,EACAC,GAEA,GAAIA,EAAMC,SAASJ,EAAKnB,IAAK,MAAMwB,EAAkBL,EAAKnB,IAC1D,GAAIyB,EAAoBJ,EAAOb,EAAOE,UAAW,MAAMgB,EAAkBL,GACzE,MAAMM,EAAe,IAAIL,EAAOH,EAAKnB,IACrC,IAAK,MAAM4B,KAAST,EAAKU,QAAS,CAChC,GAAIrB,EAAOT,IAAI+B,QAAQC,QAAS,MAAMC,IACtC,MAAMC,EAAmB,KAAXb,EAAgBQ,EAAMM,KAAO,GAAGd,KAAUQ,EAAMM,OAE9D,GADAhB,EAAQD,OAAS,EACbkB,EAAsBjB,EAAQD,MAAOT,EAAOG,YAC9C,MAAMyB,EAAuBlB,EAAQD,MAAOT,EAAOG,YAGrD,QADM,CAAEsB,OAAMjC,GAAI4B,EAAM5B,GAAIqC,KAAMT,EAAMS,OACnCC,EAAc9B,EAAOC,UAAWmB,EAAMS,MAAO,SAClD,MAAME,QAAmBpC,EAAWK,EAAOT,IAAK6B,EAAM5B,IAC9B,SAApBuC,EAAWnC,aACNY,EAAaR,EAAQU,EAASqB,EAAYN,EAAMZ,EAAQ,EAAGM,GAEtE,CACF,CAEA,SAASW,EAAc7B,EAAoB4B,GACzC,QAAK5B,IACD+B,EAAUH,IACPI,EAAYJ,EACrB"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
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,CAAeR,GACPS,IAAoB,CAC1BC,QAASC,MAAOC,IACd,GAxCJC,OAAOC,KAwCeF,EAAIG,SAxCLC,KAAMC,GAA0B,kBAApBA,EAAEC,eAwCC,OAAOT,EAAMC,QAAQE,GACrD,MAAMO,OApBUR,OAAOX,EAAoBY,KAC/C,GAAoB,WAAhBZ,EAAOC,KAAmB,MALmB,UAKID,EAAOE,QAC5D,GAAoB,UAAhBF,EAAOC,KAAkB,MAJ7B,SA7BiB,CAACmB,IAClB,MAAMC,EAAQxB,EAAayB,O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,UAAUH,IAClBA,EAtBiB,GAuBjBA,EAtBiB,GAwBjB,MAAM,IAAII,WAAW,sCAoEvBC,CAAiBvI,EAAOkI,UAhEH,CAACnB,IACtB,QAAerB,IAAXqB,KACCoB,OAAOC,SAASrB,IAAWA,EAAS,GACvC,MAAM,IAAIuB,WAAW,kCA8DvBE,CAAexI,EAAO+G,QA1DC,EAACA,EAA4BM,KACpD,QAAmB3B,IAAf2B,EAA0B,OAC9B,MAAMoB,EAAO1B,GApCS,IAqCtB,IAAKoB,OAAOC,SAASf,IAAeA,EAAaoB,EAC/C,MAAM,IAAIH,WAAW,2CAuDvBI,CAAiB1I,EAAO+G,OAAQ/G,EAAOqH,YAnDlB,CAACL,IACtB,QAAetB,IAAXsB,KACCmB,OAAOC,SAASpB,IAAWA,EAAS,GAAKA,EAAS,GACrD,MAAM,IAAIsB,WAAW,wCAiDvBK,CAAe3I,EAAOgH,SAuCtBxG,CAAeR,GACf,MAAM8H,EAAc9H,EAAO8H,aAAezC,EACpCuD,EAAQ5I,EAAO4I,OAAS9C,EAC9B,OAAQrF,IAiBC,CAAEC,QAhBOC,MAAOC,IACrB,GAAIA,EAAIoF,QAAQC,QAAS,MAAMrF,EAAIoF,OAAOI,OAC1C,IAAIuB,EAA0B,CAAA,EAC9B,IAAK,IAAIb,EAAU,EAAGA,GAAW9G,EAAOkI,SAAUpB,GAAW,EAAG,CAO9D,GANAa,QAAgBF,EAAehH,EAAOG,GAMlCgH,EALwB,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
+ {"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,CAAeR,GACPS,IAAoB,CAC1BC,QAASC,MAAOC,IACd,GAxCJC,OAAOC,KAwCeF,EAAIG,SAxCLC,KAAMC,GAA0B,kBAApBA,EAAEC,eAwCC,OAAOT,EAAMC,QAAQE,GACrD,MAAMO,OApBUR,OAAOX,EAAoBY,KAC/C,GAAoB,WAAhBZ,EAAOC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"}
@@ -1,4 +1,4 @@
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-d36639-i.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-CMrHCVwK.cjs';
2
2
  import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
3
3
 
4
4
  interface BrowserAdapterOptions {
@@ -30,6 +30,7 @@ declare class BrowserFileSystem implements FileSystem {
30
30
  write(path: string, data: Uint8Array): Promise<void>;
31
31
  writeExclusive(path: string, data: Uint8Array): Promise<void>;
32
32
  writeUtf8(path: string, content: string): Promise<void>;
33
+ appendUtf8(path: string, content: string): Promise<void>;
33
34
  exists(path: string): Promise<boolean>;
34
35
  stat(path: string): Promise<FileStat>;
35
36
  lstat(path: string): Promise<FileStat>;
@@ -1,4 +1,4 @@
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-CTaXSPiP.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-BORy7yXb.js';
2
2
  import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
3
3
 
4
4
  interface BrowserAdapterOptions {
@@ -30,6 +30,7 @@ declare class BrowserFileSystem implements FileSystem {
30
30
  write(path: string, data: Uint8Array): Promise<void>;
31
31
  writeExclusive(path: string, data: Uint8Array): Promise<void>;
32
32
  writeUtf8(path: string, content: string): Promise<void>;
33
+ appendUtf8(path: string, content: string): Promise<void>;
33
34
  exists(path: string): Promise<boolean>;
34
35
  stat(path: string): Promise<FileStat>;
35
36
  lstat(path: string): Promise<FileStat>;
@@ -1,4 +1,4 @@
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-d36639-i.cjs';
1
+ import { k as HookRunner, 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, h as HookName, j as HookResult, i as HookRequest } from '../../chunks/context-CMrHCVwK.cjs';
2
2
  import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
3
3
 
4
4
  interface MemoryAdapterOptions {
@@ -7,6 +7,10 @@ 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;
12
+ /** Optional hook runner exposed via `ctx.hooks` (default: undefined — hooks inert). */
13
+ readonly hooks?: HookRunner;
10
14
  }
11
15
  declare function createMemoryContext(options?: MemoryAdapterOptions): Context;
12
16
 
@@ -35,6 +39,8 @@ declare class MemoryFileSystem implements FileSystem {
35
39
  write: (path: string, data: Uint8Array) => Promise<void>;
36
40
  writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
37
41
  writeUtf8: (path: string, content: string) => Promise<void>;
42
+ appendUtf8: (path: string, content: string) => Promise<void>;
43
+ private readExistingUtf8;
38
44
  exists: (path: string) => Promise<boolean>;
39
45
  /** POSIX ELOOP threshold — symlink chains longer than this are cycle-detected. */
40
46
  private static readonly SYMLINK_FOLLOW_LIMIT;
@@ -75,6 +81,21 @@ declare class MemoryHashService implements HashService {
75
81
  createHasher: () => Hasher;
76
82
  }
77
83
 
84
+ /**
85
+ * In-memory `HookRunner` test double. Constructed with a per-hook outcome map;
86
+ * an unmapped hook resolves `skipped`. Every invocation is recorded on `calls`
87
+ * so a test can assert the request a command built (name, args, stdin,
88
+ * hooksDir) without spawning a process.
89
+ */
90
+ declare class MemoryHookRunner implements HookRunner {
91
+ private readonly outcomes;
92
+ private readonly recorded;
93
+ constructor(outcomes?: Partial<Record<HookName, HookResult>>);
94
+ /** Every `HookRequest` received, in invocation order. */
95
+ get calls(): ReadonlyArray<HookRequest>;
96
+ run(request: HookRequest): Promise<HookResult>;
97
+ }
98
+
78
99
  interface MockSetup {
79
100
  readonly method: 'GET' | 'POST';
80
101
  readonly url: string;
@@ -91,5 +112,5 @@ declare class MemoryHttpTransport implements HttpTransport {
91
112
  clearMocks(): void;
92
113
  }
93
114
 
94
- export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHttpTransport, createMemoryContext };
115
+ export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHookRunner, MemoryHttpTransport, createMemoryContext };
95
116
  export type { MemoryAdapterOptions, MemoryFileSystemOptions, MockSetup };
@@ -1,4 +1,4 @@
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-CTaXSPiP.js';
1
+ import { k as HookRunner, 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, h as HookName, j as HookResult, i as HookRequest } from '../../chunks/context-BORy7yXb.js';
2
2
  import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
3
3
 
4
4
  interface MemoryAdapterOptions {
@@ -7,6 +7,10 @@ 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;
12
+ /** Optional hook runner exposed via `ctx.hooks` (default: undefined — hooks inert). */
13
+ readonly hooks?: HookRunner;
10
14
  }
11
15
  declare function createMemoryContext(options?: MemoryAdapterOptions): Context;
12
16
 
@@ -35,6 +39,8 @@ declare class MemoryFileSystem implements FileSystem {
35
39
  write: (path: string, data: Uint8Array) => Promise<void>;
36
40
  writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
37
41
  writeUtf8: (path: string, content: string) => Promise<void>;
42
+ appendUtf8: (path: string, content: string) => Promise<void>;
43
+ private readExistingUtf8;
38
44
  exists: (path: string) => Promise<boolean>;
39
45
  /** POSIX ELOOP threshold — symlink chains longer than this are cycle-detected. */
40
46
  private static readonly SYMLINK_FOLLOW_LIMIT;
@@ -75,6 +81,21 @@ declare class MemoryHashService implements HashService {
75
81
  createHasher: () => Hasher;
76
82
  }
77
83
 
84
+ /**
85
+ * In-memory `HookRunner` test double. Constructed with a per-hook outcome map;
86
+ * an unmapped hook resolves `skipped`. Every invocation is recorded on `calls`
87
+ * so a test can assert the request a command built (name, args, stdin,
88
+ * hooksDir) without spawning a process.
89
+ */
90
+ declare class MemoryHookRunner implements HookRunner {
91
+ private readonly outcomes;
92
+ private readonly recorded;
93
+ constructor(outcomes?: Partial<Record<HookName, HookResult>>);
94
+ /** Every `HookRequest` received, in invocation order. */
95
+ get calls(): ReadonlyArray<HookRequest>;
96
+ run(request: HookRequest): Promise<HookResult>;
97
+ }
98
+
78
99
  interface MockSetup {
79
100
  readonly method: 'GET' | 'POST';
80
101
  readonly url: string;
@@ -91,5 +112,5 @@ declare class MemoryHttpTransport implements HttpTransport {
91
112
  clearMocks(): void;
92
113
  }
93
114
 
94
- export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHttpTransport, createMemoryContext };
115
+ export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHookRunner, MemoryHttpTransport, createMemoryContext };
95
116
  export type { MemoryAdapterOptions, MemoryFileSystemOptions, MockSetup };
@@ -1,4 +1,4 @@
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-d36639-i.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, k as HookRunner, i as HookRequest, j as HookResult } from '../../chunks/context-CMrHCVwK.cjs';
2
2
  import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
3
3
 
4
4
  interface NodeAdapterOptions {
@@ -9,6 +9,12 @@ interface NodeAdapterOptions {
9
9
  readonly signal?: AbortSignal;
10
10
  readonly deltaCacheMaxBytes?: number;
11
11
  readonly deltaCacheMaxEntries?: number;
12
+ /**
13
+ * Wire the git-hook runner (default true). Pass `false` to disable hooks.
14
+ * A wired runner spawns `.git/hooks/*` scripts that inherit the full
15
+ * `process.env` — disable it for repositories you do not trust.
16
+ */
17
+ readonly hooks?: boolean;
12
18
  }
13
19
  declare function createNodeContext(options: NodeAdapterOptions): Context;
14
20
 
@@ -25,15 +31,128 @@ declare class NodeCompressor implements Compressor {
25
31
  createInflateStream: () => TransformStream<Uint8Array, Uint8Array>;
26
32
  }
27
33
 
34
+ /**
35
+ * Injectable surface for the Node `fs/promises` calls that `NodeFileSystem`
36
+ * needs. Production code uses `realFsOps`; tests inject a partial fake.
37
+ *
38
+ * Why this exists:
39
+ * - `vi.mock('node:fs/promises')` is file-scoped and patches the module
40
+ * system. It dumps every test that "needs to mock fs" into one bucket
41
+ * (the previous `node-file-system-containment.test.ts` smell).
42
+ * - Dependency injection at the adapter constructor makes the dependency
43
+ * explicit, scoped per-instance, and cross-platform by construction —
44
+ * tests don't depend on Vitest's mock machinery to swap the fs surface.
45
+ * - The interface is a `Pick` of `fsPromises` so production code can just
46
+ * pass the real module without writing any glue. Tests pass a fake
47
+ * object that satisfies the subset they exercise.
48
+ *
49
+ * @internal — not re-exported from `src/adapters/node/index.ts`.
50
+ */
51
+ type FsOperations = Pick<typeof fsPromises, 'appendFile' | 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
52
+
53
+ /**
54
+ * Path-policy abstraction.
55
+ *
56
+ * Encapsulates every platform-aware path operation the Node adapter needs.
57
+ * Production code uses `nativePolicy` (host-matching). Tests inject
58
+ * `windowsPolicy` or `posixPolicy` to simulate either platform on any host,
59
+ * eliminating the "host vs. simulated platform" confusion that was
60
+ * leaking into containment / cache / errno code paths.
61
+ *
62
+ * Design notes:
63
+ * - `sep` is the platform separator string, used for prefix containment.
64
+ * - `caseInsensitive` drives `normalizeForCompare`; Windows + macOS HFS+
65
+ * could share this in theory, but tsgit treats macOS as case-sensitive
66
+ * per Git's `core.ignorecase` default and POSIX convention.
67
+ * - `rootOf` returns the volume/drive prefix produced by `path.parse`.
68
+ * Examples: `/` on POSIX, `'C:\\'` on Windows, `'\\\\server\\share\\'`
69
+ * for UNC paths.
70
+ * - The interface is *only* the subset NodeFileSystem actually needs; we
71
+ * intentionally do not expose all of `nodePath`'s surface so callers
72
+ * can't smuggle host-bound calls back in.
73
+ */
74
+ interface PathPolicy {
75
+ readonly sep: '\\' | '/';
76
+ readonly caseInsensitive: boolean;
77
+ isAbsolute(path: string): boolean;
78
+ resolve(...parts: string[]): string;
79
+ join(...parts: string[]): string;
80
+ dirname(path: string): string;
81
+ basename(path: string): string;
82
+ /**
83
+ * Returns the volume/drive prefix produced by `path.parse(p).root`.
84
+ * POSIX: `/` for absolute, `''` for relative.
85
+ * Windows: `'C:\\'`, `'\\\\server\\share\\'`, or `''` for relative.
86
+ */
87
+ rootOf(path: string): string;
88
+ /** Case-fold on case-insensitive platforms; identity otherwise. */
89
+ normalizeForCompare(path: string): string;
90
+ }
91
+
28
92
  declare class NodeFileSystem implements FileSystem {
29
93
  private readonly rootDir;
30
- constructor(rootDir: string);
94
+ private readonly pathPolicy;
95
+ private readonly fsOps;
96
+ /**
97
+ * Memoised realpath of an *existing* parent directory, keyed by the raw
98
+ * (pre-realpath) parent path. Populated on every cache-miss inside
99
+ * `resolveForCreation` so a clone/checkout that writes N files into the
100
+ * same tree pays the realpath walk-up once per parent rather than once
101
+ * per file.
102
+ *
103
+ * Invariants:
104
+ * - Only EXISTING parents are cached. ENOENT walks fall back to
105
+ * `realpathNearestExisting` and are never recorded.
106
+ * - `rmRecursive` and `rename` clear the cache, which is correct (the
107
+ * parent realpath may have changed) and cheap (the cache holds at
108
+ * most a handful of small strings).
109
+ */
110
+ private readonly creationParentCache;
111
+ /**
112
+ * Lazy long-name canonicalisation of `rootDir` for containment checks.
113
+ * Promise so concurrent first calls share one `realpath`; cleared on
114
+ * rejection so a transient ENOENT can be retried.
115
+ */
116
+ private canonicalRootPromise;
117
+ /**
118
+ * Memoised result of `pathPolicy.normalizeForCompare(rootDir)`. The
119
+ * rootDir is `readonly` for the adapter's lifetime, so a single
120
+ * normalisation is amortised across every containment check.
121
+ */
122
+ private normalizedRootDir;
123
+ /**
124
+ * Memoised result of `pathPolicy.normalizeForCompare(canonicalRoot)`.
125
+ * Tracked alongside the canonical-root promise: when the promise
126
+ * resolves we cache the normalised form once. The promise's
127
+ * rejection-clears-cache rule means a transient ENOENT also clears
128
+ * this field (so the next call re-normalises against the retried
129
+ * canonical root).
130
+ */
131
+ private normalizedCanonicalRoot;
132
+ constructor(rootDir: string, pathPolicy?: PathPolicy, fsOps?: FsOperations);
133
+ private getNormalizedRootDir;
134
+ /**
135
+ * Returns the cached normalised canonical root. Caller must have
136
+ * `await this.getCanonicalRoot()` immediately prior — the cache is
137
+ * populated by the promise's success arm and cleared on rejection, so
138
+ * a successful `await` guarantees the field is set.
139
+ *
140
+ * Kept synchronous (vs `async` + `await this.getCanonicalRoot()`
141
+ * inside) so the hot path doesn't pay an extra microtask suspension
142
+ * per containment check on a settled promise. The `!` is the only
143
+ * machine-readable form of "trust the post-await invariant"; the
144
+ * private `await getCanonicalRoot()` discipline at every call site is
145
+ * what makes it safe.
146
+ */
147
+ private getResolvedNormalizedCanonicalRoot;
148
+ private getCanonicalRoot;
31
149
  read: (path: string) => Promise<Uint8Array>;
32
150
  readSlice: (path: string, offset: number, length: number) => Promise<Uint8Array>;
33
151
  readUtf8: (path: string) => Promise<string>;
34
152
  write: (path: string, data: Uint8Array) => Promise<void>;
35
153
  writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
36
154
  writeUtf8: (path: string, content: string) => Promise<void>;
155
+ appendUtf8: (path: string, content: string) => Promise<void>;
37
156
  exists: (path: string) => Promise<boolean>;
38
157
  stat: (path: string) => Promise<FileStat>;
39
158
  lstat: (path: string) => Promise<FileStat>;
@@ -46,8 +165,10 @@ declare class NodeFileSystem implements FileSystem {
46
165
  chmod: (path: string, mode: number) => Promise<void>;
47
166
  rmRecursive: (path: string) => Promise<void>;
48
167
  openWithNoFollow: (path: string, mode: "read" | "write") => Promise<FileHandle>;
168
+ private isSymlinkLeaf;
49
169
  private removeTree;
50
170
  private resolveForCreation;
171
+ private realpathForCreation;
51
172
  private resolveForMode;
52
173
  private checkContainment;
53
174
  }
@@ -62,6 +183,60 @@ declare class NodeHashService implements HashService {
62
183
  createHasher: () => Hasher;
63
184
  }
64
185
 
186
+ /** Minimal `stat` result `NodeHookRunner` consumes. */
187
+ interface HookStat {
188
+ readonly mode: number;
189
+ isFile(): boolean;
190
+ }
191
+ /** Minimal readable-stream surface — a hook's stdout / stderr. */
192
+ interface HookReadable {
193
+ on(event: 'data', listener: (chunk: Buffer) => void): void;
194
+ }
195
+ /** Minimal writable surface — a hook's stdin. */
196
+ interface HookWritable {
197
+ on(event: 'error', listener: () => void): void;
198
+ end(data: string): void;
199
+ }
200
+ /** Minimal child-process surface `NodeHookRunner` consumes. */
201
+ interface HookChild {
202
+ readonly stdout: HookReadable;
203
+ readonly stderr: HookReadable;
204
+ readonly stdin: HookWritable;
205
+ on(event: 'error', listener: (err: Error) => void): void;
206
+ on(event: 'close', listener: (code: number | null) => void): void;
207
+ kill(): void;
208
+ }
209
+ /**
210
+ * Injectable process / filesystem surface. Production uses the Node builtins;
211
+ * unit tests inject a fake so every branch is exercised deterministically
212
+ * without spawning a real process (mirrors `FsOperations` — ADR-047).
213
+ */
214
+ interface HookRunnerOps {
215
+ readonly stat: (path: string) => Promise<HookStat>;
216
+ readonly spawn: (command: string, args: ReadonlyArray<string>, options: {
217
+ readonly cwd: string;
218
+ readonly env: NodeJS.ProcessEnv;
219
+ }) => HookChild;
220
+ }
221
+ /**
222
+ * Node `HookRunner`: resolves `${hooksDir}/${name}` and, when it exists and is
223
+ * executable, spawns it via `node:child_process`. The hook inherits the
224
+ * process environment plus `GIT_DIR` / `GIT_INDEX_FILE`, runs with `cwd` at the
225
+ * working tree, and its output is captured (bounded). Never rejects for a
226
+ * non-zero exit.
227
+ */
228
+ declare class NodeHookRunner implements HookRunner {
229
+ private readonly isWindows;
230
+ private readonly ops;
231
+ constructor(platform?: NodeJS.Platform, ops?: HookRunnerOps);
232
+ run(request: HookRequest): Promise<HookResult>;
233
+ /**
234
+ * A hook is runnable when it is a regular file that is executable. Windows
235
+ * has no executable bit, so any regular file qualifies (see ADR-068).
236
+ */
237
+ private isRunnable;
238
+ }
239
+
65
240
  interface NodeHttpTransportOptions {
66
241
  readonly allowInsecureHttp?: boolean;
67
242
  }
@@ -71,5 +246,5 @@ declare class NodeHttpTransport implements HttpTransport {
71
246
  request: (req: HttpRequest) => Promise<HttpResponse>;
72
247
  }
73
248
 
74
- export { NodeCompressor, NodeFileSystem, NodeHashService, NodeHttpTransport, createNodeContext };
249
+ export { NodeCompressor, NodeFileSystem, NodeHashService, NodeHookRunner, NodeHttpTransport, createNodeContext };
75
250
  export type { NodeAdapterOptions, NodeHttpTransportOptions };