@net-mesh/core 0.31.0 → 0.32.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/index.d.ts CHANGED
@@ -1,5 +1,16 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Keeps the served A2A services alive (returned by `NetMesh.serveA2a`).
5
+ * Dropping it or calling [`stop`](Self::stop) unregisters them.
6
+ */
7
+ export declare class A2aServeHandle {
8
+ /** Stop accepting A2A tasks (unregister the services). Idempotent. */
9
+ stop(): void
10
+ /** Whether the services are still registered. */
11
+ get serving(): boolean
12
+ }
13
+
3
14
  /**
4
15
  * Typed admin-event surface — one method per `AdminEvent`
5
16
  * variant. Each commits via the substrate's admin chain + returns
@@ -772,6 +783,138 @@ export declare class DeckClient {
772
783
  subscribeFailures(sinceSeq?: bigint | undefined | null): Promise<FailureStream>
773
784
  }
774
785
 
786
+ /**
787
+ * A `root → … → leaf` delegation chain that attributes a capability
788
+ * invocation to the terminal agent identity.
789
+ *
790
+ * Built with [`Self::derive_gateway`] and extended per-task with
791
+ * [`Self::extend_to_subagent`]. Verify it against a
792
+ * [`RevocationRegistry`] with [`Self::verify`]; serialize with
793
+ * [`Self::to_bytes`] to carry it.
794
+ */
795
+ export declare class DelegationChain {
796
+ /**
797
+ * Build a `root → machine → gateway` chain from opaque `Identity`
798
+ * handles. `root` and `machine` sign their own delegations; only
799
+ * `gateway`'s public entity-id is used (its keypair stays with the
800
+ * gateway). `ttlSeconds` is the grant lifetime; the whole chain
801
+ * expires together. `maxDepth` (default 4) leaves room for subagent
802
+ * hops.
803
+ */
804
+ static deriveGateway(root: Identity, machine: Identity, gateway: Identity, ttlSeconds: number, maxDepth?: number | undefined | null): DelegationChain
805
+ /**
806
+ * Parse a serialized chain. Throws `token: invalid_format` on an
807
+ * empty chain, too many links, or trailing garbage.
808
+ */
809
+ static fromBytes(data: Buffer): DelegationChain
810
+ /**
811
+ * Extend this chain with a `… → subagent` link, signed by the current
812
+ * leaf's owner (`leafSigner`, whose entity-id must equal the chain's
813
+ * current leaf subject — e.g. the gateway extending to a subagent).
814
+ * The subagent link drops the delegate right but keeps invoke
815
+ * authority, so its own calls verify and are individually
816
+ * attributable. Returns a new chain; the original is unchanged.
817
+ */
818
+ extendToSubagent(leafSigner: Identity, subagent: Buffer): DelegationChain
819
+ /**
820
+ * `true` if the chain still authorizes an invocation by `presenter`,
821
+ * anchored at `root`, honoring `registry`. Returns `false` (never
822
+ * throws) when the chain is expired, revoked, rooted elsewhere, or
823
+ * presented by the wrong identity — so a caller can gate a check on
824
+ * it directly. `skewSeconds` tolerates clock drift (default 0 =
825
+ * strict).
826
+ */
827
+ verify(presenter: Buffer, root: Buffer, registry: RevocationRegistry, skewSeconds?: number | undefined | null): boolean
828
+ /**
829
+ * The terminal (leaf) subject entity-id — the agent this chain
830
+ * attributes to (the gateway, or a subagent after
831
+ * [`Self::extend_to_subagent`]).
832
+ */
833
+ get leaf(): Buffer
834
+ /** The root issuer entity-id the chain anchors at. */
835
+ get root(): Buffer
836
+ /** The subject entity-id of each link, root-to-leaf. */
837
+ subjects(): Array<Buffer>
838
+ /**
839
+ * Serialize to wire bytes (a `TokenChain` blob) for carriage on an
840
+ * invoke or hand-off to another process.
841
+ */
842
+ toBytes(): Buffer
843
+ /**
844
+ * Number of delegation links (2 for a bare gateway chain, +1 per
845
+ * subagent hop).
846
+ */
847
+ get length(): number
848
+ }
849
+
850
+ /**
851
+ * A device's **persisted** enrollment — its own key + the
852
+ * `root → device` grant it received — so it survives restarts without
853
+ * re-pairing. The device seed stays in Rust (H8); [`Self::device`] hands
854
+ * back an opaque `Identity`.
855
+ */
856
+ export declare class DeviceEnrollment {
857
+ /**
858
+ * Bundle a device `Identity` handle with the `root → device` chain it
859
+ * received from `join`, the operator's `rendezvous` locator (from the
860
+ * invite, for renewal), and the unix-seconds it enrolled.
861
+ */
862
+ constructor(device: Identity, chain: DelegationChain, rendezvous: string, enrolledAt: bigint)
863
+ /**
864
+ * Load a persisted enrollment from `path`. Resolves `null` if none is
865
+ * saved yet; rejects on a corrupt file.
866
+ */
867
+ static load(path: string): Promise<DeviceEnrollment | null>
868
+ /**
869
+ * Persist to `path` (`0600`, atomic). Overwrites — e.g. after a
870
+ * renewal.
871
+ */
872
+ save(path: string): Promise<void>
873
+ /**
874
+ * The device's opaque `Identity` handle (its private seed stays in
875
+ * Rust) — use it to extend the grant to a gateway.
876
+ */
877
+ get device(): Identity
878
+ /** The `root → device` delegation chain. */
879
+ get chain(): DelegationChain
880
+ /**
881
+ * The operator's rendezvous locator — where the device dials to
882
+ * renew.
883
+ */
884
+ get rendezvous(): string
885
+ /** The mesh root the grant anchors at (32 bytes). */
886
+ get root(): Buffer
887
+ /** Unix-seconds the device enrolled. */
888
+ get enrolledAt(): bigint
889
+ /** Unix-seconds the grant expires. */
890
+ get expiresAt(): bigint
891
+ /**
892
+ * Whether the grant still verifies + is unexpired. Pass a
893
+ * `RevocationRegistry` (an empty one is fine device-side — the
894
+ * provider enforces revocation on invoke). `skewSeconds` tolerates
895
+ * clock drift (default 0 = strict).
896
+ */
897
+ isValid(revocation: RevocationRegistry, skewSeconds?: number | undefined | null): boolean
898
+ /**
899
+ * Whether the grant is within `windowSeconds` of expiry at `now`
900
+ * (unix secs) — the trigger for silent renewal.
901
+ */
902
+ needsRenewal(windowSeconds: number, now: bigint): boolean
903
+ }
904
+
905
+ /** One enrolled device in the operator's inventory. */
906
+ export declare class DeviceRecord {
907
+ /** The device entity-id (32 bytes). */
908
+ get device(): Buffer
909
+ get name(): string
910
+ get tags(): Array<string>
911
+ /** Unix-seconds the device enrolled. */
912
+ get enrolledAt(): bigint
913
+ /** Unix-seconds the device was revoked, or `null` while active. */
914
+ get revokedAt(): bigint | null
915
+ get isRevoked(): boolean
916
+ }
917
+
775
918
  /**
776
919
  * Open duplex RPC call. Combined send + receive surface. Use
777
920
  * `intoSplit()` to get independent `DuplexSink` + `DuplexStream`
@@ -911,6 +1054,18 @@ export declare class Encoding {
911
1054
  static defaultReedSolomon(): Encoding
912
1055
  }
913
1056
 
1057
+ /**
1058
+ * Keeps the served enrollment services alive (returned by
1059
+ * `NetMesh.serveEnrollmentAuto`). Dropping it or calling
1060
+ * [`stop`](Self::stop) unregisters them.
1061
+ */
1062
+ export declare class EnrollmentServeHandle {
1063
+ /** Stop serving enrollment (unregister the services). Idempotent. */
1064
+ stop(): void
1065
+ /** Whether the services are still registered. */
1066
+ get serving(): boolean
1067
+ }
1068
+
914
1069
  export declare class FailureStream {
915
1070
  nextRecord(): Promise<FailureRecordJs | null>
916
1071
  close(): Promise<void>
@@ -1056,6 +1211,87 @@ export declare class InMemoryChainReader {
1056
1211
  latestSeq(originHash: bigint): bigint | null
1057
1212
  }
1058
1213
 
1214
+ /**
1215
+ * A pre-authorization to *ask* to join a mesh — not a key. Carries the
1216
+ * mesh `root`, a `rendezvous` locator, a single-use nonce, and a short
1217
+ * TTL.
1218
+ */
1219
+ export declare class InviteToken {
1220
+ /**
1221
+ * Parse an invite string (`net-invite:<base64url>`). Throws on a
1222
+ * missing prefix, bad base64, or malformed bytes.
1223
+ */
1224
+ static decode(s: string): InviteToken
1225
+ /** Parse canonical wire bytes. */
1226
+ static fromBytes(data: Buffer): InviteToken
1227
+ /** The copy-paste / QR invite string. */
1228
+ encode(): string
1229
+ /** The mesh root entity-id this invite admits into (32 bytes). */
1230
+ get root(): Buffer
1231
+ /** The rendezvous locator the device dials (opaque transport string). */
1232
+ get rendezvous(): string
1233
+ /** Unix-seconds expiry. */
1234
+ get expiresAt(): bigint
1235
+ /** The displayed fingerprint of the mesh root — show it to the joiner. */
1236
+ rootFingerprint(): string
1237
+ /** Whether the invite has expired at `now` (unix secs). */
1238
+ isExpired(now: bigint): boolean
1239
+ /** Canonical wire bytes. */
1240
+ toBytes(): Buffer
1241
+ }
1242
+
1243
+ /**
1244
+ * The operator's response to a join request — the payload the enrollment
1245
+ * RPC returns to the device.
1246
+ */
1247
+ export declare class JoinOutcome {
1248
+ /** Parse canonical wire bytes. */
1249
+ static fromBytes(data: Buffer): JoinOutcome
1250
+ /** Canonical wire bytes. */
1251
+ toBytes(): Buffer
1252
+ /** `true` if the device was admitted. */
1253
+ get isAdmitted(): boolean
1254
+ /** The stable reject code (`1..=7`) if rejected, else `null`. */
1255
+ get rejectCode(): number | null
1256
+ /** The human reject message if rejected, else `null`. */
1257
+ get rejectMessage(): string | null
1258
+ /**
1259
+ * Device-side: verify the admitted grant anchors at the invited mesh
1260
+ * root (`inviteRoot`) and binds to this `device`, returning the
1261
+ * `DelegationChain`. Throws if the outcome was a rejection, or the
1262
+ * grant is untrusted (wrong root / wrong device) — defending the
1263
+ * joiner against a rogue operator.
1264
+ *
1265
+ * `&self` despite the `into_` name: a `#[napi]` method can't consume
1266
+ * `self` (the object is JS-owned), and the JS-facing name
1267
+ * deliberately mirrors the SDK's `JoinOutcome::into_chain` (pinned by
1268
+ * the Python binding and callers).
1269
+ */
1270
+ intoChain(device: Buffer, inviteRoot: Buffer): DelegationChain
1271
+ }
1272
+
1273
+ /** A device's request to join, signed by the device's own key. */
1274
+ export declare class JoinRequest {
1275
+ /**
1276
+ * Build + sign a request against `invite`. `device` is the opaque
1277
+ * `Identity` handle whose key is being enrolled (H8: seed stays in
1278
+ * Rust).
1279
+ */
1280
+ static create(device: Identity, name: string, tags: Array<string>, invite: InviteToken): JoinRequest
1281
+ /** Parse canonical wire bytes (does not verify the signature). */
1282
+ static fromBytes(data: Buffer): JoinRequest
1283
+ /** `true` if the device's self-signature verifies (it holds its key). */
1284
+ verifySelfSignature(): boolean
1285
+ /** The device entity-id (32 bytes). */
1286
+ get device(): Buffer
1287
+ /** The device-chosen name. */
1288
+ get name(): string
1289
+ /** The device-chosen tags. */
1290
+ get tags(): Array<string>
1291
+ /** Canonical wire bytes. */
1292
+ toBytes(): Buffer
1293
+ }
1294
+
1059
1295
  /**
1060
1296
  * Inbound request-stream handle for client-streaming + duplex
1061
1297
  * server handlers. Drain via `await stream.next()` until it
@@ -2038,6 +2274,84 @@ export declare class NetDb {
2038
2274
  * ```
2039
2275
  */
2040
2276
  export declare class NetMesh {
2277
+ /**
2278
+ * **Executor side.** Serve the A2A task lifecycle on this node, backed
2279
+ * by a JS **async** task executor
2280
+ * `(brief: TaskBriefJs) => Promise<string>` returning the result's
2281
+ * artifact ref, with a fresh task registry. Hold the resolved handle
2282
+ * to keep accepting tasks; call `handle.stop()` before `shutdown()`.
2283
+ * This node must be `start()`ed. (Requires the `a2a` feature.)
2284
+ *
2285
+ * `options.handlerTimeoutMs` bounds how long the executor may take to
2286
+ * settle each task's Promise (default 1 hour; `0` disables) — past the
2287
+ * deadline the task records a `Failed` terminal state instead of
2288
+ * staying `Running` forever behind a wedged event loop.
2289
+ *
2290
+ * Sync setup (the `Function` is `!Send`, so the TSFN is built on the
2291
+ * JS thread), then `spawn_future` for the registration — the SDK's
2292
+ * `serve_rpc` spawns a response-drainer task, which needs the tokio
2293
+ * runtime context only the future has (the `publish.rs` shape).
2294
+ */
2295
+ serveA2a(executor: (arg: TaskBriefJs) => Promise<string>, options?: ServeA2aOptions | undefined | null): Promise<A2aServeHandle>
2296
+ /**
2297
+ * **Requester side.** Hand `prompt` (+ optional Datafort `contextRefs`
2298
+ * + routing `tags`) to the executor at `targetNodeId`; resolves the
2299
+ * accepted task id. Rejects if the executor refused the brief. The
2300
+ * node must already be connected to `targetNodeId`. (Requires the
2301
+ * `a2a` feature.)
2302
+ */
2303
+ submitTask(targetNodeId: bigint, prompt: string, contextRefs?: Array<string> | undefined | null, tags?: Array<string> | undefined | null): Promise<string>
2304
+ /**
2305
+ * **Requester side.** The executor's status record for `taskId` as a
2306
+ * JSON string (`{brief, state, updated_at}`), or `null` if the
2307
+ * executor doesn't know it. (Requires the `a2a` feature.)
2308
+ */
2309
+ taskStatus(targetNodeId: bigint, taskId: string): Promise<string | null>
2310
+ /**
2311
+ * **Requester side.** Cancel `taskId` on the executor; resolves
2312
+ * whether it was in flight. The executor's select observes the token
2313
+ * and the task state flips to `cancelled` — the JS handler's eventual
2314
+ * result is discarded (see the module docs on one-sided
2315
+ * cancellation). (Requires the `a2a` feature.)
2316
+ */
2317
+ cancelTask(targetNodeId: bigint, taskId: string): Promise<boolean>
2318
+ /**
2319
+ * The invite `rendezvous` locator for this node (addr + Noise pubkey
2320
+ * + node id), to pass to `OperatorEnrollment.invite`. Devices dial it
2321
+ * via `join`. (Requires the `delegation` feature.)
2322
+ */
2323
+ rendezvousString(): string
2324
+ /**
2325
+ * Device-side enrollment: enroll `device`'s key into the mesh named
2326
+ * by the `invite` string, under `name` + `tags`, returning the
2327
+ * verified `root → device` `DelegationChain`. This node must be
2328
+ * `start()`ed and built with `permissiveChannels: true` (the
2329
+ * enrollment nRPC uses dynamic per-caller reply channels the strict
2330
+ * registry rejects). (Requires the `delegation` feature.)
2331
+ */
2332
+ join(device: Identity, invite: string, name: string, tags?: Array<string> | undefined | null): Promise<DelegationChain>
2333
+ /**
2334
+ * Operator-side: serve the full device lifecycle on this node (auto —
2335
+ * the invite is the authorization): **enroll** (join) + **renew**.
2336
+ * Hold the resolved handle for as long as enrollment should stay
2337
+ * open; call `handle.stop()` before `shutdown()`. This node must be
2338
+ * `start()`ed and built with `permissiveChannels: true`. (Requires
2339
+ * the `delegation` feature.)
2340
+ *
2341
+ * `async` although the registration itself is synchronous: the SDK's
2342
+ * `serve_rpc` spawns a response-drainer task, which needs the tokio
2343
+ * runtime context napi only provides to `async fn`s — a plain sync
2344
+ * method here panics with "no reactor running" (the same reason the
2345
+ * Python binding wraps this in `runtime.enter()`).
2346
+ */
2347
+ serveEnrollmentAuto(operator: OperatorEnrollment, grantTtlSeconds: number, maxDepth?: number | undefined | null): Promise<EnrollmentServeHandle>
2348
+ /**
2349
+ * Device-side renewal: refresh the grant carried by `enrollment` over
2350
+ * the mesh, returning the verified **fresh** `root → device`
2351
+ * `DelegationChain`. This node must be `start()`ed and built with
2352
+ * `permissiveChannels: true`. (Requires the `delegation` feature.)
2353
+ */
2354
+ renew(enrollment: DeviceEnrollment): Promise<DelegationChain>
2041
2355
  /**
2042
2356
  * Publish this node's island-topology record (host forced to self).
2043
2357
  * Self-indexed locally + broadcast to peers; returns the peer
@@ -2118,6 +2432,12 @@ export declare class NetMesh {
2118
2432
  * Declared `async` so napi-rs invokes it with an active
2119
2433
  * tokio runtime — `MeshNode::start()` spawns background
2120
2434
  * tasks via `tokio::spawn` and panics outside a reactor.
2435
+ *
2436
+ * Uses `start_arc` (like the C FFI and the Rust SDK) so
2437
+ * the Arc-scoped lifecycle loops run too: periodic
2438
+ * capability re-announce (with the reflex-diff
2439
+ * re-classify trigger) and — when `autoDirectUpgrade`
2440
+ * is set — the background direct-path upgrade.
2121
2441
  */
2122
2442
  start(): Promise<void>
2123
2443
  /** Send raw bytes to a direct peer. */
@@ -2405,11 +2725,16 @@ export declare class NetMesh {
2405
2725
  */
2406
2726
  reclassifyNat(): Promise<void>
2407
2727
  /**
2408
- * Cumulative NAT-traversal counters for this mesh.
2409
- * Object shape: `{ punchesAttempted, punchesSucceeded,
2410
- * relayFallbacks }` — all u64 bigints, monotonic, never
2411
- * reset. Useful for telemetry on punch success rate and
2412
- * relay load.
2728
+ * Cumulative NAT-traversal counters for this mesh — the
2729
+ * full stage-5 snapshot: punch attempt/success/derived-
2730
+ * failure counts, the three failure-cause counters
2731
+ * (timeouts / rejections / no-relay), background-upgrade
2732
+ * activity, and port-mapping state. Base counters are
2733
+ * monotonic and never reset (`punchesFailed` is derived
2734
+ * and can decrease while a punch is in flight;
2735
+ * `portMappingRenewals` resets on a fresh install —
2736
+ * difference only the base counters). Useful for
2737
+ * telemetry on punch success rate and relay load.
2413
2738
  */
2414
2739
  traversalStats(): TraversalStats
2415
2740
  /**
@@ -2431,6 +2756,18 @@ export declare class NetMesh {
2431
2756
  * handshake error.
2432
2757
  */
2433
2758
  connectDirect(peerNodeId: bigint, peerPublicKey: Buffer, coordinator: bigint): Promise<void>
2759
+ /**
2760
+ * Like `connectDirect`, but auto-selects the rendezvous
2761
+ * coordinator: the relay currently forwarding to the
2762
+ * peer, then a `relay-capable` mutual peer, then any
2763
+ * mutual peer.
2764
+ *
2765
+ * **Optimization, not correctness.** Punch-needing pairs
2766
+ * with no coordinator candidate reject with
2767
+ * `traversal: rendezvous-no-relay` — the caller simply
2768
+ * stays on the routed path, which is always available.
2769
+ */
2770
+ connectDirectAuto(peerNodeId: bigint, peerPublicKey: Buffer): Promise<void>
2434
2771
  /**
2435
2772
  * Install a runtime reflex override. Forces `natType()`
2436
2773
  * to `"open"` and `reflexAddr()` to `external`
@@ -2471,6 +2808,71 @@ export declare class NetStream {
2471
2808
  get streamId(): bigint
2472
2809
  }
2473
2810
 
2811
+ /**
2812
+ * The operator side: mint invites, approve join requests into
2813
+ * `root → device` delegations, and manage the device inventory —
2814
+ * composing the enrollment authority + device registry + revocation
2815
+ * store for one mesh root.
2816
+ */
2817
+ export declare class OperatorEnrollment {
2818
+ /**
2819
+ * Build a coordinator for the `root` `Identity` handle, with explicit
2820
+ * device-registry and revocation-store paths.
2821
+ */
2822
+ constructor(root: Identity, registryPath: string, revocationPath: string)
2823
+ /**
2824
+ * Build using the per-user default store paths (the same
2825
+ * machine-shared files the CLI and a `net wrap` provider converge
2826
+ * on). Throws if neither path resolves.
2827
+ */
2828
+ static withDefaultPaths(root: Identity): OperatorEnrollment
2829
+ /** The mesh root entity-id (32 bytes). */
2830
+ get rootId(): Buffer
2831
+ /** The displayed fingerprint of the mesh root. */
2832
+ rootFingerprint(): string
2833
+ /**
2834
+ * Mint an invite for this mesh valid for `ttlSeconds`, tracking it so
2835
+ * a later `approve` can match a request to it. `rendezvous` is the
2836
+ * transport locator devices dial (e.g. `NetMesh.rendezvousString()`).
2837
+ */
2838
+ invite(rendezvous: string, ttlSeconds: number): InviteToken
2839
+ /**
2840
+ * Approve an arriving request (auto — invite-as-authorization),
2841
+ * reading the system clock: run the fail-closed checks, record the
2842
+ * device, retire the single-use invite, and return the
2843
+ * `root → device` `DelegationChain`. Rejects on any refusal
2844
+ * (unknown/expired/wrong invite, bad signature). Runs off the JS
2845
+ * thread (store file IO).
2846
+ */
2847
+ approve(request: JoinRequest, grantTtlSeconds: number, maxDepth?: number | undefined | null): Promise<DelegationChain>
2848
+ /**
2849
+ * The **server-side** handler: turn serialized `JoinRequest` bytes
2850
+ * into serialized `JoinOutcome` bytes (auto — invite-as-
2851
+ * authorization). This is what the enrollment RPC moves; a JS host
2852
+ * can serve enrollment by feeding it received request bytes and
2853
+ * returning the outcome bytes. Never throws — a malformed request or
2854
+ * a rejection is a coded `JoinOutcome`.
2855
+ */
2856
+ handleJoinRequest(requestBytes: Buffer, grantTtlSeconds: number, maxDepth?: number | undefined | null): Promise<Buffer>
2857
+ /**
2858
+ * Revoke a device: raise its revocation floor (kills all current
2859
+ * delegations) and stamp the inventory. Reads the system clock.
2860
+ */
2861
+ revoke(device: Buffer): Promise<void>
2862
+ /** The enrolled devices in the inventory. */
2863
+ devices(): Promise<Array<DeviceRecord>>
2864
+ /**
2865
+ * Prune a device from the inventory entirely (orthogonal to revoking
2866
+ * its floor). Returns whether a record existed.
2867
+ */
2868
+ forget(device: Buffer): Promise<boolean>
2869
+ /**
2870
+ * Outstanding (minted, unredeemed, unexpired at `now` unix-secs)
2871
+ * invites.
2872
+ */
2873
+ pendingInvites(now: bigint): Array<InviteToken>
2874
+ }
2875
+
2474
2876
  /**
2475
2877
  * Operator identity. Operator id is the keypair's 64-bit origin
2476
2878
  * hash. Construct via `generate()` (tests) or `fromSeed(buffer)`
@@ -3034,6 +3436,49 @@ export declare class ReplicaGroup {
3034
3436
  get healthyCount(): number
3035
3437
  }
3036
3438
 
3439
+ /**
3440
+ * Shared per-issuer revocation floor. Bumping an issuer's floor
3441
+ * invalidates every outstanding delegation from that issuer — including
3442
+ * delegated children — the moment `verify` next runs.
3443
+ *
3444
+ * One registry is shared by a gateway and all its subagents (Arc-backed),
3445
+ * so a revoke is observed by every chain that verifies against it.
3446
+ */
3447
+ export declare class RevocationRegistry {
3448
+ /** A fresh registry — every issuer's floor is implicitly 0. */
3449
+ constructor()
3450
+ /**
3451
+ * Set `issuer`'s floor to `generation`. Any token from `issuer` with
3452
+ * `issuer_generation < generation` is rejected on the next verify.
3453
+ * Monotonic: a value <= the current floor is a no-op.
3454
+ */
3455
+ revokeBelow(issuer: Buffer, generation: number): void
3456
+ /**
3457
+ * Convenience: revoke every generation-0 delegation from `issuer`
3458
+ * (bumps the floor to 1). Revoking the *machine* identity kills its
3459
+ * gateway chain and, transitively, that gateway's subagents — while a
3460
+ * different machine's chain is untouched.
3461
+ */
3462
+ revoke(issuer: Buffer): void
3463
+ /** The current revocation floor for `issuer` (0 if never revoked). */
3464
+ floor(issuer: Buffer): number
3465
+ /**
3466
+ * Reload the machine-shared revocation floors at `path` into this
3467
+ * registry (monotonic — floors only ever rise, so re-loading is
3468
+ * idempotent and composes with any in-process `revoke`). A missing
3469
+ * store file is a no-op (nothing revoked yet); an unreadable or
3470
+ * corrupt store rejects.
3471
+ *
3472
+ * This is what lets a *caller's* self-check observe an operator's
3473
+ * `net identity revoke` — written to the same file a
3474
+ * `net wrap --owner-root` provider honors — so a revoked chain fails
3475
+ * [`DelegationChain::verify`] on the caller side too, not only when
3476
+ * the provider re-verifies. Use [`default_revocation_store_path`]
3477
+ * (or the `NET_MESH_REVOCATION_STORE` override) for `path`.
3478
+ */
3479
+ loadFromStore(path: string): Promise<void>
3480
+ }
3481
+
3037
3482
  /**
3038
3483
  * Open streaming RPC call. Yields chunks via `next()` until EOF
3039
3484
  * (returns `null`). Drop OR explicit `close()` emits CANCEL to
@@ -4074,6 +4519,16 @@ export declare function decodeJoined(row: ResultRow): JoinedRow | null
4074
4519
  */
4075
4520
  export declare function decodeWindow(row: ResultRow): WindowBoundary | null
4076
4521
 
4522
+ /**
4523
+ * The per-user default revocation-store path — the same file a
4524
+ * `net wrap --owner-root` provider honors and `net identity revoke`
4525
+ * writes — or `null` if neither a data-local nor a home directory
4526
+ * resolves. Pass it (or the `NET_MESH_REVOCATION_STORE` override) to
4527
+ * [`RevocationRegistry::load_from_store`] so a caller-side check
4528
+ * observes an operator revocation.
4529
+ */
4530
+ export declare function defaultRevocationStorePath(): string | null
4531
+
4077
4532
  /**
4078
4533
  * Delegate a token to a new subject. The `parent_bytes` token must
4079
4534
  * have `delegation_depth > 0` and include the `delegate` scope; the
@@ -4081,6 +4536,18 @@ export declare function decodeWindow(row: ResultRow): WindowBoundary | null
4081
4536
  */
4082
4537
  export declare function delegateToken(signer: Identity, parentBytes: Buffer, newSubject: Buffer, restrictedScope: Array<string>): Buffer
4083
4538
 
4539
+ /**
4540
+ * Derive a stable child `Identity` handle from `parent` under `label`.
4541
+ *
4542
+ * Deterministic (blake3 KDF over the parent seed), so a machine / gateway
4543
+ * identity is reproducible across restarts from the root alone — no extra
4544
+ * persistence, and every process that holds the root derives the same
4545
+ * child. The returned handle owns its keypair; the private seed is never
4546
+ * exposed (H8). `label` namespaces siblings, e.g. `"machine:hostA"` vs
4547
+ * `"gateway:hostA:hermes"`.
4548
+ */
4549
+ export declare function deriveChildIdentity(parent: Identity, label: string): Identity
4550
+
4084
4551
  /**
4085
4552
  * One env addition passed to the wrapped server — only the KEY drives
4086
4553
  * classification; the value is never inspected beyond presence and never
@@ -4124,6 +4591,13 @@ export interface FailureRecordJs {
4124
4591
  recordedAtMs: bigint
4125
4592
  }
4126
4593
 
4594
+ /**
4595
+ * A short, human-comparable fingerprint of an entity-id (the 32-byte
4596
+ * ed25519 public key), shown on both sides of a join so a human can
4597
+ * confirm the mesh identity matches — `A1B2-C3D4-E5F6-0789`.
4598
+ */
4599
+ export declare function fingerprint(entity: Buffer): string
4600
+
4127
4601
  export interface ForkGroupConfigJs {
4128
4602
  forkCount: number
4129
4603
  lbStrategy: StrategyJs
@@ -4137,6 +4611,13 @@ export interface ForkRecordJs {
4137
4611
  fromSnapshotSeq?: bigint
4138
4612
  }
4139
4613
 
4614
+ /**
4615
+ * The well-known channel every gateway delegation binds to (never
4616
+ * actually published to). Exported so JS callers and tests can
4617
+ * reference the exact string.
4618
+ */
4619
+ export const GATEWAY_DELEGATION_CHANNEL: string
4620
+
4140
4621
  /**
4141
4622
  * Generate a new Net keypair for encrypted UDP transport.
4142
4623
  *
@@ -4683,6 +5164,22 @@ export interface MeshOptions {
4683
5164
  * without `--features port-mapping`.
4684
5165
  */
4685
5166
  tryPortMapping?: boolean
5167
+ /**
5168
+ * Enable the background direct-path upgrade: once a
5169
+ * session to a peer is established via a relay, the mesh
5170
+ * opportunistically re-handshakes over a direct path and
5171
+ * migrates the session, cutting relay hops out of the
5172
+ * data plane. The swap is guarded by a migration
5173
+ * contract (lower-id initiator, compare-and-swap
5174
+ * install, busy-session deferral) so in-flight work is
5175
+ * never dropped.
5176
+ *
5177
+ * **Optimization, not correctness** — traffic rides the
5178
+ * relay until (and unless) a direct path lands. Default
5179
+ * `false`. Silently ignored when the binding was built
5180
+ * without `--features nat-traversal`.
5181
+ */
5182
+ autoDirectUpgrade?: boolean
4686
5183
  /**
4687
5184
  * Opt out of channel authorization: when `true`, no
4688
5185
  * `ChannelConfigRegistry` is installed on the node, so
@@ -5518,6 +6015,20 @@ export interface ScopeFilterJs {
5518
6015
  regions?: Array<string>
5519
6016
  }
5520
6017
 
6018
+ /** Optional knobs for [`NetMesh::serve_a2a`]. */
6019
+ export interface ServeA2aOptions {
6020
+ /**
6021
+ * Per-task budget in milliseconds for the JS executor to settle its
6022
+ * Promise (the handler returning the Promise + that Promise
6023
+ * resolving, one deadline across both). Default `3600000` (1 hour).
6024
+ * Past it the task records a `Failed` terminal state. Pass `0` to
6025
+ * disable the deadline entirely (Python-binding parity, where
6026
+ * cancellation is the only control) — a wedged event loop then leaves
6027
+ * the task `Running` until a requester cancels it.
6028
+ */
6029
+ handlerTimeoutMs?: number
6030
+ }
6031
+
5521
6032
  /**
5522
6033
  * Per-service caller- + server-side nRPC counters at a point
5523
6034
  * in time. Element of [`RpcMetricsSnapshotJs::services`].
@@ -5716,6 +6227,21 @@ export interface Task {
5716
6227
  updatedNs: bigint
5717
6228
  }
5718
6229
 
6230
+ /** The brief handed to the JS task executor. */
6231
+ export interface TaskBriefJs {
6232
+ /** The registry-assigned task id (poll / cancel by this). */
6233
+ taskId: string
6234
+ /** What to do. */
6235
+ prompt: string
6236
+ /**
6237
+ * Datafort refs carrying the task's context (the executor doesn't
6238
+ * share the requester's memory).
6239
+ */
6240
+ contextRefs: Array<string>
6241
+ /** Routing / bookkeeping tags. */
6242
+ tags: Array<string>
6243
+ }
6244
+
5719
6245
  /**
5720
6246
  * Filter for [`TasksAdapter::list_tasks`] and
5721
6247
  * [`TasksAdapter::watch_tasks`].
@@ -5858,9 +6384,14 @@ export declare function transferStreamId(nonce: bigint): bigint
5858
6384
 
5859
6385
  /**
5860
6386
  * Cumulative NAT-traversal counters surfaced via
5861
- * `NetMesh.traversalStats()`. All counters are monotonic u64s
5862
- * and never reset — subtract snapshots for deltas. Exposed as
5863
- * BigInt because JavaScript numbers can't round-trip full u64.
6387
+ * `NetMesh.traversalStats()`. Base counters are monotonic u64s
6388
+ * and never reset — subtract snapshots for deltas — with two
6389
+ * exemptions: `punchesFailed` is derived at snapshot time
6390
+ * (`attempted - succeeded`) and can decrease when an in-flight
6391
+ * punch lands, and `portMappingRenewals` resets to zero on each
6392
+ * fresh mapping install. Difference only the base counters for
6393
+ * rates. Exposed as BigInt because JavaScript numbers can't
6394
+ * round-trip full u64.
5864
6395
  *
5865
6396
  * Framing reminder (plan §5): NAT traversal is an optimization,
5866
6397
  * not a connectivity requirement. `relay_fallbacks` isn't a
@@ -5870,8 +6401,8 @@ export declare function transferStreamId(nonce: bigint): bigint
5870
6401
  */
5871
6402
  export interface TraversalStats {
5872
6403
  /**
5873
- * Number of hole-punch attempts the pair-type matrix
5874
- * elected to initiate. Bumps once per attempt, whether the
6404
+ * Number of hole-punch attempts whose coordinator mediation
6405
+ * succeeded. Bumps once per mediated attempt, whether the
5875
6406
  * punch eventually succeeds or falls back.
5876
6407
  */
5877
6408
  punchesAttempted: bigint
@@ -5881,6 +6412,12 @@ export interface TraversalStats {
5881
6412
  * punch-failure rate.
5882
6413
  */
5883
6414
  punchesSucceeded: bigint
6415
+ /**
6416
+ * **Derived** at snapshot time: `punchesAttempted -
6417
+ * punchesSucceeded` (a punch in flight counts as failed
6418
+ * until it resolves).
6419
+ */
6420
+ punchesFailed: bigint
5884
6421
  /**
5885
6422
  * Number of `connect_direct` resolutions that stayed on
5886
6423
  * the routed-handshake path — matrix-skipped pairs plus
@@ -5889,6 +6426,51 @@ export interface TraversalStats {
5889
6426
  * this counter.
5890
6427
  */
5891
6428
  relayFallbacks: bigint
6429
+ /**
6430
+ * Punch flows that gave up on a deadline. Failure *cause*
6431
+ * counter — includes pre-mediation introduce-wait timeouts,
6432
+ * so not a partition of `punchesFailed`.
6433
+ */
6434
+ punchTimeouts: bigint
6435
+ /**
6436
+ * Punch flows refused by a typed coordinator reject
6437
+ * (rate-limited / unknown target reflex / no session with
6438
+ * target / reflex mismatch). Cause counter.
6439
+ */
6440
+ punchRejections: bigint
6441
+ /**
6442
+ * Punch-needing pairs skipped because no rendezvous
6443
+ * coordinator candidate existed. Cause counter; the caller
6444
+ * stayed on the routed path.
6445
+ */
6446
+ rendezvousNoRelay: bigint
6447
+ /** Background direct-path upgrades started. */
6448
+ upgradesAttempted: bigint
6449
+ /**
6450
+ * Upgrades that replaced a relay-routed session with a
6451
+ * punched direct session.
6452
+ */
6453
+ upgradesSucceeded: bigint
6454
+ /**
6455
+ * Upgrades deferred because the session was busy (open
6456
+ * streams / unacked data). Retried later; not failures.
6457
+ */
6458
+ upgradesDeferredBusy: bigint
6459
+ /**
6460
+ * `true` while a UPnP / NAT-PMP / PCP port mapping is
6461
+ * installed on the operator's router.
6462
+ */
6463
+ portMappingActive: boolean
6464
+ /**
6465
+ * Mapped external `"ip:port"`, or `null` when no mapping is
6466
+ * active.
6467
+ */
6468
+ portMappingExternal?: string
6469
+ /**
6470
+ * Successful renewal ticks since the current mapping was
6471
+ * installed. Resets on a fresh install.
6472
+ */
6473
+ portMappingRenewals: bigint
5892
6474
  }
5893
6475
 
5894
6476
  /**
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@net-mesh/core-android-arm64')
79
79
  const bindingPackageVersion = require('@net-mesh/core-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@net-mesh/core-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@net-mesh/core-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@net-mesh/core-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@net-mesh/core-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@net-mesh/core-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@net-mesh/core-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@net-mesh/core-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@net-mesh/core-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@net-mesh/core-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@net-mesh/core-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@net-mesh/core-darwin-universal')
184
184
  const bindingPackageVersion = require('@net-mesh/core-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@net-mesh/core-darwin-x64')
200
200
  const bindingPackageVersion = require('@net-mesh/core-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@net-mesh/core-darwin-arm64')
216
216
  const bindingPackageVersion = require('@net-mesh/core-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@net-mesh/core-freebsd-x64')
236
236
  const bindingPackageVersion = require('@net-mesh/core-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@net-mesh/core-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@net-mesh/core-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@net-mesh/core-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@net-mesh/core-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@net-mesh/core-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@net-mesh/core-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@net-mesh/core-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@net-mesh/core-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@net-mesh/core-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@net-mesh/core-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@net-mesh/core-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@net-mesh/core-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@net-mesh/core-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@net-mesh/core-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@net-mesh/core-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@net-mesh/core-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@net-mesh/core-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@net-mesh/core-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@net-mesh/core-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@net-mesh/core-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@net-mesh/core-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@net-mesh/core-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@net-mesh/core-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@net-mesh/core-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@net-mesh/core-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@net-mesh/core-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@net-mesh/core-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@net-mesh/core-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@net-mesh/core-openharmony-x64')
494
494
  const bindingPackageVersion = require('@net-mesh/core-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@net-mesh/core-openharmony-arm')
510
510
  const bindingPackageVersion = require('@net-mesh/core-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.31.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.31.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.32.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.32.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -587,6 +587,7 @@ if (!nativeBinding) {
587
587
  }
588
588
 
589
589
  module.exports = nativeBinding
590
+ module.exports.A2aServeHandle = nativeBinding.A2aServeHandle
590
591
  module.exports.AdminCommands = nativeBinding.AdminCommands
591
592
  module.exports.AdminVerifier = nativeBinding.AdminVerifier
592
593
  module.exports.AuditQuery = nativeBinding.AuditQuery
@@ -601,10 +602,14 @@ module.exports.ConsentPolicy = nativeBinding.ConsentPolicy
601
602
  module.exports.DaemonHandle = nativeBinding.DaemonHandle
602
603
  module.exports.DaemonRuntime = nativeBinding.DaemonRuntime
603
604
  module.exports.DeckClient = nativeBinding.DeckClient
605
+ module.exports.DelegationChain = nativeBinding.DelegationChain
606
+ module.exports.DeviceEnrollment = nativeBinding.DeviceEnrollment
607
+ module.exports.DeviceRecord = nativeBinding.DeviceRecord
604
608
  module.exports.DuplexCall = nativeBinding.DuplexCall
605
609
  module.exports.DuplexSink = nativeBinding.DuplexSink
606
610
  module.exports.DuplexStream = nativeBinding.DuplexStream
607
611
  module.exports.Encoding = nativeBinding.Encoding
612
+ module.exports.EnrollmentServeHandle = nativeBinding.EnrollmentServeHandle
608
613
  module.exports.FailureStream = nativeBinding.FailureStream
609
614
  module.exports.FoldQueryClient = nativeBinding.FoldQueryClient
610
615
  module.exports.ForkGroup = nativeBinding.ForkGroup
@@ -612,6 +617,9 @@ module.exports.IceCommands = nativeBinding.IceCommands
612
617
  module.exports.IceProposal = nativeBinding.IceProposal
613
618
  module.exports.Identity = nativeBinding.Identity
614
619
  module.exports.InMemoryChainReader = nativeBinding.InMemoryChainReader
620
+ module.exports.InviteToken = nativeBinding.InviteToken
621
+ module.exports.JoinOutcome = nativeBinding.JoinOutcome
622
+ module.exports.JoinRequest = nativeBinding.JoinRequest
615
623
  module.exports.JsRequestStream = nativeBinding.JsRequestStream
616
624
  module.exports.JsResponseSink = nativeBinding.JsResponseSink
617
625
  module.exports.LocalPublicationHandle = nativeBinding.LocalPublicationHandle
@@ -631,6 +639,7 @@ module.exports.Net = nativeBinding.Net
631
639
  module.exports.NetDb = nativeBinding.NetDb
632
640
  module.exports.NetMesh = nativeBinding.NetMesh
633
641
  module.exports.NetStream = nativeBinding.NetStream
642
+ module.exports.OperatorEnrollment = nativeBinding.OperatorEnrollment
634
643
  module.exports.OperatorIdentity = nativeBinding.OperatorIdentity
635
644
  module.exports.OperatorRegistry = nativeBinding.OperatorRegistry
636
645
  module.exports.PaymentProvider = nativeBinding.PaymentProvider
@@ -642,6 +651,7 @@ module.exports.RedexTailIter = nativeBinding.RedexTailIter
642
651
  module.exports.RedisStreamDedup = nativeBinding.RedisStreamDedup
643
652
  module.exports.RegistryClient = nativeBinding.RegistryClient
644
653
  module.exports.ReplicaGroup = nativeBinding.ReplicaGroup
654
+ module.exports.RevocationRegistry = nativeBinding.RevocationRegistry
645
655
  module.exports.RpcStream = nativeBinding.RpcStream
646
656
  module.exports.ServeHandle = nativeBinding.ServeHandle
647
657
  module.exports.ShardGroup = nativeBinding.ShardGroup
@@ -675,7 +685,11 @@ module.exports.DATAFORTS_BLOB_TREE_SUPPORTED = nativeBinding.DATAFORTS_BLOB_TREE
675
685
  module.exports.decodeAggregate = nativeBinding.decodeAggregate
676
686
  module.exports.decodeJoined = nativeBinding.decodeJoined
677
687
  module.exports.decodeWindow = nativeBinding.decodeWindow
688
+ module.exports.defaultRevocationStorePath = nativeBinding.defaultRevocationStorePath
678
689
  module.exports.delegateToken = nativeBinding.delegateToken
690
+ module.exports.deriveChildIdentity = nativeBinding.deriveChildIdentity
691
+ module.exports.fingerprint = nativeBinding.fingerprint
692
+ module.exports.GATEWAY_DELEGATION_CHANNEL = nativeBinding.GATEWAY_DELEGATION_CHANNEL
679
693
  module.exports.generateNetKeypair = nativeBinding.generateNetKeypair
680
694
  module.exports.isBlobRef = nativeBinding.isBlobRef
681
695
  module.exports.isTransferStreamId = nativeBinding.isTransferStreamId
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@net-mesh/core",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "High-performance, schema-agnostic event bus for AI runtime workloads",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -80,9 +80,9 @@
80
80
  },
81
81
  "scripts": {
82
82
  "artifacts": "napi artifacts",
83
- "build": "napi build --platform --release --features redis,net,cortex,compute,groups,meshos,deck,meshdb,aggregator",
84
- "build:debug": "napi build --platform --features redis,net,cortex,compute,groups,meshos,deck,meshdb,aggregator",
85
- "build:test": "napi build --platform --features redis,net,cortex,compute,groups,meshos,deck,meshdb,aggregator,test-helpers",
83
+ "build": "napi build --platform --release --features redis,net,cortex,compute,groups,meshos,deck,meshdb,aggregator,delegation,a2a",
84
+ "build:debug": "napi build --platform --features redis,net,cortex,compute,groups,meshos,deck,meshdb,aggregator,delegation,a2a",
85
+ "build:test": "napi build --platform --features redis,net,cortex,compute,groups,meshos,deck,meshdb,aggregator,delegation,a2a,test-helpers",
86
86
  "build:ts": "tsc -p tsconfig.build.json",
87
87
  "prepublishOnly": "npm run build:ts && napi prepublish -t npm",
88
88
  "test": "vitest run",
@@ -97,13 +97,13 @@
97
97
  "node": ">=20"
98
98
  },
99
99
  "optionalDependencies": {
100
- "@net-mesh/core-win32-x64-msvc": "0.31.0",
101
- "@net-mesh/core-win32-arm64-msvc": "0.31.0",
102
- "@net-mesh/core-darwin-x64": "0.31.0",
103
- "@net-mesh/core-darwin-arm64": "0.31.0",
104
- "@net-mesh/core-linux-x64-gnu": "0.31.0",
105
- "@net-mesh/core-linux-x64-musl": "0.31.0",
106
- "@net-mesh/core-linux-arm64-gnu": "0.31.0",
107
- "@net-mesh/core-linux-arm64-musl": "0.31.0"
100
+ "@net-mesh/core-win32-x64-msvc": "0.32.0",
101
+ "@net-mesh/core-win32-arm64-msvc": "0.32.0",
102
+ "@net-mesh/core-darwin-x64": "0.32.0",
103
+ "@net-mesh/core-darwin-arm64": "0.32.0",
104
+ "@net-mesh/core-linux-x64-gnu": "0.32.0",
105
+ "@net-mesh/core-linux-x64-musl": "0.32.0",
106
+ "@net-mesh/core-linux-arm64-gnu": "0.32.0",
107
+ "@net-mesh/core-linux-arm64-musl": "0.32.0"
108
108
  }
109
109
  }