@amalgm/shell 0.1.164-main.42148096265 → 0.1.164-main.42164710551

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 (41) hide show
  1. package/dist/apply-map.d.ts +57 -0
  2. package/dist/apply-map.js +76 -30
  3. package/dist/apply-map.js.map +1 -1
  4. package/dist/drive/cloud-files/asks.js +16 -12
  5. package/dist/drive/cloud-files/asks.js.map +1 -1
  6. package/dist/drive/cloud-files/contents.d.ts +15 -8
  7. package/dist/drive/cloud-files/contents.js +54 -14
  8. package/dist/drive/cloud-files/contents.js.map +1 -1
  9. package/dist/drive/cloud-files/paths.d.ts +11 -0
  10. package/dist/drive/cloud-files/paths.js +13 -0
  11. package/dist/drive/cloud-files/paths.js.map +1 -1
  12. package/dist/drive/cloud-files/reconcile.js +64 -18
  13. package/dist/drive/cloud-files/reconcile.js.map +1 -1
  14. package/dist/drive/cloud-files/sync-root.d.ts +5 -3
  15. package/dist/drive/cloud-files/sync-root.js +15 -8
  16. package/dist/drive/cloud-files/sync-root.js.map +1 -1
  17. package/dist/drive/cloud-files/writes.d.ts +4 -2
  18. package/dist/drive/cloud-files/writes.js +33 -16
  19. package/dist/drive/cloud-files/writes.js.map +1 -1
  20. package/dist/drive/mount.d.ts +2 -1
  21. package/dist/drive/mount.js +4 -2
  22. package/dist/drive/mount.js.map +1 -1
  23. package/dist/drive/nfs/apple-double.js +0 -1
  24. package/dist/drive/nfs/apple-double.js.map +1 -1
  25. package/dist/drive/nfs/nfs3.js +7 -11
  26. package/dist/drive/nfs/nfs3.js.map +1 -1
  27. package/dist/drive/operations.d.ts +10 -4
  28. package/dist/drive/operations.js +50 -8
  29. package/dist/drive/operations.js.map +1 -1
  30. package/dist/files-program/program.js +3 -0
  31. package/dist/files-program/program.js.map +1 -1
  32. package/dist/link-target.d.ts +4 -0
  33. package/dist/link-target.js +11 -3
  34. package/dist/link-target.js.map +1 -1
  35. package/dist/native/cloud-files.node +0 -0
  36. package/dist/native/windows-fs.node +0 -0
  37. package/dist/user-ground-host.d.ts +13 -0
  38. package/dist/user-ground-host.js +31 -1
  39. package/dist/user-ground-host.js.map +1 -1
  40. package/npm-shrinkwrap.json +6 -6
  41. package/package.json +5 -5
@@ -1,3 +1,54 @@
1
+ /**
2
+ * The drive's map of one root this computer serves on demand: Apply's door
3
+ * to it (Live drive/contracts.ts MapPort).
4
+ *
5
+ * Listed is the root's received state (received-state.ts) at the received
6
+ * prefix, the delivery cursor: the position a fetch lane pins (Live
7
+ * apply/lane.ts), so a touch places exactly the version the map lists, the
8
+ * newest this computer has received. Placed is a row stored in O, shown or
9
+ * hidden, and the map holds it where it stands on this computer, at the
10
+ * parent and name Detect or Apply last admitted: `ls` and `open` agree while
11
+ * Apply has not yet revealed an accepted move, and a person's new entity
12
+ * holds its slot beside what the map lists, so a listed namesake takes its
13
+ * derived name rather than hiding behind the person's. A folder's or
14
+ * workspace's version is the membership the map lists beneath it, at the
15
+ * place the map lists it: O's counts only the children this computer placed
16
+ * (detection/container-membership.ts), and the received one may name a place
17
+ * Apply has not yet moved it to. An observed absence, a person's `rm -rf`
18
+ * (ground-store.ts), stands nowhere: its top reads as no O row, as the
19
+ * relations read it (ground-relations.ts), so the map lists it where the line
20
+ * does, else nowhere, and a name a person removed holds no slot once the line
21
+ * says so. Each row it hides is still this computer's, so the shelf says the
22
+ * ground is gone rather than the map listing it again. An entity with no O
23
+ * row stands first where this computer's own newest record of it stands
24
+ * while the received prefix does not hold that record yet: a removal of a
25
+ * unit this computer never placed (Live drive/removal.ts), or of ground a
26
+ * person removed. The authority accepts this computer's records in their
27
+ * order, so that result is the next the line will say of it, and the map
28
+ * lists it so from the moment it is recorded.
29
+ *
30
+ * Each wake brings the map to the received prefix in the cost of what
31
+ * changed: the records accepted since its last position and the entities the
32
+ * wake names, those a window end or a Detect commit admitted (MapIndex,
33
+ * @amalgm/live/drive). A new kept head, or a fold the heads let go, loads the
34
+ * root again. The map holds its own HeldHeads over the computer's proven
35
+ * graphs, so its root's proven graph and fold stay resident while the drive
36
+ * is mounted: the rail's idle drops only the line's own, and the line's next
37
+ * read takes the graph the map still holds rather than proving it again.
38
+ * About twice the root's rows in memory, the fold's and the index's, beside
39
+ * the one graph.
40
+ *
41
+ * A look at a reference, a stat of it or a listing of the folder it stands
42
+ * in, needs only its root's top (Live drive/contracts.ts Top), so it loads no
43
+ * map: `readDriveTop` reads the root's own record where its map would list
44
+ * it, the O row else the fold's, through H's pages for that one record. The
45
+ * fold folds the root only when a result since H reaches it. That record's
46
+ * version is not the membership a map lists, since a membership change is
47
+ * never a record. It need not be until the drive lists inside the root; from
48
+ * then the drive holds the root's map, and its top is the map's root
49
+ * (drive/mount.ts composeDrive).
50
+ */
51
+ import { type CloudEntityRecord } from "@amalgm/live";
1
52
  import { type MapEntity, type MapPort } from "@amalgm/live/drive";
2
53
  import type Database from "better-sqlite3";
3
54
  import { HeldHeads, type ProvenGraphs } from "./received-state.js";
@@ -23,6 +74,12 @@ export declare class ApplyMap {
23
74
  get through(): number | null;
24
75
  /** How many entities the map lists, any status. */
25
76
  get size(): number;
77
+ /** The record the map lists for an entity this computer never placed, at
78
+ * the version it lists it: the base its removal records Trash on. Null
79
+ * when the map does not hold the entity, or holds less than its record (a
80
+ * repository's package is not kept here), or this computer holds it: a
81
+ * placed unit's removal is its shelf's. */
82
+ listed(uuid: string): CloudEntityRecord | null;
26
83
  /** Bring the map to the received prefix, taking `uuids` where they stand
27
84
  * now. One run at a time; a wake during a run is answered by one more run
28
85
  * after it, however many wakes arrive. Resolves when the run that saw this
package/dist/apply-map.js CHANGED
@@ -19,7 +19,13 @@
19
19
  * relations read it (ground-relations.ts), so the map lists it where the line
20
20
  * does, else nowhere, and a name a person removed holds no slot once the line
21
21
  * says so. Each row it hides is still this computer's, so the shelf says the
22
- * ground is gone rather than the map listing it again.
22
+ * ground is gone rather than the map listing it again. An entity with no O
23
+ * row stands first where this computer's own newest record of it stands
24
+ * while the received prefix does not hold that record yet: a removal of a
25
+ * unit this computer never placed (Live drive/removal.ts), or of ground a
26
+ * person removed. The authority accepts this computer's records in their
27
+ * order, so that result is the next the line will say of it, and the map
28
+ * lists it so from the moment it is recorded.
23
29
  *
24
30
  * Each wake brings the map to the received prefix in the cost of what
25
31
  * changed: the records accepted since its last position and the entities the
@@ -42,7 +48,7 @@
42
48
  * then the drive holds the root's map, and its top is the map's root
43
49
  * (drive/mount.ts composeDrive).
44
50
  */
45
- import { CONTAINERS, DERIVED_PAYLOAD, membershipVersion } from "@amalgm/live";
51
+ import { CONTAINERS, DERIVED_PAYLOAD, decodeLocalEntityRecord, membershipVersion } from "@amalgm/live";
46
52
  import { MapIndex, mapEntity } from "@amalgm/live/drive";
47
53
  import { readAcceptedTail } from "./accepted-tail.js";
48
54
  import { readDeliveryReceipt } from "./graph-heads.js";
@@ -100,6 +106,15 @@ export class ApplyMap {
100
106
  get size() {
101
107
  return this.#index.size;
102
108
  }
109
+ /** The record the map lists for an entity this computer never placed, at
110
+ * the version it lists it: the base its removal records Trash on. Null
111
+ * when the map does not hold the entity, or holds less than its record (a
112
+ * repository's package is not kept here), or this computer holds it: a
113
+ * placed unit's removal is its shelf's. */
114
+ listed(uuid) {
115
+ const entity = this.#index.get(uuid);
116
+ return entity === undefined || entity.type === "repo.git" || placed(this.#database, uuid) ? null : listedRecord(entity);
117
+ }
103
118
  /** Bring the map to the received prefix, taking `uuids` where they stand
104
119
  * now. One run at a time; a wake during a run is answered by one more run
105
120
  * after it, however many wakes arrive. Resolves when the run that saw this
@@ -134,7 +149,7 @@ export class ApplyMap {
134
149
  try {
135
150
  await this.#heads.read(this.#database, this.#authorityId, position, async (fold, _basis, through) => {
136
151
  if (fold !== this.#fold || this.#through === null || through < this.#through) {
137
- await this.#load(fold);
152
+ await this.#load(fold, through);
138
153
  this.#loads += 1;
139
154
  }
140
155
  else {
@@ -150,15 +165,15 @@ export class ApplyMap {
150
165
  throw error;
151
166
  }
152
167
  }
153
- /** Where one identity stands for the map (`standing`). */
154
- async #entry(fold, uuid) {
155
- return (await standing(this.#database, fold, [uuid])).get(uuid);
168
+ /** Where one identity stands for the map at `through` (`standing`). */
169
+ async #entry(fold, through, uuid) {
170
+ return (await standing(this.#database, this.#authorityId, through, fold, [uuid])).get(uuid);
156
171
  }
157
172
  /** The root where it stands, with everything that stands beneath it. */
158
- async #load(fold) {
173
+ async #load(fold, through) {
159
174
  const root = this.#index.rootUUID;
160
- const top = await this.#entry(fold, root);
161
- const records = top ? [top, ...await this.#beneath(fold, top, new Set([root]))] : [];
175
+ const top = await this.#entry(fold, through, root);
176
+ const records = top ? [top, ...await this.#beneath(fold, through, top, new Set([root]))] : [];
162
177
  this.#index.load(records);
163
178
  this.#derive(records.map(record => record.uuid));
164
179
  this.#onChange?.(null);
@@ -179,10 +194,10 @@ export class ApplyMap {
179
194
  }
180
195
  // Everything the run takes is read at once; an ancestor it climbs past
181
196
  // is read when the climb reaches it.
182
- const entries = await standing(this.#database, fold, [...changed]);
197
+ const entries = await standing(this.#database, this.#authorityId, through, fold, [...changed]);
183
198
  const entry = async (uuid) => {
184
199
  if (!entries.has(uuid))
185
- entries.set(uuid, await this.#entry(fold, uuid));
200
+ entries.set(uuid, await this.#entry(fold, through, uuid));
186
201
  return entries.get(uuid);
187
202
  };
188
203
  // An unchanged entity the index holds stands where the index says.
@@ -226,7 +241,7 @@ export class ApplyMap {
226
241
  parents.add(record.parentUUID);
227
242
  if (entering && !expanded.has(uuid)) {
228
243
  expanded.add(uuid);
229
- for (const beneath of await this.#beneath(fold, record, expanded))
244
+ for (const beneath of await this.#beneath(fold, through, record, expanded))
230
245
  index.accept(beneath);
231
246
  }
232
247
  }
@@ -248,15 +263,17 @@ export class ApplyMap {
248
263
  continue;
249
264
  const version = membershipVersion(entity, this.#index.children(uuid).filter(child => child.status === "active"), sha256Hex);
250
265
  if (version !== entity.version)
251
- this.#index.accept(containerRecord(entity, version));
266
+ this.#index.accept(listedRecord(entity, version));
252
267
  }
253
268
  }
254
269
  /** Everything that stands beneath `top`, each where it stands: a child is
255
- * a fold row or an O row whose own place, O's over the fold's, names its
256
- * container. A placed container moved here brings its listed
257
- * descendants, and a descendant placed elsewhere stays where it is.
270
+ * a fold row or an O row whose own place, O's over this computer's own
271
+ * newer record over the fold's, names its container. A placed container
272
+ * moved here brings its listed descendants, and a descendant placed
273
+ * elsewhere stays where it is. An own record that moves an unplaced child
274
+ * here is not walked to: a record of the drive's own changes only a status.
258
275
  * `expanded` holds what this pass already walked; nothing is walked twice. */
259
- async #beneath(fold, top, expanded) {
276
+ async #beneath(fold, through, top, expanded) {
260
277
  const found = [];
261
278
  for (let pending = [top], next = pending.pop(); next !== undefined; next = pending.pop()) {
262
279
  if (!CONTAINERS.has(next.type))
@@ -264,9 +281,10 @@ export class ApplyMap {
264
281
  const children = new Map();
265
282
  const listed = await fold.children(next.uuid);
266
283
  const stored = readObservedEntities(this.#database, listed.map(record => record.uuid));
284
+ const own = ownResults(this.#database, this.#authorityId, through, listed.filter(record => !stored.has(record.uuid)).map(record => record.uuid));
267
285
  for (const record of listed) {
268
286
  const row = stored.get(record.uuid);
269
- children.set(record.uuid, row ? portableGroundRecord(row) : record);
287
+ children.set(record.uuid, row ? portableGroundRecord(row) : own.get(record.uuid) ?? record);
270
288
  }
271
289
  for (const row of readObservedChildren(this.#database, next.uuid)) {
272
290
  if (!children.has(row.uuid))
@@ -288,38 +306,66 @@ export class ApplyMap {
288
306
  export function readDriveTop(input) {
289
307
  const { database, authorityId, rootUUID, heads } = input;
290
308
  const position = readDeliveryReceipt(database, authorityId)?.through ?? 0;
291
- return heads.read(database, authorityId, position, async (fold) => {
292
- const record = (await standing(database, fold, [rootUUID])).get(rootUUID);
309
+ return heads.read(database, authorityId, position, async (fold, _basis, through) => {
310
+ const record = (await standing(database, authorityId, through, fold, [rootUUID])).get(rootUUID);
293
311
  return record === null ? null : { entity: mapEntity(record), placed: placed(database, rootUUID) };
294
312
  });
295
313
  }
296
- /** Where each of `uuids` stands for the drive: its O row where this
297
- * computer's ground stands it, else the fold's row, else nowhere. */
298
- async function standing(database, fold, uuids) {
314
+ /** Where each of `uuids` stands for the drive at `through`: its O row where
315
+ * this computer's ground stands it, else this computer's own newer record
316
+ * (`ownResults`), else the fold's row, else nowhere. */
317
+ async function standing(database, authorityId, through, fold, uuids) {
299
318
  const stored = readObservedEntities(database, uuids);
319
+ const own = ownResults(database, authorityId, through, uuids.filter(uuid => !stored.has(uuid)));
300
320
  const entries = new Map();
301
321
  for (const uuid of uuids) {
302
322
  const row = stored.get(uuid);
303
- entries.set(uuid, row ? portableGroundRecord(row) : (await fold.locate(uuid))?.record ?? null);
323
+ entries.set(uuid, row ? portableGroundRecord(row) : own.get(uuid) ?? (await fold.locate(uuid))?.record ?? null);
304
324
  }
305
325
  return entries;
306
326
  }
327
+ /** For each of `uuids` this computer has recorded since the received prefix
328
+ * at `through` last held its record: the result of its newest Outbox record,
329
+ * neither stamped at nor received by `through`. The authority accepts this
330
+ * computer's records in their order, so that result follows whatever the
331
+ * prefix holds. */
332
+ function ownResults(database, authorityId, through, uuids) {
333
+ const results = new Map();
334
+ const statement = cachedStatement(database, `SELECT o.record_json FROM record_outbox o
335
+ WHERE o.authority_id = ? AND o.entity_id IN (SELECT value FROM json_each(?))
336
+ AND (o.delivery_sequence IS NULL OR o.delivery_sequence > ?)
337
+ AND NOT EXISTS (SELECT 1 FROM record_inbox i
338
+ WHERE i.entity_id = o.entity_id AND i.mutation_id = o.mutation_id AND i.delivery_sequence <= ?)
339
+ ORDER BY o.local_sequence`).pluck();
340
+ for (let at = 0; at < uuids.length; at += ASKED_AT_ONCE) {
341
+ const asked = JSON.stringify(uuids.slice(at, at + ASKED_AT_ONCE));
342
+ for (const json of statement.all(authorityId, asked, through, through)) {
343
+ const { result } = decodeLocalEntityRecord(json).change;
344
+ results.set(result.uuid, result);
345
+ }
346
+ }
347
+ return results;
348
+ }
349
+ /** Entities asked of the Outbox in one statement. */
350
+ const ASKED_AT_ONCE = 1000;
307
351
  /** Whether this computer holds an entity: O stores a row for it, shown or
308
352
  * hidden. */
309
353
  const placed = (database, uuid) => cachedStatement(database, `SELECT 1 FROM ${STORED_ENTITIES} WHERE uuid = ? LIMIT 1`).pluck().get(uuid) !== undefined;
310
- /** A listed folder or workspace at another membership version; its payload is
311
- * derived, so the map entity carries all it has. */
312
- const containerRecord = (entity, version) => ({
354
+ /** The record a map entity lists, at `version`: a folder's or workspace's
355
+ * membership version is derived, so the map entity carries all its record
356
+ * has, and every other type but a repository keeps its whole record in it
357
+ * (Live drive/map-index.ts mapEntity). */
358
+ const listedRecord = (entity, version = entity.version) => ({
313
359
  uuid: entity.uuid,
314
360
  type: entity.type,
315
361
  parentUUID: entity.parentUUID,
316
362
  name: entity.name,
317
363
  status: entity.status,
318
364
  version,
319
- payloadVersion: null,
365
+ payloadVersion: entity.type === "reference" ? entity.target : entity.payloadVersion,
320
366
  fileMode: entity.fileMode,
321
- size: null,
322
- linkTarget: null,
367
+ size: entity.size,
368
+ linkTarget: entity.type === "link" ? entity.target : null,
323
369
  transportVersion: null,
324
370
  });
325
371
  //# sourceMappingURL=apply-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply-map.js","sourceRoot":"","sources":["../src/apply-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAA0B,MAAM,cAAc,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAgC,MAAM,oBAAoB,CAAC;AAIvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,oBAAoB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qDAAqD;AACrD,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;aACa;AACb,MAAM,MAAM,GAAG,CAAC,QAA2B,EAAE,IAAY,EAAW,EAAE,CACpE,eAAe,CAAC,QAAQ,EAAE,iBAAiB,eAAe,yBAAyB,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;AAEvH;;;0CAG0C;AAC1C,MAAM,YAAY,GAAG,CAAC,MAAiB,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAqB,EAAE,CAAC,CAAC;IACxF,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,UAAU,EAAE,MAAM,CAAC,UAAU;IAC7B,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,OAAO;IACP,cAAc,EAAE,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc;IACnF,QAAQ,EAAE,MAAM,CAAC,QAAQ;IACzB,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,UAAU,EAAE,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;IACzD,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAC"}
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * The door's answer to each ask Windows makes of the sync root, by the same
3
3
  * rule as every other door (operations.ts): a listing places nothing but a
4
- * repository's door (contents.ts) and the links it shows, each made beside
5
- * the placeholders before the answer, so the first look inside shows it; one
6
- * that cannot be placed now is made after it (reconcile.ts). A fetch opens the
4
+ * repository's door and a link the drive lists without its target
5
+ * (contents.ts). Each link it shows is made beside the placeholders before
6
+ * the answer, so the first look inside shows it; one that cannot be placed
7
+ * now is made after it (reconcile.ts). A fetch opens the
7
8
  * address, which places it, and reads the shelf's own bytes; a rename within
8
9
  * the root changes the shelf first and is acknowledged only once the shelf
9
10
  * says so, so a refusal there (EPERM where only another computer moves a
@@ -65,10 +66,12 @@ export async function answer(sync, writes, reconcile, connection, serving, event
65
66
  async function list(sync, reconcile, connection, serving, event, at) {
66
67
  if (at === null)
67
68
  throw errno("ENOENT");
68
- const { items, links, uuid } = await contents(serving, at, sync.mounted);
69
+ const { items, links, unplaced, uuid } = await contents(serving, sync, at);
69
70
  // Windows holds the folder for its answer: a link made in it now stands
70
71
  // beside the placeholders when the answer lets the person look.
71
- const placed = await Promise.allSettled(links.map((name) => linkAt(serving, at, name)));
72
+ const placed = await Promise.allSettled(unplaced.map((name) => linkAt(serving, at, name)));
73
+ for (const link of links)
74
+ makeLink(sync, childOf(at, link.name), link.target, link.directory);
72
75
  for (const one of placed) {
73
76
  if (one.status === "fulfilled")
74
77
  makeLink(sync, childOf(at, one.value.name), one.value.target, one.value.directory);
@@ -120,8 +123,9 @@ async function fetch(sync, connection, operations, event, at) {
120
123
  }
121
124
  binding.finish(connection, event.id, binding.constants.STATUS_SUCCESS);
122
125
  // The placeholder now holds the shelf's bytes: it says so, or the next
123
- // look at its folder takes it for a stale one and drops them.
124
- if (stats.size === event.fileSize) {
126
+ // look at its folder takes it for a stale one and drops them. Not once a
127
+ // person has appended to it: that is theirs, and travels (writes.ts).
128
+ if (stats.size === event.fileSize && binding.state(event.path)?.size === stats.size) {
125
129
  const { hr } = binding.update(event.path, {
126
130
  identity: identityText({ v: null, s: stamp(stats) }), inSync: true, verify: true, dehydrate: false,
127
131
  });
@@ -161,16 +165,16 @@ async function rename(sync, writes, serving, event, at) {
161
165
  }
162
166
  /** Says a placeholder may leave the sync root where the drive would remove
163
167
  * it: EPERM where its address names no ground, only where a folder lives on
164
- * its computer (operations.ts). The shelf keeps it until it has gone. */
168
+ * its computer (operations.ts). It places nothing: once the placeholder has
169
+ * gone, the drive removes it (writes.ts `left`), and what it never placed is
170
+ * recorded with none of its bytes. Windows fetches for itself what a move
171
+ * out of the sync root carries. */
165
172
  async function leave(sync, writes, serving, at) {
166
173
  if (at === null || at === "/")
167
174
  throw errno("EPERM");
168
175
  await writes.after([at], async () => {
169
- const touched = await serving.drive.change(addressOf(at));
170
- if (touched === null)
176
+ if (!(await serving.drive.removable(addressOf(at))))
171
177
  throw errno("EPERM");
172
- for (const receipt of touched.placed)
173
- serving.onPlaced?.(receipt);
174
178
  sync.leaving.add(at.toLowerCase());
175
179
  });
176
180
  }
@@ -1 +1 @@
1
- {"version":3,"file":"asks.js","sourceRoot":"","sources":["../../../src/drive/cloud-files/asks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAwB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAyC,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAiB,MAAM,gBAAgB,CAAC;AAGpG,0EAA0E;AAC1E,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,wEAAwE;AACxE,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;AAEtB,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAc,EAAE,MAA6B,EAAE,SAAmC,EAClF,UAAsB,EAAE,OAAgB,EAAE,KAAsB;IAEhE,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAA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,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;gBAAE,MAAM,KAAK,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5B,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACxB,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;mCAKmC;AACnC,KAAK,UAAU,KAAK,CAAC,IAAc,EAAE,MAA6B,EAAE,OAAgB,EAAE,EAAiB;IACrG,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,GAAG;QAAE,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE;QAClC,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAAE,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -10,11 +10,14 @@
10
10
  * A Windows listing is answered once and whole, so a repository's folder is
11
11
  * listed only once its `.git` can be said as what it is: listing the folder
12
12
  * places the repository, as a look at its door does on every computer.
13
- * A link is named, not placed: only its placement says whether its target is
14
- * a folder, which Windows must know to make it, so the listing places each
15
- * (`linkAt`) and makes it beside the placeholders, never a placeholder itself
16
- * (asks.ts). One link that cannot be placed now keeps no other name from
17
- * showing, and is made after the listing (reconcile.ts).
13
+ * A link is made beside the placeholders, never a placeholder itself
14
+ * (asks.ts), and a look places nothing for it: the drive lists its target,
15
+ * which is written at this computer's disk as link-target.ts writes every
16
+ * link, so it reads back exactly; and whether it leads to a folder, which
17
+ * Windows must know to make it, is what the drive says stands where it
18
+ * leads. Only a link the drive lists without its target (a reference) is
19
+ * placed first (`linkAt`); one that cannot be placed now keeps no other name
20
+ * from showing, and is made after the listing (reconcile.ts).
18
21
  * A reference into a root this person holds stands on the shelf as a link,
19
22
  * but the drive shows that root inline where it stands: it is a folder, as
20
23
  * every computer's look says, never a link to place.
@@ -24,6 +27,7 @@ import type { Drive, Receipt } from "@amalgm/live/drive";
24
27
  import { type DriveOperations } from "../operations.js";
25
28
  import type { Shelf } from "../shelf.js";
26
29
  import type { Item } from "./binding.js";
30
+ import type { SyncRoot } from "./sync-root.js";
27
31
  /** What the door answers through now: one ground's drive, its operations
28
32
  * and shelves. */
29
33
  export interface Serving {
@@ -42,8 +46,11 @@ export interface Link {
42
46
  }
43
47
  export interface Contents {
44
48
  readonly items: readonly Item[];
45
- /** The names the folder shows as links, each placed by `linkAt`. */
46
- readonly links: readonly string[];
49
+ /** The links the folder shows, each as the sync root makes it. */
50
+ readonly links: readonly Link[];
51
+ /** The names the folder shows as links the drive lists without a target,
52
+ * each placed by `linkAt` to say it. */
53
+ readonly unplaced: readonly string[];
47
54
  /** The entity the folder shows, when the map names one. */
48
55
  readonly uuid: string | null;
49
56
  }
@@ -51,7 +58,7 @@ export interface Contents {
51
58
  * or ENOTDIR where the drive shows no folder, with EIO where a file's record
52
59
  * states no size, and with a placement's failure when a repository
53
60
  * could not be placed. */
54
- export declare function contents(serving: Serving, at: string, mounted: Date): Promise<Contents>;
61
+ export declare function contents(serving: Serving, sync: Pick<SyncRoot, "root" | "mounted">, at: string): Promise<Contents>;
55
62
  /** A placeholder for a shelf file, standing for its bytes there. */
56
63
  export declare const placed: (name: string, stats: Stats) => Item;
57
64
  /** The link a folder at a drive path shows by name, placed, as the sync root
@@ -10,24 +10,30 @@
10
10
  * A Windows listing is answered once and whole, so a repository's folder is
11
11
  * listed only once its `.git` can be said as what it is: listing the folder
12
12
  * places the repository, as a look at its door does on every computer.
13
- * A link is named, not placed: only its placement says whether its target is
14
- * a folder, which Windows must know to make it, so the listing places each
15
- * (`linkAt`) and makes it beside the placeholders, never a placeholder itself
16
- * (asks.ts). One link that cannot be placed now keeps no other name from
17
- * showing, and is made after the listing (reconcile.ts).
13
+ * A link is made beside the placeholders, never a placeholder itself
14
+ * (asks.ts), and a look places nothing for it: the drive lists its target,
15
+ * which is written at this computer's disk as link-target.ts writes every
16
+ * link, so it reads back exactly; and whether it leads to a folder, which
17
+ * Windows must know to make it, is what the drive says stands where it
18
+ * leads. Only a link the drive lists without its target (a reference) is
19
+ * placed first (`linkAt`); one that cannot be placed now keeps no other name
20
+ * from showing, and is made after the listing (reconcile.ts).
18
21
  * A reference into a root this person holds stands on the shelf as a link,
19
22
  * but the drive shows that root inline where it stands: it is a folder, as
20
23
  * every computer's look says, never a link to place.
21
24
  */
22
- import { lstatSync, statSync } from "node:fs";
25
+ import { lstatSync, readlinkSync, statSync } from "node:fs";
26
+ import { win32 } from "node:path";
27
+ import { diskLinkTarget } from "../../link-target.js";
23
28
  import { addressOf, errno } from "../operations.js";
24
- import { childOf, identityText, missing, stamp } from "./paths.js";
29
+ import { childOf, drivePath, identityText, missing, stamp, syncPath } from "./paths.js";
25
30
  /** The folder at a drive path as the drive shows it now. Rejects with ENOENT
26
31
  * or ENOTDIR where the drive shows no folder, with EIO where a file's record
27
32
  * states no size, and with a placement's failure when a repository
28
33
  * could not be placed. */
29
- export async function contents(serving, at, mounted) {
34
+ export async function contents(serving, sync, at) {
30
35
  const { drive, operations } = serving;
36
+ const { root, mounted } = sync;
31
37
  let listed = await drive.list(addressOf(at));
32
38
  if (listed.kind === "place-first") {
33
39
  await operations.place(at);
@@ -46,6 +52,7 @@ export async function contents(serving, at, mounted) {
46
52
  throw errno("EIO");
47
53
  const items = [];
48
54
  const links = [];
55
+ const unplaced = [];
49
56
  const shelf = serving.shelf(listed.root);
50
57
  if (!listed.complete) {
51
58
  for (const name of shelf.names(listed.address) ?? []) {
@@ -63,10 +70,10 @@ export async function contents(serving, at, mounted) {
63
70
  }
64
71
  if (stats.isSymbolicLink()) {
65
72
  const into = await entered(serving, at, name, listed.root, mounted);
66
- if (into === null)
67
- links.push(name);
68
- else
73
+ if (into !== null)
69
74
  items.push(into);
75
+ else
76
+ links.push(await shown(serving, root, at, name, readlinkSync(path)));
70
77
  }
71
78
  else if (stats.isDirectory())
72
79
  items.push(folder(name, stats.mtimeMs, stats.birthtimeMs));
@@ -87,12 +94,16 @@ export async function contents(serving, at, mounted) {
87
94
  for (const entry of listed.entries) {
88
95
  if (entry.kind === "directory")
89
96
  items.push(folder(entry.name, mounted.getTime()));
90
- else if (entry.kind === "link")
91
- links.push(entry.name);
97
+ else if (entry.kind !== "link")
98
+ continue;
99
+ else if (entry.target === null)
100
+ unplaced.push(entry.name);
101
+ else
102
+ links.push(await shown(serving, root, at, entry.name, diskLinkTarget(entry.target)));
92
103
  }
93
104
  const where = await drive.where(addressOf(at));
94
105
  const uuid = where.kind === "shelf" ? where.entity?.uuid ?? null : where.kind === "listed" ? where.entry.uuid : null;
95
- return { items, links, uuid };
106
+ return { items, links, unplaced, uuid };
96
107
  }
97
108
  /** A placeholder for a shelf file, standing for its bytes there. */
98
109
  export const placed = (name, stats) => ({
@@ -123,6 +134,35 @@ async function entered(serving, at, name, root, mounted) {
123
134
  }
124
135
  return stats.isDirectory() ? folder(name, stats.mtimeMs, stats.birthtimeMs) : null;
125
136
  }
137
+ /** A link the folder at a drive path shows, as the sync root makes it: its
138
+ * target as this computer's disk keeps it, and whether it leads to a folder. */
139
+ async function shown(serving, root, at, name, target) {
140
+ return { name, target, directory: await leadsToFolder(serving, root, at, target) };
141
+ }
142
+ /** Whether a link's target, resolved from the folder at a drive path where
143
+ * the link stands, is a folder, placing nothing: inside the drive, as the
144
+ * drive lists it or the shelf holds it there; outside, as the disk holds it.
145
+ * A target on another computer ("\\server") is never looked at. One that
146
+ * cannot be looked at, or leads nowhere, makes a file link, as in Node. */
147
+ async function leadsToFolder(serving, root, at, target) {
148
+ if (/^[\\/]{2}/.test(target))
149
+ return false;
150
+ const full = win32.resolve(syncPath(root, at), target);
151
+ const inside = drivePath(root, full);
152
+ try {
153
+ if (inside === null)
154
+ return statSync(full).isDirectory();
155
+ const where = await serving.drive.where(addressOf(inside));
156
+ if (where.kind === "listed")
157
+ return where.entry.kind === "directory";
158
+ if (where.kind === "shelf")
159
+ return statSync(serving.shelf(where.root).path(where.address)).isDirectory();
160
+ return false;
161
+ }
162
+ catch {
163
+ return false;
164
+ }
165
+ }
126
166
  /** The link a folder at a drive path shows by name, placed, as the sync root
127
167
  * makes it: its own target text, and the kind of what that target is on the
128
168
  * shelf, a file when nothing stands there. Rejects as its placement does. */