@amalgm/live 0.2.81-main.41789770770 → 0.2.81-main.41819695622
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/PURPOSE.md +13 -11
- package/dist/apply/showing.d.ts +6 -6
- package/dist/apply/showing.js +6 -6
- package/dist/drive/contracts.d.ts +5 -0
- package/dist/drive/contracts.d.ts.map +1 -1
- package/dist/drive/contracts.js.map +1 -1
- package/dist/drive/drive.d.ts +12 -1
- package/dist/drive/drive.d.ts.map +1 -1
- package/dist/drive/drive.js +14 -1
- package/dist/drive/drive.js.map +1 -1
- package/dist/drive/listing.d.ts +3 -1
- package/dist/drive/listing.d.ts.map +1 -1
- package/dist/drive/listing.js +17 -6
- package/dist/drive/listing.js.map +1 -1
- package/dist/drive/where.d.ts +9 -0
- package/dist/drive/where.d.ts.map +1 -1
- package/dist/drive/where.js +26 -0
- package/dist/drive/where.js.map +1 -1
- package/dist/files/commands.d.ts +16 -7
- package/dist/files/commands.d.ts.map +1 -1
- package/dist/files/commands.js +8 -3
- package/dist/files/commands.js.map +1 -1
- package/dist/files/computer-address.d.ts +11 -0
- package/dist/files/computer-address.d.ts.map +1 -0
- package/dist/files/computer-address.js +45 -0
- package/dist/files/computer-address.js.map +1 -0
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.d.ts.map +1 -1
- package/dist/files/index.js +1 -0
- package/dist/files/index.js.map +1 -1
- package/dist/git/index.d.ts +1 -0
- package/dist/git/index.d.ts.map +1 -1
- package/dist/git/index.js +1 -0
- package/dist/git/index.js.map +1 -1
- package/dist/git/locks.d.ts +27 -0
- package/dist/git/locks.d.ts.map +1 -0
- package/dist/git/locks.js +35 -0
- package/dist/git/locks.js.map +1 -0
- package/dist/git/merge.js +1 -1
- package/dist/git/merge.js.map +1 -1
- package/dist/git/plan.d.ts +0 -1
- package/dist/git/plan.d.ts.map +1 -1
- package/dist/git/plan.js +1 -1
- package/dist/git/plan.js.map +1 -1
- package/dist/registration/home-layout.d.ts +9 -4
- package/dist/registration/home-layout.d.ts.map +1 -1
- package/dist/registration/home-layout.js +10 -5
- package/dist/registration/home-layout.js.map +1 -1
- package/dist-cjs/apply/showing.js +6 -6
- package/dist-cjs/drive/contracts.js.map +1 -1
- package/dist-cjs/drive/drive.js +13 -0
- package/dist-cjs/drive/drive.js.map +1 -1
- package/dist-cjs/drive/listing.js +17 -6
- package/dist-cjs/drive/listing.js.map +1 -1
- package/dist-cjs/drive/where.js +27 -0
- package/dist-cjs/drive/where.js.map +1 -1
- package/dist-cjs/files/commands.js +8 -3
- package/dist-cjs/files/commands.js.map +1 -1
- package/dist-cjs/files/computer-address.js +49 -0
- package/dist-cjs/files/computer-address.js.map +1 -0
- package/dist-cjs/files/index.js +4 -1
- package/dist-cjs/files/index.js.map +1 -1
- package/dist-cjs/git/index.js +1 -0
- package/dist-cjs/git/index.js.map +1 -1
- package/dist-cjs/git/locks.js +40 -0
- package/dist-cjs/git/locks.js.map +1 -0
- package/dist-cjs/git/merge.js +3 -3
- package/dist-cjs/git/merge.js.map +1 -1
- package/dist-cjs/git/plan.js +2 -4
- package/dist-cjs/git/plan.js.map +1 -1
- package/dist-cjs/registration/home-layout.js +11 -5
- package/dist-cjs/registration/home-layout.js.map +1 -1
- package/package.json +4 -4
package/PURPOSE.md
CHANGED
|
@@ -546,17 +546,19 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
|
|
|
546
546
|
root labels and separators; the separate nonempty, NUL-free host path owns
|
|
547
547
|
the address and never derives from the display name.
|
|
548
548
|
47. **An unfinished Git operation is settled Git-directory truth.** A stable
|
|
549
|
-
merge, rebase, cherry-pick or revert leaves its files in the Git
|
|
550
|
-
unmerged index stages included, and they travel byte for byte
|
|
551
|
-
other file, so another machine can continue or resolve the same
|
|
552
|
-
its conflicted working-tree files travel as ordinary files.
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
549
|
+
merge, rebase, cherry-pick or revert leaves its files in the Git
|
|
550
|
+
directory, unmerged index stages included, and they travel byte for byte
|
|
551
|
+
like every other file, so another machine can continue or resolve the same
|
|
552
|
+
operation; its conflicted working-tree files travel as ordinary files. A
|
|
553
|
+
lock still standing after Git's longest lock wait (1 s) travels too: a
|
|
554
|
+
command left unfinished on one machine stands unfinished on the other. A
|
|
555
|
+
lock Git holds only while it works stays on its own machine: Detect holds
|
|
556
|
+
the repository until it goes (`src/git/locks.ts`). Apply clears a lock
|
|
557
|
+
only when the synced state holds it; any other lock is a Git command at
|
|
558
|
+
work on that machine, and Apply waits for it rather than remove it. A
|
|
559
|
+
repository new on a machine is built whole in private and revealed by one
|
|
560
|
+
rename, so no half-built repository is ever shown. No layer may turn a
|
|
561
|
+
durable conflict into a busy retry or silently flatten it.
|
|
560
562
|
48. **A slot collision changes materialization, never identity.** Mutation-time
|
|
561
563
|
guards refuse a second local owner of one `(parentUUID, name)` slot, but a
|
|
562
564
|
merged graph may contain identities created concurrently in that slot.
|
package/dist/apply/showing.d.ts
CHANGED
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
*
|
|
38
38
|
* A root places some of its entries whatever their unit. A home places
|
|
39
39
|
* what login places (registration/home-layout.ts placedAtHome): the
|
|
40
|
-
* runtime's own entries whole, and the projects
|
|
41
|
-
* result at or beneath one of the runtime's own entries
|
|
42
|
-
* folder that arrives enters without
|
|
43
|
-
* listed. Any other root, such as a workspace a
|
|
44
|
-
* places only its sharing policy at its top,
|
|
45
|
-
* there. `placedInRoot` asks this of each member of an Enter too.
|
|
40
|
+
* runtime's own entries whole, and the projects and computers folders bare.
|
|
41
|
+
* So in a home a result at or beneath one of the runtime's own entries
|
|
42
|
+
* enters, a projects or computers folder that arrives enters without what it
|
|
43
|
+
* holds, and anything else is listed. Any other root, such as a workspace a
|
|
44
|
+
* home's reference leads to, places only its sharing policy at its top,
|
|
45
|
+
* which Detect reads from disk there. `placedInRoot` asks this of each member of an Enter too.
|
|
46
46
|
*
|
|
47
47
|
* A construct is its own root and its own authority, and has no ground.
|
|
48
48
|
* Holding its line is this computer's selection of it, so every active
|
package/dist/apply/showing.js
CHANGED
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
*
|
|
38
38
|
* A root places some of its entries whatever their unit. A home places
|
|
39
39
|
* what login places (registration/home-layout.ts placedAtHome): the
|
|
40
|
-
* runtime's own entries whole, and the projects
|
|
41
|
-
* result at or beneath one of the runtime's own entries
|
|
42
|
-
* folder that arrives enters without
|
|
43
|
-
* listed. Any other root, such as a workspace a
|
|
44
|
-
* places only its sharing policy at its top,
|
|
45
|
-
* there. `placedInRoot` asks this of each member of an Enter too.
|
|
40
|
+
* runtime's own entries whole, and the projects and computers folders bare.
|
|
41
|
+
* So in a home a result at or beneath one of the runtime's own entries
|
|
42
|
+
* enters, a projects or computers folder that arrives enters without what it
|
|
43
|
+
* holds, and anything else is listed. Any other root, such as a workspace a
|
|
44
|
+
* home's reference leads to, places only its sharing policy at its top,
|
|
45
|
+
* which Detect reads from disk there. `placedInRoot` asks this of each member of an Enter too.
|
|
46
46
|
*
|
|
47
47
|
* A construct is its own root and its own authority, and has no ground.
|
|
48
48
|
* Holding its line is this computer's selection of it, so every active
|
|
@@ -63,6 +63,11 @@ export interface Root {
|
|
|
63
63
|
export interface RootsPort {
|
|
64
64
|
/** The root the drive stands over: the person's home, their core root. */
|
|
65
65
|
readonly home: Root;
|
|
66
|
+
/** This computer's own folder in the home's computers folder
|
|
67
|
+
* (`files/<computer>`), or null before it has one. Its ground already
|
|
68
|
+
* stands where it lives on this computer, so the drive never shows it a
|
|
69
|
+
* second time. */
|
|
70
|
+
readonly computer: string | null;
|
|
66
71
|
/** The root a reference leads to, or null when this person's accepted
|
|
67
72
|
* graph holds no such root. Asked on every walk that reaches the
|
|
68
73
|
* reference, so a host answers repeat asks from what it already holds. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/drive/contracts.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AC;QACjH,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAA4B,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACvG,CAAC;CACF;AAED,MAAM,aAAa,GAAwB,IAAI,GAAG,CAChD,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,CAAkC,CACrE,CAAC"}
|
package/dist/drive/drive.d.ts
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* writes, renames, removes, changes or follows an address touches it first,
|
|
9
9
|
* and a creation touches the address it creates at, so its ancestors stand.
|
|
10
10
|
* After a touch the shelf speaks, and the host does what it would do on any
|
|
11
|
-
* folder, on the shelf of the root the judgment names.
|
|
11
|
+
* folder, on the shelf of the root the judgment names. An operation that
|
|
12
|
+
* creates, renames, removes or changes an address asks `change` instead,
|
|
13
|
+
* which refuses an address that names no ground (`addressOnly`).
|
|
12
14
|
*/
|
|
13
15
|
import type { DrivePorts } from './contracts.js';
|
|
14
16
|
import { type Listing } from './listing.js';
|
|
@@ -30,6 +32,15 @@ export declare class Drive {
|
|
|
30
32
|
* places nothing. Rejects with a `DriveError` when a unit could not be
|
|
31
33
|
* placed; the shelf is then as it was. */
|
|
32
34
|
touch(path: readonly string[]): Promise<Touched>;
|
|
35
|
+
/** A touch for an operation that changes the address itself: a creation,
|
|
36
|
+
* rename, removal, truncation or change of its mode, owner or times. Null,
|
|
37
|
+
* placing nothing, when the address names no ground: the computers folder,
|
|
38
|
+
* the folders of an added folder's path, its reference, and the top of the
|
|
39
|
+
* root it leads into say where a folder lives on its computer, and only
|
|
40
|
+
* that computer moves it. Beneath this computer's own folder there is
|
|
41
|
+
* nothing to change: the drive never shows it. */
|
|
42
|
+
change(path: readonly string[]): Promise<Touched | null>;
|
|
43
|
+
private settle;
|
|
33
44
|
/** Placements in flight now; the activity hook hears the same count. */
|
|
34
45
|
placing(): number;
|
|
35
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../src/drive/drive.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../src/drive/drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAsB,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,OAAO;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CACrC;AAED,qBAAa,KAAK;IAGJ,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;gBAEX,KAAK,EAAE,UAAU;IAI9C,KAAK,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;IAI9C,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C;;;8CAG0C;IACpC,KAAK,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD;;;;;;sDAMkD;IAC5C,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;YAKhD,MAAM;IAMpB,wEAAwE;IACxE,OAAO,IAAI,MAAM;CAGlB"}
|
package/dist/drive/drive.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { listing } from './listing.js';
|
|
2
2
|
import { Placements } from './placements.js';
|
|
3
|
-
import { where } from './where.js';
|
|
3
|
+
import { addressOnly, where } from './where.js';
|
|
4
4
|
export class Drive {
|
|
5
5
|
ports;
|
|
6
6
|
placements;
|
|
@@ -19,7 +19,20 @@ export class Drive {
|
|
|
19
19
|
* places nothing. Rejects with a `DriveError` when a unit could not be
|
|
20
20
|
* placed; the shelf is then as it was. */
|
|
21
21
|
async touch(path) {
|
|
22
|
+
return this.settle(path, await this.where(path));
|
|
23
|
+
}
|
|
24
|
+
/** A touch for an operation that changes the address itself: a creation,
|
|
25
|
+
* rename, removal, truncation or change of its mode, owner or times. Null,
|
|
26
|
+
* placing nothing, when the address names no ground: the computers folder,
|
|
27
|
+
* the folders of an added folder's path, its reference, and the top of the
|
|
28
|
+
* root it leads into say where a folder lives on its computer, and only
|
|
29
|
+
* that computer moves it. Beneath this computer's own folder there is
|
|
30
|
+
* nothing to change: the drive never shows it. */
|
|
31
|
+
async change(path) {
|
|
22
32
|
const before = await this.where(path);
|
|
33
|
+
return addressOnly(this.ports.roots, path, before) ? null : this.settle(path, before);
|
|
34
|
+
}
|
|
35
|
+
async settle(path, before) {
|
|
23
36
|
const placing = 'placing' in before ? before.placing : [];
|
|
24
37
|
const placed = placing.length === 0 ? [] : await this.placements.place(placing);
|
|
25
38
|
return { where: placed.length === 0 ? before : await this.where(path), placed };
|
package/dist/drive/drive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.js","sourceRoot":"","sources":["../../src/drive/drive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drive.js","sourceRoot":"","sources":["../../src/drive/drive.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,UAAU,EAAgB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAc,MAAM,YAAY,CAAC;AAQ5D,MAAM,OAAO,KAAK;IAGa;IAFZ,UAAU,C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,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAClF,CAAC;IAED,wEAAwE;IACxE,OAAO;QACL,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CACF"}
|
package/dist/drive/listing.d.ts
CHANGED
|
@@ -5,13 +5,15 @@ export type Listing =
|
|
|
5
5
|
* `complete` when nothing stands on the shelf, so these are the whole
|
|
6
6
|
* listing; otherwise the host lists that shelf's directory and shows these
|
|
7
7
|
* beside it. `doors` are names the map cannot describe, an unplaced
|
|
8
|
-
* repository's `.git`: listed by name, and a look at one places it.
|
|
8
|
+
* repository's `.git`: listed by name, and a look at one places it.
|
|
9
|
+
* `hidden` are shelf names the host leaves out of its listing. */
|
|
9
10
|
{
|
|
10
11
|
readonly kind: 'entries';
|
|
11
12
|
readonly root: string;
|
|
12
13
|
readonly address: readonly string[];
|
|
13
14
|
readonly entries: readonly Entry[];
|
|
14
15
|
readonly doors: readonly string[];
|
|
16
|
+
readonly hidden: readonly string[];
|
|
15
17
|
readonly complete: boolean;
|
|
16
18
|
}
|
|
17
19
|
/** Inside an unplaced repository's door: place `placing`, then list the shelf. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/drive/listing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/drive/listing.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAa,SAAS,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAuC,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAE7E,MAAM,MAAM,OAAO;AACjB;;;;;kEAKkE;AAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE;AACjO,kFAAkF;GAChF;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAA;CAAE,GACnE;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEhC,wBAAsB,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BzF"}
|
package/dist/drive/listing.js
CHANGED
|
@@ -6,28 +6,33 @@
|
|
|
6
6
|
* person's graph holds is listed as a directory, since the walk shows that
|
|
7
7
|
* root inline where the reference stands. An unplaced repository lists its
|
|
8
8
|
* files from the map and its `.git` as a door, so finding a repository needs
|
|
9
|
-
* no bytes; only listing inside the door places it first.
|
|
9
|
+
* no bytes; only listing inside the door places it first. The computers
|
|
10
|
+
* folder never lists this computer's own folder: the walk finds it nowhere.
|
|
10
11
|
*/
|
|
11
12
|
import { REPOSITORY_METADATA } from '../detection/classify.js';
|
|
12
13
|
import { CONTAINERS } from '../entities/types.js';
|
|
14
|
+
import { FILES_FOLDER } from '../registration/home-layout.js';
|
|
13
15
|
import { active, derivedNames, entryOf, walk } from './where.js';
|
|
14
16
|
export async function listing(roots, path) {
|
|
15
17
|
const { where: at, root } = await walk(roots, path);
|
|
16
18
|
switch (at.kind) {
|
|
17
19
|
case 'shelf': {
|
|
20
|
+
const hidden = hiddenAt(roots, at.root, at.address);
|
|
18
21
|
if (at.entity === null || !CONTAINERS.has(at.entity.type))
|
|
19
|
-
return { kind: 'entries', root: at.root, address: at.address, entries: [], doors: [], complete: false };
|
|
22
|
+
return { kind: 'entries', root: at.root, address: at.address, entries: [], doors: [], hidden, complete: false };
|
|
20
23
|
const shelf = new Set(root.shelf.names(at.address) ?? []);
|
|
21
24
|
const unplaced = derivedNames(active(root.map.children(at.entity.uuid)))
|
|
22
|
-
.filter(([child, name]) => !root.map.placed(child.uuid) && !shelf.has(name));
|
|
23
|
-
return { kind: 'entries', root: at.root, address: at.address, entries: await entries(roots, unplaced), doors: [], complete: false };
|
|
25
|
+
.filter(([child, name]) => !root.map.placed(child.uuid) && !shelf.has(name) && !hidden.includes(name));
|
|
26
|
+
return { kind: 'entries', root: at.root, address: at.address, entries: await entries(roots, unplaced), doors: [], hidden, complete: false };
|
|
24
27
|
}
|
|
25
28
|
case 'listed': {
|
|
26
29
|
if (at.entry.kind !== 'directory')
|
|
27
30
|
return { kind: 'notdir' };
|
|
28
|
-
const
|
|
31
|
+
const hidden = hiddenAt(roots, at.root, at.address);
|
|
32
|
+
const children = derivedNames(active(root.map.children(at.entry.uuid)))
|
|
33
|
+
.filter(([, name]) => !hidden.includes(name));
|
|
29
34
|
const doors = at.entry.type === 'repo.git' ? [REPOSITORY_METADATA] : [];
|
|
30
|
-
return { kind: 'entries', root: at.root, address: at.address, entries: await entries(roots, children), doors, complete: true };
|
|
35
|
+
return { kind: 'entries', root: at.root, address: at.address, entries: await entries(roots, children), doors, hidden, complete: true };
|
|
31
36
|
}
|
|
32
37
|
case 'door':
|
|
33
38
|
return { kind: 'place-first', placing: at.placing };
|
|
@@ -37,6 +42,12 @@ export async function listing(roots, path) {
|
|
|
37
42
|
return at;
|
|
38
43
|
}
|
|
39
44
|
}
|
|
45
|
+
/** The names a listing leaves out at an address: this computer's own folder,
|
|
46
|
+
* in the home's computers folder. */
|
|
47
|
+
function hiddenAt(roots, root, address) {
|
|
48
|
+
const computers = root === roots.home.uuid && address.length === 1 && address[0] === FILES_FOLDER;
|
|
49
|
+
return computers && roots.computer !== null ? [roots.computer] : [];
|
|
50
|
+
}
|
|
40
51
|
/** Each child's entry at its name; a reference leading into a root this
|
|
41
52
|
* person holds is a directory. */
|
|
42
53
|
async function entries(roots, children) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/drive/listing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/drive/listing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAe7E,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAgB,EAAE,IAAuB;IACrE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;gBAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,O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AI,CAAC,IAAI,QAAQ,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QAC9G,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/drive/where.d.ts
CHANGED
|
@@ -67,6 +67,15 @@ export interface Walked {
|
|
|
67
67
|
}
|
|
68
68
|
export declare function where(roots: RootsPort, path: readonly string[]): Promise<Where>;
|
|
69
69
|
export declare function walk(roots: RootsPort, path: readonly string[]): Promise<Walked>;
|
|
70
|
+
/** Whether a path's judgment names an address, not ground: the computers
|
|
71
|
+
* folder and everything the home holds beneath it (each computer's folder,
|
|
72
|
+
* the folders of an added folder's path, its reference), and the top of a
|
|
73
|
+
* root a reference leads into. They say where a folder lives on its
|
|
74
|
+
* computer; only that computer moves it, so no computer creates, renames or
|
|
75
|
+
* removes them through its drive. Inside an entered root everything is
|
|
76
|
+
* ground, except beneath this computer's own folder, whose ground the drive
|
|
77
|
+
* never shows. */
|
|
78
|
+
export declare function addressOnly(roots: RootsPort, path: readonly string[], at: Where): boolean;
|
|
70
79
|
/** The active child standing at a name: a sole owner keeps its bare name
|
|
71
80
|
* whatever its siblings do, so one holder answers at once. A name nobody
|
|
72
81
|
* holds that no shared slot can derive is nobody's. Only a shared slot, held
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../src/drive/where.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../src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I,CAQxF;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,CAGlF;AAED;;qCAEqC;AACrC,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,SAA+B,GAAG,KAAK,CAUrG;AAED;;uBAEuB;AACvB,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAKzD;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAElE"}
|
package/dist/drive/where.js
CHANGED
|
@@ -33,14 +33,20 @@
|
|
|
33
33
|
* stands, so each root's shelf is read once past its last standing
|
|
34
34
|
* ancestor; entering another root reads that root's shelf anew. A walk's
|
|
35
35
|
* judgment is as fresh as that one read, as any walk of a tree is.
|
|
36
|
+
* - This computer's own folder in the computers folder is nowhere. What it
|
|
37
|
+
* holds already stands where it lives on this computer, so the drive never
|
|
38
|
+
* shows it a second time.
|
|
36
39
|
*/
|
|
37
40
|
import { isRepositoryMetadataEntry } from '../detection/classify.js';
|
|
38
41
|
import { collisionBases, materializedSlotNames } from '../entities/rules.js';
|
|
39
42
|
import { CONTAINERS } from '../entities/types.js';
|
|
43
|
+
import { FILES_FOLDER } from '../registration/home-layout.js';
|
|
40
44
|
export async function where(roots, path) {
|
|
41
45
|
return (await walk(roots, path)).where;
|
|
42
46
|
}
|
|
43
47
|
export async function walk(roots, path) {
|
|
48
|
+
if (ownComputer(roots, path))
|
|
49
|
+
return { root: roots.home, where: { kind: 'nowhere' } };
|
|
44
50
|
const placing = [];
|
|
45
51
|
let covered = false;
|
|
46
52
|
let root = roots.home;
|
|
@@ -117,6 +123,26 @@ export async function walk(roots, path) {
|
|
|
117
123
|
function unitOf(root, entity, address) {
|
|
118
124
|
return { root: root.uuid, uuid: entity.uuid, type: entity.type, address };
|
|
119
125
|
}
|
|
126
|
+
/** Whether a path is this computer's own folder in the computers folder, or
|
|
127
|
+
* beneath it. */
|
|
128
|
+
function ownComputer(roots, path) {
|
|
129
|
+
return roots.computer !== null && path.length >= 2 && path[0] === FILES_FOLDER && path[1] === roots.computer;
|
|
130
|
+
}
|
|
131
|
+
/** Whether a path's judgment names an address, not ground: the computers
|
|
132
|
+
* folder and everything the home holds beneath it (each computer's folder,
|
|
133
|
+
* the folders of an added folder's path, its reference), and the top of a
|
|
134
|
+
* root a reference leads into. They say where a folder lives on its
|
|
135
|
+
* computer; only that computer moves it, so no computer creates, renames or
|
|
136
|
+
* removes them through its drive. Inside an entered root everything is
|
|
137
|
+
* ground, except beneath this computer's own folder, whose ground the drive
|
|
138
|
+
* never shows. */
|
|
139
|
+
export function addressOnly(roots, path, at) {
|
|
140
|
+
if (ownComputer(roots, path))
|
|
141
|
+
return true;
|
|
142
|
+
if (!('root' in at))
|
|
143
|
+
return false;
|
|
144
|
+
return at.root === roots.home.uuid ? at.address[0] === FILES_FOLDER : at.address.length === 0;
|
|
145
|
+
}
|
|
120
146
|
/** The active child standing at a name: a sole owner keeps its bare name
|
|
121
147
|
* whatever its siblings do, so one holder answers at once. A name nobody
|
|
122
148
|
* holds that no shared slot can derive is nobody's. Only a shared slot, held
|
package/dist/drive/where.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"where.js","sourceRoot":"","sources":["../../src/drive/where.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"where.js","sourceRoot":"","sources":["../../src/drive/where.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM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 +10,18 @@ export interface FilesRegisterPorts {
|
|
|
10
10
|
/** Resolve and prove an external directory without enrolling its contents. */
|
|
11
11
|
inspectExternalWorkspace(path: string): Promise<ExternalWorkspaceInspection>;
|
|
12
12
|
readonly randomUuid: () => string;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
|
|
13
|
+
/** This computer's folder in the computers folder (`computerFolder`),
|
|
14
|
+
* chosen once and kept. */
|
|
15
|
+
computerFolder(): Promise<string>;
|
|
16
|
+
/** The sole effect of register: render the reference at `address` and the
|
|
17
|
+
* local binding, after placing `starterPolicy` as the root's `.amalgmignore`
|
|
18
|
+
* when given and nothing stands at that name, so its first observation
|
|
19
|
+
* already reads it. */
|
|
16
20
|
declareWorkspaceReference(input: {
|
|
17
21
|
readonly workspaceId: string;
|
|
18
|
-
readonly workspaceName: string;
|
|
19
22
|
readonly absolutePath: string;
|
|
23
|
+
/** Where the reference stands in the home (`computerAddress`). */
|
|
24
|
+
readonly address: readonly string[];
|
|
20
25
|
readonly starterPolicy: string | null;
|
|
21
26
|
}): Promise<{
|
|
22
27
|
readonly created: boolean;
|
|
@@ -50,9 +55,12 @@ export interface FilesAddPorts {
|
|
|
50
55
|
* revealed root's Watch coverage, opened on the install's own verified graph
|
|
51
56
|
* as its one baseline only when nothing crossed a blind interval. Return
|
|
52
57
|
* with the intent still durable; healthy Watch coverage is the completion
|
|
53
|
-
* gate that clears it. Each accepted reference is
|
|
54
|
-
* machine
|
|
55
|
-
* already owned by Apply or Detect, is never overwritten by Add
|
|
58
|
+
* gate that clears it. Each accepted reference is current on this
|
|
59
|
+
* machine, named as still syncing (newer local work, or a transition
|
|
60
|
+
* already owned by Apply or Detect, is never overwritten by Add), or named
|
|
61
|
+
* as listed: its home is served by this computer's drive and the folders
|
|
62
|
+
* on its way are only listed, so the drive places it when something opens
|
|
63
|
+
* it. */
|
|
56
64
|
materializeWorkspace(input: {
|
|
57
65
|
readonly workspace: CloudEntityRecord;
|
|
58
66
|
readonly reference: CloudEntityRecord;
|
|
@@ -73,6 +81,7 @@ export interface FilesAddPorts {
|
|
|
73
81
|
readonly reference: CloudEntityRecord;
|
|
74
82
|
readonly references: readonly CloudEntityRecord[];
|
|
75
83
|
readonly syncingReferences: readonly string[];
|
|
84
|
+
readonly listedReferences: readonly string[];
|
|
76
85
|
readonly alreadyMaterialized: boolean;
|
|
77
86
|
}>;
|
|
78
87
|
/** Prove the one Watch owner the install opened. A recovered visible
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/files/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/files/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,MAAM,CAAC;IAClC;+BAC2B;IAC3B,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC;;;2BAGuB;IACvB,yBAAyB,CAAC,KAAK,EAAE;QAC/B,QAAQ,CAAC,WAAW,EAAE,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C,mBAAmB,EAAE,OAAO,CAAC;IACtC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;iEAKiE;AACjE,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,WAAW,EAAE,MAAM,GAClB;IACD,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD,CAsBA;AAED,gFAAgF;AAChF,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,cAAc,CAAC,CAuDzB"}
|
package/dist/files/commands.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CONTAINERS, UUID_PATTERN, containedRecords, installedSubtree, materializableRecords, sameRecords, snapshotFromRecords, } from '../entities/index.js';
|
|
2
2
|
import { DEFAULT_AMALGM_IGNORE } from '../detection/enrollment.js';
|
|
3
|
+
import { computerAddress } from './computer-address.js';
|
|
3
4
|
function uuid(value, label) {
|
|
4
5
|
const normalized = typeof value === 'string' ? value.trim().toLowerCase() : '';
|
|
5
6
|
if (!UUID_PATTERN.test(normalized))
|
|
@@ -29,8 +30,8 @@ export async function registerFilesWorkspace(path, ports) {
|
|
|
29
30
|
// what the user does with the file after that is theirs.
|
|
30
31
|
const declared = await ports.declareWorkspaceReference({
|
|
31
32
|
workspaceId,
|
|
32
|
-
workspaceName,
|
|
33
33
|
absolutePath,
|
|
34
|
+
address: computerAddress(await ports.computerFolder(), absolutePath),
|
|
34
35
|
starterPolicy: inspected.workspaceId === null ? DEFAULT_AMALGM_IGNORE : null,
|
|
35
36
|
});
|
|
36
37
|
return {
|
|
@@ -93,6 +94,8 @@ export async function addFilesWorkspace(workspaceId, destinationParent, ports) {
|
|
|
93
94
|
});
|
|
94
95
|
const installedRecords = snapshotFromRecords(installed.records || []).records;
|
|
95
96
|
const syncing = new Set(installed.syncingReferences);
|
|
97
|
+
const listed = new Set(installed.listedReferences);
|
|
98
|
+
const accepted = new Set(references.map(({ uuid }) => uuid));
|
|
96
99
|
// An install must persist exactly the head it selected. A completed Add's
|
|
97
100
|
// rows are already on their rails, Apply owning accepted transitions and
|
|
98
101
|
// Detect local ones, so its difference from the head is syncing work.
|
|
@@ -102,8 +105,10 @@ export async function addFilesWorkspace(workspaceId, destinationParent, ports) {
|
|
|
102
105
|
|| (!current && installed.alreadyMaterialized !== true)
|
|
103
106
|
|| !sameRecords([installed.reference], [selected.reference])
|
|
104
107
|
|| syncing.size !== installed.syncingReferences.length
|
|
105
|
-
||
|
|
106
|
-
||
|
|
108
|
+
|| listed.size !== installed.listedReferences.length
|
|
109
|
+
|| [...syncing].some((id) => !accepted.has(id))
|
|
110
|
+
|| [...listed].some((id) => !accepted.has(id) || syncing.has(id))
|
|
111
|
+
|| !sameRecords(installed.references, references.filter(({ uuid }) => !syncing.has(uuid) && !listed.has(uuid)))) {
|
|
107
112
|
throw new Error('workspace materialization did not persist exactly the selected graph');
|
|
108
113
|
}
|
|
109
114
|
const coverage = await ports.coverWorkspace({ workspaceId: normalizedId });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/files/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,q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AAE,CAAC,CAAC;IAC3E,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;QAC5F,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO;QACL,WAAW,EAAE,YAAY;QACzB,aAAa,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI;QACtC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,6BAA6B,CAAC;QAC7D,IAAI,EAAE,SAAS,CAAC,IAAI;QACpB,SAAS,EAAE,KAAK,CAAC,QAAQ;QACzB,YAAY,EAAE,IAAI;QAClB,mBAAmB,EAAE,SAAS,CAAC,mBAAmB,KAAK,IAAI;QAC3D,OAAO,EAAE,CAAC,OAAO;QACjB,iBAAiB,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE;QACtC,YAAY,EAAE,QAAQ,CAAC,KAAK;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The folder a computer stands at in the computers folder: its name made
|
|
2
|
+
* safe for every disk, with `-2`, `-3`, … when another computer already holds
|
|
3
|
+
* that name in any letter case. A host chooses it once, from the names the
|
|
4
|
+
* accepted graph holds there, and keeps it. */
|
|
5
|
+
export declare function computerFolder(name: string, taken: Iterable<string>): string;
|
|
6
|
+
/** The address in the home of a folder at an absolute path on a computer:
|
|
7
|
+
* the computers folder, the computer's folder, then each segment of the path.
|
|
8
|
+
* A POSIX path splits on `/`; a Windows drive path keeps its letter as the
|
|
9
|
+
* first segment. A path naming no folder below a disk's top is refused. */
|
|
10
|
+
export declare function computerAddress(computer: string, absolutePath: string): string[];
|
|
11
|
+
//# sourceMappingURL=computer-address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computer-address.d.ts","sourceRoot":"","sources":["../../src/files/computer-address.ts"],"names":[],"mappings":"AAeA;;;+CAG+C;AAC/C,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAE5E;AAED;;;2EAG2E;AAC3E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAOhF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where ground outside the Amalgm folder lives in the home: the computers
|
|
3
|
+
* folder holds one folder per computer, and in it each added folder stands at
|
|
4
|
+
* the absolute path it has on that computer. Every computer shows it at the
|
|
5
|
+
* same address, `files/<computer>/<path>`, so a folder from one computer is
|
|
6
|
+
* found where its own computer keeps it. Only the folders on that path that
|
|
7
|
+
* Amalgm holds exist; the rest of the computer's disk is no part of the home.
|
|
8
|
+
*/
|
|
9
|
+
import { entityFolderName } from '@amalgm/core/identity';
|
|
10
|
+
import { isName } from '../entities/rules.js';
|
|
11
|
+
import { FILES_FOLDER } from '../registration/home-layout.js';
|
|
12
|
+
/** A Windows drive path: its letter, then the rest. */
|
|
13
|
+
const WINDOWS_DRIVE = /^([A-Za-z]):[\\/](.*)$/;
|
|
14
|
+
/** The folder a computer stands at in the computers folder: its name made
|
|
15
|
+
* safe for every disk, with `-2`, `-3`, … when another computer already holds
|
|
16
|
+
* that name in any letter case. A host chooses it once, from the names the
|
|
17
|
+
* accepted graph holds there, and keeps it. */
|
|
18
|
+
export function computerFolder(name, taken) {
|
|
19
|
+
return entityFolderName(name, taken);
|
|
20
|
+
}
|
|
21
|
+
/** The address in the home of a folder at an absolute path on a computer:
|
|
22
|
+
* the computers folder, the computer's folder, then each segment of the path.
|
|
23
|
+
* A POSIX path splits on `/`; a Windows drive path keeps its letter as the
|
|
24
|
+
* first segment. A path naming no folder below a disk's top is refused. */
|
|
25
|
+
export function computerAddress(computer, absolutePath) {
|
|
26
|
+
const segments = pathSegments(absolutePath);
|
|
27
|
+
if (segments.length === 0)
|
|
28
|
+
throw new Error(`an added folder must stand below its disk's top, not at ${JSON.stringify(absolutePath)}`);
|
|
29
|
+
for (const name of [computer, ...segments]) {
|
|
30
|
+
if (!isName(name))
|
|
31
|
+
throw new Error(`invalid entity name ${JSON.stringify(name)}: a name is one non-empty path segment`);
|
|
32
|
+
}
|
|
33
|
+
return [FILES_FOLDER, computer, ...segments];
|
|
34
|
+
}
|
|
35
|
+
function pathSegments(absolutePath) {
|
|
36
|
+
const windows = WINDOWS_DRIVE.exec(absolutePath);
|
|
37
|
+
if (windows !== null) {
|
|
38
|
+
const rest = windows[2].split(/[\\/]/).filter(segment => segment !== '');
|
|
39
|
+
return rest.length === 0 ? [] : [windows[1].toUpperCase(), ...rest];
|
|
40
|
+
}
|
|
41
|
+
if (!absolutePath.startsWith('/'))
|
|
42
|
+
throw new Error(`${JSON.stringify(absolutePath)} is not an absolute path`);
|
|
43
|
+
return absolutePath.split('/').filter(segment => segment !== '');
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=computer-address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computer-address.js","sourceRoot":"","sources":["../../src/files/computer-address.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,uDAAuD;AACvD,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAE/C;;;+CAG+C;AAC/C,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,KAAuB;IAClE,OAAO,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;;2EAG2E;AAC3E,MAAM,UAAU,eAAe,CAAC,QAA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