@orkestrel/scaffold 0.0.60 → 0.0.62
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/README.md +13 -10
- package/dist/bin/main.js +632 -320
- package/dist/bin/main.js.map +1 -1
- package/dist/host/CLAUDE.md +5 -1
- package/dist/host/agents/orchestration.md +44 -19
- package/dist/host/agents/skills/enterprise-bootstrap/references/components.md +5 -5
- package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +2 -2
- package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +10 -9
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +21 -11
- package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +20 -2
- package/dist/host/agents/skills/orkestrel-harden-package/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden-package/references/hardening.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden-package/references/research.md +1 -1
- package/dist/host/agents/templates/brief.md +16 -7
- package/dist/host/agents/transports/claude.md +4 -2
- package/dist/host/agents/transports/codex.md +4 -1
- package/dist/host/claude/agents/analyst.md +3 -1
- package/dist/host/claude/agents/application.md +1 -1
- package/dist/host/claude/agents/builder.md +3 -3
- package/dist/host/claude/agents/checker.md +5 -0
- package/dist/host/claude/agents/grok.md +15 -5
- package/dist/host/claude/agents/implementer.md +1 -1
- package/dist/host/claude/agents/orkestrel.md +2 -2
- package/dist/host/claude/agents/planner.md +10 -0
- package/dist/host/claude/agents/reviewer.md +14 -8
- package/dist/host/claude/agents/sol.md +3 -1
- package/dist/host/claude/agents/verifier.md +2 -4
- package/dist/host/claude/rules/architecture.md +7 -5
- package/dist/host/claude/rules/documentation.md +1 -0
- package/dist/host/claude/rules/names.md +23 -5
- package/dist/host/claude/rules/patterns.md +1 -0
- package/dist/host/claude/rules/quality.md +1 -1
- package/dist/host/claude/rules/tests.md +3 -3
- package/dist/host/claude/rules/typescript.md +4 -1
- package/dist/host/claude/rules/writing.md +2 -2
- package/dist/host/codex/agents/builder.toml +6 -6
- package/dist/host/codex/agents/checker.toml +2 -1
- package/dist/host/codex/agents/grok.toml +12 -5
- package/dist/host/codex/agents/implementer.toml +2 -2
- package/dist/host/codex/agents/opus.toml +6 -1
- package/dist/host/codex/agents/planner.toml +11 -6
- package/dist/host/codex/agents/reviewer.toml +8 -6
- package/dist/host/guides/scaffold.md +39 -14
- package/dist/host/manifest.json +41 -41
- package/dist/host/scripts/codex.sh +0 -0
- package/dist/host/scripts/cursor.sh +0 -0
- package/dist/host/scripts/deps.sh +0 -0
- package/dist/host/scripts/ollama.sh +0 -0
- package/dist/src/core/index.cjs +429 -287
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +361 -220
- package/dist/src/core/index.d.ts +361 -220
- package/dist/src/core/index.js +426 -288
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +208 -170
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +276 -152
- package/dist/src/server/index.d.ts +276 -152
- package/dist/src/server/index.js +200 -172
- package/dist/src/server/index.js.map +1 -1
- package/package.json +13 -12
|
@@ -7,6 +7,7 @@ import { EmitterInterface } from '@orkestrel/emitter';
|
|
|
7
7
|
import { Group } from '@orkestrel/scaffold';
|
|
8
8
|
import { Guard } from '@orkestrel/contract';
|
|
9
9
|
import { HostFile } from '@orkestrel/scaffold';
|
|
10
|
+
import { Lookup } from '@orkestrel/scaffold';
|
|
10
11
|
import { ManifestRegionSet } from '@orkestrel/scaffold';
|
|
11
12
|
import { Mirror } from '@orkestrel/scaffold';
|
|
12
13
|
import { Plan } from '@orkestrel/scaffold';
|
|
@@ -14,7 +15,7 @@ import { Release } from '@orkestrel/scaffold';
|
|
|
14
15
|
import { Snapshot } from '@orkestrel/scaffold';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Matches the Git branch syntax the repository endpoint accepts.
|
|
18
19
|
*
|
|
19
20
|
* @remarks
|
|
20
21
|
* A branch is caller-supplied and reaches a URL path, so it is closed to
|
|
@@ -25,7 +26,22 @@ import { Snapshot } from '@orkestrel/scaffold';
|
|
|
25
26
|
export declare const BRANCH_PATTERN: RegExp;
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Reports the outcome of one bounded read whose body is taken as exact bytes.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* `hex` carries the body as lowercase hexadecimal, and only when `lookup` is
|
|
33
|
+
* `found`; otherwise it is empty and `note` states what happened. Bytes rather
|
|
34
|
+
* than text, because a vendored file is compared by digest and a decode would
|
|
35
|
+
* change what is hashed.
|
|
36
|
+
*/
|
|
37
|
+
export declare interface BytesReadResult {
|
|
38
|
+
readonly lookup: Lookup;
|
|
39
|
+
readonly hex: string;
|
|
40
|
+
readonly note: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Computes the SHA-256 digest of text.
|
|
29
45
|
*
|
|
30
46
|
* @param content - The text to digest.
|
|
31
47
|
* @returns Sixty-four lowercase hexadecimal digits.
|
|
@@ -48,7 +64,7 @@ export declare const BRANCH_PATTERN: RegExp;
|
|
|
48
64
|
export declare function computeDigest(content: string): string;
|
|
49
65
|
|
|
50
66
|
/**
|
|
51
|
-
*
|
|
67
|
+
* Computes the SHA-256 digest of one file's exact bytes.
|
|
52
68
|
*
|
|
53
69
|
* @param path - The resolved host path to digest.
|
|
54
70
|
* @returns The digest, or `undefined` when the path is not a physical file, is
|
|
@@ -71,7 +87,7 @@ export declare function computeDigest(content: string): string;
|
|
|
71
87
|
export declare function computeFileDigest(path: string): string | undefined;
|
|
72
88
|
|
|
73
89
|
/**
|
|
74
|
-
*
|
|
90
|
+
* Computes the digest of a vendored host's declared membership.
|
|
75
91
|
*
|
|
76
92
|
* @param entries - The ordered file membership declarations.
|
|
77
93
|
* @param roots - The ordered directory membership declarations.
|
|
@@ -94,8 +110,41 @@ export declare function computeFileDigest(path: string): string | undefined;
|
|
|
94
110
|
*/
|
|
95
111
|
export declare function computeManifestDigest(entries: readonly ManifestEntry[], roots: readonly string[]): string;
|
|
96
112
|
|
|
113
|
+
/** Holds the repository branch a raw content read addresses when a caller names none. */
|
|
114
|
+
export declare const DEFAULT_BRANCH = "main";
|
|
115
|
+
|
|
116
|
+
/** Holds the registry a version read addresses when a caller names none. */
|
|
117
|
+
export declare const DEFAULT_REGISTRY_BASE = "https://registry.npmjs.org";
|
|
118
|
+
|
|
119
|
+
/** Holds the raw content host a repository read addresses when a caller names none. */
|
|
120
|
+
export declare const DEFAULT_REPOSITORY_BASE = "https://raw.githubusercontent.com";
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sets the simultaneous upstream requests a reader opens with, under
|
|
124
|
+
* {@link MAX_UPSTREAM_CONCURRENCY}.
|
|
125
|
+
*/
|
|
126
|
+
export declare const DEFAULT_UPSTREAM_CONCURRENCY = 6;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Sets the retries one upstream request is given when a caller names none.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* A read is attempted once by default. Retrying is the caller's decision because
|
|
133
|
+
* a repeated request costs the upstream host, not this package.
|
|
134
|
+
*/
|
|
135
|
+
export declare const DEFAULT_UPSTREAM_RETRIES = 0;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Sets the timeout one upstream request is given when a caller names none, in milliseconds.
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* Both endpoints open at this value; a caller raises either one on its own up to
|
|
142
|
+
* {@link MAX_UPSTREAM_TIMEOUT}.
|
|
143
|
+
*/
|
|
144
|
+
export declare const DEFAULT_UPSTREAM_TIMEOUT = 10000;
|
|
145
|
+
|
|
97
146
|
/**
|
|
98
|
-
*
|
|
147
|
+
* Matches the exact SHA-256 syntax a digest is stated in: sixty-four lowercase hexadecimal digits.
|
|
99
148
|
*
|
|
100
149
|
* @remarks
|
|
101
150
|
* Fixed length, unlike the core byte encoding, because a digest is one value of
|
|
@@ -105,7 +154,7 @@ export declare function computeManifestDigest(entries: readonly ManifestEntry[],
|
|
|
105
154
|
export declare const DIGEST_PATTERN: RegExp;
|
|
106
155
|
|
|
107
156
|
/**
|
|
108
|
-
*
|
|
157
|
+
* Matches the drive prefix a Windows host path may open with.
|
|
109
158
|
*
|
|
110
159
|
* @remarks
|
|
111
160
|
* The one segment allowed to carry a colon. Every other segment is measured by
|
|
@@ -115,7 +164,7 @@ export declare const DIGEST_PATTERN: RegExp;
|
|
|
115
164
|
export declare const DRIVE_PATTERN: RegExp;
|
|
116
165
|
|
|
117
166
|
/**
|
|
118
|
-
*
|
|
167
|
+
* Assembles a whole vendored host from live files and the installed floor.
|
|
119
168
|
*
|
|
120
169
|
* @param files - The host-owned vendored files read from the repository, one
|
|
121
170
|
* row per path.
|
|
@@ -129,13 +178,10 @@ export declare const DRIVE_PATTERN: RegExp;
|
|
|
129
178
|
* restates it. The host surface contributes one baseline: a fill carries live
|
|
130
179
|
* bytes for every path that surface writes, or it is nothing. A row that failed,
|
|
131
180
|
* went missing, names an undeclared path, or leaves a host-owned path absent
|
|
132
|
-
* answers `undefined`.
|
|
133
|
-
* floor bytes
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* destination keeps its floor bytes here, claimed or not, and a fill that carries
|
|
137
|
-
* no row for one is complete rather than spoiled. One `Host` can therefore carry
|
|
138
|
-
* live host bytes beside floor bytes without mixing baselines within a surface.
|
|
181
|
+
* answers `undefined`. Every {@link isFloorPath} destination keeps the installed
|
|
182
|
+
* floor's bytes instead, claimed or not, so a fill carrying no row for one is
|
|
183
|
+
* complete rather than spoiled. One `Host` can therefore carry live host bytes
|
|
184
|
+
* beside floor bytes without mixing baselines within a surface.
|
|
139
185
|
*
|
|
140
186
|
* The emitted entries keep the release's own order and its storage and
|
|
141
187
|
* executable declarations, and carry digests recomputed over the bytes the fill
|
|
@@ -175,7 +221,7 @@ export declare function filesToHost(files: readonly HostFile[], floor: Host): Ho
|
|
|
175
221
|
export declare function hexToDigest(hex: string): string;
|
|
176
222
|
|
|
177
223
|
/**
|
|
178
|
-
*
|
|
224
|
+
* Represents a whole vendored host supplied as a value: the membership beside the bytes filling it.
|
|
179
225
|
*
|
|
180
226
|
* @remarks
|
|
181
227
|
* `manifest` carries the membership, the roots, and the executable declarations
|
|
@@ -196,7 +242,24 @@ export declare interface Host {
|
|
|
196
242
|
}
|
|
197
243
|
|
|
198
244
|
/**
|
|
199
|
-
*
|
|
245
|
+
* Represents the committed vendored-file inventory as one call's reads are decided against.
|
|
246
|
+
*
|
|
247
|
+
* @remarks
|
|
248
|
+
* `lookup` is the verdict of the inventory read itself, and every row of the
|
|
249
|
+
* call inherits it when it is not `found`. `digests` maps a target-relative
|
|
250
|
+
* destination to the exact bytes the inventory declares for it, `duplicates`
|
|
251
|
+
* names every destination the inventory claims more than once, and `note` states
|
|
252
|
+
* why a lookup that is not `found` produced no inventory.
|
|
253
|
+
*/
|
|
254
|
+
export declare interface HostInventory {
|
|
255
|
+
readonly lookup: Lookup;
|
|
256
|
+
readonly digests: ReadonlyMap<string, string>;
|
|
257
|
+
readonly duplicates: ReadonlySet<string>;
|
|
258
|
+
readonly note: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Represents the complete vendored-host inventory.
|
|
200
263
|
*
|
|
201
264
|
* @remarks
|
|
202
265
|
* `roots` is the sorted directory inventory, which is what distinguishes a
|
|
@@ -213,7 +276,7 @@ export declare interface HostManifest {
|
|
|
213
276
|
}
|
|
214
277
|
|
|
215
278
|
/**
|
|
216
|
-
*
|
|
279
|
+
* Matches the visible characters no host path segment may carry.
|
|
217
280
|
*
|
|
218
281
|
* @remarks
|
|
219
282
|
* Narrower than the core path law by exactly one character: a backslash is a
|
|
@@ -223,7 +286,7 @@ export declare interface HostManifest {
|
|
|
223
286
|
export declare const INVALID_SEGMENT_CHARACTER_PATTERN: RegExp;
|
|
224
287
|
|
|
225
288
|
/**
|
|
226
|
-
*
|
|
289
|
+
* Narrows a value to a Git branch the repository endpoint accepts.
|
|
227
290
|
*
|
|
228
291
|
* @remarks
|
|
229
292
|
* A branch reaches the repository URL's path, so the syntax is closed rather than
|
|
@@ -239,14 +302,14 @@ export declare const INVALID_SEGMENT_CHARACTER_PATTERN: RegExp;
|
|
|
239
302
|
*/
|
|
240
303
|
export declare const isBranch: Guard<string>;
|
|
241
304
|
|
|
242
|
-
/**
|
|
305
|
+
/** Narrows a value to a bounded list of fleet catalog rows. */
|
|
243
306
|
export declare const isCatalogEntries: Guard<readonly CatalogEntry[]>;
|
|
244
307
|
|
|
245
|
-
/**
|
|
308
|
+
/** Narrows a value to a bounded list of declared runtime dependencies. */
|
|
246
309
|
export declare const isDependencies: Guard<readonly Dependency[]>;
|
|
247
310
|
|
|
248
311
|
/**
|
|
249
|
-
*
|
|
312
|
+
* Narrows a value to a bounded list of `@orkestrel` package names.
|
|
250
313
|
*
|
|
251
314
|
* @remarks
|
|
252
315
|
* Composed from the core collection and dependency-name guards rather than
|
|
@@ -264,7 +327,7 @@ export declare const isDependencies: Guard<readonly Dependency[]>;
|
|
|
264
327
|
export declare const isDependencyNames: Guard<readonly string[]>;
|
|
265
328
|
|
|
266
329
|
/**
|
|
267
|
-
*
|
|
330
|
+
* Narrows a value to one exact SHA-256 digest.
|
|
268
331
|
*
|
|
269
332
|
* @remarks
|
|
270
333
|
* The identity a vendored host manifest and a write precondition are both stated
|
|
@@ -282,7 +345,7 @@ export declare const isDependencyNames: Guard<readonly string[]>;
|
|
|
282
345
|
export declare const isDigest: Guard<string>;
|
|
283
346
|
|
|
284
347
|
/**
|
|
285
|
-
*
|
|
348
|
+
* Narrows a value to a bounded upstream endpoint.
|
|
286
349
|
*
|
|
287
350
|
* @remarks
|
|
288
351
|
* Length only. Which schemes and hosts an endpoint may name is the reader's law,
|
|
@@ -292,11 +355,11 @@ export declare const isDigest: Guard<string>;
|
|
|
292
355
|
export declare const isEndpoint: Guard<string>;
|
|
293
356
|
|
|
294
357
|
/**
|
|
295
|
-
*
|
|
358
|
+
* Tests whether a path is a physical file with exact on-disk casing.
|
|
296
359
|
*
|
|
297
360
|
* @param path - The host path to inspect segment by segment.
|
|
298
|
-
* @returns
|
|
299
|
-
*
|
|
361
|
+
* @returns True if the path is a physical file whose requested segments exactly match
|
|
362
|
+
* the names each parent directory stores; false otherwise.
|
|
300
363
|
*
|
|
301
364
|
* @remarks
|
|
302
365
|
* A direct file lookup follows the host's case-folding rules on Windows and
|
|
@@ -314,11 +377,11 @@ export declare const isEndpoint: Guard<string>;
|
|
|
314
377
|
export declare function isExactCaseFile(path: string): boolean;
|
|
315
378
|
|
|
316
379
|
/**
|
|
317
|
-
*
|
|
380
|
+
* Narrows a value to a path naming a location on this host.
|
|
318
381
|
*
|
|
319
382
|
* @param value - The candidate host path.
|
|
320
|
-
* @returns
|
|
321
|
-
* portable across the supported filesystems.
|
|
383
|
+
* @returns True if the value is a bounded absolute or relative path whose every segment
|
|
384
|
+
* is portable across the supported filesystems; false otherwise.
|
|
322
385
|
*
|
|
323
386
|
* @remarks
|
|
324
387
|
* The counterpart to the core path law, not a copy of it. A target directory and
|
|
@@ -357,7 +420,7 @@ export declare function isExactCaseFile(path: string): boolean;
|
|
|
357
420
|
export declare function isFilesystemPath(value: unknown): value is string;
|
|
358
421
|
|
|
359
422
|
/**
|
|
360
|
-
*
|
|
423
|
+
* Narrows a value to one {@link Host}.
|
|
361
424
|
*
|
|
362
425
|
* @remarks
|
|
363
426
|
* A whole vendored host handed in as a value is as untrusted as one read from a
|
|
@@ -381,7 +444,7 @@ export declare function isFilesystemPath(value: unknown): value is string;
|
|
|
381
444
|
export declare const isHost: Guard<Host>;
|
|
382
445
|
|
|
383
446
|
/**
|
|
384
|
-
*
|
|
447
|
+
* Narrows a value to one {@link HostManifest}.
|
|
385
448
|
*
|
|
386
449
|
* @remarks
|
|
387
450
|
* The manifest is read from a directory a caller named, so it is the least
|
|
@@ -391,10 +454,11 @@ export declare const isHost: Guard<Host>;
|
|
|
391
454
|
export declare const isHostManifest: Guard<HostManifest>;
|
|
392
455
|
|
|
393
456
|
/**
|
|
394
|
-
*
|
|
457
|
+
* Narrows a value to a working-tree inventory within the limit one target may report.
|
|
395
458
|
*
|
|
396
459
|
* @param value - The candidate inventory.
|
|
397
|
-
* @returns
|
|
460
|
+
* @returns True if the value is an array of no more than
|
|
461
|
+
* `MAX_INVENTORY_PATHS` items; false otherwise.
|
|
398
462
|
*
|
|
399
463
|
* @remarks
|
|
400
464
|
* Compose this ahead of an element guard exactly as the core collection guard is
|
|
@@ -415,7 +479,7 @@ export declare const isHostManifest: Guard<HostManifest>;
|
|
|
415
479
|
export declare function isInventory(value: unknown): value is readonly unknown[];
|
|
416
480
|
|
|
417
481
|
/**
|
|
418
|
-
*
|
|
482
|
+
* Narrows a value to one {@link ManifestEntry}.
|
|
419
483
|
*
|
|
420
484
|
* @remarks
|
|
421
485
|
* Both paths are measured by the core path law, because a vendored host's
|
|
@@ -438,7 +502,7 @@ export declare function isInventory(value: unknown): value is readonly unknown[]
|
|
|
438
502
|
export declare const isManifestEntry: Guard<ManifestEntry>;
|
|
439
503
|
|
|
440
504
|
/**
|
|
441
|
-
*
|
|
505
|
+
* Narrows a value to one {@link ManifestRegionSet}.
|
|
442
506
|
*
|
|
443
507
|
* @remarks
|
|
444
508
|
* The whole closed record a manifest-writing method accepts, so a caller
|
|
@@ -456,7 +520,7 @@ export declare const isManifestEntry: Guard<ManifestEntry>;
|
|
|
456
520
|
export declare const isManifestRegionSet: Guard<ManifestRegionSet>;
|
|
457
521
|
|
|
458
522
|
/**
|
|
459
|
-
*
|
|
523
|
+
* Narrows a value to the materializer's initial listener record.
|
|
460
524
|
*
|
|
461
525
|
* @remarks
|
|
462
526
|
* Every event is optional and every declared value is a function. A key outside
|
|
@@ -466,7 +530,7 @@ export declare const isManifestRegionSet: Guard<ManifestRegionSet>;
|
|
|
466
530
|
export declare const isMaterializerHooks: Guard<EmitterHooks<MaterializerEventMap>>;
|
|
467
531
|
|
|
468
532
|
/**
|
|
469
|
-
*
|
|
533
|
+
* Narrows a value to {@link MaterializerOptions}.
|
|
470
534
|
*
|
|
471
535
|
* @remarks
|
|
472
536
|
* `host` admits both representations of one vendored root: a directory path and
|
|
@@ -484,11 +548,11 @@ export declare const isMaterializerHooks: Guard<EmitterHooks<MaterializerEventMa
|
|
|
484
548
|
*/
|
|
485
549
|
export declare const isMaterializerOptions: Guard<MaterializerOptions>;
|
|
486
550
|
|
|
487
|
-
/**
|
|
551
|
+
/** Narrows a value to a bounded list of fetched guide mirrors. */
|
|
488
552
|
export declare const isMirrors: Guard<readonly Mirror[]>;
|
|
489
553
|
|
|
490
554
|
/**
|
|
491
|
-
*
|
|
555
|
+
* Narrows a value to a bounded list of target-relative paths.
|
|
492
556
|
*
|
|
493
557
|
* @remarks
|
|
494
558
|
* Composed from the core collection and path guards rather than restated, so
|
|
@@ -507,10 +571,10 @@ export declare const isMirrors: Guard<readonly Mirror[]>;
|
|
|
507
571
|
export declare const isPaths: Guard<readonly string[]>;
|
|
508
572
|
|
|
509
573
|
/**
|
|
510
|
-
*
|
|
574
|
+
* Tests whether a path is a physical directory this package will read or write into.
|
|
511
575
|
*
|
|
512
576
|
* @param path - The resolved host path to inspect, without following links.
|
|
513
|
-
* @returns
|
|
577
|
+
* @returns True if the path is a directory that is not a link; false otherwise.
|
|
514
578
|
*
|
|
515
579
|
* @remarks
|
|
516
580
|
* A junction and a directory symbolic link both report as directories after
|
|
@@ -528,11 +592,11 @@ export declare const isPaths: Guard<readonly string[]>;
|
|
|
528
592
|
export declare function isPhysicalDirectory(path: string): boolean;
|
|
529
593
|
|
|
530
594
|
/**
|
|
531
|
-
*
|
|
595
|
+
* Tests whether a path is a physical file this package will read or replace.
|
|
532
596
|
*
|
|
533
597
|
* @param path - The resolved host path to inspect, without following links.
|
|
534
|
-
* @returns
|
|
535
|
-
* elsewhere.
|
|
598
|
+
* @returns True if the path is a regular file that is neither a link nor hard-linked
|
|
599
|
+
* elsewhere; false otherwise.
|
|
536
600
|
*
|
|
537
601
|
* @remarks
|
|
538
602
|
* The link tests are the point. A symbolic link is a path pointing somewhere
|
|
@@ -550,7 +614,7 @@ export declare function isPhysicalDirectory(path: string): boolean;
|
|
|
550
614
|
export declare function isPhysicalFile(path: string): boolean;
|
|
551
615
|
|
|
552
616
|
/**
|
|
553
|
-
*
|
|
617
|
+
* Narrows a value to a per-request timeout in milliseconds.
|
|
554
618
|
*
|
|
555
619
|
* @remarks
|
|
556
620
|
* A whole number of milliseconds, at least one and no more than
|
|
@@ -560,7 +624,7 @@ export declare function isPhysicalFile(path: string): boolean;
|
|
|
560
624
|
export declare const isTimeout: Guard<number>;
|
|
561
625
|
|
|
562
626
|
/**
|
|
563
|
-
*
|
|
627
|
+
* Narrows a value to the upstream reader's initial listener record.
|
|
564
628
|
*
|
|
565
629
|
* @remarks
|
|
566
630
|
* Closed to the reader's own events for the same reason the materializer's
|
|
@@ -569,7 +633,7 @@ export declare const isTimeout: Guard<number>;
|
|
|
569
633
|
export declare const isUpstreamHooks: Guard<EmitterHooks<UpstreamEventMap>>;
|
|
570
634
|
|
|
571
635
|
/**
|
|
572
|
-
*
|
|
636
|
+
* Narrows a value to {@link UpstreamOptions}.
|
|
573
637
|
*
|
|
574
638
|
* @remarks
|
|
575
639
|
* Each grouped endpoint is closed to its own leaves, so a setting written under
|
|
@@ -591,11 +655,11 @@ export declare const isUpstreamHooks: Guard<EmitterHooks<UpstreamEventMap>>;
|
|
|
591
655
|
export declare const isUpstreamOptions: Guard<UpstreamOptions>;
|
|
592
656
|
|
|
593
657
|
/**
|
|
594
|
-
*
|
|
658
|
+
* Tests whether a target is safe to write a fresh workspace into.
|
|
595
659
|
*
|
|
596
660
|
* @param target - The candidate target directory.
|
|
597
|
-
* @returns
|
|
598
|
-
*
|
|
661
|
+
* @returns True if the target is absent, empty, or holds nothing but its own `.git`
|
|
662
|
+
* directory; false otherwise.
|
|
599
663
|
*
|
|
600
664
|
* @remarks
|
|
601
665
|
* The green-field law. A checkout of an empty repository is where a new
|
|
@@ -614,7 +678,7 @@ export declare const isUpstreamOptions: Guard<UpstreamOptions>;
|
|
|
614
678
|
export declare function isVacant(target: string): boolean;
|
|
615
679
|
|
|
616
680
|
/**
|
|
617
|
-
*
|
|
681
|
+
* Narrows a value to a {@link Worktree}.
|
|
618
682
|
*
|
|
619
683
|
* @remarks
|
|
620
684
|
* Both path lists are target-relative, so both are measured by the core path
|
|
@@ -666,7 +730,7 @@ export declare const isWorktree: Guard<Worktree>;
|
|
|
666
730
|
export declare function listCanonPaths(target: string, groups: readonly Group[]): readonly string[];
|
|
667
731
|
|
|
668
732
|
/**
|
|
669
|
-
*
|
|
733
|
+
* Lists a directory's descendant directories as sorted root-relative paths.
|
|
670
734
|
*
|
|
671
735
|
* @param root - The directory to inventory.
|
|
672
736
|
* @returns Every descendant directory as a `/`-separated root-relative path, in
|
|
@@ -697,7 +761,7 @@ export declare function listCanonPaths(target: string, groups: readonly Group[])
|
|
|
697
761
|
export declare function listDirectories(root: string): readonly string[];
|
|
698
762
|
|
|
699
763
|
/**
|
|
700
|
-
*
|
|
764
|
+
* Lists a directory's files as sorted root-relative paths.
|
|
701
765
|
*
|
|
702
766
|
* @param root - The directory to inventory.
|
|
703
767
|
* @returns Every descendant file as a `/`-separated root-relative path, in
|
|
@@ -727,7 +791,7 @@ export declare function listDirectories(root: string): readonly string[];
|
|
|
727
791
|
export declare function listFiles(root: string): readonly string[];
|
|
728
792
|
|
|
729
793
|
/**
|
|
730
|
-
*
|
|
794
|
+
* Reserves the metadata name a staged vendored host writes at its own root.
|
|
731
795
|
*
|
|
732
796
|
* @remarks
|
|
733
797
|
* The one name a vendored file may never claim, because the staged root holds
|
|
@@ -738,7 +802,7 @@ export declare function listFiles(root: string): readonly string[];
|
|
|
738
802
|
export declare const MANIFEST_NAME = "manifest.json";
|
|
739
803
|
|
|
740
804
|
/**
|
|
741
|
-
*
|
|
805
|
+
* Represents one file record of the vendored host's manifest.
|
|
742
806
|
*
|
|
743
807
|
* @remarks
|
|
744
808
|
* `digest` is the SHA-256 of the file's exact bytes. A live read compares it
|
|
@@ -753,11 +817,11 @@ export declare interface ManifestEntry {
|
|
|
753
817
|
}
|
|
754
818
|
|
|
755
819
|
/**
|
|
756
|
-
*
|
|
820
|
+
* Tests whether a captured directory is still the same directory.
|
|
757
821
|
*
|
|
758
822
|
* @param anchor - The identity captured earlier.
|
|
759
|
-
* @returns
|
|
760
|
-
*
|
|
823
|
+
* @returns True if the path still holds a physical directory of that exact device and
|
|
824
|
+
* inode; false otherwise.
|
|
761
825
|
*
|
|
762
826
|
* @remarks
|
|
763
827
|
* This binds location rather than history. `true` means the path still resolves
|
|
@@ -779,10 +843,10 @@ export declare interface ManifestEntry {
|
|
|
779
843
|
export declare function matchesAnchor(anchor: WriteAnchor): boolean;
|
|
780
844
|
|
|
781
845
|
/**
|
|
782
|
-
*
|
|
846
|
+
* Tests whether a vendored path is one a target receives executable.
|
|
783
847
|
*
|
|
784
848
|
* @param path - The target-relative path to classify; either separator is read.
|
|
785
|
-
* @returns
|
|
849
|
+
* @returns True if the path is declared in {@link EXECUTABLE_PATHS}; false otherwise.
|
|
786
850
|
*
|
|
787
851
|
* @remarks
|
|
788
852
|
* The declaration is the whole answer, and deliberately so. Reading the staging
|
|
@@ -804,10 +868,10 @@ export declare function matchesAnchor(anchor: WriteAnchor): boolean;
|
|
|
804
868
|
export declare function matchesExecutablePath(path: string): boolean;
|
|
805
869
|
|
|
806
870
|
/**
|
|
807
|
-
*
|
|
871
|
+
* Tests whether a destination still holds what was captured of it.
|
|
808
872
|
*
|
|
809
873
|
* @param expectation - The state captured earlier.
|
|
810
|
-
* @returns
|
|
874
|
+
* @returns True if re-reading the destination produces that same state; false otherwise.
|
|
811
875
|
*
|
|
812
876
|
* @remarks
|
|
813
877
|
* Compared field for field against a fresh {@link readExpectation}, so an
|
|
@@ -826,10 +890,10 @@ export declare function matchesExecutablePath(path: string): boolean;
|
|
|
826
890
|
export declare function matchesExpectation(expectation: WriteExpectation): boolean;
|
|
827
891
|
|
|
828
892
|
/**
|
|
829
|
-
*
|
|
893
|
+
* Tests whether a path addresses a target's own repository metadata.
|
|
830
894
|
*
|
|
831
895
|
* @param path - The path to classify; either separator is read.
|
|
832
|
-
* @returns
|
|
896
|
+
* @returns True if the path is `.git` or sits beneath it; false otherwise.
|
|
833
897
|
*
|
|
834
898
|
* @remarks
|
|
835
899
|
* The one home of the `.git` membership rule, read in either direction. A target
|
|
@@ -850,10 +914,10 @@ export declare function matchesExpectation(expectation: WriteExpectation): boole
|
|
|
850
914
|
export declare function matchesGitPath(path: string): boolean;
|
|
851
915
|
|
|
852
916
|
/**
|
|
853
|
-
*
|
|
917
|
+
* Tests whether a caught filesystem error reports an absent path.
|
|
854
918
|
*
|
|
855
919
|
* @param error - The caught value.
|
|
856
|
-
* @returns `
|
|
920
|
+
* @returns True if `error` is an `Error` whose `code` is exactly `ENOENT`; false otherwise.
|
|
857
921
|
*
|
|
858
922
|
* @remarks
|
|
859
923
|
* The one place absence is told apart from failure. Every read here answers
|
|
@@ -872,11 +936,11 @@ export declare function matchesGitPath(path: string): boolean;
|
|
|
872
936
|
export declare function matchesMissingPath(error: unknown): boolean;
|
|
873
937
|
|
|
874
938
|
/**
|
|
875
|
-
*
|
|
939
|
+
* Tests whether a destination still matches the narrower state a caller observed.
|
|
876
940
|
*
|
|
877
941
|
* @param precondition - The caller-observed state the write is held to.
|
|
878
|
-
* @returns
|
|
879
|
-
*
|
|
942
|
+
* @returns True if the destination is absent as stated, or holds a physical file whose
|
|
943
|
+
* bytes digest to the stated value; false otherwise.
|
|
880
944
|
*
|
|
881
945
|
* @remarks
|
|
882
946
|
* Narrower than {@link matchesExpectation} on purpose. A caller observed bytes,
|
|
@@ -895,10 +959,10 @@ export declare function matchesMissingPath(error: unknown): boolean;
|
|
|
895
959
|
export declare function matchesPrecondition(precondition: WritePrecondition): boolean;
|
|
896
960
|
|
|
897
961
|
/**
|
|
898
|
-
*
|
|
962
|
+
* Tests whether a target-relative path is one no verb may delete.
|
|
899
963
|
*
|
|
900
964
|
* @param path - The target-relative path to classify.
|
|
901
|
-
* @returns
|
|
965
|
+
* @returns True if the path must survive every verb this package runs; false otherwise.
|
|
902
966
|
*
|
|
903
967
|
* @remarks
|
|
904
968
|
* The deletion deny-list, stated as a rule over paths rather than as a list of
|
|
@@ -923,10 +987,10 @@ export declare function matchesPrecondition(precondition: WritePrecondition): bo
|
|
|
923
987
|
export declare function matchesProtectedPath(path: string): boolean;
|
|
924
988
|
|
|
925
989
|
/**
|
|
926
|
-
*
|
|
990
|
+
* Tests whether a path names local configuration or a credential.
|
|
927
991
|
*
|
|
928
992
|
* @param path - The path to classify; either separator is read.
|
|
929
|
-
* @returns
|
|
993
|
+
* @returns True if the path must never be copied into a vendored host; false otherwise.
|
|
930
994
|
*
|
|
931
995
|
* @remarks
|
|
932
996
|
* The vendoring deny-list. A host root is staged from a real checkout, so the
|
|
@@ -948,7 +1012,7 @@ export declare function matchesProtectedPath(path: string): boolean;
|
|
|
948
1012
|
export declare function matchesSensitivePath(path: string): boolean;
|
|
949
1013
|
|
|
950
1014
|
/**
|
|
951
|
-
*
|
|
1015
|
+
* Represents the mutation spine: read the vendored host, re-derive the target, stage, swap.
|
|
952
1016
|
*
|
|
953
1017
|
* @remarks
|
|
954
1018
|
* Every verb runs the same steps. It snapshots each caller-supplied value
|
|
@@ -995,7 +1059,7 @@ export declare function matchesSensitivePath(path: string): boolean;
|
|
|
995
1059
|
export declare class Materializer implements MaterializerInterface {
|
|
996
1060
|
#private;
|
|
997
1061
|
/**
|
|
998
|
-
*
|
|
1062
|
+
* Constructs a materializer over one vendored host root.
|
|
999
1063
|
*
|
|
1000
1064
|
* @param options - The vendored host, in either representation, the initial
|
|
1001
1065
|
* listeners, and the listener-error handler.
|
|
@@ -1022,10 +1086,10 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1022
1086
|
* has to carry a second flag recording whether the read has happened yet.
|
|
1023
1087
|
*/
|
|
1024
1088
|
constructor(options?: MaterializerOptions);
|
|
1025
|
-
/**
|
|
1089
|
+
/** Exposes the materializer's observation channel. */
|
|
1026
1090
|
get emitter(): EmitterInterface<MaterializerEventMap>;
|
|
1027
1091
|
/**
|
|
1028
|
-
*
|
|
1092
|
+
* Compares a plan with a target through the vendored host that will repair it.
|
|
1029
1093
|
*
|
|
1030
1094
|
* @param plan - The compiled plan to compare.
|
|
1031
1095
|
* @param target - The directory to inspect.
|
|
@@ -1051,7 +1115,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1051
1115
|
*/
|
|
1052
1116
|
audit(plan: Plan, target: string): Audit;
|
|
1053
1117
|
/**
|
|
1054
|
-
*
|
|
1118
|
+
* Writes a plan into a vacant target.
|
|
1055
1119
|
*
|
|
1056
1120
|
* @param plan - The compiled plan to write.
|
|
1057
1121
|
* @param target - The directory to write into; it must hold nothing the plan would collide with.
|
|
@@ -1070,7 +1134,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1070
1134
|
*/
|
|
1071
1135
|
materialize(plan: Plan, target: string): MaterializeResult;
|
|
1072
1136
|
/**
|
|
1073
|
-
*
|
|
1137
|
+
* Writes a plan into an existing target, guided by an audit of it.
|
|
1074
1138
|
*
|
|
1075
1139
|
* @param plan - The compiled plan to write.
|
|
1076
1140
|
* @param audit - The preview returned by this materializer's `audit` method.
|
|
@@ -1094,7 +1158,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1094
1158
|
*/
|
|
1095
1159
|
repair(plan: Plan, audit: Audit, target: string): MaterializeResult;
|
|
1096
1160
|
/**
|
|
1097
|
-
*
|
|
1161
|
+
* Writes fetched dependency guides to their local mirrors.
|
|
1098
1162
|
*
|
|
1099
1163
|
* @param mirrors - The fetched guides; each carries the local bytes its write is held to.
|
|
1100
1164
|
* @param target - The directory to write into.
|
|
@@ -1110,7 +1174,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1110
1174
|
*/
|
|
1111
1175
|
mirror(mirrors: readonly Mirror[], target: string): MaterializeResult;
|
|
1112
1176
|
/**
|
|
1113
|
-
*
|
|
1177
|
+
* Rewrites the marker-bounded package table in the target's catalog agent file.
|
|
1114
1178
|
*
|
|
1115
1179
|
* @param entries - The published packages the table must list.
|
|
1116
1180
|
* @param target - The directory to write into.
|
|
@@ -1128,7 +1192,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1128
1192
|
*/
|
|
1129
1193
|
catalog(entries: readonly CatalogEntry[], target: string): MaterializeResult;
|
|
1130
1194
|
/**
|
|
1131
|
-
*
|
|
1195
|
+
* Rewrites the manifest regions the caller names in the target's manifest.
|
|
1132
1196
|
*
|
|
1133
1197
|
* @param regions - The dependency ranges and script values the manifest must declare.
|
|
1134
1198
|
* @param target - The directory to write into.
|
|
@@ -1153,7 +1217,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1153
1217
|
*/
|
|
1154
1218
|
declare(regions: ManifestRegionSet, target: string): MaterializeResult;
|
|
1155
1219
|
/**
|
|
1156
|
-
* Re-
|
|
1220
|
+
* Re-derives and deletes the tracked files the plan does not own.
|
|
1157
1221
|
*
|
|
1158
1222
|
* @param plan - The compiled plan that decides which paths are foreign.
|
|
1159
1223
|
* @param audit - The preview returned by this materializer's `audit` method; it must agree with the candidate set this call re-derives.
|
|
@@ -1191,7 +1255,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1191
1255
|
*/
|
|
1192
1256
|
remove(plan: Plan, audit: Audit, worktree: Worktree, target: string): MaterializeResult;
|
|
1193
1257
|
/**
|
|
1194
|
-
*
|
|
1258
|
+
* Tears the materializer down. Every later call throws, and teardown is idempotent.
|
|
1195
1259
|
*
|
|
1196
1260
|
* @returns Nothing.
|
|
1197
1261
|
*
|
|
@@ -1208,7 +1272,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1208
1272
|
}
|
|
1209
1273
|
|
|
1210
1274
|
/**
|
|
1211
|
-
*
|
|
1275
|
+
* Reports the outcome of one mutation of a target.
|
|
1212
1276
|
*
|
|
1213
1277
|
* @remarks
|
|
1214
1278
|
* `written` names every path this call created or replaced. `skipped` names
|
|
@@ -1223,7 +1287,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1223
1287
|
readonly removed: readonly string[];
|
|
1224
1288
|
}
|
|
1225
1289
|
|
|
1226
|
-
/**
|
|
1290
|
+
/** Represents the materializer's observation channel. */
|
|
1227
1291
|
export declare type MaterializerEventMap = {
|
|
1228
1292
|
readonly write: readonly [path: string];
|
|
1229
1293
|
readonly remove: readonly [path: string];
|
|
@@ -1233,7 +1297,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1233
1297
|
};
|
|
1234
1298
|
|
|
1235
1299
|
/**
|
|
1236
|
-
*
|
|
1300
|
+
* Describes the mutation contract: the package's only filesystem writer.
|
|
1237
1301
|
*
|
|
1238
1302
|
* @remarks
|
|
1239
1303
|
* Every method binds to the observation it was given. It re-derives what it is
|
|
@@ -1244,7 +1308,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1244
1308
|
export declare interface MaterializerInterface {
|
|
1245
1309
|
readonly emitter: EmitterInterface<MaterializerEventMap>;
|
|
1246
1310
|
/**
|
|
1247
|
-
*
|
|
1311
|
+
* Compares a plan with a target through the vendored host that will repair it.
|
|
1248
1312
|
*
|
|
1249
1313
|
* @param plan - The compiled plan to compare.
|
|
1250
1314
|
* @param target - The directory to inspect.
|
|
@@ -1252,7 +1316,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1252
1316
|
*/
|
|
1253
1317
|
audit(plan: Plan, target: string): Audit;
|
|
1254
1318
|
/**
|
|
1255
|
-
*
|
|
1319
|
+
* Writes a plan into a vacant target.
|
|
1256
1320
|
*
|
|
1257
1321
|
* @param plan - The compiled plan to write.
|
|
1258
1322
|
* @param target - The directory to write into; it must hold nothing the plan would collide with.
|
|
@@ -1260,7 +1324,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1260
1324
|
*/
|
|
1261
1325
|
materialize(plan: Plan, target: string): MaterializeResult;
|
|
1262
1326
|
/**
|
|
1263
|
-
*
|
|
1327
|
+
* Writes a plan into an existing target, guided by an audit of it.
|
|
1264
1328
|
*
|
|
1265
1329
|
* @param plan - The compiled plan to write.
|
|
1266
1330
|
* @param audit - The preview returned by this materializer's `audit` method.
|
|
@@ -1283,7 +1347,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1283
1347
|
*/
|
|
1284
1348
|
repair(plan: Plan, audit: Audit, target: string): MaterializeResult;
|
|
1285
1349
|
/**
|
|
1286
|
-
*
|
|
1350
|
+
* Writes fetched dependency guides to their local mirrors.
|
|
1287
1351
|
*
|
|
1288
1352
|
* @param mirrors - The fetched guides; each carries the local bytes its write is held to.
|
|
1289
1353
|
* @param target - The directory to write into.
|
|
@@ -1291,7 +1355,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1291
1355
|
*/
|
|
1292
1356
|
mirror(mirrors: readonly Mirror[], target: string): MaterializeResult;
|
|
1293
1357
|
/**
|
|
1294
|
-
*
|
|
1358
|
+
* Rewrites the marker-bounded package table in the target's catalog agent file.
|
|
1295
1359
|
*
|
|
1296
1360
|
* @param entries - The published packages the table must list.
|
|
1297
1361
|
* @param target - The directory to write into.
|
|
@@ -1299,7 +1363,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1299
1363
|
*/
|
|
1300
1364
|
catalog(entries: readonly CatalogEntry[], target: string): MaterializeResult;
|
|
1301
1365
|
/**
|
|
1302
|
-
*
|
|
1366
|
+
* Rewrites the manifest regions the caller names in the target's manifest.
|
|
1303
1367
|
*
|
|
1304
1368
|
* @param regions - The dependency ranges and script values the manifest must declare.
|
|
1305
1369
|
* @param target - The directory to write into.
|
|
@@ -1313,7 +1377,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1313
1377
|
*/
|
|
1314
1378
|
declare(regions: ManifestRegionSet, target: string): MaterializeResult;
|
|
1315
1379
|
/**
|
|
1316
|
-
* Re-
|
|
1380
|
+
* Re-derives and deletes the tracked files the plan does not own.
|
|
1317
1381
|
*
|
|
1318
1382
|
* @param plan - The compiled plan that decides which paths are foreign.
|
|
1319
1383
|
* @param audit - The preview returned by this materializer's `audit` method; it must agree with the candidate set this call re-derives.
|
|
@@ -1342,7 +1406,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1342
1406
|
*/
|
|
1343
1407
|
remove(plan: Plan, audit: Audit, worktree: Worktree, target: string): MaterializeResult;
|
|
1344
1408
|
/**
|
|
1345
|
-
*
|
|
1409
|
+
* Tears the materializer down. Every later call throws, and teardown is idempotent.
|
|
1346
1410
|
*
|
|
1347
1411
|
* @returns Nothing.
|
|
1348
1412
|
*/
|
|
@@ -1350,7 +1414,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1350
1414
|
}
|
|
1351
1415
|
|
|
1352
1416
|
/**
|
|
1353
|
-
*
|
|
1417
|
+
* Represents the options for the materializer.
|
|
1354
1418
|
*
|
|
1355
1419
|
* @remarks
|
|
1356
1420
|
* `host` is the vendored data root host-origin artifacts are copied from, in
|
|
@@ -1367,14 +1431,14 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1367
1431
|
readonly error?: EmitterErrorHandler;
|
|
1368
1432
|
}
|
|
1369
1433
|
|
|
1370
|
-
/**
|
|
1434
|
+
/** Caps the characters one repository branch may carry. */
|
|
1371
1435
|
export declare const MAX_BRANCH_LENGTH = 255;
|
|
1372
1436
|
|
|
1373
|
-
/**
|
|
1437
|
+
/** Caps the characters one caller-supplied upstream endpoint may carry. */
|
|
1374
1438
|
export declare const MAX_ENDPOINT_LENGTH = 2048;
|
|
1375
1439
|
|
|
1376
1440
|
/**
|
|
1377
|
-
*
|
|
1441
|
+
* Caps the paths one target's working-tree inventory may report.
|
|
1378
1442
|
*
|
|
1379
1443
|
* @remarks
|
|
1380
1444
|
* Far above the core collection ceiling, and deliberately so. A tracked or dirty
|
|
@@ -1386,7 +1450,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1386
1450
|
export declare const MAX_INVENTORY_PATHS = 100000;
|
|
1387
1451
|
|
|
1388
1452
|
/**
|
|
1389
|
-
*
|
|
1453
|
+
* Caps the segments one host path may carry.
|
|
1390
1454
|
*
|
|
1391
1455
|
* @remarks
|
|
1392
1456
|
* Bounds the work a path decision costs before any filesystem call is made. With
|
|
@@ -1396,7 +1460,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1396
1460
|
export declare const MAX_PATH_DEPTH = 64;
|
|
1397
1461
|
|
|
1398
1462
|
/**
|
|
1399
|
-
*
|
|
1463
|
+
* Caps the UTF-8 bytes one host path segment may encode to.
|
|
1400
1464
|
*
|
|
1401
1465
|
* @remarks
|
|
1402
1466
|
* The limit every supported filesystem shares for a single name. It is a byte
|
|
@@ -1406,7 +1470,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1406
1470
|
export declare const MAX_PATH_SEGMENT_BYTES = 255;
|
|
1407
1471
|
|
|
1408
1472
|
/**
|
|
1409
|
-
*
|
|
1473
|
+
* Caps the simultaneous upstream requests.
|
|
1410
1474
|
*
|
|
1411
1475
|
* @remarks
|
|
1412
1476
|
* A ceiling rather than a default: the reader picks what it opens by, and this
|
|
@@ -1414,14 +1478,29 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1414
1478
|
*/
|
|
1415
1479
|
export declare const MAX_UPSTREAM_CONCURRENCY = 64;
|
|
1416
1480
|
|
|
1417
|
-
/**
|
|
1481
|
+
/** Caps the retries one upstream request may be given after a transport fault. */
|
|
1418
1482
|
export declare const MAX_UPSTREAM_RETRIES = 5;
|
|
1419
1483
|
|
|
1420
|
-
/**
|
|
1484
|
+
/** Caps the timeout one upstream request may be given, in milliseconds. */
|
|
1421
1485
|
export declare const MAX_UPSTREAM_TIMEOUT = 300000;
|
|
1422
1486
|
|
|
1423
1487
|
/**
|
|
1424
|
-
*
|
|
1488
|
+
* Names the npm scope and repository owner the fleet's packages and sources are
|
|
1489
|
+
* published under.
|
|
1490
|
+
*/
|
|
1491
|
+
export declare const ORKESTREL_SCOPE = "orkestrel";
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* Names the media type that selects the registry's abbreviated packument.
|
|
1495
|
+
*
|
|
1496
|
+
* @remarks
|
|
1497
|
+
* Sent on exactly the reads that want a version, so the registry answers with the
|
|
1498
|
+
* smaller document instead of the whole packument.
|
|
1499
|
+
*/
|
|
1500
|
+
export declare const PACKUMENT_MEDIA_TYPE = "application/vnd.npm.install-v1+json";
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Projects a target-relative path to the storage name a vendored host holds it under.
|
|
1425
1504
|
*
|
|
1426
1505
|
* @param path - The target-relative path the file is written to.
|
|
1427
1506
|
* @returns The storage name beneath the host root.
|
|
@@ -1478,7 +1557,22 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1478
1557
|
export declare function pruneEmptiedDirectories(target: string, removed: readonly string[]): readonly string[];
|
|
1479
1558
|
|
|
1480
1559
|
/**
|
|
1481
|
-
*
|
|
1560
|
+
* Represents the byte allowance one whole upstream call spends across every read it makes.
|
|
1561
|
+
*
|
|
1562
|
+
* @remarks
|
|
1563
|
+
* `remaining` is deliberately mutable, and it is the one member of this module's
|
|
1564
|
+
* contracts that is. The carrier is what makes `budget` a bound on a call rather
|
|
1565
|
+
* than on a request: each read subtracts what it consumed from the same object,
|
|
1566
|
+
* so many small answers exhaust the call exactly as one oversized answer does.
|
|
1567
|
+
* Each call constructs its own carrier from `budget`, because concurrent calls
|
|
1568
|
+
* own separate budgets and must not spend each other's.
|
|
1569
|
+
*/
|
|
1570
|
+
export declare interface ReadAllowance {
|
|
1571
|
+
remaining: number;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* Captures one directory's physical identity.
|
|
1482
1576
|
*
|
|
1483
1577
|
* @param path - The resolved directory path to capture.
|
|
1484
1578
|
* @returns The anchor, or `undefined` when the path is not a physical directory.
|
|
@@ -1499,7 +1593,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1499
1593
|
export declare function readAnchor(path: string): WriteAnchor | undefined;
|
|
1500
1594
|
|
|
1501
1595
|
/**
|
|
1502
|
-
*
|
|
1596
|
+
* Captures what one destination holds before a write.
|
|
1503
1597
|
*
|
|
1504
1598
|
* @param path - The resolved destination path to capture.
|
|
1505
1599
|
* @returns The expectation, or `undefined` when the destination is a link or a
|
|
@@ -1523,7 +1617,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1523
1617
|
export declare function readExpectation(path: string): WriteExpectation | undefined;
|
|
1524
1618
|
|
|
1525
1619
|
/**
|
|
1526
|
-
*
|
|
1620
|
+
* Reads one contained file as its exact bytes in lowercase hexadecimal.
|
|
1527
1621
|
*
|
|
1528
1622
|
* @param root - The containing host directory.
|
|
1529
1623
|
* @param path - The portable root-relative file path.
|
|
@@ -1552,7 +1646,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1552
1646
|
export declare function readFileHex(root: string, path: string, limit?: number): string | undefined;
|
|
1553
1647
|
|
|
1554
1648
|
/**
|
|
1555
|
-
*
|
|
1649
|
+
* Reads one contained file as bounded UTF-8 text.
|
|
1556
1650
|
*
|
|
1557
1651
|
* @param root - The containing host directory.
|
|
1558
1652
|
* @param path - The portable root-relative file path.
|
|
@@ -1583,7 +1677,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1583
1677
|
* @param root - The vendored host root. Default: the installed package's
|
|
1584
1678
|
* vendored root, resolved from this module's location.
|
|
1585
1679
|
* @returns The verified manifest and the exact bytes of every declared entry.
|
|
1586
|
-
* @throws `ScaffoldError('TARGET',
|
|
1680
|
+
* @throws `ScaffoldError('TARGET', …)` when the root is not a readable physical
|
|
1587
1681
|
* directory, its manifest is absent or unreadable, the manifest does not verify,
|
|
1588
1682
|
* or a declared file is unreadable or misses its digest.
|
|
1589
1683
|
*
|
|
@@ -1605,7 +1699,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1605
1699
|
export declare function readHostFloor(root?: string): Host;
|
|
1606
1700
|
|
|
1607
1701
|
/**
|
|
1608
|
-
*
|
|
1702
|
+
* Reads a vendored host's manifest, when it carries one.
|
|
1609
1703
|
*
|
|
1610
1704
|
* @param host - The vendored host root to read.
|
|
1611
1705
|
* @param name - The root-relative manifest path. Default: `manifest.json`.
|
|
@@ -1637,7 +1731,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1637
1731
|
export declare function readHostManifest(host: string, name?: string): HostManifest | undefined;
|
|
1638
1732
|
|
|
1639
1733
|
/**
|
|
1640
|
-
*
|
|
1734
|
+
* Derives one vendored-host manifest entry from a file in a checkout.
|
|
1641
1735
|
*
|
|
1642
1736
|
* @param destination - The target-relative path the file is written to.
|
|
1643
1737
|
* @param source - The resolved host path the bytes are read from.
|
|
@@ -1666,7 +1760,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1666
1760
|
export declare function readManifestEntry(destination: string, source: string): ManifestEntry | undefined;
|
|
1667
1761
|
|
|
1668
1762
|
/**
|
|
1669
|
-
*
|
|
1763
|
+
* Reads a target's current bytes at the paths a plan claims.
|
|
1670
1764
|
*
|
|
1671
1765
|
* @param target - The target directory to read.
|
|
1672
1766
|
* @param paths - The plan-relative paths to probe.
|
|
@@ -1681,7 +1775,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1681
1775
|
* @remarks
|
|
1682
1776
|
* The one door from a real directory into the vocabulary an audit compares in.
|
|
1683
1777
|
* Absence is omission rather than an empty value, because core reads a missing
|
|
1684
|
-
* key as a missing destination and an empty string as a present directory;
|
|
1778
|
+
* key as a missing destination and an empty string as a present directory;
|
|
1685
1779
|
* they are different verdicts. A path that is there but unreadable throws instead
|
|
1686
1780
|
* of being omitted, because omission would report it as missing and a repair
|
|
1687
1781
|
* would then overwrite whatever is actually sitting there.
|
|
@@ -1697,7 +1791,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1697
1791
|
export declare function readSnapshot(target: string, paths: readonly string[]): Snapshot;
|
|
1698
1792
|
|
|
1699
1793
|
/**
|
|
1700
|
-
*
|
|
1794
|
+
* Matches the Windows device names that stay reserved even when an extension follows.
|
|
1701
1795
|
*
|
|
1702
1796
|
* @remarks
|
|
1703
1797
|
* Refused on every host rather than only on Windows. A generated workspace is
|
|
@@ -1707,7 +1801,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1707
1801
|
export declare const RESERVED_SEGMENT_PATTERN: RegExp;
|
|
1708
1802
|
|
|
1709
1803
|
/**
|
|
1710
|
-
*
|
|
1804
|
+
* Resolves a root-relative path and refuses one that leaves its root.
|
|
1711
1805
|
*
|
|
1712
1806
|
* @param root - The containing host directory.
|
|
1713
1807
|
* @param path - The portable root-relative path.
|
|
@@ -1747,7 +1841,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1747
1841
|
export declare function resolveContainedPath(root: string, path: string): string | undefined;
|
|
1748
1842
|
|
|
1749
1843
|
/**
|
|
1750
|
-
*
|
|
1844
|
+
* Resolves a path through the real filesystem, keeping the part that does not exist yet.
|
|
1751
1845
|
*
|
|
1752
1846
|
* @param path - The absolute or relative host path to resolve.
|
|
1753
1847
|
* @returns The lexical resolution of `path`, with its existing prefix then
|
|
@@ -1797,7 +1891,17 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1797
1891
|
export declare function resolveRealPath(path: string): string | undefined;
|
|
1798
1892
|
|
|
1799
1893
|
/**
|
|
1800
|
-
*
|
|
1894
|
+
* Names the repository this package's own vendored files are served from.
|
|
1895
|
+
*
|
|
1896
|
+
* @remarks
|
|
1897
|
+
* This package's bare name, stated rather than derived, because the reader has no
|
|
1898
|
+
* manifest to read it out of and one raw content host serves both the fleet's
|
|
1899
|
+
* guides and these files.
|
|
1900
|
+
*/
|
|
1901
|
+
export declare const SCAFFOLD_REPOSITORY = "scaffold";
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* Stages the named destinations of a value host into a private root.
|
|
1801
1905
|
*
|
|
1802
1906
|
* @param host - The host whose bytes are written, keyed by destination.
|
|
1803
1907
|
* @param root - The private directory to fill; it must already be a directory
|
|
@@ -1833,7 +1937,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1833
1937
|
export declare function stageBytes(host: Host, root: string, destinations: readonly string[]): readonly ManifestEntry[];
|
|
1834
1938
|
|
|
1835
1939
|
/**
|
|
1836
|
-
*
|
|
1940
|
+
* Stages a vendored host root from a real checkout.
|
|
1837
1941
|
*
|
|
1838
1942
|
* @param checkout - The checkout the vendored paths are read from.
|
|
1839
1943
|
* @param host - The vendored host root to fill; it must be absent or empty.
|
|
@@ -1920,7 +2024,24 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1920
2024
|
export declare function stageInventory(checkout: string, path: string): HostManifest;
|
|
1921
2025
|
|
|
1922
2026
|
/**
|
|
1923
|
-
*
|
|
2027
|
+
* Reports the outcome of one bounded read whose body is taken as text.
|
|
2028
|
+
*
|
|
2029
|
+
* @remarks
|
|
2030
|
+
* `content` carries the body only when `lookup` is `found`; otherwise it is
|
|
2031
|
+
* empty and `note` states what happened. A read that is not `found` is an answer
|
|
2032
|
+
* rather than a throw, which is what lets one dead row sit beside live ones.
|
|
2033
|
+
*/
|
|
2034
|
+
export declare interface TextReadResult {
|
|
2035
|
+
readonly lookup: Lookup;
|
|
2036
|
+
readonly content: string;
|
|
2037
|
+
readonly note: string;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
/** Holds the note a release carries when its packument names no readable latest version. */
|
|
2041
|
+
export declare const UNREADABLE_VERSION_NOTE = "the answer carries no readable latest version";
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* Represents the reading spine: one bounded, unauthenticated, redirect-free request per answer.
|
|
1924
2045
|
*
|
|
1925
2046
|
* @remarks
|
|
1926
2047
|
* This is the package's only network reader, and it never writes. Every call
|
|
@@ -1949,7 +2070,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1949
2070
|
* flight instead of waiting for it.
|
|
1950
2071
|
*
|
|
1951
2072
|
* The allowance is threaded through the private reads as a mutable
|
|
1952
|
-
*
|
|
2073
|
+
* {@link ReadAllowance} carrier rather than held on the instance, because
|
|
1953
2074
|
* concurrent calls each own their own budget and must not spend each other's.
|
|
1954
2075
|
*
|
|
1955
2076
|
* @example
|
|
@@ -1964,7 +2085,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1964
2085
|
export declare class Upstream implements UpstreamInterface {
|
|
1965
2086
|
#private;
|
|
1966
2087
|
/**
|
|
1967
|
-
*
|
|
2088
|
+
* Constructs a reader over one raw content host and one registry.
|
|
1968
2089
|
*
|
|
1969
2090
|
* @param options - The endpoints, the request bounds, the initial
|
|
1970
2091
|
* listeners, and the listener-error handler.
|
|
@@ -1983,10 +2104,10 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1983
2104
|
* is refused too: this reader authenticates nothing and appends its own path.
|
|
1984
2105
|
*/
|
|
1985
2106
|
constructor(options?: UpstreamOptions);
|
|
1986
|
-
/**
|
|
2107
|
+
/** Exposes the upstream reader's observation channel. */
|
|
1987
2108
|
get emitter(): EmitterInterface<UpstreamEventMap>;
|
|
1988
2109
|
/**
|
|
1989
|
-
*
|
|
2110
|
+
* Looks up the newest release each declared range admits.
|
|
1990
2111
|
*
|
|
1991
2112
|
* @param dependencies - The declared dependencies to look up.
|
|
1992
2113
|
* @returns One release verdict per dependency, in input order.
|
|
@@ -2012,7 +2133,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2012
2133
|
*/
|
|
2013
2134
|
lookup(dependencies: readonly Dependency[]): Promise<readonly Release[]>;
|
|
2014
2135
|
/**
|
|
2015
|
-
*
|
|
2136
|
+
* Fetches each named package's guide, beside the local mirror it answers for.
|
|
2016
2137
|
*
|
|
2017
2138
|
* @param names - The packages to fetch: the target's declared set, or the whole organization.
|
|
2018
2139
|
* @param current - The target's local mirrors as exact bytes, keyed by mirror path.
|
|
@@ -2040,7 +2161,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2040
2161
|
*/
|
|
2041
2162
|
fetch(names: readonly string[], current: Snapshot): Promise<readonly Mirror[]>;
|
|
2042
2163
|
/**
|
|
2043
|
-
*
|
|
2164
|
+
* Reads each named vendored file from the repository, beside the target bytes it answers for.
|
|
2044
2165
|
*
|
|
2045
2166
|
* @param paths - The target-relative vendored paths to read.
|
|
2046
2167
|
* @param current - The target files as exact bytes, keyed by the same paths.
|
|
@@ -2080,7 +2201,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2080
2201
|
*/
|
|
2081
2202
|
read(paths: readonly string[], current: Snapshot): Promise<readonly HostFile[]>;
|
|
2082
2203
|
/**
|
|
2083
|
-
*
|
|
2204
|
+
* Catalogs the published fleet from the registry's organization package list.
|
|
2084
2205
|
*
|
|
2085
2206
|
* @returns One row per published package, sorted by name.
|
|
2086
2207
|
* @throws {@link ScaffoldError} coded `FETCH` when the organization package
|
|
@@ -2108,7 +2229,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2108
2229
|
*/
|
|
2109
2230
|
catalog(): Promise<readonly CatalogEntry[]>;
|
|
2110
2231
|
/**
|
|
2111
|
-
*
|
|
2232
|
+
* Tears the reader down, aborting every request in flight. Teardown is idempotent.
|
|
2112
2233
|
*
|
|
2113
2234
|
* @returns Nothing.
|
|
2114
2235
|
*
|
|
@@ -2130,7 +2251,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2130
2251
|
}
|
|
2131
2252
|
|
|
2132
2253
|
/**
|
|
2133
|
-
*
|
|
2254
|
+
* Represents the upstream reader's observation channel.
|
|
2134
2255
|
*
|
|
2135
2256
|
* @remarks
|
|
2136
2257
|
* Each verdict is published whole rather than as a name beside a summary, so a
|
|
@@ -2147,7 +2268,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2147
2268
|
};
|
|
2148
2269
|
|
|
2149
2270
|
/**
|
|
2150
|
-
*
|
|
2271
|
+
* Describes the upstream contract: the package's only network reader, and it never writes.
|
|
2151
2272
|
*
|
|
2152
2273
|
* @remarks
|
|
2153
2274
|
* A per-package failure is collected as a verdict carrying its cause, not
|
|
@@ -2163,14 +2284,14 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2163
2284
|
export declare interface UpstreamInterface {
|
|
2164
2285
|
readonly emitter: EmitterInterface<UpstreamEventMap>;
|
|
2165
2286
|
/**
|
|
2166
|
-
*
|
|
2287
|
+
* Looks up the newest release each declared range admits.
|
|
2167
2288
|
*
|
|
2168
2289
|
* @param dependencies - The declared dependencies to look up.
|
|
2169
2290
|
* @returns One release verdict per dependency, in input order.
|
|
2170
2291
|
*/
|
|
2171
2292
|
lookup(dependencies: readonly Dependency[]): Promise<readonly Release[]>;
|
|
2172
2293
|
/**
|
|
2173
|
-
*
|
|
2294
|
+
* Fetches each named package's guide, beside the local mirror it answers for.
|
|
2174
2295
|
*
|
|
2175
2296
|
* @param names - The packages to fetch: the target's declared set, or the whole organization.
|
|
2176
2297
|
* @param current - The target's local mirrors as exact bytes, keyed by mirror path.
|
|
@@ -2178,7 +2299,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2178
2299
|
*/
|
|
2179
2300
|
fetch(names: readonly string[], current: Snapshot): Promise<readonly Mirror[]>;
|
|
2180
2301
|
/**
|
|
2181
|
-
*
|
|
2302
|
+
* Reads each named vendored file from the repository, beside the target bytes it answers for.
|
|
2182
2303
|
*
|
|
2183
2304
|
* @param paths - The target-relative vendored paths to read.
|
|
2184
2305
|
* @param current - The target files as exact bytes, keyed by the same paths.
|
|
@@ -2186,13 +2307,13 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2186
2307
|
*/
|
|
2187
2308
|
read(paths: readonly string[], current: Snapshot): Promise<readonly HostFile[]>;
|
|
2188
2309
|
/**
|
|
2189
|
-
*
|
|
2310
|
+
* Catalogs the published fleet from the registry's organization package list.
|
|
2190
2311
|
*
|
|
2191
2312
|
* @returns One row per published package, sorted by name.
|
|
2192
2313
|
*/
|
|
2193
2314
|
catalog(): Promise<readonly CatalogEntry[]>;
|
|
2194
2315
|
/**
|
|
2195
|
-
*
|
|
2316
|
+
* Tears the reader down, aborting every request in flight. Teardown is idempotent.
|
|
2196
2317
|
*
|
|
2197
2318
|
* @returns Nothing.
|
|
2198
2319
|
*/
|
|
@@ -2200,7 +2321,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2200
2321
|
}
|
|
2201
2322
|
|
|
2202
2323
|
/**
|
|
2203
|
-
*
|
|
2324
|
+
* Represents the options for the upstream reader.
|
|
2204
2325
|
*
|
|
2205
2326
|
* @remarks
|
|
2206
2327
|
* The endpoints are grouped under the entity each configures: `repository`
|
|
@@ -2233,7 +2354,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2233
2354
|
}
|
|
2234
2355
|
|
|
2235
2356
|
/**
|
|
2236
|
-
*
|
|
2357
|
+
* Describes what git reports about a target's working tree.
|
|
2237
2358
|
*
|
|
2238
2359
|
* @remarks
|
|
2239
2360
|
* `tracked` is the only set a deletion may draw from: git does not report the
|
|
@@ -2252,7 +2373,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2252
2373
|
}
|
|
2253
2374
|
|
|
2254
2375
|
/**
|
|
2255
|
-
*
|
|
2376
|
+
* Represents one physical directory identity captured across a write transaction.
|
|
2256
2377
|
*
|
|
2257
2378
|
* @remarks
|
|
2258
2379
|
* Device and inode locate the directory and do not date it. Two directories
|
|
@@ -2265,14 +2386,14 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2265
2386
|
readonly inode: number;
|
|
2266
2387
|
}
|
|
2267
2388
|
|
|
2268
|
-
/**
|
|
2389
|
+
/** Reports the final directory anchor of a write transaction and the subset one call created. */
|
|
2269
2390
|
export declare interface WriteDirectoryResult {
|
|
2270
2391
|
readonly anchor: WriteAnchor;
|
|
2271
2392
|
readonly created: readonly WriteAnchor[];
|
|
2272
2393
|
}
|
|
2273
2394
|
|
|
2274
2395
|
/**
|
|
2275
|
-
*
|
|
2396
|
+
* Represents one destination snapshot captured before a write and required to survive it.
|
|
2276
2397
|
*
|
|
2277
2398
|
* @remarks
|
|
2278
2399
|
* `device`, `inode`, `modified`, `size`, and `digest` are present only where
|
|
@@ -2288,7 +2409,10 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2288
2409
|
readonly digest?: string;
|
|
2289
2410
|
}
|
|
2290
2411
|
|
|
2291
|
-
/**
|
|
2412
|
+
/**
|
|
2413
|
+
* Describes the narrower caller-observed destination state a write transaction must
|
|
2414
|
+
* still match.
|
|
2415
|
+
*/
|
|
2292
2416
|
export declare interface WritePrecondition {
|
|
2293
2417
|
readonly path: string;
|
|
2294
2418
|
readonly shape: 'absent' | 'file';
|
|
@@ -2296,7 +2420,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2296
2420
|
}
|
|
2297
2421
|
|
|
2298
2422
|
/**
|
|
2299
|
-
*
|
|
2423
|
+
* Represents one staged, reversible mutation of one target directory.
|
|
2300
2424
|
*
|
|
2301
2425
|
* @remarks
|
|
2302
2426
|
* The transaction owns a private root beside the target — a sibling directory on
|
|
@@ -2363,7 +2487,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2363
2487
|
export declare class WriteTransaction {
|
|
2364
2488
|
#private;
|
|
2365
2489
|
/**
|
|
2366
|
-
*
|
|
2490
|
+
* Opens a transaction over one target directory.
|
|
2367
2491
|
*
|
|
2368
2492
|
* @param target - The directory every path is written beneath.
|
|
2369
2493
|
* @param paths - Every target-relative path this transaction may touch.
|
|
@@ -2381,14 +2505,14 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2381
2505
|
* transactions over one target never collide.
|
|
2382
2506
|
*/
|
|
2383
2507
|
constructor(target: string, paths: readonly string[], preconditions?: readonly WritePrecondition[]);
|
|
2384
|
-
/**
|
|
2508
|
+
/** Names the resolved directory every path is written beneath. */
|
|
2385
2509
|
get target(): string;
|
|
2386
|
-
/**
|
|
2510
|
+
/** Reports what each destination held when the transaction opened, in path order. */
|
|
2387
2511
|
get expectations(): readonly WriteExpectation[];
|
|
2388
|
-
/**
|
|
2512
|
+
/** Reports whether the transaction can still be committed or discarded. */
|
|
2389
2513
|
get open(): boolean;
|
|
2390
2514
|
/**
|
|
2391
|
-
*
|
|
2515
|
+
* Stages one text file.
|
|
2392
2516
|
*
|
|
2393
2517
|
* @param path - The target-relative path to write.
|
|
2394
2518
|
* @param content - The exact UTF-8 text the destination must hold.
|
|
@@ -2404,7 +2528,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2404
2528
|
*/
|
|
2405
2529
|
write(path: string, content: string): void;
|
|
2406
2530
|
/**
|
|
2407
|
-
*
|
|
2531
|
+
* Stages one byte-for-byte copy of a file that already exists on this host.
|
|
2408
2532
|
*
|
|
2409
2533
|
* @param path - The target-relative path to write.
|
|
2410
2534
|
* @param source - The resolved absolute path to copy the bytes from.
|
|
@@ -2421,7 +2545,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2421
2545
|
*/
|
|
2422
2546
|
copy(path: string, source: string, executable: boolean): void;
|
|
2423
2547
|
/**
|
|
2424
|
-
*
|
|
2548
|
+
* Establishes one directory inside the target, one segment at a time.
|
|
2425
2549
|
*
|
|
2426
2550
|
* @param path - The target-relative directory to establish.
|
|
2427
2551
|
* @returns The directory's identity and every segment this call created.
|
|
@@ -2438,7 +2562,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2438
2562
|
*/
|
|
2439
2563
|
establish(path: string): WriteDirectoryResult;
|
|
2440
2564
|
/**
|
|
2441
|
-
*
|
|
2565
|
+
* Marks one file for deletion at commit.
|
|
2442
2566
|
*
|
|
2443
2567
|
* @param path - The target-relative file to delete.
|
|
2444
2568
|
* @returns Nothing.
|
|
@@ -2452,7 +2576,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2452
2576
|
*/
|
|
2453
2577
|
remove(path: string): void;
|
|
2454
2578
|
/**
|
|
2455
|
-
*
|
|
2579
|
+
* Promotes every staged file and takes every marked file, or rolls the whole call back.
|
|
2456
2580
|
*
|
|
2457
2581
|
* @returns Every target-relative path whose destination changed: the files
|
|
2458
2582
|
* promoted, then the directories established, then the files taken.
|
|
@@ -2470,7 +2594,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
2470
2594
|
*/
|
|
2471
2595
|
commit(): readonly string[];
|
|
2472
2596
|
/**
|
|
2473
|
-
*
|
|
2597
|
+
* Abandons the transaction and removes everything it created.
|
|
2474
2598
|
*
|
|
2475
2599
|
* @returns Nothing.
|
|
2476
2600
|
* @throws {@link ScaffoldError} coded `WRITE` when residue could not be
|