gitx.do 0.1.0 → 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 (344) 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 +15 -415
  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 -174
  20. package/dist/cli/commands/add.d.ts.map +0 -1
  21. package/dist/cli/commands/add.js +0 -131
  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/commit.d.ts +0 -182
  32. package/dist/cli/commands/commit.d.ts.map +0 -1
  33. package/dist/cli/commands/commit.js +0 -437
  34. package/dist/cli/commands/commit.js.map +0 -1
  35. package/dist/cli/commands/diff.d.ts +0 -464
  36. package/dist/cli/commands/diff.d.ts.map +0 -1
  37. package/dist/cli/commands/diff.js +0 -958
  38. package/dist/cli/commands/diff.js.map +0 -1
  39. package/dist/cli/commands/log.d.ts +0 -239
  40. package/dist/cli/commands/log.d.ts.map +0 -1
  41. package/dist/cli/commands/log.js +0 -535
  42. package/dist/cli/commands/log.js.map +0 -1
  43. package/dist/cli/commands/merge.d.ts +0 -106
  44. package/dist/cli/commands/merge.d.ts.map +0 -1
  45. package/dist/cli/commands/merge.js +0 -55
  46. package/dist/cli/commands/merge.js.map +0 -1
  47. package/dist/cli/commands/review.d.ts +0 -457
  48. package/dist/cli/commands/review.d.ts.map +0 -1
  49. package/dist/cli/commands/review.js +0 -533
  50. package/dist/cli/commands/review.js.map +0 -1
  51. package/dist/cli/commands/status.d.ts +0 -269
  52. package/dist/cli/commands/status.d.ts.map +0 -1
  53. package/dist/cli/commands/status.js +0 -493
  54. package/dist/cli/commands/status.js.map +0 -1
  55. package/dist/cli/commands/web.d.ts +0 -199
  56. package/dist/cli/commands/web.d.ts.map +0 -1
  57. package/dist/cli/commands/web.js +0 -696
  58. package/dist/cli/commands/web.js.map +0 -1
  59. package/dist/cli/fs-adapter.d.ts +0 -656
  60. package/dist/cli/fs-adapter.d.ts.map +0 -1
  61. package/dist/cli/fs-adapter.js +0 -1179
  62. package/dist/cli/fs-adapter.js.map +0 -1
  63. package/dist/cli/fsx-cli-adapter.d.ts +0 -359
  64. package/dist/cli/fsx-cli-adapter.d.ts.map +0 -1
  65. package/dist/cli/fsx-cli-adapter.js +0 -619
  66. package/dist/cli/fsx-cli-adapter.js.map +0 -1
  67. package/dist/cli/index.d.ts +0 -387
  68. package/dist/cli/index.d.ts.map +0 -1
  69. package/dist/cli/index.js +0 -523
  70. package/dist/cli/index.js.map +0 -1
  71. package/dist/cli/ui/components/DiffView.d.ts +0 -7
  72. package/dist/cli/ui/components/DiffView.d.ts.map +0 -1
  73. package/dist/cli/ui/components/DiffView.js +0 -11
  74. package/dist/cli/ui/components/DiffView.js.map +0 -1
  75. package/dist/cli/ui/components/ErrorDisplay.d.ts +0 -6
  76. package/dist/cli/ui/components/ErrorDisplay.d.ts.map +0 -1
  77. package/dist/cli/ui/components/ErrorDisplay.js +0 -11
  78. package/dist/cli/ui/components/ErrorDisplay.js.map +0 -1
  79. package/dist/cli/ui/components/FuzzySearch.d.ts +0 -9
  80. package/dist/cli/ui/components/FuzzySearch.d.ts.map +0 -1
  81. package/dist/cli/ui/components/FuzzySearch.js +0 -12
  82. package/dist/cli/ui/components/FuzzySearch.js.map +0 -1
  83. package/dist/cli/ui/components/LoadingSpinner.d.ts +0 -6
  84. package/dist/cli/ui/components/LoadingSpinner.d.ts.map +0 -1
  85. package/dist/cli/ui/components/LoadingSpinner.js +0 -10
  86. package/dist/cli/ui/components/LoadingSpinner.js.map +0 -1
  87. package/dist/cli/ui/components/NavigationList.d.ts +0 -9
  88. package/dist/cli/ui/components/NavigationList.d.ts.map +0 -1
  89. package/dist/cli/ui/components/NavigationList.js +0 -11
  90. package/dist/cli/ui/components/NavigationList.js.map +0 -1
  91. package/dist/cli/ui/components/ScrollableContent.d.ts +0 -8
  92. package/dist/cli/ui/components/ScrollableContent.d.ts.map +0 -1
  93. package/dist/cli/ui/components/ScrollableContent.js +0 -11
  94. package/dist/cli/ui/components/ScrollableContent.js.map +0 -1
  95. package/dist/cli/ui/components/index.d.ts +0 -7
  96. package/dist/cli/ui/components/index.d.ts.map +0 -1
  97. package/dist/cli/ui/components/index.js +0 -9
  98. package/dist/cli/ui/components/index.js.map +0 -1
  99. package/dist/cli/ui/terminal-ui.d.ts +0 -52
  100. package/dist/cli/ui/terminal-ui.d.ts.map +0 -1
  101. package/dist/cli/ui/terminal-ui.js +0 -121
  102. package/dist/cli/ui/terminal-ui.js.map +0 -1
  103. package/dist/do/BashModule.d.ts +0 -871
  104. package/dist/do/BashModule.d.ts.map +0 -1
  105. package/dist/do/BashModule.js +0 -1143
  106. package/dist/do/BashModule.js.map +0 -1
  107. package/dist/do/FsModule.d.ts +0 -601
  108. package/dist/do/FsModule.d.ts.map +0 -1
  109. package/dist/do/FsModule.js +0 -1120
  110. package/dist/do/FsModule.js.map +0 -1
  111. package/dist/do/GitModule.d.ts +0 -635
  112. package/dist/do/GitModule.d.ts.map +0 -1
  113. package/dist/do/GitModule.js +0 -781
  114. package/dist/do/GitModule.js.map +0 -1
  115. package/dist/do/GitRepoDO.d.ts +0 -281
  116. package/dist/do/GitRepoDO.d.ts.map +0 -1
  117. package/dist/do/GitRepoDO.js +0 -479
  118. package/dist/do/GitRepoDO.js.map +0 -1
  119. package/dist/do/bash-ast.d.ts +0 -246
  120. package/dist/do/bash-ast.d.ts.map +0 -1
  121. package/dist/do/bash-ast.js +0 -888
  122. package/dist/do/bash-ast.js.map +0 -1
  123. package/dist/do/container-executor.d.ts +0 -491
  124. package/dist/do/container-executor.d.ts.map +0 -1
  125. package/dist/do/container-executor.js +0 -730
  126. package/dist/do/container-executor.js.map +0 -1
  127. package/dist/do/index.d.ts +0 -53
  128. package/dist/do/index.d.ts.map +0 -1
  129. package/dist/do/index.js +0 -91
  130. package/dist/do/index.js.map +0 -1
  131. package/dist/do/tiered-storage.d.ts +0 -403
  132. package/dist/do/tiered-storage.d.ts.map +0 -1
  133. package/dist/do/tiered-storage.js +0 -689
  134. package/dist/do/tiered-storage.js.map +0 -1
  135. package/dist/do/withBash.d.ts +0 -231
  136. package/dist/do/withBash.d.ts.map +0 -1
  137. package/dist/do/withBash.js +0 -244
  138. package/dist/do/withBash.js.map +0 -1
  139. package/dist/do/withFs.d.ts +0 -237
  140. package/dist/do/withFs.d.ts.map +0 -1
  141. package/dist/do/withFs.js +0 -387
  142. package/dist/do/withFs.js.map +0 -1
  143. package/dist/do/withGit.d.ts +0 -180
  144. package/dist/do/withGit.d.ts.map +0 -1
  145. package/dist/do/withGit.js +0 -271
  146. package/dist/do/withGit.js.map +0 -1
  147. package/dist/durable-object/object-store.d.ts +0 -633
  148. package/dist/durable-object/object-store.d.ts.map +0 -1
  149. package/dist/durable-object/object-store.js +0 -1161
  150. package/dist/durable-object/object-store.js.map +0 -1
  151. package/dist/durable-object/schema.d.ts.map +0 -1
  152. package/dist/durable-object/schema.js.map +0 -1
  153. package/dist/durable-object/wal.d.ts +0 -416
  154. package/dist/durable-object/wal.d.ts.map +0 -1
  155. package/dist/durable-object/wal.js +0 -445
  156. package/dist/durable-object/wal.js.map +0 -1
  157. package/dist/mcp/adapter.d.ts +0 -772
  158. package/dist/mcp/adapter.d.ts.map +0 -1
  159. package/dist/mcp/adapter.js +0 -895
  160. package/dist/mcp/adapter.js.map +0 -1
  161. package/dist/mcp/sandbox/miniflare-evaluator.d.ts +0 -22
  162. package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +0 -1
  163. package/dist/mcp/sandbox/miniflare-evaluator.js +0 -140
  164. package/dist/mcp/sandbox/miniflare-evaluator.js.map +0 -1
  165. package/dist/mcp/sandbox/object-store-proxy.d.ts +0 -32
  166. package/dist/mcp/sandbox/object-store-proxy.d.ts.map +0 -1
  167. package/dist/mcp/sandbox/object-store-proxy.js +0 -30
  168. package/dist/mcp/sandbox/object-store-proxy.js.map +0 -1
  169. package/dist/mcp/sandbox/template.d.ts +0 -17
  170. package/dist/mcp/sandbox/template.d.ts.map +0 -1
  171. package/dist/mcp/sandbox/template.js +0 -71
  172. package/dist/mcp/sandbox/template.js.map +0 -1
  173. package/dist/mcp/sandbox.d.ts +0 -764
  174. package/dist/mcp/sandbox.d.ts.map +0 -1
  175. package/dist/mcp/sandbox.js +0 -1362
  176. package/dist/mcp/sandbox.js.map +0 -1
  177. package/dist/mcp/sdk-adapter.d.ts +0 -835
  178. package/dist/mcp/sdk-adapter.d.ts.map +0 -1
  179. package/dist/mcp/sdk-adapter.js +0 -974
  180. package/dist/mcp/sdk-adapter.js.map +0 -1
  181. package/dist/mcp/tools/do.d.ts +0 -32
  182. package/dist/mcp/tools/do.d.ts.map +0 -1
  183. package/dist/mcp/tools/do.js +0 -115
  184. package/dist/mcp/tools/do.js.map +0 -1
  185. package/dist/mcp/tools.d.ts +0 -548
  186. package/dist/mcp/tools.d.ts.map +0 -1
  187. package/dist/mcp/tools.js +0 -1934
  188. package/dist/mcp/tools.js.map +0 -1
  189. package/dist/ops/blame.d.ts +0 -551
  190. package/dist/ops/blame.d.ts.map +0 -1
  191. package/dist/ops/blame.js +0 -1037
  192. package/dist/ops/blame.js.map +0 -1
  193. package/dist/ops/branch.d.ts +0 -766
  194. package/dist/ops/branch.d.ts.map +0 -1
  195. package/dist/ops/branch.js +0 -950
  196. package/dist/ops/branch.js.map +0 -1
  197. package/dist/ops/commit-traversal.d.ts +0 -349
  198. package/dist/ops/commit-traversal.d.ts.map +0 -1
  199. package/dist/ops/commit-traversal.js +0 -821
  200. package/dist/ops/commit-traversal.js.map +0 -1
  201. package/dist/ops/commit.d.ts +0 -555
  202. package/dist/ops/commit.d.ts.map +0 -1
  203. package/dist/ops/commit.js +0 -826
  204. package/dist/ops/commit.js.map +0 -1
  205. package/dist/ops/merge-base.d.ts +0 -397
  206. package/dist/ops/merge-base.d.ts.map +0 -1
  207. package/dist/ops/merge-base.js +0 -691
  208. package/dist/ops/merge-base.js.map +0 -1
  209. package/dist/ops/merge.d.ts +0 -855
  210. package/dist/ops/merge.d.ts.map +0 -1
  211. package/dist/ops/merge.js +0 -1551
  212. package/dist/ops/merge.js.map +0 -1
  213. package/dist/ops/tag.d.ts +0 -247
  214. package/dist/ops/tag.d.ts.map +0 -1
  215. package/dist/ops/tag.js +0 -649
  216. package/dist/ops/tag.js.map +0 -1
  217. package/dist/ops/tree-builder.d.ts +0 -178
  218. package/dist/ops/tree-builder.d.ts.map +0 -1
  219. package/dist/ops/tree-builder.js +0 -271
  220. package/dist/ops/tree-builder.js.map +0 -1
  221. package/dist/ops/tree-diff.d.ts +0 -291
  222. package/dist/ops/tree-diff.d.ts.map +0 -1
  223. package/dist/ops/tree-diff.js +0 -705
  224. package/dist/ops/tree-diff.js.map +0 -1
  225. package/dist/pack/delta.d.ts +0 -248
  226. package/dist/pack/delta.d.ts.map +0 -1
  227. package/dist/pack/delta.js +0 -736
  228. package/dist/pack/delta.js.map +0 -1
  229. package/dist/pack/format.d.ts +0 -446
  230. package/dist/pack/format.d.ts.map +0 -1
  231. package/dist/pack/format.js +0 -572
  232. package/dist/pack/format.js.map +0 -1
  233. package/dist/pack/full-generation.d.ts +0 -612
  234. package/dist/pack/full-generation.d.ts.map +0 -1
  235. package/dist/pack/full-generation.js +0 -1378
  236. package/dist/pack/full-generation.js.map +0 -1
  237. package/dist/pack/generation.d.ts +0 -441
  238. package/dist/pack/generation.d.ts.map +0 -1
  239. package/dist/pack/generation.js +0 -707
  240. package/dist/pack/generation.js.map +0 -1
  241. package/dist/pack/index.d.ts +0 -502
  242. package/dist/pack/index.d.ts.map +0 -1
  243. package/dist/pack/index.js +0 -833
  244. package/dist/pack/index.js.map +0 -1
  245. package/dist/refs/branch.d.ts +0 -668
  246. package/dist/refs/branch.d.ts.map +0 -1
  247. package/dist/refs/branch.js +0 -897
  248. package/dist/refs/branch.js.map +0 -1
  249. package/dist/refs/storage.d.ts +0 -833
  250. package/dist/refs/storage.d.ts.map +0 -1
  251. package/dist/refs/storage.js +0 -1023
  252. package/dist/refs/storage.js.map +0 -1
  253. package/dist/refs/tag.d.ts +0 -860
  254. package/dist/refs/tag.d.ts.map +0 -1
  255. package/dist/refs/tag.js +0 -996
  256. package/dist/refs/tag.js.map +0 -1
  257. package/dist/storage/backend.d.ts +0 -425
  258. package/dist/storage/backend.d.ts.map +0 -1
  259. package/dist/storage/backend.js +0 -41
  260. package/dist/storage/backend.js.map +0 -1
  261. package/dist/storage/fsx-adapter.d.ts +0 -204
  262. package/dist/storage/fsx-adapter.d.ts.map +0 -1
  263. package/dist/storage/fsx-adapter.js +0 -470
  264. package/dist/storage/fsx-adapter.js.map +0 -1
  265. package/dist/storage/lru-cache.d.ts +0 -691
  266. package/dist/storage/lru-cache.d.ts.map +0 -1
  267. package/dist/storage/lru-cache.js +0 -813
  268. package/dist/storage/lru-cache.js.map +0 -1
  269. package/dist/storage/object-index.d.ts +0 -585
  270. package/dist/storage/object-index.d.ts.map +0 -1
  271. package/dist/storage/object-index.js +0 -532
  272. package/dist/storage/object-index.js.map +0 -1
  273. package/dist/storage/r2-pack.d.ts +0 -1257
  274. package/dist/storage/r2-pack.d.ts.map +0 -1
  275. package/dist/storage/r2-pack.js +0 -1770
  276. package/dist/storage/r2-pack.js.map +0 -1
  277. package/dist/tiered/cdc-pipeline.d.ts +0 -1888
  278. package/dist/tiered/cdc-pipeline.d.ts.map +0 -1
  279. package/dist/tiered/cdc-pipeline.js +0 -1880
  280. package/dist/tiered/cdc-pipeline.js.map +0 -1
  281. package/dist/tiered/migration.d.ts +0 -1104
  282. package/dist/tiered/migration.d.ts.map +0 -1
  283. package/dist/tiered/migration.js +0 -1214
  284. package/dist/tiered/migration.js.map +0 -1
  285. package/dist/tiered/parquet-writer.d.ts +0 -1145
  286. package/dist/tiered/parquet-writer.d.ts.map +0 -1
  287. package/dist/tiered/parquet-writer.js +0 -1183
  288. package/dist/tiered/parquet-writer.js.map +0 -1
  289. package/dist/tiered/read-path.d.ts +0 -835
  290. package/dist/tiered/read-path.d.ts.map +0 -1
  291. package/dist/tiered/read-path.js +0 -487
  292. package/dist/tiered/read-path.js.map +0 -1
  293. package/dist/types/capability.d.ts +0 -1385
  294. package/dist/types/capability.d.ts.map +0 -1
  295. package/dist/types/capability.js +0 -36
  296. package/dist/types/capability.js.map +0 -1
  297. package/dist/types/index.d.ts +0 -13
  298. package/dist/types/index.d.ts.map +0 -1
  299. package/dist/types/index.js +0 -18
  300. package/dist/types/index.js.map +0 -1
  301. package/dist/types/objects.d.ts +0 -692
  302. package/dist/types/objects.d.ts.map +0 -1
  303. package/dist/types/objects.js +0 -837
  304. package/dist/types/objects.js.map +0 -1
  305. package/dist/types/storage.d.ts +0 -603
  306. package/dist/types/storage.d.ts.map +0 -1
  307. package/dist/types/storage.js +0 -191
  308. package/dist/types/storage.js.map +0 -1
  309. package/dist/types/worker-loader.d.ts +0 -60
  310. package/dist/types/worker-loader.d.ts.map +0 -1
  311. package/dist/types/worker-loader.js +0 -62
  312. package/dist/types/worker-loader.js.map +0 -1
  313. package/dist/utils/hash.d.ts +0 -197
  314. package/dist/utils/hash.d.ts.map +0 -1
  315. package/dist/utils/hash.js +0 -268
  316. package/dist/utils/hash.js.map +0 -1
  317. package/dist/utils/sha1.d.ts +0 -290
  318. package/dist/utils/sha1.d.ts.map +0 -1
  319. package/dist/utils/sha1.js +0 -582
  320. package/dist/utils/sha1.js.map +0 -1
  321. package/dist/wire/capabilities.d.ts +0 -1044
  322. package/dist/wire/capabilities.d.ts.map +0 -1
  323. package/dist/wire/capabilities.js +0 -941
  324. package/dist/wire/capabilities.js.map +0 -1
  325. package/dist/wire/path-security.d.ts +0 -157
  326. package/dist/wire/path-security.d.ts.map +0 -1
  327. package/dist/wire/path-security.js +0 -307
  328. package/dist/wire/path-security.js.map +0 -1
  329. package/dist/wire/pkt-line.d.ts +0 -345
  330. package/dist/wire/pkt-line.d.ts.map +0 -1
  331. package/dist/wire/pkt-line.js +0 -381
  332. package/dist/wire/pkt-line.js.map +0 -1
  333. package/dist/wire/receive-pack.d.ts +0 -1059
  334. package/dist/wire/receive-pack.d.ts.map +0 -1
  335. package/dist/wire/receive-pack.js +0 -1414
  336. package/dist/wire/receive-pack.js.map +0 -1
  337. package/dist/wire/smart-http.d.ts +0 -799
  338. package/dist/wire/smart-http.d.ts.map +0 -1
  339. package/dist/wire/smart-http.js +0 -945
  340. package/dist/wire/smart-http.js.map +0 -1
  341. package/dist/wire/upload-pack.d.ts +0 -727
  342. package/dist/wire/upload-pack.d.ts.map +0 -1
  343. package/dist/wire/upload-pack.js +0 -1138
  344. package/dist/wire/upload-pack.js.map +0 -1
@@ -1,291 +0,0 @@
1
- /**
2
- * @fileoverview Tree Diff Operations
3
- *
4
- * This module provides functionality for comparing Git trees and detecting
5
- * changes between them, including added, deleted, modified, renamed, and
6
- * copied files.
7
- *
8
- * ## Features
9
- *
10
- * - Compare two tree objects to detect changes
11
- * - Detect file additions, deletions, modifications
12
- * - Rename detection based on content similarity
13
- * - Copy detection
14
- * - Binary file detection
15
- * - Path filtering with glob patterns
16
- * - Type change detection (file to symlink, etc.)
17
- *
18
- * ## Usage Example
19
- *
20
- * ```typescript
21
- * import { diffTrees, DiffStatus } from './ops/tree-diff'
22
- *
23
- * // Compare two trees
24
- * const result = await diffTrees(store, oldTreeSha, newTreeSha, {
25
- * detectRenames: true,
26
- * similarityThreshold: 50
27
- * })
28
- *
29
- * // Process changes
30
- * for (const entry of result.entries) {
31
- * switch (entry.status) {
32
- * case DiffStatus.ADDED:
33
- * console.log(`+ ${entry.path}`)
34
- * break
35
- * case DiffStatus.DELETED:
36
- * console.log(`- ${entry.path}`)
37
- * break
38
- * case DiffStatus.MODIFIED:
39
- * console.log(`M ${entry.path}`)
40
- * break
41
- * case DiffStatus.RENAMED:
42
- * console.log(`R ${entry.oldPath} -> ${entry.path}`)
43
- * break
44
- * }
45
- * }
46
- *
47
- * console.log(`Stats: ${result.stats.added} added, ${result.stats.deleted} deleted`)
48
- * ```
49
- *
50
- * @module ops/tree-diff
51
- */
52
- import type { TreeEntry } from '../types/objects';
53
- import type { TreeDiffObjectStore as ObjectStore } from '../types/storage';
54
- /**
55
- * Status of a file in a diff.
56
- *
57
- * These status codes match Git's diff status output.
58
- *
59
- * @enum {string}
60
- */
61
- export declare enum DiffStatus {
62
- /** File was added */
63
- ADDED = "A",
64
- /** File was deleted */
65
- DELETED = "D",
66
- /** File was modified */
67
- MODIFIED = "M",
68
- /** File was renamed */
69
- RENAMED = "R",
70
- /** File was copied */
71
- COPIED = "C",
72
- /** File type changed (e.g., file to symlink) */
73
- TYPE_CHANGED = "T",
74
- /** Unmerged (conflict) */
75
- UNMERGED = "U"
76
- }
77
- /**
78
- * File mode constants for Git objects
79
- */
80
- export declare enum FileMode {
81
- /** Regular file (not executable) */
82
- REGULAR = "100644",
83
- /** Executable file */
84
- EXECUTABLE = "100755",
85
- /** Symbolic link */
86
- SYMLINK = "120000",
87
- /** Git submodule (gitlink) */
88
- GITLINK = "160000",
89
- /** Directory (tree) */
90
- TREE = "040000"
91
- }
92
- /**
93
- * Represents a single entry in a diff result
94
- */
95
- export interface DiffEntry {
96
- /** Path to the file (new path for renames/copies) */
97
- path: string;
98
- /** Status of the change */
99
- status: DiffStatus;
100
- /** Old file mode (null for added files) */
101
- oldMode: string | null;
102
- /** New file mode (null for deleted files) */
103
- newMode: string | null;
104
- /** Old object SHA (null for added files) */
105
- oldSha: string | null;
106
- /** New object SHA (null for deleted files) */
107
- newSha: string | null;
108
- /** Original path (for renames/copies) */
109
- oldPath?: string;
110
- /** Similarity percentage (for renames/copies, 0-100) */
111
- similarity?: number;
112
- /** Whether the file is binary */
113
- isBinary?: boolean;
114
- }
115
- /**
116
- * Options for tree diff operations
117
- */
118
- export interface DiffOptions {
119
- /** Enable rename detection (default: true) */
120
- detectRenames?: boolean;
121
- /** Enable copy detection (default: false) */
122
- detectCopies?: boolean;
123
- /** Similarity threshold for rename/copy detection (0-100, default: 50) */
124
- similarityThreshold?: number;
125
- /** Filter paths by glob patterns (include) */
126
- pathspecs?: string[];
127
- /** Paths to exclude */
128
- excludePaths?: string[];
129
- /** Include binary file detection (default: true) */
130
- detectBinary?: boolean;
131
- /** Maximum file size to consider for rename/copy detection */
132
- maxRenameSize?: number;
133
- /** Whether to recurse into subdirectories (default: true) */
134
- recursive?: boolean;
135
- /** Only show names, not full diff info */
136
- nameOnly?: boolean;
137
- /** Show only file status, not diff content */
138
- nameStatus?: boolean;
139
- }
140
- /**
141
- * Result of a tree diff operation
142
- */
143
- export interface DiffResult {
144
- /** List of diff entries */
145
- entries: DiffEntry[];
146
- /** Statistics about the diff */
147
- stats: {
148
- added: number;
149
- deleted: number;
150
- modified: number;
151
- renamed: number;
152
- copied: number;
153
- };
154
- }
155
- /**
156
- * ObjectStore interface for tree diff operations.
157
- * Re-exported from storage types for convenience.
158
- */
159
- export type { ObjectStore };
160
- /**
161
- * Represents an index entry for diff-to-index operations
162
- */
163
- export interface IndexEntry {
164
- path: string;
165
- mode: string;
166
- sha: string;
167
- /** Stage number (0 = normal, 1-3 = merge conflict stages) */
168
- stage: number;
169
- /** File modification time */
170
- mtime?: number;
171
- /** File size */
172
- size?: number;
173
- }
174
- /**
175
- * Check if a file appears to be binary based on its content
176
- *
177
- * A file is considered binary if it contains null bytes in the first
178
- * 8000 bytes (similar to Git's heuristic).
179
- *
180
- * @param content - File content to check
181
- * @returns true if the file appears to be binary
182
- */
183
- export declare function isBinaryContent(content: Uint8Array): boolean;
184
- /**
185
- * Calculate similarity between two blobs for rename/copy detection
186
- *
187
- * Uses a simple heuristic based on shared content.
188
- *
189
- * @param store - Object store for retrieving blob contents
190
- * @param oldSha - SHA of the old blob
191
- * @param newSha - SHA of the new blob
192
- * @returns Promise resolving to similarity percentage (0-100)
193
- */
194
- export declare function calculateSimilarity(store: ObjectStore, oldSha: string, newSha: string): Promise<number>;
195
- /**
196
- * Parse a file mode string and determine its type
197
- *
198
- * @param mode - File mode string (e.g., '100644', '040000')
199
- * @returns Object with mode information
200
- */
201
- export declare function parseMode(mode: string): {
202
- isFile: boolean;
203
- isDirectory: boolean;
204
- isSymlink: boolean;
205
- isSubmodule: boolean;
206
- isExecutable: boolean;
207
- };
208
- /**
209
- * Check if a mode change represents a significant type change
210
- *
211
- * @param oldMode - Old file mode
212
- * @param newMode - New file mode
213
- * @returns true if the mode change is significant (e.g., file to symlink)
214
- */
215
- export declare function isModeChangeSignificant(oldMode: string, newMode: string): boolean;
216
- /**
217
- * Filter diff entries by pathspecs
218
- *
219
- * @param entries - Diff entries to filter
220
- * @param pathspecs - Glob patterns to include
221
- * @param excludePaths - Paths to exclude
222
- * @returns Filtered entries
223
- */
224
- export declare function filterByPathspecs(entries: DiffEntry[], pathspecs?: string[], excludePaths?: string[]): DiffEntry[];
225
- /**
226
- * Recursively walk a tree and collect all entries with full paths
227
- *
228
- * @param store - Object store for retrieving tree contents
229
- * @param treeSha - SHA of the tree to walk
230
- * @param prefix - Path prefix for entries
231
- * @returns Promise resolving to flat list of entries with full paths
232
- */
233
- export declare function walkTree(store: ObjectStore, treeSha: string, prefix?: string): Promise<Array<TreeEntry & {
234
- fullPath: string;
235
- }>>;
236
- /**
237
- * Compare two trees and return the differences
238
- *
239
- * @param store - Object store for retrieving tree contents
240
- * @param oldTreeSha - SHA of the old tree (null for initial commit comparison)
241
- * @param newTreeSha - SHA of the new tree (null to compare against empty)
242
- * @param options - Diff options
243
- * @returns Promise resolving to diff result
244
- */
245
- export declare function diffTrees(store: ObjectStore, oldTreeSha: string | null, newTreeSha: string | null, options?: DiffOptions): Promise<DiffResult>;
246
- /**
247
- * Detect renames in a set of diff entries
248
- *
249
- * This function takes a list of added and deleted files and attempts to
250
- * match them based on content similarity to detect renames.
251
- *
252
- * @param store - Object store for retrieving blob contents
253
- * @param entries - Initial diff entries (before rename detection)
254
- * @param options - Diff options (particularly similarityThreshold)
255
- * @returns Promise resolving to entries with renames detected
256
- */
257
- export declare function detectRenames(store: ObjectStore, entries: DiffEntry[], options?: DiffOptions): Promise<DiffEntry[]>;
258
- /**
259
- * Detect copies in a set of diff entries
260
- *
261
- * This function takes a list of diff entries and attempts to detect
262
- * if any added files are copies of existing files.
263
- *
264
- * @param store - Object store for retrieving blob contents
265
- * @param entries - Initial diff entries
266
- * @param existingPaths - Map of existing paths to their SHAs
267
- * @param options - Diff options
268
- * @returns Promise resolving to entries with copies detected
269
- */
270
- export declare function detectCopies(store: ObjectStore, entries: DiffEntry[], existingPaths: Map<string, string>, options?: DiffOptions): Promise<DiffEntry[]>;
271
- /**
272
- * Compare a tree to the index (staging area)
273
- *
274
- * @param store - Object store for retrieving tree contents
275
- * @param treeSha - SHA of the tree to compare (typically HEAD)
276
- * @param index - Index entries to compare against
277
- * @param options - Diff options
278
- * @returns Promise resolving to diff result
279
- */
280
- export declare function diffTreeToIndex(store: ObjectStore, treeSha: string | null, index: IndexEntry[], options?: DiffOptions): Promise<DiffResult>;
281
- /**
282
- * Compare a tree to working directory entries
283
- *
284
- * @param store - Object store for retrieving tree contents
285
- * @param treeSha - SHA of the tree to compare
286
- * @param workingEntries - Working directory file entries
287
- * @param options - Diff options
288
- * @returns Promise resolving to diff result
289
- */
290
- export declare function diffTreeToWorktree(store: ObjectStore, treeSha: string | null, workingEntries: IndexEntry[], options?: DiffOptions): Promise<DiffResult>;
291
- //# sourceMappingURL=tree-diff.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-diff.d.ts","sourceRoot":"","sources":["../../src/ops/tree-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE1E;;;;;;GAMG;AACH,oBAAY,UAAU;IACpB,qBAAqB;IACrB,KAAK,MAAM;IACX,uBAAuB;IACvB,OAAO,MAAM;IACb,wBAAwB;IACxB,QAAQ,MAAM;IACd,uBAAuB;IACvB,OAAO,MAAM;IACb,sBAAsB;IACtB,MAAM,MAAM;IACZ,gDAAgD;IAChD,YAAY,MAAM;IAClB,0BAA0B;IAC1B,QAAQ,MAAM;CACf;AAED;;GAEG;AACH,oBAAY,QAAQ;IAClB,oCAAoC;IACpC,OAAO,WAAW;IAClB,sBAAsB;IACtB,UAAU,WAAW;IACrB,oBAAoB;IACpB,OAAO,WAAW;IAClB,8BAA8B;IAC9B,OAAO,WAAW;IAClB,uBAAuB;IACvB,IAAI,WAAW;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,MAAM,EAAE,UAAU,CAAA;IAClB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,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