@browsercore/contracts 0.2.0 → 0.2.2
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 +28 -20
- package/dist/contracts.d.ts +100 -49
- package/dist/contracts.d.ts.map +1 -1
- package/dist/events.d.ts +43 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +15 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +14 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +5 -2
- package/dist/models.js.map +1 -1
- package/dist/options.d.ts +2 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/platform.d.ts +87 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +26 -0
- package/dist/platform.js.map +1 -0
- package/dist/{net.d.ts → tcp-transport.d.ts} +31 -8
- package/dist/tcp-transport.d.ts.map +1 -0
- package/dist/tcp-transport.js +15 -0
- package/dist/tcp-transport.js.map +1 -0
- package/dist/telemetry.d.ts +53 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +15 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/time.d.ts +71 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +27 -0
- package/dist/time.js.map +1 -0
- package/package.json +1 -1
- package/dist/net.d.ts.map +0 -1
- package/dist/net.js +0 -12
- package/dist/net.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
The canonical interface package for the browsercore stack. Every protocol
|
|
8
8
|
package, runtime adapter, and consumer depends on these contracts — they
|
|
9
|
-
define how components communicate without coupling them to each other.
|
|
9
|
+
define how components communicate without coupling them to each other. This is
|
|
10
|
+
now the single source of truth for **all** cross-package interfaces, including
|
|
11
|
+
the `Platform` service contracts (events, time, telemetry, network, crypto,
|
|
12
|
+
compression).
|
|
10
13
|
|
|
11
14
|
## Why this package exists
|
|
12
15
|
|
|
@@ -20,8 +23,9 @@ any package diverges.
|
|
|
20
23
|
**Alternative implementations welcome.** The contracts define exactly what a
|
|
21
24
|
component must satisfy — nothing more. Want to write a different TLS engine?
|
|
22
25
|
Implement `TlsConnection`. A different transport? Implement `Transport`. A
|
|
23
|
-
different runtime (Bun, Deno, Workers)? Implement `
|
|
24
|
-
contracts are the spec; the packages are the reference
|
|
26
|
+
different runtime (Bun, Deno, Workers)? Implement the `Platform` service
|
|
27
|
+
interfaces. The contracts are the spec; the packages are the reference
|
|
28
|
+
implementations.
|
|
25
29
|
|
|
26
30
|
**Implementation-independent.** No `node:crypto`, `node:net`, `Buffer`, or any
|
|
27
31
|
runtime details leak into these types. They are portable TypeScript interfaces
|
|
@@ -30,29 +34,33 @@ and plain data.
|
|
|
30
34
|
## Architecture
|
|
31
35
|
|
|
32
36
|
```
|
|
33
|
-
@browsercore/contracts (this package — interfaces +
|
|
37
|
+
@browsercore/contracts (this package — interfaces + services + models)
|
|
34
38
|
▲
|
|
35
39
|
│
|
|
36
|
-
|
|
37
|
-
│ │
|
|
38
|
-
▼ ▼
|
|
39
|
-
|
|
40
|
-
│ │
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
▼
|
|
45
|
-
browsersmith (entrypoint)
|
|
40
|
+
┌──────┼─────────────────────────────┐
|
|
41
|
+
│ │ │
|
|
42
|
+
▼ ▼ ▼
|
|
43
|
+
transport tls http1 http2 http3 quic fetch crypto compression
|
|
44
|
+
│ │ │ │ │ │ │ │ │
|
|
45
|
+
└─────────┴──────┴───────┴───────┴───────┴───────┴────────┴─────────┘
|
|
46
|
+
▼
|
|
47
|
+
browsersmith (composition root — builds Platform)
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
Dependency direction is strictly upward — contracts is the root dependency.
|
|
49
|
-
|
|
51
|
+
`browsersmith` is the **only** package allowed `node:*` imports; it builds a
|
|
52
|
+
`Platform` object that threads runtime capabilities (network, crypto,
|
|
53
|
+
compression, events, telemetry, time) down through options.
|
|
50
54
|
|
|
51
55
|
## What's inside
|
|
52
56
|
|
|
53
57
|
| Module | Purpose | Key exports |
|
|
54
58
|
|---|---|---|
|
|
55
|
-
| **Contracts** | Provider + connection interfaces that protocol packages implement | `CryptoProvider`, `CompressionProvider`, `Transport`, `DatagramTransport`, `TlsConnection`, `Http1Connection`, `Http2Connection`, `Http3Connection`, `QuicConnection`, `QuicStream`, `FetchClient`, `CookieJar`, `
|
|
59
|
+
| **Contracts** | Provider + connection interfaces that protocol packages implement | `CryptoProvider`, `CompressionProvider`, `Transport`, `DatagramTransport`, `TlsConnection`, `Http1Connection`, `Http2Connection`, `Http3Connection`, `QuicConnection`, `QuicStream`, `FetchClient`, `CookieJar`, `PacketCallback` |
|
|
60
|
+
| **Platform** | The composition root + per-service bundles | `Platform`, `PlatformOptions`, `Network`, `Crypto`, `Compression` |
|
|
61
|
+
| **Events** | EventTarget-backed emitter abstraction | `EventProvider`, `TypedEventEmitter<T>` |
|
|
62
|
+
| **Time** | Clock + scheduler with composable deadlines | `Clock`, `Duration`, `Scheduler`, `Deadline`, `Time` |
|
|
63
|
+
| **Telemetry** | OTel-aligned observability | `Logger`, `Tracer`, `Span`, `Metrics`, `Telemetry` |
|
|
56
64
|
| **Models** | Shared data structures that cross package boundaries | `BrowserProfile`, `TlsProfile`, `Http1Profile`, `Http2Profile`, `Request`, `Response`, `Headers`, `Cookie`, `TransportState`, `CloseReason`, `ContentEncoding` |
|
|
57
65
|
| **Net** | Platform-agnostic TCP + DNS contracts for runtime portability | `Net`, `DnsResolver`, `Socket`, `ConnectOptions`, `IPAddress` |
|
|
58
66
|
| **Options** | Configuration objects passed to each protocol package | `TlsOptions`, `Http1Options`, `Http2Options`, `Http3Options`, `QuicOptions`, `FetchClientOptions` |
|
|
@@ -90,8 +98,8 @@ class MyCustomTransport implements Transport {
|
|
|
90
98
|
## Design rules
|
|
91
99
|
|
|
92
100
|
1. **If a type crosses a package boundary, it lives here.** Litmus test:
|
|
93
|
-
*"Could
|
|
94
|
-
If only one package uses it → stays in that package.
|
|
101
|
+
*"Could someone build an alternative package against it?"* If yes →
|
|
102
|
+
contracts. If only one package uses it → stays in that package.
|
|
95
103
|
|
|
96
104
|
2. **No runtime behavior.** Only TypeScript types and `const` data tables.
|
|
97
105
|
No classes with logic, no functions with side effects.
|
|
@@ -109,5 +117,5 @@ class MyCustomTransport implements Transport {
|
|
|
109
117
|
## Zero overhead
|
|
110
118
|
|
|
111
119
|
All type exports are erased by the TypeScript compiler. The only runtime
|
|
112
|
-
exports are the IANA wire code tables
|
|
113
|
-
dependencies, no side effects.
|
|
120
|
+
exports are the IANA wire code tables and `Duration` factories — plain
|
|
121
|
+
`const` objects with no dependencies, no side effects.
|
package/dist/contracts.d.ts
CHANGED
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ContentEncoding, Cookie, DatagramCloseReason, EcdhCurve, EcdhKeyPair, FetchOptions, FetchResponse, HashId, ProtocolFrame, Request, Response, TransportState, CloseReason, TlsState, UdpAddress, X25519KeyPair } from "./models.js";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* Implemented by: @browsercore/crypto
|
|
9
|
+
* `CryptoProvider` — the injected cryptographic primitive surface.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
11
|
+
* Implemented by: `@browsercore/crypto`
|
|
12
|
+
*
|
|
13
|
+
* Why here: Every protocol package needs crypto operations. The provider is
|
|
14
|
+
* assembled into `Platform.crypto` by the composition root (`browsersmith`)
|
|
15
|
+
* and threaded down through options — no protocol package imports
|
|
16
|
+
* `node:crypto` or any runtime builtin directly.
|
|
13
17
|
*/
|
|
14
18
|
export interface CryptoProvider {
|
|
15
19
|
randomBytes(length: number): Uint8Array;
|
|
@@ -33,20 +37,51 @@ export interface CryptoProvider {
|
|
|
33
37
|
aesEcbEncrypt(key: Uint8Array, block: Uint8Array): Uint8Array;
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
40
|
+
* `CompressionProvider` — the injected compression surface.
|
|
41
|
+
*
|
|
42
|
+
* Implemented by: `@browsercore/compression`
|
|
43
|
+
*
|
|
44
|
+
* Why here: HTTP/1 and HTTP/2 both need compression. Provided via
|
|
45
|
+
* `Platform.compression` and passed down through options — protocols never
|
|
46
|
+
* bind to `node:zlib` directly. All operations are synchronous and
|
|
47
|
+
* unit-testable. Portable across backends (node:zlib, WebCompressionStream,
|
|
48
|
+
* wasm brotli).
|
|
38
49
|
*
|
|
39
|
-
*
|
|
50
|
+
* The async `encode/decode(ContentEncoding)` shape had zero consumers and is
|
|
51
|
+
* dropped. This sync shape is the single source of truth.
|
|
40
52
|
*/
|
|
41
53
|
export interface CompressionProvider {
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
/** Compress `data` with gzip. */
|
|
55
|
+
gzip(data: Uint8Array): Uint8Array;
|
|
56
|
+
/** Decompress a gzip-encoded `data`. */
|
|
57
|
+
gunzip(data: Uint8Array): Uint8Array;
|
|
58
|
+
/** Compress `data` with zlib-wrapped deflate. */
|
|
59
|
+
deflate(data: Uint8Array): Uint8Array;
|
|
60
|
+
/** Decompress a zlib-wrapped deflate `data`. */
|
|
61
|
+
inflate(data: Uint8Array): Uint8Array;
|
|
62
|
+
/** Decompress a raw (headerless) deflate `data`. */
|
|
63
|
+
inflateRaw(data: Uint8Array): Uint8Array;
|
|
64
|
+
/** Compress `data` with brotli. */
|
|
65
|
+
brotliCompress(data: Uint8Array): Uint8Array;
|
|
66
|
+
/** Decompress a brotli-encoded `data`. */
|
|
67
|
+
brotliDecompress(data: Uint8Array): Uint8Array;
|
|
68
|
+
/** Decompress a body according to a `content-encoding` header value. */
|
|
69
|
+
decompress(data: Uint8Array, encoding: ContentEncoding): Uint8Array;
|
|
44
70
|
}
|
|
45
71
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
72
|
+
* `Transport` — the injected reliable byte stream (TCP).
|
|
73
|
+
*
|
|
74
|
+
* Implemented by: `@browsercore/transport`
|
|
75
|
+
*
|
|
76
|
+
* Why here: TLS, HTTP/1, HTTP/2 all consume `Transport`. It is created by the
|
|
77
|
+
* injected `Platform.network.tcp` adapter and passed down through options —
|
|
78
|
+
* never constructed by the protocols themselves.
|
|
48
79
|
*
|
|
49
|
-
*
|
|
80
|
+
* Event methods (`on`/`once`) are typed narrowly for stream semantics
|
|
81
|
+
* (`data`, `close`, `error`) rather than using the generic `EventProvider`:
|
|
82
|
+
* a Transport is a typed stream, not a generic bus. The *transport package*
|
|
83
|
+
* still receives its events via `Platform.events` internally; these methods
|
|
84
|
+
* are the public stream surface for protocol consumers.
|
|
50
85
|
*/
|
|
51
86
|
export interface Transport {
|
|
52
87
|
readonly id: string;
|
|
@@ -62,10 +97,13 @@ export interface Transport {
|
|
|
62
97
|
once(event: "error", listener: (error: Error) => void): void;
|
|
63
98
|
}
|
|
64
99
|
/**
|
|
65
|
-
*
|
|
66
|
-
* Implemented by: @browsercore/transport
|
|
100
|
+
* `DatagramTransport` — the injected UDP datagram surface.
|
|
67
101
|
*
|
|
68
|
-
*
|
|
102
|
+
* Implemented by: `@browsercore/transport`
|
|
103
|
+
*
|
|
104
|
+
* Why here: QUIC consumes `DatagramTransport`. Like `Transport`, it is
|
|
105
|
+
* obtained from `Platform.network.udp` and passed down through options —
|
|
106
|
+
* protocol packages never bind to a runtime socket directly.
|
|
69
107
|
*/
|
|
70
108
|
export interface DatagramTransport {
|
|
71
109
|
readonly id: string;
|
|
@@ -77,10 +115,13 @@ export interface DatagramTransport {
|
|
|
77
115
|
close(reason?: DatagramCloseReason): Promise<void>;
|
|
78
116
|
}
|
|
79
117
|
/**
|
|
80
|
-
* TLS connection
|
|
81
|
-
*
|
|
118
|
+
* `TlsConnection` — the injected TLS connection surface.
|
|
119
|
+
*
|
|
120
|
+
* Implemented by: `@browsercore/tls`
|
|
82
121
|
*
|
|
83
|
-
* Why here: fetch consumes TlsConnection
|
|
122
|
+
* Why here: fetch consumes `TlsConnection`. The TLS package receives its
|
|
123
|
+
* injected dependencies (transport, crypto, events) through `TlsOptions`,
|
|
124
|
+
* which is populated from the `Platform` composition root.
|
|
84
125
|
*/
|
|
85
126
|
export interface TlsConnection {
|
|
86
127
|
readonly id: string;
|
|
@@ -91,10 +132,12 @@ export interface TlsConnection {
|
|
|
91
132
|
close(): Promise<void>;
|
|
92
133
|
}
|
|
93
134
|
/**
|
|
94
|
-
* HTTP/1 connection
|
|
95
|
-
* Implemented by: @browsercore/http1
|
|
135
|
+
* `Http1Connection` — the injected HTTP/1 connection surface.
|
|
96
136
|
*
|
|
97
|
-
*
|
|
137
|
+
* Implemented by: `@browsercore/http1`
|
|
138
|
+
*
|
|
139
|
+
* Why here: fetch consumes `Http1Connection`. The package receives its
|
|
140
|
+
* injected transport and profile through `Http1Options`.
|
|
98
141
|
*/
|
|
99
142
|
export interface Http1Connection {
|
|
100
143
|
readonly id: string;
|
|
@@ -102,10 +145,12 @@ export interface Http1Connection {
|
|
|
102
145
|
close(): Promise<void>;
|
|
103
146
|
}
|
|
104
147
|
/**
|
|
105
|
-
* HTTP/2 connection
|
|
106
|
-
*
|
|
148
|
+
* `Http2Connection` — the injected HTTP/2 connection surface.
|
|
149
|
+
*
|
|
150
|
+
* Implemented by: `@browsercore/http2`
|
|
107
151
|
*
|
|
108
|
-
* Why here: fetch consumes Http2Connection
|
|
152
|
+
* Why here: fetch consumes `Http2Connection`. The package receives its
|
|
153
|
+
* injected transport and profile through `Http2Options`.
|
|
109
154
|
*/
|
|
110
155
|
export interface Http2Connection {
|
|
111
156
|
readonly id: string;
|
|
@@ -114,10 +159,13 @@ export interface Http2Connection {
|
|
|
114
159
|
goaway(): Promise<void>;
|
|
115
160
|
}
|
|
116
161
|
/**
|
|
117
|
-
* HTTP/3 connection
|
|
118
|
-
* Implemented by: @browsercore/http3
|
|
162
|
+
* `Http3Connection` — the injected HTTP/3 connection surface.
|
|
119
163
|
*
|
|
120
|
-
*
|
|
164
|
+
* Implemented by: `@browsercore/http3`
|
|
165
|
+
*
|
|
166
|
+
* Why here: fetch consumes `Http3Connection`. Built on top of
|
|
167
|
+
* `QuicConnection`; receives its injected QUIC transport through
|
|
168
|
+
* `Http3Options`.
|
|
121
169
|
*/
|
|
122
170
|
export interface Http3Connection {
|
|
123
171
|
readonly id: string;
|
|
@@ -126,10 +174,13 @@ export interface Http3Connection {
|
|
|
126
174
|
goaway(streamId: bigint): Promise<void>;
|
|
127
175
|
}
|
|
128
176
|
/**
|
|
129
|
-
* QUIC connection
|
|
130
|
-
*
|
|
177
|
+
* `QuicConnection` — the injected QUIC connection surface.
|
|
178
|
+
*
|
|
179
|
+
* Implemented by: `@browsercore/quic`
|
|
131
180
|
*
|
|
132
|
-
* Why here: HTTP/3 consumes QuicConnection
|
|
181
|
+
* Why here: HTTP/3 consumes `QuicConnection`. The package receives its
|
|
182
|
+
* injected UDP transport and crypto through `QuicOptions`, populated from
|
|
183
|
+
* `Platform`.
|
|
133
184
|
*/
|
|
134
185
|
export interface QuicConnection {
|
|
135
186
|
readonly id: string;
|
|
@@ -143,9 +194,11 @@ export interface QuicConnection {
|
|
|
143
194
|
hasPendingPathChallenge(data: Uint8Array): boolean;
|
|
144
195
|
}
|
|
145
196
|
/**
|
|
146
|
-
* QUIC stream
|
|
197
|
+
* `QuicStream` — an injected QUIC stream handle.
|
|
147
198
|
*
|
|
148
|
-
* Why here: QuicConnection returns QuicStream
|
|
199
|
+
* Why here: `QuicConnection` returns `QuicStream`; HTTP/3 uses it for
|
|
200
|
+
* request multiplexing. Streams are owned by the QUIC package and carry no
|
|
201
|
+
* direct runtime dependency.
|
|
149
202
|
*/
|
|
150
203
|
export interface QuicStream {
|
|
151
204
|
readonly id: bigint;
|
|
@@ -154,20 +207,26 @@ export interface QuicStream {
|
|
|
154
207
|
close(): Promise<void>;
|
|
155
208
|
}
|
|
156
209
|
/**
|
|
157
|
-
*
|
|
158
|
-
* Implemented by: @browsercore/fetch
|
|
210
|
+
* `FetchClient` — the injected high-level fetch surface.
|
|
159
211
|
*
|
|
160
|
-
*
|
|
212
|
+
* Implemented by: `@browsercore/fetch`
|
|
213
|
+
*
|
|
214
|
+
* Why here: browsersmith consumes `FetchClient`. Assembled from the
|
|
215
|
+
* protocol connections and injected services (`CookieJar`, transport, crypto)
|
|
216
|
+
* via `FetchClientOptions`, which `browsersmith` populates from `Platform`.
|
|
161
217
|
*/
|
|
162
218
|
export interface FetchClient {
|
|
163
219
|
fetch(url: string, options?: FetchOptions): Promise<FetchResponse>;
|
|
164
220
|
close(): Promise<void>;
|
|
165
221
|
}
|
|
166
222
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
223
|
+
* `CookieJar` — the injected cookie storage surface.
|
|
224
|
+
*
|
|
225
|
+
* Implemented by: `@browsercore/cookies`
|
|
169
226
|
*
|
|
170
|
-
* Why here: fetch and browsersmith both use CookieJar
|
|
227
|
+
* Why here: fetch and browsersmith both use `CookieJar`. Provided via
|
|
228
|
+
* `FetchClientOptions.cookieJar`, populated from `Platform` or a custom
|
|
229
|
+
* implementation — never hardcoded to a runtime store.
|
|
171
230
|
*/
|
|
172
231
|
export interface CookieJar {
|
|
173
232
|
getCookies(url: string): readonly Cookie[];
|
|
@@ -177,19 +236,11 @@ export interface CookieJar {
|
|
|
177
236
|
deserialize(data: string): void;
|
|
178
237
|
}
|
|
179
238
|
/**
|
|
180
|
-
*
|
|
181
|
-
* Injected for deterministic tests.
|
|
182
|
-
*
|
|
183
|
-
* Why here: Every protocol package needs time.
|
|
184
|
-
*/
|
|
185
|
-
export interface Clock {
|
|
186
|
-
now(): number;
|
|
187
|
-
setTimeout(callback: () => void, delayMs: number): () => void;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Packet inspection callback.
|
|
239
|
+
* `PacketCallback` — the injected packet-inspection surface.
|
|
191
240
|
*
|
|
192
|
-
* Why here: Protocol packages emit frames
|
|
241
|
+
* Why here: Protocol packages emit frames for inspection/debugging. The
|
|
242
|
+
* callback is passed through options (never a global), so consumers like
|
|
243
|
+
* browsersmith wire it up without coupling protocols to a tracing backend.
|
|
193
244
|
*/
|
|
194
245
|
export type PacketCallback = (frame: ProtocolFrame) => void;
|
|
195
246
|
/**
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,MAAM,EACN,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EAChB,MAAM,aAAa,CAAC;AAMrB
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,MAAM,EACN,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EAChB,MAAM,aAAa,CAAC;AAMrB;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC3B,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IACxC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IACpG,IAAI,CAAC,IAAI,EAAE,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,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;CACtC"}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic event contracts — the injected event surface.
|
|
3
|
+
*
|
|
4
|
+
* BrowserCore never inherits from or depends on `node:events.EventEmitter`.
|
|
5
|
+
* Instead, an `EventProvider` is implemented by a thin runtime adapter
|
|
6
|
+
* (e.g. `browsersmith/src/events/node/`) and **injected** down through the
|
|
7
|
+
* `Platform.events` field. The protocol stack calls `on`/`emit` against this
|
|
8
|
+
* interface — never against a global or a Node builtin.
|
|
9
|
+
*
|
|
10
|
+
* Design rule: the interface is defined by what protocol packages *consume*,
|
|
11
|
+
* not by what any one runtime provides. This keeps every package testable
|
|
12
|
+
* with a mock emitter and portable across Node, Bun, Deno, and Workers.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* `EventProvider` — the injected event surface for all protocol packages.
|
|
16
|
+
*
|
|
17
|
+
* This is the contract, not an inheritance hierarchy. Any runtime emitter
|
|
18
|
+
* that satisfies these methods can be injected via `Platform.events`.
|
|
19
|
+
* Packages never `extends EventEmitter`; they depend on this structural type.
|
|
20
|
+
*/
|
|
21
|
+
export interface EventProvider {
|
|
22
|
+
on(event: string, listener: (...args: unknown[]) => void): void;
|
|
23
|
+
once(event: string, listener: (...args: unknown[]) => void): void;
|
|
24
|
+
off(event: string, listener: (...args: unknown[]) => void): void;
|
|
25
|
+
removeListener(event: string, listener: (...args: unknown[]) => void): void;
|
|
26
|
+
emit(event: string, ...args: unknown[]): boolean;
|
|
27
|
+
listenerCount(event: string): number;
|
|
28
|
+
removeAllListeners(event?: string): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `TypedEventEmitter<T>` — compile-time typed event surface.
|
|
32
|
+
*
|
|
33
|
+
* Consumers define a map of event names to listener signatures and get
|
|
34
|
+
* type-safe `emit`/`on` calls. This is the typed counterpart to the
|
|
35
|
+
* untyped `EventProvider` — same injection pattern, stronger guarantees.
|
|
36
|
+
*/
|
|
37
|
+
export interface TypedEventEmitter<T extends Record<string, (...args: unknown[]) => void>> {
|
|
38
|
+
on<K extends keyof T>(event: K, listener: T[K]): void;
|
|
39
|
+
once<K extends keyof T>(event: K, listener: T[K]): void;
|
|
40
|
+
off<K extends keyof T>(event: K, listener: T[K]): void;
|
|
41
|
+
emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): boolean;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAChE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAClE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IACjE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAC5E,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACjD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACrF,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACtD,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACvD,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CACzE"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic event contracts — the injected event surface.
|
|
3
|
+
*
|
|
4
|
+
* BrowserCore never inherits from or depends on `node:events.EventEmitter`.
|
|
5
|
+
* Instead, an `EventProvider` is implemented by a thin runtime adapter
|
|
6
|
+
* (e.g. `browsersmith/src/events/node/`) and **injected** down through the
|
|
7
|
+
* `Platform.events` field. The protocol stack calls `on`/`emit` against this
|
|
8
|
+
* interface — never against a global or a Node builtin.
|
|
9
|
+
*
|
|
10
|
+
* Design rule: the interface is defined by what protocol packages *consume*,
|
|
11
|
+
* not by what any one runtime provides. This keeps every package testable
|
|
12
|
+
* with a mock emitter and portable across Node, Bun, Deno, and Workers.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* @browsercore/contracts — the public SDK surface for the browsercore stack.
|
|
3
3
|
*
|
|
4
4
|
* This package contains every type that defines how BrowserCore components
|
|
5
|
-
* communicate with each other. It is implementation-independent: no node:crypto
|
|
6
|
-
* node:net
|
|
5
|
+
* communicate with each other. It is implementation-independent: no `node:crypto`,
|
|
6
|
+
* `node:net`, `Buffer`, curl, OpenSSL, ngtcp2, or any runtime builtin.
|
|
7
7
|
*
|
|
8
8
|
* Litmus test: "Could another package reasonably import this type?"
|
|
9
9
|
* If yes → belongs here. If only one protocol touches it → stays in that package.
|
|
10
10
|
*
|
|
11
|
-
* Architecture
|
|
11
|
+
* Architecture — every interface here is injected through `Platform`:
|
|
12
12
|
*
|
|
13
|
-
* @browsercore/contracts (this package)
|
|
13
|
+
* @browsercore/contracts (this package — defines the contracts)
|
|
14
14
|
* ▲
|
|
15
|
-
* │
|
|
15
|
+
* │ (depend on, never import from)
|
|
16
16
|
* ┌──────┼─────────────┐
|
|
17
17
|
* │ │ │
|
|
18
18
|
* ▼ ▼ ▼
|
|
@@ -20,11 +20,17 @@
|
|
|
20
20
|
* │ │ │
|
|
21
21
|
* └───────┴─────────────┘
|
|
22
22
|
* ▼
|
|
23
|
-
*
|
|
23
|
+
* browsersmith (composition root — builds & threads Platform)
|
|
24
24
|
*/
|
|
25
|
-
export type { CryptoProvider, CompressionProvider, Transport, DatagramTransport, TlsConnection, Http1Connection, Http2Connection, Http3Connection, QuicConnection, QuicStream, FetchClient, CookieJar,
|
|
25
|
+
export type { CryptoProvider, CompressionProvider, Transport, DatagramTransport, TlsConnection, Http1Connection, Http2Connection, Http3Connection, QuicConnection, QuicStream, FetchClient, CookieJar, PacketCallback, PacketInspectionOptions, } from "./contracts.js";
|
|
26
26
|
export type { ProfileId, BrowserProfile, TlsProfile, Http1Profile, Http2Profile, Request, Response, FetchOptions, FetchResponse, Headers, Cookie, HashId, EcdhCurve, X25519KeyPair, EcdhKeyPair, UdpAddress, TransportState, CloseReason, DatagramCloseReason, TlsState, ContentEncoding, } from "./models.js";
|
|
27
27
|
export { CIPHER_GREASE_PLACEHOLDER, CIPHER_SUITE_CODES, NAMED_GROUP_CODES, SIGNATURE_SCHEME_CODES, VERSION_CODES, } from "./models.js";
|
|
28
|
-
export type { ConnectOptions, Socket, Net, DnsResolver, IPAddress, } from "./
|
|
28
|
+
export type { ConnectOptions, Socket, Net, DnsResolver, IPAddress, Network, } from "./tcp-transport.js";
|
|
29
|
+
export type { EventProvider, TypedEventEmitter, } from "./events.js";
|
|
30
|
+
export type { Logger, Span, Tracer, Metrics, Telemetry, } from "./telemetry.js";
|
|
31
|
+
export type { Clock, Deadline, Scheduler, Time, } from "./time.js";
|
|
32
|
+
/** Duration static factories — `Duration.seconds(5)`, `Duration.milliseconds(250)`. */
|
|
33
|
+
export { Duration } from "./time.js";
|
|
34
|
+
export type { Compression, Crypto, Platform, PlatformOptions, } from "./platform.js";
|
|
29
35
|
export type { TlsOptions, Http1Options, Http2Options, Http3Options, QuicOptions, FetchClientOptions, } from "./options.js";
|
|
30
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,YAAY,EAER,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EAEjB,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,UAAU,EAEV,WAAW,EACX,SAAS,EAET,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceR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kB,GACrB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* @browsercore/contracts — the public SDK surface for the browsercore stack.
|
|
3
3
|
*
|
|
4
4
|
* This package contains every type that defines how BrowserCore components
|
|
5
|
-
* communicate with each other. It is implementation-independent: no node:crypto
|
|
6
|
-
* node:net
|
|
5
|
+
* communicate with each other. It is implementation-independent: no `node:crypto`,
|
|
6
|
+
* `node:net`, `Buffer`, curl, OpenSSL, ngtcp2, or any runtime builtin.
|
|
7
7
|
*
|
|
8
8
|
* Litmus test: "Could another package reasonably import this type?"
|
|
9
9
|
* If yes → belongs here. If only one protocol touches it → stays in that package.
|
|
10
10
|
*
|
|
11
|
-
* Architecture
|
|
11
|
+
* Architecture — every interface here is injected through `Platform`:
|
|
12
12
|
*
|
|
13
|
-
* @browsercore/contracts (this package)
|
|
13
|
+
* @browsercore/contracts (this package — defines the contracts)
|
|
14
14
|
* ▲
|
|
15
|
-
* │
|
|
15
|
+
* │ (depend on, never import from)
|
|
16
16
|
* ┌──────┼─────────────┐
|
|
17
17
|
* │ │ │
|
|
18
18
|
* ▼ ▼ ▼
|
|
@@ -20,8 +20,10 @@
|
|
|
20
20
|
* │ │ │
|
|
21
21
|
* └───────┴─────────────┘
|
|
22
22
|
* ▼
|
|
23
|
-
*
|
|
23
|
+
* browsersmith (composition root — builds & threads Platform)
|
|
24
24
|
*/
|
|
25
25
|
// IANA TLS parameter registries — canonical wire code tables.
|
|
26
26
|
export { CIPHER_GREASE_PLACEHOLDER, CIPHER_SUITE_CODES, NAMED_GROUP_CODES, SIGNATURE_SCHEME_CODES, VERSION_CODES, } from "./models.js";
|
|
27
|
+
/** Duration static factories — `Duration.seconds(5)`, `Duration.milliseconds(250)`. */
|
|
28
|
+
export { Duration } from "./time.js";
|
|
27
29
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA+DH,8DAA8D;AAC9D,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,GAChB,MAAM,aAAa,CAAC;AA+CrB,uFAAuF;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,qCAAqC;AACrC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,UAAU,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAMD,kCAAkC;AAClC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAM/B;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,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,CAK1D,CAAC"}
|
package/dist/models.js
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
// IANA TLS Parameter Registries — canonical wire code tables
|
|
9
9
|
// ===========================================================================
|
|
10
10
|
//
|
|
11
|
-
// Single source of truth for TLS protocol wire codes. Both
|
|
12
|
-
// and
|
|
11
|
+
// Single source of truth for TLS protocol wire codes. Both `@browsercore/tls`
|
|
12
|
+
// and `@browsercore/profiles` import from here. These tables are part of the
|
|
13
|
+
// contracts layer — they are consumed by packages that are themselves
|
|
14
|
+
// injected through `Platform`, keeping the entire stack free of hardcoded
|
|
15
|
+
// wire constants.
|
|
13
16
|
/** The name Chrome/Edge use in their cipher list to mark a GREASE slot (RFC 8701). */
|
|
14
17
|
export const CIPHER_GREASE_PLACEHOLDER = "TLS_GREASE_RESERVED_0";
|
|
15
18
|
/**
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgPH,8EAA8E;AAC9E,6DAA6D;AAC7D,8EAA8E;AAC9E,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgPH,8EAA8E;AAC9E,6DAA6D;AAC7D,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,sEAAsE;AACtE,0EAA0E;AAC1E,kBAAkB;AAElB,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAqC;IAChE,CAAC,yBAAyB,CAAC,EAAE,MAAM;IACnC,sBAAsB,EAAE,MAAM;IAC9B,sBAAsB,EAAE,MAAM;IAC9B,4BAA4B,EAAE,MAAM;IACpC,sBAAsB,EAAE,MAAM;IAC9B,uCAAuC,EAAE,MAA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AE,MAAM;IACtB,OAAO,EAAE,MAAM;CAClB,CAAC;AAEF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC3D,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;CACpB,CAAC"}
|
package/dist/options.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* these interfaces. Options are implementation-independent configuration
|
|
6
6
|
* that gets passed down from consumers like browsersmith.
|
|
7
7
|
*/
|
|
8
|
-
import type { Transport, DatagramTransport, QuicConnection,
|
|
8
|
+
import type { Transport, DatagramTransport, QuicConnection, PacketCallback, CookieJar } from "./contracts.js";
|
|
9
|
+
import type { Clock } from "./time.js";
|
|
9
10
|
import type { BrowserProfile, UdpAddress } from "./models.js";
|
|
10
11
|
export interface TlsOptions {
|
|
11
12
|
readonly transport: Transport;
|
package/dist/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,SAAS,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAM9D,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAA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AAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAClC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform — the root composition interface.
|
|
3
|
+
*
|
|
4
|
+
* This is the single object that browsersmith assembles and passes down
|
|
5
|
+
* to every protocol package. Each field is a service bundle that groups
|
|
6
|
+
* related platform capabilities (network, crypto, compression, events,
|
|
7
|
+
* telemetry, time).
|
|
8
|
+
*
|
|
9
|
+
* Architecture:
|
|
10
|
+
*
|
|
11
|
+
* browsersmith (composition root)
|
|
12
|
+
* │
|
|
13
|
+
* ▼
|
|
14
|
+
* Platform
|
|
15
|
+
* ├── network (TCP, DNS, UDP)
|
|
16
|
+
* ├── crypto (CryptoProvider)
|
|
17
|
+
* ├── compression (gzip, deflate, brotli, etc.)
|
|
18
|
+
* ├── events (EventProvider)
|
|
19
|
+
* ├── telemetry (logger, tracer, metrics)
|
|
20
|
+
* └── time (Clock + Scheduler)
|
|
21
|
+
*
|
|
22
|
+
* All fields are interfaces — this file has zero runtime behavior
|
|
23
|
+
* and zero node:* imports.
|
|
24
|
+
*/
|
|
25
|
+
import type { Network, Net, DnsResolver } from "./tcp-transport.js";
|
|
26
|
+
import type { CryptoProvider, CompressionProvider, DatagramTransport } from "./contracts.js";
|
|
27
|
+
import type { EventProvider } from "./events.js";
|
|
28
|
+
import type { Telemetry } from "./telemetry.js";
|
|
29
|
+
import type { Time } from "./time.js";
|
|
30
|
+
/**
|
|
31
|
+
* `Compression` — the injected synchronous compression bundle (part of `Platform`).
|
|
32
|
+
*
|
|
33
|
+
* Alias for {@link CompressionProvider}: the single source of truth for the
|
|
34
|
+
* compression contract. The async `encode/decode(ContentEncoding)` shape had
|
|
35
|
+
* zero consumers and is dropped.
|
|
36
|
+
*
|
|
37
|
+
* Injected as `Platform.compression`; protocol packages receive it through
|
|
38
|
+
* options, never by importing `node:zlib` directly.
|
|
39
|
+
*/
|
|
40
|
+
export type Compression = CompressionProvider;
|
|
41
|
+
/**
|
|
42
|
+
* `Crypto` — the injected crypto bundle (part of `Platform`).
|
|
43
|
+
*
|
|
44
|
+
* Wraps `CryptoProvider` for injection. `browsersmith` populates this from
|
|
45
|
+
* `@browsercore/crypto`; protocol packages reach it through options, never
|
|
46
|
+
* by importing `node:crypto` directly.
|
|
47
|
+
*/
|
|
48
|
+
export interface Crypto {
|
|
49
|
+
readonly provider: CryptoProvider;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `Platform` — the single composition root for all runtime services.
|
|
53
|
+
*
|
|
54
|
+
* Assembled **once** by `browsersmith` (the only package with `node:*`
|
|
55
|
+
* imports) and threaded down through options to every protocol package.
|
|
56
|
+
* No package hardwires runtime imports; all capabilities arrive via this
|
|
57
|
+
* object. This is the seam that makes BrowserCore portable and testable.
|
|
58
|
+
*/
|
|
59
|
+
export interface Platform {
|
|
60
|
+
readonly network: Network;
|
|
61
|
+
readonly crypto: Crypto;
|
|
62
|
+
readonly compression: Compression;
|
|
63
|
+
readonly events: EventProvider;
|
|
64
|
+
readonly telemetry: Telemetry;
|
|
65
|
+
readonly time: Time;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Options for overriding individual platform adapters.
|
|
69
|
+
*
|
|
70
|
+
* Every field is optional — omit a field to use the default implementation.
|
|
71
|
+
* Use this in tests to inject mocks, or in production to swap a backend.
|
|
72
|
+
*/
|
|
73
|
+
export interface PlatformOptions {
|
|
74
|
+
readonly network?: {
|
|
75
|
+
readonly tcp?: Net;
|
|
76
|
+
readonly dns?: DnsResolver;
|
|
77
|
+
readonly udp?: DatagramTransport;
|
|
78
|
+
};
|
|
79
|
+
readonly crypto?: {
|
|
80
|
+
readonly provider?: CryptoProvider;
|
|
81
|
+
};
|
|
82
|
+
readonly compression?: Compression;
|
|
83
|
+
readonly events?: EventProvider;
|
|
84
|
+
readonly telemetry?: Telemetry;
|
|
85
|
+
readonly time?: Time;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAMtC;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAM9C;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IACnB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACrC;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACvB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE;QACf,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;QACnB,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC;QAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,iBAAiB,CAAC;KACpC,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE;QACd,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;KACtC,CAAC;IACF,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACxB"}
|
package/dist/platform.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform — the root composition interface.
|
|
3
|
+
*
|
|
4
|
+
* This is the single object that browsersmith assembles and passes down
|
|
5
|
+
* to every protocol package. Each field is a service bundle that groups
|
|
6
|
+
* related platform capabilities (network, crypto, compression, events,
|
|
7
|
+
* telemetry, time).
|
|
8
|
+
*
|
|
9
|
+
* Architecture:
|
|
10
|
+
*
|
|
11
|
+
* browsersmith (composition root)
|
|
12
|
+
* │
|
|
13
|
+
* ▼
|
|
14
|
+
* Platform
|
|
15
|
+
* ├── network (TCP, DNS, UDP)
|
|
16
|
+
* ├── crypto (CryptoProvider)
|
|
17
|
+
* ├── compression (gzip, deflate, brotli, etc.)
|
|
18
|
+
* ├── events (EventProvider)
|
|
19
|
+
* ├── telemetry (logger, tracer, metrics)
|
|
20
|
+
* └── time (Clock + Scheduler)
|
|
21
|
+
*
|
|
22
|
+
* All fields are interfaces — this file has zero runtime behavior
|
|
23
|
+
* and zero node:* imports.
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Platform-agnostic TCP and DNS contracts.
|
|
2
|
+
* Platform-agnostic TCP and DNS contracts — the injected network surface.
|
|
3
3
|
*
|
|
4
4
|
* These interfaces describe exactly what BrowserCore needs from a runtime —
|
|
5
|
-
* nothing more. They are implemented by thin adapters (e.g.
|
|
6
|
-
* and injected
|
|
5
|
+
* nothing more. They are implemented by thin adapters (e.g.
|
|
6
|
+
* `browsersmith/src/net/node/`) and **injected** through `Platform.network`,
|
|
7
|
+
* never imported directly by protocol packages. This keeps the stack
|
|
7
8
|
* runtime-agnostic (Node, Bun, Deno, Cloudflare Workers, mocks).
|
|
8
9
|
*
|
|
9
|
-
* Design rule:
|
|
10
|
+
* Design rule: the interface is defined by what transport *consumes*, not by
|
|
11
|
+
* what any one runtime provides. Packages depend on this contract; runtimes
|
|
12
|
+
* adapt to it.
|
|
10
13
|
*/
|
|
14
|
+
import type { DatagramTransport } from "./contracts.js";
|
|
11
15
|
/** Options for establishing a TCP connection. */
|
|
12
16
|
export interface ConnectOptions {
|
|
13
17
|
/** Target host (IP literal or resolved address). */
|
|
@@ -22,10 +26,16 @@ export interface ConnectOptions {
|
|
|
22
26
|
readonly family?: 4 | 6;
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* `Socket` — the injected TCP socket surface.
|
|
26
30
|
*
|
|
27
|
-
* This is
|
|
28
|
-
*
|
|
31
|
+
* This is the contract that runtime adapters (Node, Bun, Deno, Workers)
|
|
32
|
+
* must satisfy — defined by what `@browsercore/transport` *consumes*, not by
|
|
33
|
+
* any one runtime's socket API. A socket is obtained via `Net.connect()`
|
|
34
|
+
* (itself injected through `Platform.network.tcp`) and passed into transport,
|
|
35
|
+
* never constructed by transport directly.
|
|
36
|
+
*
|
|
37
|
+
* Any runtime socket that satisfies these methods can be injected — no
|
|
38
|
+
* inheritance from a built-in class required.
|
|
29
39
|
*/
|
|
30
40
|
export interface Socket {
|
|
31
41
|
/**
|
|
@@ -69,4 +79,17 @@ export interface DnsResolver {
|
|
|
69
79
|
*/
|
|
70
80
|
lookup(hostname: string, family: 4 | 6): Promise<readonly IPAddress[]>;
|
|
71
81
|
}
|
|
72
|
-
|
|
82
|
+
/**
|
|
83
|
+
* `Network` — the injected network bundle (part of `Platform`).
|
|
84
|
+
*
|
|
85
|
+
* Aggregates `Net`, `DnsResolver`, and `DatagramTransport` into a single
|
|
86
|
+
* object that `browsersmith` assembles and passes down through
|
|
87
|
+
* `Platform.network`. Protocol packages never import `node:net` /
|
|
88
|
+
* `node:dgram` directly.
|
|
89
|
+
*/
|
|
90
|
+
export interface Network {
|
|
91
|
+
readonly tcp: Net;
|
|
92
|
+
readonly dns: DnsResolver;
|
|
93
|
+
readonly udp: DatagramTransport;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=tcp-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcp-transport.d.ts","sourceRoot":"","sources":["../src/tcp-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mBAAmB;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,yBAAyB;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,MAAM;IACnB;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,UAA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CAAkC;AAClC,MAAM,WAAW,WAAW;IACxB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC;CAC1E;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACpB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;CACnC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic TCP and DNS contracts — the injected network surface.
|
|
3
|
+
*
|
|
4
|
+
* These interfaces describe exactly what BrowserCore needs from a runtime —
|
|
5
|
+
* nothing more. They are implemented by thin adapters (e.g.
|
|
6
|
+
* `browsersmith/src/net/node/`) and **injected** through `Platform.network`,
|
|
7
|
+
* never imported directly by protocol packages. This keeps the stack
|
|
8
|
+
* runtime-agnostic (Node, Bun, Deno, Cloudflare Workers, mocks).
|
|
9
|
+
*
|
|
10
|
+
* Design rule: the interface is defined by what transport *consumes*, not by
|
|
11
|
+
* what any one runtime provides. Packages depend on this contract; runtimes
|
|
12
|
+
* adapt to it.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=tcp-transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcp-transport.js","sourceRoot":"","sources":["../src/tcp-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic telemetry contracts — the injected observability surface.
|
|
3
|
+
*
|
|
4
|
+
* These interfaces describe the logging, tracing, and metrics surface that
|
|
5
|
+
* BrowserCore needs. They are implemented by thin adapters (e.g.
|
|
6
|
+
* `browsersmith/src/telemetry/node/`) and **injected** as `Platform.telemetry`.
|
|
7
|
+
* Protocol packages call `logger.info`/`tracer.startSpan` against these
|
|
8
|
+
* interfaces — never against a global logger or a specific SDK.
|
|
9
|
+
*
|
|
10
|
+
* Design rule: the interface is defined by what packages *consume*, not by
|
|
11
|
+
* what any one telemetry backend provides. This keeps the stack portable
|
|
12
|
+
* across runtimes and testable with a no-op telemetry adapter.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Structured logger — the minimal surface protocol packages need.
|
|
16
|
+
*/
|
|
17
|
+
export interface Logger {
|
|
18
|
+
debug(message: string, attrs?: Readonly<Record<string, unknown>>): void;
|
|
19
|
+
info(message: string, attrs?: Readonly<Record<string, unknown>>): void;
|
|
20
|
+
warn(message: string, attrs?: Readonly<Record<string, unknown>>): void;
|
|
21
|
+
error(message: string, attrs?: Readonly<Record<string, unknown>>): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A single trace span.
|
|
25
|
+
*/
|
|
26
|
+
export interface Span {
|
|
27
|
+
setAttribute(key: string, value: unknown): Span;
|
|
28
|
+
end(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Tracer — creates spans.
|
|
32
|
+
*/
|
|
33
|
+
export interface Tracer {
|
|
34
|
+
startSpan(name: string, attrs?: Readonly<Record<string, unknown>>): Span;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Metrics counter/gauge recorder.
|
|
38
|
+
*/
|
|
39
|
+
export interface Metrics {
|
|
40
|
+
add(name: string, value: number, attrs?: Readonly<Record<string, unknown>>): void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* `Telemetry` — the injected observability bundle (part of `Platform`).
|
|
44
|
+
*
|
|
45
|
+
* Aggregates `Logger`, `Tracer`, and `Metrics` into a single object that
|
|
46
|
+
* `browsersmith` assembles and passes down through `Platform.telemetry`.
|
|
47
|
+
*/
|
|
48
|
+
export interface Telemetry {
|
|
49
|
+
readonly logger: Logger;
|
|
50
|
+
readonly tracer: Tracer;
|
|
51
|
+
readonly metrics: Metrics;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IACxE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IACvE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IACvE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CAC3E;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACjB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAChD,GAAG,IAAI,IAAI,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CAC5E;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACpB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CACrF;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic telemetry contracts — the injected observability surface.
|
|
3
|
+
*
|
|
4
|
+
* These interfaces describe the logging, tracing, and metrics surface that
|
|
5
|
+
* BrowserCore needs. They are implemented by thin adapters (e.g.
|
|
6
|
+
* `browsersmith/src/telemetry/node/`) and **injected** as `Platform.telemetry`.
|
|
7
|
+
* Protocol packages call `logger.info`/`tracer.startSpan` against these
|
|
8
|
+
* interfaces — never against a global logger or a specific SDK.
|
|
9
|
+
*
|
|
10
|
+
* Design rule: the interface is defined by what packages *consume*, not by
|
|
11
|
+
* what any one telemetry backend provides. This keeps the stack portable
|
|
12
|
+
* across runtimes and testable with a no-op telemetry adapter.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
package/dist/time.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic time contracts — the injected time surface.
|
|
3
|
+
*
|
|
4
|
+
* These interfaces describe what BrowserCore needs from a runtime's time and
|
|
5
|
+
* scheduling facilities. They are implemented by thin adapters (e.g.
|
|
6
|
+
* `browsersmith/src/time/node/`) and **injected** as `Platform.time`. Protocol
|
|
7
|
+
* packages call `clock.now()` / `scheduler.delay()` against these interfaces —
|
|
8
|
+
* never against `setTimeout` or `performance.now` directly — so the stack
|
|
9
|
+
* stays runtime-agnostic and deterministically testable.
|
|
10
|
+
*
|
|
11
|
+
* Design rule: the interface is defined by what packages *consume*, not by
|
|
12
|
+
* what any one runtime provides.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Time source — wall clock and monotonic counter.
|
|
16
|
+
*
|
|
17
|
+
* `monotonic()` returns high-resolution nanoseconds and MUST NOT
|
|
18
|
+
* go backwards (unlike wall-clock `now()`).
|
|
19
|
+
*/
|
|
20
|
+
export interface Clock {
|
|
21
|
+
/** Wall-clock time, epoch milliseconds. */
|
|
22
|
+
now(): number;
|
|
23
|
+
/** High-resolution monotonic time, nanoseconds. */
|
|
24
|
+
monotonic(): bigint;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A duration interval.
|
|
28
|
+
*
|
|
29
|
+
* Returned by the `Duration` factory. Both accessors reflect the same
|
|
30
|
+
* interval in different units.
|
|
31
|
+
*/
|
|
32
|
+
export interface Duration {
|
|
33
|
+
readonly milliseconds: number;
|
|
34
|
+
seconds(): number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A deadline bound to an AbortSignal.
|
|
38
|
+
*/
|
|
39
|
+
export interface Deadline {
|
|
40
|
+
readonly signal: AbortSignal;
|
|
41
|
+
readonly expiresAt: bigint;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Scheduler — creates delays, timeouts, and deadlines.
|
|
45
|
+
*/
|
|
46
|
+
export interface Scheduler {
|
|
47
|
+
delay(duration: Duration, signal?: AbortSignal): Promise<void>;
|
|
48
|
+
timeout(duration: Duration): AbortSignal;
|
|
49
|
+
deadline(duration: Duration): Deadline;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `Time` — the injected time bundle (part of `Platform`).
|
|
53
|
+
*
|
|
54
|
+
* Aggregates `Clock` and `Scheduler` into a single object that `browsersmith`
|
|
55
|
+
* assembles and passes down through `Platform.time`.
|
|
56
|
+
*/
|
|
57
|
+
export interface Time {
|
|
58
|
+
readonly clock: Clock;
|
|
59
|
+
readonly scheduler: Scheduler;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `Duration` factory — pure function object, no runtime deps.
|
|
63
|
+
*
|
|
64
|
+
* Platform implementations use this to build `Duration` values; protocol
|
|
65
|
+
* packages treat durations as opaque data. Pure data, no injection needed.
|
|
66
|
+
*/
|
|
67
|
+
export declare const Duration: {
|
|
68
|
+
seconds: (n: number) => Duration;
|
|
69
|
+
milliseconds: (n: number) => Duration;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IAClB,2CAA2C;IAC3C,GAAG,IAAI,MAAM,CAAC;IACd,mDAAmD;IACnD,SAAS,IAAI,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,OAAO,IAAI,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC1C;AAED;;;;;GAKG;AACH,MAAM,WAAW,IAAI;IACjB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CACjC;AAMD;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;IACjB,OAAO,MAAM,MAAM,KAAG,QAAQ;IAC9B,YAAY,MAAM,MAAM,KAAG,QAAQ;CACtC,CAAC"}
|
package/dist/time.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic time contracts — the injected time surface.
|
|
3
|
+
*
|
|
4
|
+
* These interfaces describe what BrowserCore needs from a runtime's time and
|
|
5
|
+
* scheduling facilities. They are implemented by thin adapters (e.g.
|
|
6
|
+
* `browsersmith/src/time/node/`) and **injected** as `Platform.time`. Protocol
|
|
7
|
+
* packages call `clock.now()` / `scheduler.delay()` against these interfaces —
|
|
8
|
+
* never against `setTimeout` or `performance.now` directly — so the stack
|
|
9
|
+
* stays runtime-agnostic and deterministically testable.
|
|
10
|
+
*
|
|
11
|
+
* Design rule: the interface is defined by what packages *consume*, not by
|
|
12
|
+
* what any one runtime provides.
|
|
13
|
+
*/
|
|
14
|
+
// ===========================================================================
|
|
15
|
+
// Duration factory
|
|
16
|
+
// ===========================================================================
|
|
17
|
+
/**
|
|
18
|
+
* `Duration` factory — pure function object, no runtime deps.
|
|
19
|
+
*
|
|
20
|
+
* Platform implementations use this to build `Duration` values; protocol
|
|
21
|
+
* packages treat durations as opaque data. Pure data, no injection needed.
|
|
22
|
+
*/
|
|
23
|
+
export const Duration = {
|
|
24
|
+
seconds: (n) => ({ milliseconds: n * 1000, seconds: () => n }),
|
|
25
|
+
milliseconds: (n) => ({ milliseconds: n, seconds: () => n / 1000 }),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=time.js.map
|
package/dist/time.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"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ED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform-agnostic TCP and DNS contracts.
|
|
3
|
-
*
|
|
4
|
-
* These interfaces describe exactly what BrowserCore needs from a runtime —
|
|
5
|
-
* nothing more. They are implemented by thin adapters (e.g. `browsersmith/src/net/node/`)
|
|
6
|
-
* and injected into @browsercore/transport so the protocol stack stays
|
|
7
|
-
* runtime-agnostic (Node, Bun, Deno, Cloudflare Workers, mocks).
|
|
8
|
-
*
|
|
9
|
-
* Design rule: expose only what transport consumes. Don't mirror Node's API.
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=net.js.map
|
package/dist/net.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"net.js","sourceRoot":"","sources":["../src/net.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|