gitx.do 0.0.3 → 0.1.1

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 (231) hide show
  1. package/README.md +319 -92
  2. package/dist/cli/commands/add.d.ts +176 -0
  3. package/dist/cli/commands/add.d.ts.map +1 -0
  4. package/dist/cli/commands/add.js +979 -0
  5. package/dist/cli/commands/add.js.map +1 -0
  6. package/dist/cli/commands/blame.d.ts +1 -1
  7. package/dist/cli/commands/blame.d.ts.map +1 -1
  8. package/dist/cli/commands/blame.js +1 -1
  9. package/dist/cli/commands/blame.js.map +1 -1
  10. package/dist/cli/commands/branch.d.ts +1 -1
  11. package/dist/cli/commands/branch.d.ts.map +1 -1
  12. package/dist/cli/commands/branch.js +2 -2
  13. package/dist/cli/commands/branch.js.map +1 -1
  14. package/dist/cli/commands/checkout.d.ts +73 -0
  15. package/dist/cli/commands/checkout.d.ts.map +1 -0
  16. package/dist/cli/commands/checkout.js +725 -0
  17. package/dist/cli/commands/checkout.js.map +1 -0
  18. package/dist/cli/commands/commit.d.ts.map +1 -1
  19. package/dist/cli/commands/commit.js +22 -2
  20. package/dist/cli/commands/commit.js.map +1 -1
  21. package/dist/cli/commands/diff.d.ts +4 -4
  22. package/dist/cli/commands/diff.d.ts.map +1 -1
  23. package/dist/cli/commands/diff.js +9 -8
  24. package/dist/cli/commands/diff.js.map +1 -1
  25. package/dist/cli/commands/log.d.ts +1 -1
  26. package/dist/cli/commands/log.d.ts.map +1 -1
  27. package/dist/cli/commands/log.js +1 -1
  28. package/dist/cli/commands/log.js.map +1 -1
  29. package/dist/cli/commands/merge.d.ts +106 -0
  30. package/dist/cli/commands/merge.d.ts.map +1 -0
  31. package/dist/cli/commands/merge.js +852 -0
  32. package/dist/cli/commands/merge.js.map +1 -0
  33. package/dist/cli/commands/review.d.ts +1 -1
  34. package/dist/cli/commands/review.d.ts.map +1 -1
  35. package/dist/cli/commands/review.js +26 -1
  36. package/dist/cli/commands/review.js.map +1 -1
  37. package/dist/cli/commands/stash.d.ts +157 -0
  38. package/dist/cli/commands/stash.d.ts.map +1 -0
  39. package/dist/cli/commands/stash.js +655 -0
  40. package/dist/cli/commands/stash.js.map +1 -0
  41. package/dist/cli/commands/status.d.ts.map +1 -1
  42. package/dist/cli/commands/status.js +1 -2
  43. package/dist/cli/commands/status.js.map +1 -1
  44. package/dist/cli/commands/web.d.ts.map +1 -1
  45. package/dist/cli/commands/web.js +3 -2
  46. package/dist/cli/commands/web.js.map +1 -1
  47. package/dist/cli/fs-adapter.d.ts.map +1 -1
  48. package/dist/cli/fs-adapter.js +3 -5
  49. package/dist/cli/fs-adapter.js.map +1 -1
  50. package/dist/cli/fsx-cli-adapter.d.ts +359 -0
  51. package/dist/cli/fsx-cli-adapter.d.ts.map +1 -0
  52. package/dist/cli/fsx-cli-adapter.js +619 -0
  53. package/dist/cli/fsx-cli-adapter.js.map +1 -0
  54. package/dist/cli/index.d.ts.map +1 -1
  55. package/dist/cli/index.js +68 -12
  56. package/dist/cli/index.js.map +1 -1
  57. package/dist/cli/ui/components/DiffView.d.ts +7 -2
  58. package/dist/cli/ui/components/DiffView.d.ts.map +1 -1
  59. package/dist/cli/ui/components/DiffView.js.map +1 -1
  60. package/dist/cli/ui/components/ErrorDisplay.d.ts +6 -2
  61. package/dist/cli/ui/components/ErrorDisplay.d.ts.map +1 -1
  62. package/dist/cli/ui/components/ErrorDisplay.js.map +1 -1
  63. package/dist/cli/ui/components/FuzzySearch.d.ts +8 -2
  64. package/dist/cli/ui/components/FuzzySearch.d.ts.map +1 -1
  65. package/dist/cli/ui/components/FuzzySearch.js.map +1 -1
  66. package/dist/cli/ui/components/LoadingSpinner.d.ts +6 -2
  67. package/dist/cli/ui/components/LoadingSpinner.d.ts.map +1 -1
  68. package/dist/cli/ui/components/LoadingSpinner.js.map +1 -1
  69. package/dist/cli/ui/components/NavigationList.d.ts +7 -2
  70. package/dist/cli/ui/components/NavigationList.d.ts.map +1 -1
  71. package/dist/cli/ui/components/NavigationList.js.map +1 -1
  72. package/dist/cli/ui/components/ScrollableContent.d.ts +7 -2
  73. package/dist/cli/ui/components/ScrollableContent.d.ts.map +1 -1
  74. package/dist/cli/ui/components/ScrollableContent.js.map +1 -1
  75. package/dist/cli/ui/terminal-ui.d.ts +42 -9
  76. package/dist/cli/ui/terminal-ui.d.ts.map +1 -1
  77. package/dist/cli/ui/terminal-ui.js.map +1 -1
  78. package/dist/do/BashModule.d.ts +871 -0
  79. package/dist/do/BashModule.d.ts.map +1 -0
  80. package/dist/do/BashModule.js +1143 -0
  81. package/dist/do/BashModule.js.map +1 -0
  82. package/dist/do/FsModule.d.ts +612 -0
  83. package/dist/do/FsModule.d.ts.map +1 -0
  84. package/dist/do/FsModule.js +1120 -0
  85. package/dist/do/FsModule.js.map +1 -0
  86. package/dist/do/GitModule.d.ts +635 -0
  87. package/dist/do/GitModule.d.ts.map +1 -0
  88. package/dist/do/GitModule.js +784 -0
  89. package/dist/do/GitModule.js.map +1 -0
  90. package/dist/do/GitRepoDO.d.ts +281 -0
  91. package/dist/do/GitRepoDO.d.ts.map +1 -0
  92. package/dist/do/GitRepoDO.js +479 -0
  93. package/dist/do/GitRepoDO.js.map +1 -0
  94. package/dist/do/bash-ast.d.ts +246 -0
  95. package/dist/do/bash-ast.d.ts.map +1 -0
  96. package/dist/do/bash-ast.js +888 -0
  97. package/dist/do/bash-ast.js.map +1 -0
  98. package/dist/do/container-executor.d.ts +491 -0
  99. package/dist/do/container-executor.d.ts.map +1 -0
  100. package/dist/do/container-executor.js +731 -0
  101. package/dist/do/container-executor.js.map +1 -0
  102. package/dist/do/index.d.ts +53 -0
  103. package/dist/do/index.d.ts.map +1 -0
  104. package/dist/do/index.js +91 -0
  105. package/dist/do/index.js.map +1 -0
  106. package/dist/do/tiered-storage.d.ts +403 -0
  107. package/dist/do/tiered-storage.d.ts.map +1 -0
  108. package/dist/do/tiered-storage.js +689 -0
  109. package/dist/do/tiered-storage.js.map +1 -0
  110. package/dist/do/withBash.d.ts +231 -0
  111. package/dist/do/withBash.d.ts.map +1 -0
  112. package/dist/do/withBash.js +244 -0
  113. package/dist/do/withBash.js.map +1 -0
  114. package/dist/do/withFs.d.ts +237 -0
  115. package/dist/do/withFs.d.ts.map +1 -0
  116. package/dist/do/withFs.js +387 -0
  117. package/dist/do/withFs.js.map +1 -0
  118. package/dist/do/withGit.d.ts +180 -0
  119. package/dist/do/withGit.d.ts.map +1 -0
  120. package/dist/do/withGit.js +271 -0
  121. package/dist/do/withGit.js.map +1 -0
  122. package/dist/durable-object/object-store.d.ts +157 -15
  123. package/dist/durable-object/object-store.d.ts.map +1 -1
  124. package/dist/durable-object/object-store.js +435 -47
  125. package/dist/durable-object/object-store.js.map +1 -1
  126. package/dist/durable-object/schema.d.ts +12 -1
  127. package/dist/durable-object/schema.d.ts.map +1 -1
  128. package/dist/durable-object/schema.js +87 -2
  129. package/dist/durable-object/schema.js.map +1 -1
  130. package/dist/index.d.ts +84 -1
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +34 -0
  133. package/dist/index.js.map +1 -1
  134. package/dist/mcp/sandbox/miniflare-evaluator.d.ts +22 -0
  135. package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +1 -0
  136. package/dist/mcp/sandbox/miniflare-evaluator.js +140 -0
  137. package/dist/mcp/sandbox/miniflare-evaluator.js.map +1 -0
  138. package/dist/mcp/sandbox/object-store-proxy.d.ts +32 -0
  139. package/dist/mcp/sandbox/object-store-proxy.d.ts.map +1 -0
  140. package/dist/mcp/sandbox/object-store-proxy.js +30 -0
  141. package/dist/mcp/sandbox/object-store-proxy.js.map +1 -0
  142. package/dist/mcp/sandbox/template.d.ts +17 -0
  143. package/dist/mcp/sandbox/template.d.ts.map +1 -0
  144. package/dist/mcp/sandbox/template.js +71 -0
  145. package/dist/mcp/sandbox/template.js.map +1 -0
  146. package/dist/mcp/sandbox.d.ts.map +1 -1
  147. package/dist/mcp/sandbox.js +16 -4
  148. package/dist/mcp/sandbox.js.map +1 -1
  149. package/dist/mcp/tools/do.d.ts +32 -0
  150. package/dist/mcp/tools/do.d.ts.map +1 -0
  151. package/dist/mcp/tools/do.js +117 -0
  152. package/dist/mcp/tools/do.js.map +1 -0
  153. package/dist/mcp/tools.d.ts.map +1 -1
  154. package/dist/mcp/tools.js +1258 -22
  155. package/dist/mcp/tools.js.map +1 -1
  156. package/dist/pack/delta.d.ts +8 -0
  157. package/dist/pack/delta.d.ts.map +1 -1
  158. package/dist/pack/delta.js +241 -30
  159. package/dist/pack/delta.js.map +1 -1
  160. package/dist/refs/branch.d.ts +38 -25
  161. package/dist/refs/branch.d.ts.map +1 -1
  162. package/dist/refs/branch.js +421 -94
  163. package/dist/refs/branch.js.map +1 -1
  164. package/dist/refs/storage.d.ts +77 -5
  165. package/dist/refs/storage.d.ts.map +1 -1
  166. package/dist/refs/storage.js +193 -43
  167. package/dist/refs/storage.js.map +1 -1
  168. package/dist/refs/tag.d.ts +44 -24
  169. package/dist/refs/tag.d.ts.map +1 -1
  170. package/dist/refs/tag.js +411 -70
  171. package/dist/refs/tag.js.map +1 -1
  172. package/dist/storage/backend.d.ts +425 -0
  173. package/dist/storage/backend.d.ts.map +1 -0
  174. package/dist/storage/backend.js +41 -0
  175. package/dist/storage/backend.js.map +1 -0
  176. package/dist/storage/fsx-adapter.d.ts +204 -0
  177. package/dist/storage/fsx-adapter.d.ts.map +1 -0
  178. package/dist/storage/fsx-adapter.js +518 -0
  179. package/dist/storage/fsx-adapter.js.map +1 -0
  180. package/dist/storage/r2-pack.d.ts.map +1 -1
  181. package/dist/storage/r2-pack.js +4 -1
  182. package/dist/storage/r2-pack.js.map +1 -1
  183. package/dist/tiered/cdc-pipeline.js +3 -3
  184. package/dist/tiered/cdc-pipeline.js.map +1 -1
  185. package/dist/tiered/migration.d.ts.map +1 -1
  186. package/dist/tiered/migration.js +4 -1
  187. package/dist/tiered/migration.js.map +1 -1
  188. package/dist/types/capability.d.ts +1385 -0
  189. package/dist/types/capability.d.ts.map +1 -0
  190. package/dist/types/capability.js +36 -0
  191. package/dist/types/capability.js.map +1 -0
  192. package/dist/types/index.d.ts +13 -0
  193. package/dist/types/index.d.ts.map +1 -0
  194. package/dist/types/index.js +18 -0
  195. package/dist/types/index.js.map +1 -0
  196. package/dist/types/interfaces.d.ts +673 -0
  197. package/dist/types/interfaces.d.ts.map +1 -0
  198. package/dist/types/interfaces.js +26 -0
  199. package/dist/types/interfaces.js.map +1 -0
  200. package/dist/types/objects.d.ts +182 -0
  201. package/dist/types/objects.d.ts.map +1 -1
  202. package/dist/types/objects.js +249 -4
  203. package/dist/types/objects.js.map +1 -1
  204. package/dist/types/storage.d.ts +114 -0
  205. package/dist/types/storage.d.ts.map +1 -1
  206. package/dist/types/storage.js +160 -1
  207. package/dist/types/storage.js.map +1 -1
  208. package/dist/types/worker-loader.d.ts +60 -0
  209. package/dist/types/worker-loader.d.ts.map +1 -0
  210. package/dist/types/worker-loader.js +62 -0
  211. package/dist/types/worker-loader.js.map +1 -0
  212. package/dist/utils/hash.d.ts +126 -80
  213. package/dist/utils/hash.d.ts.map +1 -1
  214. package/dist/utils/hash.js +191 -100
  215. package/dist/utils/hash.js.map +1 -1
  216. package/dist/utils/sha1.d.ts +206 -0
  217. package/dist/utils/sha1.d.ts.map +1 -1
  218. package/dist/utils/sha1.js +405 -0
  219. package/dist/utils/sha1.js.map +1 -1
  220. package/dist/wire/path-security.d.ts +157 -0
  221. package/dist/wire/path-security.d.ts.map +1 -0
  222. package/dist/wire/path-security.js +307 -0
  223. package/dist/wire/path-security.js.map +1 -0
  224. package/dist/wire/receive-pack.d.ts +7 -0
  225. package/dist/wire/receive-pack.d.ts.map +1 -1
  226. package/dist/wire/receive-pack.js +29 -1
  227. package/dist/wire/receive-pack.js.map +1 -1
  228. package/dist/wire/upload-pack.d.ts.map +1 -1
  229. package/dist/wire/upload-pack.js +4 -1
  230. package/dist/wire/upload-pack.js.map +1 -1
  231. package/package.json +10 -1
@@ -0,0 +1,359 @@
1
+ /**
2
+ * @fileoverview FSx CLI Adapter for Git Repository Operations
3
+ *
4
+ * This module provides a CLI adapter that uses the FSxStorageAdapter for Git
5
+ * repository operations. It bridges the CLI interface (FSAdapter-compatible)
6
+ * with the fsx-backed storage, allowing the CLI to work with any fsx storage.
7
+ *
8
+ * **Features**:
9
+ * - Compatible with FSAdapter interface from fs-adapter.ts
10
+ * - Uses FSxStorageAdapter for underlying storage operations
11
+ * - Provides object retrieval, ref resolution, and listing operations
12
+ * - Handles both loose objects and references
13
+ *
14
+ * **Note**: Pack file operations are not implemented as fsx uses CAS storage.
15
+ * For pack file reading, use the standard fs-adapter.ts instead.
16
+ *
17
+ * @module cli/fsx-cli-adapter
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { createFSxCLIAdapter } from './fsx-cli-adapter'
22
+ *
23
+ * const adapter = await createFSxCLIAdapter('/path/to/repo')
24
+ * const head = await adapter.getHead()
25
+ * const commit = await adapter.getObject(head.target)
26
+ * ```
27
+ */
28
+ import type { ObjectType } from '../types/objects';
29
+ /**
30
+ * Type of git reference.
31
+ */
32
+ export type FSRefType = 'direct' | 'symbolic';
33
+ /**
34
+ * A git reference.
35
+ */
36
+ export interface FSRef {
37
+ /** Full ref name (e.g., 'refs/heads/main') */
38
+ name: string;
39
+ /** Target - SHA (direct) or ref name (symbolic) */
40
+ target: string;
41
+ /** Type of reference */
42
+ type: FSRefType;
43
+ }
44
+ /**
45
+ * A stored git object with metadata.
46
+ */
47
+ export interface FSObject {
48
+ /** SHA-1 hash of the object */
49
+ sha: string;
50
+ /** Object type: blob, tree, commit, tag */
51
+ type: ObjectType;
52
+ /** Size of the object data in bytes */
53
+ size: number;
54
+ /** Raw object data (uncompressed) */
55
+ data: Uint8Array;
56
+ /** Source location: 'loose' or 'pack' */
57
+ source: 'loose' | 'pack';
58
+ /** If from a pack, the pack file name */
59
+ packFile?: string;
60
+ }
61
+ /**
62
+ * Resolved reference with SHA.
63
+ */
64
+ export interface FSResolvedRef {
65
+ /** The original ref */
66
+ ref: FSRef;
67
+ /** Final SHA after resolving symbolic refs */
68
+ sha: string;
69
+ /** Chain of refs followed */
70
+ chain: FSRef[];
71
+ }
72
+ /**
73
+ * A single entry in the git index (staging area).
74
+ */
75
+ export interface IndexEntry {
76
+ /** File path relative to repo root */
77
+ path: string;
78
+ /** SHA of the blob */
79
+ sha: string;
80
+ /** File mode */
81
+ mode: number;
82
+ /** File size */
83
+ size: number;
84
+ /** Modification time */
85
+ mtime: Date;
86
+ /** Creation time */
87
+ ctime: Date;
88
+ /** Stage number (0 for normal, 1-3 for conflicts) */
89
+ stage: number;
90
+ /** Various flags */
91
+ flags: {
92
+ assumeValid: boolean;
93
+ extended: boolean;
94
+ skipWorktree: boolean;
95
+ intentToAdd: boolean;
96
+ };
97
+ }
98
+ /**
99
+ * Tree entry from a tree object.
100
+ */
101
+ export interface TreeEntry {
102
+ /** File/directory mode */
103
+ mode: number;
104
+ /** Name of the entry */
105
+ name: string;
106
+ /** SHA-1 hash of the referenced object */
107
+ sha: string;
108
+ /** Whether this is a tree (directory) or blob (file) */
109
+ type: 'tree' | 'blob';
110
+ }
111
+ /**
112
+ * Parsed commit object.
113
+ */
114
+ export interface ParsedCommit {
115
+ /** Tree SHA referenced by this commit */
116
+ tree: string;
117
+ /** Parent commit SHAs */
118
+ parents: string[];
119
+ /** Author information */
120
+ author: {
121
+ name: string;
122
+ email: string;
123
+ timestamp: number;
124
+ timezone: string;
125
+ };
126
+ /** Committer information */
127
+ committer: {
128
+ name: string;
129
+ email: string;
130
+ timestamp: number;
131
+ timezone: string;
132
+ };
133
+ /** Commit message */
134
+ message: string;
135
+ /** GPG signature if present */
136
+ gpgSig?: string;
137
+ }
138
+ /**
139
+ * Error codes for FSx CLI adapter operations.
140
+ */
141
+ export type FSxCLIAdapterErrorCode = 'NOT_A_GIT_REPO' | 'OBJECT_NOT_FOUND' | 'REF_NOT_FOUND' | 'CORRUPT_OBJECT' | 'INVALID_SHA' | 'READ_ERROR' | 'NOT_IMPLEMENTED';
142
+ /**
143
+ * Error thrown by FSx CLI adapter operations.
144
+ */
145
+ export declare class FSxCLIAdapterError extends Error {
146
+ readonly code: FSxCLIAdapterErrorCode;
147
+ readonly path?: string | undefined;
148
+ constructor(message: string, code: FSxCLIAdapterErrorCode, path?: string | undefined);
149
+ }
150
+ /**
151
+ * CLI adapter that uses fsx for Git repository operations.
152
+ *
153
+ * @description
154
+ * This adapter wraps FSxStorageAdapter to provide a CLI-friendly interface
155
+ * compatible with the FSAdapter interface from fs-adapter.ts. It allows
156
+ * the CLI to work with any fsx-backed storage.
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * const adapter = await createFSxCLIAdapter('/path/to/repo')
161
+ *
162
+ * // Get HEAD reference
163
+ * const head = await adapter.getHead()
164
+ *
165
+ * // Resolve to SHA
166
+ * const resolved = await adapter.resolveRef('HEAD')
167
+ * console.log(`Current commit: ${resolved.sha}`)
168
+ *
169
+ * // Get commit object
170
+ * const commit = await adapter.getCommit(resolved.sha)
171
+ * console.log(`Message: ${commit.message}`)
172
+ * ```
173
+ */
174
+ export declare class FSxCLIAdapter {
175
+ private backend;
176
+ private gitDir;
177
+ private repoPath;
178
+ /**
179
+ * Create a new FSxCLIAdapter.
180
+ *
181
+ * @param repoPath - Path to the repository root
182
+ * @param options - Optional configuration
183
+ */
184
+ constructor(repoPath: string, options?: {
185
+ gitDir?: string;
186
+ });
187
+ /**
188
+ * Get a git object by its SHA.
189
+ *
190
+ * @param sha - 40-character SHA-1 hash
191
+ * @returns The object if found, null otherwise
192
+ */
193
+ getObject(sha: string): Promise<FSObject | null>;
194
+ /**
195
+ * Check if an object exists.
196
+ *
197
+ * @param sha - 40-character SHA-1 hash
198
+ * @returns true if the object exists
199
+ */
200
+ hasObject(sha: string): Promise<boolean>;
201
+ /**
202
+ * Get object type without loading full data.
203
+ *
204
+ * @param sha - 40-character SHA-1 hash
205
+ * @returns The object type if found, null otherwise
206
+ */
207
+ getObjectType(sha: string): Promise<ObjectType | null>;
208
+ /**
209
+ * Get object size without loading full data.
210
+ *
211
+ * @param sha - 40-character SHA-1 hash
212
+ * @returns The object size in bytes if found, null otherwise
213
+ */
214
+ getObjectSize(sha: string): Promise<number | null>;
215
+ /**
216
+ * Read a blob object's content.
217
+ *
218
+ * @param sha - 40-character SHA-1 hash of a blob
219
+ * @returns The blob content as Uint8Array
220
+ */
221
+ readBlob(sha: string): Promise<Uint8Array>;
222
+ /**
223
+ * Read a tree object's entries.
224
+ *
225
+ * @param sha - 40-character SHA-1 hash of a tree
226
+ * @returns Array of tree entries
227
+ */
228
+ readTree(sha: string): Promise<TreeEntry[]>;
229
+ /**
230
+ * Get a parsed commit object.
231
+ *
232
+ * @param sha - 40-character SHA-1 hash of a commit
233
+ * @returns Parsed commit object
234
+ */
235
+ getCommit(sha: string): Promise<ParsedCommit>;
236
+ /**
237
+ * Get HEAD reference.
238
+ *
239
+ * @returns HEAD reference (symbolic or direct), or null if not found
240
+ */
241
+ getHead(): Promise<FSRef | null>;
242
+ /**
243
+ * Get a reference by name.
244
+ *
245
+ * @param name - Full ref name (e.g., 'refs/heads/main', 'HEAD')
246
+ * @returns The ref if found, null otherwise
247
+ */
248
+ getRef(name: string): Promise<FSRef | null>;
249
+ /**
250
+ * Resolve a reference to its final SHA.
251
+ *
252
+ * @param name - Ref name to resolve
253
+ * @returns Resolved ref with SHA and resolution chain, or null if not found
254
+ */
255
+ resolveRef(name: string): Promise<FSResolvedRef | null>;
256
+ /**
257
+ * Check if HEAD is detached (pointing directly to a SHA).
258
+ *
259
+ * @returns true if HEAD points directly to a SHA
260
+ */
261
+ isHeadDetached(): Promise<boolean>;
262
+ /**
263
+ * List all branches.
264
+ *
265
+ * @returns Array of branch names (without 'refs/heads/' prefix)
266
+ */
267
+ listBranches(): Promise<string[]>;
268
+ /**
269
+ * List all tags.
270
+ *
271
+ * @returns Array of tag names (without 'refs/tags/' prefix)
272
+ */
273
+ listTags(): Promise<string[]>;
274
+ /**
275
+ * List all refs matching an optional prefix.
276
+ *
277
+ * @param prefix - Optional prefix to filter refs
278
+ * @returns Array of refs
279
+ */
280
+ listRefs(prefix?: string): Promise<FSRef[]>;
281
+ /**
282
+ * Get the repository path.
283
+ */
284
+ getRepoPath(): string;
285
+ /**
286
+ * Get the git directory path.
287
+ */
288
+ getGitDir(): string;
289
+ /**
290
+ * Check if this is a valid git repository.
291
+ *
292
+ * @returns true if valid git repository structure exists
293
+ */
294
+ isGitRepository(): Promise<boolean>;
295
+ /**
296
+ * Get repository description.
297
+ *
298
+ * @returns Contents of .git/description file, or null
299
+ */
300
+ getDescription(): Promise<string | null>;
301
+ /**
302
+ * Get index entries.
303
+ *
304
+ * @description Index operations are not implemented in the fsx adapter.
305
+ * Use the standard fs-adapter for index operations.
306
+ */
307
+ getIndexEntries(): Promise<IndexEntry[]>;
308
+ /**
309
+ * List pack files.
310
+ *
311
+ * @description Pack file operations are not implemented in the fsx adapter.
312
+ * fsx uses CAS storage instead of pack files.
313
+ */
314
+ listPackFiles(): Promise<string[]>;
315
+ }
316
+ /**
317
+ * Check if a directory is a git repository.
318
+ *
319
+ * @description Validates whether the given path is a valid git repository
320
+ * by checking for the presence of .git directory and required git files.
321
+ *
322
+ * @param repoPath - Path to check
323
+ * @returns true if the path is a valid git repository
324
+ *
325
+ * @example
326
+ * ```typescript
327
+ * if (await isGitRepository('/path/to/repo')) {
328
+ * console.log('Valid git repository')
329
+ * }
330
+ * ```
331
+ */
332
+ export declare function isGitRepository(repoPath: string): Promise<boolean>;
333
+ /**
334
+ * Create an FSx CLI adapter for a local git repository.
335
+ *
336
+ * @description Factory function that creates an FSxCLIAdapter for a git repository.
337
+ * Uses fsx storage backend for all operations.
338
+ *
339
+ * @param repoPath - Path to the repository root
340
+ * @param options - Optional configuration
341
+ * @returns A fully initialized FSxCLIAdapter instance
342
+ *
343
+ * @throws {FSxCLIAdapterError} With code 'NOT_A_GIT_REPO' if the path is not a valid git repository
344
+ *
345
+ * @example
346
+ * ```typescript
347
+ * // Create adapter for a regular repository
348
+ * const adapter = await createFSxCLIAdapter('/path/to/repo')
349
+ *
350
+ * // Create adapter with custom git directory
351
+ * const adapter = await createFSxCLIAdapter('/path/to/repo', {
352
+ * gitDir: '/path/to/custom/.git'
353
+ * })
354
+ * ```
355
+ */
356
+ export declare function createFSxCLIAdapter(repoPath: string, options?: {
357
+ gitDir?: string;
358
+ }): Promise<FSxCLIAdapter>;
359
+ //# sourceMappingURL=fsx-cli-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsx-cli-adapter.d.ts","sourceRoot":"","sources":["../../src/cli/fsx-cli-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE7C;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,wBAAwB;IACxB,IAAI,EAAE,SAAS,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,2CAA2C;IAC3C,IAAI,EAAE,UAAU,CAAA;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,IAAI,EAAE,UAAU,CAAA;IAChB,yCAAyC;IACzC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uBAAuB;IACvB,GAAG,EAAE,KAAK,CAAA;IACV,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAA;IACX,6BAA6B;IAC7B,KAAK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