git-remote-ops 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/AGENTS.md +33 -32
  2. package/README.md +80 -206
  3. package/dist/cli.js +215 -0
  4. package/dist/cli.js.map +1 -0
  5. package/{types → dist}/client.d.ts +11 -15
  6. package/dist/client.d.ts.map +1 -0
  7. package/{esm → dist}/client.js +107 -83
  8. package/dist/client.js.map +1 -0
  9. package/{types → dist}/errors.d.ts +30 -16
  10. package/dist/errors.d.ts.map +1 -0
  11. package/{esm → dist}/errors.js +17 -8
  12. package/dist/errors.js.map +1 -0
  13. package/{types → dist}/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/{esm → dist}/index.js +2 -0
  16. package/dist/index.js.map +1 -0
  17. package/{types → dist}/logger.d.ts +11 -0
  18. package/dist/logger.d.ts.map +1 -0
  19. package/{esm → dist}/logger.js +3 -19
  20. package/dist/logger.js.map +1 -0
  21. package/{esm → dist}/objects/commit.js +1 -0
  22. package/dist/objects/commit.js.map +1 -0
  23. package/{esm → dist}/objects/index.js +1 -0
  24. package/dist/objects/index.js.map +1 -0
  25. package/{types → dist}/objects/tree.d.ts.map +1 -1
  26. package/{esm → dist}/objects/tree.js +2 -2
  27. package/dist/objects/tree.js.map +1 -0
  28. package/{esm → dist}/pack/delta.js +1 -0
  29. package/dist/pack/delta.js.map +1 -0
  30. package/{esm → dist}/pack/index.js +1 -0
  31. package/dist/pack/index.js.map +1 -0
  32. package/{types → dist}/pack/objects.d.ts.map +1 -1
  33. package/{esm → dist}/pack/objects.js +3 -3
  34. package/dist/pack/objects.js.map +1 -0
  35. package/{types → dist}/pack/parser.d.ts +19 -3
  36. package/dist/pack/parser.d.ts.map +1 -0
  37. package/{esm → dist}/pack/parser.js +46 -15
  38. package/dist/pack/parser.js.map +1 -0
  39. package/{esm → dist}/protocol/index.js +1 -0
  40. package/dist/protocol/index.js.map +1 -0
  41. package/{types → dist}/protocol/pkt_line.d.ts +3 -3
  42. package/{types → dist}/protocol/pkt_line.d.ts.map +1 -1
  43. package/{esm → dist}/protocol/pkt_line.js +1 -0
  44. package/dist/protocol/pkt_line.js.map +1 -0
  45. package/{esm → dist}/protocol/refs.js +1 -0
  46. package/dist/protocol/refs.js.map +1 -0
  47. package/{types → dist}/protocol/upload_pack.d.ts +1 -0
  48. package/{types → dist}/protocol/upload_pack.d.ts.map +1 -1
  49. package/{esm → dist}/protocol/upload_pack.js +10 -1
  50. package/dist/protocol/upload_pack.js.map +1 -0
  51. package/dist/store.d.ts +28 -0
  52. package/dist/store.d.ts.map +1 -0
  53. package/dist/store.js +179 -0
  54. package/dist/store.js.map +1 -0
  55. package/{types → dist}/transport.d.ts +15 -2
  56. package/dist/transport.d.ts.map +1 -0
  57. package/{esm → dist}/transport.js +44 -15
  58. package/dist/transport.js.map +1 -0
  59. package/{types → dist}/types.d.ts +12 -7
  60. package/dist/types.d.ts.map +1 -0
  61. package/{esm → dist}/types.js +1 -0
  62. package/dist/types.js.map +1 -0
  63. package/package.json +42 -29
  64. package/esm/_dnt.shims.js +0 -72
  65. package/esm/cli.js +0 -217
  66. package/esm/deps/jsr.io/@cliffy/command/1.1.0/_argument_types.js +0 -1
  67. package/esm/deps/jsr.io/@cliffy/command/1.1.0/_errors.js +0 -133
  68. package/esm/deps/jsr.io/@cliffy/command/1.1.0/_spread.js +0 -1
  69. package/esm/deps/jsr.io/@cliffy/command/1.1.0/_type_utils.js +0 -1
  70. package/esm/deps/jsr.io/@cliffy/command/1.1.0/_utils.js +0 -141
  71. package/esm/deps/jsr.io/@cliffy/command/1.1.0/command.js +0 -1861
  72. package/esm/deps/jsr.io/@cliffy/command/1.1.0/help/_help_generator.js +0 -357
  73. package/esm/deps/jsr.io/@cliffy/command/1.1.0/mod.js +0 -13
  74. package/esm/deps/jsr.io/@cliffy/command/1.1.0/type.js +0 -27
  75. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/action_list.js +0 -16
  76. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/boolean.js +0 -13
  77. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/child_command.js +0 -14
  78. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/command.js +0 -9
  79. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/enum.js +0 -24
  80. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/file.js +0 -12
  81. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/integer.js +0 -9
  82. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/number.js +0 -9
  83. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/secret.js +0 -7
  84. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types/string.js +0 -9
  85. package/esm/deps/jsr.io/@cliffy/command/1.1.0/types.js +0 -2
  86. package/esm/deps/jsr.io/@cliffy/command/1.1.0/upgrade/_check_version.js +0 -26
  87. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/_errors.js +0 -129
  88. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/_utils.js +0 -100
  89. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/_validate_flags.js +0 -166
  90. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/flags.js +0 -750
  91. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/mod.js +0 -55
  92. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/types/boolean.js +0 -11
  93. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/types/integer.js +0 -9
  94. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/types/number.js +0 -11
  95. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/types/string.js +0 -4
  96. package/esm/deps/jsr.io/@cliffy/flags/1.1.0/types.js +0 -1
  97. package/esm/deps/jsr.io/@cliffy/internal/1.1.0/runtime/exit.js +0 -16
  98. package/esm/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_args.js +0 -11
  99. package/esm/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_columns.js +0 -25
  100. package/esm/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_env.js +0 -18
  101. package/esm/deps/jsr.io/@cliffy/internal/1.1.0/runtime/inspect.js +0 -11
  102. package/esm/deps/jsr.io/@cliffy/table/1.1.0/_layout.js +0 -616
  103. package/esm/deps/jsr.io/@cliffy/table/1.1.0/_utils.js +0 -79
  104. package/esm/deps/jsr.io/@cliffy/table/1.1.0/border.js +0 -18
  105. package/esm/deps/jsr.io/@cliffy/table/1.1.0/cell.js +0 -190
  106. package/esm/deps/jsr.io/@cliffy/table/1.1.0/column.js +0 -117
  107. package/esm/deps/jsr.io/@cliffy/table/1.1.0/consume_words.js +0 -64
  108. package/esm/deps/jsr.io/@cliffy/table/1.1.0/mod.js +0 -42
  109. package/esm/deps/jsr.io/@cliffy/table/1.1.0/row.js +0 -82
  110. package/esm/deps/jsr.io/@cliffy/table/1.1.0/table.js +0 -341
  111. package/esm/deps/jsr.io/@cliffy/table/1.1.0/unicode_width.js +0 -101
  112. package/esm/deps/jsr.io/@std/crypto/1.1.0/_types.js +0 -2
  113. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.js +0 -237
  114. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.js +0 -2277
  115. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.js +0 -46
  116. package/esm/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.js +0 -132
  117. package/esm/deps/jsr.io/@std/crypto/1.1.0/crypto.js +0 -270
  118. package/esm/deps/jsr.io/@std/crypto/1.1.0/mod.js +0 -23
  119. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +0 -61
  120. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -51
  121. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
  122. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
  123. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -87
  124. package/esm/deps/jsr.io/@std/fmt/1.0.10/colors.js +0 -903
  125. package/esm/deps/jsr.io/@std/text/1.0.18/closest_string.js +0 -46
  126. package/esm/deps/jsr.io/@std/text/1.0.18/levenshtein_distance.js +0 -127
  127. package/esm/package.json +0 -3
  128. package/types/_dnt.shims.d.ts +0 -16
  129. package/types/_dnt.shims.d.ts.map +0 -1
  130. package/types/client.d.ts.map +0 -1
  131. package/types/deps/jsr.io/@cliffy/command/1.1.0/_argument_types.d.ts +0 -163
  132. package/types/deps/jsr.io/@cliffy/command/1.1.0/_argument_types.d.ts.map +0 -1
  133. package/types/deps/jsr.io/@cliffy/command/1.1.0/_errors.d.ts +0 -71
  134. package/types/deps/jsr.io/@cliffy/command/1.1.0/_errors.d.ts.map +0 -1
  135. package/types/deps/jsr.io/@cliffy/command/1.1.0/_spread.d.ts +0 -16
  136. package/types/deps/jsr.io/@cliffy/command/1.1.0/_spread.d.ts.map +0 -1
  137. package/types/deps/jsr.io/@cliffy/command/1.1.0/_type_utils.d.ts +0 -15
  138. package/types/deps/jsr.io/@cliffy/command/1.1.0/_type_utils.d.ts.map +0 -1
  139. package/types/deps/jsr.io/@cliffy/command/1.1.0/_utils.d.ts +0 -38
  140. package/types/deps/jsr.io/@cliffy/command/1.1.0/_utils.d.ts.map +0 -1
  141. package/types/deps/jsr.io/@cliffy/command/1.1.0/command.d.ts +0 -1086
  142. package/types/deps/jsr.io/@cliffy/command/1.1.0/command.d.ts.map +0 -1
  143. package/types/deps/jsr.io/@cliffy/command/1.1.0/help/_help_generator.d.ts +0 -33
  144. package/types/deps/jsr.io/@cliffy/command/1.1.0/help/_help_generator.d.ts.map +0 -1
  145. package/types/deps/jsr.io/@cliffy/command/1.1.0/mod.d.ts +0 -78
  146. package/types/deps/jsr.io/@cliffy/command/1.1.0/mod.d.ts.map +0 -1
  147. package/types/deps/jsr.io/@cliffy/command/1.1.0/type.d.ts +0 -51
  148. package/types/deps/jsr.io/@cliffy/command/1.1.0/type.d.ts.map +0 -1
  149. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/action_list.d.ts +0 -10
  150. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/action_list.d.ts.map +0 -1
  151. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/boolean.d.ts +0 -10
  152. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/boolean.d.ts.map +0 -1
  153. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/child_command.d.ts +0 -10
  154. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/child_command.d.ts.map +0 -1
  155. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/command.d.ts +0 -8
  156. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/command.d.ts.map +0 -1
  157. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/enum.d.ts +0 -11
  158. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/enum.d.ts.map +0 -1
  159. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/file.d.ts +0 -6
  160. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/file.d.ts.map +0 -1
  161. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/integer.d.ts +0 -8
  162. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/integer.d.ts.map +0 -1
  163. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/number.d.ts +0 -8
  164. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/number.d.ts.map +0 -1
  165. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/secret.d.ts +0 -6
  166. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/secret.d.ts.map +0 -1
  167. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/string.d.ts +0 -8
  168. package/types/deps/jsr.io/@cliffy/command/1.1.0/types/string.d.ts.map +0 -1
  169. package/types/deps/jsr.io/@cliffy/command/1.1.0/types.d.ts +0 -161
  170. package/types/deps/jsr.io/@cliffy/command/1.1.0/types.d.ts.map +0 -1
  171. package/types/deps/jsr.io/@cliffy/command/1.1.0/upgrade/_check_version.d.ts +0 -4
  172. package/types/deps/jsr.io/@cliffy/command/1.1.0/upgrade/_check_version.d.ts.map +0 -1
  173. package/types/deps/jsr.io/@cliffy/flags/1.1.0/_errors.d.ts +0 -67
  174. package/types/deps/jsr.io/@cliffy/flags/1.1.0/_errors.d.ts.map +0 -1
  175. package/types/deps/jsr.io/@cliffy/flags/1.1.0/_utils.d.ts +0 -17
  176. package/types/deps/jsr.io/@cliffy/flags/1.1.0/_utils.d.ts.map +0 -1
  177. package/types/deps/jsr.io/@cliffy/flags/1.1.0/_validate_flags.d.ts +0 -11
  178. package/types/deps/jsr.io/@cliffy/flags/1.1.0/_validate_flags.d.ts.map +0 -1
  179. package/types/deps/jsr.io/@cliffy/flags/1.1.0/flags.d.ts +0 -154
  180. package/types/deps/jsr.io/@cliffy/flags/1.1.0/flags.d.ts.map +0 -1
  181. package/types/deps/jsr.io/@cliffy/flags/1.1.0/mod.d.ts +0 -57
  182. package/types/deps/jsr.io/@cliffy/flags/1.1.0/mod.d.ts.map +0 -1
  183. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/boolean.d.ts +0 -4
  184. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/boolean.d.ts.map +0 -1
  185. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/integer.d.ts +0 -4
  186. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/integer.d.ts.map +0 -1
  187. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/number.d.ts +0 -4
  188. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/number.d.ts.map +0 -1
  189. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/string.d.ts +0 -4
  190. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types/string.d.ts.map +0 -1
  191. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types.d.ts +0 -170
  192. package/types/deps/jsr.io/@cliffy/flags/1.1.0/types.d.ts.map +0 -1
  193. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/exit.d.ts +0 -8
  194. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/exit.d.ts.map +0 -1
  195. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_args.d.ts +0 -7
  196. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_args.d.ts.map +0 -1
  197. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_columns.d.ts +0 -7
  198. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_columns.d.ts.map +0 -1
  199. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_env.d.ts +0 -8
  200. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/get_env.d.ts.map +0 -1
  201. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/inspect.d.ts +0 -7
  202. package/types/deps/jsr.io/@cliffy/internal/1.1.0/runtime/inspect.d.ts.map +0 -1
  203. package/types/deps/jsr.io/@cliffy/table/1.1.0/_layout.d.ts +0 -108
  204. package/types/deps/jsr.io/@cliffy/table/1.1.0/_layout.d.ts.map +0 -1
  205. package/types/deps/jsr.io/@cliffy/table/1.1.0/_utils.d.ts +0 -26
  206. package/types/deps/jsr.io/@cliffy/table/1.1.0/_utils.d.ts.map +0 -1
  207. package/types/deps/jsr.io/@cliffy/table/1.1.0/border.d.ts +0 -21
  208. package/types/deps/jsr.io/@cliffy/table/1.1.0/border.d.ts.map +0 -1
  209. package/types/deps/jsr.io/@cliffy/table/1.1.0/cell.d.ts +0 -155
  210. package/types/deps/jsr.io/@cliffy/table/1.1.0/cell.d.ts.map +0 -1
  211. package/types/deps/jsr.io/@cliffy/table/1.1.0/column.d.ts +0 -97
  212. package/types/deps/jsr.io/@cliffy/table/1.1.0/column.d.ts.map +0 -1
  213. package/types/deps/jsr.io/@cliffy/table/1.1.0/consume_words.d.ts +0 -30
  214. package/types/deps/jsr.io/@cliffy/table/1.1.0/consume_words.d.ts.map +0 -1
  215. package/types/deps/jsr.io/@cliffy/table/1.1.0/mod.d.ts +0 -43
  216. package/types/deps/jsr.io/@cliffy/table/1.1.0/mod.d.ts.map +0 -1
  217. package/types/deps/jsr.io/@cliffy/table/1.1.0/row.d.ts +0 -67
  218. package/types/deps/jsr.io/@cliffy/table/1.1.0/row.d.ts.map +0 -1
  219. package/types/deps/jsr.io/@cliffy/table/1.1.0/table.d.ts +0 -235
  220. package/types/deps/jsr.io/@cliffy/table/1.1.0/table.d.ts.map +0 -1
  221. package/types/deps/jsr.io/@cliffy/table/1.1.0/unicode_width.d.ts +0 -40
  222. package/types/deps/jsr.io/@cliffy/table/1.1.0/unicode_width.d.ts.map +0 -1
  223. package/types/deps/jsr.io/@std/crypto/1.1.0/_types.d.ts +0 -9
  224. package/types/deps/jsr.io/@std/crypto/1.1.0/_types.d.ts.map +0 -1
  225. package/types/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.d.ts +0 -2
  226. package/types/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.d.ts.map +0 -1
  227. package/types/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.d.ts +0 -69
  228. package/types/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.d.ts.map +0 -1
  229. package/types/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.d.ts +0 -13
  230. package/types/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.d.ts.map +0 -1
  231. package/types/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.d.ts +0 -76
  232. package/types/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.d.ts.map +0 -1
  233. package/types/deps/jsr.io/@std/crypto/1.1.0/crypto.d.ts +0 -149
  234. package/types/deps/jsr.io/@std/crypto/1.1.0/crypto.d.ts.map +0 -1
  235. package/types/deps/jsr.io/@std/crypto/1.1.0/mod.d.ts +0 -22
  236. package/types/deps/jsr.io/@std/crypto/1.1.0/mod.d.ts.map +0 -1
  237. package/types/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +0 -40
  238. package/types/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts.map +0 -1
  239. package/types/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  240. package/types/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  241. package/types/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  242. package/types/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  243. package/types/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  244. package/types/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  245. package/types/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  246. package/types/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  247. package/types/deps/jsr.io/@std/fmt/1.0.10/colors.d.ts +0 -700
  248. package/types/deps/jsr.io/@std/fmt/1.0.10/colors.d.ts.map +0 -1
  249. package/types/deps/jsr.io/@std/text/1.0.18/closest_string.d.ts +0 -42
  250. package/types/deps/jsr.io/@std/text/1.0.18/closest_string.d.ts.map +0 -1
  251. package/types/deps/jsr.io/@std/text/1.0.18/levenshtein_distance.d.ts +0 -23
  252. package/types/deps/jsr.io/@std/text/1.0.18/levenshtein_distance.d.ts.map +0 -1
  253. package/types/errors.d.ts.map +0 -1
  254. package/types/index.d.ts.map +0 -1
  255. package/types/logger.d.ts.map +0 -1
  256. package/types/pack/parser.d.ts.map +0 -1
  257. package/types/transport.d.ts.map +0 -1
  258. package/types/types.d.ts.map +0 -1
  259. /package/{types → dist}/cli.d.ts +0 -0
  260. /package/{types → dist}/cli.d.ts.map +0 -0
  261. /package/{types → dist}/objects/commit.d.ts +0 -0
  262. /package/{types → dist}/objects/commit.d.ts.map +0 -0
  263. /package/{types → dist}/objects/index.d.ts +0 -0
  264. /package/{types → dist}/objects/index.d.ts.map +0 -0
  265. /package/{types → dist}/objects/tree.d.ts +0 -0
  266. /package/{types → dist}/pack/delta.d.ts +0 -0
  267. /package/{types → dist}/pack/delta.d.ts.map +0 -0
  268. /package/{types → dist}/pack/index.d.ts +0 -0
  269. /package/{types → dist}/pack/index.d.ts.map +0 -0
  270. /package/{types → dist}/pack/objects.d.ts +0 -0
  271. /package/{types → dist}/protocol/index.d.ts +0 -0
  272. /package/{types → dist}/protocol/index.d.ts.map +0 -0
  273. /package/{types → dist}/protocol/refs.d.ts +0 -0
  274. /package/{types → dist}/protocol/refs.d.ts.map +0 -0
package/AGENTS.md CHANGED
@@ -6,48 +6,50 @@ contributor-internal lore (parser invariants, harness boot), see `docs/`.
6
6
  ## What this library is
7
7
 
8
8
  Read-only Git client over smart HTTP. No `.git` dir, no subprocess, no working tree. Fetches one
9
- commit / one tree / one blob from a remote and hands back decoded bytes.
9
+ commit / one tree / one blob from a remote and stores decoded objects in caller-supplied `storeDir`.
10
10
 
11
11
  ## What it is NOT
12
12
 
13
13
  - Not a `git` replacement. No push, no working tree, no ref writes, no merges.
14
14
  - Not a clone manager. No `have` negotiation, no incremental sync — every fetch is from-scratch with
15
15
  `done`.
16
- - Not streaming. Packs are held in memory in full.
16
+ - Not a fully streaming parser. Extracted packs are loaded in memory during parse.
17
17
 
18
18
  If consumer needs writes or full clones, shell out to `git` instead.
19
19
 
20
20
  ## Install
21
21
 
22
22
  ```ts
23
- import { RemoteGit } from "jsr:@local/git-remote-ops";
23
+ import { RemoteGit } from "git-remote-ops";
24
24
  ```
25
25
 
26
- Deno only. Requires `--allow-net`.
26
+ Node.js 24 LTS package. Use pnpm for local development and npm-compatible package installs for consumers.
27
27
 
28
28
  CLI:
29
29
 
30
30
  ```sh
31
- deno install --global -A -n git-remote-ops src/cli.ts
31
+ pnpm install
32
+ pnpm build
33
+ pnpm exec git-remote-ops --help
32
34
  ```
33
35
 
34
36
  ## Core API
35
37
 
36
38
  One class. All methods async. All return `Result<T, GitRemoteOpsError>` from
37
- [`better-result`](https://jsr.io/@local/better-result) — never throw.
39
+ `better-result` — never throw.
38
40
 
39
41
  ```ts
40
- const client = new RemoteGit(url, { logger? , diagnostic? });
42
+ const client = new RemoteGit(url, { storeDir, logger?, diagnostic? });
41
43
 
42
44
  await client.discover(); // -> ServerProfile
43
45
  await client.probe(verbose?); // -> ServerProfile (filter probe)
44
46
  await client.lsRefs(); // -> Map<refName, sha>
45
47
  await client.resolveRef(ref); // -> sha
46
- await client.fetchCommit(ref, { depth?, filter?, parseFull? });
48
+ await client.fetchCommit(ref, { depth?, filter?, parseScope? });
47
49
  await client.fetchBlob(sha);
48
50
  await client.fetchTree(sha);
49
51
  await client.fetchTreeForCommit(ref, opts);
50
- client.getObject(sha); // cache lookup, no network
52
+ await client.getObject(sha); // disk store lookup, no network
51
53
  ```
52
54
 
53
55
  ## Result handling
@@ -71,26 +73,26 @@ if you want exceptions.
71
73
 
72
74
  ## Caching behaviour consumers should know
73
75
 
74
- One `RemoteGit` instance keeps:
76
+ `RemoteGit` keeps one `ServerProfile` in memory. Objects live on disk under `storeDir`:
75
77
 
76
- - One `ServerProfile`populated on first call, reused after.
77
- - All materialized objects in a `Map<sha, GitObject>`, **process-lifetime**.
78
+ - `objects/<aa>/<rest>`Git-compatible loose objects.
79
+ - `incoming/` transient raw responses and extracted packs.
80
+ - `snapshots/` — depth-1 snapshot markers.
78
81
 
79
82
  Implications:
80
83
 
81
- - Reuse instances across calls — commit → tree → blob dedupes `want`s.
82
- - Don't hold an instance forever in long-running processes if memory matters. Throw it away when
83
- done with that remote.
84
- - Concurrent calls on one instance share the cache; no internal locking.
84
+ - Reuse `storeDir` across calls/processes — commit → tree → blob dedupes `want`s from disk.
85
+ - `getObject` is async because it reads the loose-object store.
86
+ - Concurrent writers rely on atomic temp-file rename only; no lockfile yet.
85
87
 
86
88
  ## Choosing options
87
89
 
88
- | Goal | Recipe |
89
- | --------------------------- | ----------------------------------------------------------------------------- |
90
- | One commit's metadata | `fetchCommit(ref, { depth: 1, filter: "blob:none" })` |
91
- | List files at snapshot | `fetchTreeForCommit(ref, { depth: 1, filter: "blob:none", parseFull: true })` |
92
- | One known blob | `fetchBlob(sha)` (no profile probe needed) |
93
- | Path → blob without network | `resolvePathToBlob` from `objects/tree.ts` against `client` object cache |
90
+ | Goal | Recipe |
91
+ | --------------------------- | ------------------------------------------------------------------------------------ |
92
+ | One commit's metadata | `fetchCommit(ref, { depth: 1, filter: "blob:none" })` |
93
+ | List files at snapshot | `fetchTreeForCommit(ref, { depth: 1, filter: "blob:none" })` |
94
+ | One known blob | `fetchBlob(sha)` (no profile probe needed) |
95
+ | Path → blob without network | read trees from `getObject` / `LooseObjectStore`, then use `objects/tree.ts` helpers |
94
96
 
95
97
  `depth: 1` + `filter: "blob:none"` is the cheap default. Both gracefully degrade if server doesn't
96
98
  advertise the capability — depth drops, filter logs at info and proceeds.
@@ -100,10 +102,10 @@ advertise the capability — depth drops, filter logs at info and proceeds.
100
102
  Library silent unless told otherwise.
101
103
 
102
104
  ```ts
103
- import { Logger } from "jsr:@local/git-remote-ops";
105
+ import { Logger } from "git-remote-ops";
104
106
 
105
107
  const logger = new Logger({ level: "debug" });
106
- const client = new RemoteGit(url, { logger });
108
+ const client = new RemoteGit(url, { logger, storeDir });
107
109
  // ...
108
110
  console.error(logger.summary()); // metrics table
109
111
  ```
@@ -122,7 +124,7 @@ git-remote-ops list-files <url> [--ref HEAD] [--depth N] [--filter SPEC | --no-
122
124
  [--details]
123
125
  git-remote-ops cat-blob <url> <blob-sha>
124
126
 
125
- Global: -q | -v | --debug | --stats
127
+ Global: --store-dir <path> | -q | -v | --debug | --stats
126
128
  ```
127
129
 
128
130
  Stdout = data. Stderr = logs + errors. Exit 1 on any `Result.err`.
@@ -132,8 +134,8 @@ Full reference: `docs/cli.md`.
132
134
  ## Common pitfalls
133
135
 
134
136
  **Calling `fetchTree(commit.tree)` after `fetchCommit(ref)` with default options.** Default
135
- `parseFull: false` only materializes the commit itself. Use `fetchTreeForCommit` or pass
136
- `{ parseFull: true }` to `fetchCommit`.
137
+ `parseScope: "target"` only materializes the commit itself. Use `fetchTreeForCommit` or pass
138
+ `{ parseScope: "all" }` to `fetchCommit`.
137
139
 
138
140
  **Expecting full history.** `depth: 1` (the CLI default) gives one commit. Drop depth for full
139
141
  history; expect a much larger pack.
@@ -141,11 +143,10 @@ history; expect a much larger pack.
141
143
  **Treating `RefNotFoundError` as fatal.** A 40-char hex sha is accepted even when not in the ad —
142
144
  try direct sha if your ref is unusual.
143
145
 
144
- **Confusing `getObject` with a fetch.** `getObject` only checks the cache. Returns `undefined` if
145
- not yet materialized. No network call.
146
+ **Confusing `getObject` with a fetch.** `getObject` only checks the disk store. Returns `undefined`
147
+ if not yet materialized. No network call.
146
148
 
147
- **Throwing away the client between calls.** Re-discovers, re-probes, re-fetches the same objects.
148
- Reuse it.
149
+ **Throwing away `storeDir` between calls.** Re-fetches the same objects. Reuse the directory.
149
150
 
150
151
  ## Where to look in source
151
152
 
@@ -170,7 +171,7 @@ Every file carries a module-level JSDoc banner with intent. Every constant docum
170
171
 
171
172
  ## Versioning
172
173
 
173
- Pre-1.0. API may shift. Pin exact version in `deno.json` imports.
174
+ Pre-1.0. API may shift. Pin exact package versions in `package.json`.
174
175
 
175
176
  ## License
176
177
 
package/README.md CHANGED
@@ -1,247 +1,121 @@
1
1
  # git-remote-ops
2
2
 
3
- **Read-only Git over smart HTTP, without `git`.** A single Deno/TypeScript process speaks the same
4
- wire protocol that `git fetch` does, then materializes the parts you actually want — one commit, one
5
- tree, one file — straight into memory.
3
+ Read-only Git remote operations over smart HTTP.
6
4
 
7
- No `.git` directory. No subprocess. No filesystem state to clean up.
5
+ Fetch commit metadata, trees, file lists, or blobs from a remote Git repository without cloning and without shelling out to `git`.
6
+
7
+ ## Install
8
8
 
9
9
  ```bash
10
- deno run --allow-net jsr:@local/git-remote-ops/cli \
11
- cat-blob https://github.com/torvalds/linux.git \
12
- e8c39d0f… > Makefile
10
+ npm install git-remote-ops
13
11
  ```
14
12
 
15
- The blob lands in `Makefile`. The local working set never grows past a few KB of cached pack
16
- metadata.
17
-
18
- ## Why bother
19
-
20
- A surprising amount of production code shells out to `git` just to read a file. That works, but it
21
- forces a clone — every byte of every revision of every path — to retrieve one revision of one path.
22
- On a large monorepo the clone is the entire latency budget.
23
-
24
- The Git smart-HTTP protocol has supported targeted fetches for years. With shallow depth
25
- (`--depth=1`) and partial-clone filters (`--filter=blob:none`, `--filter=tree:0`) you can ask the
26
- server for _just the snapshot you care about_, often a few hundred kilobytes total. Mainline `git`
27
- exposes this, but to use it you still need an on-disk clone and a forked process.
28
-
29
- `git-remote-ops` is the thin client you'd write if you only ever did this one thing: a few hundred
30
- lines of TypeScript that build the same `want`/`done` request `git` would, parse the packfile that
31
- comes back, and hand you the decoded objects.
32
-
33
- ## What's in the box
34
-
35
- Six subcommands, all read-only:
13
+ Run CLI without installing into project:
36
14
 
37
- | Command | Does |
38
- | ------------ | ------------------------------------------------------------- |
39
- | `probe` | Capability sniff: protocol version, shallow, filter dialects. |
40
- | `ls-refs` | List advertised refs as `<sha> <name>`. |
41
- | `cat-commit` | Fetch + decode a commit object. |
42
- | `cat-tree` | Fetch + decode a root tree (or a specific tree by sha). |
43
- | `list-files` | Walk a snapshot and emit every path. |
44
- | `cat-blob` | Stream one blob's raw bytes to stdout. |
45
-
46
- And the same operations are available as a library:
47
-
48
- ```typescript
49
- import { RemoteGit } from "jsr:@local/git-remote-ops";
50
-
51
- const client = new RemoteGit("https://github.com/owner/repo.git");
52
- const { sha, commit } = (await client.fetchCommit("HEAD")).unwrap();
53
- const tree = (await client.fetchTree(commit.tree)).unwrap();
54
- const blob = (await client.fetchBlob(tree[0].sha)).unwrap();
15
+ ```bash
16
+ npx git-remote-ops --help
55
17
  ```
56
18
 
57
- Every public call returns a `Result<T, GitRemoteOpsError>` from
58
- [`better-result`](https://jsr.io/@local/better-result) — never throws.
59
-
60
- ## How it works
19
+ ## CLI
61
20
 
62
- The work splits into four layers, and the codebase mirrors that split.
21
+ Every command needs `--store-dir`. Reuse same directory to avoid re-downloading objects.
63
22
 
23
+ ```bash
24
+ git-remote-ops --store-dir /tmp/git-remote-ops-cache ls-refs https://github.com/owner/repo.git
64
25
  ```
65
- ┌──────────────────────────┐
66
- src/client.ts ─→ │ RemoteGit (public API) │
67
- └────────────┬─────────────┘
68
-
69
- ┌────────────────────────┼───────────────────────┐
70
- ▼ ▼ ▼
71
- src/protocol/ src/pack/ src/objects/
72
- pkt-line, refs, pack parser, delta, commit + tree
73
- upload-pack zlib bridge decoders
74
- │ ▲
75
- ▼ │
76
- src/transport.ts ─────────────┘
77
- (fetch wrappers)
78
- ```
79
-
80
- ### 1. Transport — `src/transport.ts`
81
-
82
- Two `fetch` calls do all the network work:
83
-
84
- 1. `GET /info/refs?service=git-upload-pack` — the ref advertisement.
85
- 2. `POST /git-upload-pack` — the actual fetch, body framed below.
86
-
87
- Both helpers thread an optional `Logger` so byte counts and durations roll into the same metrics
88
- struct the CLI's `--stats` flag prints.
89
-
90
- ### 2. Protocol — `src/protocol/`
91
-
92
- **pkt-line framing.** Everything Git sends over HTTP is wrapped in a 4-byte ASCII-hex length prefix.
93
- Length `0000` is a flush; `0001` and `0002` are v2 control packets. `parsePktLines` walks a buffer
94
- end-to-end, returning subarray views — no payload bytes are copied. Trailing `\n`s are preserved
95
- because some callers care.
96
-
97
- **Ref advertisement.** v0/v1 puts capabilities NUL-separated on the first ref line; v2 puts them on
98
- standalone pkt-lines after `version 2`. We parse both, merge the capability sets, and prefer v2 when
99
- both are advertised.
100
-
101
- **`git-upload-pack` request.** A `want <sha>` line per object, an optional `deepen <n>` for shallow,
102
- an optional `filter <spec>` for partial-clone, a flush, then `done`. The v2 encoder adds a
103
- `command=fetch` header section and turns capabilities into separate argument lines instead of riding
104
- the first `want`.
105
-
106
- **Sideband demux.** The response is itself a stream of pkt-lines; each data line starts with a
107
- channel byte. Channel 1 is the packfile, channel 2 is human-readable progress, channel 3 is fatal
108
- stderr. `extractPack` looks at the first real data line, picks the right strategy (raw `PACK`
109
- signature, sideband, or PACK-search fallback), and returns the concatenated channel-1 bytes.
110
-
111
- ### 3. Packfile — `src/pack/`
112
26
 
113
- A packfile is `PACK` + version + count + N variable-length object entries + a trailing SHA-1. Each
114
- entry has a type/size header (a varint with a 3-bit type field jammed into the first byte) followed
115
- by a zlib-compressed body.
116
-
117
- The parser walks entries in order. For non-delta types it inflates and hashes the body in one shot.
118
- For deltas — two flavours, `OBJ_OFS_DELTA` (base referenced by negative byte offset) and
119
- `OBJ_REF_DELTA` (base referenced by 20-byte sha) — it applies the delta against the resolved base
120
- and re-hashes the reconstructed object.
121
-
122
- Two implementation notes worth flagging:
123
-
124
- **zlib boundaries.** Multiple deflate streams sit back-to-back inside the pack with no length
125
- prefix. The streaming API doesn't tell you how many input bytes a single decode consumed, so we
126
- reach into `node:zlib`'s `_processChunk` and read `bytesWritten` to advance the cursor. It's an
127
- implementation detail of Node's zlib binding, but it's a stable one, and the alternative is parsing
128
- deflate headers ourselves.
27
+ ```bash
28
+ git-remote-ops --store-dir /tmp/git-remote-ops-cache \
29
+ cat-commit https://github.com/owner/repo.git --ref main
30
+ ```
129
31
 
130
- **Targeted bailout.** If you only need a single commit, the parser accepts a `targets` set and
131
- returns as soon as those shas are materialized — even mid-pack. On a large snapshot pack that's the
132
- difference between parsing five megabytes of objects and parsing fifty kilobytes.
32
+ ```bash
33
+ git-remote-ops --store-dir /tmp/git-remote-ops-cache \
34
+ list-files https://github.com/owner/repo.git --ref main
35
+ ```
133
36
 
134
- **Delta application.** The delta stream is a tiny opcode language: "copy `n` bytes from base at
135
- offset `o`" or "insert these `n` literal bytes". A size of zero on a copy opcode means 64 KiB.
136
- Out-of-bounds copies become typed errors, never silent corruption.
37
+ ```bash
38
+ git-remote-ops --store-dir /tmp/git-remote-ops-cache \
39
+ cat-blob https://github.com/owner/repo.git <blob-sha> > file.bin
40
+ ```
137
41
 
138
- ### 4. Objects — `src/objects/`
42
+ Commands:
139
43
 
140
- Commit and tree decoders. Both inputs are the _uncompressed_ bodies produced by layer 3; neither
141
- parser cares how the bytes got there.
44
+ ```text
45
+ probe <url>
46
+ ls-refs <url>
47
+ cat-commit <url> [--ref HEAD] [--depth 1] [--filter blob:none | --no-filter]
48
+ cat-tree <url> [--ref HEAD] [--depth 1] [--filter blob:none | --no-filter] [--tree-sha <sha>]
49
+ list-files <url> [--ref HEAD] [--depth 1] [--filter blob:none | --no-filter] [--details]
50
+ cat-blob <url> <blob-sha>
51
+ ```
142
52
 
143
- A tree is `<mode> <name>\0<sha20>` repeated, with no length prefix. A commit is RFC822-ish headers +
144
- blank line + free-form message; we keep `tree`, first `parent`, `author`, `committer`. Multiple
145
- `parent` lines (merge commits) collapse to the first because this client only walks toward snapshots
146
- — never along history.
53
+ See [`docs/cli.md`](docs/cli.md) for full CLI reference.
147
54
 
148
- `walkTree` and `resolvePathToBlob` round out the layer for callers that want to flatten a tree or
149
- resolve `path/to/file` to a blob sha without touching the network.
55
+ ## API
150
56
 
151
- ### 5. The client — `src/client.ts`
57
+ ```ts
58
+ import { RemoteGit } from "git-remote-ops";
152
59
 
153
- `RemoteGit` ties the layers together and caches two things across calls:
60
+ const git = new RemoteGit("https://github.com/owner/repo.git", {
61
+ storeDir: "/tmp/git-remote-ops-cache",
62
+ });
154
63
 
155
- - A `ServerProfile` (refs + capabilities + filter probe results), populated lazily on the first call
156
- and shared by everything after.
157
- - Every materialized object, in a process-lifetime `Map`. Subsequent fetches dedupe `want` lists
158
- against this map, so a typical commit → tree → blob sequence only pays the network cost for new
159
- objects.
64
+ const commit = await git.fetchCommit("HEAD", {
65
+ depth: 1,
66
+ filter: "blob:none",
67
+ });
68
+ if (commit.isErr()) throw commit.error;
160
69
 
161
- There's a small bit of negotiation logic: shallow depth is dropped if the server didn't advertise
162
- `shallow`; filters are dropped (with an info log) if the server didn't advertise `filter`. `probe()`
163
- exists because some servers _advertise_ filter support but don't honour it — we send minimal-cost
164
- test fetches with `blob:none` and `tree:0` and look at the returned pack to find out.
70
+ const tree = await git.fetchTree(commit.value.commit.tree);
71
+ if (tree.isErr()) throw tree.error;
165
72
 
166
- ## Errors
73
+ console.log(tree.value);
74
+ ```
167
75
 
168
- Every public function returns `Result<T, E>`. Errors are tagged classes from `better-result`, so you
169
- can narrow on `_tag` and pull structured fields off:
76
+ ```ts
77
+ const files = await git.fetchTreeForCommit("main", {
78
+ depth: 1,
79
+ filter: "blob:none",
80
+ });
170
81
 
171
- ```typescript
172
- const result = await client.fetchBlob(sha);
173
- if (result.isErr()) {
174
- switch (result.error._tag) {
175
- case "TransportError": // .status, .url, .method available
176
- case "PackParseError": // .offset, .reason
177
- case "ObjectNotFoundError": // .sha
178
- // …
82
+ if (files.isOk()) {
83
+ for (const entry of files.value.entries) {
84
+ console.log(entry.mode, entry.sha, entry.name);
179
85
  }
180
86
  }
181
87
  ```
182
88
 
183
- The full union is exported as `GitRemoteOpsError`. See `src/errors.ts`.
184
-
185
- ## Observability
186
-
187
- The bundled `Logger` does three jobs at once:
188
-
189
- - Levelled messages (`info`, `debug`, `trace`) with namespaced children.
190
- - Cumulative metrics: HTTP request count / bytes / time, pack objects by type / bytes / parse time.
191
- - An aligned summary table for `--stats`.
192
-
193
- The library never logs above `info` unless you ask. Pass a configured `Logger` via
194
- `new RemoteGit(url, { logger })`, or hand it a `diagnostic` callback and the constructor will route
195
- debug-level lines to it.
196
-
197
- ## CLI
198
-
199
- ```text
200
- git-remote-ops <command> [options] <url>
201
-
202
- Global flags:
203
- -q, --quiet silent
204
- -v, --verbose debug
205
- --debug trace
206
- --stats print metrics summary after completion
207
-
208
- probe <url>
209
- ls-refs <url>
210
- cat-commit <url> [--ref HEAD] [--depth 1] [--filter blob:none | --no-filter]
211
- cat-tree <url> [--ref HEAD] [--depth 1] [--filter blob:none | --no-filter]
212
- [--tree-sha <sha>]
213
- list-files <url> [--ref HEAD] [--depth 1] [--filter blob:none | --no-filter]
214
- [--details]
215
- cat-blob <url> <blob-sha>
89
+ ```ts
90
+ const blob = await git.fetchBlob("<blob-sha>");
91
+ if (blob.isOk()) {
92
+ await writeFile("file.bin", blob.value);
93
+ }
216
94
  ```
217
95
 
218
- See `docs/cli.md` for the long-form reference.
219
-
220
- ## Development
221
-
222
- ```bash
223
- deno task check # type-check
224
- deno task lint
225
- deno task fmt:check
226
- deno task test # unit tests (no network)
227
- deno task test:integration # spins up a local git server
228
- deno task verify # fmt + lint + check, what CI runs
96
+ Core methods:
97
+
98
+ ```ts
99
+ await git.probe();
100
+ await git.lsRefs();
101
+ await git.resolveRef(ref);
102
+ await git.fetchCommit(ref, options?);
103
+ await git.fetchTree(treeSha);
104
+ await git.fetchTreeForCommit(ref, options?);
105
+ await git.fetchBlob(blobSha);
106
+ await git.getObject(sha);
229
107
  ```
230
108
 
231
- Tests for each layer live next to their code as `*.test.ts`. The integration tests under
232
- `src/testing/integration/` exercise a real `git-upload-pack` talking to the client — see
233
- `docs/git-server-harness-AGENTS.md` for how the harness boots.
109
+ All public methods return `Result<T, GitRemoteOpsError>` from `better-result`.
110
+
111
+ ## Cache
234
112
 
235
- ## Limitations
113
+ `storeDir` persists fetched Git objects. Reuse it across calls or CLI runs.
236
114
 
237
- By design this client only does fetches. It can't push, can't write to a working tree, can't manage
238
- refs. It also makes no attempt to negotiate `have` lines — every request is a from-scratch fetch
239
- with `done`, on the assumption that you're after small slices of remote history rather than
240
- incrementally syncing a clone.
115
+ ## Limits
241
116
 
242
- The packfile is held in memory in full. For large monorepos that fits in practice (kilobytes with
243
- `blob:none` + `--depth=1`), but a streaming parser would be a reasonable evolution.
117
+ Fetch only. No push, checkout, ref writes, or full clone management.
244
118
 
245
119
  ## License
246
120
 
247
- See `LICENSE`.
121
+ MIT. See [`LICENSE`](LICENSE).