@api.global/typedsocket 7.0.0 → 8.0.0
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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.requestcancellationmanager.d.ts +61 -0
- package/dist_ts/classes.requestcancellationmanager.js +234 -0
- package/dist_ts/classes.typedsocket.d.ts +14 -0
- package/dist_ts/classes.typedsocket.js +373 -46
- package/dist_ts/classes.virtualstreammanager.d.ts +8 -0
- package/dist_ts/classes.virtualstreammanager.js +61 -15
- package/dist_ts/constants.virtualstream.d.ts +3 -1
- package/dist_ts/constants.virtualstream.js +4 -2
- package/dist_ts/index.d.ts +2 -1
- package/dist_ts/index.js +3 -2
- package/package.json +7 -7
- package/readme.hints.md +5 -5
- package/readme.md +39 -15
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export declare const TYPEDSOCKET_PACKAGE_MAJOR:
|
|
1
|
+
export declare const TYPEDSOCKET_PACKAGE_MAJOR: 8;
|
|
2
2
|
export declare const TYPEDSOCKET_VERSION_METHOD: "__typedsocket_checkVersion";
|
|
3
|
+
export declare const TYPEDSOCKET_REQUEST_CANCELLATION_METHOD: "__typedsocket_cancelRequest";
|
|
4
|
+
export declare const TYPEDSOCKET_REQUEST_CANCELLATION_PROTOCOL: "typedrequest-cancellation-v1";
|
|
3
5
|
export declare const VIRTUAL_STREAM_PROTOCOL: "virtual-stream-v1";
|
|
4
6
|
export declare const VIRTUAL_STREAM_FRAME_MAGIC: "TSV1";
|
|
5
7
|
export declare const VIRTUAL_STREAM_FRAME_TYPES: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export const TYPEDSOCKET_PACKAGE_MAJOR =
|
|
1
|
+
export const TYPEDSOCKET_PACKAGE_MAJOR = 8;
|
|
2
2
|
export const TYPEDSOCKET_VERSION_METHOD = '__typedsocket_checkVersion';
|
|
3
|
+
export const TYPEDSOCKET_REQUEST_CANCELLATION_METHOD = '__typedsocket_cancelRequest';
|
|
4
|
+
export const TYPEDSOCKET_REQUEST_CANCELLATION_PROTOCOL = 'typedrequest-cancellation-v1';
|
|
3
5
|
export const VIRTUAL_STREAM_PROTOCOL = 'virtual-stream-v1';
|
|
4
6
|
export const VIRTUAL_STREAM_FRAME_MAGIC = 'TSV1';
|
|
5
7
|
export const VIRTUAL_STREAM_FRAME_TYPES = {
|
|
@@ -55,4 +57,4 @@ export const VIRTUAL_STREAM_CAPABILITY_TIMEOUT_MS = 10_000;
|
|
|
55
57
|
export const VIRTUAL_STREAM_PROGRESS_TIMEOUT_MS = 30_000;
|
|
56
58
|
export const VIRTUAL_STREAM_REVALIDATION_TIMEOUT_MS = 5_000;
|
|
57
59
|
export const VIRTUAL_STREAM_TOMBSTONE_RETENTION_MS = 60_000;
|
|
58
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLnZpcnR1YWxzdHJlYW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9jb25zdGFudHMudmlydHVhbHN0cmVhbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBRyxDQUFVLENBQUM7QUFDcEQsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsNEJBQXFDLENBQUM7QUFDaEYsTUFBTSxDQUFDLE1BQU0sdUNBQXVDLEdBQUcsNkJBQXNDLENBQUM7QUFDOUYsTUFBTSxDQUFDLE1BQU0seUNBQXlDLEdBQUcsOEJBQXVDLENBQUM7QUFDakcsTUFBTSxDQUFDLE1BQU0sdUJBQXVCLEdBQUcsbUJBQTRCLENBQUM7QUFDcEUsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsTUFBZSxDQUFDO0FBRTFELE1BQU0sQ0FBQyxNQUFNLDBCQUEwQixHQU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BRyxHQUFHLENBQUM7QUFDM0QsTUFBTSxDQUFDLE1BQU0sK0NBQStDLEdBQUcsQ0FBQyxDQUFDO0FBQ2pFLE1BQU0sQ0FBQyxNQUFNLDJDQUEyQyxHQUFHLEdBQUcsQ0FBQztBQUMvRCxNQUFNLENBQUMsTUFBTSw0Q0FBNEMsR0FBRyxFQUFFLENBQUM7QUFDL0QsTUFBTSxDQUFDLE1BQU0sNENBQTRDLEdBQUcsRUFBRSxHQUFHLElBQUksR0FBRyxJQUFJLENBQUM7QUFFN0UsTUFBTSxDQUFDLE1BQU0sZ0NBQWdDLEdBQUcsTUFBTSxDQUFDO0FBQ3ZELE1BQU0sQ0FBQyxNQUFNLG9DQUFvQyxHQUFHLE1BQU0sQ0FBQztBQUMzRCxNQUFNLENBQUMsTUFBTSxrQ0FBa0MsR0FBRyxNQUFNLENBQUM7QUFDekQsTUFBTSxDQUFDLE1BQU0sc0NBQXNDLEdBQUcsS0FBSyxDQUFDO0FBQzVELE1BQU0sQ0FBQyxNQUFNLHFDQUFxQyxHQUFHLE1BQU0sQ0FBQyJ9
|
package/dist_ts/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './classes.typedsocket.js';
|
|
2
|
-
export {
|
|
2
|
+
export { TYPEDSOCKET_MAX_ACTIVE_REQUEST_HANDLERS_PER_CONNECTION, TYPEDSOCKET_MAX_ACTIVE_REQUEST_HANDLERS, TYPEDSOCKET_MAX_REQUEST_CANCELLATION_TOMBSTONES_PER_CONNECTION, TYPEDSOCKET_MAX_REQUEST_CANCELLATION_TOMBSTONES, TYPEDSOCKET_REQUEST_HANDLER_MAX_LIFETIME_MS, TYPEDSOCKET_REQUEST_CANCELLATION_TOMBSTONE_RETENTION_MS, } from './classes.requestcancellationmanager.js';
|
|
3
|
+
export { TYPEDSOCKET_PACKAGE_MAJOR, TYPEDSOCKET_REQUEST_CANCELLATION_METHOD, TYPEDSOCKET_REQUEST_CANCELLATION_PROTOCOL, VIRTUAL_STREAM_PROTOCOL, VIRTUAL_STREAM_MAX_FRAME_BYTES, VIRTUAL_STREAM_MAX_FRAGMENT_PAYLOAD_BYTES, VIRTUAL_STREAM_MAX_LOGICAL_CHUNK_BYTES, VIRTUAL_STREAM_MAX_CONTENT_TYPE_BYTES, VIRTUAL_STREAM_MAX_STREAM_BYTES, VIRTUAL_STREAM_MAX_STREAMS_PER_CONNECTION, VIRTUAL_STREAM_MAX_STREAMS_PER_SERVER, VIRTUAL_STREAM_MAX_CONNECTIONS_PER_SERVER, VIRTUAL_STREAM_MAX_QUEUED_CHUNKS_PER_STREAM, VIRTUAL_STREAM_MAX_QUEUED_CHUNKS_PER_CONNECTION, VIRTUAL_STREAM_MAX_QUEUED_BYTES_PER_STREAM, VIRTUAL_STREAM_MAX_QUEUED_BYTES_PER_CONNECTION, VIRTUAL_STREAM_MAX_RAW_QUEUE_FRAMES, VIRTUAL_STREAM_MAX_RAW_QUEUE_BYTES, VIRTUAL_STREAM_MAX_OUTBOUND_FRAMES_PER_CONNECTION, VIRTUAL_STREAM_MAX_REVALIDATIONS_PER_CONNECTION, VIRTUAL_STREAM_MAX_REVALIDATIONS_PER_SERVER, VIRTUAL_STREAM_MAX_TOMBSTONES_PER_CONNECTION, VIRTUAL_STREAM_MAX_RETAINED_BYTES_PER_SERVER, TYPEDSOCKET_HANDSHAKE_TIMEOUT_MS, VIRTUAL_STREAM_CAPABILITY_TIMEOUT_MS, VIRTUAL_STREAM_PROGRESS_TIMEOUT_MS, VIRTUAL_STREAM_REVALIDATION_TIMEOUT_MS, VIRTUAL_STREAM_TOMBSTONE_RETENTION_MS, } from './constants.virtualstream.js';
|
|
3
4
|
export type { TVirtualStreamDirection, TVirtualStreamAuthorityOperation, TVirtualStreamConnectionBinding, IVirtualStreamDescriptorTransport, ITypedSocketVirtualStreamDescriptor, IVirtualStreamAuthorizationContext, IVirtualStreamRevalidationContext, TVirtualStreamRevalidate, IVirtualStreamAuthorizationBinding, IVirtualStreamAuthorizationAdapter, ICreateVirtualStreamOptions, IVirtualStreamCreateRegistrationOptions, IVirtualStreamStats, IVirtualStreamRuntime, } from './interfaces.virtualstream.js';
|
|
4
5
|
export { VirtualStreamManager, TypedSocketVirtualStreamError, } from './classes.virtualstreammanager.js';
|
|
5
6
|
export type { IVirtualStreamManagerOptions } from './classes.virtualstreammanager.js';
|
package/dist_ts/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './classes.typedsocket.js';
|
|
2
|
-
export {
|
|
2
|
+
export { TYPEDSOCKET_MAX_ACTIVE_REQUEST_HANDLERS_PER_CONNECTION, TYPEDSOCKET_MAX_ACTIVE_REQUEST_HANDLERS, TYPEDSOCKET_MAX_REQUEST_CANCELLATION_TOMBSTONES_PER_CONNECTION, TYPEDSOCKET_MAX_REQUEST_CANCELLATION_TOMBSTONES, TYPEDSOCKET_REQUEST_HANDLER_MAX_LIFETIME_MS, TYPEDSOCKET_REQUEST_CANCELLATION_TOMBSTONE_RETENTION_MS, } from './classes.requestcancellationmanager.js';
|
|
3
|
+
export { TYPEDSOCKET_PACKAGE_MAJOR, TYPEDSOCKET_REQUEST_CANCELLATION_METHOD, TYPEDSOCKET_REQUEST_CANCELLATION_PROTOCOL, VIRTUAL_STREAM_PROTOCOL, VIRTUAL_STREAM_MAX_FRAME_BYTES, VIRTUAL_STREAM_MAX_FRAGMENT_PAYLOAD_BYTES, VIRTUAL_STREAM_MAX_LOGICAL_CHUNK_BYTES, VIRTUAL_STREAM_MAX_CONTENT_TYPE_BYTES, VIRTUAL_STREAM_MAX_STREAM_BYTES, VIRTUAL_STREAM_MAX_STREAMS_PER_CONNECTION, VIRTUAL_STREAM_MAX_STREAMS_PER_SERVER, VIRTUAL_STREAM_MAX_CONNECTIONS_PER_SERVER, VIRTUAL_STREAM_MAX_QUEUED_CHUNKS_PER_STREAM, VIRTUAL_STREAM_MAX_QUEUED_CHUNKS_PER_CONNECTION, VIRTUAL_STREAM_MAX_QUEUED_BYTES_PER_STREAM, VIRTUAL_STREAM_MAX_QUEUED_BYTES_PER_CONNECTION, VIRTUAL_STREAM_MAX_RAW_QUEUE_FRAMES, VIRTUAL_STREAM_MAX_RAW_QUEUE_BYTES, VIRTUAL_STREAM_MAX_OUTBOUND_FRAMES_PER_CONNECTION, VIRTUAL_STREAM_MAX_REVALIDATIONS_PER_CONNECTION, VIRTUAL_STREAM_MAX_REVALIDATIONS_PER_SERVER, VIRTUAL_STREAM_MAX_TOMBSTONES_PER_CONNECTION, VIRTUAL_STREAM_MAX_RETAINED_BYTES_PER_SERVER, TYPEDSOCKET_HANDSHAKE_TIMEOUT_MS, VIRTUAL_STREAM_CAPABILITY_TIMEOUT_MS, VIRTUAL_STREAM_PROGRESS_TIMEOUT_MS, VIRTUAL_STREAM_REVALIDATION_TIMEOUT_MS, VIRTUAL_STREAM_TOMBSTONE_RETENTION_MS, } from './constants.virtualstream.js';
|
|
3
4
|
export { VirtualStreamManager, TypedSocketVirtualStreamError, } from './classes.virtualstreammanager.js';
|
|
4
5
|
export { TYPEDSOCKET_MAX_TAG_NAME_BYTES, TYPEDSOCKET_MAX_TAG_PAYLOAD_BYTES, TYPEDSOCKET_MAX_CLIENT_TAGS_PER_PEER, TYPEDSOCKET_MAX_CLIENT_TAG_RETAINED_BYTES_PER_PEER, TYPEDSOCKET_MAX_RETAINED_TAG_MUTATIONS_PER_PEER, TYPEDSOCKET_MAX_RETAINED_TAG_MUTATIONS_PER_RULE, TYPEDSOCKET_MAX_RETAINED_TAG_MUTATIONS_PER_SERVER, TYPEDSOCKET_MAX_TAG_AUTHORIZATION_TIMEOUT_MS, TYPEDSOCKET_MAX_SERVER_TAG_NAMES_PER_PEER, TYPEDSOCKET_MAX_SERVER_TAG_RETAINED_BYTES_PER_PEER, TYPEDSOCKET_TAG_DENIAL_CODES, TypedSocketClientTagDeniedError, } from './classes.typedsockettagpolicymanager.js';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/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0FBK0MsRUFDL0MsaURBQWlELEVBQ2pELDRDQUE0QyxFQUM1Qyx5Q0FBeUMsRUFDekMsa0RBQWtELEVBQ2xELDRCQUE0QixFQUM1QiwrQkFBK0IsR0FDaEMsTUFBTSwwQ0FBMEMsQ0FBQyJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api.global/typedsocket",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library for creating typed WebSocket connections, supporting bi-directional communication with type safety.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@git.zone/tsbuild": "^4.4.2",
|
|
20
|
-
"@git.zone/tsbundle": "^2.11.
|
|
20
|
+
"@git.zone/tsbundle": "^2.11.4",
|
|
21
21
|
"@git.zone/tsrun": "^2.0.6",
|
|
22
22
|
"@git.zone/tstest": "^4.0.0",
|
|
23
23
|
"@push.rocks/smartenv": "^6.1.0",
|
|
24
|
-
"@push.rocks/smartserve": "^
|
|
25
|
-
"@types/node": "26.
|
|
24
|
+
"@push.rocks/smartserve": "^6.0.0",
|
|
25
|
+
"@types/node": "26.2.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@api.global/typedrequest": "^
|
|
29
|
-
"@api.global/typedrequest-interfaces": "^7.
|
|
28
|
+
"@api.global/typedrequest": "^8.0.1",
|
|
29
|
+
"@api.global/typedrequest-interfaces": "^7.1.0",
|
|
30
30
|
"@push.rocks/smartdelay": "^3.1.0",
|
|
31
31
|
"@push.rocks/smarthash": "^3.3.0",
|
|
32
32
|
"@push.rocks/smartjson": "^6.0.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@push.rocks/smarturl": "^3.1.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@push.rocks/smartserve": ">=
|
|
39
|
+
"@push.rocks/smartserve": ">=6.0.0 <7"
|
|
40
40
|
},
|
|
41
41
|
"browserslist": [
|
|
42
42
|
"last 1 chrome versions"
|
package/readme.hints.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# TypedSocket Hints
|
|
2
2
|
|
|
3
|
-
## TypedSocket
|
|
3
|
+
## TypedSocket 8 integration findings
|
|
4
4
|
|
|
5
|
-
1. `TypedSocket.createServer()` creates a transport routing surface for each application router. SmartServe
|
|
5
|
+
1. `TypedSocket.createServer()` creates a transport routing surface for each application router. SmartServe 6 must receive `typedSocket.getServerRoutingSurface(applicationRouter)` and the exact `typedSocket.webSocketTransportOwner`; passing the application router directly does not establish the v8 peer authority boundary.
|
|
6
6
|
|
|
7
|
-
2. Construction order is fixed: application routers, `createServer()`, SmartServe construction, `attachSmartServe()`, then `smartServe.start()`. Version
|
|
7
|
+
2. Construction order is fixed: application routers, `createServer()`, SmartServe construction, `attachSmartServe()`, then `smartServe.start()`. Version 8 intentionally has no `fromSmartServe()` path because routing-surface and transport-owner identities are selected during upgrade.
|
|
8
8
|
|
|
9
|
-
3. Every peer uses one always-on TypedRequest
|
|
9
|
+
3. Every peer uses one always-on TypedRequest 8 `IVirtualStreamTransport` with protocol `virtual-stream-v1`. There are no native-byte/native-message capability modes or JSON-only fallback. Exact package major 8, `typedrequest-cancellation-v1`, and the handshake request instance must match before application RPC or binary stream traffic is authorized.
|
|
10
10
|
|
|
11
11
|
4. Server-initiated TypedRequests require an explicit `ISmartServeConnectionWrapper`. Resolve it from handler tools with `getServerConnectionForRequest()` or from the live target lookup APIs. There is no implicit single-peer targeting.
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
7. Client tags remain default-deny and exact-rule based. Authentication and roles belong in protected server tags. Connection restoration runs after the major handshake and before desired tags and `connected` readiness.
|
|
18
18
|
|
|
19
|
-
8. `stop()` releases TypedSocket-owned guards, resolvers, pending requests, streams, and router composition. Server stop does not stop SmartServe. Diagnostics use `text` and `virtualStream` scopes and never expose caller-controlled unbounded values.
|
|
19
|
+
8. `stop()` releases TypedSocket-owned guards, resolvers, pending requests, streams, and router composition. Server stop does not stop SmartServe. Aborted request handlers remain globally charged until TypedRequest invokes their registration's `complete()` callback; cancellation stats count only still-attached connection states in `connections`. Diagnostics use `text` and `virtualStream` scopes and never expose caller-controlled unbounded values.
|
|
20
20
|
|
|
21
21
|
## Release artifact
|
|
22
22
|
|
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @api.global/typedsocket
|
|
2
2
|
|
|
3
|
-
Typed request/response communication over WebSockets with one peer-scoped transport for JSON RPC and ordered `virtual-stream-v1` byte streams. TypedSocket
|
|
3
|
+
Typed request/response communication over WebSockets with one peer-scoped transport for JSON RPC and ordered `virtual-stream-v1` byte streams. TypedSocket 8 integrates TypedRequest 8, enforces an exact package-major handshake, and binds every server operation to the physical peer and routing surface selected during upgrade.
|
|
4
4
|
|
|
5
5
|
## Issue Reporting and Security
|
|
6
6
|
|
|
@@ -18,9 +18,12 @@ Server applications also need SmartServe:
|
|
|
18
18
|
pnpm add @push.rocks/smartserve
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
TypedSocket
|
|
21
|
+
TypedSocket 8 requires `@api.global/typedrequest` 8.0.1 or newer within major 8,
|
|
22
|
+
`@api.global/typedrequest-interfaces` 7.1 or newer within major 7, and a
|
|
23
|
+
`@push.rocks/smartserve` 6 release. These packages resolve one TypedRequest 8
|
|
24
|
+
router graph and must not be mixed with earlier router or stream APIs.
|
|
22
25
|
|
|
23
|
-
## Version
|
|
26
|
+
## Version 8 transport model
|
|
24
27
|
|
|
25
28
|
Each physical WebSocket peer has one always-on TypedSocket transport:
|
|
26
29
|
|
|
@@ -28,13 +31,14 @@ Each physical WebSocket peer has one always-on TypedSocket transport:
|
|
|
28
31
|
- binary frames carry the same peer's `virtual-stream-v1` streams;
|
|
29
32
|
- SmartServe fixes the peer's `routingSurface` and `transportOwner` during upgrade;
|
|
30
33
|
- the client and server must complete the exact TypedSocket package-major handshake before application requests or streams are admitted;
|
|
34
|
+
- the exact handshake also requires `typedrequest-cancellation-v1`; mixed peers fail before application traffic;
|
|
31
35
|
- client connection restoration runs after the handshake and before desired tags and the `connected` state are published.
|
|
32
36
|
|
|
33
|
-
There are no optional native-byte or native-message capability modes in version
|
|
37
|
+
There are no optional native-byte or native-message capability modes in version 8. The v6 `nativeBytes`, `native-byte-v1`, `native-message-v1`, binary-message channel, and capability-mode APIs are not part of the v8 public surface. There is also no `TypedSocket.fromSmartServe()` attachment shortcut: server composition must happen before SmartServe is constructed.
|
|
34
38
|
|
|
35
39
|
## Define shared contracts
|
|
36
40
|
|
|
37
|
-
TypedSocket uses ordinary TypedRequest interfaces. VirtualStreams use the transport-neutral TypedRequest
|
|
41
|
+
TypedSocket uses ordinary TypedRequest interfaces. VirtualStreams use the transport-neutral TypedRequest 8 types:
|
|
38
42
|
|
|
39
43
|
```typescript
|
|
40
44
|
import type {
|
|
@@ -78,7 +82,7 @@ export interface IRestoreSessionRequest
|
|
|
78
82
|
|
|
79
83
|
`TypedHandler` reverses stream directions at the handler boundary. An upload declared as requester-local `send` reaches the server handler as local `receive`; a download declared as requester-local `receive` is created by the handler as local `send`.
|
|
80
84
|
|
|
81
|
-
## Server setup with SmartServe
|
|
85
|
+
## Server setup with SmartServe 6
|
|
82
86
|
|
|
83
87
|
Construction order is part of the transport contract:
|
|
84
88
|
|
|
@@ -102,7 +106,12 @@ applicationRouter.addTypedHandler(
|
|
|
102
106
|
})),
|
|
103
107
|
);
|
|
104
108
|
|
|
105
|
-
const typedSocket = TypedSocket.createServer(applicationRouter
|
|
109
|
+
const typedSocket = TypedSocket.createServer(applicationRouter, {
|
|
110
|
+
onServerConnectionReady: (connection) => {
|
|
111
|
+
typedSocket.setServerTag(connection, 'application-client');
|
|
112
|
+
return undefined;
|
|
113
|
+
},
|
|
114
|
+
});
|
|
106
115
|
|
|
107
116
|
const smartServe = new SmartServe({
|
|
108
117
|
port: 3000,
|
|
@@ -118,6 +127,12 @@ await smartServe.start();
|
|
|
118
127
|
|
|
119
128
|
Do not pass `applicationRouter` directly to `websocket.typedRouter`. `createServer()` creates a distinct routing surface that composes the private TypedSocket protocol before the application router. SmartServe must bind that returned surface and the exact transport-owner identity to the peer.
|
|
120
129
|
|
|
130
|
+
`onServerConnectionReady(connection)` may synchronously assign protected tags or
|
|
131
|
+
other connection-local state after the exact handshake response has been
|
|
132
|
+
settled. It must return `undefined`; returning any other value, including a
|
|
133
|
+
Promise or custom thenable, or throwing closes the connection before readiness
|
|
134
|
+
is published.
|
|
135
|
+
|
|
121
136
|
### Multiple isolated routing surfaces
|
|
122
137
|
|
|
123
138
|
One TypedSocket can compose multiple application routers without making them reachable from one another. Resolve the corresponding generated surface during upgrade:
|
|
@@ -161,9 +176,10 @@ import { TypedSocket } from '@api.global/typedsocket';
|
|
|
161
176
|
const clientRouter = new TypedRouter();
|
|
162
177
|
|
|
163
178
|
clientRouter.addTypedHandler(
|
|
164
|
-
new TypedHandler<IGreetRequest>('greet', async ({ name }) =>
|
|
165
|
-
|
|
166
|
-
|
|
179
|
+
new TypedHandler<IGreetRequest>('greet', async ({ name }, tools) => {
|
|
180
|
+
tools?.abortSignal.throwIfAborted();
|
|
181
|
+
return { message: `Hello from the client, ${name}!` };
|
|
182
|
+
}),
|
|
167
183
|
);
|
|
168
184
|
|
|
169
185
|
const client = await TypedSocket.createClient(
|
|
@@ -234,11 +250,11 @@ applicationRouter.addTypedHandler(
|
|
|
234
250
|
);
|
|
235
251
|
```
|
|
236
252
|
|
|
237
|
-
`findTargetConnection()`, `findAllTargetConnections()`, and their tag variants return only live peers attached to this TypedSocket's generated routing surfaces. There is no implicit single-peer server fallback in
|
|
253
|
+
`findTargetConnection()`, `findAllTargetConnections()`, and their tag variants return only live peers attached to this TypedSocket's generated routing surfaces. There is no implicit single-peer server fallback in v8.
|
|
238
254
|
|
|
239
255
|
## VirtualStreams
|
|
240
256
|
|
|
241
|
-
TypedSocket
|
|
257
|
+
TypedSocket 8 supplies TypedRequest 8's `IVirtualStreamTransport` for each handshake-ready physical peer. TypedRequest serializes only the JSON-compatible descriptor in the parent envelope; ordered `Uint8Array` chunks travel as bounded binary frames on that exact peer.
|
|
242
258
|
|
|
243
259
|
All stream facades expose `protocol`, `direction`, `streamId`, optional `contentType` and `integrity`, `opened`, `completion`, `closed`, and `abort()`. Senders add `send()`, `writable`, and `close()`. Receivers add `receive()`, `readable`, `accept()`, and `reject()`.
|
|
244
260
|
|
|
@@ -410,6 +426,12 @@ Do not use a universal `allClients` broadcast tag. Assign a dedicated applicatio
|
|
|
410
426
|
- `diagnosticsSubject` publishes bounded structured events for invariant closes, peer rejection, reconnect scheduling or exhaustion, and tag denial. Subscribers own unsubscription; the subject does not complete.
|
|
411
427
|
- `stop()` disables client reconnect, rejects pending work, closes streams, and releases router registrations. Server `stop()` detaches TypedSocket state and composition but does not stop SmartServe.
|
|
412
428
|
- Request `timeoutMs` and `abortSignal` are supported on both sides. Server requests are cancelled on target disconnect or server stop.
|
|
429
|
+
- Timeout, caller abort, requester disconnect, target disconnect, client/server stop, and connection replacement abort the exact remote handler through `TypedTools.abortSignal`.
|
|
430
|
+
- Cancellation identity binds the physical peer, generated routing surface, connection generation, method, correlation ID, and fresh `requestInstanceId`. The control method is `__typedsocket_cancelRequest` with protocol `typedrequest-cancellation-v1` and is never broadcast or forwarded to another peer.
|
|
431
|
+
- Handshake and cancellation-control envelopes carry their own fresh top-level `requestInstanceId`. A cancellation payload separately names the exact application request instance being cancelled. Malformed, oversized, or authority-mismatched identities fail closed.
|
|
432
|
+
- A cancellation that wins routing before handler registration creates an `early-cancel` tombstone and delivers an already-aborted signal when that exact request registers. Completion replaces it with a terminal tombstone, so a late cancellation is ignored; reuse of the correlation ID is safe only with a fresh request instance ID.
|
|
433
|
+
- Active handlers are capped at 64 per connection and 1,024 per TypedSocket. Disconnect, stop, and the five-minute handler lifetime abort and detach work, but global active accounting is released only when TypedRequest calls the registration's `complete()` callback after the handler promise settles. Internal cancellation stats report that full unsettled count as `active`, its detached subset as `detachedActive`, and only live attached states as `connections`.
|
|
434
|
+
- Early/terminal cancellation tombstones are capped at 1,024 per connection and 16,384 per TypedSocket and expire after ten seconds. Per-connection overage closes that connection. On global pressure, largest-consumer selection includes the triggering connection and deterministically closes the oldest attached connection with the largest tombstone share. The triggering cancellation is admitted only when another consumer is reclaimed and the triggering connection remains open.
|
|
413
435
|
- Client `limits` may lower package ceilings but cannot raise them. Untrusted network deployments should lower text-frame and queue ceilings to match the application protocol.
|
|
414
436
|
- The stream transport bounds connections, active streams, logical chunk size, queued chunks and bytes, raw frames, outbound frames, revalidations, arrival accounting, tombstones, capability lifetime, progress time, and cleanup time.
|
|
415
437
|
- Invalid framing, overflow, integrity failure, authority revocation, handshake failure, and timeout fail closed. Physical-peer identity and raw-frame settlement identity are never inferred from caller-controlled payloads.
|
|
@@ -439,10 +461,12 @@ Selected stream defaults are 32 KiB physical frames, 4 MiB logical chunks, 32 ac
|
|
|
439
461
|
|
|
440
462
|
`VirtualStreamManager` is the peer-scoped transport manager. Client applications may use `getClientTransport()` and `createRegistration()` for explicit creator registrations. `getStats()` exposes bounded transport accounting. Server registration is not exposed on the manager; server applications must use the authorization-enforcing `TypedSocket.createVirtualStream()` facade.
|
|
441
463
|
|
|
442
|
-
## Migration
|
|
464
|
+
## Migration to version 8
|
|
443
465
|
|
|
444
|
-
- Replace TypedRequest
|
|
445
|
-
-
|
|
466
|
+
- Replace TypedRequest 7 and SmartServe 5 with TypedRequest 8 and SmartServe 6 so the transport resolves one TypedRouter major.
|
|
467
|
+
- Treat wire major 8 as intentionally incompatible with TypedSocket 7. The exact handshake requires package major 8, `typedrequest-cancellation-v1`, and a fresh request instance ID; there is no compatibility fallback.
|
|
468
|
+
- TypedSocket 7 application APIs remain otherwise unchanged.
|
|
469
|
+
- When migrating directly from version 6, remove `nativeByteCapabilityMode`, `nativeMessageCapabilityMode`, `nativeBytes`, message-channel APIs, and native-specific authorization adapters.
|
|
446
470
|
- Replace native stream DTOs with `TVirtualStream<'send' | 'receive'>` from `@api.global/typedrequest-interfaces`.
|
|
447
471
|
- Replace `fromSmartServe()` with the required `createServer()` → SmartServe construction → `attachSmartServe()` order.
|
|
448
472
|
- Pass `getServerRoutingSurface(applicationRouter)` to SmartServe, not the application router itself.
|