@kubun/plugin-p2p 0.10.1 → 0.12.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/lib/context/delegation.js +130 -1
- package/lib/context/group.js +1646 -1
- package/lib/context/hub.js +151 -1
- package/lib/context/join.js +115 -1
- package/lib/context/peer.d.ts +92 -0
- package/lib/context/peer.js +1216 -0
- package/lib/context/require-admin.d.ts +57 -0
- package/lib/context/require-admin.js +57 -0
- package/lib/context/sync.d.ts +12 -0
- package/lib/context/sync.js +252 -1
- package/lib/context/types.d.ts +58 -22
- package/lib/context/types.js +48 -1
- package/lib/groups/access-default-token.d.ts +44 -0
- package/lib/groups/access-default-token.js +103 -0
- package/lib/groups/admin-roster.d.ts +55 -0
- package/lib/groups/admin-roster.js +69 -0
- package/lib/groups/anchor-store.d.ts +15 -0
- package/lib/groups/anchor-store.js +37 -0
- package/lib/groups/app-cursor-store.d.ts +17 -0
- package/lib/groups/app-cursor-store.js +34 -0
- package/lib/groups/broadcast-codec.js +6 -1
- package/lib/groups/broadcast.d.ts +238 -106
- package/lib/groups/broadcast.js +702 -1
- package/lib/groups/catalog-token.d.ts +50 -0
- package/lib/groups/catalog-token.js +96 -0
- package/lib/groups/circle-projection.d.ts +90 -0
- package/lib/groups/circle-projection.js +202 -0
- package/lib/groups/circle-reducers.d.ts +139 -0
- package/lib/groups/circle-reducers.js +128 -0
- package/lib/groups/commit-adoption.d.ts +77 -0
- package/lib/groups/commit-adoption.js +108 -0
- package/lib/groups/commit-journal.d.ts +14 -0
- package/lib/groups/commit-journal.js +65 -0
- package/lib/groups/control-request.d.ts +66 -0
- package/lib/groups/control-request.js +101 -0
- package/lib/groups/events.d.ts +19 -2
- package/lib/groups/events.js +10 -1
- package/lib/groups/group-anchor.d.ts +24 -0
- package/lib/groups/group-anchor.js +22 -0
- package/lib/groups/group-crypto.d.ts +42 -0
- package/lib/groups/group-crypto.js +159 -0
- package/lib/groups/group-handle-registry.d.ts +138 -9
- package/lib/groups/group-handle-registry.js +533 -1
- package/lib/groups/group-handlers.d.ts +30 -0
- package/lib/groups/group-handlers.js +218 -0
- package/lib/groups/group-health-monitor.d.ts +11 -0
- package/lib/groups/group-health-monitor.js +139 -1
- package/lib/groups/group-mls.d.ts +66 -0
- package/lib/groups/group-mls.js +696 -0
- package/lib/groups/group-peer-manager.d.ts +301 -0
- package/lib/groups/group-peer-manager.js +1336 -0
- package/lib/groups/group-protocols.d.ts +754 -0
- package/lib/groups/group-protocols.js +448 -0
- package/lib/groups/invite-payload.d.ts +49 -1
- package/lib/groups/invite-payload.js +26 -1
- package/lib/groups/join-request-identity.d.ts +21 -0
- package/lib/groups/join-request-identity.js +43 -0
- package/lib/groups/join-utils.d.ts +61 -0
- package/lib/groups/join-utils.js +366 -1
- package/lib/groups/ledger-affected-events.d.ts +20 -0
- package/lib/groups/ledger-affected-events.js +85 -0
- package/lib/groups/ledger-commit-fold.d.ts +107 -0
- package/lib/groups/ledger-commit-fold.js +167 -0
- package/lib/groups/ledger-ingest.d.ts +124 -0
- package/lib/groups/ledger-ingest.js +212 -0
- package/lib/groups/ledger.d.ts +44 -0
- package/lib/groups/ledger.js +30 -0
- package/lib/groups/manager.d.ts +217 -85
- package/lib/groups/manager.js +798 -1
- package/lib/groups/mls-codec.d.ts +28 -7
- package/lib/groups/mls-codec.js +33 -1
- package/lib/groups/mls-encryptor.d.ts +2 -2
- package/lib/groups/mls-encryptor.js +33 -1
- package/lib/groups/mls-group-handle.d.ts +37 -2
- package/lib/groups/mls-group-handle.js +18 -1
- package/lib/groups/mls-json.js +17 -1
- package/lib/groups/mls-receive-errors.d.ts +27 -0
- package/lib/groups/mls-receive-errors.js +39 -0
- package/lib/groups/mls-state.d.ts +6 -4
- package/lib/groups/mls-state.js +79 -1
- package/lib/groups/peer-presence.d.ts +90 -0
- package/lib/groups/peer-presence.js +295 -0
- package/lib/groups/peer-selection.d.ts +37 -0
- package/lib/groups/peer-selection.js +72 -0
- package/lib/groups/roster-projection.d.ts +53 -0
- package/lib/groups/roster-projection.js +65 -0
- package/lib/groups/store-received-grant.d.ts +7 -3
- package/lib/groups/store-received-grant.js +161 -1
- package/lib/groups/store-received-revocation.d.ts +19 -16
- package/lib/groups/store-received-revocation.js +83 -1
- package/lib/hub/ack-backoff.d.ts +22 -0
- package/lib/hub/ack-backoff.js +88 -0
- package/lib/hub/http-client.d.ts +18 -10
- package/lib/hub/http-client.js +15 -1
- package/lib/hub/hub-like.d.ts +75 -0
- package/lib/hub/hub-like.js +1022 -0
- package/lib/hub/loopback-log-hub.d.ts +20 -0
- package/lib/hub/loopback-log-hub.js +178 -0
- package/lib/hub/manager.d.ts +25 -40
- package/lib/hub/manager.js +155 -1
- package/lib/hub/peer-scoped-hub-view.d.ts +35 -0
- package/lib/hub/peer-scoped-hub-view.js +92 -0
- package/lib/hub/sender-scoped-hub-view.d.ts +41 -0
- package/lib/hub/sender-scoped-hub-view.js +59 -0
- package/lib/hub/server-did.d.ts +67 -0
- package/lib/hub/server-did.js +131 -0
- package/lib/hub/wiring.d.ts +77 -51
- package/lib/hub/wiring.js +189 -1
- package/lib/index.d.ts +58 -22
- package/lib/index.js +563 -1
- package/lib/peer/connection-registry.d.ts +45 -0
- package/lib/peer/connection-registry.js +52 -0
- package/lib/peer/handlers.d.ts +69 -0
- package/lib/peer/handlers.js +110 -0
- package/lib/protocol.d.ts +214 -1
- package/lib/protocol.js +519 -1
- package/lib/schema.d.ts +3 -1
- package/lib/schema.js +1150 -39
- package/lib/sync/access-default-sender.d.ts +23 -0
- package/lib/sync/access-default-sender.js +80 -0
- package/lib/sync/authorize.d.ts +58 -4
- package/lib/sync/authorize.js +114 -1
- package/lib/sync/broadcast-queue.d.ts +3 -4
- package/lib/sync/broadcast-queue.js +182 -1
- package/lib/sync/broadcast-sender.js +179 -1
- package/lib/sync/catalog-scope.d.ts +8 -7
- package/lib/sync/catalog-scope.js +84 -1
- package/lib/sync/errors.d.ts +12 -2
- package/lib/sync/errors.js +29 -1
- package/lib/sync/forwarder.d.ts +13 -19
- package/lib/sync/forwarder.js +271 -1
- package/lib/sync/handlers.js +200 -1
- package/lib/sync/hub-tunnel-sync-listener.d.ts +19 -5
- package/lib/sync/hub-tunnel-sync-listener.js +261 -1
- package/lib/sync/hub-tunnel-sync-provider.d.ts +34 -14
- package/lib/sync/hub-tunnel-sync-provider.js +113 -1
- package/lib/sync/merkle-apply.d.ts +5 -0
- package/lib/sync/merkle-apply.js +194 -1
- package/lib/sync/merkle-channel.d.ts +11 -3
- package/lib/sync/merkle-channel.js +0 -0
- package/lib/sync/merkle-tree.js +120 -1
- package/lib/sync/peer-registry.d.ts +15 -11
- package/lib/sync/peer-registry.js +82 -1
- package/lib/sync/receive-access-gate.js +24 -1
- package/lib/sync/scope-resolver.js +41 -1
- package/lib/sync/sync-client.d.ts +14 -4
- package/lib/sync/sync-client.js +254 -1
- package/lib/sync/sync-manager.d.ts +24 -6
- package/lib/sync/sync-manager.js +301 -1
- package/lib/sync/tunnel-listeners.d.ts +52 -0
- package/lib/sync/tunnel-listeners.js +175 -0
- package/lib/sync/tunnel-observability.d.ts +25 -0
- package/lib/sync/tunnel-observability.js +63 -0
- package/lib/sync/tunnel-topics.d.ts +20 -0
- package/lib/sync/tunnel-topics.js +28 -0
- package/lib/types.d.ts +704 -22
- package/lib/types.js +1 -1
- package/lib/util/handler-error.d.ts +16 -0
- package/lib/util/handler-error.js +64 -0
- package/lib/util/mutex.d.ts +14 -1
- package/lib/util/mutex.js +44 -1
- package/lib/utils.js +21 -1
- package/package.json +58 -47
- package/lib/groups/broadcast-service.d.ts +0 -263
- package/lib/groups/broadcast-service.js +0 -1
- package/lib/groups/rejoin-codec.d.ts +0 -14
- package/lib/groups/rejoin-codec.js +0 -1
- package/lib/groups/wire-frame.d.ts +0 -34
- package/lib/groups/wire-frame.js +0 -1
- package/lib/hub/circle-catchup-requester.d.ts +0 -58
- package/lib/hub/circle-catchup-requester.js +0 -1
- package/lib/hub/circle-catchup-responder.d.ts +0 -50
- package/lib/hub/circle-catchup-responder.js +0 -1
- package/lib/hub/connection-pool.d.ts +0 -43
- package/lib/hub/connection-pool.js +0 -1
- package/lib/hub/did-observing-transport.d.ts +0 -64
- package/lib/hub/did-observing-transport.js +0 -1
- package/lib/hub/epoch-stale-detector.d.ts +0 -18
- package/lib/hub/epoch-stale-detector.js +0 -1
- package/lib/hub/errors.d.ts +0 -30
- package/lib/hub/errors.js +0 -1
- package/lib/hub/forward-remote-broadcast.d.ts +0 -15
- package/lib/hub/forward-remote-broadcast.js +0 -1
- package/lib/hub/group-channel.d.ts +0 -89
- package/lib/hub/group-channel.js +0 -1
- package/lib/hub/hub-connection.d.ts +0 -96
- package/lib/hub/hub-connection.js +0 -1
- package/lib/hub/receive-handler.d.ts +0 -51
- package/lib/hub/receive-handler.js +0 -1
- package/lib/hub/rejoin-manager.d.ts +0 -78
- package/lib/hub/rejoin-manager.js +0 -1
- package/lib/hub/rejoin-responder.d.ts +0 -32
- package/lib/hub/rejoin-responder.js +0 -1
- package/lib/hub/relay-manager.d.ts +0 -142
- package/lib/hub/relay-manager.js +0 -1
- package/lib/hub/send-handler.d.ts +0 -40
- package/lib/hub/send-handler.js +0 -1
- package/lib/hub/tunnel-inbox.d.ts +0 -20
- package/lib/hub/tunnel-inbox.js +0 -1
- package/lib/hub/wait-for-gate.d.ts +0 -14
- package/lib/hub/wait-for-gate.js +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
import type { DefaultAccessLevel, KubunPlugin, PluginFactoryParams } from '@kubun/engine';
|
|
2
|
-
import type
|
|
2
|
+
import { type CreateHubClient } from './hub/http-client.js';
|
|
3
3
|
import { type BroadcastBatchConfig } from './sync/broadcast-queue.js';
|
|
4
4
|
import { type PushSyncConfig } from './sync/broadcast-sender.js';
|
|
5
5
|
import type { ForwardingConfig } from './sync/forwarder.js';
|
|
6
6
|
import type { StoreUnreadableMode } from './types.js';
|
|
7
|
-
export type
|
|
7
|
+
export { GROUP_CONTROL_DENIED, LAST_GROUP_ADMIN, NOT_GROUP_ADMIN, type RequireGroupAdminParams, requireGroupAdmin, } from './context/require-admin.js';
|
|
8
|
+
export type { ContextDeps } from './context/types.js';
|
|
9
|
+
export { ADMIN_ROLE_ENTRY_TYPE, type AdminRoleValue, type AdminRosterState, foldAdminRoster, } from './groups/admin-roster.js';
|
|
8
10
|
export { type AffectedRow, type GroupBroadcastMessage, type MutationApplyEntry, type ProcessBroadcastParams, type ProcessBroadcastResult, processBroadcast, } from './groups/broadcast.js';
|
|
9
11
|
export { deserializeBroadcast, serializeBroadcast } from './groups/broadcast-codec.js';
|
|
10
|
-
export { ApplyError, type BroadcastEvent, BroadcastService, type BroadcastServiceEvents, type BroadcastServiceParams, DecryptError, type ReceiveBroadcastParams, type ReceiveBroadcastResult, type SendBroadcastParams, } from './groups/broadcast-service.js';
|
|
11
12
|
export { createFilteredGenerator, createP2PEventEmitter, type P2PEventEmitter, type P2PEventMap, } from './groups/events.js';
|
|
13
|
+
export { buildKubunGroupAnchorExtension, type GroupAnchorApp, readRecoverySecret, } from './groups/group-anchor.js';
|
|
12
14
|
export { GroupHandleRegistry, type GroupHandleRegistryParams, type SeedParams, } from './groups/group-handle-registry.js';
|
|
15
|
+
export type { PeerAvailability } from './groups/group-protocols.js';
|
|
13
16
|
export { decodeFullJoinRequest, decodeInvitePayload, decodeJoinRequest, encodeFullJoinRequest, encodeInvitePayload, encodeJoinRequest, type FullJoinRequestPayload, type InvitePayload, type JoinRequestPayload, type SuggestedHub, } from './groups/invite-payload.js';
|
|
14
|
-
export {
|
|
17
|
+
export { resolveJoinRequestDID } from './groups/join-request-identity.js';
|
|
18
|
+
export { entryOrd, type FoldInput, foldLedgerEntries, type LedgerEntry, type LedgerReducer, ledgerEntryDigest, type PositionedFoldInput, signLedgerEntry, type VerifiedLedgerEntry, verifyLedgerEntry, } from './groups/ledger.js';
|
|
19
|
+
export type { CreateGroupParams, CreateGroupResult, GroupManagerParams, InviteToGroupParams, InviteToGroupResult, JoinGroupParams, JoinGroupResult, LeaveGroupParams, LeaveGroupResult, } from './groups/manager.js';
|
|
15
20
|
export { MLSEncryptor, type MLSEncryptorParams } from './groups/mls-encryptor.js';
|
|
16
21
|
export { type MLSGroupHandle, restoreMLSGroupHandle } from './groups/mls-group-handle.js';
|
|
17
22
|
export { replacer as mlsJSONReplacer, reviver as mlsJSONReviver } from './groups/mls-json.js';
|
|
18
23
|
export { deserializeMLSGroupState, type MLSGroupState, type SerializedMLSGroupState, serializeMLSGroupState, } from './groups/mls-state.js';
|
|
19
|
-
export
|
|
24
|
+
export { MERKLE_SYNC_PROTOCOL } from './groups/peer-selection.js';
|
|
25
|
+
export { type CreateHTTPHubClientParams, type CreateHubClient, type CreateHubClientOptions, createHTTPHubClient, } from './hub/http-client.js';
|
|
26
|
+
export { type BindHubToGroupParams, bindHubToGroup, type CreateHubParams, createHub, type DeleteHubParams, type DeleteHubResult, deleteHub, type GetHubParams, getHub, type Hub, type ListGroupsByHubParams, type ListHubsByGroupParams, type ListHubsParams, listGroupsByHub, listHubs, listHubsByGroup, type UnbindHubFromGroupParams, type UpdateHubParams, type UpsertHubParams, unbindHubFromGroup, updateHub, upsertHub, } from './hub/manager.js';
|
|
27
|
+
export { type CreateHubServerDIDResolverParams, createHubServerDIDResolver, type FetchHubInfoParams, fetchHubInfo, type HubInfo, type HubServerDIDResolver, } from './hub/server-did.js';
|
|
28
|
+
export { type HubWiring, type SetupHubRelayParams, setupHubRelay, } from './hub/wiring.js';
|
|
29
|
+
export { type PeerConnection, PeerConnectionRegistry, } from './peer/connection-registry.js';
|
|
30
|
+
export { type CreatePeerHandlersParams, createPeerHandlers } from './peer/handlers.js';
|
|
31
|
+
export type { PeerClientMessage, PeerGroupsResult, PeerProtocol, PeerServerMessage, SyncClientMessage, SyncProtocol, SyncServerMessage, } from './protocol.js';
|
|
32
|
+
export { peerProtocol } from './protocol.js';
|
|
20
33
|
export { createP2PSchemaExtension } from './schema.js';
|
|
21
34
|
export { type BroadcastBatchConfig, type BroadcastQueue, type BroadcastQueueParams, createBroadcastQueue, DEFAULT_BROADCAST_BATCH_CONFIG, } from './sync/broadcast-queue.js';
|
|
22
35
|
export { type BroadcastSenderParams, DEFAULT_PUSH_SYNC_CONFIG, type PushSyncConfig, wireBroadcastSender, } from './sync/broadcast-sender.js';
|
|
@@ -27,18 +40,9 @@ export { checkSyncDelegation } from './sync/handlers.js';
|
|
|
27
40
|
export { HubTunnelSyncListener, type HubTunnelSyncListenerParams, } from './sync/hub-tunnel-sync-listener.js';
|
|
28
41
|
export { HubTunnelSyncProvider, type HubTunnelSyncProviderParams, } from './sync/hub-tunnel-sync-provider.js';
|
|
29
42
|
export { negotiateDirection, type PeerConfig, type PeerConfigWithID, PeerRegistry, } from './sync/peer-registry.js';
|
|
30
|
-
export { SyncClient, type SyncClientParams, type SyncScope, type SyncTransportProvider, } from './sync/sync-client.js';
|
|
43
|
+
export { SyncClient, type SyncClientParams, type SyncRoute, type SyncScope, type SyncServerResolver, type SyncTransportProvider, } from './sync/sync-client.js';
|
|
31
44
|
export { type SyncEvent, SyncManager, type SyncManagerParams, type SyncSessionInfo, type SyncStatus, } from './sync/sync-manager.js';
|
|
32
|
-
export type {
|
|
33
|
-
export { DIDObservingTransport, type DIDObservingTransportParams, type ServerDIDObserver, } from './hub/did-observing-transport.js';
|
|
34
|
-
export { ReconnectingError } from './hub/errors.js';
|
|
35
|
-
export type { GroupChannel, GroupChannelParams } from './hub/group-channel.js';
|
|
36
|
-
export { type CreateHTTPHubClientParams, createHTTPHubClient } from './hub/http-client.js';
|
|
37
|
-
export type { ConnectionLifecycleEvent } from './hub/hub-connection.js';
|
|
38
|
-
export { type BindHubToGroupParams, bindHubToGroup, type CaptureServerDIDParams, type CreateHubParams, captureServerDID, createHub, type DeleteHubParams, type DeleteHubResult, deleteHub, type GetHubParams, getHub, type Hub, HubServerDIDConflictError, type ListGroupsByHubParams, type ListHubsByGroupParams, type ListHubsParams, listGroupsByHub, listHubs, listHubsByGroup, type UnbindHubFromGroupParams, type UpdateHubParams, type UpsertHubParams, unbindHubFromGroup, updateHub, upsertHub, } from './hub/manager.js';
|
|
39
|
-
export { type CreateGroupChannel, type CreateHubClient, type CreateHubClientOptions, type CreateHubConnection, HubRelayManager, type HubRelayManagerParams, type RelayEvent, } from './hub/relay-manager.js';
|
|
40
|
-
export { DISABLED_HUB, type HubWiring, type SetupHubRelayParams, setupHubRelay, } from './hub/wiring.js';
|
|
41
|
-
export type { CatalogData, CircleData, CircleMemberData, DeleteCatalogData, DeleteCircleData, GroupData, GroupMemberData, GroupRequestContext, InviteToGroupData, JoinGroupData, LeaveGroupData, P2PContext, P2PJoinRequestContext, RemoveCircleMemberData, RemoveGroupMemberData, StoreUnreadableMode, SyncPluginAPI, SyncRequestContext, SyncSessionResult, UpdateCircleInput, UpdateGroupInput, } from './types.js';
|
|
45
|
+
export type { AddCircleMemberInput, CatalogData, CircleData, CircleMemberData, CreateCircleInput, DeleteCatalogData, DeleteCircleInput, GatheredPeer, GroupData, GroupMemberData, GroupRequestContext, HubServerDIDChangedData, InviteToGroupData, InviteToGroupInput, JoinGroupData, LeaveGroupData, LocalPeerAnnouncement, P2PContext, P2PJoinRequestContext, PeerCatchUpData, PeerGatherOptions, PresenceReason, RemoveCircleMemberInput, RemoveGroupMemberInput, StoreUnreadableMode, SyncPluginAPI, SyncRequestContext, SyncSessionResult, UpdateCircleInput, UpdateGroupInput, } from './types.js';
|
|
42
46
|
export type ReceiveConfig = {
|
|
43
47
|
/**
|
|
44
48
|
* Receiver storage mode for incoming peer mutations.
|
|
@@ -58,20 +62,32 @@ export type ReceiveConfig = {
|
|
|
58
62
|
export declare const DEFAULT_RECEIVE_CONFIG: ReceiveConfig;
|
|
59
63
|
export type P2PPluginOptions = {
|
|
60
64
|
autoAcceptPeers?: Array<string>;
|
|
65
|
+
/**
|
|
66
|
+
* How long `requestInviteToGroup` waits for its own Add commit to settle
|
|
67
|
+
* before returning the truthful pending shape (`invitePayload: null`,
|
|
68
|
+
* `request.status: PENDING`) instead of blocking further — the parked case,
|
|
69
|
+
* inviter offline. Test-only escape hatch — production omits it and runs on
|
|
70
|
+
* the 30s default; lets a headless test drive the park-then-pending path
|
|
71
|
+
* without waiting out the full production timeout.
|
|
72
|
+
*/
|
|
73
|
+
inviteCommitTimeoutMs?: number;
|
|
61
74
|
/**
|
|
62
75
|
* Expose the sync protocol over the HTTP plugin transport.
|
|
63
|
-
* - `true` / `{}` — enable at the default protocol path `'sync'
|
|
64
|
-
*
|
|
76
|
+
* - `true` / `{}` — enable at the default protocol path `'sync'`. CORS
|
|
77
|
+
* defaults to deny cross-origin browser requests.
|
|
65
78
|
* - `'name'` / `'/name'` — enable at the given protocol path.
|
|
66
|
-
* - `{ path?, allowedOrigin? }` — `path` is the protocol path
|
|
67
|
-
* `'sync'`); `allowedOrigin`
|
|
68
|
-
* The
|
|
69
|
-
*
|
|
79
|
+
* - `{ path?, allowedOrigin?, bodyLimit? }` — `path` is the protocol path
|
|
80
|
+
* (default `'sync'`); `allowedOrigin` opts into cross-origin (default deny).
|
|
81
|
+
* The sync server authenticates every request, so CORS is defense-in-depth
|
|
82
|
+
* rather than the security boundary; non-browser clients are unaffected.
|
|
83
|
+
* `bodyLimit` is the maximum request body size in bytes (default 1 MiB),
|
|
84
|
+
* enforced by the transport.
|
|
70
85
|
* - absent / `false` — HTTP sync transport disabled.
|
|
71
86
|
*/
|
|
72
87
|
http?: boolean | string | {
|
|
73
88
|
path?: string;
|
|
74
89
|
allowedOrigin?: string | Array<string>;
|
|
90
|
+
bodyLimit?: number;
|
|
75
91
|
};
|
|
76
92
|
/**
|
|
77
93
|
* Enable hub-mediated group broadcasts.
|
|
@@ -83,6 +99,17 @@ export type P2PPluginOptions = {
|
|
|
83
99
|
*/
|
|
84
100
|
hub?: boolean | {
|
|
85
101
|
createHubClient?: CreateHubClient;
|
|
102
|
+
/**
|
|
103
|
+
* Reconnect-backoff overrides for every hub adapter this device spawns.
|
|
104
|
+
* Test-only escape hatch — production omits it and runs on the adapter's
|
|
105
|
+
* defaults. Lets a headless multi-device test drive an offline/reconnect
|
|
106
|
+
* cycle without waiting out the ~1 s production base delay.
|
|
107
|
+
*/
|
|
108
|
+
reconnectBackoff?: {
|
|
109
|
+
baseMs?: number;
|
|
110
|
+
maxMs?: number;
|
|
111
|
+
jitter?: number;
|
|
112
|
+
};
|
|
86
113
|
};
|
|
87
114
|
/**
|
|
88
115
|
* Batch broadcast queue config. Sender-side mutation:apply broadcasts are
|
|
@@ -132,5 +159,14 @@ export type P2PPluginOptions = {
|
|
|
132
159
|
* regardless of whether locally-authored mutations are broadcast.
|
|
133
160
|
*/
|
|
134
161
|
forwarding?: ForwardingConfig;
|
|
162
|
+
/**
|
|
163
|
+
* How long a directed tunnel sync session waits with nothing arriving before
|
|
164
|
+
* giving up — how fast an unreachable peer is reported as one. Idle, not
|
|
165
|
+
* total: a session that keeps receiving frames never trips it.
|
|
166
|
+
*
|
|
167
|
+
* Test-only escape hatch; production omits it and runs on the 30s default,
|
|
168
|
+
* which a headless test would otherwise have to wait out per offline peer.
|
|
169
|
+
*/
|
|
170
|
+
tunnelIdleTimeoutMs?: number;
|
|
135
171
|
};
|
|
136
172
|
export declare function createP2PPlugin(options?: P2PPluginOptions): (params: PluginFactoryParams) => KubunPlugin;
|