@catamorphic/git 0.1.0-alpha.42 → 0.1.0-alpha.44
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/dist/checkout-remote-backend.d.ts.map +1 -1
- package/dist/fs-backend.d.ts +8 -0
- package/dist/fs-backend.d.ts.map +1 -1
- package/dist/fs-remote-backend.d.ts +43 -9
- package/dist/fs-remote-backend.d.ts.map +1 -1
- package/dist/git-objects.d.ts +77 -0
- package/dist/git-objects.d.ts.map +1 -0
- package/dist/git-sync.d.ts +16 -17
- package/dist/git-sync.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3912 -3059
- package/dist/index.js.map +23 -21
- package/dist/native-git.d.ts +114 -2
- package/dist/native-git.d.ts.map +1 -1
- package/dist/native-project-repo.d.ts +40 -5
- package/dist/native-project-repo.d.ts.map +1 -1
- package/dist/network-sync.d.ts.map +1 -1
- package/dist/network.d.ts +14 -9
- package/dist/network.d.ts.map +1 -1
- package/dist/object-origin-cache.d.ts +86 -0
- package/dist/object-origin-cache.d.ts.map +1 -0
- package/dist/object-remote-backend.d.ts +64 -10
- package/dist/object-remote-backend.d.ts.map +1 -1
- package/dist/origin-draft.d.ts.map +1 -1
- package/dist/origin-objects.d.ts +7 -2
- package/dist/origin-objects.d.ts.map +1 -1
- package/dist/project-manager.d.ts +22 -0
- package/dist/project-manager.d.ts.map +1 -1
- package/dist/project-paths.d.ts +20 -0
- package/dist/project-paths.d.ts.map +1 -0
- package/dist/ref-names.d.ts +35 -0
- package/dist/ref-names.d.ts.map +1 -1
- package/dist/types.d.ts +37 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/workspace-checkout.d.ts +31 -0
- package/dist/workspace-checkout.d.ts.map +1 -0
- package/dist/workspace-mirror.d.ts +38 -5
- package/dist/workspace-mirror.d.ts.map +1 -1
- package/dist/workspace-save.d.ts +27 -2
- package/dist/workspace-save.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/checkout-remote-backend.ts +77 -29
- package/src/fs-backend.ts +69 -7
- package/src/fs-remote-backend.ts +255 -133
- package/src/git-objects.ts +363 -0
- package/src/git-sync.ts +124 -453
- package/src/index.ts +17 -7
- package/src/native-git.ts +566 -25
- package/src/native-project-repo.ts +318 -99
- package/src/network-sync.ts +43 -35
- package/src/network.ts +177 -153
- package/src/object-origin-cache.ts +689 -0
- package/src/object-remote-backend.ts +277 -20
- package/src/origin-draft.ts +22 -15
- package/src/origin-objects.ts +21 -5
- package/src/project-manager.ts +261 -73
- package/src/project-paths.ts +142 -0
- package/src/ref-names.ts +56 -0
- package/src/types.ts +38 -4
- package/src/workspace-checkout.ts +192 -0
- package/src/workspace-mirror.ts +276 -68
- package/src/workspace-save.ts +99 -30
- package/dist/project-repo.d.ts +0 -81
- package/dist/project-repo.d.ts.map +0 -1
- package/src/project-repo.ts +0 -821
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-remote-backend.d.ts","sourceRoot":"","sources":["../src/checkout-remote-backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout-remote-backend.d.ts","sourceRoot":"","sources":["../src/checkout-remote-backend.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,UAAU,EACV,mBAAmB,EACnB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,wGAAwG;AACxG,qBAAa,qBAAsB,YAAW,aAAa;IAEvD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFzB,YACmB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,aAAa,EACpC;IAEE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGnE;IACK,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrE;IACK,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKlE;IACK,UAAU,CAAC,CAAC,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GACrC,OAAO,CAAC,CAAC,CAAC,CAKZ;CACF"}
|
package/dist/fs-backend.d.ts
CHANGED
|
@@ -21,6 +21,14 @@ export declare class FsBackend implements StorageBackend {
|
|
|
21
21
|
release: () => Promise<void>;
|
|
22
22
|
}>;
|
|
23
23
|
initProject(tenantId: string, projectId: string, opts?: InitProjectOptions): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* In the internal layout the project's own copy shares its folder with
|
|
26
|
+
* Work's storage for it: members' and chats' copies under `dev/`, caches
|
|
27
|
+
* under `cache/`. Git must never read those as the project's files (a
|
|
28
|
+
* copy being made is a repository with no commit yet, which stops every
|
|
29
|
+
* `git add`), so the project's copy excludes them.
|
|
30
|
+
*/
|
|
31
|
+
private excludeOwnStorage;
|
|
24
32
|
mirrorPath(tenantId: string, projectId: string): string;
|
|
25
33
|
cachePath(tenantId: string, projectId: string, name: string): string;
|
|
26
34
|
deleteProject(tenantId: string, projectId: string): Promise<void>;
|
package/dist/fs-backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-backend.d.ts","sourceRoot":"","sources":["../src/fs-backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fs-backend.d.ts","sourceRoot":"","sources":["../src/fs-backend.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACf,MAAM,YAAY,CAAC;AAWpB;;;;;;;;;GASG;AACH,qBAAa,SAAU,YAAW,cAAc;IAM5C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB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from "./types.js";
|
|
2
3
|
export declare class FsRemoteBackend implements RemoteBackend {
|
|
3
4
|
private readonly basePath;
|
|
@@ -9,14 +10,28 @@ export declare class FsRemoteBackend implements RemoteBackend {
|
|
|
9
10
|
withOrigin<T>(tenantId: string, projectId: string, fn: (origin: OriginRepo) => Promise<T>): Promise<T>;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* OriginRepo over a
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* OriginRepo over a bare repository on this machine's disk, read and
|
|
14
|
+
* written with the Git program. Used directly by `FsRemoteBackend` and
|
|
15
|
+
* reused by network-remote backends (e.g. Cloudflare Artifacts) that
|
|
16
|
+
* maintain a local bare mirror.
|
|
15
17
|
*/
|
|
16
18
|
export declare class FsOriginRepo implements OriginRepo {
|
|
17
19
|
readonly gitdir: string;
|
|
18
|
-
private readonly cache;
|
|
19
20
|
constructor(gitdir: string);
|
|
21
|
+
/**
|
|
22
|
+
* The id a ref names now, or null when there is no such ref. Asked of the
|
|
23
|
+
* repository's long-lived reader, so a lookup starts no Git: every
|
|
24
|
+
* workflow invocation makes several (which draft, which `main`), and a
|
|
25
|
+
* process for each cost a batch four starts an item. The reader resolves
|
|
26
|
+
* the name when it is asked, as `git rev-parse` would, so it sees a ref
|
|
27
|
+
* that moved, was packed, was deleted or was made after it started.
|
|
28
|
+
*
|
|
29
|
+
* Git answers by itself, as before, where the reader cannot say the
|
|
30
|
+
* same: a full id (named back whether or not its object is here), and a
|
|
31
|
+
* lookup the reader failed (it was closed, or its Git stopped). What the
|
|
32
|
+
* reader calls missing is a ref that is not there: Git writes no ref to
|
|
33
|
+
* an object the repository lacks.
|
|
34
|
+
*/
|
|
20
35
|
resolveRef(ref: string): Promise<string | null>;
|
|
21
36
|
listRefs(prefix: string): Promise<{
|
|
22
37
|
ref: string;
|
|
@@ -27,21 +42,40 @@ export declare class FsOriginRepo implements OriginRepo {
|
|
|
27
42
|
sha: string;
|
|
28
43
|
expected?: string | null;
|
|
29
44
|
}): Promise<void>;
|
|
30
|
-
private writeRefChecked;
|
|
31
45
|
deleteRef(input: {
|
|
32
46
|
ref: string;
|
|
33
47
|
expected?: string;
|
|
34
48
|
}): Promise<void>;
|
|
35
|
-
private deleteRefChecked;
|
|
36
49
|
hasObject(sha: string): Promise<boolean>;
|
|
37
|
-
readObject(sha: string
|
|
38
|
-
|
|
50
|
+
readObject(sha: string, options?: {
|
|
51
|
+
maxBytes?: number;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
type: GitObjectType;
|
|
39
54
|
data: Uint8Array;
|
|
40
55
|
}>;
|
|
41
56
|
writeObject(opts: {
|
|
42
|
-
type:
|
|
57
|
+
type: GitObjectType;
|
|
43
58
|
data: Uint8Array;
|
|
44
59
|
}): Promise<string>;
|
|
45
60
|
log(ref: string, maxCount?: number): Promise<CommitInfo[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Take `commit` and what it reaches from the repository at `repoPath`.
|
|
63
|
+
* Git negotiates against every ref this origin holds, so only what it
|
|
64
|
+
* lacks travels, as one pack.
|
|
65
|
+
*/
|
|
66
|
+
receive(input: {
|
|
67
|
+
repoPath: string;
|
|
68
|
+
commit: string;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Make `commit` and what it reaches readable in the repository at
|
|
72
|
+
* `repoPath`: by lending it this origin's objects (`borrow`, for a copy
|
|
73
|
+
* Work manages on this machine), or by copying what it lacks as a pack.
|
|
74
|
+
*/
|
|
75
|
+
send(input: {
|
|
76
|
+
repoPath: string;
|
|
77
|
+
commit: string;
|
|
78
|
+
borrow?: boolean;
|
|
79
|
+
}): Promise<void>;
|
|
46
80
|
}
|
|
47
81
|
//# sourceMappingURL=fs-remote-backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-remote-backend.d.ts","sourceRoot":"","sources":["../src/fs-remote-backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fs-remote-backend.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*/
|
|
3
|
+
export interface ObjectAnswer {
|
|
4
|
+
oid: string;
|
|
5
|
+
type: GitObjectType;
|
|
6
|
+
size: number;
|
|
7
|
+
/** The object's content; empty when only its header was asked for. */
|
|
8
|
+
data: Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The most one object may weigh to be read into this process's memory
|
|
12
|
+
* where its reader names no limit of its own: a repository may hold files
|
|
13
|
+
* of any size, and reading one whole must never be what exhausts the host.
|
|
14
|
+
*/
|
|
15
|
+
export declare const OBJECT_MAX_BYTES: number;
|
|
16
|
+
/** An object is larger than its reader may hold in memory. */
|
|
17
|
+
export declare class ObjectTooLargeError extends Error {
|
|
18
|
+
readonly oid: string;
|
|
19
|
+
readonly size: number | null;
|
|
20
|
+
readonly maxBytes: number;
|
|
21
|
+
constructor(oid: string, size: number | null, maxBytes: number);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A reader of its own on a repository, for one piece of work: it sees the
|
|
25
|
+
* repository as it is now (the objects it borrows included), and `stop`
|
|
26
|
+
* ends its Git process.
|
|
27
|
+
*/
|
|
28
|
+
export declare function openObjectReader(input: {
|
|
29
|
+
gitdir: string;
|
|
30
|
+
contents: boolean;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
ask(name: string): Promise<ObjectAnswer | null>;
|
|
33
|
+
stop(): void;
|
|
34
|
+
}>;
|
|
35
|
+
/** An object's type and size in the repository at `gitdir`, or null when absent. */
|
|
36
|
+
export declare function objectHeader(input: {
|
|
37
|
+
gitdir: string;
|
|
38
|
+
name: string;
|
|
39
|
+
}): Promise<ObjectAnswer | null>;
|
|
40
|
+
/**
|
|
41
|
+
* An object's content in the repository at `gitdir`, or null when absent.
|
|
42
|
+
* Its size is asked first: one over `maxBytes` (see
|
|
43
|
+
* {@link OBJECT_MAX_BYTES}) is refused before a byte of it is read. A
|
|
44
|
+
* caller that already has the size from Git (a tree's listing) passes it
|
|
45
|
+
* as `size`, and it is not asked again.
|
|
46
|
+
*/
|
|
47
|
+
export declare function objectContent(input: {
|
|
48
|
+
gitdir: string;
|
|
49
|
+
name: string;
|
|
50
|
+
maxBytes?: number;
|
|
51
|
+
size?: number;
|
|
52
|
+
}): Promise<ObjectAnswer | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Stop the Git processes reading the repository at `folder`, and any under
|
|
55
|
+
* it, when the folder is about to be removed. Whoever is waiting for an
|
|
56
|
+
* answer from one is told it was closed, so this is never for a holder
|
|
57
|
+
* that is merely done with a repository others may be reading: readers are
|
|
58
|
+
* shared by everyone who reads a folder, and an idle one stops by itself.
|
|
59
|
+
*/
|
|
60
|
+
export declare function closeObjectReaders(folder: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Write one object as a loose file under `objects` (a repository's object
|
|
63
|
+
* folder), as Git itself stores a new object: deflated, under its id. One
|
|
64
|
+
* already there is left alone. Returns its id.
|
|
65
|
+
*/
|
|
66
|
+
export declare function writeLooseObject(input: {
|
|
67
|
+
objects: string;
|
|
68
|
+
type: GitObjectType;
|
|
69
|
+
data: Uint8Array;
|
|
70
|
+
}): Promise<string>;
|
|
71
|
+
/** Write an object already in wrapped form (`<type> <length>\0<content>`). */
|
|
72
|
+
export declare function writeWrappedObject(input: {
|
|
73
|
+
objects: string;
|
|
74
|
+
sha: string;
|
|
75
|
+
wrapped: Uint8Array;
|
|
76
|
+
}): Promise<void>;
|
|
77
|
+
//# sourceMappingURL=git-objects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-objects.d.ts","sourceRoot":"","sources":["../src/git-objects.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,uBAAuB,CAAC;AAcvE,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,IAAI,EAAE,UAAU,CAAC;CA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AU,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAIlB;AAED,8EAA8E;AAC9E,wBAAsB,kBAAkB,CAAC,KAAK,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,UAAU,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB"}
|
package/dist/git-sync.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProjectRepo, RemoteBackend } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Server-orchestrated Git transport between a repository on this machine's
|
|
4
|
+
* disk (a checkout, a session's copy) and a project's origin (ADR 0356).
|
|
5
|
+
* Histories move as packs, built and read by the Git program: only what
|
|
6
|
+
* the receiving side lacks travels, and nothing here walks a history or
|
|
7
|
+
* holds its objects in memory.
|
|
8
|
+
*/
|
|
2
9
|
export interface PushOpts {
|
|
3
10
|
dev: ProjectRepo;
|
|
4
11
|
remote: Pick<RemoteBackend, "withOrigin">;
|
|
@@ -22,36 +29,28 @@ export interface FetchOpts {
|
|
|
22
29
|
tenantId: string;
|
|
23
30
|
projectId: string;
|
|
24
31
|
remoteBranch?: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
email: string;
|
|
31
|
-
};
|
|
32
|
+
/**
|
|
33
|
+
* `dev` is a copy Work manages on this machine: an origin that keeps its
|
|
34
|
+
* objects here lends them to it instead of copying them.
|
|
35
|
+
*/
|
|
36
|
+
borrow?: boolean;
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
34
|
-
*
|
|
39
|
+
* Publish a commit of the dev repository as a branch of the origin: the
|
|
40
|
+
* origin takes what it lacks, then the branch moves by compare-and-swap.
|
|
35
41
|
* Throws if the push would not be a fast-forward (caller should pull first).
|
|
36
42
|
*/
|
|
37
43
|
export declare function push(opts: PushOpts): Promise<{
|
|
38
44
|
sha: string;
|
|
39
45
|
}>;
|
|
40
46
|
/**
|
|
41
|
-
*
|
|
47
|
+
* Make the tip of the remote branch readable in the dev repo and update the
|
|
42
48
|
* `refs/work/published/<branch>` tracking ref. Does not touch the working tree.
|
|
43
49
|
*/
|
|
44
50
|
export declare function fetchRemote(opts: FetchOpts): Promise<{
|
|
45
51
|
sha: string | null;
|
|
46
52
|
alreadyUpToDate: boolean;
|
|
47
53
|
}>;
|
|
48
|
-
/**
|
|
49
|
-
* Fetch the remote branch, then merge it into the current branch. Uses a
|
|
50
|
-
* 3-way merge via isomorphic-git. Returns conflicts when the merge cannot be
|
|
51
|
-
* resolved automatically; working tree is left with conflict markers in that
|
|
52
|
-
* case so the caller can surface them or invoke the AI resolver.
|
|
53
|
-
*/
|
|
54
|
-
export declare function pull(opts: PullOpts): Promise<MergeResult>;
|
|
55
54
|
export declare class PushNotFastForwardError extends Error {
|
|
56
55
|
readonly localSha: string;
|
|
57
56
|
readonly remoteSha: string;
|
package/dist/git-sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-sync.d.ts","sourceRoot":"","sources":["../src/git-sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git-sync.d.ts","sourceRoot":"","sources":["../src/git-sync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI7D;;;;;;GAMG;AAEH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,WAAW,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,WAAW,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CA+DnE;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAC1D,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC,CAwCD;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,YAAY,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAOxD;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ export { CheckoutRemoteBackend } from "./checkout-remote-backend.js";
|
|
|
2
2
|
export { type FileReadOptions, readFileSnapshot } from "./file-reads.js";
|
|
3
3
|
export { FsBackend } from "./fs-backend.js";
|
|
4
4
|
export { FsOriginRepo, FsRemoteBackend } from "./fs-remote-backend.js";
|
|
5
|
-
export {
|
|
5
|
+
export { OBJECT_MAX_BYTES, ObjectTooLargeError } from "./git-objects.js";
|
|
6
|
+
export { fetchRemote, PushNotFastForwardError, push } from "./git-sync.js";
|
|
6
7
|
export { InMemoryObjectStore } from "./in-memory-object-store.js";
|
|
7
8
|
export { migrateWorkflowToProject } from "./migrate-workflow.js";
|
|
8
|
-
export { discoverLocalFolder, hasLocalGit, type LocalFolder, nativeGit, } from "./native-git.js";
|
|
9
|
+
export { assertNativeGit, discoverLocalFolder, gitErrorText, hasLocalGit, initManagedRepository, type LocalFolder, markManagedRepository, type NativeGitAuth, NativeGitUnavailableError, nativeGit, } from "./native-git.js";
|
|
9
10
|
export { NativeProjectRepo } from "./native-project-repo.js";
|
|
10
11
|
export { assertPushAllowed, type CloneFromRemoteOptions, cloneFromRemote, fetchFromRemote, isManagedBranch, type PushedBranch, pushOwnBranch, pushToRemote, type RemoteOwnership, RemotePushRefusedError, } from "./network.js";
|
|
11
12
|
export { type NetworkSyncResult, type NetworkSyncStatus, syncWithNetworkRemote, } from "./network-sync.js";
|
|
@@ -16,11 +17,11 @@ export { DraftBusyError, type DraftChange, DraftContentChangedError, type DraftP
|
|
|
16
17
|
export { DraftBinaryResolutionError, DraftIgnoredPathError, DraftPathError, GitObjectCache, } from "./origin-objects.js";
|
|
17
18
|
export { ensurePersonalFilesExcluded, isPersonalFile, } from "./personal-files.js";
|
|
18
19
|
export { PROGRAM_READER_ID, PROJECT_GITIGNORE, ProjectManager, } from "./project-manager.js";
|
|
19
|
-
export { ProjectRepoImpl } from "./project-repo.js";
|
|
20
20
|
export { RefMovedError } from "./ref-moved-error.js";
|
|
21
21
|
export { assertValidRefName, InvalidRefNameError, isValidRefName, } from "./ref-names.js";
|
|
22
22
|
export { currentSessionWork, isSessionBranchName, parseCheckpointMessage, readSessionWork, type SessionWork, sessionBranchName, } from "./session-checkpoint.js";
|
|
23
23
|
export type { BranchInfo, CloneSource, CommitInfo, ConflictEntry, DiffEntry, DraftSupport, FileChange, GitCredentials, InitProjectOptions, MergeResult, OriginRepo, ProjectPathResolver, ProjectRepo, RemoteBackend, RepoStatus, StorageBackend, } from "./types.js";
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
24
|
+
export { advertiseCheckout, CHECKOUT_BRANCH, type CheckoutSource, openCheckoutSource, serveCheckout, } from "./workspace-checkout.js";
|
|
25
|
+
export { type BaseMoveOutcome, buildSeedPack, copyFromMirror, fetchIntoMirror, isCommitId, mirrorChangedFiles, moveCheckoutBase, parseWorkspaceRef, seedPackInstallScript, seedPackParts, shellQuote, unpinMirrorRef, type WorkspaceBase, } from "./workspace-mirror.js";
|
|
26
|
+
export { assertHeldCommit, assertSavedPath, assertSavedTree, parseSavedChanges, ReceivedPack, type SavedChange, savedDraftChanges, WorkspaceSaveError, writeSavedChanges, } from "./workspace-save.js";
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,eAAe,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