@tomradex/files 0.26.0 → 0.27.0
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/git-store.d.ts +20 -1
- package/dist/git-sync.d.ts +18 -1
- package/dist/scopes.d.ts +15 -1
- package/dist/service.d.ts +5 -0
- package/dist/types.d.ts +2 -0
- package/package.json +15 -15
package/dist/git-store.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ export declare class GitFileStore implements FileStore {
|
|
|
60
60
|
private readonly opts;
|
|
61
61
|
readonly dir: string;
|
|
62
62
|
private readonly g;
|
|
63
|
+
private readonly runner;
|
|
64
|
+
private readonly transport;
|
|
63
65
|
private branch;
|
|
64
66
|
private watcher;
|
|
65
67
|
private settleTimer;
|
|
@@ -67,6 +69,8 @@ export declare class GitFileStore implements FileStore {
|
|
|
67
69
|
private quietUntil;
|
|
68
70
|
private syncing;
|
|
69
71
|
private syncQueue;
|
|
72
|
+
/** A change asked for a push while a sync ran; one more follows it. */
|
|
73
|
+
private changedMidSync;
|
|
70
74
|
private lastSyncAt;
|
|
71
75
|
private problem;
|
|
72
76
|
private recorder;
|
|
@@ -86,6 +90,10 @@ export declare class GitFileStore implements FileStore {
|
|
|
86
90
|
private syncedHead;
|
|
87
91
|
private policyDirty;
|
|
88
92
|
private agentsDirty;
|
|
93
|
+
/** Other folders on this machine that sync the same shared files. */
|
|
94
|
+
private elsewhere;
|
|
95
|
+
/** What each store line the remote holds says, by blob id: read once. */
|
|
96
|
+
private presence;
|
|
89
97
|
constructor(opts: GitStoreOptions);
|
|
90
98
|
private git;
|
|
91
99
|
/** Index-changing git calls run one at a time; an agent's write must not interleave with the watcher's save. */
|
|
@@ -192,7 +200,7 @@ export declare class GitFileStore implements FileStore {
|
|
|
192
200
|
/**
|
|
193
201
|
* Save, then — with a remote — probe, fetch, merge, push. Leaves `problem`
|
|
194
202
|
* for `status()` to report. Only the steps that touch the index and working
|
|
195
|
-
* copy hold the store's lock: the network calls
|
|
203
|
+
* copy hold the store's lock: the network calls may take minutes before they are cut off, and a save,
|
|
196
204
|
* a delete or an undo waiting behind an unreachable remote would read as the
|
|
197
205
|
* app not responding. Fetch writes refs and objects only, and push reads
|
|
198
206
|
* them, so a local commit landing beside either is safe.
|
|
@@ -206,6 +214,8 @@ export declare class GitFileStore implements FileStore {
|
|
|
206
214
|
* each round is a commit on a branch people share.
|
|
207
215
|
*/
|
|
208
216
|
private undoing;
|
|
217
|
+
/** Counted only once a push landed: one the remote turned away replaced nothing, however often it is tried. */
|
|
218
|
+
private published;
|
|
209
219
|
/**
|
|
210
220
|
* Merge both policy dimensions before looking at bytes. Sharing fails closed
|
|
211
221
|
* on a concurrent edit to the same rule — bytes are at stake. Listing is only
|
|
@@ -215,6 +225,15 @@ export declare class GitFileStore implements FileStore {
|
|
|
215
225
|
private mergePolicy;
|
|
216
226
|
private mergeDimension;
|
|
217
227
|
private reconcile;
|
|
228
|
+
/** Say on the remote which folder this store is, once; and find the other stores of these files that live on this machine too. */
|
|
229
|
+
private notePresence;
|
|
230
|
+
/**
|
|
231
|
+
* Whether the remote lacks the record of the version of this file it last
|
|
232
|
+
* had from us. No sync ever takes a version record off the remote, a
|
|
233
|
+
* deletion included, so a missing one means the remote was put back to an
|
|
234
|
+
* older copy by something else, such as a merge that kept its own tree.
|
|
235
|
+
*/
|
|
236
|
+
private lostOnRemote;
|
|
218
237
|
private stage;
|
|
219
238
|
conflicts(): Promise<FileConflict[]>;
|
|
220
239
|
resolve(p: string, choice: ConflictChoice): Promise<void>;
|
package/dist/git-sync.d.ts
CHANGED
|
@@ -21,8 +21,22 @@ export interface SyncState {
|
|
|
21
21
|
/** Baseline for the listing dimension; absent on a state written before it existed. */
|
|
22
22
|
agents?: FilesAgentPolicy;
|
|
23
23
|
head?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Per shared path, the record of its version the remote held when this machine's last push landed. Only a record the
|
|
26
|
+
* remote once held and no longer does tells of a remote that went back; one never sent tells nothing. Absent on a
|
|
27
|
+
* state written before it existed.
|
|
28
|
+
*/
|
|
29
|
+
published?: Record<string, string>;
|
|
24
30
|
}
|
|
25
31
|
export declare const emptySyncState: () => SyncState;
|
|
32
|
+
/**
|
|
33
|
+
* The store and its projection are Tomrade's, not the person's: their global git config must not change the bytes.
|
|
34
|
+
* Line-ending conversion and attributes made the ids recorded differ from the bytes shared (a change that is none,
|
|
35
|
+
* then a clash that is none) and could convert what is sent; a global ignore left a received file untracked, read next
|
|
36
|
+
* as deleted here and deleted from the remote; a hook of theirs could refuse or hold an exchange.
|
|
37
|
+
*/
|
|
38
|
+
export declare const STORE_CONFIG: string[];
|
|
39
|
+
export declare const isolated: (git: Git, local?: boolean) => Git;
|
|
26
40
|
/** The id git gives these bytes, so what the remote already holds is recognised without asking git. */
|
|
27
41
|
export declare const blobId: (bytes: Buffer) => string;
|
|
28
42
|
export declare const contains: (parent: string, child: string) => boolean;
|
|
@@ -113,7 +127,10 @@ export declare class GitProjection {
|
|
|
113
127
|
theirs: string | null;
|
|
114
128
|
ours: string;
|
|
115
129
|
}>;
|
|
116
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Commit what changed on top of the fetched tip and push, never forced; null once it landed, else why not. With
|
|
132
|
+
* nothing changed HEAD is that tip, which the remote already has: nothing is committed or sent.
|
|
133
|
+
*/
|
|
117
134
|
push(recorder?: SyncRecorder): Promise<ExchangeFailure | null>;
|
|
118
135
|
private refused;
|
|
119
136
|
}
|
package/dist/scopes.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ export declare const separateWorlds: (from: string | null, to: string) => boolea
|
|
|
5
5
|
/** The id a store's operations are filed under, so undo knows which store they belong to. */
|
|
6
6
|
export declare function storeId(dir: string): string;
|
|
7
7
|
export declare function ensureStoreId(dir: string, created: boolean): void;
|
|
8
|
+
/** A folder as a remote may carry it: under the home folder as `~/…`, forward-slashed, so it names the same place on a machine laid out alike. */
|
|
9
|
+
export declare function homeForm(abs: string): string;
|
|
10
|
+
/** Whether that folder, on this machine, is the store with that id and not the one at `own`. */
|
|
11
|
+
export declare function otherStoreHere(folder: string, id: string, own: string): boolean;
|
|
12
|
+
/** One name per store and folder: two old stores both read the legacy id, and must not write over each other's line. */
|
|
13
|
+
export declare const presenceKey: (dir: string) => string;
|
|
8
14
|
/**
|
|
9
15
|
* Where a project's earlier Files stores go when the remote scope moves
|
|
10
16
|
* between a repository root and a folder: whole, beside the live one, never
|
|
@@ -24,6 +30,14 @@ export declare class FilesArchive {
|
|
|
24
30
|
* here, so switching back and forth restores each view as it was. Returns
|
|
25
31
|
* how to put things back, for a bind that then fails.
|
|
26
32
|
*/
|
|
27
|
-
rotate(live: string, directory: string): () => void
|
|
33
|
+
rotate(live: string, directory: string): Promise<() => Promise<void>>;
|
|
28
34
|
}
|
|
35
|
+
/** How long a rename waits for a folder Windows calls busy before it fails as it would have at once. */
|
|
36
|
+
export declare const RENAME_PATIENCE_MS = 10000;
|
|
37
|
+
/**
|
|
38
|
+
* Renames a folder, waiting while Windows calls it busy. Windows will not rename a folder a process works in or holds
|
|
39
|
+
* a file of, and a store closed for a rebind may still run its last git command there (it stops only between steps),
|
|
40
|
+
* as a virus scanner may hold a file a moment; elsewhere the rename goes through underneath them, so it never waits.
|
|
41
|
+
*/
|
|
42
|
+
export declare function renameWhenFree(from: string, to: string, patienceMs?: number): Promise<void>;
|
|
29
43
|
//# sourceMappingURL=scopes.d.ts.map
|
package/dist/service.d.ts
CHANGED
|
@@ -185,6 +185,11 @@ export declare class Files extends Service implements FilesReader {
|
|
|
185
185
|
* The index as a prompt wants it: the person's budget, and the ticket's own
|
|
186
186
|
* folder kept open whatever that budget is.
|
|
187
187
|
*/
|
|
188
|
+
/**
|
|
189
|
+
* The index, or none when it is not ready in a moment: an agent's turn never waits on the files — a first copy
|
|
190
|
+
* fetching its remote's files waits for them, and the turn goes on without the index this once.
|
|
191
|
+
*/
|
|
192
|
+
private indexSoon;
|
|
188
193
|
indexFor(projectId: string, native: boolean, itemId?: string): Promise<AgentIndex | null>;
|
|
189
194
|
sync(projectId: string, opts?: {
|
|
190
195
|
quiet?: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface FilesStatus {
|
|
|
26
26
|
behind: number;
|
|
27
27
|
/** The latest version, null until something has been saved. */
|
|
28
28
|
head: string | null;
|
|
29
|
+
/** Other folders on this machine syncing the same shared files, as `~/…`: two copies of one project, the person should keep one. */
|
|
30
|
+
elsewhere?: string[];
|
|
29
31
|
/** True for a store that keeps no versions — no git on this machine: no history, undo, ticket pins or sharing. */
|
|
30
32
|
versionless?: boolean;
|
|
31
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomradex/files",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Haoyuan Tang",
|
|
6
6
|
"engines": {
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tomradex/agent": "0.
|
|
31
|
-
"@tomradex/boards": "0.
|
|
32
|
-
"@tomradex/contracts": "0.
|
|
33
|
-
"@tomradex/contributions": "0.
|
|
34
|
-
"@tomradex/db": "0.
|
|
30
|
+
"@tomradex/agent": "0.27.0",
|
|
31
|
+
"@tomradex/boards": "0.27.0",
|
|
32
|
+
"@tomradex/contracts": "0.27.0",
|
|
33
|
+
"@tomradex/contributions": "0.27.0",
|
|
34
|
+
"@tomradex/db": "0.27.0",
|
|
35
35
|
"@tomradex/domain": "0.2.33",
|
|
36
|
-
"@tomradex/git": "0.
|
|
37
|
-
"@tomradex/hub": "0.
|
|
38
|
-
"@tomradex/ipc": "0.
|
|
39
|
-
"@tomradex/items": "0.
|
|
40
|
-
"@tomradex/oplog": "0.
|
|
41
|
-
"@tomradex/settings": "0.
|
|
42
|
-
"@tomradex/storage": "0.
|
|
43
|
-
"@tomradex/tools": "0.
|
|
44
|
-
"@tomradex/write": "0.
|
|
36
|
+
"@tomradex/git": "0.27.0",
|
|
37
|
+
"@tomradex/hub": "0.27.0",
|
|
38
|
+
"@tomradex/ipc": "0.27.0",
|
|
39
|
+
"@tomradex/items": "0.27.0",
|
|
40
|
+
"@tomradex/oplog": "0.27.0",
|
|
41
|
+
"@tomradex/settings": "0.27.0",
|
|
42
|
+
"@tomradex/storage": "0.27.0",
|
|
43
|
+
"@tomradex/tools": "0.27.0",
|
|
44
|
+
"@tomradex/write": "0.27.0",
|
|
45
45
|
"cordis": "4.0.0-rc.8",
|
|
46
46
|
"zod": "^4.4.3"
|
|
47
47
|
}
|