@catamorphic/git 0.0.0-stage → 0.1.0-alpha.30
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.
- package/LICENSE.txt +202 -0
- package/NOTICE.txt +32 -0
- package/dist/checkout-remote-backend.d.ts +12 -0
- package/dist/checkout-remote-backend.d.ts.map +1 -0
- package/dist/file-reads.d.ts +15 -0
- package/dist/file-reads.d.ts.map +1 -0
- package/dist/fs-backend.d.ts +30 -0
- package/dist/fs-backend.d.ts.map +1 -0
- package/dist/fs-remote-backend.d.ts +47 -0
- package/dist/fs-remote-backend.d.ts.map +1 -0
- package/dist/git-object-codec.d.ts +31 -0
- package/dist/git-object-codec.d.ts.map +1 -0
- package/dist/git-sync.d.ts +61 -0
- package/dist/git-sync.d.ts.map +1 -0
- package/dist/in-memory-object-store.d.ts +23 -0
- package/dist/in-memory-object-store.d.ts.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4746 -0
- package/dist/index.js.map +32 -0
- package/dist/migrate-workflow.d.ts +12 -0
- package/dist/migrate-workflow.d.ts.map +1 -0
- package/dist/native-git.d.ts +25 -0
- package/dist/native-git.d.ts.map +1 -0
- package/dist/native-project-repo.d.ts +57 -0
- package/dist/native-project-repo.d.ts.map +1 -0
- package/dist/network-sync.d.ts +58 -0
- package/dist/network-sync.d.ts.map +1 -0
- package/dist/network.d.ts +81 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/object-remote-backend.d.ts +95 -0
- package/dist/object-remote-backend.d.ts.map +1 -0
- package/dist/object-store.d.ts +42 -0
- package/dist/object-store.d.ts.map +1 -0
- package/dist/origin-draft.d.ts +264 -0
- package/dist/origin-draft.d.ts.map +1 -0
- package/dist/origin-objects.d.ts +201 -0
- package/dist/origin-objects.d.ts.map +1 -0
- package/dist/personal-files.d.ts +6 -0
- package/dist/personal-files.d.ts.map +1 -0
- package/dist/project-manager.d.ts +214 -0
- package/dist/project-manager.d.ts.map +1 -0
- package/dist/project-repo.d.ts +79 -0
- package/dist/project-repo.d.ts.map +1 -0
- package/dist/ref-moved-error.d.ts +13 -0
- package/dist/ref-moved-error.d.ts.map +1 -0
- package/dist/ref-names.d.ts +18 -0
- package/dist/ref-names.d.ts.map +1 -0
- package/dist/types.d.ts +276 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/workspace-mirror.d.ts +110 -0
- package/dist/workspace-mirror.d.ts.map +1 -0
- package/package.json +53 -4
- package/src/checkout-remote-backend.ts +154 -0
- package/src/diff3.d.ts +16 -0
- package/src/file-reads.ts +53 -0
- package/src/fs-backend.ts +206 -0
- package/src/fs-remote-backend.ts +252 -0
- package/src/git-object-codec.ts +87 -0
- package/src/git-sync.ts +539 -0
- package/src/in-memory-object-store.ts +60 -0
- package/src/index.ts +110 -0
- package/src/migrate-workflow.ts +30 -0
- package/src/native-git.ts +177 -0
- package/src/native-project-repo.ts +515 -0
- package/src/network-sync.ts +239 -0
- package/src/network.ts +269 -0
- package/src/object-remote-backend.ts +366 -0
- package/src/object-store.ts +41 -0
- package/src/origin-draft.ts +1033 -0
- package/src/origin-objects.ts +906 -0
- package/src/personal-files.ts +57 -0
- package/src/project-manager.ts +743 -0
- package/src/project-repo.ts +800 -0
- package/src/ref-moved-error.ts +18 -0
- package/src/ref-names.ts +47 -0
- package/src/types.ts +289 -0
- package/src/workspace-mirror.ts +400 -0
- package/README.md +0 -3
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { type FileReadOptions } from "./file-reads.js";
|
|
2
|
+
import { type GitObjectCache } from "./origin-objects.js";
|
|
3
|
+
import type { CommitInfo, ConflictEntry, DiffEntry, MergeResult, ProjectRepo, RemoteBackend, RepoStatus } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* A member's draft as {@link ProjectManager.openDraft} returns it: a local
|
|
6
|
+
* folder's checkout, or a draft ref in a server-hosted project's origin.
|
|
7
|
+
*/
|
|
8
|
+
export type ProjectDraft = ProjectRepo | OriginDraftRepo;
|
|
9
|
+
/** One change to a draft: new content, or `delete: true`. */
|
|
10
|
+
export type DraftChange = {
|
|
11
|
+
path: string;
|
|
12
|
+
content: string | Uint8Array;
|
|
13
|
+
} | {
|
|
14
|
+
path: string;
|
|
15
|
+
delete: true;
|
|
16
|
+
};
|
|
17
|
+
export type DraftPublishResult = {
|
|
18
|
+
status: "deployed";
|
|
19
|
+
commitSha: string;
|
|
20
|
+
remoteSha: string;
|
|
21
|
+
conflicts: ConflictEntry[];
|
|
22
|
+
} | {
|
|
23
|
+
status: "nothing-to-deploy";
|
|
24
|
+
commitSha: null;
|
|
25
|
+
remoteSha: string | null;
|
|
26
|
+
conflicts: ConflictEntry[];
|
|
27
|
+
} | {
|
|
28
|
+
status: "conflict";
|
|
29
|
+
commitSha: string;
|
|
30
|
+
remoteSha: string;
|
|
31
|
+
conflicts: ConflictEntry[];
|
|
32
|
+
};
|
|
33
|
+
/** Every attempt to move a ref lost its race to another writer. */
|
|
34
|
+
export declare class DraftBusyError extends Error {
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
37
|
+
/** A file no longer holds the content a write expected. */
|
|
38
|
+
export declare class DraftContentChangedError extends Error {
|
|
39
|
+
constructor(path: string);
|
|
40
|
+
}
|
|
41
|
+
/** A ref that a member's draft may not read (another member's draft). */
|
|
42
|
+
export declare class DraftRefNotAllowedError extends Error {
|
|
43
|
+
constructor(ref: string);
|
|
44
|
+
}
|
|
45
|
+
/** A `base` that is not a commit of the published program. */
|
|
46
|
+
export declare class InvalidBaseError extends Error {
|
|
47
|
+
constructor(base: string);
|
|
48
|
+
}
|
|
49
|
+
/** A read-only view (no member) asked to change a draft. */
|
|
50
|
+
export declare class NoDraftError extends Error {
|
|
51
|
+
constructor();
|
|
52
|
+
}
|
|
53
|
+
/** The conflicts a merge left without a resolution. */
|
|
54
|
+
export declare class DraftUnresolvedError extends Error {
|
|
55
|
+
readonly conflicts: ConflictEntry[];
|
|
56
|
+
constructor(conflicts: ConflictEntry[]);
|
|
57
|
+
}
|
|
58
|
+
/** An origin that cannot keep drafts safely (ADR 0191). */
|
|
59
|
+
export declare class DraftsUnsupportedError extends Error {
|
|
60
|
+
constructor(reason: string);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A member's draft of a server-hosted project's program (ADR 0191): the ref
|
|
64
|
+
* `refs/work/drafts/<member>` in the project's origin, read and written as
|
|
65
|
+
* objects with no working copy on any machine. Without that ref the draft
|
|
66
|
+
* is the published `main`. Every write is a draft commit moved in with a
|
|
67
|
+
* compare-and-swap, so any replica sees every earlier write and nothing is
|
|
68
|
+
* lost when one restarts. Publishing squashes the draft into one commit on
|
|
69
|
+
* `main`, merging in memory with a `main` that moved since the draft began.
|
|
70
|
+
*
|
|
71
|
+
* Reads of `HEAD` within one open see one commit (the one the first read
|
|
72
|
+
* found, or the latest write through this instance), so several files read
|
|
73
|
+
* together always come from the same snapshot. Reads accept `HEAD`, `main`
|
|
74
|
+
* and published refs, other published branches, and commit ids reachable
|
|
75
|
+
* from those or from the member's own draft; never another member's draft
|
|
76
|
+
* or a session branch, by any spelling or case.
|
|
77
|
+
*
|
|
78
|
+
* Without a member (`externalUserId: null`) it is a read-only view of the
|
|
79
|
+
* published program.
|
|
80
|
+
*/
|
|
81
|
+
export declare class OriginDraftRepo {
|
|
82
|
+
readonly projectId: string;
|
|
83
|
+
/** The draft's ref in the origin, or null for a read-only view. */
|
|
84
|
+
readonly ref: string | null;
|
|
85
|
+
private readonly tenantId;
|
|
86
|
+
private readonly remote;
|
|
87
|
+
private readonly cache;
|
|
88
|
+
private readonly author;
|
|
89
|
+
/** The commit `HEAD` reads see; resolved on first use. */
|
|
90
|
+
private head;
|
|
91
|
+
/** Commit ids this instance proved readable. */
|
|
92
|
+
private readonly readable;
|
|
93
|
+
constructor(args: {
|
|
94
|
+
tenantId: string;
|
|
95
|
+
projectId: string;
|
|
96
|
+
externalUserId: string | null;
|
|
97
|
+
remote: RemoteBackend;
|
|
98
|
+
cache: GitObjectCache;
|
|
99
|
+
/** Author of draft commits; publishing records the publisher. */
|
|
100
|
+
author?: {
|
|
101
|
+
name: string;
|
|
102
|
+
email: string;
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
private withObjects;
|
|
106
|
+
/**
|
|
107
|
+
* Run one compare-and-swap attempt; a lost race (inside the attempt, or
|
|
108
|
+
* reported by the origin when it publishes the ref) yields null.
|
|
109
|
+
*/
|
|
110
|
+
private attempt;
|
|
111
|
+
private tips;
|
|
112
|
+
/** This member's draft ref; a read-only view has none to change. */
|
|
113
|
+
private draftRefOrThrow;
|
|
114
|
+
/**
|
|
115
|
+
* Whether a commit id may be read here: reachable from `main`, from this
|
|
116
|
+
* member's draft, or from a published branch this member may name. Ids
|
|
117
|
+
* of other members' drafts or of sessions are not capabilities.
|
|
118
|
+
*/
|
|
119
|
+
private mayReadCommit;
|
|
120
|
+
/**
|
|
121
|
+
* The commit a ref names, as this member may read it. Every name is
|
|
122
|
+
* checked against git's ref rules first, then the full ref it maps to
|
|
123
|
+
* against the private namespaces, so no spelling reaches another
|
|
124
|
+
* member's draft or a session's branch.
|
|
125
|
+
*/
|
|
126
|
+
private resolveIn;
|
|
127
|
+
private treeAt;
|
|
128
|
+
resolveRef(ref?: string): Promise<string>;
|
|
129
|
+
readFileBytes(filePath: string): Promise<Uint8Array | null>;
|
|
130
|
+
readFile(filePath: string): Promise<string>;
|
|
131
|
+
listFiles(opts?: {
|
|
132
|
+
prefix?: string;
|
|
133
|
+
}): Promise<string[]>;
|
|
134
|
+
readAllFiles(options?: FileReadOptions): Promise<Record<string, string>>;
|
|
135
|
+
listBlobsAtRef(ref: string, opts?: {
|
|
136
|
+
prefix?: string;
|
|
137
|
+
}): Promise<Array<{
|
|
138
|
+
path: string;
|
|
139
|
+
oid: string;
|
|
140
|
+
}>>;
|
|
141
|
+
listFilesAtRef(ref: string, opts?: {
|
|
142
|
+
prefix?: string;
|
|
143
|
+
}): Promise<string[]>;
|
|
144
|
+
readBlobAtRef(ref: string, filePath: string, options?: {
|
|
145
|
+
maxBytes?: number;
|
|
146
|
+
}): Promise<Uint8Array | null>;
|
|
147
|
+
readAllFilesAtRef(ref: string, options?: FileReadOptions): Promise<Record<string, string>>;
|
|
148
|
+
readFilesAtRef(ref: string, opts: {
|
|
149
|
+
prefix: string;
|
|
150
|
+
}): Promise<Record<string, string>>;
|
|
151
|
+
private snapshotAt;
|
|
152
|
+
writeFile(filePath: string, content: string, opts?: {
|
|
153
|
+
message?: string;
|
|
154
|
+
}): Promise<void>;
|
|
155
|
+
deleteFile(filePath: string, opts?: {
|
|
156
|
+
message?: string;
|
|
157
|
+
}): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Apply changes as one draft commit, starting the draft from `main` when
|
|
160
|
+
* the member has none. File contents are written to the origin once; a
|
|
161
|
+
* write that loses the race to another writer of the same draft rebuilds
|
|
162
|
+
* only its trees on the winner and retries. Returns the draft's tip,
|
|
163
|
+
* unchanged when the changes change nothing.
|
|
164
|
+
*
|
|
165
|
+
* Paths the project's ignore rules keep out of history are refused, or
|
|
166
|
+
* dropped with `skipIgnored`; with `skipMissingDeletes`, deleting a file
|
|
167
|
+
* the draft lacks is not an error (a sandbox sync reporting a file it
|
|
168
|
+
* made and removed again).
|
|
169
|
+
*/
|
|
170
|
+
write(input: {
|
|
171
|
+
changes: readonly DraftChange[];
|
|
172
|
+
message?: string;
|
|
173
|
+
/**
|
|
174
|
+
* The content each path must still have, checked against the commit
|
|
175
|
+
* the write builds on; a mismatch throws {@link DraftContentChangedError}.
|
|
176
|
+
*/
|
|
177
|
+
expected?: Record<string, string>;
|
|
178
|
+
skipIgnored?: boolean;
|
|
179
|
+
skipMissingDeletes?: boolean;
|
|
180
|
+
}): Promise<string | null>;
|
|
181
|
+
log(options?: {
|
|
182
|
+
maxCount?: number;
|
|
183
|
+
ref?: string;
|
|
184
|
+
}): Promise<CommitInfo[]>;
|
|
185
|
+
/**
|
|
186
|
+
* What the draft would publish: the files it changes since it last met
|
|
187
|
+
* `main`, its commits, and how far `main` has moved since. A draft with
|
|
188
|
+
* no changes is clean.
|
|
189
|
+
*/
|
|
190
|
+
status(): Promise<RepoStatus>;
|
|
191
|
+
/** The draft's changes since it last met `main`, with contents. */
|
|
192
|
+
workdirDiff(): Promise<DiffEntry[]>;
|
|
193
|
+
diff(opts: {
|
|
194
|
+
base: string;
|
|
195
|
+
head: string;
|
|
196
|
+
}): Promise<DiffEntry[]>;
|
|
197
|
+
/** Delete the draft: the member's view follows `main` again. */
|
|
198
|
+
discard(): Promise<boolean>;
|
|
199
|
+
/**
|
|
200
|
+
* Publish the draft as one commit on `main` with `message`, then delete
|
|
201
|
+
* it. When `main` moved since the draft began, the two merge in memory
|
|
202
|
+
* first; a conflict publishes nothing and reports the conflicted files. A
|
|
203
|
+
* draft whose merge leaves `main` as it is publishes nothing. `guard`
|
|
204
|
+
* sees every path the commit changes against `main` and throws to refuse.
|
|
205
|
+
*/
|
|
206
|
+
publish(input: {
|
|
207
|
+
message: string;
|
|
208
|
+
author: {
|
|
209
|
+
name: string;
|
|
210
|
+
email: string;
|
|
211
|
+
};
|
|
212
|
+
guard?: (paths: readonly string[]) => void;
|
|
213
|
+
}): Promise<DraftPublishResult>;
|
|
214
|
+
/**
|
|
215
|
+
* Bring what others published into the draft. A draft without changes
|
|
216
|
+
* simply follows `main` again; one with changes gets a merge commit, or
|
|
217
|
+
* the conflicted files when the two cannot be merged (nothing moves).
|
|
218
|
+
*/
|
|
219
|
+
pull(): Promise<MergeResult>;
|
|
220
|
+
/**
|
|
221
|
+
* Merge `main` into the draft with the member's resolutions for the
|
|
222
|
+
* conflicted files, as one draft commit.
|
|
223
|
+
*/
|
|
224
|
+
resolveConflicts(input: {
|
|
225
|
+
resolutions: Record<string, string>;
|
|
226
|
+
message: string;
|
|
227
|
+
}): Promise<string>;
|
|
228
|
+
private mergeMain;
|
|
229
|
+
dispose(): Promise<void>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Publish files as one commit on top of `main`, without touching any
|
|
233
|
+
* member's draft (the desktop's publish of a member's local copy). With
|
|
234
|
+
* `base`, the commit the files were edited from, they merge with what was
|
|
235
|
+
* published since, and files changed on both sides are reported as
|
|
236
|
+
* conflicts instead of overwriting. A race with another publisher retries
|
|
237
|
+
* on the new `main`.
|
|
238
|
+
*/
|
|
239
|
+
export declare function publishFilesToOrigin(input: {
|
|
240
|
+
remote: RemoteBackend;
|
|
241
|
+
cache: GitObjectCache;
|
|
242
|
+
tenantId: string;
|
|
243
|
+
projectId: string;
|
|
244
|
+
files: Record<string, string>;
|
|
245
|
+
base?: string;
|
|
246
|
+
message: string;
|
|
247
|
+
author: {
|
|
248
|
+
name: string;
|
|
249
|
+
email: string;
|
|
250
|
+
};
|
|
251
|
+
guard?: (paths: readonly string[]) => void;
|
|
252
|
+
}): Promise<DraftPublishResult>;
|
|
253
|
+
/**
|
|
254
|
+
* The published commit of `branch` as `repo` reads it: straight from the
|
|
255
|
+
* origin for a draft, after fetching it into a checkout otherwise.
|
|
256
|
+
*/
|
|
257
|
+
export declare function refreshPublished(input: {
|
|
258
|
+
repo: ProjectRepo | OriginDraftRepo;
|
|
259
|
+
remote: RemoteBackend;
|
|
260
|
+
tenantId: string;
|
|
261
|
+
projectId: string;
|
|
262
|
+
branch?: string;
|
|
263
|
+
}): Promise<string | null>;
|
|
264
|
+
//# sourceMappingURL=origin-draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin-draft.d.ts","sourceRoot":"","sources":["../src/origin-draft.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAGL,KAAK,cAAc,EAOpB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACX,MAAM,YAAY,CAAC;AAUpB;;;GA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
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { type Ignore } from "ignore";
|
|
2
|
+
import { type GitObjectType, type ParsedCommit } from "./git-object-codec.js";
|
|
3
|
+
import type { ConflictEntry, OriginRepo } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Object-level reads and writes against a project's origin, with no working
|
|
6
|
+
* copy (ADR 0191): trees are walked, rebuilt, and merged in memory, and new
|
|
7
|
+
* blobs, trees, and commits are written straight to the origin. Git objects
|
|
8
|
+
* are immutable, so every read may go through a process-wide cache keyed by
|
|
9
|
+
* origin and object id, which is safe to lose.
|
|
10
|
+
*/
|
|
11
|
+
export interface TreeEntry {
|
|
12
|
+
mode: string;
|
|
13
|
+
/** The name as text, for matching paths. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** The name exactly as stored, so names that are not UTF-8 survive. */
|
|
16
|
+
nameBytes: Uint8Array;
|
|
17
|
+
oid: string;
|
|
18
|
+
}
|
|
19
|
+
/** A file in a tree: its blob id and mode (`100644`, `100755`, `120000`). */
|
|
20
|
+
export interface TreeFile {
|
|
21
|
+
oid: string;
|
|
22
|
+
mode: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One change to apply to a tree: a blob already written (keeping the old
|
|
26
|
+
* entry's mode unless one is given), or `null` to delete.
|
|
27
|
+
*/
|
|
28
|
+
export type TreeChange = {
|
|
29
|
+
oid: string;
|
|
30
|
+
mode?: string;
|
|
31
|
+
} | null;
|
|
32
|
+
export declare const EMPTY_TREE_ID = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
33
|
+
export declare const SYMLINK_MODE = "120000";
|
|
34
|
+
export declare function isTreeMode(mode: string): boolean;
|
|
35
|
+
/** An error with a Node-style `code`, as filesystem-backed repos throw. */
|
|
36
|
+
export declare class DraftPathError extends Error {
|
|
37
|
+
readonly code: "ENOENT" | "ENOTDIR" | "EISDIR" | "ELOOP";
|
|
38
|
+
constructor(input: {
|
|
39
|
+
code: "ENOENT" | "ENOTDIR" | "EISDIR" | "ELOOP";
|
|
40
|
+
path: string;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Paths the project's ignore rules keep out of its history. */
|
|
44
|
+
export declare class DraftIgnoredPathError extends Error {
|
|
45
|
+
readonly paths: readonly string[];
|
|
46
|
+
constructor(paths: readonly string[]);
|
|
47
|
+
}
|
|
48
|
+
/** A text resolution offered for a file that is not text. */
|
|
49
|
+
export declare class DraftBinaryResolutionError extends Error {
|
|
50
|
+
readonly paths: readonly string[];
|
|
51
|
+
constructor(paths: readonly string[]);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Immutable objects read from origins, bounded by bytes and evicted least
|
|
55
|
+
* recently used. One per process is plenty; losing it only costs re-reads.
|
|
56
|
+
*/
|
|
57
|
+
export declare class GitObjectCache {
|
|
58
|
+
private readonly maxBytes;
|
|
59
|
+
private readonly entries;
|
|
60
|
+
private bytes;
|
|
61
|
+
constructor(maxBytes?: number);
|
|
62
|
+
get(key: string): {
|
|
63
|
+
type: GitObjectType;
|
|
64
|
+
data: Uint8Array;
|
|
65
|
+
} | undefined;
|
|
66
|
+
set(key: string, value: {
|
|
67
|
+
type: GitObjectType;
|
|
68
|
+
data: Uint8Array;
|
|
69
|
+
}): void;
|
|
70
|
+
}
|
|
71
|
+
/** Map with at most `limit` calls in flight, keeping input order. */
|
|
72
|
+
export declare function mapLimit<T, R>(items: readonly T[], limit: number, fn: (item: T) => Promise<R>): Promise<R[]>;
|
|
73
|
+
export declare function parseTree(data: Uint8Array): TreeEntry[];
|
|
74
|
+
export declare function serializeTree(entries: readonly TreeEntry[]): Uint8Array;
|
|
75
|
+
export declare function serializeCommit(input: {
|
|
76
|
+
tree: string;
|
|
77
|
+
parents: readonly string[];
|
|
78
|
+
author: {
|
|
79
|
+
name: string;
|
|
80
|
+
email: string;
|
|
81
|
+
};
|
|
82
|
+
message: string;
|
|
83
|
+
}): Uint8Array;
|
|
84
|
+
/** `.gitignore` matchers by directory, read once per operation. */
|
|
85
|
+
export type IgnoreRules = Map<string, Ignore | null>;
|
|
86
|
+
/** One path's difference between two trees. */
|
|
87
|
+
export interface TreeDifference {
|
|
88
|
+
path: string;
|
|
89
|
+
before: TreeFile | null;
|
|
90
|
+
after: TreeFile | null;
|
|
91
|
+
}
|
|
92
|
+
/** Reads and writes of one origin's objects through a shared cache. */
|
|
93
|
+
export declare class OriginObjects {
|
|
94
|
+
readonly origin: OriginRepo;
|
|
95
|
+
private readonly cache;
|
|
96
|
+
constructor(origin: OriginRepo, cache: GitObjectCache);
|
|
97
|
+
read(oid: string): Promise<{
|
|
98
|
+
type: GitObjectType;
|
|
99
|
+
data: Uint8Array;
|
|
100
|
+
}>;
|
|
101
|
+
write(input: {
|
|
102
|
+
type: GitObjectType;
|
|
103
|
+
data: Uint8Array;
|
|
104
|
+
}): Promise<string>;
|
|
105
|
+
/** Write file contents as blobs, several at once; ids in input order. */
|
|
106
|
+
writeBlobs(contents: readonly Uint8Array[]): Promise<string[]>;
|
|
107
|
+
commit(oid: string): Promise<ParsedCommit>;
|
|
108
|
+
tree(oid: string): Promise<TreeEntry[]>;
|
|
109
|
+
blob(oid: string): Promise<Uint8Array>;
|
|
110
|
+
/**
|
|
111
|
+
* Every file of a tree, keyed by path, optionally only under `prefix`
|
|
112
|
+
* (a directory with its trailing slash, or one file's path). Personal
|
|
113
|
+
* files and submodules are never part of the result.
|
|
114
|
+
*/
|
|
115
|
+
files(treeOid: string, prefix?: string): Promise<Map<string, TreeFile>>;
|
|
116
|
+
/** One path's entry in a tree, or null when absent. */
|
|
117
|
+
entry(treeOid: string, filePath: string): Promise<TreeEntry | null>;
|
|
118
|
+
/**
|
|
119
|
+
* Whether a path the tree does not track is ignored: under a folder no
|
|
120
|
+
* project history contains, or matched by the `.gitignore` files of the
|
|
121
|
+
* tree along its way, as a checkout's commit would skip it.
|
|
122
|
+
*/
|
|
123
|
+
isIgnored(treeOid: string | null, filePath: string, rules?: IgnoreRules): Promise<boolean>;
|
|
124
|
+
/**
|
|
125
|
+
* `treeOid` with `changes` applied (path to an existing blob, or `null`
|
|
126
|
+
* to delete), written to the origin. Returns the new tree id. With
|
|
127
|
+
* `skipMissingDeletes`, deleting a path the tree lacks is not an error.
|
|
128
|
+
*/
|
|
129
|
+
writeTree(treeOid: string | null, changes: ReadonlyMap<string, TreeChange>, options?: {
|
|
130
|
+
skipMissingDeletes?: boolean;
|
|
131
|
+
}): Promise<string>;
|
|
132
|
+
private rewrite;
|
|
133
|
+
writeCommit(input: {
|
|
134
|
+
tree: string;
|
|
135
|
+
parents: readonly string[];
|
|
136
|
+
author: {
|
|
137
|
+
name: string;
|
|
138
|
+
email: string;
|
|
139
|
+
};
|
|
140
|
+
message: string;
|
|
141
|
+
}): Promise<string>;
|
|
142
|
+
/** Paths whose file differs between two trees; equal subtrees are skipped. */
|
|
143
|
+
diffTrees(before: string | null, after: string | null): Promise<TreeDifference[]>;
|
|
144
|
+
/**
|
|
145
|
+
* Where two commits' histories meet, and how many commits each has that
|
|
146
|
+
* the other lacks. Walks newest first from both tips and stops once only
|
|
147
|
+
* shared history is left, so the cost follows the divergence, not the
|
|
148
|
+
* project's age. The meeting point is a common ancestor that no other
|
|
149
|
+
* common ancestor descends from (the best merge base), chosen by the
|
|
150
|
+
* commit graph.
|
|
151
|
+
*/
|
|
152
|
+
compare(left: string, right: string): Promise<{
|
|
153
|
+
base: string | null;
|
|
154
|
+
ahead: number;
|
|
155
|
+
behind: number;
|
|
156
|
+
}>;
|
|
157
|
+
/** Commits reachable from `tip`, newest first. */
|
|
158
|
+
/**
|
|
159
|
+
* Whether commit `sha` is one of `tips` or reachable from them. Walks
|
|
160
|
+
* newest first and stops at commits clearly older than `sha` (a day of
|
|
161
|
+
* clock skew allowed) or after `limit` commits, so a lookup costs the
|
|
162
|
+
* history since that commit, not the project's age. Anything it cannot
|
|
163
|
+
* prove reachable answers false.
|
|
164
|
+
*/
|
|
165
|
+
isReachable(input: {
|
|
166
|
+
sha: string;
|
|
167
|
+
tips: readonly string[];
|
|
168
|
+
limit?: number;
|
|
169
|
+
}): Promise<boolean>;
|
|
170
|
+
log(tip: string, maxCount: number): Promise<Array<{
|
|
171
|
+
sha: string;
|
|
172
|
+
message: string;
|
|
173
|
+
author: {
|
|
174
|
+
name: string;
|
|
175
|
+
email: string;
|
|
176
|
+
};
|
|
177
|
+
timestamp: number;
|
|
178
|
+
}>>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* A three-way merge of trees in memory: every path only one side changed
|
|
182
|
+
* takes that side, a text file both changed merges line by line, and
|
|
183
|
+
* anything else both changed differently is a conflict. `resolutions`
|
|
184
|
+
* settle conflicted paths with the member's content. Ours is the member's
|
|
185
|
+
* side and theirs the published program, as in every conflict a member
|
|
186
|
+
* resolves.
|
|
187
|
+
*/
|
|
188
|
+
export declare function mergeTrees(input: {
|
|
189
|
+
objects: OriginObjects;
|
|
190
|
+
base: string | null;
|
|
191
|
+
ours: string;
|
|
192
|
+
theirs: string;
|
|
193
|
+
resolutions?: Record<string, string>;
|
|
194
|
+
}): Promise<{
|
|
195
|
+
status: "merged";
|
|
196
|
+
tree: string;
|
|
197
|
+
} | {
|
|
198
|
+
status: "conflict";
|
|
199
|
+
conflicts: ConflictEntry[];
|
|
200
|
+
}>;
|
|
201
|
+
//# sourceMappingURL=origin-objects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin-objects.d.ts","sourceRoot":"","sources":["../src/origin-objects.ts"],"names":[],"mappings":"AACA,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;GAMG;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,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CAAC;KACnB,CAAC,CACH,CAiCA;CACF;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE;IACtC,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GAAG,OAAO,CACP;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,aAAa,EAAE,CAAA;CAAE,CACrD,CA2HA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isPersonalFile(filePath: string): boolean;
|
|
2
|
+
/** Also protects native git add/checkpoint operations, including linked worktrees. */
|
|
3
|
+
export declare function ensurePersonalFilesExcluded({ repoPath, }: {
|
|
4
|
+
repoPath: string;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=personal-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-files.d.ts","sourceRoot":"","sources":["../src/personal-files.ts"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED,sFAAsF;AACtF,wBAAsB,2BAA2B,CAAC,EAChD,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuChB"}
|