@nice-code/action 0.22.0 → 0.24.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/README.md +22 -25
- package/build/{ActionPayload.types-Dx1JPyfs.d.mts → AcceptorHandler-11-QMdx2.d.mts} +977 -1351
- package/build/{ActionPayload.types-L9k0LyBd.d.cts → AcceptorHandler-CxD0c1BE.d.cts} +977 -1351
- package/build/{ActionDevtoolsCore-CQ0vrvPD.d.cts → ActionDevtoolsCore-37JP4bOG.d.cts} +2 -2
- package/build/{ActionDevtoolsCore-CiLBYC3K.d.mts → ActionDevtoolsCore-Cgq-go1R.d.mts} +2 -2
- package/build/advanced/index.cjs +115 -0
- package/build/advanced/index.cjs.map +1 -0
- package/build/advanced/index.d.cts +344 -0
- package/build/advanced/index.d.mts +344 -0
- package/build/advanced/index.mjs +88 -0
- package/build/advanced/index.mjs.map +1 -0
- package/build/{httpAcceptorCarrier-OnJxzsAD.cjs → createHibernatableWsServerAdapter-BNi4k9j3.cjs} +258 -470
- package/build/createHibernatableWsServerAdapter-BNi4k9j3.cjs.map +1 -0
- package/build/{httpAcceptorCarrier-DL8lf0xB.mjs → createHibernatableWsServerAdapter-C07RfUTH.mjs} +233 -421
- package/build/createHibernatableWsServerAdapter-C07RfUTH.mjs.map +1 -0
- package/build/devtools/browser/index.d.cts +1 -1
- package/build/devtools/browser/index.d.mts +1 -1
- package/build/devtools/server/index.d.cts +1 -1
- package/build/devtools/server/index.d.mts +1 -1
- package/build/httpAcceptorCarrier-C3S_bDkL.cjs +454 -0
- package/build/httpAcceptorCarrier-C3S_bDkL.cjs.map +1 -0
- package/build/httpAcceptorCarrier-DPBEuewS.mjs +401 -0
- package/build/httpAcceptorCarrier-DPBEuewS.mjs.map +1 -0
- package/build/index.cjs +84 -458
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +2 -2
- package/build/index.d.mts +2 -2
- package/build/index.mjs +28 -374
- package/build/index.mjs.map +1 -1
- package/build/platform/cloudflare/index.cjs +1 -1
- package/build/platform/cloudflare/index.cjs.map +1 -1
- package/build/platform/cloudflare/index.d.cts +3 -3
- package/build/platform/cloudflare/index.d.mts +3 -3
- package/build/platform/cloudflare/index.mjs +1 -1
- package/build/platform/cloudflare/index.mjs.map +1 -1
- package/build/react-query/index.d.cts +1 -1
- package/build/react-query/index.d.mts +1 -1
- package/package.json +15 -4
- package/build/httpAcceptorCarrier-DL8lf0xB.mjs.map +0 -1
- package/build/httpAcceptorCarrier-OnJxzsAD.cjs.map +0 -1
package/build/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_createHibernatableWsServerAdapter = require("./createHibernatableWsServerAdapter-BNi4k9j3.cjs");
|
|
3
3
|
const require_RunningAction_types = require("./RunningAction.types-DjCX1xp5.cjs");
|
|
4
|
+
const require_httpAcceptorCarrier = require("./httpAcceptorCarrier-C3S_bDkL.cjs");
|
|
4
5
|
let nanoid = require("nanoid");
|
|
5
6
|
let _nice_code_error = require("@nice-code/error");
|
|
6
|
-
let msgpackr = require("msgpackr");
|
|
7
7
|
//#region src/ActionDefinition/Action/Context/ActionContext.ts
|
|
8
|
-
var ActionContext = class extends
|
|
8
|
+
var ActionContext = class extends require_createHibernatableWsServerAdapter.ActionBase {
|
|
9
9
|
_domain;
|
|
10
10
|
form = "context";
|
|
11
11
|
_routing;
|
|
@@ -71,7 +71,7 @@ var ActionContext = class extends require_httpAcceptorCarrier.ActionBase {
|
|
|
71
71
|
};
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/ActionDefinition/Action/Core/ActionCore.ts
|
|
74
|
-
var ActionCore = class extends
|
|
74
|
+
var ActionCore = class extends require_createHibernatableWsServerAdapter.ActionBase {
|
|
75
75
|
_domain;
|
|
76
76
|
form = "core";
|
|
77
77
|
constructor(_domain, id) {
|
|
@@ -79,7 +79,7 @@ var ActionCore = class extends require_httpAcceptorCarrier.ActionBase {
|
|
|
79
79
|
this._domain = _domain;
|
|
80
80
|
}
|
|
81
81
|
is(action) {
|
|
82
|
-
return action instanceof
|
|
82
|
+
return action instanceof require_createHibernatableWsServerAdapter.ActionPayload && action.domain === this.domain && action.id === this.id;
|
|
83
83
|
}
|
|
84
84
|
toJsonObject() {
|
|
85
85
|
return {
|
|
@@ -95,11 +95,11 @@ var ActionCore = class extends require_httpAcceptorCarrier.ActionBase {
|
|
|
95
95
|
actionId: this.id,
|
|
96
96
|
domain: this.domain
|
|
97
97
|
});
|
|
98
|
-
return new
|
|
98
|
+
return new require_createHibernatableWsServerAdapter.ActionPayload_Request({ context: new ActionContext(this._domain, this.id, {
|
|
99
99
|
cuid: (0, nanoid.nanoid)(),
|
|
100
100
|
timeCreated: Date.now(),
|
|
101
101
|
routing: [],
|
|
102
|
-
originClient:
|
|
102
|
+
originClient: require_createHibernatableWsServerAdapter.RuntimeCoordinate.unknown
|
|
103
103
|
}) }, validatedInput, { time: Date.now() });
|
|
104
104
|
}
|
|
105
105
|
deserializeInput(serialized) {
|
|
@@ -124,27 +124,27 @@ var ActionCore = class extends require_httpAcceptorCarrier.ActionBase {
|
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region src/utils/isAction_Context_JsonObject.ts
|
|
126
126
|
const isAction_Context_JsonObject = (obj) => {
|
|
127
|
-
return
|
|
127
|
+
return require_createHibernatableWsServerAdapter.isAction_Base_JsonObject(obj) && obj.form === "context";
|
|
128
128
|
};
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region src/utils/isAction_Core_JsonObject.ts
|
|
131
131
|
const isAction_Core_JsonObject = (obj) => {
|
|
132
|
-
return
|
|
132
|
+
return require_createHibernatableWsServerAdapter.isAction_Base_JsonObject(obj) && obj.form === "core";
|
|
133
133
|
};
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region src/utils/isAction_Any_JsonObject.ts
|
|
136
136
|
function isAction_Any_JsonObject(obj) {
|
|
137
|
-
return
|
|
137
|
+
return require_createHibernatableWsServerAdapter.isActionPayload_Any_JsonObject(obj) || isAction_Context_JsonObject(obj) || isAction_Core_JsonObject(obj);
|
|
138
138
|
}
|
|
139
139
|
//#endregion
|
|
140
140
|
//#region src/utils/assertIsActionJson.ts
|
|
141
141
|
function assertIsActionJson(obj) {
|
|
142
|
-
if (!isAction_Any_JsonObject(obj)) throw
|
|
142
|
+
if (!isAction_Any_JsonObject(obj)) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("wire_not_action_data");
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/utils/isAction_Any_Instance.ts
|
|
146
146
|
function isAction_Any_Instance(value) {
|
|
147
|
-
return value instanceof ActionCore || value instanceof
|
|
147
|
+
return value instanceof ActionCore || value instanceof require_createHibernatableWsServerAdapter.ActionPayload || value instanceof ActionContext;
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/ActionDefinition/Domain/ActionDomainBase.ts
|
|
@@ -190,7 +190,7 @@ var ActionRuntimeManager = class {
|
|
|
190
190
|
}
|
|
191
191
|
registerRuntime(runtime) {
|
|
192
192
|
const runtimeId = runtime.coordinate.stringId;
|
|
193
|
-
if (this._runtimes.has(runtimeId)) throw
|
|
193
|
+
if (this._runtimes.has(runtimeId)) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("client_runtime_already_registered", {
|
|
194
194
|
context: this._context,
|
|
195
195
|
client: runtime.coordinate
|
|
196
196
|
});
|
|
@@ -209,7 +209,7 @@ var ActionRuntimeManager = class {
|
|
|
209
209
|
handler,
|
|
210
210
|
runtime
|
|
211
211
|
};
|
|
212
|
-
if (throwOnIssue) throw
|
|
212
|
+
if (throwOnIssue) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("no_action_execution_handler", {
|
|
213
213
|
domain: action.domain,
|
|
214
214
|
actionId: action.id,
|
|
215
215
|
specifiedClient: localRuntime.coordinate
|
|
@@ -222,7 +222,7 @@ var ActionRuntimeManager = class {
|
|
|
222
222
|
runtime
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
if (throwOnIssue) throw
|
|
225
|
+
if (throwOnIssue) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("no_action_execution_handler", {
|
|
226
226
|
domain: action.domain,
|
|
227
227
|
actionId: action.id,
|
|
228
228
|
specifiedClient: options?.targetLocalRuntime?.coordinate
|
|
@@ -243,7 +243,7 @@ var ActionRuntimeManager = class {
|
|
|
243
243
|
return this._runtimes.values().next().value;
|
|
244
244
|
}
|
|
245
245
|
getBestRuntimeForSpecifier(clientSpecifier) {
|
|
246
|
-
const ids = new
|
|
246
|
+
const ids = new require_createHibernatableWsServerAdapter.RuntimeCoordinate(clientSpecifier).toStringIds();
|
|
247
247
|
for (const id of ids) {
|
|
248
248
|
const runtime = this._runtimes.get(id);
|
|
249
249
|
if (runtime) return runtime;
|
|
@@ -258,10 +258,10 @@ var ActionRuntimeManager = class {
|
|
|
258
258
|
getBestRuntimeOrThrow(specifier) {
|
|
259
259
|
const runtime = this.getBestRuntime(specifier);
|
|
260
260
|
if (!runtime) {
|
|
261
|
-
if (specifier == null) throw
|
|
262
|
-
throw
|
|
261
|
+
if (specifier == null) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("no_client_runtimes_registered", { context: this._context });
|
|
262
|
+
throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("client_runtime_not_registered", {
|
|
263
263
|
context: this._context,
|
|
264
|
-
clientStringId:
|
|
264
|
+
clientStringId: require_createHibernatableWsServerAdapter.runtimeCoordinateToStringIds(specifier)[0]
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
return runtime;
|
|
@@ -283,7 +283,7 @@ var ActionRootDomain = class extends ActionDomainBase {
|
|
|
283
283
|
this._actionRuntimeManager = new ActionRuntimeManager({ domain: domainId });
|
|
284
284
|
}
|
|
285
285
|
createChildDomain(subDomainDef) {
|
|
286
|
-
if (this.allDomains.includes(subDomainDef.domain)) throw
|
|
286
|
+
if (this.allDomains.includes(subDomainDef.domain)) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("domain_already_exists_in_hierarchy", {
|
|
287
287
|
domain: subDomainDef.domain,
|
|
288
288
|
allParentDomains: this.allDomains,
|
|
289
289
|
parentDomain: this.domain
|
|
@@ -309,7 +309,7 @@ var ActionRootDomain = class extends ActionDomainBase {
|
|
|
309
309
|
try {
|
|
310
310
|
handlerAndRuntime = this._actionRuntimeManager.getRuntimeAndHandlerForActionOrThrow(actionPayload, options);
|
|
311
311
|
} catch (err) {
|
|
312
|
-
const runningAction = new
|
|
312
|
+
const runningAction = new require_createHibernatableWsServerAdapter.RunningAction({
|
|
313
313
|
context: actionPayload.context,
|
|
314
314
|
request: actionPayload,
|
|
315
315
|
callSite: actionPayload._callSite
|
|
@@ -352,7 +352,7 @@ var ActionDomain = class ActionDomain extends ActionDomainBase {
|
|
|
352
352
|
this._rootDomain._registerRuntime(runtime);
|
|
353
353
|
}
|
|
354
354
|
createChildDomain(subDomainDef) {
|
|
355
|
-
if (this.allDomains.includes(subDomainDef.domain)) throw
|
|
355
|
+
if (this.allDomains.includes(subDomainDef.domain)) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("domain_already_exists_in_hierarchy", {
|
|
356
356
|
domain: subDomainDef.domain,
|
|
357
357
|
allParentDomains: this.allDomains,
|
|
358
358
|
parentDomain: this.domain
|
|
@@ -370,14 +370,14 @@ var ActionDomain = class ActionDomain extends ActionDomainBase {
|
|
|
370
370
|
return this._actionMap;
|
|
371
371
|
}
|
|
372
372
|
actionForId(id) {
|
|
373
|
-
if (!this.actionSchema[id]) throw
|
|
373
|
+
if (!this.actionSchema[id]) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("action_id_not_in_domain", {
|
|
374
374
|
domain: this.domain,
|
|
375
375
|
actionId: id
|
|
376
376
|
});
|
|
377
377
|
return new ActionCore(this, id);
|
|
378
378
|
}
|
|
379
379
|
wrapAsPartialLocalHandler(wrappedActionExecutor) {
|
|
380
|
-
const _handler = new
|
|
380
|
+
const _handler = new require_createHibernatableWsServerAdapter.ActionLocalHandler();
|
|
381
381
|
const executor = wrappedActionExecutor;
|
|
382
382
|
for (const actionKey in wrappedActionExecutor) {
|
|
383
383
|
if (!this.actionSchema[actionKey]) continue;
|
|
@@ -386,7 +386,7 @@ var ActionDomain = class ActionDomain extends ActionDomainBase {
|
|
|
386
386
|
return _handler;
|
|
387
387
|
}
|
|
388
388
|
wrapAsLocalHandler(wrappedActionExecutor) {
|
|
389
|
-
const _handler = new
|
|
389
|
+
const _handler = new require_createHibernatableWsServerAdapter.ActionLocalHandler();
|
|
390
390
|
const executor = wrappedActionExecutor;
|
|
391
391
|
return _handler.forDomain(this, (request) => executor[request.id](request.input));
|
|
392
392
|
}
|
|
@@ -396,45 +396,45 @@ var ActionDomain = class ActionDomain extends ActionDomainBase {
|
|
|
396
396
|
cuid: contextData.cuid,
|
|
397
397
|
routing: contextData.routing.map((item) => {
|
|
398
398
|
return {
|
|
399
|
-
runtime: new
|
|
399
|
+
runtime: new require_createHibernatableWsServerAdapter.RuntimeCoordinate(item.runtime),
|
|
400
400
|
handler: item.handler,
|
|
401
401
|
time: item.time
|
|
402
402
|
};
|
|
403
403
|
}),
|
|
404
|
-
originClient: contextData.originClient ? new
|
|
404
|
+
originClient: contextData.originClient ? new require_createHibernatableWsServerAdapter.RuntimeCoordinate(contextData.originClient) : require_createHibernatableWsServerAdapter.RuntimeCoordinate.unknown
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
407
|
isDomainAction(action) {
|
|
408
408
|
return isAction_Any_Instance(action) && action.domain === this.domain;
|
|
409
409
|
}
|
|
410
410
|
hydrateRequestPayload(serialized) {
|
|
411
|
-
if (serialized.type !== "request") throw
|
|
411
|
+
if (serialized.type !== "request") throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("hydration_action_state_mismatch", {
|
|
412
412
|
expected: "request",
|
|
413
413
|
received: serialized.type
|
|
414
414
|
});
|
|
415
|
-
if (serialized.domain !== this.domain) throw
|
|
415
|
+
if (serialized.domain !== this.domain) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("hydration_domain_mismatch", {
|
|
416
416
|
expected: this.domain,
|
|
417
417
|
received: serialized.domain
|
|
418
418
|
});
|
|
419
419
|
const id = serialized.id;
|
|
420
|
-
if (!this.actionSchema[id]) throw
|
|
420
|
+
if (!this.actionSchema[id]) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("hydration_action_id_not_found", {
|
|
421
421
|
domain: this.domain,
|
|
422
422
|
actionId: serialized.id
|
|
423
423
|
});
|
|
424
424
|
const contextAction = this.hydrateContext(id, serialized.context);
|
|
425
|
-
return new
|
|
425
|
+
return new require_createHibernatableWsServerAdapter.ActionPayload_Request({ context: contextAction }, contextAction.deserializeInput(serialized.input), { time: serialized.time });
|
|
426
426
|
}
|
|
427
427
|
hydrateResultPayload(serialized) {
|
|
428
|
-
if (serialized.type !== "result") throw
|
|
428
|
+
if (serialized.type !== "result") throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("hydration_action_state_mismatch", {
|
|
429
429
|
expected: "result",
|
|
430
430
|
received: serialized.type
|
|
431
431
|
});
|
|
432
|
-
if (serialized.domain !== this.domain) throw
|
|
432
|
+
if (serialized.domain !== this.domain) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("hydration_domain_mismatch", {
|
|
433
433
|
expected: this.domain,
|
|
434
434
|
received: serialized.domain
|
|
435
435
|
});
|
|
436
436
|
const id = serialized.id;
|
|
437
|
-
if (!this.actionSchema[id]) throw
|
|
437
|
+
if (!this.actionSchema[id]) throw require_createHibernatableWsServerAdapter.err_nice_action.fromId("hydration_action_id_not_found", {
|
|
438
438
|
domain: this.domain,
|
|
439
439
|
actionId: serialized.id
|
|
440
440
|
});
|
|
@@ -443,7 +443,7 @@ var ActionDomain = class ActionDomain extends ActionDomainBase {
|
|
|
443
443
|
ok: true,
|
|
444
444
|
output: contextAction.schema.deserializeOutput(serialized.result.output)
|
|
445
445
|
} : serialized.result;
|
|
446
|
-
return new
|
|
446
|
+
return new require_createHibernatableWsServerAdapter.ActionPayload_Result({ context: contextAction }, result, { time: serialized.time });
|
|
447
447
|
}
|
|
448
448
|
hydrateAnyAction(actionJson) {
|
|
449
449
|
assertIsActionJson(actionJson);
|
|
@@ -472,275 +472,6 @@ const createActionRootDomain = (definition) => {
|
|
|
472
472
|
return new ActionRootDomain(definition);
|
|
473
473
|
};
|
|
474
474
|
//#endregion
|
|
475
|
-
//#region src/ActionRuntime/Transport/codec/actionWireCodec.ts
|
|
476
|
-
/**
|
|
477
|
-
* Tiny integer codes for the payload type, so the verbose `"request"`/`"result"`/`"progress"`
|
|
478
|
-
* strings never hit the wire. The index in {@link ReversePayloadType} must line up with the value.
|
|
479
|
-
*/
|
|
480
|
-
const PayloadTypeToInt = {
|
|
481
|
-
["request"]: 0,
|
|
482
|
-
["result"]: 1,
|
|
483
|
-
["progress"]: 2
|
|
484
|
-
};
|
|
485
|
-
const ReversePayloadType = [
|
|
486
|
-
"request",
|
|
487
|
-
"result",
|
|
488
|
-
"progress"
|
|
489
|
-
];
|
|
490
|
-
/**
|
|
491
|
-
* Build the positional `domain:id` ↔ integer dictionary. Both ends of a channel MUST build it from
|
|
492
|
-
* the same domains in the same order — the mapping is positional, so a mismatch routes to the wrong
|
|
493
|
-
* action. Add new transported domains to the end of the list.
|
|
494
|
-
*/
|
|
495
|
-
function buildActionRouteDictionary(domains) {
|
|
496
|
-
const routeToInt = /* @__PURE__ */ new Map();
|
|
497
|
-
const intToRoute = [];
|
|
498
|
-
for (const dom of domains) for (const actionId of Object.keys(dom.actionSchema)) {
|
|
499
|
-
const routeKey = `${dom.domain}:${actionId}`;
|
|
500
|
-
if (routeToInt.has(routeKey)) continue;
|
|
501
|
-
routeToInt.set(routeKey, intToRoute.length);
|
|
502
|
-
intToRoute.push({
|
|
503
|
-
domain: dom.domain,
|
|
504
|
-
id: actionId,
|
|
505
|
-
allDomains: dom.allDomains
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
return {
|
|
509
|
-
routeToInt,
|
|
510
|
-
intToRoute
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
/** Pull the type-specific payload (`input` / `result` / `progress`) out of a wire JSON object. */
|
|
514
|
-
function extractWirePayload(json) {
|
|
515
|
-
if (json.type === "request") return json.input;
|
|
516
|
-
if (json.type === "result") return json.result;
|
|
517
|
-
if (json.type === "progress") return json.progress;
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Reassemble a full wire JSON object from its decoded parts. `inputHash`/`outputHash` are emitted
|
|
521
|
-
* empty — the hydration constructors recompute them — and the result still satisfies
|
|
522
|
-
* `isActionPayload_Any_JsonObject` so it flows through validation like a JSON frame.
|
|
523
|
-
*/
|
|
524
|
-
function assembleWireJson(routeMeta, payloadType, time, context, payloadData) {
|
|
525
|
-
const base = {
|
|
526
|
-
form: "data",
|
|
527
|
-
domain: routeMeta.domain,
|
|
528
|
-
id: routeMeta.id,
|
|
529
|
-
allDomains: routeMeta.allDomains,
|
|
530
|
-
time,
|
|
531
|
-
context
|
|
532
|
-
};
|
|
533
|
-
if (payloadType === "request") return {
|
|
534
|
-
...base,
|
|
535
|
-
type: "request",
|
|
536
|
-
input: payloadData,
|
|
537
|
-
inputHash: ""
|
|
538
|
-
};
|
|
539
|
-
if (payloadType === "result") return {
|
|
540
|
-
...base,
|
|
541
|
-
type: "result",
|
|
542
|
-
result: payloadData,
|
|
543
|
-
outputHash: ""
|
|
544
|
-
};
|
|
545
|
-
return {
|
|
546
|
-
...base,
|
|
547
|
-
type: "progress",
|
|
548
|
-
progress: payloadData
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
//#endregion
|
|
552
|
-
//#region src/ActionRuntime/Transport/codec/createBinaryWireSessionFactory.ts
|
|
553
|
-
/**
|
|
554
|
-
* Positional layout of the *session* binary envelope — the leanest frame. Compared to the stateless
|
|
555
|
-
* adapter it replaces the 21-char `cuid` with a small per-connection integer and only carries
|
|
556
|
-
* `originClient` on the very first request of each direction (the peer remembers it afterwards).
|
|
557
|
-
*
|
|
558
|
-
* [ routeInt, typeInt, corrId, time, originClient?, payloadData ]
|
|
559
|
-
*/
|
|
560
|
-
const ENVELOPE$1 = {
|
|
561
|
-
route: 0,
|
|
562
|
-
type: 1,
|
|
563
|
-
corr: 2,
|
|
564
|
-
time: 3,
|
|
565
|
-
originClient: 4,
|
|
566
|
-
payload: 5
|
|
567
|
-
};
|
|
568
|
-
const ENVELOPE_LENGTH$1 = 6;
|
|
569
|
-
/**
|
|
570
|
-
* How long a pending correlation entry is kept before it's swept. A correlation only matters until its
|
|
571
|
-
* action resolves or times out, so anything older than the longest realistic action timeout can be
|
|
572
|
-
* dropped — this bounds memory when requests time out or a connection dies mid-flight (their replies
|
|
573
|
-
* would never arrive, leaving the entry orphaned). Generous default so live correlations are never
|
|
574
|
-
* pruned (the default transport timeout is 10s).
|
|
575
|
-
*/
|
|
576
|
-
const DEFAULT_CORRELATION_TTL_MS = 5 * 6e4;
|
|
577
|
-
function isKnownIdentity(coordinate) {
|
|
578
|
-
return coordinate != null && coordinate.envId !== "_unset_";
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Drop entries older than `ttlMs`. Maps keep insertion order and entries are inserted in time order,
|
|
582
|
-
* so the oldest are first — stop sweeping at the first live entry.
|
|
583
|
-
*/
|
|
584
|
-
function pruneExpired(map, now, ttlMs) {
|
|
585
|
-
for (const [key, entry] of map) {
|
|
586
|
-
if (now - entry.time <= ttlMs) break;
|
|
587
|
-
map.delete(key);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* Builds a factory of *stateful, per-connection* codecs for {@link LinkTransport} /
|
|
592
|
-
* `AcceptorHandler` — the maximally compact binary wire. Call the returned factory once per live
|
|
593
|
-
* connection (each socket on the client, each accepted connection on the server) so every channel
|
|
594
|
-
* gets its own correlation + identity state.
|
|
595
|
-
*
|
|
596
|
-
* On top of everything {@link createBinaryWireAdapter} drops, a session also drops:
|
|
597
|
-
* - **`cuid`** — replaced by a per-connection integer correlation id. The initiator maps it to its
|
|
598
|
-
* real cuid; the responder echoes it; each side reconstructs the cuid from its own map. Correlation
|
|
599
|
-
* only needs to be unique per socket, so a counter suffices.
|
|
600
|
-
* - **`originClient` after the first request** — the first request each side sends carries its
|
|
601
|
-
* identity; the peer remembers it and injects it into later frames. Replies omit it entirely (a
|
|
602
|
-
* reply carries the initiator's own origin, which the initiator already knows).
|
|
603
|
-
*
|
|
604
|
-
* Both ends MUST build the factory from the same domains in the same order (positional dictionary).
|
|
605
|
-
* Text frames still return `undefined` from `incoming`, so JSON clients remain interoperable.
|
|
606
|
-
*
|
|
607
|
-
* Hibernation note: after a server connection is evicted its session resets, so a still-connected
|
|
608
|
-
* client (whose session persists) will keep omitting `originClient`. The server must therefore restore
|
|
609
|
-
* the connection→client binding from its own store (see `AcceptorHandler.rehydrateConnection`) and
|
|
610
|
-
* inject `originClient` from there — the session alone can't recover it.
|
|
611
|
-
*/
|
|
612
|
-
function createBinaryWireSessionFactory(domains, options) {
|
|
613
|
-
const { routeToInt, intToRoute } = buildActionRouteDictionary(domains);
|
|
614
|
-
const unknownIdentity = require_httpAcceptorCarrier.RuntimeCoordinate.unknown.toJsonObject();
|
|
615
|
-
const ttlMs = options?.correlationTtlMs ?? DEFAULT_CORRELATION_TTL_MS;
|
|
616
|
-
return () => {
|
|
617
|
-
let outCounter = 0;
|
|
618
|
-
const corrToCuid = /* @__PURE__ */ new Map();
|
|
619
|
-
const cuidToCorr = /* @__PURE__ */ new Map();
|
|
620
|
-
let selfIdentity;
|
|
621
|
-
let peerIdentity;
|
|
622
|
-
return {
|
|
623
|
-
outgoing: (input) => {
|
|
624
|
-
const json = input.action.toJsonObject();
|
|
625
|
-
const routeKey = `${json.domain}:${json.id}`;
|
|
626
|
-
const routeInt = routeToInt.get(routeKey);
|
|
627
|
-
if (routeInt == null) throw new Error(`[binary-wire] Cannot pack unregistered action route: ${routeKey}`);
|
|
628
|
-
const now = Date.now();
|
|
629
|
-
pruneExpired(corrToCuid, now, ttlMs);
|
|
630
|
-
pruneExpired(cuidToCorr, now, ttlMs);
|
|
631
|
-
let corr;
|
|
632
|
-
let wireIdentity;
|
|
633
|
-
if (json.type === "request") {
|
|
634
|
-
corr = outCounter++;
|
|
635
|
-
corrToCuid.set(corr, {
|
|
636
|
-
value: json.context.cuid,
|
|
637
|
-
time: now
|
|
638
|
-
});
|
|
639
|
-
if (selfIdentity == null && isKnownIdentity(json.context.originClient)) {
|
|
640
|
-
selfIdentity = json.context.originClient;
|
|
641
|
-
wireIdentity = json.context.originClient;
|
|
642
|
-
}
|
|
643
|
-
} else {
|
|
644
|
-
corr = cuidToCorr.get(json.context.cuid)?.value ?? -1;
|
|
645
|
-
if (json.type === "result") cuidToCorr.delete(json.context.cuid);
|
|
646
|
-
}
|
|
647
|
-
const envelope = new Array(ENVELOPE_LENGTH$1);
|
|
648
|
-
envelope[ENVELOPE$1.route] = routeInt;
|
|
649
|
-
envelope[ENVELOPE$1.type] = PayloadTypeToInt[json.type];
|
|
650
|
-
envelope[ENVELOPE$1.corr] = corr;
|
|
651
|
-
envelope[ENVELOPE$1.time] = json.time;
|
|
652
|
-
envelope[ENVELOPE$1.originClient] = wireIdentity;
|
|
653
|
-
envelope[ENVELOPE$1.payload] = extractWirePayload(json);
|
|
654
|
-
return (0, msgpackr.pack)(envelope);
|
|
655
|
-
},
|
|
656
|
-
incoming: (frame) => {
|
|
657
|
-
let buffer;
|
|
658
|
-
if (frame instanceof ArrayBuffer) buffer = new Uint8Array(frame);
|
|
659
|
-
else if (frame instanceof Uint8Array) buffer = frame;
|
|
660
|
-
else return;
|
|
661
|
-
try {
|
|
662
|
-
const envelope = (0, msgpackr.unpack)(buffer);
|
|
663
|
-
if (!Array.isArray(envelope) || envelope.length !== ENVELOPE_LENGTH$1) return void 0;
|
|
664
|
-
const routeMeta = intToRoute[envelope[ENVELOPE$1.route]];
|
|
665
|
-
const payloadType = ReversePayloadType[envelope[ENVELOPE$1.type]];
|
|
666
|
-
if (routeMeta == null || payloadType == null) return void 0;
|
|
667
|
-
const now = Date.now();
|
|
668
|
-
pruneExpired(corrToCuid, now, ttlMs);
|
|
669
|
-
pruneExpired(cuidToCorr, now, ttlMs);
|
|
670
|
-
const corr = envelope[ENVELOPE$1.corr];
|
|
671
|
-
const time = envelope[ENVELOPE$1.time];
|
|
672
|
-
const wireIdentity = envelope[ENVELOPE$1.originClient];
|
|
673
|
-
let cuid;
|
|
674
|
-
let originClient;
|
|
675
|
-
if (payloadType === "request") {
|
|
676
|
-
cuid = (0, nanoid.nanoid)();
|
|
677
|
-
cuidToCorr.set(cuid, {
|
|
678
|
-
value: corr,
|
|
679
|
-
time: now
|
|
680
|
-
});
|
|
681
|
-
if (isKnownIdentity(wireIdentity)) peerIdentity = wireIdentity;
|
|
682
|
-
originClient = peerIdentity ?? unknownIdentity;
|
|
683
|
-
} else {
|
|
684
|
-
cuid = corrToCuid.get(corr)?.value ?? (0, nanoid.nanoid)();
|
|
685
|
-
if (payloadType === "result") corrToCuid.delete(corr);
|
|
686
|
-
originClient = selfIdentity ?? unknownIdentity;
|
|
687
|
-
}
|
|
688
|
-
return assembleWireJson(routeMeta, payloadType, time, {
|
|
689
|
-
cuid,
|
|
690
|
-
timeCreated: time,
|
|
691
|
-
routing: [],
|
|
692
|
-
originClient
|
|
693
|
-
}, envelope[ENVELOPE$1.payload]);
|
|
694
|
-
} catch (e) {
|
|
695
|
-
console.error("[binary-wire] Failed to unpack binary action session frame", e);
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
//#endregion
|
|
703
|
-
//#region src/ActionRuntime/Channel/secureChannel.ts
|
|
704
|
-
/**
|
|
705
|
-
* Derive a stable wire-dictionary version from the ordered route list (FNV-1a over `domain:id,…`), so
|
|
706
|
-
* the version moves automatically whenever the transported domains change — a stale peer is then
|
|
707
|
-
* rejected by the handshake instead of silently misrouting a positionally-packed frame.
|
|
708
|
-
*/
|
|
709
|
-
function deriveDictionaryVersion(domains) {
|
|
710
|
-
const { intToRoute } = buildActionRouteDictionary(domains);
|
|
711
|
-
const signature = intToRoute.map((route) => `${route.domain}:${route.id}`).join(",");
|
|
712
|
-
let hash = 2166136261;
|
|
713
|
-
for (let i = 0; i < signature.length; i++) {
|
|
714
|
-
hash ^= signature.charCodeAt(i);
|
|
715
|
-
hash = Math.imul(hash, 16777619);
|
|
716
|
-
}
|
|
717
|
-
return `auto:${(hash >>> 0).toString(16).padStart(8, "0")}`;
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Bundle a secure channel's shared identity from its transported domains. Both ends MUST call this
|
|
721
|
-
* with the same domains in the same order (the binary wire dictionary is positional). The
|
|
722
|
-
* `dictionaryVersion` is derived from those domains unless you pin an explicit one.
|
|
723
|
-
*
|
|
724
|
-
* Declare the domains *by role* — `toAcceptor` (connector→acceptor requests) and `toConnector`
|
|
725
|
-
* (acceptor→connector pushes) — so the routing for both ends is derived from the channel (see
|
|
726
|
-
* {@link connectChannel} and `acceptChannelConnections`) instead of being restated at each end. The
|
|
727
|
-
* wire dictionary spans `[...toAcceptor, ...toConnector]` in that order; add new domains to the end of
|
|
728
|
-
* their list to keep older peers compatible. (`domains` is still accepted as a legacy alias for
|
|
729
|
-
* `toAcceptor`.)
|
|
730
|
-
*/
|
|
731
|
-
function defineSecureChannel(options) {
|
|
732
|
-
const base = require_httpAcceptorCarrier.defineChannel({
|
|
733
|
-
toAcceptor: options.toAcceptor,
|
|
734
|
-
toConnector: options.toConnector
|
|
735
|
-
});
|
|
736
|
-
const allDomains = [...base.toAcceptorDomains, ...base.toConnectorDomains];
|
|
737
|
-
return {
|
|
738
|
-
...base,
|
|
739
|
-
dictionaryVersion: options.dictionaryVersion ?? deriveDictionaryVersion(allDomains),
|
|
740
|
-
createCodec: createBinaryWireSessionFactory(allDomains, options.sessionOptions)
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
//#endregion
|
|
744
475
|
//#region src/ActionRuntime/Transport/Carrier/duplex/inMemory/createInMemoryChannel.ts
|
|
745
476
|
/**
|
|
746
477
|
* Two cross-wired in-process byte channels — a loopback carrier with no socket. The client end is a
|
|
@@ -798,9 +529,8 @@ function createInMemoryChannelPair() {
|
|
|
798
529
|
//#region src/ActionRuntime/Transport/Carrier/duplex/inMemory/inMemoryCarrier.ts
|
|
799
530
|
/**
|
|
800
531
|
* A loopback duplex carrier with no socket — two cross-wired in-process ends. The connector end is an
|
|
801
|
-
* {@link IDuplexCarrierSource} for
|
|
802
|
-
*
|
|
803
|
-
* non-WS carrier end to end.
|
|
532
|
+
* {@link IDuplexCarrierSource} for `connectChannel`; the acceptor end plugs into an `AcceptorHandler`.
|
|
533
|
+
* Ideal for tests and for running two runtimes in one process, or proving a non-WS carrier end to end.
|
|
804
534
|
*/
|
|
805
535
|
function inMemoryCarrier() {
|
|
806
536
|
const { clientChannel, serverEndpoint } = createInMemoryChannelPair();
|
|
@@ -886,8 +616,8 @@ async function normalizeFrame$1(data) {
|
|
|
886
616
|
//#region src/ActionRuntime/Transport/Carrier/duplex/rtc/rtcCarrier.ts
|
|
887
617
|
/**
|
|
888
618
|
* A WebRTC {@link IDuplexCarrierSource} over an already-negotiated `RTCDataChannel` (signaling is the
|
|
889
|
-
* app's concern).
|
|
890
|
-
* identical secure session as a WebSocket.
|
|
619
|
+
* app's concern). Pass it as a `carrier` to `connectChannel` so two browsers/apps linked peer-to-peer run
|
|
620
|
+
* the identical secure session as a WebSocket.
|
|
891
621
|
*/
|
|
892
622
|
function rtcCarrier(dataChannel, options = {}) {
|
|
893
623
|
return {
|
|
@@ -905,7 +635,7 @@ let EErrId_NiceTransport_WebSocket = /* @__PURE__ */ function(EErrId_NiceTranspo
|
|
|
905
635
|
EErrId_NiceTransport_WebSocket["ws_error"] = "ws_error";
|
|
906
636
|
return EErrId_NiceTransport_WebSocket;
|
|
907
637
|
}({});
|
|
908
|
-
const err_nice_transport_ws =
|
|
638
|
+
const err_nice_transport_ws = require_createHibernatableWsServerAdapter.err_nice_transport.createChildDomain({
|
|
909
639
|
domain: "ws_transport",
|
|
910
640
|
schema: {
|
|
911
641
|
["ws_disconnected"]: (0, _nice_code_error.err)({ message: () => `WebSocket transport disconnected.` }),
|
|
@@ -1004,20 +734,26 @@ async function normalizeFrame(data) {
|
|
|
1004
734
|
//#endregion
|
|
1005
735
|
//#region src/ActionRuntime/Transport/Carrier/duplex/ws/wsCarrier.ts
|
|
1006
736
|
/**
|
|
1007
|
-
* A WebSocket {@link IDuplexCarrierSource}: opens an `arraybuffer` socket
|
|
1008
|
-
*
|
|
1009
|
-
*
|
|
737
|
+
* A WebSocket {@link IDuplexCarrierSource}: opens an `arraybuffer` socket (cached per endpoint) and adapts
|
|
738
|
+
* it to a carrier. Pass it as a `carrier` to `connectChannel` — the WebSocket is now "just another
|
|
739
|
+
* carrier" under the shared secure session, with no WS-specific transport class.
|
|
740
|
+
*
|
|
741
|
+
* `createRequest` derives the socket URL per action (keep it simple with `() => ({ url })`), so dynamic
|
|
742
|
+
* endpoints (e.g. a per-run query param) need no `createWebSocket` escape hatch.
|
|
1010
743
|
*/
|
|
1011
|
-
function wsCarrier(
|
|
744
|
+
function wsCarrier(createRequest, options = {}) {
|
|
1012
745
|
return {
|
|
1013
746
|
carrierLabel: "ws",
|
|
1014
|
-
open: (input) => webSocketByteChannel(
|
|
1015
|
-
getCacheKey: options.getTransportCacheKey ?? (() => [url]),
|
|
1016
|
-
getRouteInfo: options.getRouteInfo ?? (() =>
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
747
|
+
open: (input) => webSocketByteChannel(defaultWebSocket(createRequest(input).url)),
|
|
748
|
+
getCacheKey: options.getTransportCacheKey ?? ((input) => [createRequest(input).url]),
|
|
749
|
+
getRouteInfo: options.getRouteInfo ?? ((input) => {
|
|
750
|
+
const { url } = createRequest(input);
|
|
751
|
+
return {
|
|
752
|
+
carrierLabel: "ws",
|
|
753
|
+
url,
|
|
754
|
+
summary: `ws ${shortWs(url)}`
|
|
755
|
+
};
|
|
756
|
+
})
|
|
1021
757
|
};
|
|
1022
758
|
}
|
|
1023
759
|
function defaultWebSocket(url) {
|
|
@@ -1036,9 +772,10 @@ function shortPath(url) {
|
|
|
1036
772
|
}
|
|
1037
773
|
/**
|
|
1038
774
|
* An HTTP {@link IExchangeCarrierSource}: each `exchange` POSTs one frame body to the action endpoint and
|
|
1039
|
-
* resolves with the response body as the single correlated reply.
|
|
1040
|
-
* HTTP then runs the *same* secure session as a duplex carrier
|
|
1041
|
-
* the request/reply correlation provided for free by the HTTP
|
|
775
|
+
* resolves with the response body as the single correlated reply. Pass it as a `carrier` to
|
|
776
|
+
* `connectChannel` — a secure HTTP transport then runs the *same* secure session as a duplex carrier
|
|
777
|
+
* (handshake → token → encrypted frames), the request/reply correlation provided for free by the HTTP
|
|
778
|
+
* transaction.
|
|
1042
779
|
*
|
|
1043
780
|
* `createRequest` derives the URL/headers per action (keep it simple with `() => ({ url })`). The body is
|
|
1044
781
|
* the session's responsibility, so it is never built here.
|
|
@@ -1078,160 +815,49 @@ function httpCarrier(createRequest, options = {}) {
|
|
|
1078
815
|
};
|
|
1079
816
|
}
|
|
1080
817
|
//#endregion
|
|
1081
|
-
//#region src/ActionRuntime/Transport/codec/createBinaryWireAdapter.ts
|
|
1082
|
-
/**
|
|
1083
|
-
* Positional layout of the stateless binary envelope. A flat tuple (rather than an object) strips the
|
|
1084
|
-
* repeated `domain`/`id`/`form`/`type` and context key names from every frame, and we carry only the
|
|
1085
|
-
* context fields the receiver can't recompute: `cuid` (correlation) and `originClient` (return
|
|
1086
|
-
* routing).
|
|
1087
|
-
*
|
|
1088
|
-
* [ routeInt, typeInt, time, cuid, originClient, payloadData ]
|
|
1089
|
-
*
|
|
1090
|
-
* Dropped vs the JSON wire: `form`/`type` strings, `inputHash`/`outputHash` (recomputed on hydrate),
|
|
1091
|
-
* `context.timeCreated` (reconstructed from `time`) and `context.routing` (rebuilt empty — the
|
|
1092
|
-
* receiver re-stamps its own route items as it handles the action). For the leanest possible frames
|
|
1093
|
-
* (integer correlation, identity dropped after a handshake), use `createBinaryWireSessionFactory`.
|
|
1094
|
-
*/
|
|
1095
|
-
const ENVELOPE = {
|
|
1096
|
-
route: 0,
|
|
1097
|
-
type: 1,
|
|
1098
|
-
time: 2,
|
|
1099
|
-
cuid: 3,
|
|
1100
|
-
originClient: 4,
|
|
1101
|
-
payload: 5
|
|
1102
|
-
};
|
|
1103
|
-
const ENVELOPE_LENGTH = 6;
|
|
1104
|
-
/**
|
|
1105
|
-
* Builds a *stateless* `formatMessage` pipeline for {@link LinkTransport}, packing action
|
|
1106
|
-
* payloads into a compact msgpackr binary frame instead of JSON. The `domain`/`id` route collapses to
|
|
1107
|
-
* a single integer drawn from a shared dictionary; `form`/`type`, the recomputable
|
|
1108
|
-
* `inputHash`/`outputHash`, and the per-frame `context.routing`/`context.timeCreated` are all dropped
|
|
1109
|
-
* (see {@link ENVELOPE}).
|
|
1110
|
-
*
|
|
1111
|
-
* No validation runs here: `incoming` blindly reconstructs the wire JSON shape and hands it back to
|
|
1112
|
-
* the connection, which flows into `ActionRuntime` → `domain.hydrateAnyAction()` where the Valibot
|
|
1113
|
-
* schemas validate it exactly as they would for a JSON frame.
|
|
1114
|
-
*
|
|
1115
|
-
* Both ends of the socket MUST construct the adapter with the same domains in the same order — the
|
|
1116
|
-
* integer dictionary is positional. Mismatched dictionaries will route to the wrong action.
|
|
1117
|
-
*
|
|
1118
|
-
* Because `incoming` returns `undefined` for text frames, a binary server can still serve plain-JSON
|
|
1119
|
-
* clients on the same runtime (the connection falls back to its built-in JSON parser).
|
|
1120
|
-
*/
|
|
1121
|
-
function createBinaryWireAdapter(domains) {
|
|
1122
|
-
const { routeToInt, intToRoute } = buildActionRouteDictionary(domains);
|
|
1123
|
-
return {
|
|
1124
|
-
outgoing: (input) => {
|
|
1125
|
-
const json = input.action.toJsonObject();
|
|
1126
|
-
const routeKey = `${json.domain}:${json.id}`;
|
|
1127
|
-
const routeInt = routeToInt.get(routeKey);
|
|
1128
|
-
if (routeInt == null) throw new Error(`[binary-wire] Cannot pack unregistered action route: ${routeKey}`);
|
|
1129
|
-
const envelope = new Array(ENVELOPE_LENGTH);
|
|
1130
|
-
envelope[ENVELOPE.route] = routeInt;
|
|
1131
|
-
envelope[ENVELOPE.type] = PayloadTypeToInt[json.type];
|
|
1132
|
-
envelope[ENVELOPE.time] = json.time;
|
|
1133
|
-
envelope[ENVELOPE.cuid] = json.context.cuid;
|
|
1134
|
-
envelope[ENVELOPE.originClient] = json.context.originClient;
|
|
1135
|
-
envelope[ENVELOPE.payload] = extractWirePayload(json);
|
|
1136
|
-
return (0, msgpackr.pack)(envelope);
|
|
1137
|
-
},
|
|
1138
|
-
incoming: (frame) => {
|
|
1139
|
-
let buffer;
|
|
1140
|
-
if (frame instanceof ArrayBuffer) buffer = new Uint8Array(frame);
|
|
1141
|
-
else if (frame instanceof Uint8Array) buffer = frame;
|
|
1142
|
-
else return;
|
|
1143
|
-
try {
|
|
1144
|
-
const envelope = (0, msgpackr.unpack)(buffer);
|
|
1145
|
-
if (!Array.isArray(envelope) || envelope.length !== ENVELOPE_LENGTH) return void 0;
|
|
1146
|
-
const routeMeta = intToRoute[envelope[ENVELOPE.route]];
|
|
1147
|
-
const payloadType = ReversePayloadType[envelope[ENVELOPE.type]];
|
|
1148
|
-
if (routeMeta == null || payloadType == null) return void 0;
|
|
1149
|
-
const time = envelope[ENVELOPE.time];
|
|
1150
|
-
return assembleWireJson(routeMeta, payloadType, time, {
|
|
1151
|
-
cuid: envelope[ENVELOPE.cuid],
|
|
1152
|
-
timeCreated: time,
|
|
1153
|
-
routing: [],
|
|
1154
|
-
originClient: envelope[ENVELOPE.originClient]
|
|
1155
|
-
}, envelope[ENVELOPE.payload]);
|
|
1156
|
-
} catch (e) {
|
|
1157
|
-
console.error("[binary-wire] Failed to unpack binary action frame", e);
|
|
1158
|
-
return;
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
};
|
|
1162
|
-
}
|
|
1163
|
-
//#endregion
|
|
1164
|
-
exports.AcceptorHandler = require_httpAcceptorCarrier.AcceptorHandler;
|
|
1165
818
|
exports.ActionCore = ActionCore;
|
|
1166
819
|
exports.ActionDomain = ActionDomain;
|
|
1167
|
-
exports.ActionLocalHandler =
|
|
820
|
+
exports.ActionLocalHandler = require_createHibernatableWsServerAdapter.ActionLocalHandler;
|
|
1168
821
|
exports.ActionRootDomain = ActionRootDomain;
|
|
1169
|
-
exports.ActionRuntime =
|
|
1170
|
-
exports.ActionSchema =
|
|
1171
|
-
exports.
|
|
1172
|
-
exports.
|
|
1173
|
-
exports.
|
|
1174
|
-
exports.
|
|
1175
|
-
exports.
|
|
1176
|
-
exports.EErrId_NiceAction = require_httpAcceptorCarrier.EErrId_NiceAction;
|
|
1177
|
-
exports.EErrId_NiceTransport = require_httpAcceptorCarrier.EErrId_NiceTransport;
|
|
822
|
+
exports.ActionRuntime = require_createHibernatableWsServerAdapter.ActionRuntime;
|
|
823
|
+
exports.ActionSchema = require_createHibernatableWsServerAdapter.ActionSchema;
|
|
824
|
+
exports.EActionPayloadType = require_createHibernatableWsServerAdapter.EActionPayloadType;
|
|
825
|
+
exports.EActionProgressType = require_createHibernatableWsServerAdapter.EActionProgressType;
|
|
826
|
+
exports.EActionResponseMode = require_createHibernatableWsServerAdapter.EActionResponseMode;
|
|
827
|
+
exports.EErrId_NiceAction = require_createHibernatableWsServerAdapter.EErrId_NiceAction;
|
|
828
|
+
exports.EErrId_NiceTransport = require_createHibernatableWsServerAdapter.EErrId_NiceTransport;
|
|
1178
829
|
exports.EErrId_NiceTransport_WebSocket = EErrId_NiceTransport_WebSocket;
|
|
1179
|
-
exports.EHandshakeMessageType = require_httpAcceptorCarrier.EHandshakeMessageType;
|
|
1180
830
|
exports.ERunningActionFinishedType = require_RunningAction_types.ERunningActionFinishedType;
|
|
1181
831
|
exports.ERunningActionState = require_RunningAction_types.ERunningActionState;
|
|
1182
832
|
exports.ERunningActionUpdateType = require_RunningAction_types.ERunningActionUpdateType;
|
|
1183
|
-
exports.ESecurityLevel =
|
|
1184
|
-
exports.
|
|
1185
|
-
exports.
|
|
1186
|
-
exports.ExchangeAcceptor = require_httpAcceptorCarrier.ExchangeAcceptor;
|
|
1187
|
-
exports.ExchangeTransport = require_httpAcceptorCarrier.ExchangeTransport;
|
|
1188
|
-
exports.LinkTransport = require_httpAcceptorCarrier.LinkTransport;
|
|
1189
|
-
exports.PeerLinkHandler = require_httpAcceptorCarrier.PeerLinkHandler;
|
|
1190
|
-
exports.RunningAction = require_httpAcceptorCarrier.RunningAction;
|
|
1191
|
-
exports.RuntimeCoordinate = require_httpAcceptorCarrier.RuntimeCoordinate;
|
|
1192
|
-
exports.Transport = require_httpAcceptorCarrier.Transport;
|
|
833
|
+
exports.ESecurityLevel = require_createHibernatableWsServerAdapter.ESecurityLevel;
|
|
834
|
+
exports.RunningAction = require_createHibernatableWsServerAdapter.RunningAction;
|
|
835
|
+
exports.RuntimeCoordinate = require_createHibernatableWsServerAdapter.RuntimeCoordinate;
|
|
1193
836
|
exports.acceptChannel = require_httpAcceptorCarrier.acceptChannel;
|
|
1194
837
|
exports.acceptChannelConnections = require_httpAcceptorCarrier.acceptChannelConnections;
|
|
1195
|
-
exports.actionSchema =
|
|
838
|
+
exports.actionSchema = require_createHibernatableWsServerAdapter.actionSchema;
|
|
1196
839
|
exports.connectChannel = require_httpAcceptorCarrier.connectChannel;
|
|
1197
|
-
exports.createAcceptorHandler = require_httpAcceptorCarrier.createAcceptorHandler;
|
|
1198
|
-
exports.createActionFetchHandler = require_httpAcceptorCarrier.createActionFetchHandler;
|
|
1199
|
-
exports.createActionFrameCrypto = require_httpAcceptorCarrier.createActionFrameCrypto;
|
|
1200
840
|
exports.createActionRootDomain = createActionRootDomain;
|
|
1201
|
-
exports.createBinaryWireAdapter = createBinaryWireAdapter;
|
|
1202
|
-
exports.createBinaryWireSessionFactory = createBinaryWireSessionFactory;
|
|
1203
|
-
exports.createClientHandshake = require_httpAcceptorCarrier.createClientHandshake;
|
|
1204
|
-
exports.createConnectionStateStore = require_httpAcceptorCarrier.createConnectionStateStore;
|
|
1205
|
-
exports.createConnectorHandler = require_httpAcceptorCarrier.createConnectorHandler;
|
|
1206
|
-
exports.createHibernatableWsServerAdapter = require_httpAcceptorCarrier.createHibernatableWsServerAdapter;
|
|
1207
841
|
exports.createInMemoryChannelPair = createInMemoryChannelPair;
|
|
1208
|
-
exports.createInMemoryTofuVerifyKeyResolver =
|
|
1209
|
-
exports.createLocalHandler =
|
|
1210
|
-
exports.
|
|
1211
|
-
exports.
|
|
1212
|
-
exports.createStorageTofuVerifyKeyResolver = require_httpAcceptorCarrier.createStorageTofuVerifyKeyResolver;
|
|
1213
|
-
exports.decodeActionFrame = require_httpAcceptorCarrier.decodeActionFrame;
|
|
1214
|
-
exports.decodeExchangeReply = require_httpAcceptorCarrier.decodeExchangeReply;
|
|
1215
|
-
exports.decodeExchangeRequest = require_httpAcceptorCarrier.decodeExchangeRequest;
|
|
1216
|
-
exports.decodeHandshakeMessage = require_httpAcceptorCarrier.decodeHandshakeMessage;
|
|
842
|
+
exports.createInMemoryTofuVerifyKeyResolver = require_createHibernatableWsServerAdapter.createInMemoryTofuVerifyKeyResolver;
|
|
843
|
+
exports.createLocalHandler = require_createHibernatableWsServerAdapter.createLocalHandler;
|
|
844
|
+
exports.createStorageTofuVerifyKeyResolver = require_createHibernatableWsServerAdapter.createStorageTofuVerifyKeyResolver;
|
|
845
|
+
exports.decodeActionFrame = require_createHibernatableWsServerAdapter.decodeActionFrame;
|
|
1217
846
|
exports.defineChannel = require_httpAcceptorCarrier.defineChannel;
|
|
1218
|
-
exports.
|
|
1219
|
-
exports.
|
|
1220
|
-
exports.
|
|
1221
|
-
exports.err_nice_action = require_httpAcceptorCarrier.err_nice_action;
|
|
1222
|
-
exports.err_nice_external_client = require_httpAcceptorCarrier.err_nice_external_client;
|
|
1223
|
-
exports.err_nice_transport = require_httpAcceptorCarrier.err_nice_transport;
|
|
847
|
+
exports.err_nice_action = require_createHibernatableWsServerAdapter.err_nice_action;
|
|
848
|
+
exports.err_nice_external_client = require_createHibernatableWsServerAdapter.err_nice_external_client;
|
|
849
|
+
exports.err_nice_transport = require_createHibernatableWsServerAdapter.err_nice_transport;
|
|
1224
850
|
exports.err_nice_transport_ws = err_nice_transport_ws;
|
|
1225
851
|
exports.httpAcceptorCarrier = require_httpAcceptorCarrier.httpAcceptorCarrier;
|
|
1226
852
|
exports.httpCarrier = httpCarrier;
|
|
1227
853
|
exports.inMemoryCarrier = inMemoryCarrier;
|
|
1228
|
-
exports.isActionPayload_Any_JsonObject =
|
|
1229
|
-
exports.isActionPayload_Request_JsonObject =
|
|
1230
|
-
exports.isActionPayload_Result_JsonObject =
|
|
854
|
+
exports.isActionPayload_Any_JsonObject = require_createHibernatableWsServerAdapter.isActionPayload_Any_JsonObject;
|
|
855
|
+
exports.isActionPayload_Request_JsonObject = require_createHibernatableWsServerAdapter.isActionPayload_Request_JsonObject;
|
|
856
|
+
exports.isActionPayload_Result_JsonObject = require_createHibernatableWsServerAdapter.isActionPayload_Result_JsonObject;
|
|
1231
857
|
exports.isExchangeAcceptorCarrier = require_httpAcceptorCarrier.isExchangeAcceptorCarrier;
|
|
1232
858
|
exports.rtcCarrier = rtcCarrier;
|
|
1233
859
|
exports.rtcDataChannelByteChannel = rtcDataChannelByteChannel;
|
|
1234
|
-
exports.runtimeLinkId =
|
|
860
|
+
exports.runtimeLinkId = require_createHibernatableWsServerAdapter.runtimeLinkId;
|
|
1235
861
|
exports.serveChannel = require_httpAcceptorCarrier.serveChannel;
|
|
1236
862
|
exports.serveHost = require_httpAcceptorCarrier.serveHost;
|
|
1237
863
|
exports.wsAcceptorCarrier = require_httpAcceptorCarrier.wsAcceptorCarrier;
|