@moltzap/client 2026.930.0 → 2026.1001.1
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/daemon/configuration.d.ts +18 -6
- package/dist/daemon/configuration.d.ts.map +1 -1
- package/dist/daemon/configuration.js +15 -9
- package/dist/daemon/configuration.js.map +1 -1
- package/dist/daemon/management.d.ts.map +1 -1
- package/dist/daemon/management.js +2 -0
- package/dist/daemon/management.js.map +1 -1
- package/dist/daemon/registration.d.ts +18 -3
- package/dist/daemon/registration.d.ts.map +1 -1
- package/dist/daemon/registration.js +17 -2
- package/dist/daemon/registration.js.map +1 -1
- package/dist/endpoint/engine-types.d.ts +1 -1
- package/dist/endpoint/engine-types.d.ts.map +1 -1
- package/dist/endpoint/engine.d.ts.map +1 -1
- package/dist/endpoint/engine.js +64 -33
- package/dist/endpoint/engine.js.map +1 -1
- package/dist/endpoint/recovery/index.d.ts +5 -0
- package/dist/endpoint/recovery/index.d.ts.map +1 -1
- package/dist/endpoint/recovery/index.js +39 -38
- package/dist/endpoint/recovery/index.js.map +1 -1
- package/dist/endpoint/recovery/reanchor/index.js +26 -5
- package/dist/endpoint/recovery/reanchor/index.js.map +1 -1
- package/dist/endpoint/recovery/state.d.ts +7 -1
- package/dist/endpoint/recovery/state.d.ts.map +1 -1
- package/dist/endpoint/recovery/state.js +3 -1
- package/dist/endpoint/recovery/state.js.map +1 -1
- package/dist/endpoint/recovery/store.d.ts +8 -1
- package/dist/endpoint/recovery/store.d.ts.map +1 -1
- package/dist/endpoint/recovery/store.js +18 -0
- package/dist/endpoint/recovery/store.js.map +1 -1
- package/dist/endpoint/router-worker/index.d.ts +6 -2
- package/dist/endpoint/router-worker/index.d.ts.map +1 -1
- package/dist/endpoint/router-worker/index.js +48 -16
- package/dist/endpoint/router-worker/index.js.map +1 -1
- package/dist/endpoint/router-worker/outage.d.ts +87 -0
- package/dist/endpoint/router-worker/outage.d.ts.map +1 -0
- package/dist/endpoint/router-worker/outage.js +178 -0
- package/dist/endpoint/router-worker/outage.js.map +1 -0
- package/dist/endpoint/router-worker/types.d.ts +73 -8
- package/dist/endpoint/router-worker/types.d.ts.map +1 -1
- package/dist/endpoint/router-worker/types.js +50 -3
- package/dist/endpoint/router-worker/types.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +18 -0
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Router outage handling: classifying Router client failures as outages
|
|
3
|
+
* or rejections, and the worker's detachment, reattachment, and warnings.
|
|
4
|
+
*/
|
|
5
|
+
import { Clock, Effect, Option, Ref, Schedule, Stream } from "effect";
|
|
6
|
+
import { isTransientRouterWorkerError, routerWorkerBlipSchedule, routerWorkerDetachedReportInterval, RouterWorkerRejectedError, RouterWorkerTransportError, } from "./types.js";
|
|
7
|
+
const transportFailure = () => new RouterWorkerTransportError();
|
|
8
|
+
const rejectedFailure = (reason) => () => new RouterWorkerRejectedError({ reason });
|
|
9
|
+
/**
|
|
10
|
+
* Outage-shaped Router failures (unreachable, timed out, 429, 5xx) are
|
|
11
|
+
* transport failures the worker waits out. A refusal of the request itself
|
|
12
|
+
* (401, 412 version mismatch, other 4xx, an undecodable answer, or a local
|
|
13
|
+
* signing failure) cannot succeed on retry and is a rejection.
|
|
14
|
+
*/
|
|
15
|
+
const routerFailureByTag = {
|
|
16
|
+
AgentSigningError: rejectedFailure("signing"),
|
|
17
|
+
AuthenticationFailedError: rejectedFailure("authentication"),
|
|
18
|
+
InternalServerError: transportFailure,
|
|
19
|
+
MalformedRequestError: rejectedFailure("request"),
|
|
20
|
+
MethodNotAllowedError: rejectedFailure("request"),
|
|
21
|
+
OverloadedError: transportFailure,
|
|
22
|
+
PayloadTooLargeError: rejectedFailure("request"),
|
|
23
|
+
RouteNotFoundError: rejectedFailure("request"),
|
|
24
|
+
RouterConnectionError: transportFailure,
|
|
25
|
+
RouterInvalidResponseError: rejectedFailure("response"),
|
|
26
|
+
RouterRequestTimeoutError: transportFailure,
|
|
27
|
+
UnavailableError: transportFailure,
|
|
28
|
+
UnsupportedMediaTypeError: rejectedFailure("request"),
|
|
29
|
+
VersionMismatchError: rejectedFailure("version"),
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Classify one Router client failure as an outage or a rejection.
|
|
33
|
+
* @param error Failure the Router client raised.
|
|
34
|
+
* @returns The worker failure it maps to.
|
|
35
|
+
*/
|
|
36
|
+
export const mapRouterFailure = (error) => routerFailureByTag[error._tag]();
|
|
37
|
+
/**
|
|
38
|
+
* Whether a worker failure is a Router outage rather than a rejection.
|
|
39
|
+
* @param error Any tagged worker failure.
|
|
40
|
+
* @returns True for `RouterWorkerTransportError`.
|
|
41
|
+
*/
|
|
42
|
+
export const isTransportFailure = (error) => error._tag === "RouterWorkerTransportError";
|
|
43
|
+
/** Quick retries of one Router poll, for transport failures only. */
|
|
44
|
+
export const pollBlipRetry = routerWorkerBlipSchedule.pipe(Schedule.whileInput(isTransportFailure));
|
|
45
|
+
const secondsSince = (since) => Clock.currentTimeMillis.pipe(Effect.map((now) => Math.round((now - since) / 1000)));
|
|
46
|
+
const logDetached = (state) => Effect.logWarning("Router unreachable: worker detached; sends wait until it answers").pipe(Effect.annotateLogs({
|
|
47
|
+
generation: state.generation,
|
|
48
|
+
routerInstanceId: state.anchor.routerInstanceId,
|
|
49
|
+
}));
|
|
50
|
+
const logReattached = (state) => secondsSince(state.detachedAt).pipe(Effect.flatMap((seconds) => Effect.logInfo(`Router answered: worker reattached after ${String(seconds)} s`).pipe(Effect.annotateLogs({
|
|
51
|
+
generation: state.generation,
|
|
52
|
+
routerInstanceId: state.anchor.routerInstanceId,
|
|
53
|
+
detachedSeconds: seconds,
|
|
54
|
+
}))));
|
|
55
|
+
/**
|
|
56
|
+
* Mark the worker detached after a poll issued at `generation` lost the
|
|
57
|
+
* Router through its quick retries, so sends and the outbound drain wait for
|
|
58
|
+
* the next answered poll instead of transmitting. A generation that recovery
|
|
59
|
+
* has since replaced stays as it is.
|
|
60
|
+
* @param runtime Worker whose poll lost the Router.
|
|
61
|
+
* @param generation Generation the failed poll was issued from.
|
|
62
|
+
* @returns Completion once a matching active state is detached.
|
|
63
|
+
*/
|
|
64
|
+
export const detach = (runtime, generation) => Clock.currentTimeMillis.pipe(Effect.flatMap((detachedAt) => runtime.stateGate.withPermits(1)(Ref.modify(runtime.state, (state) => {
|
|
65
|
+
if (state.kind !== "active" || state.generation !== generation) {
|
|
66
|
+
return [Option.none(), state];
|
|
67
|
+
}
|
|
68
|
+
const detached = {
|
|
69
|
+
...state,
|
|
70
|
+
kind: "detached",
|
|
71
|
+
detachedAt,
|
|
72
|
+
};
|
|
73
|
+
return [Option.some(detached), detached];
|
|
74
|
+
}))), Effect.flatMap(Option.match({ onNone: () => Effect.void, onSome: logDetached })));
|
|
75
|
+
const stallOf = (state) => {
|
|
76
|
+
switch (state.kind) {
|
|
77
|
+
case "active":
|
|
78
|
+
return Option.none();
|
|
79
|
+
case "detached":
|
|
80
|
+
return Option.some({
|
|
81
|
+
kind: "detached",
|
|
82
|
+
generation: state.generation,
|
|
83
|
+
since: state.detachedAt,
|
|
84
|
+
});
|
|
85
|
+
case "recovering":
|
|
86
|
+
return Option.map(state.unreachableSince, (since) => ({
|
|
87
|
+
kind: "recovering",
|
|
88
|
+
generation: state.generation,
|
|
89
|
+
since,
|
|
90
|
+
}));
|
|
91
|
+
default: {
|
|
92
|
+
const exhaustive = state;
|
|
93
|
+
return exhaustive;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const sameStall = Option.getEquivalence((left, right) => left.kind === right.kind &&
|
|
98
|
+
left.generation === right.generation &&
|
|
99
|
+
left.since === right.since);
|
|
100
|
+
const stallText = {
|
|
101
|
+
detached: "worker detached",
|
|
102
|
+
recovering: "recovery waiting",
|
|
103
|
+
};
|
|
104
|
+
const logStillStalled = (stall) => secondsSince(stall.since).pipe(Effect.flatMap((seconds) => Effect.logWarning(`Router still unreachable: ${stallText[stall.kind]} for ${String(seconds)} s`).pipe(Effect.annotateLogs({
|
|
105
|
+
generation: stall.generation,
|
|
106
|
+
unreachableSeconds: seconds,
|
|
107
|
+
}))));
|
|
108
|
+
/**
|
|
109
|
+
* Repeat a warning every `routerWorkerDetachedReportInterval` for as long as
|
|
110
|
+
* the worker waits on an unreachable Router, detached or recovering, so an
|
|
111
|
+
* outage is never silent however long it lasts.
|
|
112
|
+
* @param runtime Worker whose state is watched.
|
|
113
|
+
* @returns A watcher that runs for the worker's lifetime.
|
|
114
|
+
*/
|
|
115
|
+
export const reportUnreachable = (runtime) => runtime.state.changes.pipe(Stream.map(stallOf), Stream.changesWith(sameStall), Stream.flatMap(Option.match({
|
|
116
|
+
onNone: () => Stream.empty,
|
|
117
|
+
onSome: (stall) => Stream.tick(routerWorkerDetachedReportInterval).pipe(Stream.drop(1), Stream.mapEffect(() => logStillStalled(stall))),
|
|
118
|
+
}), { switch: true }), Stream.runDrain);
|
|
119
|
+
/**
|
|
120
|
+
* One line naming why the worker or the outbound drain failed; a Router
|
|
121
|
+
* rejection names what the Router refused.
|
|
122
|
+
* @param error Poll or send failure.
|
|
123
|
+
* @returns Human-readable reason for the log.
|
|
124
|
+
*/
|
|
125
|
+
export const describeRouterWorkerFailure = (error) => error._tag === "RouterWorkerRejectedError"
|
|
126
|
+
? `the Router rejected this endpoint's ${error.reason}`
|
|
127
|
+
: error._tag;
|
|
128
|
+
const markUnreachable = (state, error, now) => state.kind === "recovering" &&
|
|
129
|
+
isTransportFailure(error) &&
|
|
130
|
+
Option.isNone(state.unreachableSince)
|
|
131
|
+
? { ...state, unreachableSince: Option.some(now) }
|
|
132
|
+
: state;
|
|
133
|
+
const logRecoveryAttemptFailed = (state, error) => state.kind === "recovering"
|
|
134
|
+
? Effect.logWarning(`Router recovery attempt failed, retrying: ${describeRouterWorkerFailure(error)}`).pipe(Effect.annotateLogs({
|
|
135
|
+
generation: state.generation,
|
|
136
|
+
reason: state.reason,
|
|
137
|
+
}))
|
|
138
|
+
: Effect.void;
|
|
139
|
+
/**
|
|
140
|
+
* Report a failed poll-loop step before the loop retries or ends: a fatal
|
|
141
|
+
* failure logs why the daemon exits, and a failed recovery attempt warns and
|
|
142
|
+
* marks when the Router was first unreachable.
|
|
143
|
+
* @param runtime Worker whose step failed.
|
|
144
|
+
* @param error The step's failure.
|
|
145
|
+
* @returns Completion once the failure is logged and recorded.
|
|
146
|
+
*/
|
|
147
|
+
export const noteRunFailure = (runtime, error) => isTransientRouterWorkerError(error)
|
|
148
|
+
? Clock.currentTimeMillis.pipe(Effect.flatMap((now) => runtime.stateGate.withPermits(1)(Ref.updateAndGet(runtime.state, (state) => markUnreachable(state, error, now)))), Effect.flatMap((state) => logRecoveryAttemptFailed(state, error)))
|
|
149
|
+
: Effect.logError(`Router worker stopping, daemon exits: ${describeRouterWorkerFailure(error)}`);
|
|
150
|
+
/**
|
|
151
|
+
* Warn that a worker that had lost the Router now recovers from a
|
|
152
|
+
* discontinuity its first answered probe revealed.
|
|
153
|
+
* @param state The new recovering state.
|
|
154
|
+
* @returns Completion once logged.
|
|
155
|
+
*/
|
|
156
|
+
export const logRecoveryAfterLoss = (state) => Effect.logWarning(`Router answered after a loss with ${state.reason}: recovering`).pipe(Effect.annotateLogs({ generation: state.generation }));
|
|
157
|
+
/**
|
|
158
|
+
* Note that certified-history recovery finished and the worker is active.
|
|
159
|
+
* @param state The recovering state recovery completed.
|
|
160
|
+
* @returns Completion once logged.
|
|
161
|
+
*/
|
|
162
|
+
export const logRecoveryComplete = (state) => Effect.logInfo(`Router recovery complete after ${state.reason}`).pipe(Effect.annotateLogs({ generation: state.generation }));
|
|
163
|
+
/**
|
|
164
|
+
* Mark a detached worker active again at its retained anchor, unless another
|
|
165
|
+
* generation replaced it meanwhile.
|
|
166
|
+
* @param runtime Worker whose probe the Router answered.
|
|
167
|
+
* @param snapshot Detached state the probe was issued from.
|
|
168
|
+
* @returns Completion once the worker is active or left as it was.
|
|
169
|
+
*/
|
|
170
|
+
export const reattach = (runtime, snapshot) => runtime.stateGate.withPermits(1)(Ref.get(runtime.state).pipe(Effect.flatMap((current) => current.kind === "detached" &&
|
|
171
|
+
current.generation === snapshot.generation
|
|
172
|
+
? Ref.set(runtime.state, {
|
|
173
|
+
kind: "active",
|
|
174
|
+
generation: current.generation,
|
|
175
|
+
anchor: current.anchor,
|
|
176
|
+
}).pipe(Effect.zipRight(logReattached(current)))
|
|
177
|
+
: Effect.void)));
|
|
178
|
+
//# sourceMappingURL=outage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outage.js","sourceRoot":"","sources":["../../../src/endpoint/router-worker/outage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAIlC,yBAAyB,EAKzB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAepB,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,IAAI,0BAA0B,EAAE,CAAC;AAChE,MAAM,eAAe,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,GAAG,EAAE,CAC5E,IAAI,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG;IACzB,iBAAiB,EAAE,eAAe,CAAC,SAAS,CAAC;IAC7C,yBAAyB,EAAE,eAAe,CAAC,gBAAgB,CAAC;IAC5D,mBAAmB,EAAE,gBAAgB;IACrC,qBAAqB,EAAE,eAAe,CAAC,SAAS,CAAC;IACjD,qBAAqB,EAAE,eAAe,CAAC,SAAS,CAAC;IACjD,eAAe,EAAE,gBAAgB;IACjC,oBAAoB,EAAE,eAAe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qC,KAAK,CAAC,MAAM,cAAc,CAChE,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAkC,EACb,EAAE,CACvB,MAAM,CAAC,OAAO,CAAC,kCAAkC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CACnE,MAAM,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CACtD,CAAC;AAEJ;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAAqC,EACrC,QAAmC,EACd,EAAE,CACvB,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAC9B,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CACzB,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CACzB,OAAO,CAAC,IAAI,KAAK,UAAU;IAC3B,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU;IACxC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE;QACrB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,MAAM,CAAC,IAAI,CAChB,CACF,CACF,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { AgentId, AgentSigningAuthority, MessageId, SignedMessage, VerifiedAgentCard, VerifiedSignedMessage } from "@moltzap/identity";
|
|
3
3
|
import type { Registry } from "@moltzap/identity/registry";
|
|
4
4
|
import type { PollCursor, Router, RouterInstanceId } from "@moltzap/router";
|
|
5
|
-
import { type Context, type Effect, type SubscriptionRef } from "effect";
|
|
5
|
+
import { type Context, type Effect, type Option, Schedule, type SubscriptionRef } from "effect";
|
|
6
6
|
import type { DecodedOuterBody } from "../representation.js";
|
|
7
7
|
import type { EndpointStore } from "../store.js";
|
|
8
8
|
declare const RouterWorkerAuthenticationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
@@ -26,7 +26,10 @@ export declare class RouterWorkerPayloadInvalidError extends RouterWorkerPayload
|
|
|
26
26
|
declare const RouterWorkerTransportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
27
27
|
readonly _tag: "RouterWorkerTransportError";
|
|
28
28
|
} & Readonly<A>;
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* The Router could not be reached, timed out, or answered overloaded,
|
|
31
|
+
* unavailable, or internal error through a bounded run of quick retries.
|
|
32
|
+
*/
|
|
30
33
|
export declare class RouterWorkerTransportError extends RouterWorkerTransportError_base {
|
|
31
34
|
}
|
|
32
35
|
declare const RouterWorkerProtocolError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
@@ -47,10 +50,22 @@ declare const RouterWorkerDiscontinuityError_base: new <A extends Record<string,
|
|
|
47
50
|
/** A caller must resume protocol work from the recovered certified position. */
|
|
48
51
|
export declare class RouterWorkerDiscontinuityError extends RouterWorkerDiscontinuityError_base {
|
|
49
52
|
}
|
|
53
|
+
declare const RouterWorkerRejectedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
54
|
+
readonly _tag: "RouterWorkerRejectedError";
|
|
55
|
+
} & Readonly<A>;
|
|
56
|
+
/**
|
|
57
|
+
* The Router refused this endpoint's request itself: its authentication, its
|
|
58
|
+
* MoltZap version, its representation, or its local signature. Retrying
|
|
59
|
+
* cannot succeed, so the failure is fatal rather than an outage.
|
|
60
|
+
*/
|
|
61
|
+
export declare class RouterWorkerRejectedError extends RouterWorkerRejectedError_base<{
|
|
62
|
+
readonly reason: "authentication" | "version" | "request" | "response" | "signing";
|
|
63
|
+
}> {
|
|
64
|
+
}
|
|
50
65
|
declare const RouterWorkerUnavailableError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
51
66
|
readonly _tag: "RouterWorkerUnavailableError";
|
|
52
67
|
} & Readonly<A>;
|
|
53
|
-
/** A normal send was attempted while
|
|
68
|
+
/** A normal send was attempted while the worker is detached or recovering. */
|
|
54
69
|
export declare class RouterWorkerUnavailableError extends RouterWorkerUnavailableError_base {
|
|
55
70
|
}
|
|
56
71
|
/** Closed reason for abandoning process-local protocol folds. */
|
|
@@ -63,9 +78,9 @@ export interface RouterTailAnchor {
|
|
|
63
78
|
/** A verified protocol input either changed durable state or was conclusively irrelevant. */
|
|
64
79
|
export type RouterIngressDisposition = "accepted" | "ignored";
|
|
65
80
|
/** Closed failures returned by initial and recovery sends. */
|
|
66
|
-
export type RouterWorkerSendError = RouterWorkerAuthenticationError | RouterWorkerPersistenceError | RouterWorkerTransportError | RouterWorkerProtocolError | RouterWorkerRecoveryError | RouterWorkerDiscontinuityError | RouterWorkerUnavailableError;
|
|
81
|
+
export type RouterWorkerSendError = RouterWorkerAuthenticationError | RouterWorkerPersistenceError | RouterWorkerRejectedError | RouterWorkerTransportError | RouterWorkerProtocolError | RouterWorkerRecoveryError | RouterWorkerDiscontinuityError | RouterWorkerUnavailableError;
|
|
67
82
|
/** Closed failures returned by one poll/recovery transition. */
|
|
68
|
-
export type RouterWorkerPollError = RouterWorkerAuthenticationError | RouterWorkerPersistenceError | RouterWorkerTransportError | RouterWorkerProtocolError | RouterWorkerRecoveryError | RouterWorkerDiscontinuityError | RouterWorkerUnavailableError;
|
|
83
|
+
export type RouterWorkerPollError = RouterWorkerAuthenticationError | RouterWorkerPersistenceError | RouterWorkerRejectedError | RouterWorkerTransportError | RouterWorkerProtocolError | RouterWorkerRecoveryError | RouterWorkerDiscontinuityError | RouterWorkerUnavailableError;
|
|
69
84
|
/** Verified outer message and its decoded private Client payload. */
|
|
70
85
|
export interface RouterWorkerIngress<Payload> {
|
|
71
86
|
readonly routerInstanceId: RouterInstanceId;
|
|
@@ -125,11 +140,17 @@ export interface RouterWorker {
|
|
|
125
140
|
readonly currentAnchor: Effect.Effect<RouterTailAnchor, RouterWorkerUnavailableError>;
|
|
126
141
|
/**
|
|
127
142
|
* The active anchor as soon as one exists: the current anchor while the
|
|
128
|
-
* worker is active, otherwise the anchor the next
|
|
129
|
-
* publishes. Callers bound the wait; the worker itself
|
|
143
|
+
* worker is active, otherwise the anchor the next answered poll or
|
|
144
|
+
* completed recovery publishes. Callers bound the wait; the worker itself
|
|
145
|
+
* never gives up.
|
|
130
146
|
*/
|
|
131
147
|
readonly awaitAnchor: Effect.Effect<RouterTailAnchor>;
|
|
132
148
|
readonly pollOnce: Effect.Effect<void, RouterWorkerPollError>;
|
|
149
|
+
/**
|
|
150
|
+
* Polls for the endpoint's lifetime. A transient failure detaches the
|
|
151
|
+
* worker and backs off until the Router answers; only a non-transient
|
|
152
|
+
* failure ends the loop.
|
|
153
|
+
*/
|
|
133
154
|
readonly run: Effect.Effect<never, RouterWorkerPollError>;
|
|
134
155
|
readonly send: (outboundId: string) => Effect.Effect<void, RouterWorkerSendError>;
|
|
135
156
|
}
|
|
@@ -147,9 +168,26 @@ export interface RouterWorkerRecoveringState {
|
|
|
147
168
|
readonly priorRouterInstanceId?: RouterInstanceId;
|
|
148
169
|
readonly volatileFoldsAbandoned: boolean;
|
|
149
170
|
readonly anchor?: RouterTailAnchor;
|
|
171
|
+
/**
|
|
172
|
+
* Clock epoch milliseconds when a recovery attempt first lost the Router;
|
|
173
|
+
* none once the Router answers the recovery's tail poll.
|
|
174
|
+
*/
|
|
175
|
+
readonly unreachableSince: Option.Option<number>;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Volatile cursor state while the Router stops answering an active worker.
|
|
179
|
+
* The next answered poll either reattaches at the same anchor or starts
|
|
180
|
+
* recovery, so no send runs until the Router's instance is known again.
|
|
181
|
+
*/
|
|
182
|
+
export interface RouterWorkerDetachedState {
|
|
183
|
+
readonly kind: "detached";
|
|
184
|
+
readonly generation: number;
|
|
185
|
+
readonly anchor: RouterTailAnchor;
|
|
186
|
+
/** Epoch milliseconds of the Clock when the worker detached. */
|
|
187
|
+
readonly detachedAt: number;
|
|
150
188
|
}
|
|
151
189
|
/** Closed volatile lifecycle of the Router worker. */
|
|
152
|
-
export type RouterWorkerState = RouterWorkerActiveState | RouterWorkerRecoveringState;
|
|
190
|
+
export type RouterWorkerState = RouterWorkerActiveState | RouterWorkerDetachedState | RouterWorkerRecoveringState;
|
|
153
191
|
/** Resolved public capabilities consumed by private worker mechanics. */
|
|
154
192
|
export interface RouterWorkerServices {
|
|
155
193
|
readonly router: Context.Tag.Service<typeof Router>;
|
|
@@ -179,5 +217,32 @@ export type RouterWorkerSendOutcome = Readonly<{
|
|
|
179
217
|
export declare const routerWorkerRetryAttempts = 3;
|
|
180
218
|
/** Fixed interruptible spacing between bounded attempts. */
|
|
181
219
|
export declare const routerWorkerRetryDelay = "25 millis";
|
|
220
|
+
/**
|
|
221
|
+
* Quick retries of one poll before a transport failure detaches the worker,
|
|
222
|
+
* spanning about 350 ms, so a connection reset or a single overloaded answer
|
|
223
|
+
* does not block sends.
|
|
224
|
+
*/
|
|
225
|
+
export declare const routerWorkerBlipSchedule: Schedule.Schedule<[import("effect/Duration").Duration, number], unknown, never>;
|
|
226
|
+
/**
|
|
227
|
+
* Backoff for work that waits out an unreachable or re-anchoring Router: the
|
|
228
|
+
* poll loop and the outbound drain. Delays grow from 100 ms to a 5 s cap and
|
|
229
|
+
* are jittered so endpoints do not return in lockstep after a Router restart.
|
|
230
|
+
* It never ends, because a Router outage halts progress rather than failing
|
|
231
|
+
* the endpoint.
|
|
232
|
+
*/
|
|
233
|
+
export declare const routerWorkerReconnectSchedule: Schedule.Schedule<[import("effect/Duration").Duration, number], unknown, never>;
|
|
234
|
+
/**
|
|
235
|
+
* How often a worker that cannot reach the Router, detached or recovering,
|
|
236
|
+
* repeats its warning.
|
|
237
|
+
*/
|
|
238
|
+
export declare const routerWorkerDetachedReportInterval = "60 seconds";
|
|
239
|
+
/**
|
|
240
|
+
* Whether a worker failure ends once the Router answers and the worker
|
|
241
|
+
* re-anchors. Every other failure is a protocol, persistence, recovery, or
|
|
242
|
+
* Router-rejection fault that stays fatal.
|
|
243
|
+
* @param error Poll or send failure; both unions share these tags.
|
|
244
|
+
* @returns True for transport loss, a pending recovery, or a discontinuity.
|
|
245
|
+
*/
|
|
246
|
+
export declare const isTransientRouterWorkerError: (error: RouterWorkerPollError | RouterWorkerSendError) => boolean;
|
|
182
247
|
export {};
|
|
183
248
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/endpoint/router-worker/types.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,OAAO,KAAK,EACV,OAAO,EACP,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAi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,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,kCAAkC,eAAe,CAAC;AAa/D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,UAChC,qBAAqB,GAAG,qBAAqB,KACnD,OAAqC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @file Private Router worker contracts shared by orchestration and transport. */
|
|
2
|
-
import { Data } from "effect";
|
|
2
|
+
import { Data, Schedule, } from "effect";
|
|
3
3
|
/** An outer sender card could not be resolved, pinned, or authenticated. */
|
|
4
4
|
export class RouterWorkerAuthenticationError extends Data.TaggedError("RouterWorkerAuthenticationError") {
|
|
5
5
|
}
|
|
@@ -9,7 +9,10 @@ export class RouterWorkerPersistenceError extends Data.TaggedError("RouterWorker
|
|
|
9
9
|
/** An authenticated outer body is not one closed Client protocol value. */
|
|
10
10
|
export class RouterWorkerPayloadInvalidError extends Data.TaggedError("RouterWorkerPayloadInvalidError") {
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The Router could not be reached, timed out, or answered overloaded,
|
|
14
|
+
* unavailable, or internal error through a bounded run of quick retries.
|
|
15
|
+
*/
|
|
13
16
|
export class RouterWorkerTransportError extends Data.TaggedError("RouterWorkerTransportError") {
|
|
14
17
|
}
|
|
15
18
|
/** A Router outcome or local envelope violated the private worker contract. */
|
|
@@ -21,11 +24,55 @@ export class RouterWorkerRecoveryError extends Data.TaggedError("RouterWorkerRec
|
|
|
21
24
|
/** A caller must resume protocol work from the recovered certified position. */
|
|
22
25
|
export class RouterWorkerDiscontinuityError extends Data.TaggedError("RouterWorkerDiscontinuityError") {
|
|
23
26
|
}
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The Router refused this endpoint's request itself: its authentication, its
|
|
29
|
+
* MoltZap version, its representation, or its local signature. Retrying
|
|
30
|
+
* cannot succeed, so the failure is fatal rather than an outage.
|
|
31
|
+
*/
|
|
32
|
+
export class RouterWorkerRejectedError extends Data.TaggedError("RouterWorkerRejectedError") {
|
|
33
|
+
}
|
|
34
|
+
/** A normal send was attempted while the worker is detached or recovering. */
|
|
25
35
|
export class RouterWorkerUnavailableError extends Data.TaggedError("RouterWorkerUnavailableError") {
|
|
26
36
|
}
|
|
27
37
|
/** Complete number of attempts for one ambiguous transport operation. */
|
|
28
38
|
export const routerWorkerRetryAttempts = 3;
|
|
29
39
|
/** Fixed interruptible spacing between bounded attempts. */
|
|
30
40
|
export const routerWorkerRetryDelay = "25 millis";
|
|
41
|
+
/**
|
|
42
|
+
* Quick retries of one poll before a transport failure detaches the worker,
|
|
43
|
+
* spanning about 350 ms, so a connection reset or a single overloaded answer
|
|
44
|
+
* does not block sends.
|
|
45
|
+
*/
|
|
46
|
+
export const routerWorkerBlipSchedule = Schedule.exponential("50 millis").pipe(Schedule.intersect(Schedule.recurs(3)));
|
|
47
|
+
/**
|
|
48
|
+
* Backoff for work that waits out an unreachable or re-anchoring Router: the
|
|
49
|
+
* poll loop and the outbound drain. Delays grow from 100 ms to a 5 s cap and
|
|
50
|
+
* are jittered so endpoints do not return in lockstep after a Router restart.
|
|
51
|
+
* It never ends, because a Router outage halts progress rather than failing
|
|
52
|
+
* the endpoint.
|
|
53
|
+
*/
|
|
54
|
+
export const routerWorkerReconnectSchedule = Schedule.exponential("100 millis").pipe(Schedule.union(Schedule.spaced("5 seconds")), Schedule.jittered);
|
|
55
|
+
/**
|
|
56
|
+
* How often a worker that cannot reach the Router, detached or recovering,
|
|
57
|
+
* repeats its warning.
|
|
58
|
+
*/
|
|
59
|
+
export const routerWorkerDetachedReportInterval = "60 seconds";
|
|
60
|
+
const transientByTag = {
|
|
61
|
+
RouterWorkerAuthenticationError: false,
|
|
62
|
+
RouterWorkerDiscontinuityError: true,
|
|
63
|
+
RouterWorkerPersistenceError: false,
|
|
64
|
+
RouterWorkerProtocolError: false,
|
|
65
|
+
RouterWorkerRecoveryError: false,
|
|
66
|
+
RouterWorkerRejectedError: false,
|
|
67
|
+
RouterWorkerTransportError: true,
|
|
68
|
+
RouterWorkerUnavailableError: true,
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Whether a worker failure ends once the Router answers and the worker
|
|
72
|
+
* re-anchors. Every other failure is a protocol, persistence, recovery, or
|
|
73
|
+
* Router-rejection fault that stays fatal.
|
|
74
|
+
* @param error Poll or send failure; both unions share these tags.
|
|
75
|
+
* @returns True for transport loss, a pending recovery, or a discontinuity.
|
|
76
|
+
*/
|
|
77
|
+
export const isTransientRouterWorkerError = (error) => transientByTag[error._tag];
|
|
31
78
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/endpoint/router-worker/types.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAYnF,OAAO,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/endpoint/router-worker/types.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAYnF,OAAO,EAEL,IAAI,EAGJ,QAAQ,GAET,MAAM,QAAQ,CAAC;AAIhB,4EAA4E;AAC5E,MAAM,OAAO,+BAAgC,SAAQ,IAAI,CAAC,WAAW,CACnE,iCAAiC,CAClC;CAAG;AAEJ,2EAA2E;AAC3E,MAAM,OAAO,4BAA6B,SAAQ,IAAI,CAAC,WAAW,CAChE,8BAA8B,CAC/B;CAAG;AAEJ,2EAA2E;AAC3E,MAAM,OAAO,+BAAgC,SAAQ,IAAI,CAAC,WAAW,CACnE,iCAAiC,CAClC;CAAG;AAEJ;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,IAAI,CAAC,WAAW,CAC9D,4BAA4B,CAC7B;CAAG;AAEJ,+EAA+E;AAC/E,MAAM,OAAO,yBAA0B,SAAQ,IAAI,CAAC,WAAW,CAC7D,2BAA2B,CAC5B;CAAG;AAEJ,+EAA+E;AAC/E,MAAM,OAAO,yBAA0B,SAAQ,IAAI,CAAC,WAAW,CAC7D,2BAA2B,CAC5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E,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare namespace MoltZapDaemon {
|
|
|
8
8
|
export class StartupError extends StartupError_base<{
|
|
9
9
|
readonly phase: "configuration" | "storage" | "listener";
|
|
10
10
|
}> {
|
|
11
|
+
/** Names only the failed phase, so the process log says why startup stopped. */
|
|
12
|
+
get message(): string;
|
|
11
13
|
}
|
|
12
14
|
/** Complete production process composition for `moltzapd`. */
|
|
13
15
|
export const layer: Layer.Layer<never, StartupError>;
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAKlF,OAAO,EAA0B,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAKlF,OAAO,EAA0B,KAAK,EAAE,MAAM,QAAQ,CAAC;AAmBvD,yBAAiB,aAAa,CAAC;;;;IAC7B,4EAA4E;IAC5E,MAAM,OAAO,YAAa,SAAQ,kBAEhC;QACA,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;KAC1D,CAAC;QACA,gFAAgF;QAChF,IAAa,OAAO,IAAI,MAAM,CAE7B;KACF;IAoCD,8DAA8D;IAC9D,MAAM,CAAC,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,CACnB,CAAC;;CAwBlC"}
|
package/dist/server.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Registry } from "@moltzap/identity/registry";
|
|
|
4
4
|
import { Router } from "@moltzap/router";
|
|
5
5
|
import { Data, Duration, Effect, Layer } from "effect";
|
|
6
6
|
import { loadDaemonBootstrap, loadDaemonProcessConfiguration, } from "./daemon/configuration.js";
|
|
7
|
+
import { requireAdmissionWhileUnregistered, } from "./daemon/registration.js";
|
|
7
8
|
import { runDaemonRuntime } from "./daemon/runtime/index.js";
|
|
8
9
|
import { openEndpointStore } from "./endpoint/store.js";
|
|
9
10
|
const REGISTRY_REQUEST_TIMEOUT = Duration.seconds(30);
|
|
@@ -15,12 +16,17 @@ export var MoltZapDaemon;
|
|
|
15
16
|
(function (MoltZapDaemon) {
|
|
16
17
|
/** Closed daemon startup phase without configuration or platform detail. */
|
|
17
18
|
class StartupError extends Data.TaggedError("MoltZapDaemonStartupError") {
|
|
19
|
+
/** Names only the failed phase, so the process log says why startup stopped. */
|
|
20
|
+
get message() {
|
|
21
|
+
return `moltzapd startup failed in phase ${this.phase}`;
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
MoltZapDaemon.StartupError = StartupError;
|
|
20
25
|
const runDaemon = Effect.gen(function* () {
|
|
21
26
|
const configuration = yield* loadDaemonProcessConfiguration.pipe(Effect.mapError(configurationFailure));
|
|
22
27
|
const bootstrap = yield* loadDaemonBootstrap(configuration).pipe(Effect.mapError(configurationFailure));
|
|
23
28
|
const store = yield* openEndpointStore(configuration.stateDirectory).pipe(Effect.mapError(storageFailure));
|
|
29
|
+
yield* requireAdmissionWhileUnregistered({ store, bootstrap }).pipe(Effect.mapError(admissionFailure));
|
|
24
30
|
const networkContext = yield* Layer.build(Layer.merge(Registry.layer({
|
|
25
31
|
origin: configuration.registryOrigin,
|
|
26
32
|
registrySignerPublicKey: configuration.registrySignerPublicKey,
|
|
@@ -42,5 +48,17 @@ export var MoltZapDaemon;
|
|
|
42
48
|
function storageFailure() {
|
|
43
49
|
return new StartupError({ phase: "storage" });
|
|
44
50
|
}
|
|
51
|
+
function admissionFailure(error) {
|
|
52
|
+
switch (error._tag) {
|
|
53
|
+
case "DaemonConfigurationError":
|
|
54
|
+
return configurationFailure();
|
|
55
|
+
case "DaemonRegistrationPersistenceError":
|
|
56
|
+
return storageFailure();
|
|
57
|
+
default: {
|
|
58
|
+
const exhaustive = error;
|
|
59
|
+
return exhaustive;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
45
63
|
})(MoltZapDaemon || (MoltZapDaemon = {}));
|
|
46
64
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAEL,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,wBAAwB,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACtD,MAAM,mBAAmB,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAA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6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moltzap/client",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1001.1",
|
|
4
4
|
"description": "MoltZap endpoint runtime and harness boundary",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"@modelcontextprotocol/server": "2.0.0-beta.5",
|
|
87
87
|
"canonicalize": "3.0.0",
|
|
88
88
|
"effect": "^3.22.0",
|
|
89
|
-
"@moltzap/identity": "2026.
|
|
90
|
-
"@moltzap/router": "2026.
|
|
89
|
+
"@moltzap/identity": "2026.1001.1",
|
|
90
|
+
"@moltzap/router": "2026.1001.1"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@typescript/native": "npm:typescript@7.0.2",
|