@veryfront/ext-content-mdx 0.1.1183 → 0.1.1186

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/esm/deno.d.ts +20 -1
  2. package/esm/deno.js +31 -6
  3. package/esm/src/errors/error-registry.d.ts +2 -2
  4. package/esm/src/extensions/websocket/index.d.ts +3 -0
  5. package/esm/src/extensions/websocket/index.d.ts.map +1 -0
  6. package/esm/src/extensions/websocket/index.js +2 -0
  7. package/esm/src/extensions/websocket/node-websocket-server-provider.d.ts +51 -0
  8. package/esm/src/extensions/websocket/node-websocket-server-provider.d.ts.map +1 -0
  9. package/esm/src/extensions/websocket/node-websocket-server-provider.js +146 -0
  10. package/esm/src/platform/adapters/base.d.ts +35 -0
  11. package/esm/src/platform/adapters/base.d.ts.map +1 -1
  12. package/esm/src/platform/adapters/base.js +54 -5
  13. package/esm/src/platform/adapters/bounded-file-read.d.ts +34 -0
  14. package/esm/src/platform/adapters/bounded-file-read.d.ts.map +1 -0
  15. package/esm/src/platform/adapters/bounded-file-read.js +179 -0
  16. package/esm/src/platform/adapters/file-snapshot-error.d.ts +6 -0
  17. package/esm/src/platform/adapters/file-snapshot-error.d.ts.map +1 -0
  18. package/esm/src/platform/adapters/file-snapshot-error.js +11 -0
  19. package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.d.ts +33 -0
  20. package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.d.ts.map +1 -0
  21. package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.js +205 -0
  22. package/esm/src/platform/compat/fs.d.ts +6 -2
  23. package/esm/src/platform/compat/fs.d.ts.map +1 -1
  24. package/esm/src/platform/compat/fs.js +55 -19
  25. package/esm/src/platform/compat/not-found-error.d.ts +7 -0
  26. package/esm/src/platform/compat/not-found-error.d.ts.map +1 -0
  27. package/esm/src/platform/compat/not-found-error.js +41 -0
  28. package/esm/src/platform/compat/path/basic-operations.d.ts +1 -1
  29. package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
  30. package/esm/src/platform/compat/path/basic-operations.js +24 -44
  31. package/esm/src/platform/compat/path/index.d.ts +1 -0
  32. package/esm/src/platform/compat/path/index.d.ts.map +1 -1
  33. package/esm/src/platform/compat/path/index.js +1 -0
  34. package/esm/src/platform/compat/path/parse-format.d.ts.map +1 -1
  35. package/esm/src/platform/compat/path/parse-format.js +26 -20
  36. package/esm/src/platform/compat/path/portable.d.ts +16 -0
  37. package/esm/src/platform/compat/path/portable.d.ts.map +1 -0
  38. package/esm/src/platform/compat/path/portable.js +307 -0
  39. package/esm/src/platform/compat/path/posix.d.ts +14 -0
  40. package/esm/src/platform/compat/path/posix.d.ts.map +1 -0
  41. package/esm/src/platform/compat/path/posix.js +206 -0
  42. package/esm/src/platform/compat/path/resolution.d.ts +1 -1
  43. package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
  44. package/esm/src/platform/compat/path/resolution.js +28 -112
  45. package/esm/src/platform/compat/path/runtime.d.ts +2 -1
  46. package/esm/src/platform/compat/path/runtime.d.ts.map +1 -1
  47. package/esm/src/platform/compat/path/runtime.js +5 -0
  48. package/esm/src/platform/compat/path/types.d.ts +5 -1
  49. package/esm/src/platform/compat/path/types.d.ts.map +1 -1
  50. package/esm/src/platform/compat/path/url-conversion.d.ts +10 -0
  51. package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
  52. package/esm/src/platform/compat/path/url-conversion.js +63 -41
  53. package/esm/src/platform/compat/process.d.ts +1 -1
  54. package/esm/src/utils/constants/build.d.ts +9 -0
  55. package/esm/src/utils/constants/build.d.ts.map +1 -1
  56. package/esm/src/utils/constants/build.js +9 -0
  57. package/esm/src/utils/constants/index.d.ts +1 -1
  58. package/esm/src/utils/constants/index.d.ts.map +1 -1
  59. package/esm/src/utils/constants/index.js +1 -1
  60. package/esm/src/utils/css-artifact-identity.d.ts +23 -0
  61. package/esm/src/utils/css-artifact-identity.d.ts.map +1 -0
  62. package/esm/src/utils/css-artifact-identity.js +77 -0
  63. package/esm/src/utils/index.d.ts +1 -0
  64. package/esm/src/utils/index.d.ts.map +1 -1
  65. package/esm/src/utils/index.js +1 -0
  66. package/esm/src/utils/version-constant.d.ts +1 -1
  67. package/esm/src/utils/version-constant.js +1 -1
  68. package/package.json +2 -2
@@ -1,15 +1,64 @@
1
1
  const WEBSOCKET_UPGRADE_RESPONSE_KIND = "websocket-upgrade";
2
2
  export function createWebSocketUpgradeResponse(input = {}) {
3
- return {
3
+ return Object.freeze({
4
4
  kind: WEBSOCKET_UPGRADE_RESPONSE_KIND,
5
5
  status: 101,
6
6
  statusText: input.statusText ?? "Switching Protocols",
7
7
  headers: new Headers(input.headers),
8
8
  body: null,
9
- };
9
+ });
10
+ }
11
+ // A Proxy can synthesize a fresh prototype for every getPrototypeOf trap.
12
+ // Bound each structural field lookup so an upgrade discriminator can never
13
+ // turn into attacker-controlled, unbounded traversal.
14
+ const MAX_UPGRADE_RESPONSE_PROTOTYPE_DEPTH = 16;
15
+ const headersGet = Headers.prototype.get;
16
+ function readDataProperty(value, key) {
17
+ const visited = new Set();
18
+ let current = value;
19
+ try {
20
+ for (let depth = 0; current !== null && depth < MAX_UPGRADE_RESPONSE_PROTOTYPE_DEPTH; depth++) {
21
+ if (visited.has(current))
22
+ return { readable: false };
23
+ visited.add(current);
24
+ const descriptor = Reflect.getOwnPropertyDescriptor(current, key);
25
+ if (descriptor) {
26
+ return "value" in descriptor
27
+ ? { readable: true, value: descriptor.value }
28
+ : { readable: false };
29
+ }
30
+ current = Reflect.getPrototypeOf(current);
31
+ }
32
+ }
33
+ catch {
34
+ return { readable: false };
35
+ }
36
+ return current === null ? { readable: true, value: undefined } : { readable: false };
10
37
  }
11
38
  export function isWebSocketUpgradeResponse(value) {
12
- return typeof value === "object" && value !== null &&
13
- value.kind === WEBSOCKET_UPGRADE_RESPONSE_KIND &&
14
- value.status === 101;
39
+ if (typeof value !== "object" || value === null)
40
+ return false;
41
+ const kind = readDataProperty(value, "kind");
42
+ if (!kind.readable || kind.value !== WEBSOCKET_UPGRADE_RESPONSE_KIND)
43
+ return false;
44
+ const status = readDataProperty(value, "status");
45
+ if (!status.readable || status.value !== 101)
46
+ return false;
47
+ const statusText = readDataProperty(value, "statusText");
48
+ if (!statusText.readable || typeof statusText.value !== "string")
49
+ return false;
50
+ const headers = readDataProperty(value, "headers");
51
+ if (!headers.readable || typeof headers.value !== "object" || headers.value === null) {
52
+ return false;
53
+ }
54
+ try {
55
+ // Verify the native Headers internal slot without consulting hostile
56
+ // properties or Symbol.hasInstance hooks.
57
+ Reflect.apply(headersGet, headers.value, ["upgrade"]);
58
+ }
59
+ catch {
60
+ return false;
61
+ }
62
+ const body = readDataProperty(value, "body");
63
+ return body.readable && body.value === null;
15
64
  }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Minimal handle contract shared by native filesystem adapters.
3
+ *
4
+ * The caller supplies the handle factory so each runtime can choose its native
5
+ * open semantics while this helper owns bounded chunking and cleanup.
6
+ */
7
+ export interface BoundedFileReader {
8
+ read(buffer: Uint8Array): Promise<number | null>;
9
+ }
10
+ export interface BoundedFileReadHandle extends BoundedFileReader {
11
+ close(): void | Promise<void>;
12
+ }
13
+ export declare function requireBoundedFileReadLimit(byteLimit: unknown): number;
14
+ /**
15
+ * Read at most `byteLimit` bytes without first materializing the whole file.
16
+ *
17
+ * A full-length result is intentionally ambiguous: callers that need to
18
+ * distinguish an exact-size file from an oversized file request their accepted
19
+ * maximum plus one byte.
20
+ */
21
+ export declare function readBoundedFilePrefix(openHandle: () => Promise<BoundedFileReadHandle>, byteLimit: number): Promise<Uint8Array>;
22
+ /**
23
+ * Read the complete file only when it fits within `byteLimit`.
24
+ *
25
+ * Unlike a prefix read, reaching the limit triggers one additional EOF probe.
26
+ * The probe reuses the final byte of the accepted buffer, so the helper never
27
+ * retains more than `byteLimit` bytes from the source.
28
+ */
29
+ export declare function readFileWithinLimit(openHandle: () => Promise<BoundedFileReadHandle>, byteLimit: number): Promise<Uint8Array>;
30
+ /** Read a bounded prefix while leaving ownership of the open handle to the caller. */
31
+ export declare function readBoundedFileHandlePrefix(reader: BoundedFileReader, byteLimit: number): Promise<Uint8Array>;
32
+ /** Read a complete bounded file while leaving ownership of the handle to the caller. */
33
+ export declare function readFileHandleWithinLimit(reader: BoundedFileReader, byteLimit: number): Promise<Uint8Array>;
34
+ //# sourceMappingURL=bounded-file-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-file-read.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/adapters/bounded-file-read.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,KAAK,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAuGD,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAKtE;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,EAChD,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,EAChD,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED,sFAAsF;AACtF,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,CAAC,CAoDrB;AAED,wFAAwF;AACxF,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,CAAC,CAuBrB"}
@@ -0,0 +1,179 @@
1
+ const apply = Reflect.apply;
2
+ const arrayPush = Array.prototype.push;
3
+ const minimum = Math.min;
4
+ const numberIsSafeInteger = Number.isSafeInteger;
5
+ const NativeUint8Array = Uint8Array;
6
+ const typedArrayPrototype = Object.getPrototypeOf(NativeUint8Array.prototype);
7
+ const typedArrayByteLengthGetterCandidate = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteLength")?.get;
8
+ const typedArrayBufferGetterCandidate = Object.getOwnPropertyDescriptor(typedArrayPrototype, "buffer")?.get;
9
+ const typedArrayByteOffsetGetterCandidate = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteOffset")?.get;
10
+ const setBytes = NativeUint8Array.prototype.set;
11
+ if (typeof typedArrayByteLengthGetterCandidate !== "function" ||
12
+ typeof typedArrayBufferGetterCandidate !== "function" ||
13
+ typeof typedArrayByteOffsetGetterCandidate !== "function") {
14
+ throw new TypeError("Required Uint8Array intrinsics are unavailable");
15
+ }
16
+ const typedArrayByteLengthGetter = typedArrayByteLengthGetterCandidate;
17
+ const typedArrayBufferGetter = typedArrayBufferGetterCandidate;
18
+ const typedArrayByteOffsetGetter = typedArrayByteOffsetGetterCandidate;
19
+ function byteLengthOf(value) {
20
+ const byteLength = apply(typedArrayByteLengthGetter, value, []);
21
+ if (!numberIsSafeInteger(byteLength) || byteLength < 0) {
22
+ throw new TypeError("Filesystem read buffer has an invalid byte length");
23
+ }
24
+ return byteLength;
25
+ }
26
+ function allocateBytes(byteLength) {
27
+ const bytes = new NativeUint8Array(byteLength);
28
+ if (byteLengthOf(bytes) !== byteLength) {
29
+ throw new TypeError("Filesystem byte buffer allocation returned an invalid size");
30
+ }
31
+ return bytes;
32
+ }
33
+ function viewBytes(value, start, byteLength) {
34
+ const sourceByteLength = byteLengthOf(value);
35
+ if (!numberIsSafeInteger(start) || start < 0 ||
36
+ !numberIsSafeInteger(byteLength) || byteLength < 0 ||
37
+ start > sourceByteLength - byteLength) {
38
+ throw new RangeError("Filesystem byte view is outside its source buffer");
39
+ }
40
+ const buffer = apply(typedArrayBufferGetter, value, []);
41
+ const byteOffset = apply(typedArrayByteOffsetGetter, value, []);
42
+ const view = new NativeUint8Array(buffer, byteOffset + start, byteLength);
43
+ if (byteLengthOf(view) !== byteLength) {
44
+ throw new TypeError("Filesystem byte view allocation returned an invalid size");
45
+ }
46
+ return view;
47
+ }
48
+ // Keep a large caller-supplied limit from becoming an equally large eager
49
+ // allocation when the source is small. The aggregate returned data remains
50
+ // bounded by the caller's limit.
51
+ const BOUNDED_FILE_READ_CHUNK_BYTES = 64 * 1024;
52
+ async function readAndCloseHandle(openHandle, read) {
53
+ const handle = await openHandle();
54
+ let result;
55
+ let primaryFailure;
56
+ let primaryFailed = false;
57
+ try {
58
+ result = await read(handle);
59
+ }
60
+ catch (error) {
61
+ primaryFailed = true;
62
+ primaryFailure = error;
63
+ }
64
+ try {
65
+ await handle.close();
66
+ }
67
+ catch (cleanupFailure) {
68
+ if (primaryFailed) {
69
+ throw new AggregateError([primaryFailure, cleanupFailure], "Filesystem read and handle cleanup both failed");
70
+ }
71
+ throw cleanupFailure;
72
+ }
73
+ if (primaryFailed)
74
+ throw primaryFailure;
75
+ return result;
76
+ }
77
+ export function requireBoundedFileReadLimit(byteLimit) {
78
+ if (!numberIsSafeInteger(byteLimit) || byteLimit <= 0) {
79
+ throw new RangeError("Filesystem byteLimit must be a positive safe integer");
80
+ }
81
+ return byteLimit;
82
+ }
83
+ /**
84
+ * Read at most `byteLimit` bytes without first materializing the whole file.
85
+ *
86
+ * A full-length result is intentionally ambiguous: callers that need to
87
+ * distinguish an exact-size file from an oversized file request their accepted
88
+ * maximum plus one byte.
89
+ */
90
+ export async function readBoundedFilePrefix(openHandle, byteLimit) {
91
+ const boundedLimit = requireBoundedFileReadLimit(byteLimit);
92
+ return await readAndCloseHandle(openHandle, (handle) => readBoundedFileHandlePrefix(handle, boundedLimit));
93
+ }
94
+ /**
95
+ * Read the complete file only when it fits within `byteLimit`.
96
+ *
97
+ * Unlike a prefix read, reaching the limit triggers one additional EOF probe.
98
+ * The probe reuses the final byte of the accepted buffer, so the helper never
99
+ * retains more than `byteLimit` bytes from the source.
100
+ */
101
+ export async function readFileWithinLimit(openHandle, byteLimit) {
102
+ const boundedLimit = requireBoundedFileReadLimit(byteLimit);
103
+ return await readAndCloseHandle(openHandle, (handle) => readFileHandleWithinLimit(handle, boundedLimit));
104
+ }
105
+ /** Read a bounded prefix while leaving ownership of the open handle to the caller. */
106
+ export async function readBoundedFileHandlePrefix(reader, byteLimit) {
107
+ const boundedLimit = requireBoundedFileReadLimit(byteLimit);
108
+ const chunks = [];
109
+ let byteLength = 0;
110
+ let reachedEnd = false;
111
+ while (byteLength < boundedLimit) {
112
+ const chunk = allocateBytes(minimum(BOUNDED_FILE_READ_CHUNK_BYTES, boundedLimit - byteLength));
113
+ let chunkLength = 0;
114
+ const chunkByteLength = byteLengthOf(chunk);
115
+ while (chunkLength < chunkByteLength) {
116
+ const remaining = viewBytes(chunk, chunkLength, chunkByteLength - chunkLength);
117
+ const bytesRead = await reader.read(remaining);
118
+ if (bytesRead === null || bytesRead === 0) {
119
+ reachedEnd = true;
120
+ break;
121
+ }
122
+ if (!numberIsSafeInteger(bytesRead) ||
123
+ bytesRead < 0 ||
124
+ bytesRead > byteLengthOf(remaining)) {
125
+ throw new TypeError("Filesystem read returned an invalid byte count");
126
+ }
127
+ chunkLength += bytesRead;
128
+ byteLength += bytesRead;
129
+ }
130
+ if (chunkLength > 0) {
131
+ // Copy a short final chunk so a tiny result does not retain the entire
132
+ // fixed-size read buffer.
133
+ if (chunkLength === chunkByteLength) {
134
+ apply(arrayPush, chunks, [chunk]);
135
+ }
136
+ else {
137
+ const shortChunk = allocateBytes(chunkLength);
138
+ apply(setBytes, shortChunk, [viewBytes(chunk, 0, chunkLength)]);
139
+ apply(arrayPush, chunks, [shortChunk]);
140
+ }
141
+ }
142
+ if (reachedEnd)
143
+ break;
144
+ }
145
+ if (chunks.length === 0)
146
+ return allocateBytes(0);
147
+ if (chunks.length === 1)
148
+ return chunks[0];
149
+ const bytes = allocateBytes(byteLength);
150
+ let offset = 0;
151
+ for (let index = 0; index < chunks.length; index++) {
152
+ const chunk = chunks[index];
153
+ apply(setBytes, bytes, [chunk, offset]);
154
+ offset += byteLengthOf(chunk);
155
+ }
156
+ return bytes;
157
+ }
158
+ /** Read a complete bounded file while leaving ownership of the handle to the caller. */
159
+ export async function readFileHandleWithinLimit(reader, byteLimit) {
160
+ const boundedLimit = requireBoundedFileReadLimit(byteLimit);
161
+ const bytes = await readBoundedFileHandlePrefix(reader, boundedLimit);
162
+ if (byteLengthOf(bytes) < boundedLimit)
163
+ return bytes;
164
+ // Reuse the final accepted byte as the EOF probe instead of allocating or
165
+ // retaining a maximum-plus-one buffer. Restore it when the file ends exactly
166
+ // at the limit; on overflow the result is discarded.
167
+ const finalIndex = boundedLimit - 1;
168
+ const acceptedFinalByte = bytes[finalIndex];
169
+ const probe = viewBytes(bytes, finalIndex, 1);
170
+ const bytesRead = await reader.read(probe);
171
+ if (bytesRead === null || bytesRead === 0) {
172
+ bytes[finalIndex] = acceptedFinalByte;
173
+ return bytes;
174
+ }
175
+ if (!numberIsSafeInteger(bytesRead) || bytesRead < 0 || bytesRead > byteLengthOf(probe)) {
176
+ throw new TypeError("Filesystem read returned an invalid byte count");
177
+ }
178
+ throw new RangeError(`File exceeds byte limit of ${boundedLimit} ${boundedLimit === 1 ? "byte" : "bytes"}`);
179
+ }
@@ -0,0 +1,6 @@
1
+ export declare class FileSnapshotChangedError extends Error {
2
+ readonly name = "FileSnapshotChangedError";
3
+ constructor(message?: string);
4
+ }
5
+ export declare function isFileSnapshotChangedError(value: unknown): value is FileSnapshotChangedError;
6
+ //# sourceMappingURL=file-snapshot-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-snapshot-error.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/adapters/file-snapshot-error.ts"],"names":[],"mappings":"AAEA,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,SAAkB,IAAI,8BAA8B;gBAExC,OAAO,SAA0C;CAI9D;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,wBAAwB,CAEnC"}
@@ -0,0 +1,11 @@
1
+ const changedErrors = new WeakSet();
2
+ export class FileSnapshotChangedError extends Error {
3
+ name = "FileSnapshotChangedError";
4
+ constructor(message = "File snapshot changed during the read") {
5
+ super(message);
6
+ changedErrors.add(this);
7
+ }
8
+ }
9
+ export function isFileSnapshotChangedError(value) {
10
+ return typeof value === "object" && value !== null && changedErrors.has(value);
11
+ }
@@ -0,0 +1,33 @@
1
+ interface SnapshotStat {
2
+ readonly dev: bigint;
3
+ readonly ino: bigint;
4
+ readonly size: bigint;
5
+ readonly mtimeNs: bigint;
6
+ readonly ctimeNs: bigint;
7
+ isFile(): boolean;
8
+ isSymbolicLink(): boolean;
9
+ }
10
+ interface SnapshotHandle {
11
+ stat(): Promise<SnapshotStat>;
12
+ read(buffer: Uint8Array, offset: number, length: number, position: number): Promise<{
13
+ bytesRead: number;
14
+ }>;
15
+ writeFile(content: Uint8Array): Promise<void>;
16
+ close(): Promise<void>;
17
+ }
18
+ export interface NativeSnapshotOperations {
19
+ realpath(path: string): Promise<string>;
20
+ lstat(path: string): Promise<SnapshotStat>;
21
+ open(path: string, flags: number | string): Promise<SnapshotHandle>;
22
+ }
23
+ /** Whether the runtime can enforce a no-follow native snapshot open. */
24
+ export declare function supportsNativeFileSnapshots(platform?: "posix" | "windows"): boolean;
25
+ /**
26
+ * Read one verified regular-file generation without following a terminal link.
27
+ * Identity and generation are checked before and after the bounded positional read.
28
+ */
29
+ export declare function readNodeFileSnapshotWithinLimit(path: string, containmentRoot: string, byteLimit: number, operations?: NativeSnapshotOperations): Promise<Uint8Array>;
30
+ /** Create a new file without replacement and join handle cleanup. */
31
+ export declare function createNodeFileBytesExclusive(path: string, content: Uint8Array, operations?: NativeSnapshotOperations): Promise<void>;
32
+ export {};
33
+ //# sourceMappingURL=native-file-capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-file-capabilities.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/runtime/shared/native-file-capabilities.ts"],"names":[],"mappings":"AAIA,UAAU,YAAY;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,MAAM,IAAI,OAAO,CAAC;IAClB,cAAc,IAAI,OAAO,CAAC;CAC3B;AAED,UAAU,cAAc;IACtB,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9B,IAAI,CACF,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClC,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACrE;AAED,wEAAwE;AACxE,wBAAgB,2BAA2B,CACzC,QAAQ,GAAE,OAAO,GAAG,SAA2D,GAC9E,OAAO,CAET;AAkFD;;;GAGG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,wBAAwB,GACpC,OAAO,CAAC,UAAU,CAAC,CAsHrB;AAED,qEAAqE;AACrE,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,UAAU,EACnB,UAAU,CAAC,EAAE,wBAAwB,GACpC,OAAO,CAAC,IAAI,CAAC,CAYf"}
@@ -0,0 +1,205 @@
1
+ import { isAbsolute, relative, resolve, sep } from "../../../compat/path/index.js";
2
+ import { runtimeUsesWindowsPaths } from "../../../compat/path/portable.js";
3
+ import { FileSnapshotChangedError } from "../../file-snapshot-error.js";
4
+ /** Whether the runtime can enforce a no-follow native snapshot open. */
5
+ export function supportsNativeFileSnapshots(platform = runtimeUsesWindowsPaths() ? "windows" : "posix") {
6
+ return platform === "posix";
7
+ }
8
+ function toSnapshotStat(stats) {
9
+ return {
10
+ dev: stats.dev,
11
+ ino: stats.ino,
12
+ size: stats.size,
13
+ mtimeNs: stats.mtimeNs,
14
+ ctimeNs: stats.ctimeNs,
15
+ isFile: () => stats.isFile(),
16
+ isSymbolicLink: () => stats.isSymbolicLink(),
17
+ };
18
+ }
19
+ async function defaultOperations() {
20
+ const fs = await import("node:fs/promises");
21
+ return {
22
+ realpath: (path) => fs.realpath(path),
23
+ async lstat(path) {
24
+ return toSnapshotStat(await fs.lstat(path, { bigint: true }));
25
+ },
26
+ async open(path, flags) {
27
+ const handle = await fs.open(path, flags);
28
+ return {
29
+ async stat() {
30
+ return toSnapshotStat(await handle.stat({ bigint: true }));
31
+ },
32
+ read: (buffer, offset, length, position) => handle.read(buffer, offset, length, position),
33
+ writeFile: (content) => handle.writeFile(content),
34
+ close: () => handle.close(),
35
+ };
36
+ },
37
+ };
38
+ }
39
+ function requireByteLimit(value) {
40
+ if (!Number.isSafeInteger(value) || value <= 0) {
41
+ throw new RangeError("Snapshot byte limit must be a positive safe integer");
42
+ }
43
+ return value;
44
+ }
45
+ function isContainedPath(path, root) {
46
+ const relation = relative(root, path);
47
+ return relation === "" ||
48
+ (relation !== ".." && !relation.startsWith(`..${sep}`) && !isAbsolute(relation));
49
+ }
50
+ function sameIdentity(left, right) {
51
+ return left.dev === right.dev && left.ino === right.ino;
52
+ }
53
+ function sameGeneration(left, right) {
54
+ return sameIdentity(left, right) && left.size === right.size &&
55
+ left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
56
+ }
57
+ function changed(message, cause) {
58
+ const error = new FileSnapshotChangedError(message);
59
+ if (cause !== undefined)
60
+ Object.defineProperty(error, "cause", { value: cause });
61
+ return error;
62
+ }
63
+ async function closeSnapshotHandle(handle, primaryFailure, failed) {
64
+ try {
65
+ await handle.close();
66
+ }
67
+ catch (cleanupFailure) {
68
+ if (failed) {
69
+ throw new AggregateError([primaryFailure, cleanupFailure], "Filesystem snapshot read and handle cleanup both failed");
70
+ }
71
+ throw cleanupFailure;
72
+ }
73
+ if (failed)
74
+ throw primaryFailure;
75
+ }
76
+ /**
77
+ * Read one verified regular-file generation without following a terminal link.
78
+ * Identity and generation are checked before and after the bounded positional read.
79
+ */
80
+ export async function readNodeFileSnapshotWithinLimit(path, containmentRoot, byteLimit, operations) {
81
+ const admittedLimit = requireByteLimit(byteLimit);
82
+ const lexicalRoot = resolve(containmentRoot);
83
+ const candidate = resolve(path);
84
+ const fsOperations = operations ?? await defaultOperations();
85
+ const { constants } = await import("node:fs");
86
+ if (!Number.isSafeInteger(constants.O_NOFOLLOW) || constants.O_NOFOLLOW === 0) {
87
+ throw new TypeError("This runtime cannot guarantee no-follow snapshot opens");
88
+ }
89
+ const canonicalRoot = await fsOperations.realpath(lexicalRoot);
90
+ if (!isContainedPath(candidate, lexicalRoot) &&
91
+ !isContainedPath(candidate, canonicalRoot)) {
92
+ throw new TypeError("Snapshot path must be contained by the requested root");
93
+ }
94
+ const pathnameBefore = await fsOperations.lstat(candidate);
95
+ if (pathnameBefore.isSymbolicLink()) {
96
+ throw new TypeError("Snapshot path must not be a symbolic link");
97
+ }
98
+ if (!pathnameBefore.isFile()) {
99
+ throw new TypeError("Snapshot path must identify a regular file");
100
+ }
101
+ let handle;
102
+ try {
103
+ handle = await fsOperations.open(candidate, constants.O_RDONLY | constants.O_NOFOLLOW);
104
+ }
105
+ catch (cause) {
106
+ throw changed("File identity became uncertain while opening the snapshot", cause);
107
+ }
108
+ let failed = false;
109
+ let primaryFailure;
110
+ let result;
111
+ try {
112
+ let handleBefore;
113
+ try {
114
+ handleBefore = await handle.stat();
115
+ }
116
+ catch (cause) {
117
+ throw changed("Opened file identity could not be verified", cause);
118
+ }
119
+ if (!handleBefore.isFile() || !sameGeneration(pathnameBefore, handleBefore)) {
120
+ throw changed("File identity changed while opening the snapshot");
121
+ }
122
+ let canonicalTarget;
123
+ let pathnameOpened;
124
+ try {
125
+ [canonicalTarget, pathnameOpened] = await Promise.all([
126
+ fsOperations.realpath(candidate),
127
+ fsOperations.lstat(candidate),
128
+ ]);
129
+ }
130
+ catch (cause) {
131
+ throw changed("File target became uncertain while opening the snapshot", cause);
132
+ }
133
+ if (pathnameOpened.isSymbolicLink() || !pathnameOpened.isFile() ||
134
+ !sameGeneration(handleBefore, pathnameOpened)) {
135
+ throw changed("File identity changed while opening the snapshot");
136
+ }
137
+ if (!isContainedPath(canonicalTarget, canonicalRoot)) {
138
+ throw new TypeError("Snapshot target must be contained by the canonical root");
139
+ }
140
+ if (handleBefore.size < 0n) {
141
+ throw changed("File size became uncertain while opening the snapshot");
142
+ }
143
+ if (handleBefore.size > BigInt(admittedLimit)) {
144
+ throw new RangeError(`File exceeds byte limit of ${admittedLimit} bytes`);
145
+ }
146
+ const size = Number(handleBefore.size);
147
+ let bytes;
148
+ try {
149
+ bytes = new Uint8Array(size);
150
+ }
151
+ catch (cause) {
152
+ throw new Error("Unable to allocate the admitted snapshot buffer", { cause });
153
+ }
154
+ let offset = 0;
155
+ while (offset < size) {
156
+ const { bytesRead } = await handle.read(bytes, offset, size - offset, offset);
157
+ if (!Number.isSafeInteger(bytesRead) || bytesRead <= 0 || bytesRead > size - offset) {
158
+ throw changed("File size changed while reading the snapshot");
159
+ }
160
+ offset += bytesRead;
161
+ }
162
+ let handleAfter;
163
+ let pathnameAfter;
164
+ let canonicalTargetAfter;
165
+ try {
166
+ [handleAfter, pathnameAfter, canonicalTargetAfter] = await Promise.all([
167
+ handle.stat(),
168
+ fsOperations.lstat(candidate),
169
+ fsOperations.realpath(candidate),
170
+ ]);
171
+ }
172
+ catch (cause) {
173
+ throw changed("File identity became uncertain after reading the snapshot", cause);
174
+ }
175
+ if (pathnameAfter.isSymbolicLink() || !pathnameAfter.isFile() ||
176
+ !sameGeneration(handleBefore, handleAfter) ||
177
+ !sameGeneration(handleBefore, pathnameAfter) ||
178
+ canonicalTargetAfter !== canonicalTarget ||
179
+ !isContainedPath(canonicalTargetAfter, canonicalRoot)) {
180
+ throw changed("File snapshot changed during the read");
181
+ }
182
+ result = bytes;
183
+ }
184
+ catch (error) {
185
+ failed = true;
186
+ primaryFailure = error;
187
+ }
188
+ await closeSnapshotHandle(handle, primaryFailure, failed);
189
+ return result;
190
+ }
191
+ /** Create a new file without replacement and join handle cleanup. */
192
+ export async function createNodeFileBytesExclusive(path, content, operations) {
193
+ const fsOperations = operations ?? await defaultOperations();
194
+ const handle = await fsOperations.open(path, "wx");
195
+ let failed = false;
196
+ let primaryFailure;
197
+ try {
198
+ await handle.writeFile(content);
199
+ }
200
+ catch (error) {
201
+ failed = true;
202
+ primaryFailure = error;
203
+ }
204
+ await closeSnapshotHandle(handle, primaryFailure, failed);
205
+ }
@@ -1,10 +1,16 @@
1
1
  import type { FileInfo } from "../adapters/base.js";
2
+ export { isNotFoundError } from "./not-found-error.js";
2
3
  /** Public API contract for file system. */
3
4
  export interface FileSystem {
4
5
  readTextFile(path: string): Promise<string>;
5
6
  readFile(path: string): Promise<Uint8Array>;
7
+ readFileBytesWithinLimit?(path: string, byteLimit: number): Promise<Uint8Array>;
8
+ readFileSnapshotWithinLimit?(path: string, containmentRoot: string, byteLimit: number): Promise<Uint8Array>;
6
9
  writeTextFile(path: string, data: string): Promise<void>;
7
10
  writeFile(path: string, data: Uint8Array): Promise<void>;
11
+ /** Atomically replace a path when same-filesystem rename is supported. */
12
+ createFileBytesExclusive?(path: string, data: Uint8Array): Promise<void>;
13
+ rename?(from: string, to: string): Promise<void>;
8
14
  exists(path: string): Promise<boolean>;
9
15
  stat(path: string): Promise<FileInfo>;
10
16
  lstat?(path: string): Promise<FileInfo>;
@@ -69,8 +75,6 @@ export declare function symlink(target: string, path: string): Promise<void>;
69
75
  * symlink could otherwise escape an intended directory.
70
76
  */
71
77
  export declare function realPath(path: string): Promise<string>;
72
- /** Error shape for is not found. */
73
- export declare function isNotFoundError(error: unknown, seen?: Set<unknown>): boolean;
74
78
  /** Error shape for is already exists. */
75
79
  export declare function isAlreadyExistsError(error: unknown): boolean;
76
80
  //# sourceMappingURL=fs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/fs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAgBpD,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CA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