knitting 0.1.55 → 0.1.56
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/knitting.d.ts +6 -797
- package/knitting.js +6 -9780
- package/map.md +12 -8
- package/package.json +14 -6
- package/process-shared-buffer.d.ts +1 -0
- package/process-shared-buffer.js +1 -0
- package/shared-memory.d.ts +1 -155
- package/shared-memory.js +1 -1342
- package/src/api.d.ts +69 -0
- package/src/api.js +619 -0
- package/src/common/envelope.d.ts +17 -0
- package/src/common/envelope.js +22 -0
- package/src/common/module-url.d.ts +1 -0
- package/src/common/module-url.js +24 -0
- package/src/common/node-compat.d.ts +20 -0
- package/src/common/node-compat.js +24 -0
- package/src/common/path-canonical.d.ts +6 -0
- package/src/common/path-canonical.js +41 -0
- package/src/common/runtime.d.ts +15 -0
- package/src/common/runtime.js +91 -0
- package/src/common/shared-buffer-region.d.ts +11 -0
- package/src/common/shared-buffer-region.js +21 -0
- package/src/common/shared-buffer-text.d.ts +16 -0
- package/src/common/shared-buffer-text.js +65 -0
- package/src/common/task-source.d.ts +3 -0
- package/src/common/task-source.js +84 -0
- package/src/common/task-symbol.d.ts +1 -0
- package/src/common/task-symbol.js +1 -0
- package/src/common/with-resolvers.d.ts +9 -0
- package/src/common/with-resolvers.js +23 -0
- package/src/common/worker-runtime.d.ts +42 -0
- package/src/common/worker-runtime.js +61 -0
- package/src/connections/buffer-reference-native.d.ts +56 -0
- package/src/connections/buffer-reference-native.js +217 -0
- package/src/connections/buffer-reference.d.ts +78 -0
- package/src/connections/buffer-reference.js +461 -0
- package/src/connections/bun.d.ts +22 -0
- package/src/connections/bun.js +214 -0
- package/src/connections/deno.d.ts +22 -0
- package/src/connections/deno.js +205 -0
- package/src/connections/file-descriptor.d.ts +39 -0
- package/src/connections/file-descriptor.js +161 -0
- package/src/connections/index.d.ts +4 -0
- package/src/connections/index.js +4 -0
- package/src/connections/node-addons.d.ts +5 -0
- package/src/connections/node-addons.js +44 -0
- package/src/connections/node-buffer-pointer.d.ts +20 -0
- package/src/connections/node-buffer-pointer.js +16 -0
- package/src/connections/node.d.ts +30 -0
- package/src/connections/node.js +62 -0
- package/src/connections/numeric-array.d.ts +5 -0
- package/src/connections/numeric-array.js +17 -0
- package/src/connections/package-assets.d.ts +2 -0
- package/src/connections/package-assets.js +45 -0
- package/src/connections/posix.d.ts +32 -0
- package/src/connections/posix.js +77 -0
- package/src/connections/process-shared-buffer.d.ts +75 -0
- package/src/connections/process-shared-buffer.js +279 -0
- package/src/connections/shared-array-buffer-payload.d.ts +36 -0
- package/src/connections/shared-array-buffer-payload.js +235 -0
- package/src/connections/types.d.ts +50 -0
- package/src/connections/types.js +37 -0
- package/src/connections/windows.d.ts +28 -0
- package/src/connections/windows.js +224 -0
- package/src/debug/env-diff.d.ts +26 -0
- package/src/debug/env-diff.js +49 -0
- package/src/debug/gate.d.ts +18 -0
- package/src/debug/gate.js +69 -0
- package/src/debug/handle.d.ts +23 -0
- package/src/debug/handle.js +48 -0
- package/src/error.d.ts +13 -0
- package/src/error.js +49 -0
- package/src/ipc/tools/ring-queue.d.ts +33 -0
- package/src/ipc/tools/ring-queue.js +159 -0
- package/src/ipc/transport/shared-memory.d.ts +23 -0
- package/src/ipc/transport/shared-memory.js +35 -0
- package/src/memory/byte-carpet.d.ts +73 -0
- package/src/memory/byte-carpet.js +157 -0
- package/src/memory/lock.d.ts +203 -0
- package/src/memory/lock.js +741 -0
- package/src/memory/payload-config.d.ts +31 -0
- package/src/memory/payload-config.js +67 -0
- package/src/memory/payloadCodec.d.ts +46 -0
- package/src/memory/payloadCodec.js +1377 -0
- package/src/memory/regionRegistry.d.ts +17 -0
- package/src/memory/regionRegistry.js +285 -0
- package/src/memory/shared-buffer-io.d.ts +55 -0
- package/src/memory/shared-buffer-io.js +403 -0
- package/src/permission/index.d.ts +2 -0
- package/src/permission/index.js +2 -0
- package/src/permission/protocol.d.ts +166 -0
- package/src/permission/protocol.js +650 -0
- package/src/runtime/balancer.d.ts +19 -0
- package/src/runtime/balancer.js +149 -0
- package/src/runtime/dispatcher.d.ts +40 -0
- package/src/runtime/dispatcher.js +142 -0
- package/src/runtime/inline-executor.d.ts +10 -0
- package/src/runtime/inline-executor.js +282 -0
- package/src/runtime/pool.d.ts +39 -0
- package/src/runtime/pool.js +404 -0
- package/src/runtime/process-worker.d.ts +92 -0
- package/src/runtime/process-worker.js +673 -0
- package/src/runtime/tx-queue.d.ts +26 -0
- package/src/runtime/tx-queue.js +155 -0
- package/src/shared/abortSignal.d.ts +23 -0
- package/src/shared/abortSignal.js +134 -0
- package/src/types.d.ts +357 -0
- package/src/types.js +2 -0
- package/src/utils/http.d.ts +29 -0
- package/src/utils/http.js +100 -0
- package/src/worker/bootstrap.d.ts +5 -0
- package/src/worker/bootstrap.js +78 -0
- package/src/worker/composable-runners.d.ts +12 -0
- package/src/worker/composable-runners.js +97 -0
- package/src/worker/loop.d.ts +2 -0
- package/src/worker/loop.js +382 -0
- package/src/worker/process-worker-bootstrap.d.ts +8 -0
- package/src/worker/process-worker-bootstrap.js +160 -0
- package/src/worker/rx-queue.d.ts +25 -0
- package/src/worker/rx-queue.js +173 -0
- package/src/worker/safety/index.d.ts +4 -0
- package/src/worker/safety/index.js +4 -0
- package/src/worker/safety/performance.d.ts +1 -0
- package/src/worker/safety/performance.js +17 -0
- package/src/worker/safety/process.d.ts +2 -0
- package/src/worker/safety/process.js +79 -0
- package/src/worker/safety/startup.d.ts +16 -0
- package/src/worker/safety/startup.js +30 -0
- package/src/worker/safety/worker-data.d.ts +2 -0
- package/src/worker/safety/worker-data.js +36 -0
- package/src/worker/task-loader.d.ts +27 -0
- package/src/worker/task-loader.js +70 -0
- package/src/worker/timers.d.ts +18 -0
- package/src/worker/timers.js +116 -0
- package/unsafe.d.ts +1 -71
- package/unsafe.js +1 -878
- package/utils.d.ts +1 -31
- package/utils.js +1 -116
package/unsafe.d.ts
CHANGED
|
@@ -1,71 +1 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export declare const BUFFER_REFERENCE_KIND: "knitting.bufferReference";
|
|
3
|
-
/** Named values for the `unsafe.BufferReferenceReturn` pool option. */
|
|
4
|
-
export declare const BufferReferenceReturn: {
|
|
5
|
-
/** Safe default: Deno/Bun copy the returned bytes so they outlive the worker. */
|
|
6
|
-
readonly Copy: "copy";
|
|
7
|
-
/** Zero-copy: borrow the worker's backing store until the reference is released. */
|
|
8
|
-
readonly Borrow: "borrow";
|
|
9
|
-
};
|
|
10
|
-
export type BufferReferenceReturn = (typeof BufferReferenceReturn)[keyof typeof BufferReferenceReturn];
|
|
11
|
-
declare const BUFFER_REFERENCE_NUMERIC_TRANSFER: unique symbol;
|
|
12
|
-
declare const EXTERNAL_PAYLOAD_BRAND: unique symbol;
|
|
13
|
-
export declare const BUFFER_REFERENCE_CODEC_ID: "knitting.bufferReference";
|
|
14
|
-
type BufferReferenceNumericMetadata = readonly [
|
|
15
|
-
pointerLow: number,
|
|
16
|
-
pointerHigh: number,
|
|
17
|
-
tokenLow: number,
|
|
18
|
-
tokenHigh: number,
|
|
19
|
-
byteOffset: number,
|
|
20
|
-
byteLength: number,
|
|
21
|
-
runtime: number,
|
|
22
|
-
originPid: number
|
|
23
|
-
];
|
|
24
|
-
export type BufferReferenceMetadata = {
|
|
25
|
-
readonly kind: typeof BUFFER_REFERENCE_KIND;
|
|
26
|
-
readonly origin: string;
|
|
27
|
-
readonly runtime: BufferReferenceRuntime;
|
|
28
|
-
readonly pointer: string;
|
|
29
|
-
/** Producer-side release handle (process-local). */
|
|
30
|
-
readonly token: string;
|
|
31
|
-
readonly byteOffset: number;
|
|
32
|
-
readonly byteLength: number;
|
|
33
|
-
};
|
|
34
|
-
type BufferReferenceReturnReleaser = (token: bigint) => void;
|
|
35
|
-
type BufferSource$1 = ArrayBufferView | ArrayBuffer;
|
|
36
|
-
declare const PAYLOAD_TRANSPORT_FINALIZER: unique symbol;
|
|
37
|
-
export declare const isBufferReferenceMetadata: (value: unknown) => value is BufferReferenceMetadata;
|
|
38
|
-
/**
|
|
39
|
-
* Zero-copy handle for moving ArrayBuffer bytes to/from **thread** workers.
|
|
40
|
-
*
|
|
41
|
-
* Construction detaches the source. Consumers materialize the moved region in
|
|
42
|
-
* their isolate: owning on Node, alias/copy on Deno/Bun. Return a
|
|
43
|
-
* `BufferReference` for large binary results to avoid copying back through the
|
|
44
|
-
* transport. Use `ProcessSharedBuffer` across process boundaries.
|
|
45
|
-
*/
|
|
46
|
-
export declare class BufferReference {
|
|
47
|
-
#private;
|
|
48
|
-
readonly [EXTERNAL_PAYLOAD_BRAND]: "knitting.bufferReference";
|
|
49
|
-
readonly runtime: BufferReferenceRuntime;
|
|
50
|
-
readonly origin: string;
|
|
51
|
-
readonly pointer: bigint;
|
|
52
|
-
readonly byteOffset: number;
|
|
53
|
-
readonly byteLength: number;
|
|
54
|
-
constructor(source: BufferSource$1);
|
|
55
|
-
constructor(source: BufferSource$1 | undefined, meta: BufferReferenceMetadata);
|
|
56
|
-
static fromMetadata(meta: BufferReferenceMetadata): BufferReference;
|
|
57
|
-
toMetadata(): BufferReferenceMetadata;
|
|
58
|
-
[BUFFER_REFERENCE_NUMERIC_TRANSFER](): BufferReferenceNumericMetadata | undefined;
|
|
59
|
-
get isLocal(): boolean;
|
|
60
|
-
/** Prepare a returned reference before the worker-side producer hold drains. */
|
|
61
|
-
claimOwnership(releaser?: BufferReferenceReturnReleaser): this;
|
|
62
|
-
toArrayBuffer(): ArrayBuffer;
|
|
63
|
-
toUint8Array(): Uint8Array;
|
|
64
|
-
/** The source is moved on construction, so it is never retained here. */
|
|
65
|
-
get source(): undefined;
|
|
66
|
-
release(): void;
|
|
67
|
-
[Symbol.dispose](): void;
|
|
68
|
-
[PAYLOAD_TRANSPORT_FINALIZER](): (() => void) | undefined;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export {};
|
|
1
|
+
export { BUFFER_REFERENCE_CODEC_ID, BUFFER_REFERENCE_KIND, BufferReference, type BufferReferenceMetadata, BufferReferenceReturn, type BufferReferenceRuntime, isBufferReferenceMetadata, } from "./src/connections/buffer-reference.js";
|