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,532 +0,0 @@
1
- /**
2
- * @fileoverview Object Location Index Module
3
- *
4
- * This module tracks the storage location of Git objects across multiple storage tiers.
5
- * It provides a unified index for locating objects regardless of which tier contains
6
- * the actual data.
7
- *
8
- * ## Storage Tiers
9
- *
10
- * - **Hot**: SQLite (local Durable Object storage for frequently accessed objects)
11
- * - **R2**: Packed in R2 object storage (for larger objects or archives)
12
- * - **Parquet**: Columnar format for cold storage analytics
13
- *
14
- * ## Features
15
- *
16
- * - O(1) object location lookup by SHA
17
- * - Batch lookup for multiple objects
18
- * - Tier-based statistics and querying
19
- * - Object tracking during tier migrations
20
- *
21
- * @module storage/object-index
22
- *
23
- * @example
24
- * ```typescript
25
- * // Initialize the index with Durable Object storage
26
- * const index = new ObjectIndex(storage);
27
- *
28
- * // Record an object location
29
- * await index.recordLocation({
30
- * sha: 'abc123...def456',
31
- * tier: 'hot',
32
- * size: 1024,
33
- * type: 'blob'
34
- * });
35
- *
36
- * // Look up an object
37
- * const location = await index.lookupLocation('abc123...def456');
38
- * if (location) {
39
- * console.log(`Object is in ${location.tier} tier`);
40
- * }
41
- * ```
42
- */
43
- /**
44
- * Validates SHA format (40 alphanumeric characters, allows hyphens).
45
- *
46
- * @description
47
- * Ensures the SHA meets the expected format requirements. Throws an error
48
- * if the SHA is invalid, which helps catch bugs early.
49
- *
50
- * @param sha - The SHA string to validate
51
- *
52
- * @throws {Error} If SHA format is invalid
53
- *
54
- * @example
55
- * ```typescript
56
- * validateSha('abc123def456789012345678901234567890abcd'); // OK
57
- * validateSha('invalid'); // throws Error
58
- * ```
59
- *
60
- * @internal
61
- */
62
- function validateSha(sha) {
63
- if (!sha || sha.length !== 40) {
64
- throw new Error(`Invalid SHA format: ${sha}`);
65
- }
66
- if (!/^[0-9a-z-]{40}$/.test(sha)) {
67
- throw new Error(`Invalid SHA format: ${sha}`);
68
- }
69
- // Reject strings that are just one character repeated
70
- if (/^(.)\1{39}$/.test(sha)) {
71
- throw new Error(`Invalid SHA format: ${sha}`);
72
- }
73
- }
74
- /**
75
- * Object Index class for managing object locations across storage tiers.
76
- *
77
- * @description
78
- * Provides a centralized index for tracking where Git objects are stored
79
- * in the tiered storage system. Uses SQLite (via Durable Object storage)
80
- * for persistent, consistent storage of location metadata.
81
- *
82
- * ## Key Features
83
- *
84
- * - **Fast Lookups**: O(1) lookup by SHA using indexed SQLite queries
85
- * - **Batch Operations**: Efficient bulk lookup for multiple objects
86
- * - **Tier Tracking**: Query objects by storage tier
87
- * - **Statistics**: Aggregate stats for monitoring and capacity planning
88
- *
89
- * ## Thread Safety
90
- *
91
- * The underlying Durable Object storage provides transactional guarantees,
92
- * ensuring consistency even with concurrent access.
93
- *
94
- * @example
95
- * ```typescript
96
- * const index = new ObjectIndex(storage);
97
- *
98
- * // Record locations
99
- * await index.recordLocation({
100
- * sha: 'abc123...',
101
- * tier: 'hot',
102
- * size: 1024,
103
- * type: 'blob'
104
- * });
105
- *
106
- * // Look up a single object
107
- * const location = await index.lookupLocation('abc123...');
108
- *
109
- * // Batch lookup
110
- * const result = await index.batchLookup(['sha1', 'sha2', 'sha3']);
111
- *
112
- * // Get objects by tier
113
- * const hotObjects = await index.getObjectsByTier('hot');
114
- *
115
- * // Get statistics
116
- * const stats = await index.getStats();
117
- * ```
118
- */
119
- export class ObjectIndex {
120
- _storage;
121
- /**
122
- * Creates a new ObjectIndex instance.
123
- *
124
- * @description
125
- * Initializes the index with a Durable Object storage instance.
126
- * The storage should have the object_index table already created
127
- * by the schema migration.
128
- *
129
- * @param storage - Durable Object storage instance with SQL support
130
- *
131
- * @example
132
- * ```typescript
133
- * // In a Durable Object class
134
- * constructor(state: DurableObjectState) {
135
- * this.index = new ObjectIndex(state.storage);
136
- * }
137
- * ```
138
- */
139
- constructor(storage) {
140
- this._storage = storage;
141
- }
142
- /**
143
- * Records the location of an object in the index.
144
- *
145
- * @description
146
- * Inserts or updates the location record for an object. If the object
147
- * already exists in the index, its location is updated (upsert behavior).
148
- *
149
- * @param options - Location recording options including SHA, tier, size, etc.
150
- *
151
- * @throws {Error} If SHA format is invalid
152
- *
153
- * @example
154
- * ```typescript
155
- * // Record a new object in hot tier
156
- * await index.recordLocation({
157
- * sha: 'abc123def456789012345678901234567890abcd',
158
- * tier: 'hot',
159
- * size: 1024,
160
- * type: 'blob'
161
- * });
162
- *
163
- * // Record an object in R2 pack
164
- * await index.recordLocation({
165
- * sha: 'def456789012345678901234567890abcdef12',
166
- * tier: 'r2',
167
- * packId: 'pack-abc123',
168
- * offset: 4096,
169
- * size: 2048,
170
- * type: 'tree'
171
- * });
172
- * ```
173
- */
174
- async recordLocation(options) {
175
- validateSha(options.sha);
176
- const updatedAt = Date.now();
177
- const packId = options.packId ?? null;
178
- const offset = options.offset ?? null;
179
- this._storage.sql.exec('INSERT OR REPLACE INTO object_index (sha, tier, pack_id, offset, size, type, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)', options.sha, options.tier, packId, offset, options.size, options.type ?? null, updatedAt);
180
- }
181
- /**
182
- * Looks up the location of an object by SHA.
183
- *
184
- * @description
185
- * Retrieves the storage location for a single object. Returns null if
186
- * the object is not found in the index.
187
- *
188
- * @param sha - The 40-character SHA-1 hash of the object
189
- *
190
- * @returns The object location or null if not found
191
- *
192
- * @example
193
- * ```typescript
194
- * const location = await index.lookupLocation('abc123...');
195
- * if (location) {
196
- * console.log(`Object is in ${location.tier} tier`);
197
- * if (location.packId) {
198
- * console.log(`Pack: ${location.packId}, Offset: ${location.offset}`);
199
- * }
200
- * } else {
201
- * console.log('Object not found');
202
- * }
203
- * ```
204
- */
205
- async lookupLocation(sha) {
206
- const result = this._storage.sql.exec('SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE sha = ?', sha);
207
- const rows = result.toArray();
208
- if (rows.length === 0) {
209
- return null;
210
- }
211
- return rows[0];
212
- }
213
- /**
214
- * Performs batch lookup of multiple objects.
215
- *
216
- * @description
217
- * Efficiently looks up locations for multiple objects in a single query.
218
- * Returns both found locations and a list of missing SHAs.
219
- *
220
- * This is more efficient than multiple single lookups when you need
221
- * to find several objects.
222
- *
223
- * @param shas - Array of SHA-1 hashes to look up
224
- *
225
- * @returns Result containing found locations and missing SHAs
226
- *
227
- * @example
228
- * ```typescript
229
- * const shas = ['sha1...', 'sha2...', 'sha3...'];
230
- * const result = await index.batchLookup(shas);
231
- *
232
- * console.log(`Found ${result.found.size} objects`);
233
- * console.log(`Missing ${result.missing.length} objects`);
234
- *
235
- * for (const [sha, location] of result.found) {
236
- * console.log(`${sha}: ${location.tier}`);
237
- * }
238
- * ```
239
- */
240
- async batchLookup(shas) {
241
- if (shas.length === 0) {
242
- return { found: new Map(), missing: [] };
243
- }
244
- // Build query with placeholders
245
- const placeholders = shas.map(() => '?').join(', ');
246
- const result = this._storage.sql.exec(`SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE sha IN (${placeholders})`, ...shas);
247
- const rows = result.toArray();
248
- const found = new Map();
249
- for (const row of rows) {
250
- found.set(row.sha, row);
251
- }
252
- const missing = shas.filter(sha => !found.has(sha));
253
- return { found, missing };
254
- }
255
- /**
256
- * Updates the location of an object (e.g., when moving between tiers).
257
- *
258
- * @description
259
- * Updates the tier, packId, and offset for an existing object.
260
- * Use this when migrating objects between storage tiers.
261
- *
262
- * Note: This only updates existing records. If the object doesn't exist,
263
- * no action is taken. Use `recordLocation` for upsert behavior.
264
- *
265
- * @param sha - The object's SHA-1 hash
266
- * @param newTier - The new storage tier
267
- * @param packId - Pack ID for r2/parquet tiers (optional)
268
- * @param offset - Byte offset in pack file (optional)
269
- *
270
- * @example
271
- * ```typescript
272
- * // Migrate object from hot to R2
273
- * await index.updateLocation(
274
- * 'abc123...',
275
- * 'r2',
276
- * 'pack-new123',
277
- * 1024
278
- * );
279
- *
280
- * // Migrate object to hot tier
281
- * await index.updateLocation('abc123...', 'hot');
282
- * ```
283
- */
284
- async updateLocation(sha, newTier, packId, offset) {
285
- this._storage.sql.exec('UPDATE object_index SET tier = ?, pack_id = ?, offset = ? WHERE sha = ?', newTier, packId ?? null, offset ?? null, sha);
286
- }
287
- /**
288
- * Gets statistics about object distribution across tiers.
289
- *
290
- * @description
291
- * Returns aggregated statistics including object counts and total sizes
292
- * for each storage tier. Useful for monitoring storage usage and
293
- * capacity planning.
294
- *
295
- * @returns Statistics about objects in each tier
296
- *
297
- * @example
298
- * ```typescript
299
- * const stats = await index.getStats();
300
- *
301
- * console.log(`Total objects: ${stats.totalObjects}`);
302
- * console.log('Hot tier:');
303
- * console.log(` Count: ${stats.hotCount}`);
304
- * console.log(` Size: ${(stats.hotSize / 1024 / 1024).toFixed(2)} MB`);
305
- * console.log('R2 tier:');
306
- * console.log(` Count: ${stats.r2Count}`);
307
- * console.log(` Size: ${(stats.r2Size / 1024 / 1024).toFixed(2)} MB`);
308
- * ```
309
- */
310
- async getStats() {
311
- // Get objects by tier and compute stats in code
312
- // This approach works better with the mock storage implementation
313
- const hotObjects = await this.getObjectsByTier('hot');
314
- const r2Objects = await this.getObjectsByTier('r2');
315
- const parquetObjects = await this.getObjectsByTier('parquet');
316
- const hotCount = hotObjects.length;
317
- const r2Count = r2Objects.length;
318
- const parquetCount = parquetObjects.length;
319
- const totalObjects = hotCount + r2Count + parquetCount;
320
- const hotSize = hotObjects.reduce((sum, o) => sum + o.size, 0);
321
- const r2Size = r2Objects.reduce((sum, o) => sum + o.size, 0);
322
- const parquetSize = parquetObjects.reduce((sum, o) => sum + o.size, 0);
323
- return {
324
- totalObjects,
325
- hotCount,
326
- r2Count,
327
- parquetCount,
328
- hotSize,
329
- r2Size,
330
- parquetSize
331
- };
332
- }
333
- /**
334
- * Checks if an object exists in the index.
335
- *
336
- * @description
337
- * Returns true if the object is tracked in the index, regardless of
338
- * which tier it's stored in.
339
- *
340
- * @param sha - The object's SHA-1 hash
341
- *
342
- * @returns true if the object exists in the index
343
- *
344
- * @example
345
- * ```typescript
346
- * if (await index.exists('abc123...')) {
347
- * console.log('Object is tracked');
348
- * } else {
349
- * console.log('Object is not in the index');
350
- * }
351
- * ```
352
- */
353
- async exists(sha) {
354
- const location = await this.lookupLocation(sha);
355
- return location !== null;
356
- }
357
- /**
358
- * Deletes an object from the index.
359
- *
360
- * @description
361
- * Removes the location record for an object. This does NOT delete
362
- * the actual object data from storage - only the index entry.
363
- *
364
- * @param sha - The object's SHA-1 hash
365
- *
366
- * @returns true if the object was deleted, false if it didn't exist
367
- *
368
- * @example
369
- * ```typescript
370
- * if (await index.deleteLocation('abc123...')) {
371
- * console.log('Location record deleted');
372
- * } else {
373
- * console.log('Object was not in the index');
374
- * }
375
- * ```
376
- */
377
- async deleteLocation(sha) {
378
- const result = this._storage.sql.exec('DELETE FROM object_index WHERE sha = ?', sha);
379
- const rows = result.toArray();
380
- return rows.length > 0 && rows[0].changes > 0;
381
- }
382
- /**
383
- * Gets all objects in a specific tier.
384
- *
385
- * @description
386
- * Returns all objects currently stored in the specified tier.
387
- * Useful for migration planning or tier-specific operations.
388
- *
389
- * @param tier - The storage tier to query ('hot', 'r2', or 'parquet')
390
- *
391
- * @returns Array of object locations in the specified tier
392
- *
393
- * @example
394
- * ```typescript
395
- * // Get all hot tier objects
396
- * const hotObjects = await index.getObjectsByTier('hot');
397
- * console.log(`Hot tier has ${hotObjects.length} objects`);
398
- *
399
- * // Calculate total size
400
- * const totalSize = hotObjects.reduce((sum, obj) => sum + obj.size, 0);
401
- * console.log(`Total hot tier size: ${totalSize} bytes`);
402
- * ```
403
- */
404
- async getObjectsByTier(tier) {
405
- const result = this._storage.sql.exec('SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE tier = ?', tier);
406
- return result.toArray();
407
- }
408
- /**
409
- * Gets all objects in a specific pack.
410
- *
411
- * @description
412
- * Returns all objects stored in a particular packfile, sorted by offset.
413
- * Useful for pack operations like repacking or verification.
414
- *
415
- * @param packId - The pack file identifier
416
- *
417
- * @returns Array of object locations in the pack, sorted by offset
418
- *
419
- * @example
420
- * ```typescript
421
- * const packObjects = await index.getObjectsByPack('pack-abc123');
422
- * console.log(`Pack contains ${packObjects.length} objects`);
423
- *
424
- * // Objects are sorted by offset for sequential reading
425
- * for (const obj of packObjects) {
426
- * console.log(` ${obj.sha}: offset=${obj.offset}, size=${obj.size}`);
427
- * }
428
- * ```
429
- */
430
- async getObjectsByPack(packId) {
431
- const result = this._storage.sql.exec('SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE pack_id = ?', packId);
432
- const locations = result.toArray();
433
- // Sort by offset to ensure consistent ordering
434
- return locations.sort((a, b) => (a.offset ?? 0) - (b.offset ?? 0));
435
- }
436
- }
437
- /**
438
- * Records the location of an object (standalone function).
439
- *
440
- * @description
441
- * Standalone function that creates a temporary ObjectIndex instance
442
- * to record an object's location. Useful when you don't need to
443
- * maintain an ObjectIndex instance.
444
- *
445
- * @param storage - Durable Object storage instance
446
- * @param options - Location recording options
447
- *
448
- * @throws {Error} If SHA format is invalid
449
- *
450
- * @example
451
- * ```typescript
452
- * await recordLocation(storage, {
453
- * sha: 'abc123...',
454
- * tier: 'hot',
455
- * size: 1024,
456
- * type: 'blob'
457
- * });
458
- * ```
459
- */
460
- export async function recordLocation(storage, options) {
461
- const index = new ObjectIndex(storage);
462
- return index.recordLocation(options);
463
- }
464
- /**
465
- * Looks up the location of an object by SHA (standalone function).
466
- *
467
- * @description
468
- * Standalone function for single object lookup. Creates a temporary
469
- * ObjectIndex instance internally.
470
- *
471
- * @param storage - Durable Object storage instance
472
- * @param sha - The object's SHA-1 hash
473
- *
474
- * @returns Object location or null if not found
475
- *
476
- * @example
477
- * ```typescript
478
- * const location = await lookupLocation(storage, 'abc123...');
479
- * if (location) {
480
- * console.log(`Found in ${location.tier}`);
481
- * }
482
- * ```
483
- */
484
- export async function lookupLocation(storage, sha) {
485
- const index = new ObjectIndex(storage);
486
- return index.lookupLocation(sha);
487
- }
488
- /**
489
- * Performs batch lookup of multiple objects (standalone function).
490
- *
491
- * @description
492
- * Standalone function for batch object lookup. More efficient than
493
- * multiple single lookups when querying several objects.
494
- *
495
- * @param storage - Durable Object storage instance
496
- * @param shas - Array of SHA-1 hashes to look up
497
- *
498
- * @returns Result containing found locations and missing SHAs
499
- *
500
- * @example
501
- * ```typescript
502
- * const result = await batchLookup(storage, ['sha1...', 'sha2...']);
503
- * console.log(`Found: ${result.found.size}, Missing: ${result.missing.length}`);
504
- * ```
505
- */
506
- export async function batchLookup(storage, shas) {
507
- const index = new ObjectIndex(storage);
508
- return index.batchLookup(shas);
509
- }
510
- /**
511
- * Gets statistics about object distribution (standalone function).
512
- *
513
- * @description
514
- * Standalone function for retrieving object distribution statistics
515
- * across storage tiers.
516
- *
517
- * @param storage - Durable Object storage instance
518
- *
519
- * @returns Statistics about objects in each tier
520
- *
521
- * @example
522
- * ```typescript
523
- * const stats = await getStats(storage);
524
- * console.log(`Total: ${stats.totalObjects} objects`);
525
- * console.log(`Hot: ${stats.hotCount}, R2: ${stats.r2Count}`);
526
- * ```
527
- */
528
- export async function getStats(storage) {
529
- const index = new ObjectIndex(storage);
530
- return index.getStats();
531
- }
532
- //# sourceMappingURL=object-index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object-index.js","sourceRoot":"","sources":["../../src/storage/object-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AA8LH;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG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