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
@@ -1,357 +0,0 @@
1
- import { Table } from "../../../table/1.1.0/mod.js";
2
- import { bold, brightBlue, brightMagenta, dim, getColorEnabled, green, italic, red, setColorEnabled, yellow, } from "../../../../@std/fmt/1.0.10/colors.js";
3
- import { getColumns } from "../../../internal/1.1.0/runtime/get_columns.js";
4
- import { inspect } from "../../../internal/1.1.0/runtime/inspect.js";
5
- import { dedent, getDescription, getFlag, parseArgumentsDefinition, } from "../_utils.js";
6
- import { Type } from "../type.js";
7
- /** Help text generator. */
8
- export class HelpGenerator {
9
- cmd;
10
- indent = 2;
11
- options;
12
- /** Generate help text for given command. */
13
- static generate(cmd, options) {
14
- return new HelpGenerator(cmd, options).generate();
15
- }
16
- constructor(cmd, options = {}) {
17
- this.cmd = cmd;
18
- this.options = {
19
- types: false,
20
- hints: true,
21
- colors: true,
22
- long: false,
23
- width: getColumns() ?? 150,
24
- maxWidth: Infinity,
25
- ...options,
26
- };
27
- this.options.width = Math.min(this.options.width, this.options.maxWidth);
28
- }
29
- generate() {
30
- const areColorsEnabled = getColorEnabled();
31
- setColorEnabled(this.options.colors);
32
- const result = this.generateHeader() +
33
- this.generateMeta() +
34
- this.generateDescription() +
35
- this.generateArguments() +
36
- this.generateOptions() +
37
- this.generateCommands() +
38
- this.generateEnvironmentVariables() +
39
- this.generateExamples();
40
- setColorEnabled(areColorsEnabled);
41
- return result;
42
- }
43
- generateHeader() {
44
- const usage = this.cmd.getUsage();
45
- const rows = [
46
- [
47
- bold("Usage:"),
48
- brightMagenta(this.cmd.getPath() +
49
- (usage ? " " + highlightArguments(usage, this.options.types) : "")),
50
- ],
51
- ];
52
- const version = this.cmd.getVersion();
53
- if (version) {
54
- rows.push([bold("Version:"), yellow(`${this.cmd.getVersion()}`)]);
55
- }
56
- return "\n" +
57
- Table.from(rows)
58
- .padding(1)
59
- .toString() +
60
- "\n";
61
- }
62
- generateMeta() {
63
- const meta = Object.entries(this.cmd.getMeta());
64
- if (!meta.length) {
65
- return "";
66
- }
67
- const rows = [];
68
- for (const [name, value] of meta) {
69
- rows.push([bold(`${name}: `) + value]);
70
- }
71
- return "\n" +
72
- Table.from(rows)
73
- .padding(1)
74
- .toString() +
75
- "\n";
76
- }
77
- generateDescription() {
78
- if (!this.cmd.getDescription()) {
79
- return "";
80
- }
81
- return this.label("Description") +
82
- Table.from([
83
- [dedent(this.cmd.getDescription())],
84
- ])
85
- .indent(this.indent)
86
- .maxColWidth(this.options.width - this.indent)
87
- .padding(1)
88
- .toString() +
89
- "\n";
90
- }
91
- generateArguments() {
92
- const args = this.cmd.getArguments();
93
- if (!args.length || !args.find((arg) => arg.description)) {
94
- return "";
95
- }
96
- return this.label("Arguments") +
97
- Table.from([
98
- ...args
99
- .filter((arg) => arg.description)
100
- .map((argument) => [
101
- highlightArguments(argument.raw || "", this.options.types),
102
- red(bold("-")),
103
- getDescription(argument.description ?? "", !this.options.long),
104
- this.generateArgumentHints(argument),
105
- ]),
106
- ])
107
- .padding([2, 1, 2])
108
- .indent(this.indent)
109
- .maxWidth(this.options.width - this.indent)
110
- .flexShrink([0, 0, 1, 1])
111
- .toString() +
112
- "\n";
113
- }
114
- generateOptions() {
115
- const options = this.cmd.getOptions(false);
116
- if (!options.length) {
117
- return "";
118
- }
119
- let groups = [];
120
- const hasGroups = options.some((option) => option.groupName);
121
- if (hasGroups) {
122
- for (const option of options) {
123
- let group = groups.find((group) => group.name === option.groupName);
124
- if (!group) {
125
- group = {
126
- name: option.groupName,
127
- options: [],
128
- };
129
- groups.push(group);
130
- }
131
- group.options.push(option);
132
- }
133
- }
134
- else {
135
- groups = [{
136
- name: "Options",
137
- options,
138
- }];
139
- }
140
- let result = "";
141
- for (const group of groups) {
142
- result += this.generateOptionGroup(group);
143
- }
144
- return result;
145
- }
146
- generateOptionGroup(group) {
147
- if (!group.options.length) {
148
- return "";
149
- }
150
- const hasTypeDefinitions = !!group.options.find((option) => !!option.typeDefinition);
151
- if (hasTypeDefinitions) {
152
- return this.label(group.name ?? "Options") +
153
- Table.from([
154
- ...group.options.map((option) => [
155
- option.flags.map((flag) => brightBlue(flag)).join(", "),
156
- highlightArguments(option.typeDefinition || "", this.options.types),
157
- red(bold("-")),
158
- getDescription(option.description, !this.options.long),
159
- this.generateOptionHints(option),
160
- ]),
161
- ])
162
- .padding([2, 2, 1, 2])
163
- .indent(this.indent)
164
- .maxWidth(this.options.width - this.indent)
165
- .flexShrink([0, 0, 0, 1, 1])
166
- .toString() +
167
- "\n";
168
- }
169
- return this.label(group.name ?? "Options") +
170
- Table.from([
171
- ...group.options.map((option) => [
172
- option.flags.map((flag) => brightBlue(flag)).join(", "),
173
- red(bold("-")),
174
- getDescription(option.description, !this.options.long),
175
- this.generateOptionHints(option),
176
- ]),
177
- ])
178
- .indent(this.indent)
179
- .maxWidth(this.options.width - this.indent)
180
- .flexShrink([0, 0, 1, 1])
181
- .padding([2, 1, 2])
182
- .toString() +
183
- "\n";
184
- }
185
- generateCommands() {
186
- const commands = this.cmd.getCommands(false);
187
- if (!commands.length) {
188
- return "";
189
- }
190
- const hasTypeDefinitions = !!commands.find((command) => !!command.getArgsDefinition());
191
- if (hasTypeDefinitions) {
192
- return this.label("Commands") +
193
- Table.from([
194
- ...commands.map((command) => [
195
- [command.getName(), ...command.getAliases()].map((name) => brightBlue(name)).join(", "),
196
- highlightArguments(command.getArgsDefinition() || "", this.options.types),
197
- red(bold("-")),
198
- command.getShortDescription(),
199
- ]),
200
- ])
201
- .indent(this.indent)
202
- .maxWidth(this.options.width - this.indent)
203
- .flexShrink([0, 0, 0, 1])
204
- .padding([2, 2, 1, 2])
205
- .toString() +
206
- "\n";
207
- }
208
- return this.label("Commands") +
209
- Table.from([
210
- ...commands.map((command) => [
211
- [command.getName(), ...command.getAliases()].map((name) => brightBlue(name))
212
- .join(", "),
213
- red(bold("-")),
214
- command.getShortDescription(),
215
- ]),
216
- ])
217
- .maxWidth(this.options.width - this.indent)
218
- .flexShrink([0, 0, 1])
219
- .padding([2, 1, 2])
220
- .indent(this.indent)
221
- .toString() +
222
- "\n";
223
- }
224
- generateEnvironmentVariables() {
225
- const envVars = this.cmd.getEnvVars(false);
226
- if (!envVars.length) {
227
- return "";
228
- }
229
- return this.label("Environment variables") +
230
- Table.from([
231
- ...envVars.map((envVar) => [
232
- envVar.names.map((name) => brightBlue(name)).join(", "),
233
- highlightArgumentDetails(envVar.details, this.options.types),
234
- red(bold("-")),
235
- this.options.long
236
- ? dedent(envVar.description)
237
- : envVar.description.trim().split("\n", 1)[0],
238
- envVar.required ? `(${yellow(`required`)})` : "",
239
- ]),
240
- ])
241
- .padding([2, 2, 1, 2])
242
- .indent(this.indent)
243
- .maxWidth(this.options.width - this.indent)
244
- .flexShrink([0, 0, 0, 1, 1])
245
- .toString() +
246
- "\n";
247
- }
248
- generateExamples() {
249
- const examples = this.cmd.getExamples();
250
- if (!examples.length) {
251
- return "";
252
- }
253
- return this.label("Examples") +
254
- Table.from(examples.map((example) => [
255
- dim(bold(example.name)),
256
- dedent(example.description),
257
- ]))
258
- .padding(1)
259
- .indent(this.indent)
260
- .maxWidth(this.options.width - this.indent)
261
- .flexShrink([0, 1])
262
- .toString() +
263
- "\n";
264
- }
265
- generateOptionHints(option) {
266
- if (!this.options.hints) {
267
- return "";
268
- }
269
- const hints = [];
270
- option.required && hints.push(yellow(`required`));
271
- const type = this.cmd.getType(option.args[0]?.type)?.handler;
272
- if (typeof option.default !== "undefined" ||
273
- typeof option.defaultText !== "undefined") {
274
- const defaultValue = typeof option.default === "function"
275
- ? option.default()
276
- : option.default;
277
- const defaultText = typeof option.defaultText === "function"
278
- ? option.defaultText(defaultValue)
279
- : (typeof option.defaultText !== "undefined"
280
- ? option.defaultText
281
- : ((type instanceof Type && type.defaultText)
282
- ? type.defaultText()
283
- : defaultValue));
284
- if (typeof defaultText !== "undefined") {
285
- hints.push(bold(`Default: `) + inspect(defaultText, this.options.colors));
286
- }
287
- }
288
- option.depends?.length && hints.push(yellow(bold(`Depends: `)) +
289
- italic(option.depends.map(getFlag).join(", ")));
290
- option.conflicts?.length && hints.push(red(bold(`Conflicts: `)) +
291
- italic(option.conflicts.map(getFlag).join(", ")));
292
- return this.generateHints(type, hints);
293
- }
294
- generateArgumentHints(option) {
295
- if (!this.options.hints) {
296
- return "";
297
- }
298
- const hints = [];
299
- !option.optional && hints.push(yellow(`required`));
300
- const type = this.cmd.getType(option.type)?.handler;
301
- return this.generateHints(type, hints);
302
- }
303
- generateHints(type, hints) {
304
- if (type instanceof Type) {
305
- const possibleValues = type.values?.(this.cmd, this.cmd.getParent());
306
- if (possibleValues?.length) {
307
- hints.push(bold(`Values: `) +
308
- possibleValues.map((value) => inspect(value, this.options.colors)).join(", "));
309
- }
310
- }
311
- if (hints.length) {
312
- return `(${hints.join(", ")})`;
313
- }
314
- return "";
315
- }
316
- label(label) {
317
- return "\n" + bold(`${label}:`) + "\n\n";
318
- }
319
- }
320
- /**
321
- * Colorize arguments string.
322
- * @param argsDefinition Arguments definition: `<color1:string> <color2:string>`
323
- * @param types Show types.
324
- */
325
- function highlightArguments(argsDefinition, types = true) {
326
- if (!argsDefinition) {
327
- return "";
328
- }
329
- return parseArgumentsDefinition(argsDefinition, false, true)
330
- .map((arg) => typeof arg === "string" ? arg : highlightArgumentDetails(arg, types))
331
- .join(" ");
332
- }
333
- /**
334
- * Colorize argument string.
335
- * @param arg Argument details.
336
- * @param types Show types.
337
- */
338
- function highlightArgumentDetails(arg, types = true) {
339
- let str = "";
340
- str += yellow(arg.optional ? "[" : "<");
341
- let name = "";
342
- name += arg.name;
343
- if (arg.variadic) {
344
- name += "...";
345
- }
346
- name = brightMagenta(name);
347
- str += name;
348
- if (types) {
349
- str += yellow(":");
350
- str += red(arg.type);
351
- if (arg.list) {
352
- str += green("[]");
353
- }
354
- }
355
- str += yellow(arg.optional ? "]" : ">");
356
- return str;
357
- }
@@ -1,13 +0,0 @@
1
- export { Command } from "./command.js";
2
- export { ActionListType } from "./types/action_list.js";
3
- export { BooleanType } from "./types/boolean.js";
4
- export { ChildCommandType } from "./types/child_command.js";
5
- export { CommandType } from "./types/command.js";
6
- export { EnumType } from "./types/enum.js";
7
- export { FileType } from "./types/file.js";
8
- export { IntegerType } from "./types/integer.js";
9
- export { NumberType } from "./types/number.js";
10
- export { SecretType } from "./types/secret.js";
11
- export { StringType } from "./types/string.js";
12
- export { Type } from "./type.js";
13
- export { ValidationError } from "./_errors.js";
@@ -1,27 +0,0 @@
1
- /**
2
- * Base class for custom types.
3
- *
4
- * **Custom type example:**
5
- *
6
- * ```ts
7
- * import { Type, ArgumentValue } from "./mod.ts";
8
- *
9
- * export class ColorType extends Type<string> {
10
- * public parse({ label, name, value, type }: ArgumentValue): string {
11
- * if (["red", "blue"].includes(value)) {
12
- * throw new Error(
13
- * `${label} "${name}" must be of type "${type}", but got "${value}".` +
14
- * "Valid colors are: red, blue"
15
- * );
16
- * }
17
- * return value;
18
- * }
19
- *
20
- * public override complete(): string[] {
21
- * return ["red", "blue"];
22
- * }
23
- * }
24
- * ```
25
- */
26
- export class Type {
27
- }
@@ -1,16 +0,0 @@
1
- import { StringType } from "./string.js";
2
- /** Completion list type. */
3
- export class ActionListType extends StringType {
4
- cmd;
5
- constructor(cmd) {
6
- super();
7
- this.cmd = cmd;
8
- }
9
- /** Complete action names. */
10
- complete() {
11
- return this.cmd.getCompletions()
12
- .map((type) => type.name)
13
- // filter unique values
14
- .filter((value, index, self) => self.indexOf(value) === index);
15
- }
16
- }
@@ -1,13 +0,0 @@
1
- import { boolean } from "../../../flags/1.1.0/mod.js";
2
- import { Type } from "../type.js";
3
- /** Boolean type with auto completion. Allows `true`, `false`, `0` and `1`. */
4
- export class BooleanType extends Type {
5
- /** Parse boolean type. */
6
- parse(type) {
7
- return boolean(type);
8
- }
9
- /** Complete boolean type. */
10
- complete() {
11
- return ["true", "false"];
12
- }
13
- }
@@ -1,14 +0,0 @@
1
- import { StringType } from "./string.js";
2
- /** String type with auto completion of child command names. */
3
- export class ChildCommandType extends StringType {
4
- #cmd;
5
- constructor(cmd) {
6
- super();
7
- this.#cmd = cmd;
8
- }
9
- /** Complete child command names. */
10
- complete(cmd) {
11
- return (this.#cmd ?? cmd)?.getCommands(false)
12
- .map((cmd) => cmd.getName()) || [];
13
- }
14
- }
@@ -1,9 +0,0 @@
1
- import { StringType } from "./string.js";
2
- /** String type with auto completion of sibling command names. */
3
- export class CommandType extends StringType {
4
- /** Complete sub-command names of global parent command. */
5
- complete(_cmd, parent) {
6
- return parent?.getCommands(false)
7
- .map((cmd) => cmd.getName()) || [];
8
- }
9
- }
@@ -1,24 +0,0 @@
1
- import { Type } from "../type.js";
2
- import { InvalidTypeError } from "../../../flags/1.1.0/mod.js";
3
- /** Enum type. Allows only provided values. */
4
- export class EnumType extends Type {
5
- allowedValues;
6
- constructor(values) {
7
- super();
8
- this.allowedValues = Array.isArray(values) ? values : Object.values(values);
9
- }
10
- parse(type) {
11
- for (const value of this.allowedValues) {
12
- if (value.toString() === type.value) {
13
- return value;
14
- }
15
- }
16
- throw new InvalidTypeError(type, this.allowedValues.slice());
17
- }
18
- values() {
19
- return this.allowedValues.slice();
20
- }
21
- complete() {
22
- return this.values();
23
- }
24
- }
@@ -1,12 +0,0 @@
1
- import { StringType } from "./string.js";
2
- // export interface FileTypeOptions {
3
- // dirsOnly?: boolean;
4
- // pattern?: string;
5
- // ignore?: Array<string>;
6
- // }
7
- /** Integer type. */
8
- export class FileType extends StringType {
9
- constructor() {
10
- super();
11
- }
12
- }
@@ -1,9 +0,0 @@
1
- import { Type } from "../type.js";
2
- import { integer } from "../../../flags/1.1.0/mod.js";
3
- /** Integer type. */
4
- export class IntegerType extends Type {
5
- /** Parse integer type. */
6
- parse(type) {
7
- return integer(type);
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- import { number } from "../../../flags/1.1.0/mod.js";
2
- import { Type } from "../type.js";
3
- /** Number type. */
4
- export class NumberType extends Type {
5
- /** Parse number type. */
6
- parse(type) {
7
- return number(type);
8
- }
9
- }
@@ -1,7 +0,0 @@
1
- import { StringType } from "./string.js";
2
- /** Secret type. Allows any value, and does not show values in help text. */
3
- export class SecretType extends StringType {
4
- defaultText() {
5
- return "******";
6
- }
7
- }
@@ -1,9 +0,0 @@
1
- import { string } from "../../../flags/1.1.0/mod.js";
2
- import { Type } from "../type.js";
3
- /** String type. Allows any value. */
4
- export class StringType extends Type {
5
- /** Complete string type. */
6
- parse(type) {
7
- return string(type);
8
- }
9
- }
@@ -1,2 +0,0 @@
1
- // deno-lint-ignore-file no-explicit-any
2
- export {};
@@ -1,26 +0,0 @@
1
- import { bold, yellow } from "../../../../@std/fmt/1.0.10/colors.js";
2
- import { Command } from "../command.js";
3
- /** Check if new version is available and add hint to version. */
4
- // deno-lint-ignore no-explicit-any
5
- export async function checkVersion(cmd) {
6
- const mainCommand = cmd.getMainCommand();
7
- const upgradeCommand = mainCommand.getCommand("upgrade");
8
- if (!isUpgradeCommand(upgradeCommand)) {
9
- return;
10
- }
11
- if (!await upgradeCommand.hasRequiredPermissions()) {
12
- // If not all required permissions were pre-granted, skip the version check to prevent prompting user
13
- return;
14
- }
15
- const latestVersion = await upgradeCommand.getLatestVersion();
16
- const currentVersion = mainCommand.getVersion();
17
- if (!currentVersion || currentVersion === latestVersion) {
18
- return;
19
- }
20
- const versionHelpText = `(New version available: ${latestVersion}. Run '${mainCommand.getName()} upgrade' to upgrade to the latest version!)`;
21
- mainCommand.version(`${currentVersion} ${bold(yellow(versionHelpText))}`);
22
- }
23
- function isUpgradeCommand(command) {
24
- return command instanceof Command && "getLatestVersion" in command &&
25
- "hasRequiredPermissions" in command;
26
- }