gitx.do 0.1.1 → 0.1.2

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 (356) hide show
  1. package/README.md +40 -353
  2. package/dist/do/logger.d.ts +50 -0
  3. package/dist/do/logger.d.ts.map +1 -0
  4. package/dist/do/logger.js +122 -0
  5. package/dist/do/logger.js.map +1 -0
  6. package/dist/{durable-object → do}/schema.d.ts +3 -3
  7. package/dist/do/schema.d.ts.map +1 -0
  8. package/dist/{durable-object → do}/schema.js +4 -3
  9. package/dist/do/schema.js.map +1 -0
  10. package/dist/do/types.d.ts +267 -0
  11. package/dist/do/types.d.ts.map +1 -0
  12. package/dist/do/types.js +62 -0
  13. package/dist/do/types.js.map +1 -0
  14. package/dist/index.d.ts +14 -469
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +31 -483
  17. package/dist/index.js.map +1 -1
  18. package/package.json +13 -21
  19. package/dist/cli/commands/add.d.ts +0 -176
  20. package/dist/cli/commands/add.d.ts.map +0 -1
  21. package/dist/cli/commands/add.js +0 -979
  22. package/dist/cli/commands/add.js.map +0 -1
  23. package/dist/cli/commands/blame.d.ts +0 -259
  24. package/dist/cli/commands/blame.d.ts.map +0 -1
  25. package/dist/cli/commands/blame.js +0 -609
  26. package/dist/cli/commands/blame.js.map +0 -1
  27. package/dist/cli/commands/branch.d.ts +0 -249
  28. package/dist/cli/commands/branch.d.ts.map +0 -1
  29. package/dist/cli/commands/branch.js +0 -693
  30. package/dist/cli/commands/branch.js.map +0 -1
  31. package/dist/cli/commands/checkout.d.ts +0 -73
  32. package/dist/cli/commands/checkout.d.ts.map +0 -1
  33. package/dist/cli/commands/checkout.js +0 -725
  34. package/dist/cli/commands/checkout.js.map +0 -1
  35. package/dist/cli/commands/commit.d.ts +0 -182
  36. package/dist/cli/commands/commit.d.ts.map +0 -1
  37. package/dist/cli/commands/commit.js +0 -457
  38. package/dist/cli/commands/commit.js.map +0 -1
  39. package/dist/cli/commands/diff.d.ts +0 -464
  40. package/dist/cli/commands/diff.d.ts.map +0 -1
  41. package/dist/cli/commands/diff.js +0 -959
  42. package/dist/cli/commands/diff.js.map +0 -1
  43. package/dist/cli/commands/log.d.ts +0 -239
  44. package/dist/cli/commands/log.d.ts.map +0 -1
  45. package/dist/cli/commands/log.js +0 -535
  46. package/dist/cli/commands/log.js.map +0 -1
  47. package/dist/cli/commands/merge.d.ts +0 -106
  48. package/dist/cli/commands/merge.d.ts.map +0 -1
  49. package/dist/cli/commands/merge.js +0 -852
  50. package/dist/cli/commands/merge.js.map +0 -1
  51. package/dist/cli/commands/review.d.ts +0 -457
  52. package/dist/cli/commands/review.d.ts.map +0 -1
  53. package/dist/cli/commands/review.js +0 -558
  54. package/dist/cli/commands/review.js.map +0 -1
  55. package/dist/cli/commands/stash.d.ts +0 -157
  56. package/dist/cli/commands/stash.d.ts.map +0 -1
  57. package/dist/cli/commands/stash.js +0 -655
  58. package/dist/cli/commands/stash.js.map +0 -1
  59. package/dist/cli/commands/status.d.ts +0 -269
  60. package/dist/cli/commands/status.d.ts.map +0 -1
  61. package/dist/cli/commands/status.js +0 -492
  62. package/dist/cli/commands/status.js.map +0 -1
  63. package/dist/cli/commands/web.d.ts +0 -199
  64. package/dist/cli/commands/web.d.ts.map +0 -1
  65. package/dist/cli/commands/web.js +0 -697
  66. package/dist/cli/commands/web.js.map +0 -1
  67. package/dist/cli/fs-adapter.d.ts +0 -656
  68. package/dist/cli/fs-adapter.d.ts.map +0 -1
  69. package/dist/cli/fs-adapter.js +0 -1177
  70. package/dist/cli/fs-adapter.js.map +0 -1
  71. package/dist/cli/fsx-cli-adapter.d.ts +0 -359
  72. package/dist/cli/fsx-cli-adapter.d.ts.map +0 -1
  73. package/dist/cli/fsx-cli-adapter.js +0 -619
  74. package/dist/cli/fsx-cli-adapter.js.map +0 -1
  75. package/dist/cli/index.d.ts +0 -387
  76. package/dist/cli/index.d.ts.map +0 -1
  77. package/dist/cli/index.js +0 -579
  78. package/dist/cli/index.js.map +0 -1
  79. package/dist/cli/ui/components/DiffView.d.ts +0 -12
  80. package/dist/cli/ui/components/DiffView.d.ts.map +0 -1
  81. package/dist/cli/ui/components/DiffView.js +0 -11
  82. package/dist/cli/ui/components/DiffView.js.map +0 -1
  83. package/dist/cli/ui/components/ErrorDisplay.d.ts +0 -10
  84. package/dist/cli/ui/components/ErrorDisplay.d.ts.map +0 -1
  85. package/dist/cli/ui/components/ErrorDisplay.js +0 -11
  86. package/dist/cli/ui/components/ErrorDisplay.js.map +0 -1
  87. package/dist/cli/ui/components/FuzzySearch.d.ts +0 -15
  88. package/dist/cli/ui/components/FuzzySearch.d.ts.map +0 -1
  89. package/dist/cli/ui/components/FuzzySearch.js +0 -12
  90. package/dist/cli/ui/components/FuzzySearch.js.map +0 -1
  91. package/dist/cli/ui/components/LoadingSpinner.d.ts +0 -10
  92. package/dist/cli/ui/components/LoadingSpinner.d.ts.map +0 -1
  93. package/dist/cli/ui/components/LoadingSpinner.js +0 -10
  94. package/dist/cli/ui/components/LoadingSpinner.js.map +0 -1
  95. package/dist/cli/ui/components/NavigationList.d.ts +0 -14
  96. package/dist/cli/ui/components/NavigationList.d.ts.map +0 -1
  97. package/dist/cli/ui/components/NavigationList.js +0 -11
  98. package/dist/cli/ui/components/NavigationList.js.map +0 -1
  99. package/dist/cli/ui/components/ScrollableContent.d.ts +0 -13
  100. package/dist/cli/ui/components/ScrollableContent.d.ts.map +0 -1
  101. package/dist/cli/ui/components/ScrollableContent.js +0 -11
  102. package/dist/cli/ui/components/ScrollableContent.js.map +0 -1
  103. package/dist/cli/ui/components/index.d.ts +0 -7
  104. package/dist/cli/ui/components/index.d.ts.map +0 -1
  105. package/dist/cli/ui/components/index.js +0 -9
  106. package/dist/cli/ui/components/index.js.map +0 -1
  107. package/dist/cli/ui/terminal-ui.d.ts +0 -85
  108. package/dist/cli/ui/terminal-ui.d.ts.map +0 -1
  109. package/dist/cli/ui/terminal-ui.js +0 -121
  110. package/dist/cli/ui/terminal-ui.js.map +0 -1
  111. package/dist/do/BashModule.d.ts +0 -871
  112. package/dist/do/BashModule.d.ts.map +0 -1
  113. package/dist/do/BashModule.js +0 -1143
  114. package/dist/do/BashModule.js.map +0 -1
  115. package/dist/do/FsModule.d.ts +0 -612
  116. package/dist/do/FsModule.d.ts.map +0 -1
  117. package/dist/do/FsModule.js +0 -1120
  118. package/dist/do/FsModule.js.map +0 -1
  119. package/dist/do/GitModule.d.ts +0 -635
  120. package/dist/do/GitModule.d.ts.map +0 -1
  121. package/dist/do/GitModule.js +0 -784
  122. package/dist/do/GitModule.js.map +0 -1
  123. package/dist/do/GitRepoDO.d.ts +0 -281
  124. package/dist/do/GitRepoDO.d.ts.map +0 -1
  125. package/dist/do/GitRepoDO.js +0 -479
  126. package/dist/do/GitRepoDO.js.map +0 -1
  127. package/dist/do/bash-ast.d.ts +0 -246
  128. package/dist/do/bash-ast.d.ts.map +0 -1
  129. package/dist/do/bash-ast.js +0 -888
  130. package/dist/do/bash-ast.js.map +0 -1
  131. package/dist/do/container-executor.d.ts +0 -491
  132. package/dist/do/container-executor.d.ts.map +0 -1
  133. package/dist/do/container-executor.js +0 -731
  134. package/dist/do/container-executor.js.map +0 -1
  135. package/dist/do/index.d.ts +0 -53
  136. package/dist/do/index.d.ts.map +0 -1
  137. package/dist/do/index.js +0 -91
  138. package/dist/do/index.js.map +0 -1
  139. package/dist/do/tiered-storage.d.ts +0 -403
  140. package/dist/do/tiered-storage.d.ts.map +0 -1
  141. package/dist/do/tiered-storage.js +0 -689
  142. package/dist/do/tiered-storage.js.map +0 -1
  143. package/dist/do/withBash.d.ts +0 -231
  144. package/dist/do/withBash.d.ts.map +0 -1
  145. package/dist/do/withBash.js +0 -244
  146. package/dist/do/withBash.js.map +0 -1
  147. package/dist/do/withFs.d.ts +0 -237
  148. package/dist/do/withFs.d.ts.map +0 -1
  149. package/dist/do/withFs.js +0 -387
  150. package/dist/do/withFs.js.map +0 -1
  151. package/dist/do/withGit.d.ts +0 -180
  152. package/dist/do/withGit.d.ts.map +0 -1
  153. package/dist/do/withGit.js +0 -271
  154. package/dist/do/withGit.js.map +0 -1
  155. package/dist/durable-object/object-store.d.ts +0 -633
  156. package/dist/durable-object/object-store.d.ts.map +0 -1
  157. package/dist/durable-object/object-store.js +0 -1164
  158. package/dist/durable-object/object-store.js.map +0 -1
  159. package/dist/durable-object/schema.d.ts.map +0 -1
  160. package/dist/durable-object/schema.js.map +0 -1
  161. package/dist/durable-object/wal.d.ts +0 -416
  162. package/dist/durable-object/wal.d.ts.map +0 -1
  163. package/dist/durable-object/wal.js +0 -445
  164. package/dist/durable-object/wal.js.map +0 -1
  165. package/dist/mcp/adapter.d.ts +0 -772
  166. package/dist/mcp/adapter.d.ts.map +0 -1
  167. package/dist/mcp/adapter.js +0 -895
  168. package/dist/mcp/adapter.js.map +0 -1
  169. package/dist/mcp/sandbox/miniflare-evaluator.d.ts +0 -22
  170. package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +0 -1
  171. package/dist/mcp/sandbox/miniflare-evaluator.js +0 -140
  172. package/dist/mcp/sandbox/miniflare-evaluator.js.map +0 -1
  173. package/dist/mcp/sandbox/object-store-proxy.d.ts +0 -32
  174. package/dist/mcp/sandbox/object-store-proxy.d.ts.map +0 -1
  175. package/dist/mcp/sandbox/object-store-proxy.js +0 -30
  176. package/dist/mcp/sandbox/object-store-proxy.js.map +0 -1
  177. package/dist/mcp/sandbox/template.d.ts +0 -17
  178. package/dist/mcp/sandbox/template.d.ts.map +0 -1
  179. package/dist/mcp/sandbox/template.js +0 -71
  180. package/dist/mcp/sandbox/template.js.map +0 -1
  181. package/dist/mcp/sandbox.d.ts +0 -764
  182. package/dist/mcp/sandbox.d.ts.map +0 -1
  183. package/dist/mcp/sandbox.js +0 -1362
  184. package/dist/mcp/sandbox.js.map +0 -1
  185. package/dist/mcp/sdk-adapter.d.ts +0 -835
  186. package/dist/mcp/sdk-adapter.d.ts.map +0 -1
  187. package/dist/mcp/sdk-adapter.js +0 -974
  188. package/dist/mcp/sdk-adapter.js.map +0 -1
  189. package/dist/mcp/tools/do.d.ts +0 -32
  190. package/dist/mcp/tools/do.d.ts.map +0 -1
  191. package/dist/mcp/tools/do.js +0 -117
  192. package/dist/mcp/tools/do.js.map +0 -1
  193. package/dist/mcp/tools.d.ts +0 -548
  194. package/dist/mcp/tools.d.ts.map +0 -1
  195. package/dist/mcp/tools.js +0 -3170
  196. package/dist/mcp/tools.js.map +0 -1
  197. package/dist/ops/blame.d.ts +0 -551
  198. package/dist/ops/blame.d.ts.map +0 -1
  199. package/dist/ops/blame.js +0 -1037
  200. package/dist/ops/blame.js.map +0 -1
  201. package/dist/ops/branch.d.ts +0 -766
  202. package/dist/ops/branch.d.ts.map +0 -1
  203. package/dist/ops/branch.js +0 -950
  204. package/dist/ops/branch.js.map +0 -1
  205. package/dist/ops/commit-traversal.d.ts +0 -349
  206. package/dist/ops/commit-traversal.d.ts.map +0 -1
  207. package/dist/ops/commit-traversal.js +0 -821
  208. package/dist/ops/commit-traversal.js.map +0 -1
  209. package/dist/ops/commit.d.ts +0 -555
  210. package/dist/ops/commit.d.ts.map +0 -1
  211. package/dist/ops/commit.js +0 -826
  212. package/dist/ops/commit.js.map +0 -1
  213. package/dist/ops/merge-base.d.ts +0 -397
  214. package/dist/ops/merge-base.d.ts.map +0 -1
  215. package/dist/ops/merge-base.js +0 -691
  216. package/dist/ops/merge-base.js.map +0 -1
  217. package/dist/ops/merge.d.ts +0 -855
  218. package/dist/ops/merge.d.ts.map +0 -1
  219. package/dist/ops/merge.js +0 -1551
  220. package/dist/ops/merge.js.map +0 -1
  221. package/dist/ops/tag.d.ts +0 -247
  222. package/dist/ops/tag.d.ts.map +0 -1
  223. package/dist/ops/tag.js +0 -649
  224. package/dist/ops/tag.js.map +0 -1
  225. package/dist/ops/tree-builder.d.ts +0 -178
  226. package/dist/ops/tree-builder.d.ts.map +0 -1
  227. package/dist/ops/tree-builder.js +0 -271
  228. package/dist/ops/tree-builder.js.map +0 -1
  229. package/dist/ops/tree-diff.d.ts +0 -291
  230. package/dist/ops/tree-diff.d.ts.map +0 -1
  231. package/dist/ops/tree-diff.js +0 -705
  232. package/dist/ops/tree-diff.js.map +0 -1
  233. package/dist/pack/delta.d.ts +0 -248
  234. package/dist/pack/delta.d.ts.map +0 -1
  235. package/dist/pack/delta.js +0 -740
  236. package/dist/pack/delta.js.map +0 -1
  237. package/dist/pack/format.d.ts +0 -446
  238. package/dist/pack/format.d.ts.map +0 -1
  239. package/dist/pack/format.js +0 -572
  240. package/dist/pack/format.js.map +0 -1
  241. package/dist/pack/full-generation.d.ts +0 -612
  242. package/dist/pack/full-generation.d.ts.map +0 -1
  243. package/dist/pack/full-generation.js +0 -1378
  244. package/dist/pack/full-generation.js.map +0 -1
  245. package/dist/pack/generation.d.ts +0 -441
  246. package/dist/pack/generation.d.ts.map +0 -1
  247. package/dist/pack/generation.js +0 -707
  248. package/dist/pack/generation.js.map +0 -1
  249. package/dist/pack/index.d.ts +0 -502
  250. package/dist/pack/index.d.ts.map +0 -1
  251. package/dist/pack/index.js +0 -833
  252. package/dist/pack/index.js.map +0 -1
  253. package/dist/refs/branch.d.ts +0 -683
  254. package/dist/refs/branch.d.ts.map +0 -1
  255. package/dist/refs/branch.js +0 -881
  256. package/dist/refs/branch.js.map +0 -1
  257. package/dist/refs/storage.d.ts +0 -833
  258. package/dist/refs/storage.d.ts.map +0 -1
  259. package/dist/refs/storage.js +0 -1023
  260. package/dist/refs/storage.js.map +0 -1
  261. package/dist/refs/tag.d.ts +0 -860
  262. package/dist/refs/tag.d.ts.map +0 -1
  263. package/dist/refs/tag.js +0 -996
  264. package/dist/refs/tag.js.map +0 -1
  265. package/dist/storage/backend.d.ts +0 -425
  266. package/dist/storage/backend.d.ts.map +0 -1
  267. package/dist/storage/backend.js +0 -41
  268. package/dist/storage/backend.js.map +0 -1
  269. package/dist/storage/fsx-adapter.d.ts +0 -204
  270. package/dist/storage/fsx-adapter.d.ts.map +0 -1
  271. package/dist/storage/fsx-adapter.js +0 -518
  272. package/dist/storage/fsx-adapter.js.map +0 -1
  273. package/dist/storage/lru-cache.d.ts +0 -691
  274. package/dist/storage/lru-cache.d.ts.map +0 -1
  275. package/dist/storage/lru-cache.js +0 -813
  276. package/dist/storage/lru-cache.js.map +0 -1
  277. package/dist/storage/object-index.d.ts +0 -585
  278. package/dist/storage/object-index.d.ts.map +0 -1
  279. package/dist/storage/object-index.js +0 -532
  280. package/dist/storage/object-index.js.map +0 -1
  281. package/dist/storage/r2-pack.d.ts +0 -1257
  282. package/dist/storage/r2-pack.d.ts.map +0 -1
  283. package/dist/storage/r2-pack.js +0 -1773
  284. package/dist/storage/r2-pack.js.map +0 -1
  285. package/dist/tiered/cdc-pipeline.d.ts +0 -1888
  286. package/dist/tiered/cdc-pipeline.d.ts.map +0 -1
  287. package/dist/tiered/cdc-pipeline.js +0 -1880
  288. package/dist/tiered/cdc-pipeline.js.map +0 -1
  289. package/dist/tiered/migration.d.ts +0 -1104
  290. package/dist/tiered/migration.d.ts.map +0 -1
  291. package/dist/tiered/migration.js +0 -1217
  292. package/dist/tiered/migration.js.map +0 -1
  293. package/dist/tiered/parquet-writer.d.ts +0 -1145
  294. package/dist/tiered/parquet-writer.d.ts.map +0 -1
  295. package/dist/tiered/parquet-writer.js +0 -1183
  296. package/dist/tiered/parquet-writer.js.map +0 -1
  297. package/dist/tiered/read-path.d.ts +0 -835
  298. package/dist/tiered/read-path.d.ts.map +0 -1
  299. package/dist/tiered/read-path.js +0 -487
  300. package/dist/tiered/read-path.js.map +0 -1
  301. package/dist/types/capability.d.ts +0 -1385
  302. package/dist/types/capability.d.ts.map +0 -1
  303. package/dist/types/capability.js +0 -36
  304. package/dist/types/capability.js.map +0 -1
  305. package/dist/types/index.d.ts +0 -13
  306. package/dist/types/index.d.ts.map +0 -1
  307. package/dist/types/index.js +0 -18
  308. package/dist/types/index.js.map +0 -1
  309. package/dist/types/interfaces.d.ts +0 -673
  310. package/dist/types/interfaces.d.ts.map +0 -1
  311. package/dist/types/interfaces.js +0 -26
  312. package/dist/types/interfaces.js.map +0 -1
  313. package/dist/types/objects.d.ts +0 -692
  314. package/dist/types/objects.d.ts.map +0 -1
  315. package/dist/types/objects.js +0 -837
  316. package/dist/types/objects.js.map +0 -1
  317. package/dist/types/storage.d.ts +0 -603
  318. package/dist/types/storage.d.ts.map +0 -1
  319. package/dist/types/storage.js +0 -191
  320. package/dist/types/storage.js.map +0 -1
  321. package/dist/types/worker-loader.d.ts +0 -60
  322. package/dist/types/worker-loader.d.ts.map +0 -1
  323. package/dist/types/worker-loader.js +0 -62
  324. package/dist/types/worker-loader.js.map +0 -1
  325. package/dist/utils/hash.d.ts +0 -198
  326. package/dist/utils/hash.d.ts.map +0 -1
  327. package/dist/utils/hash.js +0 -272
  328. package/dist/utils/hash.js.map +0 -1
  329. package/dist/utils/sha1.d.ts +0 -325
  330. package/dist/utils/sha1.d.ts.map +0 -1
  331. package/dist/utils/sha1.js +0 -635
  332. package/dist/utils/sha1.js.map +0 -1
  333. package/dist/wire/capabilities.d.ts +0 -1044
  334. package/dist/wire/capabilities.d.ts.map +0 -1
  335. package/dist/wire/capabilities.js +0 -941
  336. package/dist/wire/capabilities.js.map +0 -1
  337. package/dist/wire/path-security.d.ts +0 -157
  338. package/dist/wire/path-security.d.ts.map +0 -1
  339. package/dist/wire/path-security.js +0 -307
  340. package/dist/wire/path-security.js.map +0 -1
  341. package/dist/wire/pkt-line.d.ts +0 -345
  342. package/dist/wire/pkt-line.d.ts.map +0 -1
  343. package/dist/wire/pkt-line.js +0 -381
  344. package/dist/wire/pkt-line.js.map +0 -1
  345. package/dist/wire/receive-pack.d.ts +0 -1059
  346. package/dist/wire/receive-pack.d.ts.map +0 -1
  347. package/dist/wire/receive-pack.js +0 -1414
  348. package/dist/wire/receive-pack.js.map +0 -1
  349. package/dist/wire/smart-http.d.ts +0 -799
  350. package/dist/wire/smart-http.d.ts.map +0 -1
  351. package/dist/wire/smart-http.js +0 -945
  352. package/dist/wire/smart-http.js.map +0 -1
  353. package/dist/wire/upload-pack.d.ts +0 -727
  354. package/dist/wire/upload-pack.d.ts.map +0 -1
  355. package/dist/wire/upload-pack.js +0 -1141
  356. package/dist/wire/upload-pack.js.map +0 -1
@@ -1,518 +0,0 @@
1
- /**
2
- * @fileoverview FSx Storage Adapter for gitx
3
- *
4
- * This module provides a storage backend implementation that uses fsx.do for
5
- * both content-addressable storage (CAS) and file system operations. It bridges
6
- * gitx's StorageBackend interface with fsx's CAS and fs operations.
7
- *
8
- * **Features**:
9
- * - Content-addressable storage using fsx CAS (putObject, getObject, hasObject)
10
- * - Reference storage using fsx file operations
11
- * - Full file system operations for index, config, and other Git files
12
- *
13
- * @module storage/fsx-adapter
14
- *
15
- * @example
16
- * ```typescript
17
- * import { createFSxAdapter } from './storage/fsx-adapter'
18
- *
19
- * const storage = createFSxAdapter('/repos/my-repo/.git')
20
- *
21
- * // Store a blob
22
- * const sha = await storage.putObject('blob', content)
23
- *
24
- * // Work with refs
25
- * await storage.setRef('refs/heads/main', {
26
- * name: 'refs/heads/main',
27
- * target: sha,
28
- * type: 'direct'
29
- * })
30
- * ```
31
- */
32
- import { parseRefContent, serializeRefContent } from '../refs/storage';
33
- // Import hash utilities from local utils module
34
- // Note: sha1 is re-exported from fsx.do and works in Workers environment
35
- import { sha1 } from '../utils/hash';
36
- // Import pako for compression (still needed as fsx.do CAS handles this internally)
37
- import * as pako from 'pako';
38
- // ============================================================================
39
- // Git Object Utilities
40
- // ============================================================================
41
- /**
42
- * Create a Git object with header
43
- */
44
- function createGitObject(type, content) {
45
- const header = `${type} ${content.length}\0`;
46
- const headerBytes = new TextEncoder().encode(header);
47
- const result = new Uint8Array(headerBytes.length + content.length);
48
- result.set(headerBytes, 0);
49
- result.set(content, headerBytes.length);
50
- return result;
51
- }
52
- /**
53
- * Parse a Git object to extract type and content
54
- */
55
- function parseGitObject(data) {
56
- // Find null byte separator
57
- let nullIndex = -1;
58
- for (let i = 0; i < data.length; i++) {
59
- if (data[i] === 0) {
60
- nullIndex = i;
61
- break;
62
- }
63
- }
64
- if (nullIndex === -1) {
65
- throw new Error('Invalid git object: no null byte found');
66
- }
67
- const headerStr = new TextDecoder().decode(data.subarray(0, nullIndex));
68
- const [type] = headerStr.split(' ');
69
- const content = data.subarray(nullIndex + 1);
70
- return { type, content };
71
- }
72
- /**
73
- * Compress data with zlib
74
- */
75
- async function compress(data) {
76
- return pako.deflate(data);
77
- }
78
- /**
79
- * Decompress zlib data
80
- */
81
- async function decompress(data) {
82
- return pako.inflate(data);
83
- }
84
- // ============================================================================
85
- // In-Memory Storage for Development/Testing
86
- // ============================================================================
87
- /**
88
- * Simple in-memory storage for development and testing
89
- * In production, this would be backed by fsx's R2 or SQLite storage
90
- */
91
- class InMemoryStorage {
92
- files = new Map();
93
- directories = new Set();
94
- constructor() {
95
- // Initialize root directory
96
- this.directories.add('/');
97
- }
98
- async read(path) {
99
- return this.files.get(path) ?? null;
100
- }
101
- async write(path, data) {
102
- this.files.set(path, data);
103
- // Ensure parent directories exist
104
- const parts = path.split('/');
105
- let current = '';
106
- for (let i = 0; i < parts.length - 1; i++) {
107
- current += (i === 0 ? '' : '/') + parts[i];
108
- if (current) {
109
- this.directories.add(current);
110
- }
111
- }
112
- }
113
- async delete(path) {
114
- this.files.delete(path);
115
- }
116
- async exists(path) {
117
- return this.files.has(path) || this.directories.has(path);
118
- }
119
- async readdir(path) {
120
- const normalizedPath = path.endsWith('/') ? path.slice(0, -1) : path;
121
- const entries = new Set();
122
- // Check files
123
- const fileKeys = Array.from(this.files.keys());
124
- for (const filePath of fileKeys) {
125
- if (filePath.startsWith(normalizedPath + '/')) {
126
- const rest = filePath.slice(normalizedPath.length + 1);
127
- const firstPart = rest.split('/')[0];
128
- if (firstPart) {
129
- entries.add(firstPart);
130
- }
131
- }
132
- }
133
- // Check directories
134
- const dirEntries = Array.from(this.directories);
135
- for (const dirPath of dirEntries) {
136
- if (dirPath.startsWith(normalizedPath + '/')) {
137
- const rest = dirPath.slice(normalizedPath.length + 1);
138
- const firstPart = rest.split('/')[0];
139
- if (firstPart) {
140
- entries.add(firstPart);
141
- }
142
- }
143
- }
144
- return Array.from(entries).sort();
145
- }
146
- async mkdir(path, options) {
147
- if (options?.recursive) {
148
- const parts = path.split('/').filter(Boolean);
149
- let current = '';
150
- for (const part of parts) {
151
- current += '/' + part;
152
- this.directories.add(current);
153
- }
154
- }
155
- else {
156
- this.directories.add(path);
157
- }
158
- }
159
- }
160
- // ============================================================================
161
- // FSxStorageAdapter Implementation
162
- // ============================================================================
163
- const encoder = new TextEncoder();
164
- const decoder = new TextDecoder();
165
- /**
166
- * FSx storage adapter implementing the StorageBackend interface.
167
- *
168
- * @description
169
- * This adapter uses fsx for all storage operations:
170
- * - CAS operations use fsx's git-compatible object storage
171
- * - Refs are stored as files at {rootPath}/refs/{refname}
172
- * - File operations are relative to the rootPath
173
- */
174
- export class FSxStorageAdapter {
175
- rootPath;
176
- storage;
177
- /**
178
- * Create a new FSxStorageAdapter
179
- *
180
- * @param rootPath - The root path for the Git repository (typically .git directory)
181
- */
182
- constructor(rootPath) {
183
- // Normalize root path - remove trailing slash
184
- this.rootPath = rootPath.endsWith('/') ? rootPath.slice(0, -1) : rootPath;
185
- // Use in-memory storage for now - in production this would be injected
186
- this.storage = new InMemoryStorage();
187
- }
188
- // ==========================================================================
189
- // Helper Methods
190
- // ==========================================================================
191
- /**
192
- * Resolve a relative path to an absolute path within the repository
193
- *
194
- * @param p - Relative path within the repository
195
- * @returns Absolute path
196
- */
197
- resolvePath(p) {
198
- // Handle empty path
199
- if (!p) {
200
- return this.rootPath;
201
- }
202
- // Handle absolute paths - just return as-is if already under rootPath
203
- if (p.startsWith('/')) {
204
- if (p.startsWith(this.rootPath)) {
205
- return p;
206
- }
207
- // Join with rootPath
208
- return this.rootPath + p;
209
- }
210
- // Relative path - join with rootPath
211
- return this.rootPath + '/' + p;
212
- }
213
- /**
214
- * Get the path for an object based on its SHA
215
- *
216
- * @param sha - 40-character SHA-1 hash
217
- * @returns Path in format: objects/xx/yyyy...
218
- */
219
- getObjectPath(sha) {
220
- const normalizedSha = sha.toLowerCase();
221
- const dir = normalizedSha.slice(0, 2);
222
- const filename = normalizedSha.slice(2);
223
- return this.resolvePath(`objects/${dir}/${filename}`);
224
- }
225
- /**
226
- * Get the path for a ref
227
- *
228
- * @param name - Ref name (e.g., 'refs/heads/main', 'HEAD')
229
- * @returns Absolute path to the ref file
230
- */
231
- getRefPath(name) {
232
- return this.resolvePath(name);
233
- }
234
- // ==========================================================================
235
- // Content-Addressable Storage (CAS) Operations
236
- // ==========================================================================
237
- /**
238
- * Store a Git object and return its SHA-1 hash.
239
- *
240
- * @description
241
- * Creates a Git object in the format: "{type} {size}\0{content}",
242
- * computes its SHA-1 hash, compresses it with zlib, and stores it.
243
- *
244
- * @param type - Object type: 'blob', 'tree', 'commit', or 'tag'
245
- * @param content - Raw object content (without Git header)
246
- * @returns 40-character lowercase hexadecimal SHA-1 hash
247
- */
248
- async putObject(type, content) {
249
- // Create the git object (header + content)
250
- const gitObject = createGitObject(type, content);
251
- // Compute SHA-1 hash of the uncompressed git object
252
- const hash = await sha1(gitObject);
253
- // Compress the git object with zlib
254
- const compressedData = await compress(gitObject);
255
- // Get the storage path from the hash
256
- const objectPath = this.getObjectPath(hash);
257
- // Ensure parent directory exists
258
- const dirPath = objectPath.substring(0, objectPath.lastIndexOf('/'));
259
- await this.storage.mkdir(dirPath, { recursive: true });
260
- // Write the compressed data to storage
261
- await this.storage.write(objectPath, compressedData);
262
- // Return the 40-character hex hash
263
- return hash;
264
- }
265
- /**
266
- * Retrieve a Git object by its SHA-1 hash.
267
- *
268
- * @param sha - 40-character SHA-1 hash (case-insensitive)
269
- * @returns Object with type and content, or null if not found
270
- */
271
- async getObject(sha) {
272
- // Normalize to lowercase
273
- const normalizedSha = sha.toLowerCase();
274
- // Get the storage path
275
- const objectPath = this.getObjectPath(normalizedSha);
276
- // Read compressed data from storage
277
- const compressedData = await this.storage.read(objectPath);
278
- if (!compressedData) {
279
- return null;
280
- }
281
- // Decompress the data
282
- const decompressed = await decompress(compressedData);
283
- // Parse git object format
284
- const { type, content } = parseGitObject(decompressed);
285
- return {
286
- type: type,
287
- content
288
- };
289
- }
290
- /**
291
- * Check if a Git object exists in storage.
292
- *
293
- * @param sha - 40-character SHA-1 hash (case-insensitive)
294
- * @returns True if the object exists, false otherwise
295
- */
296
- async hasObject(sha) {
297
- // Validate hash format
298
- if (!sha || (sha.length !== 40 && sha.length !== 64)) {
299
- return false;
300
- }
301
- if (!/^[0-9a-fA-F]+$/.test(sha)) {
302
- return false;
303
- }
304
- const normalizedSha = sha.toLowerCase();
305
- const objectPath = this.getObjectPath(normalizedSha);
306
- return this.storage.exists(objectPath);
307
- }
308
- /**
309
- * Delete a Git object from storage.
310
- *
311
- * @param sha - 40-character SHA-1 hash (case-insensitive)
312
- */
313
- async deleteObject(sha) {
314
- const normalizedSha = sha.toLowerCase();
315
- const objectPath = this.getObjectPath(normalizedSha);
316
- await this.storage.delete(objectPath);
317
- }
318
- // ==========================================================================
319
- // Reference Operations
320
- // ==========================================================================
321
- /**
322
- * Get a reference by name.
323
- *
324
- * @param name - Full ref name (e.g., 'HEAD', 'refs/heads/main')
325
- * @returns The reference or null if not found
326
- */
327
- async getRef(name) {
328
- const refPath = this.getRefPath(name);
329
- const data = await this.storage.read(refPath);
330
- if (!data) {
331
- return null;
332
- }
333
- const content = decoder.decode(data);
334
- const { type, target } = parseRefContent(content);
335
- return {
336
- name,
337
- target,
338
- type
339
- };
340
- }
341
- /**
342
- * Create or update a reference.
343
- *
344
- * @param name - Full ref name (e.g., 'HEAD', 'refs/heads/main')
345
- * @param ref - The reference object
346
- */
347
- async setRef(name, ref) {
348
- const refPath = this.getRefPath(name);
349
- // Ensure parent directory exists
350
- const dirPath = refPath.substring(0, refPath.lastIndexOf('/'));
351
- if (dirPath && dirPath !== this.rootPath) {
352
- await this.storage.mkdir(dirPath, { recursive: true });
353
- }
354
- const content = serializeRefContent(ref);
355
- await this.storage.write(refPath, encoder.encode(content));
356
- }
357
- /**
358
- * Delete a reference.
359
- *
360
- * @param name - Full ref name to delete
361
- */
362
- async deleteRef(name) {
363
- const refPath = this.getRefPath(name);
364
- await this.storage.delete(refPath);
365
- }
366
- /**
367
- * List references matching an optional prefix.
368
- *
369
- * @param prefix - Optional prefix to filter refs (e.g., 'refs/heads/')
370
- * @returns Array of matching references
371
- */
372
- async listRefs(prefix) {
373
- const refs = [];
374
- // Helper function to recursively read refs from a directory
375
- const readRefsFromDir = async (dirPath, refPrefix) => {
376
- const fullDirPath = this.resolvePath(dirPath);
377
- const exists = await this.storage.exists(fullDirPath);
378
- if (!exists) {
379
- return;
380
- }
381
- const entries = await this.storage.readdir(fullDirPath);
382
- for (const entry of entries) {
383
- const entryPath = `${dirPath}/${entry}`;
384
- const fullEntryPath = this.resolvePath(entryPath);
385
- const refName = `${refPrefix}${entry}`;
386
- // Try to read as a ref file
387
- const data = await this.storage.read(fullEntryPath);
388
- if (data) {
389
- // It's a file - parse as ref
390
- const content = decoder.decode(data);
391
- try {
392
- const { type, target } = parseRefContent(content);
393
- refs.push({ name: refName, target, type });
394
- }
395
- catch {
396
- // Not a valid ref file, skip
397
- }
398
- }
399
- else {
400
- // It might be a directory - recurse
401
- await readRefsFromDir(entryPath, refName + '/');
402
- }
403
- }
404
- };
405
- // Start from refs directory
406
- const refsDir = prefix ? prefix.replace(/\/$/, '') : 'refs';
407
- await readRefsFromDir(refsDir, prefix || 'refs/');
408
- // Also check HEAD if no prefix or if listing all
409
- if (!prefix) {
410
- const headRef = await this.getRef('HEAD');
411
- if (headRef) {
412
- refs.unshift(headRef);
413
- }
414
- }
415
- return refs;
416
- }
417
- // ==========================================================================
418
- // Raw File Operations
419
- // ==========================================================================
420
- /**
421
- * Read a raw file from the repository.
422
- *
423
- * @param path - Path relative to Git directory
424
- * @returns File contents as Uint8Array, or null if not found
425
- */
426
- async readFile(path) {
427
- const fullPath = this.resolvePath(path);
428
- return this.storage.read(fullPath);
429
- }
430
- /**
431
- * Write a raw file to the repository.
432
- *
433
- * @param path - Path relative to Git directory
434
- * @param content - File contents as Uint8Array
435
- */
436
- async writeFile(path, content) {
437
- const fullPath = this.resolvePath(path);
438
- // Ensure parent directory exists
439
- const dirPath = fullPath.substring(0, fullPath.lastIndexOf('/'));
440
- if (dirPath && dirPath !== this.rootPath) {
441
- await this.storage.mkdir(dirPath, { recursive: true });
442
- }
443
- await this.storage.write(fullPath, content);
444
- }
445
- /**
446
- * Delete a raw file from the repository.
447
- *
448
- * @param path - Path relative to Git directory
449
- */
450
- async deleteFile(path) {
451
- const fullPath = this.resolvePath(path);
452
- await this.storage.delete(fullPath);
453
- }
454
- /**
455
- * Check if a file or directory exists.
456
- *
457
- * @param path - Path relative to Git directory
458
- * @returns True if the path exists
459
- */
460
- async exists(path) {
461
- const fullPath = this.resolvePath(path);
462
- return this.storage.exists(fullPath);
463
- }
464
- // ==========================================================================
465
- // Directory Operations
466
- // ==========================================================================
467
- /**
468
- * List contents of a directory.
469
- *
470
- * @param path - Path relative to Git directory
471
- * @returns Array of file and directory names
472
- */
473
- async readdir(path) {
474
- const fullPath = this.resolvePath(path);
475
- try {
476
- return await this.storage.readdir(fullPath);
477
- }
478
- catch {
479
- // Return empty array if directory doesn't exist
480
- return [];
481
- }
482
- }
483
- /**
484
- * Create a directory.
485
- *
486
- * @param path - Path relative to Git directory
487
- * @param options - Options for directory creation
488
- */
489
- async mkdir(path, options) {
490
- const fullPath = this.resolvePath(path);
491
- await this.storage.mkdir(fullPath, options);
492
- }
493
- }
494
- // ============================================================================
495
- // Factory Function
496
- // ============================================================================
497
- /**
498
- * Create an FSx storage adapter.
499
- *
500
- * @description
501
- * Factory function for creating an FSxStorageAdapter instance.
502
- *
503
- * @param rootPath - The root path for the Git repository (typically .git directory)
504
- * @returns A StorageBackend instance backed by fsx
505
- *
506
- * @example
507
- * ```typescript
508
- * const storage = createFSxAdapter('/repos/my-project/.git')
509
- *
510
- * // Use the storage backend
511
- * const sha = await storage.putObject('blob', content)
512
- * const ref = await storage.getRef('HEAD')
513
- * ```
514
- */
515
- export function createFSxAdapter(rootPath) {
516
- return new FSxStorageAdapter(rootPath);
517
- }
518
- //# sourceMappingURL=fsx-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fsx-adapter.js","sourceRoot":"","sources":["../../src/storage/fsx-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAEtE,gDAAgD;AAChD,yEAAyE;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC,mFAAmF;AACnF,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY,EAAE,OAAmB;IACxD,MAAM,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,MAAM,IAAI,CAAA;IAC5C,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAClE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;IAC1B,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACvC,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,IAAgB;IACtC,2BAA2B;IAC3B,IAAI,SAAS,GAAG,CAAC,CAAC,CAAA;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE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