@agentplat/mesh 0.3.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # `@agentplat/mesh`
2
+
3
+ Provider-neutral state, input and effect contracts for independently executing
4
+ AgentPlat peers.
5
+
6
+ The package is additive to the existing Runtime, Sessions and Rooms surfaces.
7
+ Its peer kernel is defined as a synchronous state transition:
8
+
9
+ ```text
10
+ state + input + logical time -> next state + ordered effects
11
+ ```
12
+
13
+ The Alpha 1 implementation provides:
14
+
15
+ - deeply immutable peer, admission, liveness and replay snapshots;
16
+ - a synchronous pure reducer for lifecycle inputs, outbound liveness probes
17
+ and effect results;
18
+ - the `processMeshEnvelope` coordinator, which applies context, cryptographic
19
+ verification, preprovisioned admission, authority, replay, idempotency and
20
+ causality before invoking a reducer;
21
+ - a 2,048-position sequence window per admitted peer instance;
22
+ - Mesh-wide message-ID retention for at least the protocol lifetime plus twice
23
+ the clock-skew allowance;
24
+ - bounded pending preparations and pings, with acknowledgements consumed once
25
+ and only from the intended peer;
26
+ - two-phase outbound delivery (`message.prepare` then `message.deliver`) so
27
+ causal state is committed before signed bytes are released; and
28
+ - deterministic, redacted and ordered effects.
29
+
30
+ `createMeshPeerState` is the supported construction path. It validates and
31
+ freezes local identity, preprovisioned peers and resource limits.
32
+ `ALLOW_PREPROVISIONED_MESH_ADMISSION` accepts the preprovisioned table as the
33
+ complete baseline; a stricter synchronous `MeshAdmissionPolicy` may be supplied
34
+ per inbound boundary, but it cannot admit identities absent from local state.
35
+
36
+ Only `processMeshEnvelope` can invoke the package-internal accepted-envelope
37
+ transition. The public reducer has no accepted-message input, and successful
38
+ decisions expose verified data rather than a reusable capability. A rejected
39
+ envelope returns the original state reference and produces no effects.
40
+
41
+ The coordinator validates canonical, bounded identity, admission, peer, replay,
42
+ message-ID, preparation and causal state before cryptographic work. Logical time
43
+ is monotonic across reducer and inbound transitions.
44
+
45
+ Alpha 1 accepts direct peer audiences only. Mesh-topic intake, work allocation,
46
+ leases and recovery are introduced in later preview releases.
47
+
48
+ `@agentplat/mesh/loopback` provides the explicit in-memory signed transport used
49
+ by the local vertical slice. `createMeshLoopbackTransport` owns composite
50
+ tenant/Mesh/peer routing, bounded FIFO delivery and per-peer serialization.
51
+ Registered peers use the same `processMeshEnvelope` boundary as future
52
+ transports. Outbound sequence allocators are included in restart snapshots,
53
+ duplicate batches repeat the exact signed envelope, and cooperative close
54
+ drains already accepted work.
55
+
56
+ Importing either entrypoint performs no network, clock, storage or key
57
+ operations. Clocks, message-ID sources, signers, keys and verification policy
58
+ are supplied explicitly when a peer is registered.
@@ -0,0 +1,206 @@
1
+ import type { MeshCryptoPolicy, MeshCryptoRejectionCode, MeshEnvelopeVerifier, MeshKeyResolver } from '@agentplat/mesh-crypto';
2
+ import type { MeshMessagePayload, MeshMessageType, MeshProtocolOptions, SignedMeshEnvelope, VerifiedMeshEnvelope } from '@agentplat/mesh-protocol';
3
+ /** Integer virtual or wall-clock-derived milliseconds supplied by a driver. */
4
+ export type MeshLogicalTime = number;
5
+ /** Identity and scope owned by one independently executing peer. */
6
+ export interface MeshPeerIdentity {
7
+ readonly tenantId: string;
8
+ readonly meshId: string;
9
+ readonly peerId: string;
10
+ readonly instanceId: string;
11
+ readonly keyId: string;
12
+ }
13
+ /** Locally preprovisioned admission information for one peer instance. */
14
+ export interface MeshAdmittedPeer {
15
+ readonly peerId: string;
16
+ readonly instanceIds: readonly string[];
17
+ readonly peerCardId: string;
18
+ readonly acceptedCardMessageId: string;
19
+ readonly cardRevision: number;
20
+ readonly validUntil: string;
21
+ }
22
+ /** Latest locally accepted membership projection for one admitted peer. */
23
+ export interface MeshPeerView {
24
+ readonly peerId: string;
25
+ readonly instanceId: string;
26
+ readonly peerCardId: string;
27
+ readonly cardRevision: number;
28
+ readonly status: 'admitted' | 'observed' | 'responsive' | 'departed';
29
+ readonly lastObservedAt?: MeshLogicalTime;
30
+ readonly lastResponsiveAt?: MeshLogicalTime;
31
+ }
32
+ /** Replay and idempotency state for one admitted peer and instance pair. */
33
+ export interface MeshReplayWindow {
34
+ readonly highestSequence: number;
35
+ /** Sequence offsets retained within the bounded replay window. */
36
+ readonly seenOffsets: readonly number[];
37
+ }
38
+ /** One locally dispatched ping awaiting a causally bound acknowledgement. */
39
+ export interface MeshPendingPing {
40
+ readonly messageId: string;
41
+ readonly peerId: string;
42
+ readonly expiresAt: MeshLogicalTime;
43
+ }
44
+ /** One outbound message waiting for a driver to prepare signed bytes. */
45
+ export interface MeshPendingPreparation {
46
+ readonly effectId: string;
47
+ readonly type: MeshMessageType;
48
+ readonly audiencePeerId: string;
49
+ readonly maximumLifetimeMs: number;
50
+ readonly prepareBy: MeshLogicalTime;
51
+ }
52
+ /** Fixed local resource bounds applied by the inbound acceptance boundary. */
53
+ export interface MeshPeerLimits {
54
+ readonly replayWindowSize: number;
55
+ readonly maximumTrackedMessageIds: number;
56
+ readonly messageIdRetentionMs: number;
57
+ readonly maximumPendingPings: number;
58
+ readonly maximumAdmittedPeers: number;
59
+ readonly maximumInstancesPerPeer: number;
60
+ }
61
+ /** Immutable state consumed and returned by a peer reducer. */
62
+ export interface MeshPeerState {
63
+ readonly identity: MeshPeerIdentity;
64
+ readonly status: 'created' | 'running' | 'stopped';
65
+ readonly admittedPeers: Readonly<Record<string, MeshAdmittedPeer>>;
66
+ readonly peers: Readonly<Record<string, MeshPeerView>>;
67
+ readonly replay: Readonly<Record<string, MeshReplayWindow>>;
68
+ /** Mesh-wide IDs mapped to their local exclusive retention deadline. */
69
+ readonly messageIds: Readonly<Record<string, MeshLogicalTime>>;
70
+ readonly pendingPings: Readonly<Record<string, MeshPendingPing>>;
71
+ readonly pendingPreparations: Readonly<Record<string, MeshPendingPreparation>>;
72
+ readonly limits: MeshPeerLimits;
73
+ readonly localEventSequence: number;
74
+ readonly lastLogicalTime: MeshLogicalTime;
75
+ }
76
+ /** Input used to construct one bounded local peer state. */
77
+ export interface MeshPeerStateOptions {
78
+ readonly identity: MeshPeerIdentity;
79
+ readonly admittedPeers: readonly MeshAdmittedPeer[];
80
+ readonly limits?: Partial<MeshPeerLimits>;
81
+ }
82
+ /** Starts an already configured peer without reading a clock or transport. */
83
+ export interface MeshPeerStartInput {
84
+ readonly kind: 'peer.start';
85
+ }
86
+ /** Stops local scheduling without changing remote identity history. */
87
+ export interface MeshPeerStopInput {
88
+ readonly kind: 'peer.stop';
89
+ readonly reason: 'requested' | 'resource_limit' | 'policy';
90
+ }
91
+ /** Requests a causally tracked liveness probe to one admitted peer. */
92
+ export interface MeshPeerPingInput {
93
+ readonly kind: 'peer.ping';
94
+ readonly peerId: string;
95
+ }
96
+ /** Returns one interpreted effect result to the pure reducer. */
97
+ export interface MeshEffectResultInput {
98
+ readonly kind: 'effect.result';
99
+ readonly effectId: string;
100
+ readonly status: 'succeeded' | 'failed';
101
+ readonly errorCode?: string;
102
+ readonly preparedMessage?: {
103
+ readonly messageId: string;
104
+ readonly type: MeshMessageType;
105
+ readonly audiencePeerId: string;
106
+ readonly expiresAt: MeshLogicalTime;
107
+ };
108
+ }
109
+ /** Every input accepted by the initial peer kernel. */
110
+ export type MeshPeerInput = MeshPeerStartInput | MeshPeerStopInput | MeshPeerPingInput | MeshEffectResultInput;
111
+ /** A message request that has not yet received identity, time or proof fields. */
112
+ export interface MeshOutboundIntent<TPayload extends MeshMessagePayload = MeshMessagePayload> {
113
+ readonly type: TPayload['type'];
114
+ readonly audiencePeerId: string;
115
+ readonly objectiveId?: string;
116
+ readonly payload: TPayload;
117
+ readonly causationId?: string;
118
+ readonly correlationId?: string;
119
+ readonly maximumLifetimeMs: number;
120
+ }
121
+ /** Requests that a driver serialize and sign without delivering yet. */
122
+ export interface MeshPrepareEffect {
123
+ readonly kind: 'message.prepare';
124
+ readonly effectId: string;
125
+ readonly intent: MeshOutboundIntent;
126
+ }
127
+ /** Releases previously prepared bytes only after causal state is committed. */
128
+ export interface MeshDeliverEffect {
129
+ readonly kind: 'message.deliver';
130
+ readonly effectId: string;
131
+ readonly preparationEffectId: string;
132
+ readonly messageId: string;
133
+ readonly audiencePeerId: string;
134
+ }
135
+ /** Requests a logical timer without reading a host clock inside the reducer. */
136
+ export interface MeshScheduleEffect {
137
+ readonly kind: 'timer.schedule';
138
+ readonly effectId: string;
139
+ readonly timerId: string;
140
+ readonly dueAt: MeshLogicalTime;
141
+ }
142
+ /** Emits redacted operational data without changing a peer decision. */
143
+ export interface MeshEventEffect {
144
+ readonly kind: 'event.emit';
145
+ readonly effectId: string;
146
+ readonly event: {
147
+ readonly type: string;
148
+ readonly peerId: string;
149
+ readonly messageType?: MeshMessageType;
150
+ readonly messageId?: string;
151
+ readonly occurredAt: MeshLogicalTime;
152
+ readonly reasonCode?: string;
153
+ };
154
+ }
155
+ /** Stops additional intake when a configured bound would be exceeded. */
156
+ export interface MeshBackpressureEffect {
157
+ readonly kind: 'intake.backpressure';
158
+ readonly effectId: string;
159
+ readonly reason: 'event_limit' | 'queue_limit' | 'replay_limit';
160
+ }
161
+ /** Ordered effects that may be interpreted by production or simulation drivers. */
162
+ export type MeshPeerEffect = MeshPrepareEffect | MeshDeliverEffect | MeshScheduleEffect | MeshEventEffect | MeshBackpressureEffect;
163
+ /** One synchronous peer state transition. */
164
+ export interface MeshPeerTransition {
165
+ readonly state: MeshPeerState;
166
+ readonly effects: readonly MeshPeerEffect[];
167
+ }
168
+ /** Production and simulation use the same reducer contract. */
169
+ export type MeshPeerReducer = (state: MeshPeerState, input: MeshPeerInput, logicalTime: MeshLogicalTime) => MeshPeerTransition;
170
+ /** Synchronous local authority policy evaluated after signature verification. */
171
+ export interface MeshAdmissionPolicy {
172
+ isPeerAdmitted(input: {
173
+ localPeer: MeshPeerIdentity;
174
+ senderPeerId: string;
175
+ senderInstanceId: string;
176
+ messageType: MeshMessageType;
177
+ }): boolean;
178
+ }
179
+ /** Stable inbound rejection reasons safe for redacted telemetry. */
180
+ export type MeshInboundRejectionCode = MeshCryptoRejectionCode | 'scope_mismatch' | 'audience_mismatch' | 'message_expired' | 'message_from_future' | 'logical_time_regressed' | 'unknown_critical_extension' | 'peer_not_running' | 'sender_not_admitted' | 'sender_instance_not_admitted' | 'sender_admission_expired' | 'message_not_authorized' | 'causation_rejected' | 'message_replayed' | 'sequence_outside_window' | 'replay_capacity_exceeded' | 'unsupported_message_type';
181
+ /** Complete signed-envelope request for the reference inbound boundary. */
182
+ export interface MeshInboundRequest<TPayload extends MeshMessagePayload = MeshMessagePayload> {
183
+ readonly envelope: SignedMeshEnvelope<TPayload>;
184
+ readonly verifiedAt: string;
185
+ readonly receivedAt: MeshLogicalTime;
186
+ readonly verifier: MeshEnvelopeVerifier;
187
+ readonly resolver: MeshKeyResolver;
188
+ readonly cryptoPolicy: MeshCryptoPolicy;
189
+ readonly admissionPolicy: MeshAdmissionPolicy;
190
+ readonly crypto?: Crypto;
191
+ readonly protocolOptions?: MeshProtocolOptions;
192
+ readonly supportedCriticalExtensions?: readonly string[];
193
+ }
194
+ /** Result returned by the local acceptance and reducer boundary. */
195
+ export type MeshInboundDecision<TPayload extends MeshMessagePayload = MeshMessagePayload> = {
196
+ readonly accepted: true;
197
+ readonly envelope: VerifiedMeshEnvelope<TPayload>;
198
+ readonly state: MeshPeerState;
199
+ readonly effects: readonly MeshPeerEffect[];
200
+ } | {
201
+ readonly accepted: false;
202
+ readonly code: MeshInboundRejectionCode;
203
+ readonly state: MeshPeerState;
204
+ readonly effects: readonly [];
205
+ };
206
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAChB,MAAM,wBAAwB,CAAC;AACh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,2BAA2B,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1D;AAED,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,CAC7B,QAAQ,SAAS,kBAAkB,GAAG,kBAAkB,IAEtD;IACE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;CAC7C,GACD;IACE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { type MeshMessagePayload } from '@agentplat/mesh-protocol';
2
+ import type { MeshAdmissionPolicy, MeshInboundDecision, MeshInboundRequest, MeshPeerState } from './contracts.js';
3
+ /** Additional policy hook that cannot override preprovisioned admission state. */
4
+ export declare const ALLOW_PREPROVISIONED_MESH_ADMISSION: Readonly<MeshAdmissionPolicy>;
5
+ /** Verifies one signed envelope before entering the synchronous local boundary. */
6
+ export declare function processMeshEnvelope<TPayload extends MeshMessagePayload>(state: MeshPeerState, request: MeshInboundRequest<TPayload>): Promise<MeshInboundDecision<TPayload>>;
7
+ //# sourceMappingURL=inbound.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbound.d.ts","sourceRoot":"","sources":["../src/inbound.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EAEnB,kBAAkB,EAGlB,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAaxB,kFAAkF;AAClF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,mBAAmB,CAG1E,CAAC;AAEL,mFAAmF;AACnF,wBAAsB,mBAAmB,CAAC,QAAQ,SAAS,kBAAkB,EAC3E,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACpC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAsGxC"}