gitx.do 0.0.1 → 0.0.3

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 (237) hide show
  1. package/dist/cli/commands/blame.d.ts +259 -0
  2. package/dist/cli/commands/blame.d.ts.map +1 -0
  3. package/dist/cli/commands/blame.js +609 -0
  4. package/dist/cli/commands/blame.js.map +1 -0
  5. package/dist/cli/commands/branch.d.ts +249 -0
  6. package/dist/cli/commands/branch.d.ts.map +1 -0
  7. package/dist/cli/commands/branch.js +693 -0
  8. package/dist/cli/commands/branch.js.map +1 -0
  9. package/dist/cli/commands/commit.d.ts +182 -0
  10. package/dist/cli/commands/commit.d.ts.map +1 -0
  11. package/dist/cli/commands/commit.js +437 -0
  12. package/dist/cli/commands/commit.js.map +1 -0
  13. package/dist/cli/commands/diff.d.ts +464 -0
  14. package/dist/cli/commands/diff.d.ts.map +1 -0
  15. package/dist/cli/commands/diff.js +958 -0
  16. package/dist/cli/commands/diff.js.map +1 -0
  17. package/dist/cli/commands/log.d.ts +239 -0
  18. package/dist/cli/commands/log.d.ts.map +1 -0
  19. package/dist/cli/commands/log.js +535 -0
  20. package/dist/cli/commands/log.js.map +1 -0
  21. package/dist/cli/commands/review.d.ts +457 -0
  22. package/dist/cli/commands/review.d.ts.map +1 -0
  23. package/dist/cli/commands/review.js +533 -0
  24. package/dist/cli/commands/review.js.map +1 -0
  25. package/dist/cli/commands/status.d.ts +269 -0
  26. package/dist/cli/commands/status.d.ts.map +1 -0
  27. package/dist/cli/commands/status.js +493 -0
  28. package/dist/cli/commands/status.js.map +1 -0
  29. package/dist/cli/commands/web.d.ts +199 -0
  30. package/dist/cli/commands/web.d.ts.map +1 -0
  31. package/dist/cli/commands/web.js +696 -0
  32. package/dist/cli/commands/web.js.map +1 -0
  33. package/dist/cli/fs-adapter.d.ts +656 -0
  34. package/dist/cli/fs-adapter.d.ts.map +1 -0
  35. package/dist/cli/fs-adapter.js +1179 -0
  36. package/dist/cli/fs-adapter.js.map +1 -0
  37. package/dist/cli/index.d.ts +387 -0
  38. package/dist/cli/index.d.ts.map +1 -0
  39. package/dist/cli/index.js +523 -0
  40. package/dist/cli/index.js.map +1 -0
  41. package/dist/cli/ui/components/DiffView.d.ts +7 -0
  42. package/dist/cli/ui/components/DiffView.d.ts.map +1 -0
  43. package/dist/cli/ui/components/DiffView.js +11 -0
  44. package/dist/cli/ui/components/DiffView.js.map +1 -0
  45. package/dist/cli/ui/components/ErrorDisplay.d.ts +6 -0
  46. package/dist/cli/ui/components/ErrorDisplay.d.ts.map +1 -0
  47. package/dist/cli/ui/components/ErrorDisplay.js +11 -0
  48. package/dist/cli/ui/components/ErrorDisplay.js.map +1 -0
  49. package/dist/cli/ui/components/FuzzySearch.d.ts +9 -0
  50. package/dist/cli/ui/components/FuzzySearch.d.ts.map +1 -0
  51. package/dist/cli/ui/components/FuzzySearch.js +12 -0
  52. package/dist/cli/ui/components/FuzzySearch.js.map +1 -0
  53. package/dist/cli/ui/components/LoadingSpinner.d.ts +6 -0
  54. package/dist/cli/ui/components/LoadingSpinner.d.ts.map +1 -0
  55. package/dist/cli/ui/components/LoadingSpinner.js +10 -0
  56. package/dist/cli/ui/components/LoadingSpinner.js.map +1 -0
  57. package/dist/cli/ui/components/NavigationList.d.ts +9 -0
  58. package/dist/cli/ui/components/NavigationList.d.ts.map +1 -0
  59. package/dist/cli/ui/components/NavigationList.js +11 -0
  60. package/dist/cli/ui/components/NavigationList.js.map +1 -0
  61. package/dist/cli/ui/components/ScrollableContent.d.ts +8 -0
  62. package/dist/cli/ui/components/ScrollableContent.d.ts.map +1 -0
  63. package/dist/cli/ui/components/ScrollableContent.js +11 -0
  64. package/dist/cli/ui/components/ScrollableContent.js.map +1 -0
  65. package/dist/cli/ui/components/index.d.ts +7 -0
  66. package/dist/cli/ui/components/index.d.ts.map +1 -0
  67. package/dist/cli/ui/components/index.js +9 -0
  68. package/dist/cli/ui/components/index.js.map +1 -0
  69. package/dist/cli/ui/terminal-ui.d.ts +52 -0
  70. package/dist/cli/ui/terminal-ui.d.ts.map +1 -0
  71. package/dist/cli/ui/terminal-ui.js +121 -0
  72. package/dist/cli/ui/terminal-ui.js.map +1 -0
  73. package/dist/durable-object/object-store.d.ts +401 -23
  74. package/dist/durable-object/object-store.d.ts.map +1 -1
  75. package/dist/durable-object/object-store.js +414 -25
  76. package/dist/durable-object/object-store.js.map +1 -1
  77. package/dist/durable-object/schema.d.ts +188 -0
  78. package/dist/durable-object/schema.d.ts.map +1 -1
  79. package/dist/durable-object/schema.js +160 -0
  80. package/dist/durable-object/schema.js.map +1 -1
  81. package/dist/durable-object/wal.d.ts +336 -31
  82. package/dist/durable-object/wal.d.ts.map +1 -1
  83. package/dist/durable-object/wal.js +272 -27
  84. package/dist/durable-object/wal.js.map +1 -1
  85. package/dist/index.d.ts +379 -3
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +379 -7
  88. package/dist/index.js.map +1 -1
  89. package/dist/mcp/adapter.d.ts +579 -38
  90. package/dist/mcp/adapter.d.ts.map +1 -1
  91. package/dist/mcp/adapter.js +426 -33
  92. package/dist/mcp/adapter.js.map +1 -1
  93. package/dist/mcp/sandbox.d.ts +532 -29
  94. package/dist/mcp/sandbox.d.ts.map +1 -1
  95. package/dist/mcp/sandbox.js +389 -22
  96. package/dist/mcp/sandbox.js.map +1 -1
  97. package/dist/mcp/sdk-adapter.d.ts +478 -56
  98. package/dist/mcp/sdk-adapter.d.ts.map +1 -1
  99. package/dist/mcp/sdk-adapter.js +346 -44
  100. package/dist/mcp/sdk-adapter.js.map +1 -1
  101. package/dist/mcp/tools.d.ts +445 -30
  102. package/dist/mcp/tools.d.ts.map +1 -1
  103. package/dist/mcp/tools.js +363 -33
  104. package/dist/mcp/tools.js.map +1 -1
  105. package/dist/ops/blame.d.ts +424 -21
  106. package/dist/ops/blame.d.ts.map +1 -1
  107. package/dist/ops/blame.js +303 -20
  108. package/dist/ops/blame.js.map +1 -1
  109. package/dist/ops/branch.d.ts +583 -32
  110. package/dist/ops/branch.d.ts.map +1 -1
  111. package/dist/ops/branch.js +365 -23
  112. package/dist/ops/branch.js.map +1 -1
  113. package/dist/ops/commit-traversal.d.ts +164 -24
  114. package/dist/ops/commit-traversal.d.ts.map +1 -1
  115. package/dist/ops/commit-traversal.js +68 -2
  116. package/dist/ops/commit-traversal.js.map +1 -1
  117. package/dist/ops/commit.d.ts +387 -53
  118. package/dist/ops/commit.d.ts.map +1 -1
  119. package/dist/ops/commit.js +249 -29
  120. package/dist/ops/commit.js.map +1 -1
  121. package/dist/ops/merge-base.d.ts +195 -21
  122. package/dist/ops/merge-base.d.ts.map +1 -1
  123. package/dist/ops/merge-base.js +122 -12
  124. package/dist/ops/merge-base.js.map +1 -1
  125. package/dist/ops/merge.d.ts +600 -130
  126. package/dist/ops/merge.d.ts.map +1 -1
  127. package/dist/ops/merge.js +408 -60
  128. package/dist/ops/merge.js.map +1 -1
  129. package/dist/ops/tag.d.ts +67 -2
  130. package/dist/ops/tag.d.ts.map +1 -1
  131. package/dist/ops/tag.js +42 -1
  132. package/dist/ops/tag.js.map +1 -1
  133. package/dist/ops/tree-builder.d.ts +102 -6
  134. package/dist/ops/tree-builder.d.ts.map +1 -1
  135. package/dist/ops/tree-builder.js +30 -5
  136. package/dist/ops/tree-builder.js.map +1 -1
  137. package/dist/ops/tree-diff.d.ts +50 -2
  138. package/dist/ops/tree-diff.d.ts.map +1 -1
  139. package/dist/ops/tree-diff.js +50 -2
  140. package/dist/ops/tree-diff.js.map +1 -1
  141. package/dist/pack/delta.d.ts +211 -39
  142. package/dist/pack/delta.d.ts.map +1 -1
  143. package/dist/pack/delta.js +232 -46
  144. package/dist/pack/delta.js.map +1 -1
  145. package/dist/pack/format.d.ts +390 -28
  146. package/dist/pack/format.d.ts.map +1 -1
  147. package/dist/pack/format.js +344 -33
  148. package/dist/pack/format.js.map +1 -1
  149. package/dist/pack/full-generation.d.ts +313 -28
  150. package/dist/pack/full-generation.d.ts.map +1 -1
  151. package/dist/pack/full-generation.js +238 -19
  152. package/dist/pack/full-generation.js.map +1 -1
  153. package/dist/pack/generation.d.ts +346 -23
  154. package/dist/pack/generation.d.ts.map +1 -1
  155. package/dist/pack/generation.js +269 -21
  156. package/dist/pack/generation.js.map +1 -1
  157. package/dist/pack/index.d.ts +407 -86
  158. package/dist/pack/index.d.ts.map +1 -1
  159. package/dist/pack/index.js +351 -70
  160. package/dist/pack/index.js.map +1 -1
  161. package/dist/refs/branch.d.ts +517 -71
  162. package/dist/refs/branch.d.ts.map +1 -1
  163. package/dist/refs/branch.js +410 -26
  164. package/dist/refs/branch.js.map +1 -1
  165. package/dist/refs/storage.d.ts +610 -57
  166. package/dist/refs/storage.d.ts.map +1 -1
  167. package/dist/refs/storage.js +481 -29
  168. package/dist/refs/storage.js.map +1 -1
  169. package/dist/refs/tag.d.ts +677 -67
  170. package/dist/refs/tag.d.ts.map +1 -1
  171. package/dist/refs/tag.js +497 -30
  172. package/dist/refs/tag.js.map +1 -1
  173. package/dist/storage/lru-cache.d.ts +556 -53
  174. package/dist/storage/lru-cache.d.ts.map +1 -1
  175. package/dist/storage/lru-cache.js +439 -36
  176. package/dist/storage/lru-cache.js.map +1 -1
  177. package/dist/storage/object-index.d.ts +483 -38
  178. package/dist/storage/object-index.d.ts.map +1 -1
  179. package/dist/storage/object-index.js +388 -22
  180. package/dist/storage/object-index.js.map +1 -1
  181. package/dist/storage/r2-pack.d.ts +957 -94
  182. package/dist/storage/r2-pack.d.ts.map +1 -1
  183. package/dist/storage/r2-pack.js +756 -48
  184. package/dist/storage/r2-pack.js.map +1 -1
  185. package/dist/tiered/cdc-pipeline.d.ts +1610 -38
  186. package/dist/tiered/cdc-pipeline.d.ts.map +1 -1
  187. package/dist/tiered/cdc-pipeline.js +1131 -22
  188. package/dist/tiered/cdc-pipeline.js.map +1 -1
  189. package/dist/tiered/migration.d.ts +903 -41
  190. package/dist/tiered/migration.d.ts.map +1 -1
  191. package/dist/tiered/migration.js +646 -24
  192. package/dist/tiered/migration.js.map +1 -1
  193. package/dist/tiered/parquet-writer.d.ts +944 -47
  194. package/dist/tiered/parquet-writer.d.ts.map +1 -1
  195. package/dist/tiered/parquet-writer.js +667 -39
  196. package/dist/tiered/parquet-writer.js.map +1 -1
  197. package/dist/tiered/read-path.d.ts +728 -34
  198. package/dist/tiered/read-path.d.ts.map +1 -1
  199. package/dist/tiered/read-path.js +310 -27
  200. package/dist/tiered/read-path.js.map +1 -1
  201. package/dist/types/objects.d.ts +457 -0
  202. package/dist/types/objects.d.ts.map +1 -1
  203. package/dist/types/objects.js +305 -4
  204. package/dist/types/objects.js.map +1 -1
  205. package/dist/types/storage.d.ts +407 -35
  206. package/dist/types/storage.d.ts.map +1 -1
  207. package/dist/types/storage.js +27 -3
  208. package/dist/types/storage.js.map +1 -1
  209. package/dist/utils/hash.d.ts +133 -12
  210. package/dist/utils/hash.d.ts.map +1 -1
  211. package/dist/utils/hash.js +133 -12
  212. package/dist/utils/hash.js.map +1 -1
  213. package/dist/utils/sha1.d.ts +102 -9
  214. package/dist/utils/sha1.d.ts.map +1 -1
  215. package/dist/utils/sha1.js +114 -11
  216. package/dist/utils/sha1.js.map +1 -1
  217. package/dist/wire/capabilities.d.ts +896 -88
  218. package/dist/wire/capabilities.d.ts.map +1 -1
  219. package/dist/wire/capabilities.js +566 -62
  220. package/dist/wire/capabilities.js.map +1 -1
  221. package/dist/wire/pkt-line.d.ts +293 -15
  222. package/dist/wire/pkt-line.d.ts.map +1 -1
  223. package/dist/wire/pkt-line.js +251 -15
  224. package/dist/wire/pkt-line.js.map +1 -1
  225. package/dist/wire/receive-pack.d.ts +814 -64
  226. package/dist/wire/receive-pack.d.ts.map +1 -1
  227. package/dist/wire/receive-pack.js +542 -41
  228. package/dist/wire/receive-pack.js.map +1 -1
  229. package/dist/wire/smart-http.d.ts +575 -97
  230. package/dist/wire/smart-http.d.ts.map +1 -1
  231. package/dist/wire/smart-http.js +337 -46
  232. package/dist/wire/smart-http.js.map +1 -1
  233. package/dist/wire/upload-pack.d.ts +492 -98
  234. package/dist/wire/upload-pack.d.ts.map +1 -1
  235. package/dist/wire/upload-pack.js +347 -59
  236. package/dist/wire/upload-pack.js.map +1 -1
  237. package/package.json +10 -2
@@ -1,16 +1,63 @@
1
1
  /**
2
- * Object Location Index
2
+ * @fileoverview Object Location Index Module
3
3
  *
4
- * Tracks the storage location of Git objects across multiple tiers:
5
- * - Hot: SQLite (local Durable Object storage for frequently accessed objects)
6
- * - R2: Packed in R2 object storage (for larger objects or archives)
7
- * - Parquet: Columnar format for cold storage analytics
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.
8
7
  *
9
- * The index enables efficient object lookup regardless of which tier
10
- * contains the actual data.
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
+ * ```
11
42
  */
12
43
  /**
13
- * Validate SHA format (40 alphanumeric characters, allows hyphens)
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
14
61
  */
15
62
  function validateSha(sha) {
16
63
  if (!sha || sha.length !== 40) {
@@ -25,15 +72,104 @@ function validateSha(sha) {
25
72
  }
26
73
  }
27
74
  /**
28
- * Object Index class for managing object locations across storage tiers
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
+ * ```
29
118
  */
30
119
  export class ObjectIndex {
31
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
+ */
32
139
  constructor(storage) {
33
140
  this._storage = storage;
34
141
  }
35
142
  /**
36
- * Record the location of an object
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
+ * ```
37
173
  */
38
174
  async recordLocation(options) {
39
175
  validateSha(options.sha);
@@ -43,7 +179,28 @@ export class ObjectIndex {
43
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);
44
180
  }
45
181
  /**
46
- * Look up the location of an object by SHA
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
+ * ```
47
204
  */
48
205
  async lookupLocation(sha) {
49
206
  const result = this._storage.sql.exec('SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE sha = ?', sha);
@@ -54,7 +211,31 @@ export class ObjectIndex {
54
211
  return rows[0];
55
212
  }
56
213
  /**
57
- * Perform batch lookup of multiple objects
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
+ * ```
58
239
  */
59
240
  async batchLookup(shas) {
60
241
  if (shas.length === 0) {
@@ -72,13 +253,59 @@ export class ObjectIndex {
72
253
  return { found, missing };
73
254
  }
74
255
  /**
75
- * Update the location of an object (e.g., when moving between tiers)
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
+ * ```
76
283
  */
77
284
  async updateLocation(sha, newTier, packId, offset) {
78
285
  this._storage.sql.exec('UPDATE object_index SET tier = ?, pack_id = ?, offset = ? WHERE sha = ?', newTier, packId ?? null, offset ?? null, sha);
79
286
  }
80
287
  /**
81
- * Get statistics about object distribution across tiers
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
+ * ```
82
309
  */
83
310
  async getStats() {
84
311
  // Get objects by tier and compute stats in code
@@ -104,14 +331,48 @@ export class ObjectIndex {
104
331
  };
105
332
  }
106
333
  /**
107
- * Check if an object exists in the index
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
+ * ```
108
352
  */
109
353
  async exists(sha) {
110
354
  const location = await this.lookupLocation(sha);
111
355
  return location !== null;
112
356
  }
113
357
  /**
114
- * Delete an object from the index
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
+ * ```
115
376
  */
116
377
  async deleteLocation(sha) {
117
378
  const result = this._storage.sql.exec('DELETE FROM object_index WHERE sha = ?', sha);
@@ -119,14 +380,52 @@ export class ObjectIndex {
119
380
  return rows.length > 0 && rows[0].changes > 0;
120
381
  }
121
382
  /**
122
- * Get all objects in a specific tier
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
+ * ```
123
403
  */
124
404
  async getObjectsByTier(tier) {
125
405
  const result = this._storage.sql.exec('SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE tier = ?', tier);
126
406
  return result.toArray();
127
407
  }
128
408
  /**
129
- * Get all objects in a specific pack
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
+ * ```
130
429
  */
131
430
  async getObjectsByPack(packId) {
132
431
  const result = this._storage.sql.exec('SELECT sha, tier, pack_id, offset, size, type, updated_at FROM object_index WHERE pack_id = ?', packId);
@@ -136,28 +435,95 @@ export class ObjectIndex {
136
435
  }
137
436
  }
138
437
  /**
139
- * Record the location of an object (standalone function)
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
+ * ```
140
459
  */
141
460
  export async function recordLocation(storage, options) {
142
461
  const index = new ObjectIndex(storage);
143
462
  return index.recordLocation(options);
144
463
  }
145
464
  /**
146
- * Look up the location of an object by SHA (standalone function)
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
+ * ```
147
483
  */
148
484
  export async function lookupLocation(storage, sha) {
149
485
  const index = new ObjectIndex(storage);
150
486
  return index.lookupLocation(sha);
151
487
  }
152
488
  /**
153
- * Perform batch lookup of multiple objects (standalone function)
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
+ * ```
154
505
  */
155
506
  export async function batchLookup(storage, shas) {
156
507
  const index = new ObjectIndex(storage);
157
508
  return index.batchLookup(shas);
158
509
  }
159
510
  /**
160
- * Get statistics about object distribution (standalone function)
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
+ * ```
161
527
  */
162
528
  export async function getStats(storage) {
163
529
  const index = new ObjectIndex(storage);
@@ -1 +1 @@
1
- {"version":3,"file":"object-index.js","sourceRoot":"","sources":["../../src/storage/object-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA6EH;;GAEG;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