devbrain-cli 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/README.md +26 -26
  2. package/dist/bin.js +66 -4
  3. package/dist/commands/context.command.d.ts +2 -1
  4. package/dist/commands/context.command.js +42 -4
  5. package/dist/commands/history.command.d.ts +10 -0
  6. package/dist/commands/history.command.js +66 -0
  7. package/dist/commands/hook.command.d.ts +14 -0
  8. package/dist/commands/hook.command.js +40 -0
  9. package/dist/commands/init.command.d.ts +1 -0
  10. package/dist/commands/init.command.js +51 -15
  11. package/dist/commands/learn.command.d.ts +17 -4
  12. package/dist/commands/learn.command.js +266 -44
  13. package/dist/commands/search.command.d.ts +14 -0
  14. package/dist/commands/search.command.js +90 -0
  15. package/dist/commands/status.command.d.ts +12 -0
  16. package/dist/commands/status.command.js +82 -0
  17. package/dist/temp-prefix/devbrain +16 -0
  18. package/dist/temp-prefix/devbrain.cmd +17 -0
  19. package/dist/temp-prefix/devbrain.ps1 +28 -0
  20. package/dist/temp-prefix/node_modules/devbrain-cli/LICENSE +21 -0
  21. package/dist/temp-prefix/node_modules/devbrain-cli/README.md +26 -0
  22. package/dist/temp-prefix/node_modules/devbrain-cli/dist/bin.d.ts +2 -0
  23. package/dist/temp-prefix/node_modules/devbrain-cli/dist/bin.js +110 -0
  24. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/context.command.d.ts +17 -0
  25. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/context.command.js +74 -0
  26. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/history.command.d.ts +10 -0
  27. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/history.command.js +66 -0
  28. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/hook.command.d.ts +14 -0
  29. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/hook.command.js +40 -0
  30. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/init.command.d.ts +17 -0
  31. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/init.command.js +93 -0
  32. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/learn.command.d.ts +30 -0
  33. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/learn.command.js +294 -0
  34. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/search.command.d.ts +14 -0
  35. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/search.command.js +90 -0
  36. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/status.command.d.ts +12 -0
  37. package/dist/temp-prefix/node_modules/devbrain-cli/dist/commands/status.command.js +82 -0
  38. package/dist/temp-prefix/node_modules/devbrain-cli/dist/pipeline/command.pipeline.d.ts +28 -0
  39. package/dist/temp-prefix/node_modules/devbrain-cli/dist/pipeline/command.pipeline.js +65 -0
  40. package/dist/temp-prefix/node_modules/devbrain-cli/dist/ui/logger.d.ts +13 -0
  41. package/dist/temp-prefix/node_modules/devbrain-cli/dist/ui/logger.js +31 -0
  42. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/.bin/fxparser +16 -0
  43. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/.bin/fxparser.cmd +17 -0
  44. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/.bin/fxparser.ps1 +28 -0
  45. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzer.interface.d.ts +10 -0
  46. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzer.interface.js +2 -0
  47. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzer.registry.d.ts +20 -0
  48. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzer.registry.js +67 -0
  49. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/build-gradle.analyzer.d.ts +14 -0
  50. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/build-gradle.analyzer.js +53 -0
  51. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/docker.analyzer.d.ts +14 -0
  52. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/docker.analyzer.js +38 -0
  53. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/git.analyzer.d.ts +14 -0
  54. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/git.analyzer.js +54 -0
  55. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/package-json.analyzer.d.ts +14 -0
  56. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/package-json.analyzer.js +72 -0
  57. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/pom-xml.analyzer.d.ts +14 -0
  58. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/pom-xml.analyzer.js +70 -0
  59. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/readme.analyzer.d.ts +17 -0
  60. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/readme.analyzer.js +65 -0
  61. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/requirements-txt.analyzer.d.ts +14 -0
  62. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/requirements-txt.analyzer.js +62 -0
  63. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/source-code.analyzer.d.ts +24 -0
  64. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/source-code.analyzer.js +126 -0
  65. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/tsconfig.analyzer.d.ts +14 -0
  66. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/analyzers/tsconfig.analyzer.js +47 -0
  67. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/scanner.d.ts +21 -0
  68. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/analysis/scanner.js +81 -0
  69. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/context/context.service.d.ts +16 -0
  70. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/context/context.service.js +158 -0
  71. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/embeddings/EmbeddingProvider.d.ts +4 -0
  72. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/embeddings/EmbeddingProvider.js +2 -0
  73. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/embeddings/TransformersProvider.d.ts +9 -0
  74. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/embeddings/TransformersProvider.js +70 -0
  75. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/dependency.resolver.d.ts +12 -0
  76. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/dependency.resolver.js +101 -0
  77. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/history.manager.d.ts +24 -0
  78. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/history.manager.js +64 -0
  79. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/lock.manager.d.ts +21 -0
  80. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/lock.manager.js +89 -0
  81. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/logger.service.d.ts +16 -0
  82. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/logger.service.js +49 -0
  83. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/memory.engine.d.ts +30 -0
  84. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/engine/memory.engine.js +200 -0
  85. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/filesystem/filesystem.service.d.ts +29 -0
  86. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/filesystem/filesystem.service.js +87 -0
  87. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/git/git.service.d.ts +42 -0
  88. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/git/git.service.js +192 -0
  89. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index/SQLiteVectorStore.d.ts +19 -0
  90. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index/SQLiteVectorStore.js +189 -0
  91. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index/VectorIndexer.d.ts +20 -0
  92. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index/VectorIndexer.js +169 -0
  93. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index/VectorStore.d.ts +26 -0
  94. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index/VectorStore.js +2 -0
  95. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index.d.ts +29 -0
  96. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/index.js +29 -0
  97. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/memory/memory.service.d.ts +22 -0
  98. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/memory/memory.service.js +338 -0
  99. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/retrieval/ContextBuilder.d.ts +4 -0
  100. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/retrieval/ContextBuilder.js +107 -0
  101. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/retrieval/RankingEngine.d.ts +13 -0
  102. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/retrieval/RankingEngine.js +124 -0
  103. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/retrieval/SemanticRetriever.d.ts +17 -0
  104. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/dist/retrieval/SemanticRetriever.js +48 -0
  105. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/core/package.json +23 -0
  106. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/constants.d.ts +14 -0
  107. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/constants.js +24 -0
  108. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/errors.d.ts +38 -0
  109. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/errors.js +64 -0
  110. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/index.d.ts +3 -0
  111. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/index.js +4 -0
  112. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/types.d.ts +97 -0
  113. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/dist/types.js +2 -0
  114. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@devbrain/shared/package.json +14 -0
  115. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/CHANGELOG.md +12 -0
  116. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/LICENSE +20 -0
  117. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/index.d.ts +1 -0
  118. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/index.js +7 -0
  119. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/src/index.d.ts +19 -0
  120. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/src/index.js +55 -0
  121. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts +7 -0
  122. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js +26 -0
  123. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/test/exists.spec.d.ts +1 -0
  124. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/dist/test/exists.spec.js +77 -0
  125. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/package.json +42 -0
  126. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/file-exists/readme.md +41 -0
  127. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/promise-deferred/LICENSE +21 -0
  128. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/promise-deferred/dist/index.d.ts +49 -0
  129. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/promise-deferred/dist/index.js +59 -0
  130. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@kwsites/promise-deferred/package.json +43 -0
  131. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/README.md +41 -0
  132. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/package.json +57 -0
  133. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
  134. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/src/EntityEncoder.js +194 -0
  135. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/src/entities.js +1159 -0
  136. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/src/entityTries.js +49 -0
  137. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/src/index.d.ts +341 -0
  138. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodable/entities/src/index.js +29 -0
  139. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
  140. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/README.md +171 -0
  141. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  142. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
  143. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
  144. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
  145. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
  146. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
  147. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  148. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
  149. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
  150. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
  151. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
  152. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
  153. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  154. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
  155. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  156. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
  157. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
  158. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
  159. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
  160. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
  161. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.scandir/package.json +44 -0
  162. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/LICENSE +21 -0
  163. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/README.md +126 -0
  164. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  165. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
  166. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
  167. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/index.js +26 -0
  168. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  169. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
  170. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
  171. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
  172. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
  173. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
  174. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  175. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
  176. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.stat/package.json +37 -0
  177. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/LICENSE +21 -0
  178. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/README.md +215 -0
  179. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
  180. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/index.js +34 -0
  181. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  182. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
  183. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
  184. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
  185. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
  186. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
  187. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
  188. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
  189. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  190. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
  191. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
  192. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
  193. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  194. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
  195. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
  196. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
  197. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
  198. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
  199. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  200. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
  201. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@nodelib/fs.walk/package.json +44 -0
  202. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/args-pathspec/dist/index.cjs +2 -0
  203. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/args-pathspec/dist/index.d.ts +1 -0
  204. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/args-pathspec/dist/index.mjs +17 -0
  205. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/args-pathspec/dist/src/pathspec.d.ts +8 -0
  206. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/args-pathspec/package.json +32 -0
  207. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/index.cjs +2 -0
  208. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/index.d.ts +5 -0
  209. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/index.mjs +463 -0
  210. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/args/parse-argv.d.ts +6 -0
  211. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/args/parse-argv.types.d.ts +59 -0
  212. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/config/analyse-config.d.ts +3 -0
  213. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/config/config-operands.d.ts +4 -0
  214. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/config/config.types.d.ts +6 -0
  215. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/config/detect-config-action.d.ts +13 -0
  216. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/env/parse-env.d.ts +6 -0
  217. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/flags/flags.helpers.d.ts +9 -0
  218. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/flags/parse-global-flags.d.ts +6 -0
  219. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/flags/parse-task-flags.d.ts +8 -0
  220. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/tokens/flag-specs.d.ts +9 -0
  221. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/tokens/token-expander.d.ts +7 -0
  222. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/detect-vulnerable-config-writes.d.ts +3 -0
  223. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/detect-vulnerable-flags.d.ts +3 -0
  224. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability-analysis.d.ts +4 -0
  225. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability-check.d.ts +5 -0
  226. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability.types.d.ts +104 -0
  227. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/@simple-git/argv-parser/package.json +36 -0
  228. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ansi-regex/index.d.ts +33 -0
  229. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ansi-regex/index.js +14 -0
  230. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ansi-regex/license +9 -0
  231. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ansi-regex/package.json +61 -0
  232. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ansi-regex/readme.md +66 -0
  233. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/anynum/LICENSE +21 -0
  234. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/anynum/README.md +142 -0
  235. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/anynum/anynum.js +135 -0
  236. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/anynum/digitTable.js +116 -0
  237. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/anynum/package.json +42 -0
  238. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/LICENSE +21 -0
  239. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/README.md +586 -0
  240. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/index.js +170 -0
  241. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/lib/compile.js +60 -0
  242. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/lib/constants.js +57 -0
  243. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/lib/expand.js +113 -0
  244. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/lib/parse.js +331 -0
  245. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/lib/stringify.js +32 -0
  246. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/lib/utils.js +122 -0
  247. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/braces/package.json +77 -0
  248. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/license +9 -0
  249. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/package.json +83 -0
  250. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/readme.md +297 -0
  251. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/index.d.ts +325 -0
  252. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/index.js +225 -0
  253. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/utilities.js +33 -0
  254. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
  255. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
  256. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
  257. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
  258. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
  259. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
  260. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-cursor/index.d.ts +47 -0
  261. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-cursor/index.js +39 -0
  262. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-cursor/license +9 -0
  263. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-cursor/package.json +56 -0
  264. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-cursor/readme.md +39 -0
  265. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-spinners/index.d.ts +128 -0
  266. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-spinners/index.js +15 -0
  267. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-spinners/license +9 -0
  268. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-spinners/package.json +50 -0
  269. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-spinners/readme.md +54 -0
  270. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/cli-spinners/spinners.json +1622 -0
  271. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/LICENSE +22 -0
  272. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/Readme.md +1157 -0
  273. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/esm.mjs +16 -0
  274. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/index.js +24 -0
  275. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/lib/argument.js +149 -0
  276. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/lib/command.js +2509 -0
  277. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/lib/error.js +39 -0
  278. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/lib/help.js +520 -0
  279. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/lib/option.js +330 -0
  280. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/lib/suggestSimilar.js +101 -0
  281. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/package-support.json +16 -0
  282. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/package.json +84 -0
  283. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/typings/esm.d.mts +3 -0
  284. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/commander/typings/index.d.ts +969 -0
  285. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/LICENSE +20 -0
  286. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/README.md +481 -0
  287. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/package.json +64 -0
  288. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/src/browser.js +272 -0
  289. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/src/common.js +292 -0
  290. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/src/index.js +10 -0
  291. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/debug/src/node.js +263 -0
  292. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
  293. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/emoji-regex/README.md +107 -0
  294. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/emoji-regex/index.d.ts +3 -0
  295. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/emoji-regex/index.js +4 -0
  296. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/emoji-regex/index.mjs +4 -0
  297. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/emoji-regex/package.json +45 -0
  298. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/LICENSE +21 -0
  299. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/README.md +830 -0
  300. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/index.d.ts +40 -0
  301. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/index.js +102 -0
  302. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
  303. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/managers/tasks.js +110 -0
  304. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/async.d.ts +9 -0
  305. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/async.js +23 -0
  306. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
  307. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
  308. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
  309. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
  310. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
  311. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/filters/error.js +15 -0
  312. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
  313. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
  314. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
  315. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
  316. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
  317. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/provider.js +48 -0
  318. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
  319. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/stream.js +31 -0
  320. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
  321. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/sync.js +23 -0
  322. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
  323. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
  324. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/async.d.ts +10 -0
  325. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/async.js +35 -0
  326. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
  327. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/reader.js +33 -0
  328. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
  329. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/stream.js +55 -0
  330. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
  331. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/readers/sync.js +43 -0
  332. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/settings.d.ts +164 -0
  333. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/settings.js +59 -0
  334. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/types/index.d.ts +31 -0
  335. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/types/index.js +2 -0
  336. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/array.d.ts +2 -0
  337. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/array.js +22 -0
  338. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
  339. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/errno.js +7 -0
  340. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
  341. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/fs.js +19 -0
  342. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/index.d.ts +8 -0
  343. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/index.js +17 -0
  344. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/path.d.ts +13 -0
  345. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/path.js +68 -0
  346. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
  347. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/pattern.js +206 -0
  348. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
  349. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/stream.js +17 -0
  350. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/string.d.ts +2 -0
  351. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/out/utils/string.js +11 -0
  352. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-glob/package.json +81 -0
  353. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/CHANGELOG.md +40 -0
  354. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/LICENSE +21 -0
  355. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/README.md +74 -0
  356. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  357. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
  358. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  359. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/package.json +81 -0
  360. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
  361. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/src/fxb.js +599 -0
  362. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  363. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/src/orderedJs2Xml.js +359 -0
  364. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  365. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-builder/src/util.js +16 -0
  366. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/CHANGELOG.md +852 -0
  367. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/LICENSE +21 -0
  368. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/README.md +200 -0
  369. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  370. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  371. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/lib/fxp.d.cts +772 -0
  372. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  373. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  374. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  375. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/package.json +93 -0
  376. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
  377. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/cli/man.js +17 -0
  378. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/cli/read.js +43 -0
  379. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/fxp.d.ts +752 -0
  380. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/fxp.js +14 -0
  381. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
  382. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/util.js +61 -0
  383. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
  384. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
  385. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
  386. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
  387. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
  388. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
  389. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
  390. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
  391. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  392. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
  393. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
  394. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
  395. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
  396. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
  397. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
  398. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
  399. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
  400. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
  401. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
  402. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
  403. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
  404. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
  405. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
  406. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
  407. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/validator.js +425 -0
  408. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
  409. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +411 -0
  410. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
  411. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +846 -0
  412. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +71 -0
  413. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
  414. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +40 -0
  415. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/LICENSE +13 -0
  416. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/README.md +310 -0
  417. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/SECURITY.md +15 -0
  418. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/bench.js +66 -0
  419. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/eslint.config.js +11 -0
  420. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/example.js +14 -0
  421. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/example.mjs +9 -0
  422. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/index.d.ts +59 -0
  423. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/package.json +49 -0
  424. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/queue.js +346 -0
  425. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/test/example.ts +83 -0
  426. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/test/promise.js +325 -0
  427. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/test/test.js +733 -0
  428. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fastq/test/tsconfig.json +11 -0
  429. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fill-range/LICENSE +21 -0
  430. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fill-range/README.md +237 -0
  431. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fill-range/index.js +248 -0
  432. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/fill-range/package.json +74 -0
  433. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/index.d.ts +60 -0
  434. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/index.js +30 -0
  435. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/license +9 -0
  436. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/lookup-data.js +21 -0
  437. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/lookup.js +138 -0
  438. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/package.json +71 -0
  439. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/readme.md +65 -0
  440. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/get-east-asian-width/utilities.js +24 -0
  441. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/glob-parent/CHANGELOG.md +110 -0
  442. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/glob-parent/LICENSE +15 -0
  443. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/glob-parent/README.md +137 -0
  444. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/glob-parent/index.js +42 -0
  445. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/glob-parent/package.json +48 -0
  446. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-extglob/LICENSE +21 -0
  447. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-extglob/README.md +107 -0
  448. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-extglob/index.js +20 -0
  449. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-extglob/package.json +69 -0
  450. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-glob/LICENSE +21 -0
  451. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-glob/README.md +206 -0
  452. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-glob/index.js +150 -0
  453. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-glob/package.json +81 -0
  454. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-interactive/index.d.ts +25 -0
  455. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-interactive/index.js +7 -0
  456. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-interactive/license +9 -0
  457. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-interactive/package.json +41 -0
  458. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-interactive/readme.md +52 -0
  459. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-number/LICENSE +21 -0
  460. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-number/README.md +187 -0
  461. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-number/index.js +18 -0
  462. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-number/package.json +82 -0
  463. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unicode-supported/index.d.ts +12 -0
  464. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unicode-supported/index.js +21 -0
  465. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unicode-supported/license +9 -0
  466. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unicode-supported/package.json +47 -0
  467. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unicode-supported/readme.md +35 -0
  468. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/LICENSE +21 -0
  469. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/README.md +528 -0
  470. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/package.json +48 -0
  471. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/html.js +102 -0
  472. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/log.js +98 -0
  473. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
  474. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/redos.js +60 -0
  475. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/shell.js +105 -0
  476. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
  477. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/sql.js +95 -0
  478. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/svg.js +81 -0
  479. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/contexts/xml.js +78 -0
  480. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/index.cjs +27 -0
  481. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/index.d.ts +28 -0
  482. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/index.js +204 -0
  483. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/is-unsafe/src/registry.js +45 -0
  484. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/browser.js +8 -0
  485. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/index.d.ts +22 -0
  486. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/index.js +20 -0
  487. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/license +9 -0
  488. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/node_modules/is-unicode-supported/index.d.ts +12 -0
  489. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/node_modules/is-unicode-supported/index.js +17 -0
  490. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/node_modules/is-unicode-supported/license +9 -0
  491. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/node_modules/is-unicode-supported/package.json +43 -0
  492. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/node_modules/is-unicode-supported/readme.md +35 -0
  493. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/package.json +57 -0
  494. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/log-symbols/readme.md +39 -0
  495. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/merge2/LICENSE +21 -0
  496. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/merge2/README.md +144 -0
  497. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/merge2/index.js +144 -0
  498. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/merge2/package.json +43 -0
  499. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/micromatch/LICENSE +21 -0
  500. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/micromatch/README.md +1024 -0
  501. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/micromatch/index.js +474 -0
  502. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/micromatch/package.json +119 -0
  503. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/mimic-function/index.d.ts +52 -0
  504. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/mimic-function/index.js +72 -0
  505. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/mimic-function/license +9 -0
  506. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/mimic-function/package.json +49 -0
  507. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/mimic-function/readme.md +80 -0
  508. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ms/index.js +162 -0
  509. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ms/license.md +21 -0
  510. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ms/package.json +38 -0
  511. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ms/readme.md +59 -0
  512. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/onetime/index.d.ts +59 -0
  513. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/onetime/index.js +41 -0
  514. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/onetime/license +9 -0
  515. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/onetime/package.json +49 -0
  516. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/onetime/readme.md +88 -0
  517. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ora/index.d.ts +332 -0
  518. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ora/index.js +424 -0
  519. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ora/license +9 -0
  520. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ora/package.json +64 -0
  521. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/ora/readme.md +329 -0
  522. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/LICENSE +21 -0
  523. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/README.md +947 -0
  524. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  525. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
  526. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  527. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/package.json +79 -0
  528. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/src/Expression.js +232 -0
  529. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
  530. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/src/Matcher.js +660 -0
  531. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/src/index.d.ts +589 -0
  532. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/path-expression-matcher/src/index.js +30 -0
  533. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/LICENSE +21 -0
  534. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/README.md +716 -0
  535. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/index.js +3 -0
  536. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/lib/constants.js +184 -0
  537. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/lib/parse.js +1392 -0
  538. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/lib/picomatch.js +342 -0
  539. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/lib/scan.js +391 -0
  540. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/lib/utils.js +64 -0
  541. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/picomatch/package.json +81 -0
  542. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/queue-microtask/LICENSE +20 -0
  543. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/queue-microtask/README.md +90 -0
  544. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/queue-microtask/index.d.ts +2 -0
  545. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/queue-microtask/index.js +9 -0
  546. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/queue-microtask/package.json +55 -0
  547. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/restore-cursor/index.d.ts +15 -0
  548. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/restore-cursor/index.js +15 -0
  549. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/restore-cursor/license +9 -0
  550. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/restore-cursor/package.json +57 -0
  551. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/restore-cursor/readme.md +21 -0
  552. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/.github/dependabot.yml +7 -0
  553. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/.github/workflows/ci.yml +96 -0
  554. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/LICENSE +22 -0
  555. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/README.md +139 -0
  556. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/SECURITY.md +15 -0
  557. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
  558. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/benchmarks/fib.js +13 -0
  559. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
  560. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/eslint.config.js +14 -0
  561. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/package.json +50 -0
  562. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/reusify.d.ts +14 -0
  563. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/reusify.js +33 -0
  564. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/test.js +66 -0
  565. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/reusify/tsconfig.json +11 -0
  566. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/run-parallel/LICENSE +20 -0
  567. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/run-parallel/README.md +85 -0
  568. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/run-parallel/index.js +51 -0
  569. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/run-parallel/package.json +58 -0
  570. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/LICENSE.txt +16 -0
  571. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/README.md +74 -0
  572. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
  573. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/browser.js +10 -0
  574. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
  575. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/index.js +279 -0
  576. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/package.json +3 -0
  577. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
  578. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/cjs/signals.js +42 -0
  579. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
  580. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/browser.js +4 -0
  581. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
  582. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/index.js +275 -0
  583. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/package.json +3 -0
  584. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
  585. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/dist/mjs/signals.js +39 -0
  586. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/signal-exit/package.json +106 -0
  587. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/cjs/index.js +4898 -0
  588. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/esm/index.js +4745 -0
  589. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/esm/package.json +3 -0
  590. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/api.d.ts +13 -0
  591. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
  592. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/errors/git-construct-error.d.ts +15 -0
  593. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/errors/git-error.d.ts +30 -0
  594. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
  595. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/errors/git-response-error.d.ts +32 -0
  596. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/errors/task-configuration-error.d.ts +12 -0
  597. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
  598. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/git-logger.d.ts +21 -0
  599. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-branch-delete.d.ts +5 -0
  600. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +2 -0
  601. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-commit.d.ts +2 -0
  602. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
  603. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-fetch.d.ts +2 -0
  604. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-list-log-summary.d.ts +6 -0
  605. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-merge.d.ts +11 -0
  606. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-move.d.ts +2 -0
  607. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-pull.d.ts +6 -0
  608. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-push.d.ts +4 -0
  609. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-remote-messages.d.ts +5 -0
  610. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/parsers/parse-remote-objects.d.ts +3 -0
  611. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
  612. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
  613. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/command-config-prefixing-plugin.d.ts +2 -0
  614. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/completion-detection.plugin.d.ts +3 -0
  615. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
  616. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +7 -0
  617. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/index.d.ts +11 -0
  618. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
  619. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/progress-monitor-plugin.d.ts +3 -0
  620. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +48 -0
  621. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +3 -0
  622. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
  623. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
  624. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/BranchDeleteSummary.d.ts +12 -0
  625. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
  626. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/CheckIgnore.d.ts +4 -0
  627. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/CleanSummary.d.ts +9 -0
  628. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/ConfigList.d.ts +13 -0
  629. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/DiffSummary.d.ts +10 -0
  630. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/FileStatusSummary.d.ts +9 -0
  631. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/GetRemoteSummary.d.ts +11 -0
  632. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/InitSummary.d.ts +9 -0
  633. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/MergeSummary.d.ts +16 -0
  634. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
  635. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/StatusSummary.d.ts +19 -0
  636. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/responses/TagList.d.ts +7 -0
  637. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/runners/git-executor-chain.d.ts +25 -0
  638. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/runners/git-executor.d.ts +14 -0
  639. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/runners/promise-wrapped.d.ts +2 -0
  640. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +11 -0
  641. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +23 -0
  642. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/simple-git-api.d.ts +20 -0
  643. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/task-callback.d.ts +2 -0
  644. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +3 -0
  645. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/branch.d.ts +7 -0
  646. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/change-working-directory.d.ts +2 -0
  647. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/check-ignore.d.ts +2 -0
  648. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/check-is-repo.d.ts +9 -0
  649. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
  650. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +25 -0
  651. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +9 -0
  652. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
  653. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/config.d.ts +8 -0
  654. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
  655. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
  656. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
  657. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/fetch.d.ts +4 -0
  658. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
  659. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/grep.d.ts +12 -0
  660. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/hash-object.d.ts +5 -0
  661. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/init.d.ts +3 -0
  662. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +32 -0
  663. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/merge.d.ts +4 -0
  664. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/move.d.ts +3 -0
  665. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/pull.d.ts +3 -0
  666. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +9 -0
  667. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +8 -0
  668. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +11 -0
  669. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
  670. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
  671. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/status.d.ts +3 -0
  672. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/sub-module.d.ts +5 -0
  673. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/tag.d.ts +18 -0
  674. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +14 -0
  675. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
  676. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +21 -0
  677. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/types/index.d.ts +136 -0
  678. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +19 -0
  679. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +14 -0
  680. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/exit-codes.d.ts +10 -0
  681. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +7 -0
  682. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/index.d.ts +8 -0
  683. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +15 -0
  684. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/simple-git-options.d.ts +2 -0
  685. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +13 -0
  686. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/task-parser.d.ts +5 -0
  687. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/src/lib/utils/util.d.ts +47 -0
  688. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/typings/errors.d.ts +5 -0
  689. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/typings/index.d.ts +14 -0
  690. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/typings/response.d.ts +556 -0
  691. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/typings/simple-git.d.ts +1033 -0
  692. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/dist/typings/types.d.ts +22 -0
  693. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/package.json +51 -0
  694. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/promise.js +17 -0
  695. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/simple-git/readme.md +851 -0
  696. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/stdin-discarder/index.d.ts +13 -0
  697. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/stdin-discarder/index.js +59 -0
  698. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/stdin-discarder/license +9 -0
  699. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/stdin-discarder/package.json +42 -0
  700. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/stdin-discarder/readme.md +37 -0
  701. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/string-width/index.d.ts +39 -0
  702. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/string-width/index.js +82 -0
  703. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/string-width/license +9 -0
  704. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/string-width/package.json +64 -0
  705. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/string-width/readme.md +66 -0
  706. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strip-ansi/index.d.ts +15 -0
  707. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strip-ansi/index.js +19 -0
  708. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strip-ansi/license +9 -0
  709. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strip-ansi/package.json +59 -0
  710. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strip-ansi/readme.md +37 -0
  711. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strnum/CHANGELOG.md +51 -0
  712. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strnum/LICENSE +21 -0
  713. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strnum/README.md +113 -0
  714. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strnum/package.json +36 -0
  715. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/strnum/strnum.js +171 -0
  716. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/to-regex-range/LICENSE +21 -0
  717. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/to-regex-range/README.md +305 -0
  718. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/to-regex-range/index.js +288 -0
  719. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/to-regex-range/package.json +88 -0
  720. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/xml-naming/README.md +189 -0
  721. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/xml-naming/package.json +54 -0
  722. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/xml-naming/src/index.d.ts +74 -0
  723. package/dist/temp-prefix/node_modules/devbrain-cli/node_modules/xml-naming/src/index.js +270 -0
  724. package/dist/temp-prefix/node_modules/devbrain-cli/package.json +66 -0
  725. package/node_modules/@devbrain/core/dist/analysis/analyzers/source-code.analyzer.d.ts +24 -0
  726. package/node_modules/@devbrain/core/dist/analysis/analyzers/source-code.analyzer.js +126 -0
  727. package/node_modules/@devbrain/core/dist/context/context.service.d.ts +6 -7
  728. package/node_modules/@devbrain/core/dist/context/context.service.js +102 -16
  729. package/node_modules/@devbrain/core/dist/embeddings/EmbeddingProvider.d.ts +4 -0
  730. package/node_modules/@devbrain/core/dist/embeddings/EmbeddingProvider.js +2 -0
  731. package/node_modules/@devbrain/core/dist/embeddings/TransformersProvider.d.ts +9 -0
  732. package/node_modules/@devbrain/core/dist/embeddings/TransformersProvider.js +70 -0
  733. package/node_modules/@devbrain/core/dist/engine/dependency.resolver.d.ts +12 -0
  734. package/node_modules/@devbrain/core/dist/engine/dependency.resolver.js +101 -0
  735. package/node_modules/@devbrain/core/dist/engine/history.manager.d.ts +24 -0
  736. package/node_modules/@devbrain/core/dist/engine/history.manager.js +64 -0
  737. package/node_modules/@devbrain/core/dist/engine/lock.manager.d.ts +21 -0
  738. package/node_modules/@devbrain/core/dist/engine/lock.manager.js +89 -0
  739. package/node_modules/@devbrain/core/dist/engine/logger.service.d.ts +16 -0
  740. package/node_modules/@devbrain/core/dist/engine/logger.service.js +49 -0
  741. package/node_modules/@devbrain/core/dist/engine/memory.engine.d.ts +30 -0
  742. package/node_modules/@devbrain/core/dist/engine/memory.engine.js +200 -0
  743. package/node_modules/@devbrain/core/dist/git/git.service.d.ts +42 -0
  744. package/node_modules/@devbrain/core/dist/git/git.service.js +192 -0
  745. package/node_modules/@devbrain/core/dist/index/SQLiteVectorStore.d.ts +19 -0
  746. package/node_modules/@devbrain/core/dist/index/SQLiteVectorStore.js +189 -0
  747. package/node_modules/@devbrain/core/dist/index/VectorIndexer.d.ts +20 -0
  748. package/node_modules/@devbrain/core/dist/index/VectorIndexer.js +169 -0
  749. package/node_modules/@devbrain/core/dist/index/VectorStore.d.ts +26 -0
  750. package/node_modules/@devbrain/core/dist/index/VectorStore.js +2 -0
  751. package/node_modules/@devbrain/core/dist/index.d.ts +15 -0
  752. package/node_modules/@devbrain/core/dist/index.js +13 -0
  753. package/node_modules/@devbrain/core/dist/memory/memory.service.d.ts +6 -3
  754. package/node_modules/@devbrain/core/dist/memory/memory.service.js +186 -6
  755. package/node_modules/@devbrain/core/dist/retrieval/ContextBuilder.d.ts +4 -0
  756. package/node_modules/@devbrain/core/dist/retrieval/ContextBuilder.js +107 -0
  757. package/node_modules/@devbrain/core/dist/retrieval/RankingEngine.d.ts +13 -0
  758. package/node_modules/@devbrain/core/dist/retrieval/RankingEngine.js +124 -0
  759. package/node_modules/@devbrain/core/dist/retrieval/SemanticRetriever.d.ts +17 -0
  760. package/node_modules/@devbrain/core/dist/retrieval/SemanticRetriever.js +48 -0
  761. package/node_modules/@devbrain/core/package.json +23 -22
  762. package/node_modules/@devbrain/shared/dist/constants.d.ts +10 -2
  763. package/node_modules/@devbrain/shared/dist/constants.js +11 -2
  764. package/node_modules/@devbrain/shared/dist/types.d.ts +45 -0
  765. package/node_modules/@devbrain/shared/package.json +14 -14
  766. package/package.json +66 -65
@@ -0,0 +1,4898 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function __require() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
+ mod
33
+ ));
34
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+
36
+ // src/lib/errors/git-error.ts
37
+ var GitError;
38
+ var init_git_error = __esm({
39
+ "src/lib/errors/git-error.ts"() {
40
+ "use strict";
41
+ GitError = class extends Error {
42
+ constructor(task, message) {
43
+ super(message);
44
+ this.task = task;
45
+ Object.setPrototypeOf(this, new.target.prototype);
46
+ }
47
+ };
48
+ }
49
+ });
50
+
51
+ // src/lib/errors/git-response-error.ts
52
+ var GitResponseError;
53
+ var init_git_response_error = __esm({
54
+ "src/lib/errors/git-response-error.ts"() {
55
+ "use strict";
56
+ init_git_error();
57
+ GitResponseError = class extends GitError {
58
+ constructor(git, message) {
59
+ super(void 0, message || String(git));
60
+ this.git = git;
61
+ }
62
+ };
63
+ }
64
+ });
65
+
66
+ // src/lib/errors/git-construct-error.ts
67
+ var GitConstructError;
68
+ var init_git_construct_error = __esm({
69
+ "src/lib/errors/git-construct-error.ts"() {
70
+ "use strict";
71
+ init_git_error();
72
+ GitConstructError = class extends GitError {
73
+ constructor(config, message) {
74
+ super(void 0, message);
75
+ this.config = config;
76
+ }
77
+ };
78
+ }
79
+ });
80
+
81
+ // src/lib/errors/git-plugin-error.ts
82
+ var GitPluginError;
83
+ var init_git_plugin_error = __esm({
84
+ "src/lib/errors/git-plugin-error.ts"() {
85
+ "use strict";
86
+ init_git_error();
87
+ GitPluginError = class extends GitError {
88
+ constructor(task, plugin, message) {
89
+ super(task, message);
90
+ this.task = task;
91
+ this.plugin = plugin;
92
+ Object.setPrototypeOf(this, new.target.prototype);
93
+ }
94
+ };
95
+ }
96
+ });
97
+
98
+ // src/lib/errors/task-configuration-error.ts
99
+ var TaskConfigurationError;
100
+ var init_task_configuration_error = __esm({
101
+ "src/lib/errors/task-configuration-error.ts"() {
102
+ "use strict";
103
+ init_git_error();
104
+ TaskConfigurationError = class extends GitError {
105
+ constructor(message) {
106
+ super(void 0, message);
107
+ }
108
+ };
109
+ }
110
+ });
111
+
112
+ // src/lib/utils/util.ts
113
+ function asFunction(source) {
114
+ if (typeof source !== "function") {
115
+ return NOOP;
116
+ }
117
+ return source;
118
+ }
119
+ function isUserFunction(source) {
120
+ return typeof source === "function" && source !== NOOP;
121
+ }
122
+ function splitOn(input, char) {
123
+ const index = input.indexOf(char);
124
+ if (index <= 0) {
125
+ return [input, ""];
126
+ }
127
+ return [input.substr(0, index), input.substr(index + 1)];
128
+ }
129
+ function first(input, offset = 0) {
130
+ return isArrayLike(input) && input.length > offset ? input[offset] : void 0;
131
+ }
132
+ function last(input, offset = 0) {
133
+ if (isArrayLike(input) && input.length > offset) {
134
+ return input[input.length - 1 - offset];
135
+ }
136
+ }
137
+ function isArrayLike(input) {
138
+ return filterHasLength(input);
139
+ }
140
+ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
141
+ return input.split(separator).reduce((output, line) => {
142
+ const lineContent = trimmed2 ? line.trim() : line;
143
+ if (lineContent) {
144
+ output.push(lineContent);
145
+ }
146
+ return output;
147
+ }, []);
148
+ }
149
+ function forEachLineWithContent(input, callback) {
150
+ return toLinesWithContent(input, true).map((line) => callback(line));
151
+ }
152
+ function folderExists(path) {
153
+ return (0, import_file_exists.exists)(path, import_file_exists.FOLDER);
154
+ }
155
+ function append(target, item) {
156
+ if (Array.isArray(target)) {
157
+ if (!target.includes(item)) {
158
+ target.push(item);
159
+ }
160
+ } else {
161
+ target.add(item);
162
+ }
163
+ return item;
164
+ }
165
+ function including(target, item) {
166
+ if (Array.isArray(target) && !target.includes(item)) {
167
+ target.push(item);
168
+ }
169
+ return target;
170
+ }
171
+ function remove(target, item) {
172
+ if (Array.isArray(target)) {
173
+ const index = target.indexOf(item);
174
+ if (index >= 0) {
175
+ target.splice(index, 1);
176
+ }
177
+ } else {
178
+ target.delete(item);
179
+ }
180
+ return item;
181
+ }
182
+ function asArray(source) {
183
+ return Array.isArray(source) ? source : [source];
184
+ }
185
+ function asCamelCase(str) {
186
+ return str.replace(/[\s-]+(.)/g, (_all, chr) => {
187
+ return chr.toUpperCase();
188
+ });
189
+ }
190
+ function asStringArray(source) {
191
+ return asArray(source).map((item) => {
192
+ return item instanceof String ? item : String(item);
193
+ });
194
+ }
195
+ function asNumber(source, onNaN = 0) {
196
+ if (source == null) {
197
+ return onNaN;
198
+ }
199
+ const num = parseInt(source, 10);
200
+ return Number.isNaN(num) ? onNaN : num;
201
+ }
202
+ function prefixedArray(input, prefix) {
203
+ const output = [];
204
+ for (let i = 0, max = input.length; i < max; i++) {
205
+ output.push(prefix, input[i]);
206
+ }
207
+ return output;
208
+ }
209
+ function bufferToString(input) {
210
+ return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
211
+ }
212
+ function pick(source, properties) {
213
+ const out = {};
214
+ properties.forEach((key) => {
215
+ if (source[key] !== void 0) {
216
+ out[key] = source[key];
217
+ }
218
+ });
219
+ return out;
220
+ }
221
+ function delay(duration = 0) {
222
+ return new Promise((done) => setTimeout(done, duration));
223
+ }
224
+ function orVoid(input) {
225
+ if (input === false) {
226
+ return void 0;
227
+ }
228
+ return input;
229
+ }
230
+ var import_file_exists, NULL, NOOP, objectToString;
231
+ var init_util = __esm({
232
+ "src/lib/utils/util.ts"() {
233
+ "use strict";
234
+ import_file_exists = require("@kwsites/file-exists");
235
+ init_argument_filters();
236
+ NULL = "\0";
237
+ NOOP = () => {
238
+ };
239
+ objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);
240
+ }
241
+ });
242
+
243
+ // src/lib/utils/argument-filters.ts
244
+ function filterType(input, filter, def) {
245
+ if (filter(input)) {
246
+ return input;
247
+ }
248
+ return arguments.length > 2 ? def : void 0;
249
+ }
250
+ function filterPrimitives(input, omit) {
251
+ const type = (0, import_args_pathspec.isPathSpec)(input) ? "string" : typeof input;
252
+ return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
253
+ }
254
+ function filterPlainObject(input) {
255
+ return !!input && objectToString(input) === "[object Object]";
256
+ }
257
+ function filterFunction(input) {
258
+ return typeof input === "function";
259
+ }
260
+ var import_args_pathspec, filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;
261
+ var init_argument_filters = __esm({
262
+ "src/lib/utils/argument-filters.ts"() {
263
+ "use strict";
264
+ import_args_pathspec = require("@simple-git/args-pathspec");
265
+ init_util();
266
+ filterArray = (input) => {
267
+ return Array.isArray(input);
268
+ };
269
+ filterNumber = (input) => {
270
+ return typeof input === "number";
271
+ };
272
+ filterString = (input) => {
273
+ return typeof input === "string" || (0, import_args_pathspec.isPathSpec)(input);
274
+ };
275
+ filterStringOrStringArray = (input) => {
276
+ return filterString(input) || Array.isArray(input) && input.every(filterString);
277
+ };
278
+ filterHasLength = (input) => {
279
+ if (input == null || "number|boolean|function".includes(typeof input)) {
280
+ return false;
281
+ }
282
+ return typeof input.length === "number";
283
+ };
284
+ }
285
+ });
286
+
287
+ // src/lib/utils/exit-codes.ts
288
+ var ExitCodes;
289
+ var init_exit_codes = __esm({
290
+ "src/lib/utils/exit-codes.ts"() {
291
+ "use strict";
292
+ ExitCodes = /* @__PURE__ */ ((ExitCodes2) => {
293
+ ExitCodes2[ExitCodes2["SUCCESS"] = 0] = "SUCCESS";
294
+ ExitCodes2[ExitCodes2["ERROR"] = 1] = "ERROR";
295
+ ExitCodes2[ExitCodes2["NOT_FOUND"] = -2] = "NOT_FOUND";
296
+ ExitCodes2[ExitCodes2["UNCLEAN"] = 128] = "UNCLEAN";
297
+ return ExitCodes2;
298
+ })(ExitCodes || {});
299
+ }
300
+ });
301
+
302
+ // src/lib/utils/git-output-streams.ts
303
+ var GitOutputStreams;
304
+ var init_git_output_streams = __esm({
305
+ "src/lib/utils/git-output-streams.ts"() {
306
+ "use strict";
307
+ GitOutputStreams = class _GitOutputStreams {
308
+ constructor(stdOut, stdErr) {
309
+ this.stdOut = stdOut;
310
+ this.stdErr = stdErr;
311
+ }
312
+ asStrings() {
313
+ return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
314
+ }
315
+ };
316
+ }
317
+ });
318
+
319
+ // src/lib/utils/line-parser.ts
320
+ function useMatchesDefault() {
321
+ throw new Error(`LineParser:useMatches not implemented`);
322
+ }
323
+ var LineParser, RemoteLineParser;
324
+ var init_line_parser = __esm({
325
+ "src/lib/utils/line-parser.ts"() {
326
+ "use strict";
327
+ LineParser = class {
328
+ constructor(regExp, useMatches) {
329
+ this.matches = [];
330
+ this.useMatches = useMatchesDefault;
331
+ this.parse = (line, target) => {
332
+ this.resetMatches();
333
+ if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
334
+ return false;
335
+ }
336
+ return this.useMatches(target, this.prepareMatches()) !== false;
337
+ };
338
+ this._regExp = Array.isArray(regExp) ? regExp : [regExp];
339
+ if (useMatches) {
340
+ this.useMatches = useMatches;
341
+ }
342
+ }
343
+ resetMatches() {
344
+ this.matches.length = 0;
345
+ }
346
+ prepareMatches() {
347
+ return this.matches;
348
+ }
349
+ addMatch(reg, index, line) {
350
+ const matched = line && reg.exec(line);
351
+ if (matched) {
352
+ this.pushMatch(index, matched);
353
+ }
354
+ return !!matched;
355
+ }
356
+ pushMatch(_index, matched) {
357
+ this.matches.push(...matched.slice(1));
358
+ }
359
+ };
360
+ RemoteLineParser = class extends LineParser {
361
+ addMatch(reg, index, line) {
362
+ return /^remote:\s/.test(String(line)) && super.addMatch(reg, index, line);
363
+ }
364
+ pushMatch(index, matched) {
365
+ if (index > 0 || matched.length > 1) {
366
+ super.pushMatch(index, matched);
367
+ }
368
+ }
369
+ };
370
+ }
371
+ });
372
+
373
+ // src/lib/utils/simple-git-options.ts
374
+ function createInstanceConfig(...options) {
375
+ const baseDir = process.cwd();
376
+ const config = Object.assign(
377
+ { baseDir, ...defaultOptions },
378
+ ...options.filter((o) => typeof o === "object" && o)
379
+ );
380
+ config.baseDir = config.baseDir || baseDir;
381
+ config.trimmed = config.trimmed === true;
382
+ return config;
383
+ }
384
+ var defaultOptions;
385
+ var init_simple_git_options = __esm({
386
+ "src/lib/utils/simple-git-options.ts"() {
387
+ "use strict";
388
+ defaultOptions = {
389
+ binary: "git",
390
+ maxConcurrentProcesses: 5,
391
+ config: [],
392
+ trimmed: false
393
+ };
394
+ }
395
+ });
396
+
397
+ // src/lib/utils/task-options.ts
398
+ function appendTaskOptions(options, commands = []) {
399
+ if (!filterPlainObject(options)) {
400
+ return commands;
401
+ }
402
+ return Object.keys(options).reduce((commands2, key) => {
403
+ const value = options[key];
404
+ if ((0, import_args_pathspec2.isPathSpec)(value)) {
405
+ commands2.push(value);
406
+ } else if (filterPrimitives(value, ["boolean"])) {
407
+ commands2.push(key + "=" + value);
408
+ } else if (Array.isArray(value)) {
409
+ for (const v of value) {
410
+ if (!filterPrimitives(v, ["string", "number"])) {
411
+ commands2.push(key + "=" + v);
412
+ }
413
+ }
414
+ } else {
415
+ commands2.push(key);
416
+ }
417
+ return commands2;
418
+ }, commands);
419
+ }
420
+ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
421
+ const command = [];
422
+ for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {
423
+ if ("string|number".includes(typeof args[i])) {
424
+ command.push(String(args[i]));
425
+ }
426
+ }
427
+ appendTaskOptions(trailingOptionsArgument(args), command);
428
+ if (!objectOnly) {
429
+ command.push(...trailingArrayArgument(args));
430
+ }
431
+ return command;
432
+ }
433
+ function trailingArrayArgument(args) {
434
+ const hasTrailingCallback = typeof last(args) === "function";
435
+ return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
436
+ }
437
+ function trailingOptionsArgument(args) {
438
+ const hasTrailingCallback = filterFunction(last(args));
439
+ return filterType(last(args, hasTrailingCallback ? 1 : 0), filterPlainObject);
440
+ }
441
+ function trailingFunctionArgument(args, includeNoop = true) {
442
+ const callback = asFunction(last(args));
443
+ return includeNoop || isUserFunction(callback) ? callback : void 0;
444
+ }
445
+ var import_args_pathspec2;
446
+ var init_task_options = __esm({
447
+ "src/lib/utils/task-options.ts"() {
448
+ "use strict";
449
+ init_argument_filters();
450
+ init_util();
451
+ import_args_pathspec2 = require("@simple-git/args-pathspec");
452
+ }
453
+ });
454
+
455
+ // src/lib/utils/task-parser.ts
456
+ function callTaskParser(parser4, streams) {
457
+ return parser4(streams.stdOut, streams.stdErr);
458
+ }
459
+ function parseStringResponse(result, parsers12, texts, trim = true) {
460
+ asArray(texts).forEach((text) => {
461
+ for (let lines = toLinesWithContent(text, trim), i = 0, max = lines.length; i < max; i++) {
462
+ const line = (offset = 0) => {
463
+ if (i + offset >= max) {
464
+ return;
465
+ }
466
+ return lines[i + offset];
467
+ };
468
+ parsers12.some(({ parse }) => parse(line, result));
469
+ }
470
+ });
471
+ return result;
472
+ }
473
+ var init_task_parser = __esm({
474
+ "src/lib/utils/task-parser.ts"() {
475
+ "use strict";
476
+ init_util();
477
+ }
478
+ });
479
+
480
+ // src/lib/utils/index.ts
481
+ var utils_exports = {};
482
+ __export(utils_exports, {
483
+ ExitCodes: () => ExitCodes,
484
+ GitOutputStreams: () => GitOutputStreams,
485
+ LineParser: () => LineParser,
486
+ NOOP: () => NOOP,
487
+ NULL: () => NULL,
488
+ RemoteLineParser: () => RemoteLineParser,
489
+ append: () => append,
490
+ appendTaskOptions: () => appendTaskOptions,
491
+ asArray: () => asArray,
492
+ asCamelCase: () => asCamelCase,
493
+ asFunction: () => asFunction,
494
+ asNumber: () => asNumber,
495
+ asStringArray: () => asStringArray,
496
+ bufferToString: () => bufferToString,
497
+ callTaskParser: () => callTaskParser,
498
+ createInstanceConfig: () => createInstanceConfig,
499
+ delay: () => delay,
500
+ filterArray: () => filterArray,
501
+ filterFunction: () => filterFunction,
502
+ filterHasLength: () => filterHasLength,
503
+ filterNumber: () => filterNumber,
504
+ filterPlainObject: () => filterPlainObject,
505
+ filterPrimitives: () => filterPrimitives,
506
+ filterString: () => filterString,
507
+ filterStringOrStringArray: () => filterStringOrStringArray,
508
+ filterType: () => filterType,
509
+ first: () => first,
510
+ folderExists: () => folderExists,
511
+ forEachLineWithContent: () => forEachLineWithContent,
512
+ getTrailingOptions: () => getTrailingOptions,
513
+ including: () => including,
514
+ isUserFunction: () => isUserFunction,
515
+ last: () => last,
516
+ objectToString: () => objectToString,
517
+ orVoid: () => orVoid,
518
+ parseStringResponse: () => parseStringResponse,
519
+ pick: () => pick,
520
+ prefixedArray: () => prefixedArray,
521
+ remove: () => remove,
522
+ splitOn: () => splitOn,
523
+ toLinesWithContent: () => toLinesWithContent,
524
+ trailingFunctionArgument: () => trailingFunctionArgument,
525
+ trailingOptionsArgument: () => trailingOptionsArgument
526
+ });
527
+ var init_utils = __esm({
528
+ "src/lib/utils/index.ts"() {
529
+ "use strict";
530
+ init_argument_filters();
531
+ init_exit_codes();
532
+ init_git_output_streams();
533
+ init_line_parser();
534
+ init_simple_git_options();
535
+ init_task_options();
536
+ init_task_parser();
537
+ init_util();
538
+ }
539
+ });
540
+
541
+ // src/lib/tasks/check-is-repo.ts
542
+ var check_is_repo_exports = {};
543
+ __export(check_is_repo_exports, {
544
+ CheckRepoActions: () => CheckRepoActions,
545
+ checkIsBareRepoTask: () => checkIsBareRepoTask,
546
+ checkIsRepoRootTask: () => checkIsRepoRootTask,
547
+ checkIsRepoTask: () => checkIsRepoTask
548
+ });
549
+ function checkIsRepoTask(action) {
550
+ switch (action) {
551
+ case "bare" /* BARE */:
552
+ return checkIsBareRepoTask();
553
+ case "root" /* IS_REPO_ROOT */:
554
+ return checkIsRepoRootTask();
555
+ }
556
+ const commands = ["rev-parse", "--is-inside-work-tree"];
557
+ return {
558
+ commands,
559
+ format: "utf-8",
560
+ onError,
561
+ parser
562
+ };
563
+ }
564
+ function checkIsRepoRootTask() {
565
+ const commands = ["rev-parse", "--git-dir"];
566
+ return {
567
+ commands,
568
+ format: "utf-8",
569
+ onError,
570
+ parser(path) {
571
+ return /^\.(git)?$/.test(path.trim());
572
+ }
573
+ };
574
+ }
575
+ function checkIsBareRepoTask() {
576
+ const commands = ["rev-parse", "--is-bare-repository"];
577
+ return {
578
+ commands,
579
+ format: "utf-8",
580
+ onError,
581
+ parser
582
+ };
583
+ }
584
+ function isNotRepoMessage(error) {
585
+ return /(Not a git repository|Kein Git-Repository)/i.test(String(error));
586
+ }
587
+ var CheckRepoActions, onError, parser;
588
+ var init_check_is_repo = __esm({
589
+ "src/lib/tasks/check-is-repo.ts"() {
590
+ "use strict";
591
+ init_utils();
592
+ CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => {
593
+ CheckRepoActions2["BARE"] = "bare";
594
+ CheckRepoActions2["IN_TREE"] = "tree";
595
+ CheckRepoActions2["IS_REPO_ROOT"] = "root";
596
+ return CheckRepoActions2;
597
+ })(CheckRepoActions || {});
598
+ onError = ({ exitCode }, error, done, fail) => {
599
+ if (exitCode === 128 /* UNCLEAN */ && isNotRepoMessage(error)) {
600
+ return done(Buffer.from("false"));
601
+ }
602
+ fail(error);
603
+ };
604
+ parser = (text) => {
605
+ return text.trim() === "true";
606
+ };
607
+ }
608
+ });
609
+
610
+ // src/lib/responses/CleanSummary.ts
611
+ function cleanSummaryParser(dryRun, text) {
612
+ const summary = new CleanResponse(dryRun);
613
+ const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp;
614
+ toLinesWithContent(text).forEach((line) => {
615
+ const removed = line.replace(regexp, "");
616
+ summary.paths.push(removed);
617
+ (isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed);
618
+ });
619
+ return summary;
620
+ }
621
+ var CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp;
622
+ var init_CleanSummary = __esm({
623
+ "src/lib/responses/CleanSummary.ts"() {
624
+ "use strict";
625
+ init_utils();
626
+ CleanResponse = class {
627
+ constructor(dryRun) {
628
+ this.dryRun = dryRun;
629
+ this.paths = [];
630
+ this.files = [];
631
+ this.folders = [];
632
+ }
633
+ };
634
+ removalRegexp = /^[a-z]+\s*/i;
635
+ dryRunRemovalRegexp = /^[a-z]+\s+[a-z]+\s*/i;
636
+ isFolderRegexp = /\/$/;
637
+ }
638
+ });
639
+
640
+ // src/lib/tasks/task.ts
641
+ var task_exports = {};
642
+ __export(task_exports, {
643
+ EMPTY_COMMANDS: () => EMPTY_COMMANDS,
644
+ adhocExecTask: () => adhocExecTask,
645
+ configurationErrorTask: () => configurationErrorTask,
646
+ isBufferTask: () => isBufferTask,
647
+ isEmptyTask: () => isEmptyTask,
648
+ straightThroughBufferTask: () => straightThroughBufferTask,
649
+ straightThroughStringTask: () => straightThroughStringTask
650
+ });
651
+ function adhocExecTask(parser4) {
652
+ return {
653
+ commands: EMPTY_COMMANDS,
654
+ format: "empty",
655
+ parser: parser4
656
+ };
657
+ }
658
+ function configurationErrorTask(error) {
659
+ return {
660
+ commands: EMPTY_COMMANDS,
661
+ format: "empty",
662
+ parser() {
663
+ throw typeof error === "string" ? new TaskConfigurationError(error) : error;
664
+ }
665
+ };
666
+ }
667
+ function straightThroughStringTask(commands, trimmed2 = false) {
668
+ return {
669
+ commands,
670
+ format: "utf-8",
671
+ parser(text) {
672
+ return trimmed2 ? String(text).trim() : text;
673
+ }
674
+ };
675
+ }
676
+ function straightThroughBufferTask(commands) {
677
+ return {
678
+ commands,
679
+ format: "buffer",
680
+ parser(buffer) {
681
+ return buffer;
682
+ }
683
+ };
684
+ }
685
+ function isBufferTask(task) {
686
+ return task.format === "buffer";
687
+ }
688
+ function isEmptyTask(task) {
689
+ return task.format === "empty" || !task.commands.length;
690
+ }
691
+ var EMPTY_COMMANDS;
692
+ var init_task = __esm({
693
+ "src/lib/tasks/task.ts"() {
694
+ "use strict";
695
+ init_task_configuration_error();
696
+ EMPTY_COMMANDS = [];
697
+ }
698
+ });
699
+
700
+ // src/lib/tasks/clean.ts
701
+ var clean_exports = {};
702
+ __export(clean_exports, {
703
+ CONFIG_ERROR_INTERACTIVE_MODE: () => CONFIG_ERROR_INTERACTIVE_MODE,
704
+ CONFIG_ERROR_MODE_REQUIRED: () => CONFIG_ERROR_MODE_REQUIRED,
705
+ CONFIG_ERROR_UNKNOWN_OPTION: () => CONFIG_ERROR_UNKNOWN_OPTION,
706
+ CleanOptions: () => CleanOptions,
707
+ cleanTask: () => cleanTask,
708
+ cleanWithOptionsTask: () => cleanWithOptionsTask,
709
+ isCleanOptionsArray: () => isCleanOptionsArray
710
+ });
711
+ function cleanWithOptionsTask(mode, customArgs) {
712
+ const { cleanMode, options, valid } = getCleanOptions(mode);
713
+ if (!cleanMode) {
714
+ return configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED);
715
+ }
716
+ if (!valid.options) {
717
+ return configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode));
718
+ }
719
+ options.push(...customArgs);
720
+ if (options.some(isInteractiveMode)) {
721
+ return configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE);
722
+ }
723
+ return cleanTask(cleanMode, options);
724
+ }
725
+ function cleanTask(mode, customArgs) {
726
+ const commands = ["clean", `-${mode}`, ...customArgs];
727
+ return {
728
+ commands,
729
+ format: "utf-8",
730
+ parser(text) {
731
+ return cleanSummaryParser(mode === "n" /* DRY_RUN */, text);
732
+ }
733
+ };
734
+ }
735
+ function isCleanOptionsArray(input) {
736
+ return Array.isArray(input) && input.every((test) => CleanOptionValues.has(test));
737
+ }
738
+ function getCleanOptions(input) {
739
+ let cleanMode;
740
+ let options = [];
741
+ let valid = { cleanMode: false, options: true };
742
+ input.replace(/[^a-z]i/g, "").split("").forEach((char) => {
743
+ if (isCleanMode(char)) {
744
+ cleanMode = char;
745
+ valid.cleanMode = true;
746
+ } else {
747
+ valid.options = valid.options && isKnownOption(options[options.length] = `-${char}`);
748
+ }
749
+ });
750
+ return {
751
+ cleanMode,
752
+ options,
753
+ valid
754
+ };
755
+ }
756
+ function isCleanMode(cleanMode) {
757
+ return cleanMode === "f" /* FORCE */ || cleanMode === "n" /* DRY_RUN */;
758
+ }
759
+ function isKnownOption(option) {
760
+ return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1));
761
+ }
762
+ function isInteractiveMode(option) {
763
+ if (/^-[^\-]/.test(option)) {
764
+ return option.indexOf("i") > 0;
765
+ }
766
+ return option === "--interactive";
767
+ }
768
+ var CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues;
769
+ var init_clean = __esm({
770
+ "src/lib/tasks/clean.ts"() {
771
+ "use strict";
772
+ init_CleanSummary();
773
+ init_utils();
774
+ init_task();
775
+ CONFIG_ERROR_INTERACTIVE_MODE = "Git clean interactive mode is not supported";
776
+ CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter ("n" or "f") is required';
777
+ CONFIG_ERROR_UNKNOWN_OPTION = "Git clean unknown option found in: ";
778
+ CleanOptions = /* @__PURE__ */ ((CleanOptions2) => {
779
+ CleanOptions2["DRY_RUN"] = "n";
780
+ CleanOptions2["FORCE"] = "f";
781
+ CleanOptions2["IGNORED_INCLUDED"] = "x";
782
+ CleanOptions2["IGNORED_ONLY"] = "X";
783
+ CleanOptions2["EXCLUDING"] = "e";
784
+ CleanOptions2["QUIET"] = "q";
785
+ CleanOptions2["RECURSIVE"] = "d";
786
+ return CleanOptions2;
787
+ })(CleanOptions || {});
788
+ CleanOptionValues = /* @__PURE__ */ new Set([
789
+ "i",
790
+ ...asStringArray(Object.values(CleanOptions))
791
+ ]);
792
+ }
793
+ });
794
+
795
+ // src/lib/responses/ConfigList.ts
796
+ function configListParser(text) {
797
+ const config = new ConfigList();
798
+ for (const item of configParser(text)) {
799
+ config.addValue(item.file, String(item.key), item.value);
800
+ }
801
+ return config;
802
+ }
803
+ function configGetParser(text, key) {
804
+ let value = null;
805
+ const values = [];
806
+ const scopes = /* @__PURE__ */ new Map();
807
+ for (const item of configParser(text, key)) {
808
+ if (item.key !== key) {
809
+ continue;
810
+ }
811
+ values.push(value = item.value);
812
+ if (!scopes.has(item.file)) {
813
+ scopes.set(item.file, []);
814
+ }
815
+ scopes.get(item.file).push(value);
816
+ }
817
+ return {
818
+ key,
819
+ paths: Array.from(scopes.keys()),
820
+ scopes,
821
+ value,
822
+ values
823
+ };
824
+ }
825
+ function configFilePath(filePath) {
826
+ return filePath.replace(/^(file):/, "");
827
+ }
828
+ function* configParser(text, requestedKey = null) {
829
+ const lines = text.split("\0");
830
+ for (let i = 0, max = lines.length - 1; i < max; ) {
831
+ const file = configFilePath(lines[i++]);
832
+ let value = lines[i++];
833
+ let key = requestedKey;
834
+ if (value.includes("\n")) {
835
+ const line = splitOn(value, "\n");
836
+ key = line[0];
837
+ value = line[1];
838
+ }
839
+ yield { file, key, value };
840
+ }
841
+ }
842
+ var ConfigList;
843
+ var init_ConfigList = __esm({
844
+ "src/lib/responses/ConfigList.ts"() {
845
+ "use strict";
846
+ init_utils();
847
+ ConfigList = class {
848
+ constructor() {
849
+ this.files = [];
850
+ this.values = /* @__PURE__ */ Object.create(null);
851
+ }
852
+ get all() {
853
+ if (!this._all) {
854
+ this._all = this.files.reduce((all, file) => {
855
+ return Object.assign(all, this.values[file]);
856
+ }, {});
857
+ }
858
+ return this._all;
859
+ }
860
+ addFile(file) {
861
+ if (!(file in this.values)) {
862
+ const latest = last(this.files);
863
+ this.values[file] = latest ? Object.create(this.values[latest]) : {};
864
+ this.files.push(file);
865
+ }
866
+ return this.values[file];
867
+ }
868
+ addValue(file, key, value) {
869
+ const values = this.addFile(file);
870
+ if (!Object.hasOwn(values, key)) {
871
+ values[key] = value;
872
+ } else if (Array.isArray(values[key])) {
873
+ values[key].push(value);
874
+ } else {
875
+ values[key] = [values[key], value];
876
+ }
877
+ this._all = void 0;
878
+ }
879
+ };
880
+ }
881
+ });
882
+
883
+ // src/lib/tasks/config.ts
884
+ function asConfigScope(scope, fallback) {
885
+ if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
886
+ return scope;
887
+ }
888
+ return fallback;
889
+ }
890
+ function addConfigTask(key, value, append2, scope) {
891
+ const commands = ["config", `--${scope}`];
892
+ if (append2) {
893
+ commands.push("--add");
894
+ }
895
+ commands.push(key, value);
896
+ return {
897
+ commands,
898
+ format: "utf-8",
899
+ parser(text) {
900
+ return text;
901
+ }
902
+ };
903
+ }
904
+ function getConfigTask(key, scope) {
905
+ const commands = ["config", "--null", "--show-origin", "--get-all", key];
906
+ if (scope) {
907
+ commands.splice(1, 0, `--${scope}`);
908
+ }
909
+ return {
910
+ commands,
911
+ format: "utf-8",
912
+ parser(text) {
913
+ return configGetParser(text, key);
914
+ }
915
+ };
916
+ }
917
+ function listConfigTask(scope) {
918
+ const commands = ["config", "--list", "--show-origin", "--null"];
919
+ if (scope) {
920
+ commands.push(`--${scope}`);
921
+ }
922
+ return {
923
+ commands,
924
+ format: "utf-8",
925
+ parser(text) {
926
+ return configListParser(text);
927
+ }
928
+ };
929
+ }
930
+ function config_default() {
931
+ return {
932
+ addConfig(key, value, ...rest) {
933
+ return this._runTask(
934
+ addConfigTask(
935
+ key,
936
+ value,
937
+ rest[0] === true,
938
+ asConfigScope(rest[1], "local" /* local */)
939
+ ),
940
+ trailingFunctionArgument(arguments)
941
+ );
942
+ },
943
+ getConfig(key, scope) {
944
+ return this._runTask(
945
+ getConfigTask(key, asConfigScope(scope, void 0)),
946
+ trailingFunctionArgument(arguments)
947
+ );
948
+ },
949
+ listConfig(...rest) {
950
+ return this._runTask(
951
+ listConfigTask(asConfigScope(rest[0], void 0)),
952
+ trailingFunctionArgument(arguments)
953
+ );
954
+ }
955
+ };
956
+ }
957
+ var GitConfigScope;
958
+ var init_config = __esm({
959
+ "src/lib/tasks/config.ts"() {
960
+ "use strict";
961
+ init_ConfigList();
962
+ init_utils();
963
+ GitConfigScope = /* @__PURE__ */ ((GitConfigScope2) => {
964
+ GitConfigScope2["system"] = "system";
965
+ GitConfigScope2["global"] = "global";
966
+ GitConfigScope2["local"] = "local";
967
+ GitConfigScope2["worktree"] = "worktree";
968
+ return GitConfigScope2;
969
+ })(GitConfigScope || {});
970
+ }
971
+ });
972
+
973
+ // src/lib/tasks/diff-name-status.ts
974
+ function isDiffNameStatus(input) {
975
+ return diffNameStatus.has(input);
976
+ }
977
+ var DiffNameStatus, diffNameStatus;
978
+ var init_diff_name_status = __esm({
979
+ "src/lib/tasks/diff-name-status.ts"() {
980
+ "use strict";
981
+ DiffNameStatus = /* @__PURE__ */ ((DiffNameStatus2) => {
982
+ DiffNameStatus2["ADDED"] = "A";
983
+ DiffNameStatus2["COPIED"] = "C";
984
+ DiffNameStatus2["DELETED"] = "D";
985
+ DiffNameStatus2["MODIFIED"] = "M";
986
+ DiffNameStatus2["RENAMED"] = "R";
987
+ DiffNameStatus2["CHANGED"] = "T";
988
+ DiffNameStatus2["UNMERGED"] = "U";
989
+ DiffNameStatus2["UNKNOWN"] = "X";
990
+ DiffNameStatus2["BROKEN"] = "B";
991
+ return DiffNameStatus2;
992
+ })(DiffNameStatus || {});
993
+ diffNameStatus = new Set(Object.values(DiffNameStatus));
994
+ }
995
+ });
996
+
997
+ // src/lib/tasks/grep.ts
998
+ function grepQueryBuilder(...params) {
999
+ return new GrepQuery().param(...params);
1000
+ }
1001
+ function parseGrep(grep) {
1002
+ const paths = /* @__PURE__ */ new Set();
1003
+ const results = {};
1004
+ forEachLineWithContent(grep, (input) => {
1005
+ const [path, line, preview] = input.split(NULL);
1006
+ paths.add(path);
1007
+ (results[path] = results[path] || []).push({
1008
+ line: asNumber(line),
1009
+ path,
1010
+ preview
1011
+ });
1012
+ });
1013
+ return {
1014
+ paths,
1015
+ results
1016
+ };
1017
+ }
1018
+ function grep_default() {
1019
+ return {
1020
+ grep(searchTerm) {
1021
+ const then = trailingFunctionArgument(arguments);
1022
+ const options = getTrailingOptions(arguments);
1023
+ for (const option of disallowedOptions) {
1024
+ if (options.includes(option)) {
1025
+ return this._runTask(
1026
+ configurationErrorTask(`git.grep: use of "${option}" is not supported.`),
1027
+ then
1028
+ );
1029
+ }
1030
+ }
1031
+ if (typeof searchTerm === "string") {
1032
+ searchTerm = grepQueryBuilder().param(searchTerm);
1033
+ }
1034
+ const commands = ["grep", "--null", "-n", "--full-name", ...options, ...searchTerm];
1035
+ return this._runTask(
1036
+ {
1037
+ commands,
1038
+ format: "utf-8",
1039
+ parser(stdOut) {
1040
+ return parseGrep(stdOut);
1041
+ }
1042
+ },
1043
+ then
1044
+ );
1045
+ }
1046
+ };
1047
+ }
1048
+ var disallowedOptions, Query, _a, GrepQuery;
1049
+ var init_grep = __esm({
1050
+ "src/lib/tasks/grep.ts"() {
1051
+ "use strict";
1052
+ init_utils();
1053
+ init_task();
1054
+ disallowedOptions = ["-h"];
1055
+ Query = Symbol("grepQuery");
1056
+ GrepQuery = class {
1057
+ constructor() {
1058
+ this[_a] = [];
1059
+ }
1060
+ *[(_a = Query, Symbol.iterator)]() {
1061
+ for (const query of this[Query]) {
1062
+ yield query;
1063
+ }
1064
+ }
1065
+ and(...and) {
1066
+ and.length && this[Query].push("--and", "(", ...prefixedArray(and, "-e"), ")");
1067
+ return this;
1068
+ }
1069
+ param(...param) {
1070
+ this[Query].push(...prefixedArray(param, "-e"));
1071
+ return this;
1072
+ }
1073
+ };
1074
+ }
1075
+ });
1076
+
1077
+ // src/lib/tasks/reset.ts
1078
+ var reset_exports = {};
1079
+ __export(reset_exports, {
1080
+ ResetMode: () => ResetMode,
1081
+ getResetMode: () => getResetMode,
1082
+ resetTask: () => resetTask
1083
+ });
1084
+ function resetTask(mode, customArgs) {
1085
+ const commands = ["reset"];
1086
+ if (isValidResetMode(mode)) {
1087
+ commands.push(`--${mode}`);
1088
+ }
1089
+ commands.push(...customArgs);
1090
+ return straightThroughStringTask(commands);
1091
+ }
1092
+ function getResetMode(mode) {
1093
+ if (isValidResetMode(mode)) {
1094
+ return mode;
1095
+ }
1096
+ switch (typeof mode) {
1097
+ case "string":
1098
+ case "undefined":
1099
+ return "soft" /* SOFT */;
1100
+ }
1101
+ return;
1102
+ }
1103
+ function isValidResetMode(mode) {
1104
+ return typeof mode === "string" && validResetModes.includes(mode);
1105
+ }
1106
+ var ResetMode, validResetModes;
1107
+ var init_reset = __esm({
1108
+ "src/lib/tasks/reset.ts"() {
1109
+ "use strict";
1110
+ init_utils();
1111
+ init_task();
1112
+ ResetMode = /* @__PURE__ */ ((ResetMode2) => {
1113
+ ResetMode2["MIXED"] = "mixed";
1114
+ ResetMode2["SOFT"] = "soft";
1115
+ ResetMode2["HARD"] = "hard";
1116
+ ResetMode2["MERGE"] = "merge";
1117
+ ResetMode2["KEEP"] = "keep";
1118
+ return ResetMode2;
1119
+ })(ResetMode || {});
1120
+ validResetModes = asStringArray(Object.values(ResetMode));
1121
+ }
1122
+ });
1123
+
1124
+ // src/lib/api.ts
1125
+ var api_exports = {};
1126
+ __export(api_exports, {
1127
+ CheckRepoActions: () => CheckRepoActions,
1128
+ CleanOptions: () => CleanOptions,
1129
+ DiffNameStatus: () => DiffNameStatus,
1130
+ GitConfigScope: () => GitConfigScope,
1131
+ GitConstructError: () => GitConstructError,
1132
+ GitError: () => GitError,
1133
+ GitPluginError: () => GitPluginError,
1134
+ GitResponseError: () => GitResponseError,
1135
+ ResetMode: () => ResetMode,
1136
+ TaskConfigurationError: () => TaskConfigurationError,
1137
+ grepQueryBuilder: () => grepQueryBuilder,
1138
+ pathspec: () => import_args_pathspec3.pathspec
1139
+ });
1140
+ var import_args_pathspec3;
1141
+ var init_api = __esm({
1142
+ "src/lib/api.ts"() {
1143
+ "use strict";
1144
+ import_args_pathspec3 = require("@simple-git/args-pathspec");
1145
+ init_git_construct_error();
1146
+ init_git_error();
1147
+ init_git_plugin_error();
1148
+ init_git_response_error();
1149
+ init_task_configuration_error();
1150
+ init_check_is_repo();
1151
+ init_clean();
1152
+ init_config();
1153
+ init_diff_name_status();
1154
+ init_grep();
1155
+ init_reset();
1156
+ }
1157
+ });
1158
+
1159
+ // src/lib/plugins/abort-plugin.ts
1160
+ function abortPlugin(signal) {
1161
+ if (!signal) {
1162
+ return;
1163
+ }
1164
+ const onSpawnAfter = {
1165
+ type: "spawn.after",
1166
+ action(_data, context) {
1167
+ function kill() {
1168
+ context.kill(new GitPluginError(void 0, "abort", "Abort signal received"));
1169
+ }
1170
+ signal.addEventListener("abort", kill);
1171
+ context.spawned.on("close", () => signal.removeEventListener("abort", kill));
1172
+ }
1173
+ };
1174
+ const onSpawnBefore = {
1175
+ type: "spawn.before",
1176
+ action(_data, context) {
1177
+ if (signal.aborted) {
1178
+ context.kill(new GitPluginError(void 0, "abort", "Abort already signaled"));
1179
+ }
1180
+ }
1181
+ };
1182
+ return [onSpawnBefore, onSpawnAfter];
1183
+ }
1184
+ var init_abort_plugin = __esm({
1185
+ "src/lib/plugins/abort-plugin.ts"() {
1186
+ "use strict";
1187
+ init_git_plugin_error();
1188
+ }
1189
+ });
1190
+
1191
+ // src/lib/plugins/block-unsafe-operations-plugin.ts
1192
+ function blockUnsafeOperationsPlugin(options = {}) {
1193
+ return {
1194
+ type: "spawn.args",
1195
+ action(args, { env }) {
1196
+ for (const vulnerability of (0, import_argv_parser.vulnerabilityCheck)(args, env)) {
1197
+ if (options[vulnerability.category] !== true) {
1198
+ throw new GitPluginError(void 0, "unsafe", vulnerability.message);
1199
+ }
1200
+ }
1201
+ return args;
1202
+ }
1203
+ };
1204
+ }
1205
+ var import_argv_parser;
1206
+ var init_block_unsafe_operations_plugin = __esm({
1207
+ "src/lib/plugins/block-unsafe-operations-plugin.ts"() {
1208
+ "use strict";
1209
+ import_argv_parser = require("@simple-git/argv-parser");
1210
+ init_git_plugin_error();
1211
+ }
1212
+ });
1213
+
1214
+ // src/lib/plugins/command-config-prefixing-plugin.ts
1215
+ function commandConfigPrefixingPlugin(configuration) {
1216
+ const prefix = prefixedArray(configuration, "-c");
1217
+ return {
1218
+ type: "spawn.args",
1219
+ action(data) {
1220
+ return [...prefix, ...data];
1221
+ }
1222
+ };
1223
+ }
1224
+ var init_command_config_prefixing_plugin = __esm({
1225
+ "src/lib/plugins/command-config-prefixing-plugin.ts"() {
1226
+ "use strict";
1227
+ init_utils();
1228
+ }
1229
+ });
1230
+
1231
+ // src/lib/plugins/completion-detection.plugin.ts
1232
+ function completionDetectionPlugin({
1233
+ onClose = true,
1234
+ onExit = 50
1235
+ } = {}) {
1236
+ function createEvents() {
1237
+ let exitCode = -1;
1238
+ const events = {
1239
+ close: (0, import_promise_deferred.deferred)(),
1240
+ closeTimeout: (0, import_promise_deferred.deferred)(),
1241
+ exit: (0, import_promise_deferred.deferred)(),
1242
+ exitTimeout: (0, import_promise_deferred.deferred)()
1243
+ };
1244
+ const result = Promise.race([
1245
+ onClose === false ? never : events.closeTimeout.promise,
1246
+ onExit === false ? never : events.exitTimeout.promise
1247
+ ]);
1248
+ configureTimeout(onClose, events.close, events.closeTimeout);
1249
+ configureTimeout(onExit, events.exit, events.exitTimeout);
1250
+ return {
1251
+ close(code) {
1252
+ exitCode = code;
1253
+ events.close.done();
1254
+ },
1255
+ exit(code) {
1256
+ exitCode = code;
1257
+ events.exit.done();
1258
+ },
1259
+ get exitCode() {
1260
+ return exitCode;
1261
+ },
1262
+ result
1263
+ };
1264
+ }
1265
+ function configureTimeout(flag, event, timeout) {
1266
+ if (flag === false) {
1267
+ return;
1268
+ }
1269
+ (flag === true ? event.promise : event.promise.then(() => delay(flag))).then(timeout.done);
1270
+ }
1271
+ return {
1272
+ type: "spawn.after",
1273
+ async action(_data, { spawned, close }) {
1274
+ const events = createEvents();
1275
+ let deferClose = true;
1276
+ let quickClose = () => void (deferClose = false);
1277
+ spawned.stdout?.on("data", quickClose);
1278
+ spawned.stderr?.on("data", quickClose);
1279
+ spawned.on("error", quickClose);
1280
+ spawned.on("close", (code) => events.close(code));
1281
+ spawned.on("exit", (code) => events.exit(code));
1282
+ try {
1283
+ await events.result;
1284
+ if (deferClose) {
1285
+ await delay(50);
1286
+ }
1287
+ close(events.exitCode);
1288
+ } catch (err) {
1289
+ close(events.exitCode, err);
1290
+ }
1291
+ }
1292
+ };
1293
+ }
1294
+ var import_promise_deferred, never;
1295
+ var init_completion_detection_plugin = __esm({
1296
+ "src/lib/plugins/completion-detection.plugin.ts"() {
1297
+ "use strict";
1298
+ import_promise_deferred = require("@kwsites/promise-deferred");
1299
+ init_utils();
1300
+ never = (0, import_promise_deferred.deferred)().promise;
1301
+ }
1302
+ });
1303
+
1304
+ // src/lib/plugins/custom-binary.plugin.ts
1305
+ function isBadArgument(arg) {
1306
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
1307
+ }
1308
+ function toBinaryConfig(input, allowUnsafe) {
1309
+ if (input.length < 1 || input.length > 2) {
1310
+ throw new GitPluginError(void 0, "binary", WRONG_NUMBER_ERR);
1311
+ }
1312
+ const isBad = input.some(isBadArgument);
1313
+ if (isBad) {
1314
+ if (allowUnsafe) {
1315
+ console.warn(WRONG_CHARS_ERR);
1316
+ } else {
1317
+ throw new GitPluginError(void 0, "binary", WRONG_CHARS_ERR);
1318
+ }
1319
+ }
1320
+ const [binary, prefix] = input;
1321
+ return {
1322
+ binary,
1323
+ prefix
1324
+ };
1325
+ }
1326
+ function customBinaryPlugin(plugins, input = ["git"], allowUnsafe = false) {
1327
+ let config = toBinaryConfig(asArray(input), allowUnsafe);
1328
+ plugins.on("binary", (input2) => {
1329
+ config = toBinaryConfig(asArray(input2), allowUnsafe);
1330
+ });
1331
+ plugins.append("spawn.binary", () => {
1332
+ return config.binary;
1333
+ });
1334
+ plugins.append("spawn.args", (data) => {
1335
+ return config.prefix ? [config.prefix, ...data] : data;
1336
+ });
1337
+ }
1338
+ var WRONG_NUMBER_ERR, WRONG_CHARS_ERR;
1339
+ var init_custom_binary_plugin = __esm({
1340
+ "src/lib/plugins/custom-binary.plugin.ts"() {
1341
+ "use strict";
1342
+ init_git_plugin_error();
1343
+ init_utils();
1344
+ WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
1345
+ WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
1346
+ }
1347
+ });
1348
+
1349
+ // src/lib/plugins/error-detection.plugin.ts
1350
+ function isTaskError(result) {
1351
+ return !!(result.exitCode && result.stdErr.length);
1352
+ }
1353
+ function getErrorMessage(result) {
1354
+ return Buffer.concat([...result.stdOut, ...result.stdErr]);
1355
+ }
1356
+ function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {
1357
+ return (error, result) => {
1358
+ if (!overwrite && error || !isError(result)) {
1359
+ return error;
1360
+ }
1361
+ return errorMessage(result);
1362
+ };
1363
+ }
1364
+ function errorDetectionPlugin(config) {
1365
+ return {
1366
+ type: "task.error",
1367
+ action(data, context) {
1368
+ const error = config(data.error, {
1369
+ stdErr: context.stdErr,
1370
+ stdOut: context.stdOut,
1371
+ exitCode: context.exitCode
1372
+ });
1373
+ if (Buffer.isBuffer(error)) {
1374
+ return { error: new GitError(void 0, error.toString("utf-8")) };
1375
+ }
1376
+ return {
1377
+ error
1378
+ };
1379
+ }
1380
+ };
1381
+ }
1382
+ var init_error_detection_plugin = __esm({
1383
+ "src/lib/plugins/error-detection.plugin.ts"() {
1384
+ "use strict";
1385
+ init_git_error();
1386
+ }
1387
+ });
1388
+
1389
+ // src/lib/plugins/plugin-store.ts
1390
+ var import_node_events, PluginStore;
1391
+ var init_plugin_store = __esm({
1392
+ "src/lib/plugins/plugin-store.ts"() {
1393
+ "use strict";
1394
+ import_node_events = require("node:events");
1395
+ init_utils();
1396
+ PluginStore = class {
1397
+ constructor() {
1398
+ this.plugins = /* @__PURE__ */ new Set();
1399
+ this.events = new import_node_events.EventEmitter();
1400
+ }
1401
+ on(type, listener) {
1402
+ this.events.on(type, listener);
1403
+ }
1404
+ reconfigure(type, data) {
1405
+ this.events.emit(type, data);
1406
+ }
1407
+ append(type, action) {
1408
+ const plugin = append(this.plugins, { type, action });
1409
+ return () => this.plugins.delete(plugin);
1410
+ }
1411
+ add(plugin) {
1412
+ const plugins = [];
1413
+ asArray(plugin).forEach((plugin2) => plugin2 && this.plugins.add(append(plugins, plugin2)));
1414
+ return () => {
1415
+ plugins.forEach((plugin2) => this.plugins.delete(plugin2));
1416
+ };
1417
+ }
1418
+ exec(type, data, context) {
1419
+ let output = data;
1420
+ const contextual = Object.freeze(Object.create(context));
1421
+ for (const plugin of this.plugins) {
1422
+ if (plugin.type === type) {
1423
+ output = plugin.action(output, contextual);
1424
+ }
1425
+ }
1426
+ return output;
1427
+ }
1428
+ };
1429
+ }
1430
+ });
1431
+
1432
+ // src/lib/plugins/progress-monitor-plugin.ts
1433
+ function progressMonitorPlugin(progress) {
1434
+ const progressCommand = "--progress";
1435
+ const progressMethods = ["checkout", "clone", "fetch", "pull", "push"];
1436
+ const onProgress = {
1437
+ type: "spawn.after",
1438
+ action(_data, context) {
1439
+ if (!context.commands.includes(progressCommand)) {
1440
+ return;
1441
+ }
1442
+ context.spawned.stderr?.on("data", (chunk) => {
1443
+ const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8"));
1444
+ if (!message) {
1445
+ return;
1446
+ }
1447
+ progress({
1448
+ method: context.method,
1449
+ stage: progressEventStage(message[1]),
1450
+ progress: asNumber(message[2]),
1451
+ processed: asNumber(message[3]),
1452
+ total: asNumber(message[4])
1453
+ });
1454
+ });
1455
+ }
1456
+ };
1457
+ const onArgs = {
1458
+ type: "spawn.args",
1459
+ action(args, context) {
1460
+ if (!progressMethods.includes(context.method)) {
1461
+ return args;
1462
+ }
1463
+ return including(args, progressCommand);
1464
+ }
1465
+ };
1466
+ return [onArgs, onProgress];
1467
+ }
1468
+ function progressEventStage(input) {
1469
+ return String(input.toLowerCase().split(" ", 1)) || "unknown";
1470
+ }
1471
+ var init_progress_monitor_plugin = __esm({
1472
+ "src/lib/plugins/progress-monitor-plugin.ts"() {
1473
+ "use strict";
1474
+ init_utils();
1475
+ }
1476
+ });
1477
+
1478
+ // src/lib/plugins/simple-git-plugin.ts
1479
+ var init_simple_git_plugin = __esm({
1480
+ "src/lib/plugins/simple-git-plugin.ts"() {
1481
+ "use strict";
1482
+ }
1483
+ });
1484
+
1485
+ // src/lib/plugins/spawn-options-plugin.ts
1486
+ function spawnOptionsPlugin(spawnOptions) {
1487
+ const options = pick(spawnOptions, ["uid", "gid"]);
1488
+ return {
1489
+ type: "spawn.options",
1490
+ action(data) {
1491
+ return { ...options, ...data };
1492
+ }
1493
+ };
1494
+ }
1495
+ var init_spawn_options_plugin = __esm({
1496
+ "src/lib/plugins/spawn-options-plugin.ts"() {
1497
+ "use strict";
1498
+ init_utils();
1499
+ }
1500
+ });
1501
+
1502
+ // src/lib/plugins/timout-plugin.ts
1503
+ function timeoutPlugin({
1504
+ block,
1505
+ stdErr = true,
1506
+ stdOut = true
1507
+ }) {
1508
+ if (block > 0) {
1509
+ return {
1510
+ type: "spawn.after",
1511
+ action(_data, context) {
1512
+ let timeout;
1513
+ function wait() {
1514
+ timeout && clearTimeout(timeout);
1515
+ timeout = setTimeout(kill, block);
1516
+ }
1517
+ function stop() {
1518
+ context.spawned.stdout?.off("data", wait);
1519
+ context.spawned.stderr?.off("data", wait);
1520
+ context.spawned.off("exit", stop);
1521
+ context.spawned.off("close", stop);
1522
+ timeout && clearTimeout(timeout);
1523
+ }
1524
+ function kill() {
1525
+ stop();
1526
+ context.kill(new GitPluginError(void 0, "timeout", `block timeout reached`));
1527
+ }
1528
+ stdOut && context.spawned.stdout?.on("data", wait);
1529
+ stdErr && context.spawned.stderr?.on("data", wait);
1530
+ context.spawned.on("exit", stop);
1531
+ context.spawned.on("close", stop);
1532
+ wait();
1533
+ }
1534
+ };
1535
+ }
1536
+ }
1537
+ var init_timout_plugin = __esm({
1538
+ "src/lib/plugins/timout-plugin.ts"() {
1539
+ "use strict";
1540
+ init_git_plugin_error();
1541
+ }
1542
+ });
1543
+
1544
+ // src/lib/plugins/index.ts
1545
+ var init_plugins = __esm({
1546
+ "src/lib/plugins/index.ts"() {
1547
+ "use strict";
1548
+ init_abort_plugin();
1549
+ init_block_unsafe_operations_plugin();
1550
+ init_command_config_prefixing_plugin();
1551
+ init_completion_detection_plugin();
1552
+ init_custom_binary_plugin();
1553
+ init_error_detection_plugin();
1554
+ init_plugin_store();
1555
+ init_progress_monitor_plugin();
1556
+ init_simple_git_plugin();
1557
+ init_spawn_options_plugin();
1558
+ init_timout_plugin();
1559
+ }
1560
+ });
1561
+
1562
+ // src/lib/plugins/suffix-paths.plugin.ts
1563
+ function suffixPathsPlugin() {
1564
+ return {
1565
+ type: "spawn.args",
1566
+ action(data) {
1567
+ const prefix = [];
1568
+ let suffix;
1569
+ function append2(args) {
1570
+ (suffix = suffix || []).push(...args);
1571
+ }
1572
+ for (let i = 0; i < data.length; i++) {
1573
+ const param = data[i];
1574
+ if ((0, import_args_pathspec4.isPathSpec)(param)) {
1575
+ append2((0, import_args_pathspec4.toPaths)(param));
1576
+ continue;
1577
+ }
1578
+ if (param === "--") {
1579
+ append2(
1580
+ data.slice(i + 1).flatMap((item) => (0, import_args_pathspec4.isPathSpec)(item) && (0, import_args_pathspec4.toPaths)(item) || item)
1581
+ );
1582
+ break;
1583
+ }
1584
+ prefix.push(param);
1585
+ }
1586
+ return !suffix ? prefix : [...prefix, "--", ...suffix.map(String)];
1587
+ }
1588
+ };
1589
+ }
1590
+ var import_args_pathspec4;
1591
+ var init_suffix_paths_plugin = __esm({
1592
+ "src/lib/plugins/suffix-paths.plugin.ts"() {
1593
+ "use strict";
1594
+ import_args_pathspec4 = require("@simple-git/args-pathspec");
1595
+ }
1596
+ });
1597
+
1598
+ // src/lib/git-logger.ts
1599
+ function createLog() {
1600
+ return (0, import_debug.default)("simple-git");
1601
+ }
1602
+ function prefixedLogger(to, prefix, forward) {
1603
+ if (!prefix || !String(prefix).replace(/\s*/, "")) {
1604
+ return !forward ? to : (message, ...args) => {
1605
+ to(message, ...args);
1606
+ forward(message, ...args);
1607
+ };
1608
+ }
1609
+ return (message, ...args) => {
1610
+ to(`%s ${message}`, prefix, ...args);
1611
+ if (forward) {
1612
+ forward(message, ...args);
1613
+ }
1614
+ };
1615
+ }
1616
+ function childLoggerName(name, childDebugger, { namespace: parentNamespace }) {
1617
+ if (typeof name === "string") {
1618
+ return name;
1619
+ }
1620
+ const childNamespace = childDebugger && childDebugger.namespace || "";
1621
+ if (childNamespace.startsWith(parentNamespace)) {
1622
+ return childNamespace.substr(parentNamespace.length + 1);
1623
+ }
1624
+ return childNamespace || parentNamespace;
1625
+ }
1626
+ function createLogger(label, verbose, initialStep, infoDebugger = createLog()) {
1627
+ const labelPrefix = label && `[${label}]` || "";
1628
+ const spawned = [];
1629
+ const debugDebugger = typeof verbose === "string" ? infoDebugger.extend(verbose) : verbose;
1630
+ const key = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger);
1631
+ return step(initialStep);
1632
+ function sibling(name, initial) {
1633
+ return append(
1634
+ spawned,
1635
+ createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger)
1636
+ );
1637
+ }
1638
+ function step(phase) {
1639
+ const stepPrefix = phase && `[${phase}]` || "";
1640
+ const debug2 = debugDebugger && prefixedLogger(debugDebugger, stepPrefix) || NOOP;
1641
+ const info = prefixedLogger(infoDebugger, `${labelPrefix} ${stepPrefix}`, debug2);
1642
+ return Object.assign(debugDebugger ? debug2 : info, {
1643
+ label,
1644
+ sibling,
1645
+ info,
1646
+ step
1647
+ });
1648
+ }
1649
+ }
1650
+ var import_debug;
1651
+ var init_git_logger = __esm({
1652
+ "src/lib/git-logger.ts"() {
1653
+ "use strict";
1654
+ import_debug = __toESM(require("debug"));
1655
+ init_utils();
1656
+ import_debug.default.formatters.L = (value) => String(filterHasLength(value) ? value.length : "-");
1657
+ import_debug.default.formatters.B = (value) => {
1658
+ if (Buffer.isBuffer(value)) {
1659
+ return value.toString("utf8");
1660
+ }
1661
+ return objectToString(value);
1662
+ };
1663
+ }
1664
+ });
1665
+
1666
+ // src/lib/runners/tasks-pending-queue.ts
1667
+ var TasksPendingQueue;
1668
+ var init_tasks_pending_queue = __esm({
1669
+ "src/lib/runners/tasks-pending-queue.ts"() {
1670
+ "use strict";
1671
+ init_git_error();
1672
+ init_git_logger();
1673
+ TasksPendingQueue = class _TasksPendingQueue {
1674
+ constructor(logLabel = "GitExecutor") {
1675
+ this.logLabel = logLabel;
1676
+ this._queue = /* @__PURE__ */ new Map();
1677
+ }
1678
+ withProgress(task) {
1679
+ return this._queue.get(task);
1680
+ }
1681
+ createProgress(task) {
1682
+ const name = _TasksPendingQueue.getName(task.commands[0]);
1683
+ const logger = createLogger(this.logLabel, name);
1684
+ return {
1685
+ task,
1686
+ logger,
1687
+ name
1688
+ };
1689
+ }
1690
+ push(task) {
1691
+ const progress = this.createProgress(task);
1692
+ progress.logger("Adding task to the queue, commands = %o", task.commands);
1693
+ this._queue.set(task, progress);
1694
+ return progress;
1695
+ }
1696
+ fatal(err) {
1697
+ for (const [task, { logger }] of Array.from(this._queue.entries())) {
1698
+ if (task === err.task) {
1699
+ logger.info(`Failed %o`, err);
1700
+ logger(
1701
+ `Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`
1702
+ );
1703
+ } else {
1704
+ logger.info(
1705
+ `A fatal exception occurred in a previous task, the queue has been purged: %o`,
1706
+ err.message
1707
+ );
1708
+ }
1709
+ this.complete(task);
1710
+ }
1711
+ if (this._queue.size !== 0) {
1712
+ throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`);
1713
+ }
1714
+ }
1715
+ complete(task) {
1716
+ const progress = this.withProgress(task);
1717
+ if (progress) {
1718
+ this._queue.delete(task);
1719
+ }
1720
+ }
1721
+ attempt(task) {
1722
+ const progress = this.withProgress(task);
1723
+ if (!progress) {
1724
+ throw new GitError(void 0, "TasksPendingQueue: attempt called for an unknown task");
1725
+ }
1726
+ progress.logger("Starting task");
1727
+ return progress;
1728
+ }
1729
+ static getName(name = "empty") {
1730
+ return `task:${name}:${++_TasksPendingQueue.counter}`;
1731
+ }
1732
+ static {
1733
+ this.counter = 0;
1734
+ }
1735
+ };
1736
+ }
1737
+ });
1738
+
1739
+ // src/lib/runners/git-executor-chain.ts
1740
+ function pluginContext(task, commands) {
1741
+ return {
1742
+ method: first(task.commands) || "",
1743
+ commands
1744
+ };
1745
+ }
1746
+ function onErrorReceived(target, logger) {
1747
+ return (err) => {
1748
+ logger(`[ERROR] child process exception %o`, err);
1749
+ target.push(Buffer.from(String(err.stack), "ascii"));
1750
+ };
1751
+ }
1752
+ function onDataReceived(target, name, logger, output) {
1753
+ return (buffer) => {
1754
+ logger(`%s received %L bytes`, name, buffer);
1755
+ output(`%B`, buffer);
1756
+ target.push(buffer);
1757
+ };
1758
+ }
1759
+ var import_child_process, GitExecutorChain;
1760
+ var init_git_executor_chain = __esm({
1761
+ "src/lib/runners/git-executor-chain.ts"() {
1762
+ "use strict";
1763
+ import_child_process = require("child_process");
1764
+ init_git_error();
1765
+ init_task();
1766
+ init_utils();
1767
+ init_tasks_pending_queue();
1768
+ GitExecutorChain = class {
1769
+ constructor(_executor, _scheduler, _plugins) {
1770
+ this._executor = _executor;
1771
+ this._scheduler = _scheduler;
1772
+ this._plugins = _plugins;
1773
+ this._chain = Promise.resolve();
1774
+ this._queue = new TasksPendingQueue();
1775
+ }
1776
+ get cwd() {
1777
+ return this._cwd || this._executor.cwd;
1778
+ }
1779
+ set cwd(cwd) {
1780
+ this._cwd = cwd;
1781
+ }
1782
+ get env() {
1783
+ return this._executor.env;
1784
+ }
1785
+ get outputHandler() {
1786
+ return this._executor.outputHandler;
1787
+ }
1788
+ chain() {
1789
+ return this;
1790
+ }
1791
+ push(task) {
1792
+ this._queue.push(task);
1793
+ return this._chain = this._chain.then(() => this.attemptTask(task));
1794
+ }
1795
+ async attemptTask(task) {
1796
+ const onScheduleComplete = await this._scheduler.next();
1797
+ const onQueueComplete = () => this._queue.complete(task);
1798
+ try {
1799
+ const { logger } = this._queue.attempt(task);
1800
+ return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
1801
+ } catch (e) {
1802
+ throw this.onFatalException(task, e);
1803
+ } finally {
1804
+ onQueueComplete();
1805
+ onScheduleComplete();
1806
+ }
1807
+ }
1808
+ onFatalException(task, e) {
1809
+ const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
1810
+ this._chain = Promise.resolve();
1811
+ this._queue.fatal(gitError);
1812
+ return gitError;
1813
+ }
1814
+ async attemptRemoteTask(task, logger) {
1815
+ const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
1816
+ const args = this._plugins.exec("spawn.args", [...task.commands], {
1817
+ ...pluginContext(task, task.commands),
1818
+ env: { ...this.env }
1819
+ });
1820
+ const raw = await this.gitResponse(
1821
+ task,
1822
+ binary,
1823
+ args,
1824
+ this.outputHandler,
1825
+ logger.step("SPAWN")
1826
+ );
1827
+ const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
1828
+ logger(`passing response to task's parser as a %s`, task.format);
1829
+ if (isBufferTask(task)) {
1830
+ return callTaskParser(task.parser, outputStreams);
1831
+ }
1832
+ return callTaskParser(task.parser, outputStreams.asStrings());
1833
+ }
1834
+ async attemptEmptyTask(task, logger) {
1835
+ logger(`empty task bypassing child process to call to task's parser`);
1836
+ return task.parser(this);
1837
+ }
1838
+ handleTaskData(task, args, result, logger) {
1839
+ const { exitCode, rejection, stdOut, stdErr } = result;
1840
+ return new Promise((done, fail) => {
1841
+ logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode);
1842
+ const { error } = this._plugins.exec(
1843
+ "task.error",
1844
+ { error: rejection },
1845
+ {
1846
+ ...pluginContext(task, args),
1847
+ ...result
1848
+ }
1849
+ );
1850
+ if (error && task.onError) {
1851
+ logger.info(`exitCode=%s handling with custom error handler`);
1852
+ return task.onError(
1853
+ result,
1854
+ error,
1855
+ (newStdOut) => {
1856
+ logger.info(`custom error handler treated as success`);
1857
+ logger(`custom error returned a %s`, objectToString(newStdOut));
1858
+ done(
1859
+ new GitOutputStreams(
1860
+ Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut,
1861
+ Buffer.concat(stdErr)
1862
+ )
1863
+ );
1864
+ },
1865
+ fail
1866
+ );
1867
+ }
1868
+ if (error) {
1869
+ logger.info(
1870
+ `handling as error: exitCode=%s stdErr=%s rejection=%o`,
1871
+ exitCode,
1872
+ stdErr.length,
1873
+ rejection
1874
+ );
1875
+ return fail(error);
1876
+ }
1877
+ logger.info(`retrieving task output complete`);
1878
+ done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
1879
+ });
1880
+ }
1881
+ async gitResponse(task, command, args, outputHandler, logger) {
1882
+ const outputLogger = logger.sibling("output");
1883
+ const spawnOptions = this._plugins.exec(
1884
+ "spawn.options",
1885
+ {
1886
+ cwd: this.cwd,
1887
+ env: this.env,
1888
+ windowsHide: true
1889
+ },
1890
+ pluginContext(task, task.commands)
1891
+ );
1892
+ return new Promise((done) => {
1893
+ const stdOut = [];
1894
+ const stdErr = [];
1895
+ logger.info(`%s %o`, command, args);
1896
+ logger("%O", spawnOptions);
1897
+ let rejection = this._beforeSpawn(task, args);
1898
+ if (rejection) {
1899
+ return done({
1900
+ stdOut,
1901
+ stdErr,
1902
+ exitCode: 9901,
1903
+ rejection
1904
+ });
1905
+ }
1906
+ this._plugins.exec("spawn.before", void 0, {
1907
+ ...pluginContext(task, args),
1908
+ kill(reason) {
1909
+ rejection = reason || rejection;
1910
+ }
1911
+ });
1912
+ const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);
1913
+ spawned.stdout.on(
1914
+ "data",
1915
+ onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
1916
+ );
1917
+ spawned.stderr.on(
1918
+ "data",
1919
+ onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
1920
+ );
1921
+ spawned.on("error", onErrorReceived(stdErr, logger));
1922
+ if (outputHandler) {
1923
+ logger(`Passing child process stdOut/stdErr to custom outputHandler`);
1924
+ outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
1925
+ }
1926
+ this._plugins.exec("spawn.after", void 0, {
1927
+ ...pluginContext(task, args),
1928
+ spawned,
1929
+ close(exitCode, reason) {
1930
+ done({
1931
+ stdOut,
1932
+ stdErr,
1933
+ exitCode,
1934
+ rejection: rejection || reason
1935
+ });
1936
+ },
1937
+ kill(reason) {
1938
+ if (spawned.killed) {
1939
+ return;
1940
+ }
1941
+ rejection = reason;
1942
+ spawned.kill("SIGINT");
1943
+ }
1944
+ });
1945
+ });
1946
+ }
1947
+ _beforeSpawn(task, args) {
1948
+ let rejection;
1949
+ this._plugins.exec("spawn.before", void 0, {
1950
+ ...pluginContext(task, args),
1951
+ kill(reason) {
1952
+ rejection = reason || rejection;
1953
+ }
1954
+ });
1955
+ return rejection;
1956
+ }
1957
+ };
1958
+ }
1959
+ });
1960
+
1961
+ // src/lib/runners/git-executor.ts
1962
+ var git_executor_exports = {};
1963
+ __export(git_executor_exports, {
1964
+ GitExecutor: () => GitExecutor
1965
+ });
1966
+ var GitExecutor;
1967
+ var init_git_executor = __esm({
1968
+ "src/lib/runners/git-executor.ts"() {
1969
+ "use strict";
1970
+ init_git_executor_chain();
1971
+ GitExecutor = class {
1972
+ constructor(cwd, _scheduler, _plugins) {
1973
+ this.cwd = cwd;
1974
+ this._scheduler = _scheduler;
1975
+ this._plugins = _plugins;
1976
+ this._chain = new GitExecutorChain(this, this._scheduler, this._plugins);
1977
+ }
1978
+ chain() {
1979
+ return new GitExecutorChain(this, this._scheduler, this._plugins);
1980
+ }
1981
+ push(task) {
1982
+ return this._chain.push(task);
1983
+ }
1984
+ };
1985
+ }
1986
+ });
1987
+
1988
+ // src/lib/task-callback.ts
1989
+ function taskCallback(task, response, callback = NOOP) {
1990
+ const onSuccess = (data) => {
1991
+ callback(null, data);
1992
+ };
1993
+ const onError2 = (err) => {
1994
+ if (err?.task === task) {
1995
+ callback(
1996
+ err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err,
1997
+ void 0
1998
+ );
1999
+ }
2000
+ };
2001
+ response.then(onSuccess, onError2);
2002
+ }
2003
+ function addDeprecationNoticeToError(err) {
2004
+ let log = (name) => {
2005
+ console.warn(
2006
+ `simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`
2007
+ );
2008
+ log = NOOP;
2009
+ };
2010
+ return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {}));
2011
+ function descriptorReducer(all, name) {
2012
+ if (name in err) {
2013
+ return all;
2014
+ }
2015
+ all[name] = {
2016
+ enumerable: false,
2017
+ configurable: false,
2018
+ get() {
2019
+ log(name);
2020
+ return err.git[name];
2021
+ }
2022
+ };
2023
+ return all;
2024
+ }
2025
+ }
2026
+ var init_task_callback = __esm({
2027
+ "src/lib/task-callback.ts"() {
2028
+ "use strict";
2029
+ init_git_response_error();
2030
+ init_utils();
2031
+ }
2032
+ });
2033
+
2034
+ // src/lib/tasks/change-working-directory.ts
2035
+ function changeWorkingDirectoryTask(directory, root) {
2036
+ return adhocExecTask((instance) => {
2037
+ if (!folderExists(directory)) {
2038
+ throw new Error(`Git.cwd: cannot change to non-directory "${directory}"`);
2039
+ }
2040
+ return (root || instance).cwd = directory;
2041
+ });
2042
+ }
2043
+ var init_change_working_directory = __esm({
2044
+ "src/lib/tasks/change-working-directory.ts"() {
2045
+ "use strict";
2046
+ init_utils();
2047
+ init_task();
2048
+ }
2049
+ });
2050
+
2051
+ // src/lib/tasks/checkout.ts
2052
+ function checkoutTask(args) {
2053
+ const commands = ["checkout", ...args];
2054
+ if (commands[1] === "-b" && commands.includes("-B")) {
2055
+ commands[1] = remove(commands, "-B");
2056
+ }
2057
+ return straightThroughStringTask(commands);
2058
+ }
2059
+ function checkout_default() {
2060
+ return {
2061
+ checkout() {
2062
+ return this._runTask(
2063
+ checkoutTask(getTrailingOptions(arguments, 1)),
2064
+ trailingFunctionArgument(arguments)
2065
+ );
2066
+ },
2067
+ checkoutBranch(branchName, startPoint) {
2068
+ return this._runTask(
2069
+ checkoutTask(["-b", branchName, startPoint, ...getTrailingOptions(arguments)]),
2070
+ trailingFunctionArgument(arguments)
2071
+ );
2072
+ },
2073
+ checkoutLocalBranch(branchName) {
2074
+ return this._runTask(
2075
+ checkoutTask(["-b", branchName, ...getTrailingOptions(arguments)]),
2076
+ trailingFunctionArgument(arguments)
2077
+ );
2078
+ }
2079
+ };
2080
+ }
2081
+ var init_checkout = __esm({
2082
+ "src/lib/tasks/checkout.ts"() {
2083
+ "use strict";
2084
+ init_utils();
2085
+ init_task();
2086
+ }
2087
+ });
2088
+
2089
+ // src/lib/tasks/count-objects.ts
2090
+ function countObjectsResponse() {
2091
+ return {
2092
+ count: 0,
2093
+ garbage: 0,
2094
+ inPack: 0,
2095
+ packs: 0,
2096
+ prunePackable: 0,
2097
+ size: 0,
2098
+ sizeGarbage: 0,
2099
+ sizePack: 0
2100
+ };
2101
+ }
2102
+ function count_objects_default() {
2103
+ return {
2104
+ countObjects() {
2105
+ return this._runTask({
2106
+ commands: ["count-objects", "--verbose"],
2107
+ format: "utf-8",
2108
+ parser(stdOut) {
2109
+ return parseStringResponse(countObjectsResponse(), [parser2], stdOut);
2110
+ }
2111
+ });
2112
+ }
2113
+ };
2114
+ }
2115
+ var parser2;
2116
+ var init_count_objects = __esm({
2117
+ "src/lib/tasks/count-objects.ts"() {
2118
+ "use strict";
2119
+ init_utils();
2120
+ parser2 = new LineParser(
2121
+ /([a-z-]+): (\d+)$/,
2122
+ (result, [key, value]) => {
2123
+ const property = asCamelCase(key);
2124
+ if (Object.hasOwn(result, property)) {
2125
+ result[property] = asNumber(value);
2126
+ }
2127
+ }
2128
+ );
2129
+ }
2130
+ });
2131
+
2132
+ // src/lib/parsers/parse-commit.ts
2133
+ function parseCommitResult(stdOut) {
2134
+ const result = {
2135
+ author: null,
2136
+ branch: "",
2137
+ commit: "",
2138
+ root: false,
2139
+ summary: {
2140
+ changes: 0,
2141
+ insertions: 0,
2142
+ deletions: 0
2143
+ }
2144
+ };
2145
+ return parseStringResponse(result, parsers, stdOut);
2146
+ }
2147
+ var parsers;
2148
+ var init_parse_commit = __esm({
2149
+ "src/lib/parsers/parse-commit.ts"() {
2150
+ "use strict";
2151
+ init_utils();
2152
+ parsers = [
2153
+ new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch, root, commit]) => {
2154
+ result.branch = branch;
2155
+ result.commit = commit;
2156
+ result.root = !!root;
2157
+ }),
2158
+ new LineParser(/\s*Author:\s(.+)/i, (result, [author]) => {
2159
+ const parts = author.split("<");
2160
+ const email = parts.pop();
2161
+ if (!email || !email.includes("@")) {
2162
+ return;
2163
+ }
2164
+ result.author = {
2165
+ email: email.substr(0, email.length - 1),
2166
+ name: parts.join("<").trim()
2167
+ };
2168
+ }),
2169
+ new LineParser(
2170
+ /(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,
2171
+ (result, [changes, insertions, deletions]) => {
2172
+ result.summary.changes = parseInt(changes, 10) || 0;
2173
+ result.summary.insertions = parseInt(insertions, 10) || 0;
2174
+ result.summary.deletions = parseInt(deletions, 10) || 0;
2175
+ }
2176
+ ),
2177
+ new LineParser(
2178
+ /^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,
2179
+ (result, [changes, lines, direction]) => {
2180
+ result.summary.changes = parseInt(changes, 10) || 0;
2181
+ const count = parseInt(lines, 10) || 0;
2182
+ if (direction === "-") {
2183
+ result.summary.deletions = count;
2184
+ } else if (direction === "+") {
2185
+ result.summary.insertions = count;
2186
+ }
2187
+ }
2188
+ )
2189
+ ];
2190
+ }
2191
+ });
2192
+
2193
+ // src/lib/tasks/commit.ts
2194
+ function commitTask(message, files, customArgs) {
2195
+ const commands = [
2196
+ "-c",
2197
+ "core.abbrev=40",
2198
+ "commit",
2199
+ ...prefixedArray(message, "-m"),
2200
+ ...files,
2201
+ ...customArgs
2202
+ ];
2203
+ return {
2204
+ commands,
2205
+ format: "utf-8",
2206
+ parser: parseCommitResult
2207
+ };
2208
+ }
2209
+ function commit_default() {
2210
+ return {
2211
+ commit(message, ...rest) {
2212
+ const next = trailingFunctionArgument(arguments);
2213
+ const task = rejectDeprecatedSignatures(message) || commitTask(
2214
+ asArray(message),
2215
+ asArray(filterType(rest[0], filterStringOrStringArray, [])),
2216
+ [
2217
+ ...asStringArray(filterType(rest[1], filterArray, [])),
2218
+ ...getTrailingOptions(arguments, 0, true)
2219
+ ]
2220
+ );
2221
+ return this._runTask(task, next);
2222
+ }
2223
+ };
2224
+ function rejectDeprecatedSignatures(message) {
2225
+ return !filterStringOrStringArray(message) && configurationErrorTask(
2226
+ `git.commit: requires the commit message to be supplied as a string/string[]`
2227
+ );
2228
+ }
2229
+ }
2230
+ var init_commit = __esm({
2231
+ "src/lib/tasks/commit.ts"() {
2232
+ "use strict";
2233
+ init_parse_commit();
2234
+ init_utils();
2235
+ init_task();
2236
+ }
2237
+ });
2238
+
2239
+ // src/lib/tasks/first-commit.ts
2240
+ function first_commit_default() {
2241
+ return {
2242
+ firstCommit() {
2243
+ return this._runTask(
2244
+ straightThroughStringTask(["rev-list", "--max-parents=0", "HEAD"], true),
2245
+ trailingFunctionArgument(arguments)
2246
+ );
2247
+ }
2248
+ };
2249
+ }
2250
+ var init_first_commit = __esm({
2251
+ "src/lib/tasks/first-commit.ts"() {
2252
+ "use strict";
2253
+ init_utils();
2254
+ init_task();
2255
+ }
2256
+ });
2257
+
2258
+ // src/lib/tasks/hash-object.ts
2259
+ function hashObjectTask(filePath, write) {
2260
+ const commands = ["hash-object", filePath];
2261
+ if (write) {
2262
+ commands.push("-w");
2263
+ }
2264
+ return straightThroughStringTask(commands, true);
2265
+ }
2266
+ var init_hash_object = __esm({
2267
+ "src/lib/tasks/hash-object.ts"() {
2268
+ "use strict";
2269
+ init_task();
2270
+ }
2271
+ });
2272
+
2273
+ // src/lib/responses/InitSummary.ts
2274
+ function parseInit(bare, path, text) {
2275
+ const response = String(text).trim();
2276
+ let result;
2277
+ if (result = initResponseRegex.exec(response)) {
2278
+ return new InitSummary(bare, path, false, result[1]);
2279
+ }
2280
+ if (result = reInitResponseRegex.exec(response)) {
2281
+ return new InitSummary(bare, path, true, result[1]);
2282
+ }
2283
+ let gitDir = "";
2284
+ const tokens = response.split(" ");
2285
+ while (tokens.length) {
2286
+ const token = tokens.shift();
2287
+ if (token === "in") {
2288
+ gitDir = tokens.join(" ");
2289
+ break;
2290
+ }
2291
+ }
2292
+ return new InitSummary(bare, path, /^re/i.test(response), gitDir);
2293
+ }
2294
+ var InitSummary, initResponseRegex, reInitResponseRegex;
2295
+ var init_InitSummary = __esm({
2296
+ "src/lib/responses/InitSummary.ts"() {
2297
+ "use strict";
2298
+ InitSummary = class {
2299
+ constructor(bare, path, existing, gitDir) {
2300
+ this.bare = bare;
2301
+ this.path = path;
2302
+ this.existing = existing;
2303
+ this.gitDir = gitDir;
2304
+ }
2305
+ };
2306
+ initResponseRegex = /^Init.+ repository in (.+)$/;
2307
+ reInitResponseRegex = /^Rein.+ in (.+)$/;
2308
+ }
2309
+ });
2310
+
2311
+ // src/lib/tasks/init.ts
2312
+ function hasBareCommand(command) {
2313
+ return command.includes(bareCommand);
2314
+ }
2315
+ function initTask(bare = false, path, customArgs) {
2316
+ const commands = ["init", ...customArgs];
2317
+ if (bare && !hasBareCommand(commands)) {
2318
+ commands.splice(1, 0, bareCommand);
2319
+ }
2320
+ return {
2321
+ commands,
2322
+ format: "utf-8",
2323
+ parser(text) {
2324
+ return parseInit(commands.includes("--bare"), path, text);
2325
+ }
2326
+ };
2327
+ }
2328
+ var bareCommand;
2329
+ var init_init = __esm({
2330
+ "src/lib/tasks/init.ts"() {
2331
+ "use strict";
2332
+ init_InitSummary();
2333
+ bareCommand = "--bare";
2334
+ }
2335
+ });
2336
+
2337
+ // src/lib/args/log-format.ts
2338
+ function logFormatFromCommand(customArgs) {
2339
+ for (let i = 0; i < customArgs.length; i++) {
2340
+ const format = logFormatRegex.exec(customArgs[i]);
2341
+ if (format) {
2342
+ return `--${format[1]}`;
2343
+ }
2344
+ }
2345
+ return "" /* NONE */;
2346
+ }
2347
+ function isLogFormat(customArg) {
2348
+ return logFormatRegex.test(customArg);
2349
+ }
2350
+ var logFormatRegex;
2351
+ var init_log_format = __esm({
2352
+ "src/lib/args/log-format.ts"() {
2353
+ "use strict";
2354
+ logFormatRegex = /^--(stat|numstat|name-only|name-status)(=|$)/;
2355
+ }
2356
+ });
2357
+
2358
+ // src/lib/responses/DiffSummary.ts
2359
+ var DiffSummary;
2360
+ var init_DiffSummary = __esm({
2361
+ "src/lib/responses/DiffSummary.ts"() {
2362
+ "use strict";
2363
+ DiffSummary = class {
2364
+ constructor() {
2365
+ this.changed = 0;
2366
+ this.deletions = 0;
2367
+ this.insertions = 0;
2368
+ this.files = [];
2369
+ }
2370
+ };
2371
+ }
2372
+ });
2373
+
2374
+ // src/lib/parsers/parse-diff-summary.ts
2375
+ function getDiffParser(format = "" /* NONE */) {
2376
+ const parser4 = diffSummaryParsers[format];
2377
+ return (stdOut) => parseStringResponse(new DiffSummary(), parser4, stdOut, false);
2378
+ }
2379
+ var statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers;
2380
+ var init_parse_diff_summary = __esm({
2381
+ "src/lib/parsers/parse-diff-summary.ts"() {
2382
+ "use strict";
2383
+ init_log_format();
2384
+ init_DiffSummary();
2385
+ init_diff_name_status();
2386
+ init_utils();
2387
+ statParser = [
2388
+ new LineParser(
2389
+ /^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,
2390
+ (result, [file, changes, alterations = ""]) => {
2391
+ result.files.push({
2392
+ file: file.trim(),
2393
+ changes: asNumber(changes),
2394
+ insertions: alterations.replace(/[^+]/g, "").length,
2395
+ deletions: alterations.replace(/[^-]/g, "").length,
2396
+ binary: false
2397
+ });
2398
+ }
2399
+ ),
2400
+ new LineParser(
2401
+ /^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,
2402
+ (result, [file, before, after]) => {
2403
+ result.files.push({
2404
+ file: file.trim(),
2405
+ before: asNumber(before),
2406
+ after: asNumber(after),
2407
+ binary: true
2408
+ });
2409
+ }
2410
+ ),
2411
+ new LineParser(
2412
+ /(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,
2413
+ (result, [changed, summary]) => {
2414
+ const inserted = /(\d+) i/.exec(summary);
2415
+ const deleted = /(\d+) d/.exec(summary);
2416
+ result.changed = asNumber(changed);
2417
+ result.insertions = asNumber(inserted?.[1]);
2418
+ result.deletions = asNumber(deleted?.[1]);
2419
+ }
2420
+ )
2421
+ ];
2422
+ numStatParser = [
2423
+ new LineParser(
2424
+ /(\d+)\t(\d+)\t(.+)$/,
2425
+ (result, [changesInsert, changesDelete, file]) => {
2426
+ const insertions = asNumber(changesInsert);
2427
+ const deletions = asNumber(changesDelete);
2428
+ result.changed++;
2429
+ result.insertions += insertions;
2430
+ result.deletions += deletions;
2431
+ result.files.push({
2432
+ file,
2433
+ changes: insertions + deletions,
2434
+ insertions,
2435
+ deletions,
2436
+ binary: false
2437
+ });
2438
+ }
2439
+ ),
2440
+ new LineParser(/-\t-\t(.+)$/, (result, [file]) => {
2441
+ result.changed++;
2442
+ result.files.push({
2443
+ file,
2444
+ after: 0,
2445
+ before: 0,
2446
+ binary: true
2447
+ });
2448
+ })
2449
+ ];
2450
+ nameOnlyParser = [
2451
+ new LineParser(/(.+)$/, (result, [file]) => {
2452
+ result.changed++;
2453
+ result.files.push({
2454
+ file,
2455
+ changes: 0,
2456
+ insertions: 0,
2457
+ deletions: 0,
2458
+ binary: false
2459
+ });
2460
+ })
2461
+ ];
2462
+ nameStatusParser = [
2463
+ new LineParser(
2464
+ /([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,
2465
+ (result, [status, similarity, from, _to, to]) => {
2466
+ result.changed++;
2467
+ result.files.push({
2468
+ file: to ?? from,
2469
+ changes: 0,
2470
+ insertions: 0,
2471
+ deletions: 0,
2472
+ binary: false,
2473
+ status: orVoid(isDiffNameStatus(status) && status),
2474
+ from: orVoid(!!to && from !== to && from),
2475
+ similarity: asNumber(similarity)
2476
+ });
2477
+ }
2478
+ )
2479
+ ];
2480
+ diffSummaryParsers = {
2481
+ ["" /* NONE */]: statParser,
2482
+ ["--stat" /* STAT */]: statParser,
2483
+ ["--numstat" /* NUM_STAT */]: numStatParser,
2484
+ ["--name-status" /* NAME_STATUS */]: nameStatusParser,
2485
+ ["--name-only" /* NAME_ONLY */]: nameOnlyParser
2486
+ };
2487
+ }
2488
+ });
2489
+
2490
+ // src/lib/parsers/parse-list-log-summary.ts
2491
+ function lineBuilder(tokens, fields) {
2492
+ return fields.reduce(
2493
+ (line, field, index) => {
2494
+ line[field] = tokens[index] || "";
2495
+ return line;
2496
+ },
2497
+ /* @__PURE__ */ Object.create({ diff: null })
2498
+ );
2499
+ }
2500
+ function createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames, logFormat = "" /* NONE */) {
2501
+ const parseDiffResult = getDiffParser(logFormat);
2502
+ return function(stdOut) {
2503
+ const all = toLinesWithContent(
2504
+ stdOut.trim(),
2505
+ false,
2506
+ START_BOUNDARY
2507
+ ).map(function(item) {
2508
+ const lineDetail = item.split(COMMIT_BOUNDARY);
2509
+ const listLogLine = lineBuilder(lineDetail[0].split(splitter), fields);
2510
+ if (lineDetail.length > 1 && !!lineDetail[1].trim()) {
2511
+ listLogLine.diff = parseDiffResult(lineDetail[1]);
2512
+ }
2513
+ return listLogLine;
2514
+ });
2515
+ return {
2516
+ all,
2517
+ latest: all.length && all[0] || null,
2518
+ total: all.length
2519
+ };
2520
+ };
2521
+ }
2522
+ var START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames;
2523
+ var init_parse_list_log_summary = __esm({
2524
+ "src/lib/parsers/parse-list-log-summary.ts"() {
2525
+ "use strict";
2526
+ init_utils();
2527
+ init_parse_diff_summary();
2528
+ init_log_format();
2529
+ START_BOUNDARY = "\xF2\xF2\xF2\xF2\xF2\xF2 ";
2530
+ COMMIT_BOUNDARY = " \xF2\xF2";
2531
+ SPLITTER = " \xF2 ";
2532
+ defaultFieldNames = ["hash", "date", "message", "refs", "author_name", "author_email"];
2533
+ }
2534
+ });
2535
+
2536
+ // src/lib/tasks/diff.ts
2537
+ var diff_exports = {};
2538
+ __export(diff_exports, {
2539
+ diffSummaryTask: () => diffSummaryTask,
2540
+ validateLogFormatConfig: () => validateLogFormatConfig
2541
+ });
2542
+ function diffSummaryTask(customArgs) {
2543
+ let logFormat = logFormatFromCommand(customArgs);
2544
+ const commands = ["diff"];
2545
+ if (logFormat === "" /* NONE */) {
2546
+ logFormat = "--stat" /* STAT */;
2547
+ commands.push("--stat=4096");
2548
+ }
2549
+ commands.push(...customArgs);
2550
+ return validateLogFormatConfig(commands) || {
2551
+ commands,
2552
+ format: "utf-8",
2553
+ parser: getDiffParser(logFormat)
2554
+ };
2555
+ }
2556
+ function validateLogFormatConfig(customArgs) {
2557
+ const flags = customArgs.filter(isLogFormat);
2558
+ if (flags.length > 1) {
2559
+ return configurationErrorTask(
2560
+ `Summary flags are mutually exclusive - pick one of ${flags.join(",")}`
2561
+ );
2562
+ }
2563
+ if (flags.length && customArgs.includes("-z")) {
2564
+ return configurationErrorTask(
2565
+ `Summary flag ${flags} parsing is not compatible with null termination option '-z'`
2566
+ );
2567
+ }
2568
+ }
2569
+ var init_diff = __esm({
2570
+ "src/lib/tasks/diff.ts"() {
2571
+ "use strict";
2572
+ init_log_format();
2573
+ init_parse_diff_summary();
2574
+ init_task();
2575
+ }
2576
+ });
2577
+
2578
+ // src/lib/tasks/log.ts
2579
+ function prettyFormat(format, splitter) {
2580
+ const fields = [];
2581
+ const formatStr = [];
2582
+ Object.keys(format).forEach((field) => {
2583
+ fields.push(field);
2584
+ formatStr.push(String(format[field]));
2585
+ });
2586
+ return [fields, formatStr.join(splitter)];
2587
+ }
2588
+ function userOptions(input) {
2589
+ return Object.keys(input).reduce((out, key) => {
2590
+ if (!(key in excludeOptions)) {
2591
+ out[key] = input[key];
2592
+ }
2593
+ return out;
2594
+ }, {});
2595
+ }
2596
+ function parseLogOptions(opt = {}, customArgs = []) {
2597
+ const splitter = filterType(opt.splitter, filterString, SPLITTER);
2598
+ const format = filterPlainObject(opt.format) ? opt.format : {
2599
+ hash: "%H",
2600
+ date: opt.strictDate === false ? "%ai" : "%aI",
2601
+ message: "%s",
2602
+ refs: "%D",
2603
+ body: opt.multiLine ? "%B" : "%b",
2604
+ author_name: opt.mailMap !== false ? "%aN" : "%an",
2605
+ author_email: opt.mailMap !== false ? "%aE" : "%ae"
2606
+ };
2607
+ const [fields, formatStr] = prettyFormat(format, splitter);
2608
+ const suffix = [];
2609
+ const command = [
2610
+ `--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`,
2611
+ ...customArgs
2612
+ ];
2613
+ const maxCount = opt.n || opt["max-count"] || opt.maxCount;
2614
+ if (maxCount) {
2615
+ command.push(`--max-count=${maxCount}`);
2616
+ }
2617
+ if (opt.from || opt.to) {
2618
+ const rangeOperator = opt.symmetric !== false ? "..." : "..";
2619
+ suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
2620
+ }
2621
+ if (filterString(opt.file)) {
2622
+ command.push("--follow", (0, import_args_pathspec5.pathspec)(opt.file));
2623
+ }
2624
+ appendTaskOptions(userOptions(opt), command);
2625
+ return {
2626
+ fields,
2627
+ splitter,
2628
+ commands: [...command, ...suffix]
2629
+ };
2630
+ }
2631
+ function logTask(splitter, fields, customArgs) {
2632
+ const parser4 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs));
2633
+ return {
2634
+ commands: ["log", ...customArgs],
2635
+ format: "utf-8",
2636
+ parser: parser4
2637
+ };
2638
+ }
2639
+ function log_default() {
2640
+ return {
2641
+ log(...rest) {
2642
+ const next = trailingFunctionArgument(arguments);
2643
+ const options = parseLogOptions(
2644
+ trailingOptionsArgument(arguments),
2645
+ asStringArray(filterType(arguments[0], filterArray, []))
2646
+ );
2647
+ const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
2648
+ return this._runTask(task, next);
2649
+ }
2650
+ };
2651
+ function createLogTask(options) {
2652
+ return logTask(options.splitter, options.fields, options.commands);
2653
+ }
2654
+ function rejectDeprecatedSignatures(from, to) {
2655
+ return filterString(from) && filterString(to) && configurationErrorTask(
2656
+ `git.log(string, string) should be replaced with git.log({ from: string, to: string })`
2657
+ );
2658
+ }
2659
+ }
2660
+ var import_args_pathspec5, excludeOptions;
2661
+ var init_log = __esm({
2662
+ "src/lib/tasks/log.ts"() {
2663
+ "use strict";
2664
+ init_log_format();
2665
+ import_args_pathspec5 = require("@simple-git/args-pathspec");
2666
+ init_parse_list_log_summary();
2667
+ init_utils();
2668
+ init_task();
2669
+ init_diff();
2670
+ excludeOptions = /* @__PURE__ */ ((excludeOptions2) => {
2671
+ excludeOptions2[excludeOptions2["--pretty"] = 0] = "--pretty";
2672
+ excludeOptions2[excludeOptions2["max-count"] = 1] = "max-count";
2673
+ excludeOptions2[excludeOptions2["maxCount"] = 2] = "maxCount";
2674
+ excludeOptions2[excludeOptions2["n"] = 3] = "n";
2675
+ excludeOptions2[excludeOptions2["file"] = 4] = "file";
2676
+ excludeOptions2[excludeOptions2["format"] = 5] = "format";
2677
+ excludeOptions2[excludeOptions2["from"] = 6] = "from";
2678
+ excludeOptions2[excludeOptions2["to"] = 7] = "to";
2679
+ excludeOptions2[excludeOptions2["splitter"] = 8] = "splitter";
2680
+ excludeOptions2[excludeOptions2["symmetric"] = 9] = "symmetric";
2681
+ excludeOptions2[excludeOptions2["mailMap"] = 10] = "mailMap";
2682
+ excludeOptions2[excludeOptions2["multiLine"] = 11] = "multiLine";
2683
+ excludeOptions2[excludeOptions2["strictDate"] = 12] = "strictDate";
2684
+ return excludeOptions2;
2685
+ })(excludeOptions || {});
2686
+ }
2687
+ });
2688
+
2689
+ // src/lib/responses/MergeSummary.ts
2690
+ var MergeSummaryConflict, MergeSummaryDetail;
2691
+ var init_MergeSummary = __esm({
2692
+ "src/lib/responses/MergeSummary.ts"() {
2693
+ "use strict";
2694
+ MergeSummaryConflict = class {
2695
+ constructor(reason, file = null, meta) {
2696
+ this.reason = reason;
2697
+ this.file = file;
2698
+ this.meta = meta;
2699
+ }
2700
+ toString() {
2701
+ return `${this.file}:${this.reason}`;
2702
+ }
2703
+ };
2704
+ MergeSummaryDetail = class {
2705
+ constructor() {
2706
+ this.conflicts = [];
2707
+ this.merges = [];
2708
+ this.result = "success";
2709
+ }
2710
+ get failed() {
2711
+ return this.conflicts.length > 0;
2712
+ }
2713
+ get reason() {
2714
+ return this.result;
2715
+ }
2716
+ toString() {
2717
+ if (this.conflicts.length) {
2718
+ return `CONFLICTS: ${this.conflicts.join(", ")}`;
2719
+ }
2720
+ return "OK";
2721
+ }
2722
+ };
2723
+ }
2724
+ });
2725
+
2726
+ // src/lib/responses/PullSummary.ts
2727
+ var PullSummary, PullFailedSummary;
2728
+ var init_PullSummary = __esm({
2729
+ "src/lib/responses/PullSummary.ts"() {
2730
+ "use strict";
2731
+ PullSummary = class {
2732
+ constructor() {
2733
+ this.remoteMessages = {
2734
+ all: []
2735
+ };
2736
+ this.created = [];
2737
+ this.deleted = [];
2738
+ this.files = [];
2739
+ this.deletions = {};
2740
+ this.insertions = {};
2741
+ this.summary = {
2742
+ changes: 0,
2743
+ deletions: 0,
2744
+ insertions: 0
2745
+ };
2746
+ }
2747
+ };
2748
+ PullFailedSummary = class {
2749
+ constructor() {
2750
+ this.remote = "";
2751
+ this.hash = {
2752
+ local: "",
2753
+ remote: ""
2754
+ };
2755
+ this.branch = {
2756
+ local: "",
2757
+ remote: ""
2758
+ };
2759
+ this.message = "";
2760
+ }
2761
+ toString() {
2762
+ return this.message;
2763
+ }
2764
+ };
2765
+ }
2766
+ });
2767
+
2768
+ // src/lib/parsers/parse-remote-objects.ts
2769
+ function objectEnumerationResult(remoteMessages) {
2770
+ return remoteMessages.objects = remoteMessages.objects || {
2771
+ compressing: 0,
2772
+ counting: 0,
2773
+ enumerating: 0,
2774
+ packReused: 0,
2775
+ reused: { count: 0, delta: 0 },
2776
+ total: { count: 0, delta: 0 }
2777
+ };
2778
+ }
2779
+ function asObjectCount(source) {
2780
+ const count = /^\s*(\d+)/.exec(source);
2781
+ const delta = /delta (\d+)/i.exec(source);
2782
+ return {
2783
+ count: asNumber(count && count[1] || "0"),
2784
+ delta: asNumber(delta && delta[1] || "0")
2785
+ };
2786
+ }
2787
+ var remoteMessagesObjectParsers;
2788
+ var init_parse_remote_objects = __esm({
2789
+ "src/lib/parsers/parse-remote-objects.ts"() {
2790
+ "use strict";
2791
+ init_utils();
2792
+ remoteMessagesObjectParsers = [
2793
+ new RemoteLineParser(
2794
+ /^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,
2795
+ (result, [action, count]) => {
2796
+ const key = action.toLowerCase();
2797
+ const enumeration = objectEnumerationResult(result.remoteMessages);
2798
+ Object.assign(enumeration, { [key]: asNumber(count) });
2799
+ }
2800
+ ),
2801
+ new RemoteLineParser(
2802
+ /^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,
2803
+ (result, [action, count]) => {
2804
+ const key = action.toLowerCase();
2805
+ const enumeration = objectEnumerationResult(result.remoteMessages);
2806
+ Object.assign(enumeration, { [key]: asNumber(count) });
2807
+ }
2808
+ ),
2809
+ new RemoteLineParser(
2810
+ /total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,
2811
+ (result, [total, reused, packReused]) => {
2812
+ const objects = objectEnumerationResult(result.remoteMessages);
2813
+ objects.total = asObjectCount(total);
2814
+ objects.reused = asObjectCount(reused);
2815
+ objects.packReused = asNumber(packReused);
2816
+ }
2817
+ )
2818
+ ];
2819
+ }
2820
+ });
2821
+
2822
+ // src/lib/parsers/parse-remote-messages.ts
2823
+ function parseRemoteMessages(_stdOut, stdErr) {
2824
+ return parseStringResponse({ remoteMessages: new RemoteMessageSummary() }, parsers2, stdErr);
2825
+ }
2826
+ var parsers2, RemoteMessageSummary;
2827
+ var init_parse_remote_messages = __esm({
2828
+ "src/lib/parsers/parse-remote-messages.ts"() {
2829
+ "use strict";
2830
+ init_utils();
2831
+ init_parse_remote_objects();
2832
+ parsers2 = [
2833
+ new RemoteLineParser(/^remote:\s*(.+)$/, (result, [text]) => {
2834
+ result.remoteMessages.all.push(text.trim());
2835
+ return false;
2836
+ }),
2837
+ ...remoteMessagesObjectParsers,
2838
+ new RemoteLineParser(
2839
+ [/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/],
2840
+ (result, [pullRequestUrl]) => {
2841
+ result.remoteMessages.pullRequestUrl = pullRequestUrl;
2842
+ }
2843
+ ),
2844
+ new RemoteLineParser(
2845
+ [/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/],
2846
+ (result, [count, summary, url]) => {
2847
+ result.remoteMessages.vulnerabilities = {
2848
+ count: asNumber(count),
2849
+ summary,
2850
+ url
2851
+ };
2852
+ }
2853
+ )
2854
+ ];
2855
+ RemoteMessageSummary = class {
2856
+ constructor() {
2857
+ this.all = [];
2858
+ }
2859
+ };
2860
+ }
2861
+ });
2862
+
2863
+ // src/lib/parsers/parse-pull.ts
2864
+ function parsePullErrorResult(stdOut, stdErr) {
2865
+ const pullError = parseStringResponse(new PullFailedSummary(), errorParsers, [stdOut, stdErr]);
2866
+ return pullError.message && pullError;
2867
+ }
2868
+ var FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers3, errorParsers, parsePullDetail, parsePullResult;
2869
+ var init_parse_pull = __esm({
2870
+ "src/lib/parsers/parse-pull.ts"() {
2871
+ "use strict";
2872
+ init_PullSummary();
2873
+ init_utils();
2874
+ init_parse_remote_messages();
2875
+ FILE_UPDATE_REGEX = /^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/;
2876
+ SUMMARY_REGEX = /(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/;
2877
+ ACTION_REGEX = /^(create|delete) mode \d+ (.+)/;
2878
+ parsers3 = [
2879
+ new LineParser(FILE_UPDATE_REGEX, (result, [file, insertions, deletions]) => {
2880
+ result.files.push(file);
2881
+ if (insertions) {
2882
+ result.insertions[file] = insertions.length;
2883
+ }
2884
+ if (deletions) {
2885
+ result.deletions[file] = deletions.length;
2886
+ }
2887
+ }),
2888
+ new LineParser(SUMMARY_REGEX, (result, [changes, , insertions, , deletions]) => {
2889
+ if (insertions !== void 0 || deletions !== void 0) {
2890
+ result.summary.changes = +changes || 0;
2891
+ result.summary.insertions = +insertions || 0;
2892
+ result.summary.deletions = +deletions || 0;
2893
+ return true;
2894
+ }
2895
+ return false;
2896
+ }),
2897
+ new LineParser(ACTION_REGEX, (result, [action, file]) => {
2898
+ append(result.files, file);
2899
+ append(action === "create" ? result.created : result.deleted, file);
2900
+ })
2901
+ ];
2902
+ errorParsers = [
2903
+ new LineParser(/^from\s(.+)$/i, (result, [remote]) => void (result.remote = remote)),
2904
+ new LineParser(/^fatal:\s(.+)$/, (result, [message]) => void (result.message = message)),
2905
+ new LineParser(
2906
+ /([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,
2907
+ (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => {
2908
+ result.branch.local = branchLocal;
2909
+ result.hash.local = hashLocal;
2910
+ result.branch.remote = branchRemote;
2911
+ result.hash.remote = hashRemote;
2912
+ }
2913
+ )
2914
+ ];
2915
+ parsePullDetail = (stdOut, stdErr) => {
2916
+ return parseStringResponse(new PullSummary(), parsers3, [stdOut, stdErr]);
2917
+ };
2918
+ parsePullResult = (stdOut, stdErr) => {
2919
+ return Object.assign(
2920
+ new PullSummary(),
2921
+ parsePullDetail(stdOut, stdErr),
2922
+ parseRemoteMessages(stdOut, stdErr)
2923
+ );
2924
+ };
2925
+ }
2926
+ });
2927
+
2928
+ // src/lib/parsers/parse-merge.ts
2929
+ var parsers4, parseMergeResult, parseMergeDetail;
2930
+ var init_parse_merge = __esm({
2931
+ "src/lib/parsers/parse-merge.ts"() {
2932
+ "use strict";
2933
+ init_MergeSummary();
2934
+ init_utils();
2935
+ init_parse_pull();
2936
+ parsers4 = [
2937
+ new LineParser(/^Auto-merging\s+(.+)$/, (summary, [autoMerge]) => {
2938
+ summary.merges.push(autoMerge);
2939
+ }),
2940
+ new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/, (summary, [reason, file]) => {
2941
+ summary.conflicts.push(new MergeSummaryConflict(reason, file));
2942
+ }),
2943
+ new LineParser(
2944
+ /^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,
2945
+ (summary, [reason, file, deleteRef]) => {
2946
+ summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef }));
2947
+ }
2948
+ ),
2949
+ new LineParser(/^CONFLICT\s+\((.+)\):/, (summary, [reason]) => {
2950
+ summary.conflicts.push(new MergeSummaryConflict(reason, null));
2951
+ }),
2952
+ new LineParser(/^Automatic merge failed;\s+(.+)$/, (summary, [result]) => {
2953
+ summary.result = result;
2954
+ })
2955
+ ];
2956
+ parseMergeResult = (stdOut, stdErr) => {
2957
+ return Object.assign(parseMergeDetail(stdOut, stdErr), parsePullResult(stdOut, stdErr));
2958
+ };
2959
+ parseMergeDetail = (stdOut) => {
2960
+ return parseStringResponse(new MergeSummaryDetail(), parsers4, stdOut);
2961
+ };
2962
+ }
2963
+ });
2964
+
2965
+ // src/lib/tasks/merge.ts
2966
+ function mergeTask(customArgs) {
2967
+ if (!customArgs.length) {
2968
+ return configurationErrorTask("Git.merge requires at least one option");
2969
+ }
2970
+ return {
2971
+ commands: ["merge", ...customArgs],
2972
+ format: "utf-8",
2973
+ parser(stdOut, stdErr) {
2974
+ const merge = parseMergeResult(stdOut, stdErr);
2975
+ if (merge.failed) {
2976
+ throw new GitResponseError(merge);
2977
+ }
2978
+ return merge;
2979
+ }
2980
+ };
2981
+ }
2982
+ var init_merge = __esm({
2983
+ "src/lib/tasks/merge.ts"() {
2984
+ "use strict";
2985
+ init_git_response_error();
2986
+ init_parse_merge();
2987
+ init_task();
2988
+ }
2989
+ });
2990
+
2991
+ // src/lib/parsers/parse-push.ts
2992
+ function pushResultPushedItem(local, remote, status) {
2993
+ const deleted = status.includes("deleted");
2994
+ const tag = status.includes("tag") || /^refs\/tags/.test(local);
2995
+ const alreadyUpdated = !status.includes("new");
2996
+ return {
2997
+ deleted,
2998
+ tag,
2999
+ branch: !tag,
3000
+ new: !alreadyUpdated,
3001
+ alreadyUpdated,
3002
+ local,
3003
+ remote
3004
+ };
3005
+ }
3006
+ var parsers5, parsePushResult, parsePushDetail;
3007
+ var init_parse_push = __esm({
3008
+ "src/lib/parsers/parse-push.ts"() {
3009
+ "use strict";
3010
+ init_utils();
3011
+ init_parse_remote_messages();
3012
+ parsers5 = [
3013
+ new LineParser(/^Pushing to (.+)$/, (result, [repo]) => {
3014
+ result.repo = repo;
3015
+ }),
3016
+ new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
3017
+ result.ref = {
3018
+ ...result.ref || {},
3019
+ local
3020
+ };
3021
+ }),
3022
+ new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
3023
+ result.pushed.push(pushResultPushedItem(local, remote, type));
3024
+ }),
3025
+ new LineParser(
3026
+ /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
3027
+ (result, [local, remote, remoteName]) => {
3028
+ result.branch = {
3029
+ ...result.branch || {},
3030
+ local,
3031
+ remote,
3032
+ remoteName
3033
+ };
3034
+ }
3035
+ ),
3036
+ new LineParser(
3037
+ /^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,
3038
+ (result, [local, remote, from, to]) => {
3039
+ result.update = {
3040
+ head: {
3041
+ local,
3042
+ remote
3043
+ },
3044
+ hash: {
3045
+ from,
3046
+ to
3047
+ }
3048
+ };
3049
+ }
3050
+ )
3051
+ ];
3052
+ parsePushResult = (stdOut, stdErr) => {
3053
+ const pushDetail = parsePushDetail(stdOut, stdErr);
3054
+ const responseDetail = parseRemoteMessages(stdOut, stdErr);
3055
+ return {
3056
+ ...pushDetail,
3057
+ ...responseDetail
3058
+ };
3059
+ };
3060
+ parsePushDetail = (stdOut, stdErr) => {
3061
+ return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
3062
+ };
3063
+ }
3064
+ });
3065
+
3066
+ // src/lib/tasks/push.ts
3067
+ var push_exports = {};
3068
+ __export(push_exports, {
3069
+ pushTagsTask: () => pushTagsTask,
3070
+ pushTask: () => pushTask
3071
+ });
3072
+ function pushTagsTask(ref = {}, customArgs) {
3073
+ append(customArgs, "--tags");
3074
+ return pushTask(ref, customArgs);
3075
+ }
3076
+ function pushTask(ref = {}, customArgs) {
3077
+ const commands = ["push", ...customArgs];
3078
+ if (ref.branch) {
3079
+ commands.splice(1, 0, ref.branch);
3080
+ }
3081
+ if (ref.remote) {
3082
+ commands.splice(1, 0, ref.remote);
3083
+ }
3084
+ remove(commands, "-v");
3085
+ append(commands, "--verbose");
3086
+ append(commands, "--porcelain");
3087
+ return {
3088
+ commands,
3089
+ format: "utf-8",
3090
+ parser: parsePushResult
3091
+ };
3092
+ }
3093
+ var init_push = __esm({
3094
+ "src/lib/tasks/push.ts"() {
3095
+ "use strict";
3096
+ init_parse_push();
3097
+ init_utils();
3098
+ }
3099
+ });
3100
+
3101
+ // src/lib/tasks/show.ts
3102
+ function show_default() {
3103
+ return {
3104
+ showBuffer() {
3105
+ const commands = ["show", ...getTrailingOptions(arguments, 1)];
3106
+ if (!commands.includes("--binary")) {
3107
+ commands.splice(1, 0, "--binary");
3108
+ }
3109
+ return this._runTask(
3110
+ straightThroughBufferTask(commands),
3111
+ trailingFunctionArgument(arguments)
3112
+ );
3113
+ },
3114
+ show() {
3115
+ const commands = ["show", ...getTrailingOptions(arguments, 1)];
3116
+ return this._runTask(
3117
+ straightThroughStringTask(commands),
3118
+ trailingFunctionArgument(arguments)
3119
+ );
3120
+ }
3121
+ };
3122
+ }
3123
+ var init_show = __esm({
3124
+ "src/lib/tasks/show.ts"() {
3125
+ "use strict";
3126
+ init_utils();
3127
+ init_task();
3128
+ }
3129
+ });
3130
+
3131
+ // src/lib/responses/FileStatusSummary.ts
3132
+ var fromPathRegex, FileStatusSummary;
3133
+ var init_FileStatusSummary = __esm({
3134
+ "src/lib/responses/FileStatusSummary.ts"() {
3135
+ "use strict";
3136
+ fromPathRegex = /^(.+)\0(.+)$/;
3137
+ FileStatusSummary = class {
3138
+ constructor(path, index, working_dir) {
3139
+ this.path = path;
3140
+ this.index = index;
3141
+ this.working_dir = working_dir;
3142
+ if (index === "R" || working_dir === "R") {
3143
+ const detail = fromPathRegex.exec(path) || [null, path, path];
3144
+ this.from = detail[2] || "";
3145
+ this.path = detail[1] || "";
3146
+ }
3147
+ }
3148
+ };
3149
+ }
3150
+ });
3151
+
3152
+ // src/lib/responses/StatusSummary.ts
3153
+ function renamedFile(line) {
3154
+ const [to, from] = line.split(NULL);
3155
+ return {
3156
+ from: from || to,
3157
+ to
3158
+ };
3159
+ }
3160
+ function parser3(indexX, indexY, handler) {
3161
+ return [`${indexX}${indexY}`, handler];
3162
+ }
3163
+ function conflicts(indexX, ...indexY) {
3164
+ return indexY.map((y) => parser3(indexX, y, (result, file) => result.conflicted.push(file)));
3165
+ }
3166
+ function splitLine(result, lineStr) {
3167
+ const trimmed2 = lineStr.trim();
3168
+ switch (" ") {
3169
+ case trimmed2.charAt(2):
3170
+ return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
3171
+ case trimmed2.charAt(1):
3172
+ return data(" " /* NONE */, trimmed2.charAt(0), trimmed2.slice(2));
3173
+ default:
3174
+ return;
3175
+ }
3176
+ function data(index, workingDir, path) {
3177
+ const raw = `${index}${workingDir}`;
3178
+ const handler = parsers6.get(raw);
3179
+ if (handler) {
3180
+ handler(result, path);
3181
+ }
3182
+ if (raw !== "##" && raw !== "!!") {
3183
+ result.files.push(new FileStatusSummary(path, index, workingDir));
3184
+ }
3185
+ }
3186
+ }
3187
+ var StatusSummary, parsers6, parseStatusSummary;
3188
+ var init_StatusSummary = __esm({
3189
+ "src/lib/responses/StatusSummary.ts"() {
3190
+ "use strict";
3191
+ init_utils();
3192
+ init_FileStatusSummary();
3193
+ StatusSummary = class {
3194
+ constructor() {
3195
+ this.not_added = [];
3196
+ this.conflicted = [];
3197
+ this.created = [];
3198
+ this.deleted = [];
3199
+ this.ignored = void 0;
3200
+ this.modified = [];
3201
+ this.renamed = [];
3202
+ this.files = [];
3203
+ this.staged = [];
3204
+ this.ahead = 0;
3205
+ this.behind = 0;
3206
+ this.current = null;
3207
+ this.tracking = null;
3208
+ this.detached = false;
3209
+ this.isClean = () => {
3210
+ return !this.files.length;
3211
+ };
3212
+ }
3213
+ };
3214
+ parsers6 = new Map([
3215
+ parser3(
3216
+ " " /* NONE */,
3217
+ "A" /* ADDED */,
3218
+ (result, file) => result.created.push(file)
3219
+ ),
3220
+ parser3(
3221
+ " " /* NONE */,
3222
+ "D" /* DELETED */,
3223
+ (result, file) => result.deleted.push(file)
3224
+ ),
3225
+ parser3(
3226
+ " " /* NONE */,
3227
+ "M" /* MODIFIED */,
3228
+ (result, file) => result.modified.push(file)
3229
+ ),
3230
+ parser3("A" /* ADDED */, " " /* NONE */, (result, file) => {
3231
+ result.created.push(file);
3232
+ result.staged.push(file);
3233
+ }),
3234
+ parser3("A" /* ADDED */, "M" /* MODIFIED */, (result, file) => {
3235
+ result.created.push(file);
3236
+ result.staged.push(file);
3237
+ result.modified.push(file);
3238
+ }),
3239
+ parser3("D" /* DELETED */, " " /* NONE */, (result, file) => {
3240
+ result.deleted.push(file);
3241
+ result.staged.push(file);
3242
+ }),
3243
+ parser3("M" /* MODIFIED */, " " /* NONE */, (result, file) => {
3244
+ result.modified.push(file);
3245
+ result.staged.push(file);
3246
+ }),
3247
+ parser3("M" /* MODIFIED */, "M" /* MODIFIED */, (result, file) => {
3248
+ result.modified.push(file);
3249
+ result.staged.push(file);
3250
+ }),
3251
+ parser3("R" /* RENAMED */, " " /* NONE */, (result, file) => {
3252
+ result.renamed.push(renamedFile(file));
3253
+ }),
3254
+ parser3("R" /* RENAMED */, "M" /* MODIFIED */, (result, file) => {
3255
+ const renamed = renamedFile(file);
3256
+ result.renamed.push(renamed);
3257
+ result.modified.push(renamed.to);
3258
+ }),
3259
+ parser3("!" /* IGNORED */, "!" /* IGNORED */, (_result, _file) => {
3260
+ (_result.ignored = _result.ignored || []).push(_file);
3261
+ }),
3262
+ parser3(
3263
+ "?" /* UNTRACKED */,
3264
+ "?" /* UNTRACKED */,
3265
+ (result, file) => result.not_added.push(file)
3266
+ ),
3267
+ ...conflicts("A" /* ADDED */, "A" /* ADDED */, "U" /* UNMERGED */),
3268
+ ...conflicts(
3269
+ "D" /* DELETED */,
3270
+ "D" /* DELETED */,
3271
+ "U" /* UNMERGED */
3272
+ ),
3273
+ ...conflicts(
3274
+ "U" /* UNMERGED */,
3275
+ "A" /* ADDED */,
3276
+ "D" /* DELETED */,
3277
+ "U" /* UNMERGED */
3278
+ ),
3279
+ [
3280
+ "##",
3281
+ (result, line) => {
3282
+ const aheadReg = /ahead (\d+)/;
3283
+ const behindReg = /behind (\d+)/;
3284
+ const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
3285
+ const trackingReg = /\.{3}(\S*)/;
3286
+ const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
3287
+ let regexResult = aheadReg.exec(line);
3288
+ result.ahead = regexResult && +regexResult[1] || 0;
3289
+ regexResult = behindReg.exec(line);
3290
+ result.behind = regexResult && +regexResult[1] || 0;
3291
+ regexResult = currentReg.exec(line);
3292
+ result.current = filterType(regexResult?.[1], filterString, null);
3293
+ regexResult = trackingReg.exec(line);
3294
+ result.tracking = filterType(regexResult?.[1], filterString, null);
3295
+ regexResult = onEmptyBranchReg.exec(line);
3296
+ if (regexResult) {
3297
+ result.current = filterType(regexResult?.[1], filterString, result.current);
3298
+ }
3299
+ result.detached = /\(no branch\)/.test(line);
3300
+ }
3301
+ ]
3302
+ ]);
3303
+ parseStatusSummary = function(text) {
3304
+ const lines = text.split(NULL);
3305
+ const status = new StatusSummary();
3306
+ for (let i = 0, l = lines.length; i < l; ) {
3307
+ let line = lines[i++].trim();
3308
+ if (!line) {
3309
+ continue;
3310
+ }
3311
+ if (line.charAt(0) === "R" /* RENAMED */) {
3312
+ line += NULL + (lines[i++] || "");
3313
+ }
3314
+ splitLine(status, line);
3315
+ }
3316
+ return status;
3317
+ };
3318
+ }
3319
+ });
3320
+
3321
+ // src/lib/tasks/status.ts
3322
+ function statusTask(customArgs) {
3323
+ const commands = [
3324
+ "status",
3325
+ "--porcelain",
3326
+ "-b",
3327
+ "-u",
3328
+ "--null",
3329
+ ...customArgs.filter((arg) => !ignoredOptions.includes(arg))
3330
+ ];
3331
+ return {
3332
+ format: "utf-8",
3333
+ commands,
3334
+ parser(text) {
3335
+ return parseStatusSummary(text);
3336
+ }
3337
+ };
3338
+ }
3339
+ var ignoredOptions;
3340
+ var init_status = __esm({
3341
+ "src/lib/tasks/status.ts"() {
3342
+ "use strict";
3343
+ init_StatusSummary();
3344
+ ignoredOptions = ["--null", "-z"];
3345
+ }
3346
+ });
3347
+
3348
+ // src/lib/tasks/version.ts
3349
+ function versionResponse(major = 0, minor = 0, patch = 0, agent = "", installed = true) {
3350
+ return Object.defineProperty(
3351
+ {
3352
+ major,
3353
+ minor,
3354
+ patch,
3355
+ agent,
3356
+ installed
3357
+ },
3358
+ "toString",
3359
+ {
3360
+ value() {
3361
+ return `${this.major}.${this.minor}.${this.patch}`;
3362
+ },
3363
+ configurable: false,
3364
+ enumerable: false
3365
+ }
3366
+ );
3367
+ }
3368
+ function notInstalledResponse() {
3369
+ return versionResponse(0, 0, 0, "", false);
3370
+ }
3371
+ function version_default() {
3372
+ return {
3373
+ version() {
3374
+ return this._runTask({
3375
+ commands: ["--version"],
3376
+ format: "utf-8",
3377
+ parser: versionParser,
3378
+ onError(result, error, done, fail) {
3379
+ if (result.exitCode === -2 /* NOT_FOUND */) {
3380
+ return done(Buffer.from(NOT_INSTALLED));
3381
+ }
3382
+ fail(error);
3383
+ }
3384
+ });
3385
+ }
3386
+ };
3387
+ }
3388
+ function versionParser(stdOut) {
3389
+ if (stdOut === NOT_INSTALLED) {
3390
+ return notInstalledResponse();
3391
+ }
3392
+ return parseStringResponse(versionResponse(0, 0, 0, stdOut), parsers7, stdOut);
3393
+ }
3394
+ var NOT_INSTALLED, parsers7;
3395
+ var init_version = __esm({
3396
+ "src/lib/tasks/version.ts"() {
3397
+ "use strict";
3398
+ init_utils();
3399
+ NOT_INSTALLED = "installed=false";
3400
+ parsers7 = [
3401
+ new LineParser(
3402
+ /version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,
3403
+ (result, [major, minor, patch, agent = ""]) => {
3404
+ Object.assign(
3405
+ result,
3406
+ versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent)
3407
+ );
3408
+ }
3409
+ ),
3410
+ new LineParser(
3411
+ /version (\d+)\.(\d+)\.(\D+)(.+)?$/,
3412
+ (result, [major, minor, patch, agent = ""]) => {
3413
+ Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent));
3414
+ }
3415
+ )
3416
+ ];
3417
+ }
3418
+ });
3419
+
3420
+ // src/lib/tasks/clone.ts
3421
+ function createCloneTask(api, task, repoPath, ...args) {
3422
+ if (!filterString(repoPath)) {
3423
+ return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
3424
+ }
3425
+ return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
3426
+ }
3427
+ function clone_default() {
3428
+ return {
3429
+ clone(repo, ...rest) {
3430
+ return this._runTask(
3431
+ createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest),
3432
+ trailingFunctionArgument(arguments)
3433
+ );
3434
+ },
3435
+ mirror(repo, ...rest) {
3436
+ return this._runTask(
3437
+ createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest),
3438
+ trailingFunctionArgument(arguments)
3439
+ );
3440
+ }
3441
+ };
3442
+ }
3443
+ var import_args_pathspec6, cloneTask, cloneMirrorTask;
3444
+ var init_clone = __esm({
3445
+ "src/lib/tasks/clone.ts"() {
3446
+ "use strict";
3447
+ init_task();
3448
+ init_utils();
3449
+ import_args_pathspec6 = require("@simple-git/args-pathspec");
3450
+ cloneTask = (repo, directory, customArgs) => {
3451
+ const commands = ["clone", ...customArgs];
3452
+ filterString(repo) && commands.push((0, import_args_pathspec6.pathspec)(repo));
3453
+ filterString(directory) && commands.push((0, import_args_pathspec6.pathspec)(directory));
3454
+ return straightThroughStringTask(commands);
3455
+ };
3456
+ cloneMirrorTask = (repo, directory, customArgs) => {
3457
+ append(customArgs, "--mirror");
3458
+ return cloneTask(repo, directory, customArgs);
3459
+ };
3460
+ }
3461
+ });
3462
+
3463
+ // src/lib/simple-git-api.ts
3464
+ var simple_git_api_exports = {};
3465
+ __export(simple_git_api_exports, {
3466
+ SimpleGitApi: () => SimpleGitApi
3467
+ });
3468
+ var SimpleGitApi;
3469
+ var init_simple_git_api = __esm({
3470
+ "src/lib/simple-git-api.ts"() {
3471
+ "use strict";
3472
+ init_task_callback();
3473
+ init_change_working_directory();
3474
+ init_checkout();
3475
+ init_count_objects();
3476
+ init_commit();
3477
+ init_config();
3478
+ init_first_commit();
3479
+ init_grep();
3480
+ init_hash_object();
3481
+ init_init();
3482
+ init_log();
3483
+ init_merge();
3484
+ init_push();
3485
+ init_show();
3486
+ init_status();
3487
+ init_task();
3488
+ init_version();
3489
+ init_utils();
3490
+ init_clone();
3491
+ SimpleGitApi = class {
3492
+ constructor(_executor) {
3493
+ this._executor = _executor;
3494
+ }
3495
+ _runTask(task, then) {
3496
+ const chain = this._executor.chain();
3497
+ const promise = chain.push(task);
3498
+ if (then) {
3499
+ taskCallback(task, promise, then);
3500
+ }
3501
+ return Object.create(this, {
3502
+ then: { value: promise.then.bind(promise) },
3503
+ catch: { value: promise.catch.bind(promise) },
3504
+ _executor: { value: chain }
3505
+ });
3506
+ }
3507
+ add(files) {
3508
+ return this._runTask(
3509
+ straightThroughStringTask(["add", ...asArray(files)]),
3510
+ trailingFunctionArgument(arguments)
3511
+ );
3512
+ }
3513
+ cwd(directory) {
3514
+ const next = trailingFunctionArgument(arguments);
3515
+ if (typeof directory === "string") {
3516
+ return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);
3517
+ }
3518
+ if (typeof directory?.path === "string") {
3519
+ return this._runTask(
3520
+ changeWorkingDirectoryTask(
3521
+ directory.path,
3522
+ directory.root && this._executor || void 0
3523
+ ),
3524
+ next
3525
+ );
3526
+ }
3527
+ return this._runTask(
3528
+ configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"),
3529
+ next
3530
+ );
3531
+ }
3532
+ hashObject(path, write) {
3533
+ return this._runTask(
3534
+ hashObjectTask(path, write === true),
3535
+ trailingFunctionArgument(arguments)
3536
+ );
3537
+ }
3538
+ init(bare) {
3539
+ return this._runTask(
3540
+ initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)),
3541
+ trailingFunctionArgument(arguments)
3542
+ );
3543
+ }
3544
+ merge() {
3545
+ return this._runTask(
3546
+ mergeTask(getTrailingOptions(arguments)),
3547
+ trailingFunctionArgument(arguments)
3548
+ );
3549
+ }
3550
+ mergeFromTo(remote, branch) {
3551
+ if (!(filterString(remote) && filterString(branch))) {
3552
+ return this._runTask(
3553
+ configurationErrorTask(
3554
+ `Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`
3555
+ )
3556
+ );
3557
+ }
3558
+ return this._runTask(
3559
+ mergeTask([remote, branch, ...getTrailingOptions(arguments)]),
3560
+ trailingFunctionArgument(arguments, false)
3561
+ );
3562
+ }
3563
+ outputHandler(handler) {
3564
+ this._executor.outputHandler = handler;
3565
+ return this;
3566
+ }
3567
+ push() {
3568
+ const task = pushTask(
3569
+ {
3570
+ remote: filterType(arguments[0], filterString),
3571
+ branch: filterType(arguments[1], filterString)
3572
+ },
3573
+ getTrailingOptions(arguments)
3574
+ );
3575
+ return this._runTask(task, trailingFunctionArgument(arguments));
3576
+ }
3577
+ stash() {
3578
+ return this._runTask(
3579
+ straightThroughStringTask(["stash", ...getTrailingOptions(arguments)]),
3580
+ trailingFunctionArgument(arguments)
3581
+ );
3582
+ }
3583
+ status() {
3584
+ return this._runTask(
3585
+ statusTask(getTrailingOptions(arguments)),
3586
+ trailingFunctionArgument(arguments)
3587
+ );
3588
+ }
3589
+ };
3590
+ Object.assign(
3591
+ SimpleGitApi.prototype,
3592
+ checkout_default(),
3593
+ clone_default(),
3594
+ commit_default(),
3595
+ config_default(),
3596
+ count_objects_default(),
3597
+ first_commit_default(),
3598
+ grep_default(),
3599
+ log_default(),
3600
+ show_default(),
3601
+ version_default()
3602
+ );
3603
+ }
3604
+ });
3605
+
3606
+ // src/lib/runners/scheduler.ts
3607
+ var scheduler_exports = {};
3608
+ __export(scheduler_exports, {
3609
+ Scheduler: () => Scheduler
3610
+ });
3611
+ var import_promise_deferred2, createScheduledTask, Scheduler;
3612
+ var init_scheduler = __esm({
3613
+ "src/lib/runners/scheduler.ts"() {
3614
+ "use strict";
3615
+ init_utils();
3616
+ import_promise_deferred2 = require("@kwsites/promise-deferred");
3617
+ init_git_logger();
3618
+ createScheduledTask = /* @__PURE__ */ (() => {
3619
+ let id = 0;
3620
+ return () => {
3621
+ id++;
3622
+ const { promise, done } = (0, import_promise_deferred2.createDeferred)();
3623
+ return {
3624
+ promise,
3625
+ done,
3626
+ id
3627
+ };
3628
+ };
3629
+ })();
3630
+ Scheduler = class {
3631
+ constructor(concurrency = 2) {
3632
+ this.concurrency = concurrency;
3633
+ this.logger = createLogger("", "scheduler");
3634
+ this.pending = [];
3635
+ this.running = [];
3636
+ this.logger(`Constructed, concurrency=%s`, concurrency);
3637
+ }
3638
+ schedule() {
3639
+ if (!this.pending.length || this.running.length >= this.concurrency) {
3640
+ this.logger(
3641
+ `Schedule attempt ignored, pending=%s running=%s concurrency=%s`,
3642
+ this.pending.length,
3643
+ this.running.length,
3644
+ this.concurrency
3645
+ );
3646
+ return;
3647
+ }
3648
+ const task = append(this.running, this.pending.shift());
3649
+ this.logger(`Attempting id=%s`, task.id);
3650
+ task.done(() => {
3651
+ this.logger(`Completing id=`, task.id);
3652
+ remove(this.running, task);
3653
+ this.schedule();
3654
+ });
3655
+ }
3656
+ next() {
3657
+ const { promise, id } = append(this.pending, createScheduledTask());
3658
+ this.logger(`Scheduling id=%s`, id);
3659
+ this.schedule();
3660
+ return promise;
3661
+ }
3662
+ };
3663
+ }
3664
+ });
3665
+
3666
+ // src/lib/tasks/apply-patch.ts
3667
+ var apply_patch_exports = {};
3668
+ __export(apply_patch_exports, {
3669
+ applyPatchTask: () => applyPatchTask
3670
+ });
3671
+ function applyPatchTask(patches, customArgs) {
3672
+ return straightThroughStringTask(["apply", ...customArgs, ...patches]);
3673
+ }
3674
+ var init_apply_patch = __esm({
3675
+ "src/lib/tasks/apply-patch.ts"() {
3676
+ "use strict";
3677
+ init_task();
3678
+ }
3679
+ });
3680
+
3681
+ // src/lib/responses/BranchDeleteSummary.ts
3682
+ function branchDeletionSuccess(branch, hash) {
3683
+ return {
3684
+ branch,
3685
+ hash,
3686
+ success: true
3687
+ };
3688
+ }
3689
+ function branchDeletionFailure(branch) {
3690
+ return {
3691
+ branch,
3692
+ hash: null,
3693
+ success: false
3694
+ };
3695
+ }
3696
+ var BranchDeletionBatch;
3697
+ var init_BranchDeleteSummary = __esm({
3698
+ "src/lib/responses/BranchDeleteSummary.ts"() {
3699
+ "use strict";
3700
+ BranchDeletionBatch = class {
3701
+ constructor() {
3702
+ this.all = [];
3703
+ this.branches = {};
3704
+ this.errors = [];
3705
+ }
3706
+ get success() {
3707
+ return !this.errors.length;
3708
+ }
3709
+ };
3710
+ }
3711
+ });
3712
+
3713
+ // src/lib/parsers/parse-branch-delete.ts
3714
+ function hasBranchDeletionError(data, processExitCode) {
3715
+ return processExitCode === 1 /* ERROR */ && deleteErrorRegex.test(data);
3716
+ }
3717
+ var deleteSuccessRegex, deleteErrorRegex, parsers8, parseBranchDeletions;
3718
+ var init_parse_branch_delete = __esm({
3719
+ "src/lib/parsers/parse-branch-delete.ts"() {
3720
+ "use strict";
3721
+ init_BranchDeleteSummary();
3722
+ init_utils();
3723
+ deleteSuccessRegex = /(\S+)\s+\(\S+\s([^)]+)\)/;
3724
+ deleteErrorRegex = /^error[^']+'([^']+)'/m;
3725
+ parsers8 = [
3726
+ new LineParser(deleteSuccessRegex, (result, [branch, hash]) => {
3727
+ const deletion = branchDeletionSuccess(branch, hash);
3728
+ result.all.push(deletion);
3729
+ result.branches[branch] = deletion;
3730
+ }),
3731
+ new LineParser(deleteErrorRegex, (result, [branch]) => {
3732
+ const deletion = branchDeletionFailure(branch);
3733
+ result.errors.push(deletion);
3734
+ result.all.push(deletion);
3735
+ result.branches[branch] = deletion;
3736
+ })
3737
+ ];
3738
+ parseBranchDeletions = (stdOut, stdErr) => {
3739
+ return parseStringResponse(new BranchDeletionBatch(), parsers8, [stdOut, stdErr]);
3740
+ };
3741
+ }
3742
+ });
3743
+
3744
+ // src/lib/responses/BranchSummary.ts
3745
+ var BranchSummaryResult;
3746
+ var init_BranchSummary = __esm({
3747
+ "src/lib/responses/BranchSummary.ts"() {
3748
+ "use strict";
3749
+ BranchSummaryResult = class {
3750
+ constructor() {
3751
+ this.all = [];
3752
+ this.branches = {};
3753
+ this.current = "";
3754
+ this.detached = false;
3755
+ }
3756
+ push(status, detached, name, commit, label) {
3757
+ if (status === "*" /* CURRENT */) {
3758
+ this.detached = detached;
3759
+ this.current = name;
3760
+ }
3761
+ this.all.push(name);
3762
+ this.branches[name] = {
3763
+ current: status === "*" /* CURRENT */,
3764
+ linkedWorkTree: status === "+" /* LINKED */,
3765
+ name,
3766
+ commit,
3767
+ label
3768
+ };
3769
+ }
3770
+ };
3771
+ }
3772
+ });
3773
+
3774
+ // src/lib/parsers/parse-branch.ts
3775
+ function branchStatus(input) {
3776
+ return input ? input.charAt(0) : "";
3777
+ }
3778
+ function parseBranchSummary(stdOut, currentOnly = false) {
3779
+ return parseStringResponse(
3780
+ new BranchSummaryResult(),
3781
+ currentOnly ? [currentBranchParser] : parsers9,
3782
+ stdOut
3783
+ );
3784
+ }
3785
+ var parsers9, currentBranchParser;
3786
+ var init_parse_branch = __esm({
3787
+ "src/lib/parsers/parse-branch.ts"() {
3788
+ "use strict";
3789
+ init_BranchSummary();
3790
+ init_utils();
3791
+ parsers9 = [
3792
+ new LineParser(
3793
+ /^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,
3794
+ (result, [current, name, commit, label]) => {
3795
+ result.push(branchStatus(current), true, name, commit, label);
3796
+ }
3797
+ ),
3798
+ new LineParser(
3799
+ /^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
3800
+ (result, [current, name, commit, label]) => {
3801
+ result.push(branchStatus(current), false, name, commit, label);
3802
+ }
3803
+ )
3804
+ ];
3805
+ currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
3806
+ result.push("*" /* CURRENT */, false, name, "", "");
3807
+ });
3808
+ }
3809
+ });
3810
+
3811
+ // src/lib/tasks/branch.ts
3812
+ var branch_exports = {};
3813
+ __export(branch_exports, {
3814
+ branchLocalTask: () => branchLocalTask,
3815
+ branchTask: () => branchTask,
3816
+ containsDeleteBranchCommand: () => containsDeleteBranchCommand,
3817
+ deleteBranchTask: () => deleteBranchTask,
3818
+ deleteBranchesTask: () => deleteBranchesTask
3819
+ });
3820
+ function containsDeleteBranchCommand(commands) {
3821
+ const deleteCommands = ["-d", "-D", "--delete"];
3822
+ return commands.some((command) => deleteCommands.includes(command));
3823
+ }
3824
+ function branchTask(customArgs) {
3825
+ const isDelete = containsDeleteBranchCommand(customArgs);
3826
+ const isCurrentOnly = customArgs.includes("--show-current");
3827
+ const commands = ["branch", ...customArgs];
3828
+ if (commands.length === 1) {
3829
+ commands.push("-a");
3830
+ }
3831
+ if (!commands.includes("-v")) {
3832
+ commands.splice(1, 0, "-v");
3833
+ }
3834
+ return {
3835
+ format: "utf-8",
3836
+ commands,
3837
+ parser(stdOut, stdErr) {
3838
+ if (isDelete) {
3839
+ return parseBranchDeletions(stdOut, stdErr).all[0];
3840
+ }
3841
+ return parseBranchSummary(stdOut, isCurrentOnly);
3842
+ }
3843
+ };
3844
+ }
3845
+ function branchLocalTask() {
3846
+ return {
3847
+ format: "utf-8",
3848
+ commands: ["branch", "-v"],
3849
+ parser(stdOut) {
3850
+ return parseBranchSummary(stdOut);
3851
+ }
3852
+ };
3853
+ }
3854
+ function deleteBranchesTask(branches, forceDelete = false) {
3855
+ return {
3856
+ format: "utf-8",
3857
+ commands: ["branch", "-v", forceDelete ? "-D" : "-d", ...branches],
3858
+ parser(stdOut, stdErr) {
3859
+ return parseBranchDeletions(stdOut, stdErr);
3860
+ },
3861
+ onError({ exitCode, stdOut }, error, done, fail) {
3862
+ if (!hasBranchDeletionError(String(error), exitCode)) {
3863
+ return fail(error);
3864
+ }
3865
+ done(stdOut);
3866
+ }
3867
+ };
3868
+ }
3869
+ function deleteBranchTask(branch, forceDelete = false) {
3870
+ const task = {
3871
+ format: "utf-8",
3872
+ commands: ["branch", "-v", forceDelete ? "-D" : "-d", branch],
3873
+ parser(stdOut, stdErr) {
3874
+ return parseBranchDeletions(stdOut, stdErr).branches[branch];
3875
+ },
3876
+ onError({ exitCode, stdErr, stdOut }, error, _, fail) {
3877
+ if (!hasBranchDeletionError(String(error), exitCode)) {
3878
+ return fail(error);
3879
+ }
3880
+ throw new GitResponseError(
3881
+ task.parser(bufferToString(stdOut), bufferToString(stdErr)),
3882
+ String(error)
3883
+ );
3884
+ }
3885
+ };
3886
+ return task;
3887
+ }
3888
+ var init_branch = __esm({
3889
+ "src/lib/tasks/branch.ts"() {
3890
+ "use strict";
3891
+ init_git_response_error();
3892
+ init_parse_branch_delete();
3893
+ init_parse_branch();
3894
+ init_utils();
3895
+ }
3896
+ });
3897
+
3898
+ // src/lib/responses/CheckIgnore.ts
3899
+ function toPath(input) {
3900
+ const path = input.trim().replace(/^["']|["']$/g, "");
3901
+ return path && (0, import_node_path.normalize)(path);
3902
+ }
3903
+ var import_node_path, parseCheckIgnore;
3904
+ var init_CheckIgnore = __esm({
3905
+ "src/lib/responses/CheckIgnore.ts"() {
3906
+ "use strict";
3907
+ import_node_path = require("node:path");
3908
+ parseCheckIgnore = (text) => {
3909
+ return text.split(/\n/g).map(toPath).filter(Boolean);
3910
+ };
3911
+ }
3912
+ });
3913
+
3914
+ // src/lib/tasks/check-ignore.ts
3915
+ var check_ignore_exports = {};
3916
+ __export(check_ignore_exports, {
3917
+ checkIgnoreTask: () => checkIgnoreTask
3918
+ });
3919
+ function checkIgnoreTask(paths) {
3920
+ return {
3921
+ commands: ["check-ignore", ...paths],
3922
+ format: "utf-8",
3923
+ parser: parseCheckIgnore
3924
+ };
3925
+ }
3926
+ var init_check_ignore = __esm({
3927
+ "src/lib/tasks/check-ignore.ts"() {
3928
+ "use strict";
3929
+ init_CheckIgnore();
3930
+ }
3931
+ });
3932
+
3933
+ // src/lib/parsers/parse-fetch.ts
3934
+ function parseFetchResult(stdOut, stdErr) {
3935
+ const result = {
3936
+ raw: stdOut,
3937
+ remote: null,
3938
+ branches: [],
3939
+ tags: [],
3940
+ updated: [],
3941
+ deleted: []
3942
+ };
3943
+ return parseStringResponse(result, parsers10, [stdOut, stdErr]);
3944
+ }
3945
+ var parsers10;
3946
+ var init_parse_fetch = __esm({
3947
+ "src/lib/parsers/parse-fetch.ts"() {
3948
+ "use strict";
3949
+ init_utils();
3950
+ parsers10 = [
3951
+ new LineParser(/From (.+)$/, (result, [remote]) => {
3952
+ result.remote = remote;
3953
+ }),
3954
+ new LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/, (result, [name, tracking]) => {
3955
+ result.branches.push({
3956
+ name,
3957
+ tracking
3958
+ });
3959
+ }),
3960
+ new LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/, (result, [name, tracking]) => {
3961
+ result.tags.push({
3962
+ name,
3963
+ tracking
3964
+ });
3965
+ }),
3966
+ new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/, (result, [tracking]) => {
3967
+ result.deleted.push({
3968
+ tracking
3969
+ });
3970
+ }),
3971
+ new LineParser(
3972
+ /\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,
3973
+ (result, [from, to, name, tracking]) => {
3974
+ result.updated.push({
3975
+ name,
3976
+ tracking,
3977
+ to,
3978
+ from
3979
+ });
3980
+ }
3981
+ )
3982
+ ];
3983
+ }
3984
+ });
3985
+
3986
+ // src/lib/tasks/fetch.ts
3987
+ var fetch_exports = {};
3988
+ __export(fetch_exports, {
3989
+ fetchTask: () => fetchTask
3990
+ });
3991
+ function disallowedCommand(command) {
3992
+ return /^--upload-pack(=|$)/.test(command);
3993
+ }
3994
+ function fetchTask(remote, branch, customArgs) {
3995
+ const commands = ["fetch", ...customArgs];
3996
+ if (remote && branch) {
3997
+ commands.push(remote, branch);
3998
+ }
3999
+ const banned = commands.find(disallowedCommand);
4000
+ if (banned) {
4001
+ return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4002
+ }
4003
+ return {
4004
+ commands,
4005
+ format: "utf-8",
4006
+ parser: parseFetchResult
4007
+ };
4008
+ }
4009
+ var init_fetch = __esm({
4010
+ "src/lib/tasks/fetch.ts"() {
4011
+ "use strict";
4012
+ init_parse_fetch();
4013
+ init_task();
4014
+ }
4015
+ });
4016
+
4017
+ // src/lib/parsers/parse-move.ts
4018
+ function parseMoveResult(stdOut) {
4019
+ return parseStringResponse({ moves: [] }, parsers11, stdOut);
4020
+ }
4021
+ var parsers11;
4022
+ var init_parse_move = __esm({
4023
+ "src/lib/parsers/parse-move.ts"() {
4024
+ "use strict";
4025
+ init_utils();
4026
+ parsers11 = [
4027
+ new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => {
4028
+ result.moves.push({ from, to });
4029
+ })
4030
+ ];
4031
+ }
4032
+ });
4033
+
4034
+ // src/lib/tasks/move.ts
4035
+ var move_exports = {};
4036
+ __export(move_exports, {
4037
+ moveTask: () => moveTask
4038
+ });
4039
+ function moveTask(from, to) {
4040
+ return {
4041
+ commands: ["mv", "-v", ...asArray(from), to],
4042
+ format: "utf-8",
4043
+ parser: parseMoveResult
4044
+ };
4045
+ }
4046
+ var init_move = __esm({
4047
+ "src/lib/tasks/move.ts"() {
4048
+ "use strict";
4049
+ init_parse_move();
4050
+ init_utils();
4051
+ }
4052
+ });
4053
+
4054
+ // src/lib/tasks/pull.ts
4055
+ var pull_exports = {};
4056
+ __export(pull_exports, {
4057
+ pullTask: () => pullTask
4058
+ });
4059
+ function pullTask(remote, branch, customArgs) {
4060
+ const commands = ["pull", ...customArgs];
4061
+ if (remote && branch) {
4062
+ commands.splice(1, 0, remote, branch);
4063
+ }
4064
+ return {
4065
+ commands,
4066
+ format: "utf-8",
4067
+ parser(stdOut, stdErr) {
4068
+ return parsePullResult(stdOut, stdErr);
4069
+ },
4070
+ onError(result, _error, _done, fail) {
4071
+ const pullError = parsePullErrorResult(
4072
+ bufferToString(result.stdOut),
4073
+ bufferToString(result.stdErr)
4074
+ );
4075
+ if (pullError) {
4076
+ return fail(new GitResponseError(pullError));
4077
+ }
4078
+ fail(_error);
4079
+ }
4080
+ };
4081
+ }
4082
+ var init_pull = __esm({
4083
+ "src/lib/tasks/pull.ts"() {
4084
+ "use strict";
4085
+ init_git_response_error();
4086
+ init_parse_pull();
4087
+ init_utils();
4088
+ }
4089
+ });
4090
+
4091
+ // src/lib/responses/GetRemoteSummary.ts
4092
+ function parseGetRemotes(text) {
4093
+ const remotes = {};
4094
+ forEach(text, ([name]) => remotes[name] = { name });
4095
+ return Object.values(remotes);
4096
+ }
4097
+ function parseGetRemotesVerbose(text) {
4098
+ const remotes = {};
4099
+ forEach(text, ([name, url, purpose]) => {
4100
+ if (!Object.hasOwn(remotes, name)) {
4101
+ remotes[name] = {
4102
+ name,
4103
+ refs: { fetch: "", push: "" }
4104
+ };
4105
+ }
4106
+ if (purpose && url) {
4107
+ remotes[name].refs[purpose.replace(/[^a-z]/g, "")] = url;
4108
+ }
4109
+ });
4110
+ return Object.values(remotes);
4111
+ }
4112
+ function forEach(text, handler) {
4113
+ forEachLineWithContent(text, (line) => handler(line.split(/\s+/)));
4114
+ }
4115
+ var init_GetRemoteSummary = __esm({
4116
+ "src/lib/responses/GetRemoteSummary.ts"() {
4117
+ "use strict";
4118
+ init_utils();
4119
+ }
4120
+ });
4121
+
4122
+ // src/lib/tasks/remote.ts
4123
+ var remote_exports = {};
4124
+ __export(remote_exports, {
4125
+ addRemoteTask: () => addRemoteTask,
4126
+ getRemotesTask: () => getRemotesTask,
4127
+ listRemotesTask: () => listRemotesTask,
4128
+ remoteTask: () => remoteTask,
4129
+ removeRemoteTask: () => removeRemoteTask
4130
+ });
4131
+ function addRemoteTask(remoteName, remoteRepo, customArgs) {
4132
+ return straightThroughStringTask(["remote", "add", ...customArgs, remoteName, remoteRepo]);
4133
+ }
4134
+ function getRemotesTask(verbose) {
4135
+ const commands = ["remote"];
4136
+ if (verbose) {
4137
+ commands.push("-v");
4138
+ }
4139
+ return {
4140
+ commands,
4141
+ format: "utf-8",
4142
+ parser: verbose ? parseGetRemotesVerbose : parseGetRemotes
4143
+ };
4144
+ }
4145
+ function listRemotesTask(customArgs) {
4146
+ const commands = [...customArgs];
4147
+ if (commands[0] !== "ls-remote") {
4148
+ commands.unshift("ls-remote");
4149
+ }
4150
+ return straightThroughStringTask(commands);
4151
+ }
4152
+ function remoteTask(customArgs) {
4153
+ const commands = [...customArgs];
4154
+ if (commands[0] !== "remote") {
4155
+ commands.unshift("remote");
4156
+ }
4157
+ return straightThroughStringTask(commands);
4158
+ }
4159
+ function removeRemoteTask(remoteName) {
4160
+ return straightThroughStringTask(["remote", "remove", remoteName]);
4161
+ }
4162
+ var init_remote = __esm({
4163
+ "src/lib/tasks/remote.ts"() {
4164
+ "use strict";
4165
+ init_GetRemoteSummary();
4166
+ init_task();
4167
+ }
4168
+ });
4169
+
4170
+ // src/lib/tasks/stash-list.ts
4171
+ var stash_list_exports = {};
4172
+ __export(stash_list_exports, {
4173
+ stashListTask: () => stashListTask
4174
+ });
4175
+ function stashListTask(opt = {}, customArgs) {
4176
+ const options = parseLogOptions(opt);
4177
+ const commands = ["stash", "list", ...options.commands, ...customArgs];
4178
+ const parser4 = createListLogSummaryParser(
4179
+ options.splitter,
4180
+ options.fields,
4181
+ logFormatFromCommand(commands)
4182
+ );
4183
+ return validateLogFormatConfig(commands) || {
4184
+ commands,
4185
+ format: "utf-8",
4186
+ parser: parser4
4187
+ };
4188
+ }
4189
+ var init_stash_list = __esm({
4190
+ "src/lib/tasks/stash-list.ts"() {
4191
+ "use strict";
4192
+ init_log_format();
4193
+ init_parse_list_log_summary();
4194
+ init_diff();
4195
+ init_log();
4196
+ }
4197
+ });
4198
+
4199
+ // src/lib/tasks/sub-module.ts
4200
+ var sub_module_exports = {};
4201
+ __export(sub_module_exports, {
4202
+ addSubModuleTask: () => addSubModuleTask,
4203
+ initSubModuleTask: () => initSubModuleTask,
4204
+ subModuleTask: () => subModuleTask,
4205
+ updateSubModuleTask: () => updateSubModuleTask
4206
+ });
4207
+ function addSubModuleTask(repo, path) {
4208
+ return subModuleTask(["add", repo, path]);
4209
+ }
4210
+ function initSubModuleTask(customArgs) {
4211
+ return subModuleTask(["init", ...customArgs]);
4212
+ }
4213
+ function subModuleTask(customArgs) {
4214
+ const commands = [...customArgs];
4215
+ if (commands[0] !== "submodule") {
4216
+ commands.unshift("submodule");
4217
+ }
4218
+ return straightThroughStringTask(commands);
4219
+ }
4220
+ function updateSubModuleTask(customArgs) {
4221
+ return subModuleTask(["update", ...customArgs]);
4222
+ }
4223
+ var init_sub_module = __esm({
4224
+ "src/lib/tasks/sub-module.ts"() {
4225
+ "use strict";
4226
+ init_task();
4227
+ }
4228
+ });
4229
+
4230
+ // src/lib/responses/TagList.ts
4231
+ function singleSorted(a, b) {
4232
+ const aIsNum = Number.isNaN(a);
4233
+ const bIsNum = Number.isNaN(b);
4234
+ if (aIsNum !== bIsNum) {
4235
+ return aIsNum ? 1 : -1;
4236
+ }
4237
+ return aIsNum ? sorted(a, b) : 0;
4238
+ }
4239
+ function sorted(a, b) {
4240
+ return a === b ? 0 : a > b ? 1 : -1;
4241
+ }
4242
+ function trimmed(input) {
4243
+ return input.trim();
4244
+ }
4245
+ function toNumber(input) {
4246
+ if (typeof input === "string") {
4247
+ return parseInt(input.replace(/^\D+/g, ""), 10) || 0;
4248
+ }
4249
+ return 0;
4250
+ }
4251
+ var TagList, parseTagList;
4252
+ var init_TagList = __esm({
4253
+ "src/lib/responses/TagList.ts"() {
4254
+ "use strict";
4255
+ TagList = class {
4256
+ constructor(all, latest) {
4257
+ this.all = all;
4258
+ this.latest = latest;
4259
+ }
4260
+ };
4261
+ parseTagList = function(data, customSort = false) {
4262
+ const tags = data.split("\n").map(trimmed).filter(Boolean);
4263
+ if (!customSort) {
4264
+ tags.sort(function(tagA, tagB) {
4265
+ const partsA = tagA.split(".");
4266
+ const partsB = tagB.split(".");
4267
+ if (partsA.length === 1 || partsB.length === 1) {
4268
+ return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));
4269
+ }
4270
+ for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {
4271
+ const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));
4272
+ if (diff) {
4273
+ return diff;
4274
+ }
4275
+ }
4276
+ return 0;
4277
+ });
4278
+ }
4279
+ const latest = customSort ? tags[0] : [...tags].reverse().find((tag) => tag.indexOf(".") >= 0);
4280
+ return new TagList(tags, latest);
4281
+ };
4282
+ }
4283
+ });
4284
+
4285
+ // src/lib/tasks/tag.ts
4286
+ var tag_exports = {};
4287
+ __export(tag_exports, {
4288
+ addAnnotatedTagTask: () => addAnnotatedTagTask,
4289
+ addTagTask: () => addTagTask,
4290
+ tagListTask: () => tagListTask
4291
+ });
4292
+ function tagListTask(customArgs = []) {
4293
+ const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option));
4294
+ return {
4295
+ format: "utf-8",
4296
+ commands: ["tag", "-l", ...customArgs],
4297
+ parser(text) {
4298
+ return parseTagList(text, hasCustomSort);
4299
+ }
4300
+ };
4301
+ }
4302
+ function addTagTask(name) {
4303
+ return {
4304
+ format: "utf-8",
4305
+ commands: ["tag", name],
4306
+ parser() {
4307
+ return { name };
4308
+ }
4309
+ };
4310
+ }
4311
+ function addAnnotatedTagTask(name, tagMessage) {
4312
+ return {
4313
+ format: "utf-8",
4314
+ commands: ["tag", "-a", "-m", tagMessage, name],
4315
+ parser() {
4316
+ return { name };
4317
+ }
4318
+ };
4319
+ }
4320
+ var init_tag = __esm({
4321
+ "src/lib/tasks/tag.ts"() {
4322
+ "use strict";
4323
+ init_TagList();
4324
+ }
4325
+ });
4326
+
4327
+ // src/git.js
4328
+ var require_git = __commonJS({
4329
+ "src/git.js"(exports2, module2) {
4330
+ "use strict";
4331
+ var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
4332
+ var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
4333
+ var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
4334
+ var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
4335
+ var {
4336
+ asArray: asArray2,
4337
+ filterArray: filterArray2,
4338
+ filterPrimitives: filterPrimitives2,
4339
+ filterString: filterString2,
4340
+ filterStringOrStringArray: filterStringOrStringArray2,
4341
+ filterType: filterType2,
4342
+ getTrailingOptions: getTrailingOptions2,
4343
+ trailingFunctionArgument: trailingFunctionArgument2,
4344
+ trailingOptionsArgument: trailingOptionsArgument2
4345
+ } = (init_utils(), __toCommonJS(utils_exports));
4346
+ var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports));
4347
+ var {
4348
+ branchTask: branchTask2,
4349
+ branchLocalTask: branchLocalTask2,
4350
+ deleteBranchesTask: deleteBranchesTask2,
4351
+ deleteBranchTask: deleteBranchTask2
4352
+ } = (init_branch(), __toCommonJS(branch_exports));
4353
+ var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
4354
+ var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
4355
+ var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
4356
+ var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
4357
+ var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
4358
+ var { moveTask: moveTask2 } = (init_move(), __toCommonJS(move_exports));
4359
+ var { pullTask: pullTask2 } = (init_pull(), __toCommonJS(pull_exports));
4360
+ var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS(push_exports));
4361
+ var {
4362
+ addRemoteTask: addRemoteTask2,
4363
+ getRemotesTask: getRemotesTask2,
4364
+ listRemotesTask: listRemotesTask2,
4365
+ remoteTask: remoteTask2,
4366
+ removeRemoteTask: removeRemoteTask2
4367
+ } = (init_remote(), __toCommonJS(remote_exports));
4368
+ var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS(reset_exports));
4369
+ var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS(stash_list_exports));
4370
+ var {
4371
+ addSubModuleTask: addSubModuleTask2,
4372
+ initSubModuleTask: initSubModuleTask2,
4373
+ subModuleTask: subModuleTask2,
4374
+ updateSubModuleTask: updateSubModuleTask2
4375
+ } = (init_sub_module(), __toCommonJS(sub_module_exports));
4376
+ var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports));
4377
+ var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports));
4378
+ function Git2(options, plugins) {
4379
+ this._plugins = plugins;
4380
+ this._executor = new GitExecutor2(
4381
+ options.baseDir,
4382
+ new Scheduler2(options.maxConcurrentProcesses),
4383
+ plugins
4384
+ );
4385
+ this._trimmed = options.trimmed;
4386
+ }
4387
+ (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2;
4388
+ Git2.prototype.customBinary = function(command) {
4389
+ this._plugins.reconfigure("binary", command);
4390
+ return this;
4391
+ };
4392
+ Git2.prototype.env = function(name, value) {
4393
+ if (arguments.length === 1 && typeof name === "object") {
4394
+ this._executor.env = name;
4395
+ } else {
4396
+ (this._executor.env = this._executor.env || {})[name] = value;
4397
+ }
4398
+ return this;
4399
+ };
4400
+ Git2.prototype.stashList = function(options) {
4401
+ return this._runTask(
4402
+ stashListTask2(
4403
+ trailingOptionsArgument2(arguments) || {},
4404
+ filterArray2(options) && options || []
4405
+ ),
4406
+ trailingFunctionArgument2(arguments)
4407
+ );
4408
+ };
4409
+ Git2.prototype.mv = function(from, to) {
4410
+ return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
4411
+ };
4412
+ Git2.prototype.checkoutLatestTag = function(then) {
4413
+ var git = this;
4414
+ return this.pull(function() {
4415
+ git.tags(function(err, tags) {
4416
+ git.checkout(tags.latest, then);
4417
+ });
4418
+ });
4419
+ };
4420
+ Git2.prototype.pull = function(remote, branch, options, then) {
4421
+ return this._runTask(
4422
+ pullTask2(
4423
+ filterType2(remote, filterString2),
4424
+ filterType2(branch, filterString2),
4425
+ getTrailingOptions2(arguments)
4426
+ ),
4427
+ trailingFunctionArgument2(arguments)
4428
+ );
4429
+ };
4430
+ Git2.prototype.fetch = function(remote, branch) {
4431
+ return this._runTask(
4432
+ fetchTask2(
4433
+ filterType2(remote, filterString2),
4434
+ filterType2(branch, filterString2),
4435
+ getTrailingOptions2(arguments)
4436
+ ),
4437
+ trailingFunctionArgument2(arguments)
4438
+ );
4439
+ };
4440
+ Git2.prototype.silent = function(silence) {
4441
+ return this._runTask(
4442
+ adhocExecTask2(
4443
+ () => console.warn(
4444
+ "simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed."
4445
+ )
4446
+ )
4447
+ );
4448
+ };
4449
+ Git2.prototype.tags = function(options, then) {
4450
+ return this._runTask(
4451
+ tagListTask2(getTrailingOptions2(arguments)),
4452
+ trailingFunctionArgument2(arguments)
4453
+ );
4454
+ };
4455
+ Git2.prototype.rebase = function() {
4456
+ return this._runTask(
4457
+ straightThroughStringTask2(["rebase", ...getTrailingOptions2(arguments)]),
4458
+ trailingFunctionArgument2(arguments)
4459
+ );
4460
+ };
4461
+ Git2.prototype.reset = function(mode) {
4462
+ return this._runTask(
4463
+ resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)),
4464
+ trailingFunctionArgument2(arguments)
4465
+ );
4466
+ };
4467
+ Git2.prototype.revert = function(commit) {
4468
+ const next = trailingFunctionArgument2(arguments);
4469
+ if (typeof commit !== "string") {
4470
+ return this._runTask(configurationErrorTask2("Commit must be a string"), next);
4471
+ }
4472
+ return this._runTask(
4473
+ straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit]),
4474
+ next
4475
+ );
4476
+ };
4477
+ Git2.prototype.addTag = function(name) {
4478
+ const task = typeof name === "string" ? addTagTask2(name) : configurationErrorTask2("Git.addTag requires a tag name");
4479
+ return this._runTask(task, trailingFunctionArgument2(arguments));
4480
+ };
4481
+ Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) {
4482
+ return this._runTask(
4483
+ addAnnotatedTagTask2(tagName, tagMessage),
4484
+ trailingFunctionArgument2(arguments)
4485
+ );
4486
+ };
4487
+ Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) {
4488
+ return this._runTask(
4489
+ deleteBranchTask2(branchName, typeof forceDelete === "boolean" ? forceDelete : false),
4490
+ trailingFunctionArgument2(arguments)
4491
+ );
4492
+ };
4493
+ Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) {
4494
+ return this._runTask(
4495
+ deleteBranchesTask2(branchNames, typeof forceDelete === "boolean" ? forceDelete : false),
4496
+ trailingFunctionArgument2(arguments)
4497
+ );
4498
+ };
4499
+ Git2.prototype.branch = function(options, then) {
4500
+ return this._runTask(
4501
+ branchTask2(getTrailingOptions2(arguments)),
4502
+ trailingFunctionArgument2(arguments)
4503
+ );
4504
+ };
4505
+ Git2.prototype.branchLocal = function(then) {
4506
+ return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments));
4507
+ };
4508
+ Git2.prototype.raw = function(commands) {
4509
+ const createRestCommands = !Array.isArray(commands);
4510
+ const command = [].slice.call(createRestCommands ? arguments : commands, 0);
4511
+ for (let i = 0; i < command.length && createRestCommands; i++) {
4512
+ if (!filterPrimitives2(command[i])) {
4513
+ command.splice(i, command.length - i);
4514
+ break;
4515
+ }
4516
+ }
4517
+ command.push(...getTrailingOptions2(arguments, 0, true));
4518
+ var next = trailingFunctionArgument2(arguments);
4519
+ if (!command.length) {
4520
+ return this._runTask(
4521
+ configurationErrorTask2("Raw: must supply one or more command to execute"),
4522
+ next
4523
+ );
4524
+ }
4525
+ return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
4526
+ };
4527
+ Git2.prototype.submoduleAdd = function(repo, path, then) {
4528
+ return this._runTask(addSubModuleTask2(repo, path), trailingFunctionArgument2(arguments));
4529
+ };
4530
+ Git2.prototype.submoduleUpdate = function(args, then) {
4531
+ return this._runTask(
4532
+ updateSubModuleTask2(getTrailingOptions2(arguments, true)),
4533
+ trailingFunctionArgument2(arguments)
4534
+ );
4535
+ };
4536
+ Git2.prototype.submoduleInit = function(args, then) {
4537
+ return this._runTask(
4538
+ initSubModuleTask2(getTrailingOptions2(arguments, true)),
4539
+ trailingFunctionArgument2(arguments)
4540
+ );
4541
+ };
4542
+ Git2.prototype.subModule = function(options, then) {
4543
+ return this._runTask(
4544
+ subModuleTask2(getTrailingOptions2(arguments)),
4545
+ trailingFunctionArgument2(arguments)
4546
+ );
4547
+ };
4548
+ Git2.prototype.listRemote = function() {
4549
+ return this._runTask(
4550
+ listRemotesTask2(getTrailingOptions2(arguments)),
4551
+ trailingFunctionArgument2(arguments)
4552
+ );
4553
+ };
4554
+ Git2.prototype.addRemote = function(remoteName, remoteRepo, then) {
4555
+ return this._runTask(
4556
+ addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)),
4557
+ trailingFunctionArgument2(arguments)
4558
+ );
4559
+ };
4560
+ Git2.prototype.removeRemote = function(remoteName, then) {
4561
+ return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments));
4562
+ };
4563
+ Git2.prototype.getRemotes = function(verbose, then) {
4564
+ return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments));
4565
+ };
4566
+ Git2.prototype.remote = function(options, then) {
4567
+ return this._runTask(
4568
+ remoteTask2(getTrailingOptions2(arguments)),
4569
+ trailingFunctionArgument2(arguments)
4570
+ );
4571
+ };
4572
+ Git2.prototype.tag = function(options, then) {
4573
+ const command = getTrailingOptions2(arguments);
4574
+ if (command[0] !== "tag") {
4575
+ command.unshift("tag");
4576
+ }
4577
+ return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments));
4578
+ };
4579
+ Git2.prototype.updateServerInfo = function(then) {
4580
+ return this._runTask(
4581
+ straightThroughStringTask2(["update-server-info"]),
4582
+ trailingFunctionArgument2(arguments)
4583
+ );
4584
+ };
4585
+ Git2.prototype.pushTags = function(remote, then) {
4586
+ const task = pushTagsTask2(
4587
+ { remote: filterType2(remote, filterString2) },
4588
+ getTrailingOptions2(arguments)
4589
+ );
4590
+ return this._runTask(task, trailingFunctionArgument2(arguments));
4591
+ };
4592
+ Git2.prototype.rm = function(files) {
4593
+ return this._runTask(
4594
+ straightThroughStringTask2(["rm", "-f", ...asArray2(files)]),
4595
+ trailingFunctionArgument2(arguments)
4596
+ );
4597
+ };
4598
+ Git2.prototype.rmKeepLocal = function(files) {
4599
+ return this._runTask(
4600
+ straightThroughStringTask2(["rm", "--cached", ...asArray2(files)]),
4601
+ trailingFunctionArgument2(arguments)
4602
+ );
4603
+ };
4604
+ Git2.prototype.catFile = function(options, then) {
4605
+ return this._catFile("utf-8", arguments);
4606
+ };
4607
+ Git2.prototype.binaryCatFile = function() {
4608
+ return this._catFile("buffer", arguments);
4609
+ };
4610
+ Git2.prototype._catFile = function(format, args) {
4611
+ var handler = trailingFunctionArgument2(args);
4612
+ var command = ["cat-file"];
4613
+ var options = args[0];
4614
+ if (typeof options === "string") {
4615
+ return this._runTask(
4616
+ configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"),
4617
+ handler
4618
+ );
4619
+ }
4620
+ if (Array.isArray(options)) {
4621
+ command.push.apply(command, options);
4622
+ }
4623
+ const task = format === "buffer" ? straightThroughBufferTask2(command) : straightThroughStringTask2(command);
4624
+ return this._runTask(task, handler);
4625
+ };
4626
+ Git2.prototype.diff = function(options, then) {
4627
+ const task = filterString2(options) ? configurationErrorTask2(
4628
+ "git.diff: supplying options as a single string is no longer supported, switch to an array of strings"
4629
+ ) : straightThroughStringTask2(["diff", ...getTrailingOptions2(arguments)]);
4630
+ return this._runTask(task, trailingFunctionArgument2(arguments));
4631
+ };
4632
+ Git2.prototype.diffSummary = function() {
4633
+ return this._runTask(
4634
+ diffSummaryTask2(getTrailingOptions2(arguments, 1)),
4635
+ trailingFunctionArgument2(arguments)
4636
+ );
4637
+ };
4638
+ Git2.prototype.applyPatch = function(patches) {
4639
+ const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(
4640
+ `git.applyPatch requires one or more string patches as the first argument`
4641
+ ) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1)));
4642
+ return this._runTask(task, trailingFunctionArgument2(arguments));
4643
+ };
4644
+ Git2.prototype.revparse = function() {
4645
+ const commands = ["rev-parse", ...getTrailingOptions2(arguments, true)];
4646
+ return this._runTask(
4647
+ straightThroughStringTask2(commands, true),
4648
+ trailingFunctionArgument2(arguments)
4649
+ );
4650
+ };
4651
+ Git2.prototype.clean = function(mode, options, then) {
4652
+ const usingCleanOptionsArray = isCleanOptionsArray2(mode);
4653
+ const cleanMode = usingCleanOptionsArray && mode.join("") || filterType2(mode, filterString2) || "";
4654
+ const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0));
4655
+ return this._runTask(
4656
+ cleanWithOptionsTask2(cleanMode, customArgs),
4657
+ trailingFunctionArgument2(arguments)
4658
+ );
4659
+ };
4660
+ Git2.prototype.exec = function(then) {
4661
+ const task = {
4662
+ commands: [],
4663
+ format: "utf-8",
4664
+ parser() {
4665
+ if (typeof then === "function") {
4666
+ then();
4667
+ }
4668
+ }
4669
+ };
4670
+ return this._runTask(task);
4671
+ };
4672
+ Git2.prototype.clearQueue = function() {
4673
+ return this._runTask(
4674
+ adhocExecTask2(
4675
+ () => console.warn(
4676
+ "simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead."
4677
+ )
4678
+ )
4679
+ );
4680
+ };
4681
+ Git2.prototype.checkIgnore = function(pathnames, then) {
4682
+ return this._runTask(
4683
+ checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))),
4684
+ trailingFunctionArgument2(arguments)
4685
+ );
4686
+ };
4687
+ Git2.prototype.checkIsRepo = function(checkType, then) {
4688
+ return this._runTask(
4689
+ checkIsRepoTask2(filterType2(checkType, filterString2)),
4690
+ trailingFunctionArgument2(arguments)
4691
+ );
4692
+ };
4693
+ module2.exports = Git2;
4694
+ }
4695
+ });
4696
+
4697
+ // src/lib/git-factory.ts
4698
+ var git_factory_exports = {};
4699
+ __export(git_factory_exports, {
4700
+ esModuleFactory: () => esModuleFactory,
4701
+ gitExportFactory: () => gitExportFactory,
4702
+ gitInstanceFactory: () => gitInstanceFactory
4703
+ });
4704
+ function esModuleFactory(defaultExport) {
4705
+ return Object.defineProperties(defaultExport, {
4706
+ __esModule: { value: true },
4707
+ default: { value: defaultExport }
4708
+ });
4709
+ }
4710
+ function gitExportFactory(factory) {
4711
+ return Object.assign(factory.bind(null), api_exports);
4712
+ }
4713
+ function gitInstanceFactory(baseDir, options) {
4714
+ const plugins = new PluginStore();
4715
+ const config = createInstanceConfig(
4716
+ baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {},
4717
+ options
4718
+ );
4719
+ if (!folderExists(config.baseDir)) {
4720
+ throw new GitConstructError(
4721
+ config,
4722
+ `Cannot use simple-git on a directory that does not exist`
4723
+ );
4724
+ }
4725
+ if (Array.isArray(config.config)) {
4726
+ plugins.add(commandConfigPrefixingPlugin(config.config));
4727
+ }
4728
+ plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
4729
+ plugins.add(completionDetectionPlugin(config.completion));
4730
+ config.abort && plugins.add(abortPlugin(config.abort));
4731
+ config.progress && plugins.add(progressMonitorPlugin(config.progress));
4732
+ config.timeout && plugins.add(timeoutPlugin(config.timeout));
4733
+ config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
4734
+ plugins.add(suffixPathsPlugin());
4735
+ plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
4736
+ config.errors && plugins.add(errorDetectionPlugin(config.errors));
4737
+ customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
4738
+ return new Git(config, plugins);
4739
+ }
4740
+ var Git;
4741
+ var init_git_factory = __esm({
4742
+ "src/lib/git-factory.ts"() {
4743
+ "use strict";
4744
+ init_api();
4745
+ init_plugins();
4746
+ init_suffix_paths_plugin();
4747
+ init_utils();
4748
+ Git = require_git();
4749
+ }
4750
+ });
4751
+
4752
+ // src/lib/runners/promise-wrapped.ts
4753
+ var promise_wrapped_exports = {};
4754
+ __export(promise_wrapped_exports, {
4755
+ gitP: () => gitP
4756
+ });
4757
+ function gitP(...args) {
4758
+ let git;
4759
+ let chain = Promise.resolve();
4760
+ try {
4761
+ git = gitInstanceFactory(...args);
4762
+ } catch (e) {
4763
+ chain = Promise.reject(e);
4764
+ }
4765
+ function builderReturn() {
4766
+ return promiseApi;
4767
+ }
4768
+ function chainReturn() {
4769
+ return chain;
4770
+ }
4771
+ const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce(
4772
+ (api, name) => {
4773
+ const isAsync = functionNamesPromiseApi.includes(name);
4774
+ const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api);
4775
+ const alternative = isAsync ? chainReturn : builderReturn;
4776
+ Object.defineProperty(api, name, {
4777
+ enumerable: false,
4778
+ configurable: false,
4779
+ value: git ? valid : alternative
4780
+ });
4781
+ return api;
4782
+ },
4783
+ {}
4784
+ );
4785
+ return promiseApi;
4786
+ function asyncWrapper(fn, git2) {
4787
+ return function(...args2) {
4788
+ if (typeof args2[args2.length] === "function") {
4789
+ throw new TypeError(
4790
+ "Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to " + fn
4791
+ );
4792
+ }
4793
+ return chain.then(function() {
4794
+ return new Promise(function(resolve, reject) {
4795
+ const callback = (err, result) => {
4796
+ if (err) {
4797
+ return reject(toError(err));
4798
+ }
4799
+ resolve(result);
4800
+ };
4801
+ args2.push(callback);
4802
+ git2[fn].apply(git2, args2);
4803
+ });
4804
+ });
4805
+ };
4806
+ }
4807
+ function syncWrapper(fn, git2, api) {
4808
+ return (...args2) => {
4809
+ git2[fn](...args2);
4810
+ return api;
4811
+ };
4812
+ }
4813
+ }
4814
+ function toError(error) {
4815
+ if (error instanceof Error) {
4816
+ return error;
4817
+ }
4818
+ if (typeof error === "string") {
4819
+ return new Error(error);
4820
+ }
4821
+ return new GitResponseError(error);
4822
+ }
4823
+ var functionNamesBuilderApi, functionNamesPromiseApi;
4824
+ var init_promise_wrapped = __esm({
4825
+ "src/lib/runners/promise-wrapped.ts"() {
4826
+ "use strict";
4827
+ init_git_response_error();
4828
+ init_git_factory();
4829
+ functionNamesBuilderApi = ["customBinary", "env", "outputHandler", "silent"];
4830
+ functionNamesPromiseApi = [
4831
+ "add",
4832
+ "addAnnotatedTag",
4833
+ "addConfig",
4834
+ "addRemote",
4835
+ "addTag",
4836
+ "applyPatch",
4837
+ "binaryCatFile",
4838
+ "branch",
4839
+ "branchLocal",
4840
+ "catFile",
4841
+ "checkIgnore",
4842
+ "checkIsRepo",
4843
+ "checkout",
4844
+ "checkoutBranch",
4845
+ "checkoutLatestTag",
4846
+ "checkoutLocalBranch",
4847
+ "clean",
4848
+ "clone",
4849
+ "commit",
4850
+ "cwd",
4851
+ "deleteLocalBranch",
4852
+ "deleteLocalBranches",
4853
+ "diff",
4854
+ "diffSummary",
4855
+ "exec",
4856
+ "fetch",
4857
+ "getRemotes",
4858
+ "init",
4859
+ "listConfig",
4860
+ "listRemote",
4861
+ "log",
4862
+ "merge",
4863
+ "mergeFromTo",
4864
+ "mirror",
4865
+ "mv",
4866
+ "pull",
4867
+ "push",
4868
+ "pushTags",
4869
+ "raw",
4870
+ "rebase",
4871
+ "remote",
4872
+ "removeRemote",
4873
+ "reset",
4874
+ "revert",
4875
+ "revparse",
4876
+ "rm",
4877
+ "rmKeepLocal",
4878
+ "show",
4879
+ "stash",
4880
+ "stashList",
4881
+ "status",
4882
+ "subModule",
4883
+ "submoduleAdd",
4884
+ "submoduleInit",
4885
+ "submoduleUpdate",
4886
+ "tag",
4887
+ "tags",
4888
+ "updateServerInfo"
4889
+ ];
4890
+ }
4891
+ });
4892
+
4893
+ // src/index.js
4894
+ var { gitP: gitP2 } = (init_promise_wrapped(), __toCommonJS(promise_wrapped_exports));
4895
+ var { esModuleFactory: esModuleFactory2, gitInstanceFactory: gitInstanceFactory2, gitExportFactory: gitExportFactory2 } = (init_git_factory(), __toCommonJS(git_factory_exports));
4896
+ var simpleGit = esModuleFactory2(gitExportFactory2(gitInstanceFactory2));
4897
+ module.exports = Object.assign(simpleGit, { gitP: gitP2, simpleGit });
4898
+ //# sourceMappingURL=index.js.map