@multi-agent-protocol/sdk 0.0.7 → 0.0.9

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.
@@ -32,6 +32,12 @@ type MessageId = string;
32
32
  type SubscriptionId = string;
33
33
  /** Identifier for correlating related messages */
34
34
  type CorrelationId = string;
35
+ /** Unique identifier for a conversation (format: 'conv-{ulid}') */
36
+ type ConversationId = string;
37
+ /** Unique identifier for a turn within a conversation (format: 'turn-{ulid}') */
38
+ type TurnId = string;
39
+ /** Unique identifier for a thread within a conversation (format: 'thread-{ulid}') */
40
+ type ThreadId = string;
35
41
  /** JSON-RPC request ID */
36
42
  type RequestId = string | number;
37
43
  /** MAP protocol version */
@@ -40,10 +46,104 @@ type ProtocolVersion = 1;
40
46
  type Timestamp = number;
41
47
  /** Vendor extension metadata */
42
48
  type Meta = Record<string, unknown>;
49
+ /**
50
+ * Compute environment information for an agent.
51
+ * Category names are normative; field conventions within categories are documented separately.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const environment: AgentEnvironment = {
56
+ * schemaVersion: '1.0',
57
+ * os: { type: 'linux', version: '22.04' },
58
+ * process: { cwd: '/home/user/project' },
59
+ * network: { connectivity: 'full' },
60
+ * tools: { installed: { python: '3.11', node: '20.0' } }
61
+ * };
62
+ * ```
63
+ */
64
+ interface AgentEnvironment {
65
+ /** Schema version for evolution (e.g., '1.0') */
66
+ schemaVersion?: string;
67
+ /** Self-declared profile compliance (e.g., ['cloud-native', 'ml-ready']) */
68
+ profiles?: string[];
69
+ /** Host/machine info (arch, cpu, memory, gpu) */
70
+ host?: Record<string, unknown>;
71
+ /** Operating system info (type, version) */
72
+ os?: Record<string, unknown>;
73
+ /** Process/runtime info (pid, cwd, runtime) */
74
+ process?: Record<string, unknown>;
75
+ /** Container info if containerized */
76
+ container?: Record<string, unknown>;
77
+ /** Cloud provider info (provider, region) */
78
+ cloud?: Record<string, unknown>;
79
+ /** Kubernetes info if in k8s */
80
+ k8s?: Record<string, unknown>;
81
+ /** Filesystem/workspace info (cwd, mounts, workspace) */
82
+ filesystem?: Record<string, unknown>;
83
+ /** Network info (connectivity, addresses) */
84
+ network?: Record<string, unknown>;
85
+ /** Available tools and runtimes */
86
+ tools?: Record<string, unknown>;
87
+ /** Resource limits and constraints */
88
+ resources?: Record<string, unknown>;
89
+ /** Security/isolation context */
90
+ security?: Record<string, unknown>;
91
+ /** External services and APIs (aiProviders, mcp) */
92
+ services?: Record<string, unknown>;
93
+ /** Allow additional categories */
94
+ [key: string]: unknown;
95
+ }
96
+ /**
97
+ * Structured capability descriptor for an agent.
98
+ * Published at registration time via the `capabilityDescriptor` field on Agent.
99
+ * Optional — agents without descriptors still work via role/metadata.
100
+ */
101
+ interface MAPAgentCapabilityDescriptor {
102
+ /** Globally unique capability descriptor ID (e.g., "urn:map:cap:code-review") */
103
+ id?: string;
104
+ /** Semantic version of the capability descriptor */
105
+ version?: string;
106
+ /** Human-readable name */
107
+ name?: string;
108
+ /** Human-readable summary of what this agent does */
109
+ description?: string;
110
+ /** Capability categories this agent supports */
111
+ capabilities?: MAPCapabilityDeclaration[];
112
+ /** Input types this agent can accept */
113
+ accepts?: MAPInterfaceSpec[];
114
+ /** Output types this agent can provide */
115
+ provides?: MAPInterfaceSpec[];
116
+ /** Semantic tags for discovery (searchable) */
117
+ tags?: string[];
118
+ }
119
+ /**
120
+ * A single capability declaration within an agent's descriptor.
121
+ */
122
+ interface MAPCapabilityDeclaration {
123
+ /** Machine-readable capability identifier (namespaced, e.g., "doc:summarize") */
124
+ id: string;
125
+ /** Capability version */
126
+ version?: string;
127
+ /** What this capability does */
128
+ description?: string;
129
+ /** Interfaces for this specific capability */
130
+ interfaces?: MAPInterfaceSpec[];
131
+ }
132
+ /**
133
+ * Interface specification for capability inputs/outputs.
134
+ */
135
+ interface MAPInterfaceSpec {
136
+ /** Content type (e.g., "application/json", "text/plain") */
137
+ contentType: string;
138
+ /** JSON Schema URI for the expected payload structure */
139
+ schema?: string;
140
+ /** Description of this interface */
141
+ description?: string;
142
+ }
43
143
  /** Type of participant in the protocol */
44
- type ParticipantType = 'agent' | 'client' | 'system' | 'gateway';
144
+ type ParticipantType = "agent" | "client" | "system" | "gateway";
45
145
  /** Transport binding type */
46
- type TransportType = 'websocket' | 'stdio' | 'inprocess' | 'http-sse';
146
+ type TransportType = "websocket" | "stdio" | "inprocess" | "http-sse";
47
147
  /**
48
148
  * Streaming capabilities for backpressure and flow control.
49
149
  * Servers advertise these to indicate what features they support.
@@ -94,6 +194,32 @@ interface ParticipantCapabilities {
94
194
  /** Can connect to and route to federated systems */
95
195
  canFederate?: boolean;
96
196
  };
197
+ /** Mail protocol capabilities for conversation/turn tracking */
198
+ mail?: {
199
+ /** Whether mail is enabled (server response only) */
200
+ enabled?: boolean;
201
+ /** Can create new conversations */
202
+ canCreate?: boolean;
203
+ /** Can join existing conversations */
204
+ canJoin?: boolean;
205
+ /** Can invite participants to conversations */
206
+ canInvite?: boolean;
207
+ /** Can view conversation history */
208
+ canViewHistory?: boolean;
209
+ /** Can create threads within conversations */
210
+ canCreateThreads?: boolean;
211
+ };
212
+ /** Workspace file access capabilities */
213
+ workspace?: {
214
+ /** Whether workspace is enabled (server response only) */
215
+ enabled?: boolean;
216
+ /** Can search files by pattern */
217
+ canSearch?: boolean;
218
+ /** Can list files in a directory */
219
+ canList?: boolean;
220
+ /** Can read file contents */
221
+ canRead?: boolean;
222
+ };
97
223
  /** Streaming/backpressure capabilities */
98
224
  streaming?: StreamingCapabilities;
99
225
  /**
@@ -136,9 +262,9 @@ interface Participant {
136
262
  * State of an agent.
137
263
  * Standard states are enumerated; custom states use 'x-' prefix.
138
264
  */
139
- type AgentState = 'registered' | 'active' | 'busy' | 'idle' | 'suspended' | 'stopping' | 'stopped' | 'failed' | 'orphaned' | `x-${string}`;
265
+ type AgentState = "registered" | "active" | "busy" | "idle" | "suspended" | "stopping" | "stopped" | "failed" | "orphaned" | `x-${string}`;
140
266
  /** Type of relationship between agents */
141
- type AgentRelationshipType = 'peer' | 'supervisor' | 'supervised' | 'collaborator';
267
+ type AgentRelationshipType = "peer" | "supervisor" | "supervised" | "collaborator";
142
268
  /** A relationship between agents */
143
269
  interface AgentRelationship {
144
270
  type: AgentRelationshipType;
@@ -158,7 +284,7 @@ interface AgentLifecycle {
158
284
  _meta?: Meta;
159
285
  }
160
286
  /** Who can see this agent */
161
- type AgentVisibility = 'public' | 'parent-only' | 'scope' | 'system';
287
+ type AgentVisibility = "public" | "parent-only" | "scope" | "system";
162
288
  /** An agent in the multi-agent system */
163
289
  interface Agent {
164
290
  id: AgentId;
@@ -201,6 +327,10 @@ interface Agent {
201
327
  permissionOverrides?: Partial<AgentPermissions>;
202
328
  lifecycle?: AgentLifecycle;
203
329
  capabilities?: ParticipantCapabilities;
330
+ /** Compute environment where this agent runs */
331
+ environment?: AgentEnvironment;
332
+ /** Structured capability descriptor for rich agent discovery */
333
+ capabilityDescriptor?: MAPAgentCapabilityDescriptor;
204
334
  metadata?: Record<string, unknown>;
205
335
  _meta?: Meta;
206
336
  }
@@ -217,7 +347,7 @@ declare function isOrphanedAgent(agent: Agent): boolean;
217
347
  * - 'direct': Can only see explicitly included agents
218
348
  * - { include: [...] }: Explicit allowlist of agent IDs
219
349
  */
220
- type AgentVisibilityRule = 'all' | 'hierarchy' | 'scoped' | 'direct' | {
350
+ type AgentVisibilityRule = "all" | "hierarchy" | "scoped" | "direct" | {
221
351
  include: AgentId[];
222
352
  };
223
353
  /**
@@ -226,7 +356,7 @@ type AgentVisibilityRule = 'all' | 'hierarchy' | 'scoped' | 'direct' | {
226
356
  * - 'member': Can only see scopes they're a member of
227
357
  * - { include: [...] }: Explicit allowlist of scope IDs
228
358
  */
229
- type ScopeVisibilityRule = 'all' | 'member' | {
359
+ type ScopeVisibilityRule = "all" | "member" | {
230
360
  include: ScopeId[];
231
361
  };
232
362
  /**
@@ -235,7 +365,7 @@ type ScopeVisibilityRule = 'all' | 'member' | {
235
365
  * - 'local': Can see immediate parent and children only
236
366
  * - 'none': Cannot see hierarchy relationships
237
367
  */
238
- type StructureVisibilityRule = 'full' | 'local' | 'none';
368
+ type StructureVisibilityRule = "full" | "local" | "none";
239
369
  /**
240
370
  * Rule for which agents this agent can send messages to.
241
371
  * - 'all': Can message any agent
@@ -243,7 +373,7 @@ type StructureVisibilityRule = 'full' | 'local' | 'none';
243
373
  * - 'scoped': Can message agents in the same scopes
244
374
  * - { include: [...] }: Explicit allowlist of agent IDs
245
375
  */
246
- type AgentMessagingRule = 'all' | 'hierarchy' | 'scoped' | {
376
+ type AgentMessagingRule = "all" | "hierarchy" | "scoped" | {
247
377
  include: AgentId[];
248
378
  };
249
379
  /**
@@ -252,7 +382,7 @@ type AgentMessagingRule = 'all' | 'hierarchy' | 'scoped' | {
252
382
  * - 'member': Can only send to scopes they're a member of
253
383
  * - { include: [...] }: Explicit allowlist of scope IDs
254
384
  */
255
- type ScopeMessagingRule = 'all' | 'member' | {
385
+ type ScopeMessagingRule = "all" | "member" | {
256
386
  include: ScopeId[];
257
387
  };
258
388
  /**
@@ -262,7 +392,7 @@ type ScopeMessagingRule = 'all' | 'member' | {
262
392
  * - 'scoped': Accepts from agents in the same scopes
263
393
  * - { include: [...] }: Explicit allowlist of agent IDs
264
394
  */
265
- type AgentAcceptanceRule = 'all' | 'hierarchy' | 'scoped' | {
395
+ type AgentAcceptanceRule = "all" | "hierarchy" | "scoped" | {
266
396
  include: AgentId[];
267
397
  };
268
398
  /**
@@ -271,7 +401,7 @@ type AgentAcceptanceRule = 'all' | 'hierarchy' | 'scoped' | {
271
401
  * - 'none': Does not accept from any client
272
402
  * - { include: [...] }: Explicit allowlist of participant IDs
273
403
  */
274
- type ClientAcceptanceRule = 'all' | 'none' | {
404
+ type ClientAcceptanceRule = "all" | "none" | {
275
405
  include: ParticipantId[];
276
406
  };
277
407
  /**
@@ -280,7 +410,7 @@ type ClientAcceptanceRule = 'all' | 'none' | {
280
410
  * - 'none': Does not accept from any federated system
281
411
  * - { include: [...] }: Explicit allowlist of system IDs
282
412
  */
283
- type SystemAcceptanceRule = 'all' | 'none' | {
413
+ type SystemAcceptanceRule = "all" | "none" | {
284
414
  include: string[];
285
415
  };
286
416
  /**
@@ -408,7 +538,7 @@ interface SystemAddress {
408
538
  /** Address any participant by ID or category */
409
539
  interface ParticipantAddress {
410
540
  participant?: ParticipantId;
411
- participants?: 'all' | 'agents' | 'clients';
541
+ participants?: "all" | "agents" | "clients";
412
542
  }
413
543
  /** Address an agent in a federated system */
414
544
  interface FederatedAddress {
@@ -418,11 +548,11 @@ interface FederatedAddress {
418
548
  /** Flexible addressing for any topology */
419
549
  type Address = string | DirectAddress | MultiAddress | ScopeAddress | RoleAddress | HierarchicalAddress | BroadcastAddress | SystemAddress | ParticipantAddress | FederatedAddress;
420
550
  /** Message priority */
421
- type MessagePriority = 'urgent' | 'high' | 'normal' | 'low';
551
+ type MessagePriority = "urgent" | "high" | "normal" | "low";
422
552
  /** Message delivery guarantees */
423
- type DeliverySemantics = 'fire-and-forget' | 'acknowledged' | 'guaranteed';
553
+ type DeliverySemantics = "fire-and-forget" | "acknowledged" | "guaranteed";
424
554
  /** Relationship context for the message */
425
- type MessageRelationship = 'parent-to-child' | 'child-to-parent' | 'peer' | 'broadcast';
555
+ type MessageRelationship = "parent-to-child" | "child-to-parent" | "peer" | "broadcast";
426
556
  /** Metadata for a message */
427
557
  interface MessageMeta {
428
558
  timestamp?: Timestamp;
@@ -438,6 +568,12 @@ interface MessageMeta {
438
568
  * Used to identify the protocol of the payload.
439
569
  */
440
570
  protocol?: string;
571
+ /**
572
+ * Mail turn tracking metadata.
573
+ * When present on map/send, the server records a turn in the specified
574
+ * conversation in addition to routing the message.
575
+ */
576
+ mail?: MailMessageMeta;
441
577
  _meta?: Meta;
442
578
  }
443
579
  /** A message in the multi-agent system */
@@ -451,13 +587,13 @@ interface Message<T = unknown> {
451
587
  _meta?: Meta;
452
588
  }
453
589
  /** Policy for joining a scope */
454
- type JoinPolicy = 'open' | 'invite' | 'role' | 'system';
590
+ type JoinPolicy = "open" | "invite" | "role" | "system";
455
591
  /** Who can see the scope exists and its members */
456
- type ScopeVisibility = 'public' | 'members' | 'system';
592
+ type ScopeVisibility = "public" | "members" | "system";
457
593
  /** Who can see messages sent to this scope */
458
- type MessageVisibility = 'public' | 'members' | 'system';
594
+ type MessageVisibility = "public" | "members" | "system";
459
595
  /** Who can send messages to this scope */
460
- type SendPolicy = 'members' | 'any';
596
+ type SendPolicy = "members" | "any";
461
597
  /** A scope for grouping agents */
462
598
  interface Scope {
463
599
  id: ScopeId;
@@ -482,6 +618,7 @@ declare const EVENT_TYPES: {
482
618
  readonly AGENT_REGISTERED: "agent_registered";
483
619
  readonly AGENT_UNREGISTERED: "agent_unregistered";
484
620
  readonly AGENT_STATE_CHANGED: "agent_state_changed";
621
+ readonly AGENT_ENVIRONMENT_CHANGED: "agent_environment_changed";
485
622
  readonly AGENT_ORPHANED: "agent_orphaned";
486
623
  readonly PARTICIPANT_CONNECTED: "participant_connected";
487
624
  readonly PARTICIPANT_DISCONNECTED: "participant_disconnected";
@@ -497,6 +634,14 @@ declare const EVENT_TYPES: {
497
634
  readonly SYSTEM_ERROR: "system_error";
498
635
  readonly FEDERATION_CONNECTED: "federation_connected";
499
636
  readonly FEDERATION_DISCONNECTED: "federation_disconnected";
637
+ readonly MAIL_CREATED: "mail.created";
638
+ readonly MAIL_CLOSED: "mail.closed";
639
+ readonly MAIL_PARTICIPANT_JOINED: "mail.participant.joined";
640
+ readonly MAIL_PARTICIPANT_LEFT: "mail.participant.left";
641
+ readonly MAIL_TURN_ADDED: "mail.turn.added";
642
+ readonly MAIL_TURN_UPDATED: "mail.turn.updated";
643
+ readonly MAIL_THREAD_CREATED: "mail.thread.created";
644
+ readonly MAIL_SUMMARY_GENERATED: "mail.summary.generated";
500
645
  };
501
646
  /** Type of system event (derived from EVENT_TYPES) */
502
647
  type EventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
@@ -611,6 +756,26 @@ interface SubscriptionFilter {
611
756
  * Checks event.data.metadata for matching values.
612
757
  */
613
758
  metadataMatch?: Record<string, unknown>;
759
+ /**
760
+ * Filter by agent environment attributes.
761
+ * Matches events from agents whose environment contains matching values.
762
+ * Uses dot notation for nested fields (e.g., 'os.type', 'cloud.region').
763
+ *
764
+ * @example
765
+ * ```typescript
766
+ * environmentMatch: {
767
+ * 'os.type': 'linux',
768
+ * 'cloud.provider': 'aws'
769
+ * }
770
+ * ```
771
+ */
772
+ environmentMatch?: Record<string, unknown>;
773
+ /**
774
+ * Mail-specific filter for conversation events.
775
+ * Matches mail events related to a specific conversation, thread,
776
+ * participant, or content type.
777
+ */
778
+ mail?: MailSubscriptionFilter;
614
779
  _meta?: Meta;
615
780
  }
616
781
  /** Options for subscriptions */
@@ -626,7 +791,7 @@ interface SubscriptionOptions$1 {
626
791
  * - 'paused': Events are buffered but not delivered to the iterator
627
792
  * - 'closed': Subscription is terminated
628
793
  */
629
- type SubscriptionState = 'active' | 'paused' | 'closed';
794
+ type SubscriptionState = "active" | "paused" | "closed";
630
795
  /**
631
796
  * Information about events dropped due to buffer overflow.
632
797
  * Passed to overflow handlers when events cannot be buffered.
@@ -659,7 +824,7 @@ interface SubscriptionAckParams {
659
824
  }
660
825
  /** Notification for subscription acknowledgment */
661
826
  interface SubscriptionAckNotification extends MAPNotificationBase<SubscriptionAckParams> {
662
- method: 'map/subscribe.ack';
827
+ method: "map/subscribe.ack";
663
828
  params: SubscriptionAckParams;
664
829
  }
665
830
  /** Data for message_sent events (no payload for privacy) */
@@ -688,7 +853,7 @@ interface MessageFailedEventData {
688
853
  code?: number;
689
854
  }
690
855
  /** Category of error for handling decisions */
691
- type ErrorCategory = 'protocol' | 'auth' | 'routing' | 'agent' | 'resource' | 'federation' | 'internal';
856
+ type ErrorCategory = "protocol" | "auth" | "routing" | "agent" | "resource" | "federation" | "mail" | "internal";
692
857
  /** Structured error data */
693
858
  interface MAPErrorData {
694
859
  category?: ErrorCategory;
@@ -707,20 +872,20 @@ interface MAPError {
707
872
  declare const JSONRPC_VERSION: "2.0";
708
873
  /** Base JSON-RPC request */
709
874
  interface MAPRequestBase<TParams = unknown> {
710
- jsonrpc: '2.0';
875
+ jsonrpc: "2.0";
711
876
  id: RequestId;
712
877
  method: string;
713
878
  params?: TParams;
714
879
  }
715
880
  /** Base JSON-RPC response (success) */
716
881
  interface MAPResponseSuccess<T = unknown> {
717
- jsonrpc: '2.0';
882
+ jsonrpc: "2.0";
718
883
  id: RequestId;
719
884
  result: T;
720
885
  }
721
886
  /** Base JSON-RPC response (error) */
722
887
  interface MAPResponseError {
723
- jsonrpc: '2.0';
888
+ jsonrpc: "2.0";
724
889
  id: RequestId;
725
890
  error: MAPError;
726
891
  }
@@ -728,7 +893,7 @@ interface MAPResponseError {
728
893
  type MAPResponse<T = unknown> = MAPResponseSuccess<T> | MAPResponseError;
729
894
  /** Base JSON-RPC notification */
730
895
  interface MAPNotificationBase<TParams = unknown> {
731
- jsonrpc: '2.0';
896
+ jsonrpc: "2.0";
732
897
  method: string;
733
898
  params?: TParams;
734
899
  }
@@ -739,11 +904,11 @@ interface SessionInfo {
739
904
  closedAt?: Timestamp;
740
905
  }
741
906
  /** Standard authentication methods defined by the protocol */
742
- type StandardAuthMethod = 'bearer' | 'api-key' | 'mtls' | 'none';
907
+ type StandardAuthMethod = "bearer" | "api-key" | "mtls" | "none" | "did:wba";
743
908
  /** Authentication method - standard or custom (x- prefixed) */
744
909
  type AuthMethod = StandardAuthMethod | `x-${string}`;
745
910
  /** Authentication error codes */
746
- type AuthErrorCode = 'invalid_credentials' | 'expired' | 'insufficient_scope' | 'method_not_supported' | 'auth_required';
911
+ type AuthErrorCode = "invalid_credentials" | "expired" | "insufficient_scope" | "method_not_supported" | "auth_required";
747
912
  /**
748
913
  * Client-provided authentication credentials.
749
914
  * Used in connect requests and authenticate calls.
@@ -805,18 +970,89 @@ interface AuthResult {
805
970
  principal?: AuthPrincipal;
806
971
  /** Error details (if failure) */
807
972
  error?: AuthError;
973
+ /** Provider-specific data to store on session (e.g., verified AgentToken) */
974
+ providerData?: unknown;
808
975
  }
976
+ /**
977
+ * Supported federation authentication methods.
978
+ */
979
+ type FederationAuthMethod = "bearer" | "api-key" | "mtls" | "none" | "did:wba" | "oauth2" | `x-${string}`;
809
980
  /**
810
981
  * Authentication for federated connections.
811
982
  */
812
983
  interface FederationAuth {
813
- method: 'bearer' | 'api-key' | 'mtls';
984
+ method: FederationAuthMethod;
814
985
  credentials?: string;
986
+ /** Method-specific additional data (e.g., DID proof, OAuth2 config) */
987
+ metadata?: Record<string, unknown>;
988
+ }
989
+ /**
990
+ * DID:WBA authentication credentials for federation.
991
+ * Used for domain-anchored decentralized identity.
992
+ */
993
+ interface DIDWBACredentials {
994
+ method: "did:wba";
995
+ /** DID and proof nested in metadata (matches wire format) */
996
+ metadata: {
997
+ /** The DID of the connecting system/agent (e.g., "did:wba:agents.example.com:gateway") */
998
+ did: string;
999
+ /** Cryptographic proof of DID ownership */
1000
+ proof: DIDWBAProof;
1001
+ };
815
1002
  }
1003
+ /**
1004
+ * Cryptographic proof for DID:WBA authentication.
1005
+ */
1006
+ interface DIDWBAProof {
1007
+ /** Proof type (e.g., "JsonWebSignature2020", "Ed25519Signature2020") */
1008
+ type: string;
1009
+ /** ISO 8601 timestamp of proof creation */
1010
+ created: string;
1011
+ /** Server-provided nonce (prevents replay) */
1012
+ challenge: string;
1013
+ /** JWS signature over (challenge + did + created) */
1014
+ jws: string;
1015
+ }
1016
+ /**
1017
+ * DID Document structure for MAP federation.
1018
+ * Resolved from `did:wba:<domain>:<path>` → `https://<domain>/<path>/did.json`
1019
+ */
1020
+ interface DIDDocument {
1021
+ "@context"?: string | string[];
1022
+ id: string;
1023
+ verificationMethod?: DIDVerificationMethod[];
1024
+ authentication?: string[];
1025
+ service?: DIDService[];
1026
+ }
1027
+ /**
1028
+ * A verification method within a DID Document.
1029
+ */
1030
+ interface DIDVerificationMethod {
1031
+ id: string;
1032
+ type: string;
1033
+ controller: string;
1034
+ publicKeyJwk?: Record<string, unknown>;
1035
+ }
1036
+ /**
1037
+ * A service endpoint within a DID Document.
1038
+ */
1039
+ interface DIDService {
1040
+ id: string;
1041
+ type: string;
1042
+ serviceEndpoint: string | Record<string, unknown>;
1043
+ /** MAP protocol version (for MAPFederationEndpoint services) */
1044
+ mapProtocolVersion?: number;
1045
+ /** MAP capabilities advertised by this endpoint */
1046
+ mapCapabilities?: Record<string, boolean>;
1047
+ }
1048
+ /**
1049
+ * Union type for all supported federation auth credentials.
1050
+ */
1051
+ type MAPFederationAuth = FederationAuth | DIDWBACredentials;
816
1052
  /** Policy for handling unexpected disconnection */
817
1053
  interface DisconnectPolicy {
818
1054
  /** What happens to agents on disconnect */
819
- agentBehavior: 'unregister' | 'orphan' | 'grace-period';
1055
+ agentBehavior: "unregister" | "orphan" | "grace-period";
820
1056
  /** Grace period before unregistering (ms) */
821
1057
  gracePeriodMs?: number;
822
1058
  /** Emit events to subscribers */
@@ -840,7 +1076,7 @@ interface ConnectRequestParams {
840
1076
  _meta?: Meta;
841
1077
  }
842
1078
  interface ConnectRequest extends MAPRequestBase<ConnectRequestParams> {
843
- method: 'map/connect';
1079
+ method: "map/connect";
844
1080
  params: ConnectRequestParams;
845
1081
  }
846
1082
  interface ConnectResponseResult {
@@ -871,7 +1107,7 @@ interface DisconnectRequestParams {
871
1107
  _meta?: Meta;
872
1108
  }
873
1109
  interface DisconnectRequest extends MAPRequestBase<DisconnectRequestParams> {
874
- method: 'map/disconnect';
1110
+ method: "map/disconnect";
875
1111
  params?: DisconnectRequestParams;
876
1112
  }
877
1113
  interface DisconnectResponseResult {
@@ -884,7 +1120,7 @@ interface SessionListRequestParams {
884
1120
  _meta?: Meta;
885
1121
  }
886
1122
  interface SessionListRequest extends MAPRequestBase<SessionListRequestParams> {
887
- method: 'map/session/list';
1123
+ method: "map/session/list";
888
1124
  params?: SessionListRequestParams;
889
1125
  }
890
1126
  interface SessionListResponseResult {
@@ -896,7 +1132,7 @@ interface SessionLoadRequestParams {
896
1132
  _meta?: Meta;
897
1133
  }
898
1134
  interface SessionLoadRequest extends MAPRequestBase<SessionLoadRequestParams> {
899
- method: 'map/session/load';
1135
+ method: "map/session/load";
900
1136
  params: SessionLoadRequestParams;
901
1137
  }
902
1138
  interface SessionLoadResponseResult {
@@ -909,7 +1145,7 @@ interface SessionCloseRequestParams {
909
1145
  _meta?: Meta;
910
1146
  }
911
1147
  interface SessionCloseRequest extends MAPRequestBase<SessionCloseRequestParams> {
912
- method: 'map/session/close';
1148
+ method: "map/session/close";
913
1149
  params?: SessionCloseRequestParams;
914
1150
  }
915
1151
  interface SessionCloseResponseResult {
@@ -923,6 +1159,12 @@ interface AgentsListFilter {
923
1159
  parent?: AgentId;
924
1160
  hasChildren?: boolean;
925
1161
  ownerId?: ParticipantId;
1162
+ /** Filter by structured capability ID (e.g., "doc:summarize") */
1163
+ capabilityId?: string;
1164
+ /** Filter by semantic tags from capability descriptor */
1165
+ tags?: string[];
1166
+ /** Filter by accepted content type */
1167
+ accepts?: string;
926
1168
  }
927
1169
  interface AgentsListRequestParams {
928
1170
  filter?: AgentsListFilter;
@@ -931,7 +1173,7 @@ interface AgentsListRequestParams {
931
1173
  _meta?: Meta;
932
1174
  }
933
1175
  interface AgentsListRequest extends MAPRequestBase<AgentsListRequestParams> {
934
- method: 'map/agents/list';
1176
+ method: "map/agents/list";
935
1177
  params?: AgentsListRequestParams;
936
1178
  }
937
1179
  interface AgentsListResponseResult {
@@ -954,7 +1196,7 @@ interface AgentsGetRequestParams {
954
1196
  _meta?: Meta;
955
1197
  }
956
1198
  interface AgentsGetRequest extends MAPRequestBase<AgentsGetRequestParams> {
957
- method: 'map/agents/get';
1199
+ method: "map/agents/get";
958
1200
  params: AgentsGetRequestParams;
959
1201
  }
960
1202
  interface AgentsGetResponseResult {
@@ -975,13 +1217,17 @@ interface AgentsRegisterRequestParams {
975
1217
  scopes?: ScopeId[];
976
1218
  visibility?: AgentVisibility;
977
1219
  capabilities?: ParticipantCapabilities;
1220
+ /** Compute environment where this agent runs */
1221
+ environment?: AgentEnvironment;
1222
+ /** Structured capability descriptor for rich agent discovery */
1223
+ capabilityDescriptor?: MAPAgentCapabilityDescriptor;
978
1224
  metadata?: Record<string, unknown>;
979
1225
  /** Permission overrides merged on top of role-based defaults */
980
1226
  permissionOverrides?: Partial<AgentPermissions>;
981
1227
  _meta?: Meta;
982
1228
  }
983
1229
  interface AgentsRegisterRequest extends MAPRequestBase<AgentsRegisterRequestParams> {
984
- method: 'map/agents/register';
1230
+ method: "map/agents/register";
985
1231
  params?: AgentsRegisterRequestParams;
986
1232
  }
987
1233
  interface AgentsRegisterResponseResult {
@@ -994,7 +1240,7 @@ interface AgentsUnregisterRequestParams {
994
1240
  _meta?: Meta;
995
1241
  }
996
1242
  interface AgentsUnregisterRequest extends MAPRequestBase<AgentsUnregisterRequestParams> {
997
- method: 'map/agents/unregister';
1243
+ method: "map/agents/unregister";
998
1244
  params: AgentsUnregisterRequestParams;
999
1245
  }
1000
1246
  interface AgentsUnregisterResponseResult {
@@ -1004,6 +1250,8 @@ interface AgentsUnregisterResponseResult {
1004
1250
  interface AgentsUpdateRequestParams {
1005
1251
  agentId: AgentId;
1006
1252
  state?: AgentState;
1253
+ /** Update agent's compute environment */
1254
+ environment?: AgentEnvironment;
1007
1255
  metadata?: Record<string, unknown>;
1008
1256
  /**
1009
1257
  * Permission overrides to apply to the agent.
@@ -1013,7 +1261,7 @@ interface AgentsUpdateRequestParams {
1013
1261
  _meta?: Meta;
1014
1262
  }
1015
1263
  interface AgentsUpdateRequest extends MAPRequestBase<AgentsUpdateRequestParams> {
1016
- method: 'map/agents/update';
1264
+ method: "map/agents/update";
1017
1265
  params: AgentsUpdateRequestParams;
1018
1266
  }
1019
1267
  interface AgentsUpdateResponseResult {
@@ -1029,12 +1277,16 @@ interface AgentsSpawnRequestParams {
1029
1277
  scopes?: ScopeId[];
1030
1278
  visibility?: AgentVisibility;
1031
1279
  capabilities?: ParticipantCapabilities;
1280
+ /** Compute environment where this agent runs */
1281
+ environment?: AgentEnvironment;
1282
+ /** Structured capability descriptor for rich agent discovery */
1283
+ capabilityDescriptor?: MAPAgentCapabilityDescriptor;
1032
1284
  initialMessage?: Message;
1033
1285
  metadata?: Record<string, unknown>;
1034
1286
  _meta?: Meta;
1035
1287
  }
1036
1288
  interface AgentsSpawnRequest extends MAPRequestBase<AgentsSpawnRequestParams> {
1037
- method: 'map/agents/spawn';
1289
+ method: "map/agents/spawn";
1038
1290
  params?: AgentsSpawnRequestParams;
1039
1291
  }
1040
1292
  interface AgentsSpawnResponseResult {
@@ -1049,7 +1301,7 @@ interface AgentsStopRequestParams {
1049
1301
  _meta?: Meta;
1050
1302
  }
1051
1303
  interface AgentsStopRequest extends MAPRequestBase<AgentsStopRequestParams> {
1052
- method: 'map/agents/stop';
1304
+ method: "map/agents/stop";
1053
1305
  params: AgentsStopRequestParams;
1054
1306
  }
1055
1307
  interface AgentsStopResponseResult {
@@ -1062,7 +1314,7 @@ interface AgentsSuspendRequestParams {
1062
1314
  _meta?: Meta;
1063
1315
  }
1064
1316
  interface AgentsSuspendRequest extends MAPRequestBase<AgentsSuspendRequestParams> {
1065
- method: 'map/agents/suspend';
1317
+ method: "map/agents/suspend";
1066
1318
  params: AgentsSuspendRequestParams;
1067
1319
  }
1068
1320
  interface AgentsSuspendResponseResult {
@@ -1074,7 +1326,7 @@ interface AgentsResumeRequestParams {
1074
1326
  _meta?: Meta;
1075
1327
  }
1076
1328
  interface AgentsResumeRequest extends MAPRequestBase<AgentsResumeRequestParams> {
1077
- method: 'map/agents/resume';
1329
+ method: "map/agents/resume";
1078
1330
  params: AgentsResumeRequestParams;
1079
1331
  }
1080
1332
  interface AgentsResumeResponseResult {
@@ -1088,7 +1340,7 @@ interface SendRequestParams {
1088
1340
  _meta?: Meta;
1089
1341
  }
1090
1342
  interface SendRequest extends MAPRequestBase<SendRequestParams> {
1091
- method: 'map/send';
1343
+ method: "map/send";
1092
1344
  params: SendRequestParams;
1093
1345
  }
1094
1346
  interface SendResponseResult {
@@ -1103,7 +1355,7 @@ interface SubscribeRequestParams {
1103
1355
  _meta?: Meta;
1104
1356
  }
1105
1357
  interface SubscribeRequest extends MAPRequestBase<SubscribeRequestParams> {
1106
- method: 'map/subscribe';
1358
+ method: "map/subscribe";
1107
1359
  params?: SubscribeRequestParams;
1108
1360
  }
1109
1361
  interface SubscribeResponseResult {
@@ -1115,7 +1367,7 @@ interface UnsubscribeRequestParams {
1115
1367
  _meta?: Meta;
1116
1368
  }
1117
1369
  interface UnsubscribeRequest extends MAPRequestBase<UnsubscribeRequestParams> {
1118
- method: 'map/unsubscribe';
1370
+ method: "map/unsubscribe";
1119
1371
  params: UnsubscribeRequestParams;
1120
1372
  }
1121
1373
  interface UnsubscribeResponseResult {
@@ -1182,7 +1434,7 @@ interface ReplayRequestParams {
1182
1434
  _meta?: Meta;
1183
1435
  }
1184
1436
  interface ReplayRequest extends MAPRequestBase<ReplayRequestParams> {
1185
- method: 'map/replay';
1437
+ method: "map/replay";
1186
1438
  params?: ReplayRequestParams;
1187
1439
  }
1188
1440
  interface ReplayResponseResult {
@@ -1202,7 +1454,7 @@ interface AuthRefreshRequestParams {
1202
1454
  _meta?: Meta;
1203
1455
  }
1204
1456
  interface AuthRefreshRequest extends MAPRequestBase<AuthRefreshRequestParams> {
1205
- method: 'map/auth/refresh';
1457
+ method: "map/auth/refresh";
1206
1458
  params: AuthRefreshRequestParams;
1207
1459
  }
1208
1460
  interface AuthRefreshResponseResult {
@@ -1225,7 +1477,7 @@ interface AuthenticateRequestParams {
1225
1477
  _meta?: Meta;
1226
1478
  }
1227
1479
  interface AuthenticateRequest extends MAPRequestBase<AuthenticateRequestParams> {
1228
- method: 'map/authenticate';
1480
+ method: "map/authenticate";
1229
1481
  params: AuthenticateRequestParams;
1230
1482
  }
1231
1483
  /**
@@ -1249,7 +1501,7 @@ interface ScopesListRequestParams {
1249
1501
  _meta?: Meta;
1250
1502
  }
1251
1503
  interface ScopesListRequest extends MAPRequestBase<ScopesListRequestParams> {
1252
- method: 'map/scopes/list';
1504
+ method: "map/scopes/list";
1253
1505
  params?: ScopesListRequestParams;
1254
1506
  }
1255
1507
  interface ScopesListResponseResult {
@@ -1261,7 +1513,7 @@ interface ScopesGetRequestParams {
1261
1513
  _meta?: Meta;
1262
1514
  }
1263
1515
  interface ScopesGetRequest extends MAPRequestBase<ScopesGetRequestParams> {
1264
- method: 'map/scopes/get';
1516
+ method: "map/scopes/get";
1265
1517
  params: ScopesGetRequestParams;
1266
1518
  }
1267
1519
  interface ScopesGetResponseResult {
@@ -1284,7 +1536,7 @@ interface ScopesCreateRequestParams {
1284
1536
  _meta?: Meta;
1285
1537
  }
1286
1538
  interface ScopesCreateRequest extends MAPRequestBase<ScopesCreateRequestParams> {
1287
- method: 'map/scopes/create';
1539
+ method: "map/scopes/create";
1288
1540
  params?: ScopesCreateRequestParams;
1289
1541
  }
1290
1542
  interface ScopesCreateResponseResult {
@@ -1296,7 +1548,7 @@ interface ScopesDeleteRequestParams {
1296
1548
  _meta?: Meta;
1297
1549
  }
1298
1550
  interface ScopesDeleteRequest extends MAPRequestBase<ScopesDeleteRequestParams> {
1299
- method: 'map/scopes/delete';
1551
+ method: "map/scopes/delete";
1300
1552
  params: ScopesDeleteRequestParams;
1301
1553
  }
1302
1554
  interface ScopesDeleteResponseResult {
@@ -1309,7 +1561,7 @@ interface ScopesJoinRequestParams {
1309
1561
  _meta?: Meta;
1310
1562
  }
1311
1563
  interface ScopesJoinRequest extends MAPRequestBase<ScopesJoinRequestParams> {
1312
- method: 'map/scopes/join';
1564
+ method: "map/scopes/join";
1313
1565
  params: ScopesJoinRequestParams;
1314
1566
  }
1315
1567
  interface ScopesJoinResponseResult {
@@ -1323,7 +1575,7 @@ interface ScopesLeaveRequestParams {
1323
1575
  _meta?: Meta;
1324
1576
  }
1325
1577
  interface ScopesLeaveRequest extends MAPRequestBase<ScopesLeaveRequestParams> {
1326
- method: 'map/scopes/leave';
1578
+ method: "map/scopes/leave";
1327
1579
  params: ScopesLeaveRequestParams;
1328
1580
  }
1329
1581
  interface ScopesLeaveResponseResult {
@@ -1338,7 +1590,7 @@ interface ScopesMembersRequestParams {
1338
1590
  _meta?: Meta;
1339
1591
  }
1340
1592
  interface ScopesMembersRequest extends MAPRequestBase<ScopesMembersRequestParams> {
1341
- method: 'map/scopes/members';
1593
+ method: "map/scopes/members";
1342
1594
  params: ScopesMembersRequestParams;
1343
1595
  }
1344
1596
  interface ScopesMembersResponseResult {
@@ -1353,21 +1605,21 @@ interface StructureGraphRequestParams {
1353
1605
  _meta?: Meta;
1354
1606
  }
1355
1607
  interface StructureGraphRequest extends MAPRequestBase<StructureGraphRequestParams> {
1356
- method: 'map/structure/graph';
1608
+ method: "map/structure/graph";
1357
1609
  params?: StructureGraphRequestParams;
1358
1610
  }
1359
1611
  interface GraphEdge {
1360
1612
  from: AgentId;
1361
1613
  to: AgentId;
1362
- type: 'parent-child' | 'peer' | 'supervisor' | 'collaborator';
1614
+ type: "parent-child" | "peer" | "supervisor" | "collaborator";
1363
1615
  }
1364
1616
  interface StructureGraphResponseResult {
1365
1617
  nodes: Agent[];
1366
1618
  edges: GraphEdge[];
1367
1619
  _meta?: Meta;
1368
1620
  }
1369
- type InjectDelivery = 'interrupt' | 'queue' | 'best-effort';
1370
- type InjectDeliveryResult = 'interrupt' | 'queue' | 'message';
1621
+ type InjectDelivery = "interrupt" | "queue" | "best-effort";
1622
+ type InjectDeliveryResult = "interrupt" | "queue" | "message";
1371
1623
  interface InjectRequestParams {
1372
1624
  agentId: AgentId;
1373
1625
  content: unknown;
@@ -1375,7 +1627,7 @@ interface InjectRequestParams {
1375
1627
  _meta?: Meta;
1376
1628
  }
1377
1629
  interface InjectRequest extends MAPRequestBase<InjectRequestParams> {
1378
- method: 'map/inject';
1630
+ method: "map/inject";
1379
1631
  params: InjectRequestParams;
1380
1632
  }
1381
1633
  interface InjectResponseResult {
@@ -1395,7 +1647,7 @@ interface PermissionsUpdateRequestParams {
1395
1647
  _meta?: Meta;
1396
1648
  }
1397
1649
  interface PermissionsUpdateRequest extends MAPRequestBase<PermissionsUpdateRequestParams> {
1398
- method: 'map/permissions/update';
1650
+ method: "map/permissions/update";
1399
1651
  params: PermissionsUpdateRequestParams;
1400
1652
  }
1401
1653
  interface PermissionsUpdateResponseResult {
@@ -1513,7 +1765,7 @@ interface FederationBufferConfig {
1513
1765
  /** Time to retain buffered messages in ms (default: 1 hour) */
1514
1766
  retentionMs?: number;
1515
1767
  /** Strategy when buffer is full */
1516
- overflowStrategy?: 'drop-oldest' | 'drop-newest' | 'reject';
1768
+ overflowStrategy?: "drop-oldest" | "drop-newest" | "reject";
1517
1769
  }
1518
1770
  /**
1519
1771
  * Configuration for replaying events from event store on reconnection.
@@ -1532,7 +1784,7 @@ interface FederationReplayConfig {
1532
1784
  /**
1533
1785
  * Type of gateway reconnection event.
1534
1786
  */
1535
- type GatewayReconnectionEventType = 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'reconnect_failed' | 'buffer_overflow' | 'replay_started' | 'replay_completed';
1787
+ type GatewayReconnectionEventType = "connecting" | "connected" | "disconnected" | "reconnecting" | "reconnect_failed" | "buffer_overflow" | "replay_started" | "replay_completed";
1536
1788
  /**
1537
1789
  * Event emitted during gateway reconnection lifecycle.
1538
1790
  */
@@ -1584,10 +1836,27 @@ interface FederationConnectRequestParams {
1584
1836
  systemId: string;
1585
1837
  endpoint: string;
1586
1838
  auth?: FederationAuth;
1839
+ /** Pre-fetched server auth context (e.g., from .well-known discovery) */
1840
+ authContext?: {
1841
+ /** How the client learned the server's auth requirements */
1842
+ source: "well-known" | "cached" | "configured";
1843
+ /** Server's nonce/challenge (if pre-fetched, e.g., for did:wba) */
1844
+ challenge?: string;
1845
+ };
1846
+ /** System info about the connecting peer */
1847
+ systemInfo?: {
1848
+ name: string;
1849
+ version: string;
1850
+ endpoint: string;
1851
+ };
1852
+ /** MAP protocol version (default: 1) */
1853
+ protocolVersion?: number;
1854
+ /** What this peer exposes to the other side */
1855
+ exposure?: Record<string, unknown>;
1587
1856
  _meta?: Meta;
1588
1857
  }
1589
1858
  interface FederationConnectRequest extends MAPRequestBase<FederationConnectRequestParams> {
1590
- method: 'map/federation/connect';
1859
+ method: "map/federation/connect";
1591
1860
  params: FederationConnectRequestParams;
1592
1861
  }
1593
1862
  interface FederationConnectResponseResult {
@@ -1597,6 +1866,17 @@ interface FederationConnectResponseResult {
1597
1866
  version?: string;
1598
1867
  capabilities?: ParticipantCapabilities;
1599
1868
  };
1869
+ /** Federation session ID (when single-request auth succeeds) */
1870
+ sessionId?: string;
1871
+ /** Authenticated principal (when single-request auth succeeds) */
1872
+ principal?: AuthPrincipal;
1873
+ /** Auth negotiation fallback (when auth not provided or failed recoverably) */
1874
+ authRequired?: {
1875
+ methods: string[];
1876
+ /** Server-generated challenge nonce (e.g., for did:wba) */
1877
+ challenge?: string;
1878
+ required: boolean;
1879
+ };
1600
1880
  _meta?: Meta;
1601
1881
  }
1602
1882
  interface FederationRouteRequestParams {
@@ -1615,7 +1895,7 @@ interface FederationRouteRequestParams {
1615
1895
  _meta?: Meta;
1616
1896
  }
1617
1897
  interface FederationRouteRequest extends MAPRequestBase<FederationRouteRequestParams> {
1618
- method: 'map/federation/route';
1898
+ method: "map/federation/route";
1619
1899
  params: FederationRouteRequestParams;
1620
1900
  }
1621
1901
  interface FederationRouteResponseResult {
@@ -1623,6 +1903,537 @@ interface FederationRouteResponseResult {
1623
1903
  messageId?: MessageId;
1624
1904
  _meta?: Meta;
1625
1905
  }
1906
+ /**
1907
+ * Type of conversation.
1908
+ */
1909
+ type ConversationType = "user-session" | "agent-task" | "multi-agent" | "mixed";
1910
+ /**
1911
+ * Status of a conversation.
1912
+ */
1913
+ type ConversationStatus = "active" | "paused" | "completed" | "failed" | "archived";
1914
+ /**
1915
+ * A conversation - a container for tracking related interactions.
1916
+ */
1917
+ interface Conversation {
1918
+ id: ConversationId;
1919
+ type: ConversationType;
1920
+ status: ConversationStatus;
1921
+ subject?: string;
1922
+ participantCount: number;
1923
+ parentConversationId?: ConversationId;
1924
+ parentTurnId?: TurnId;
1925
+ createdAt: Timestamp;
1926
+ updatedAt: Timestamp;
1927
+ closedAt?: Timestamp;
1928
+ createdBy: ParticipantId;
1929
+ metadata?: Record<string, unknown>;
1930
+ _meta?: Meta;
1931
+ }
1932
+ /**
1933
+ * Role of a participant within a conversation.
1934
+ */
1935
+ type ParticipantRole = "initiator" | "assistant" | "worker" | "observer" | "moderator";
1936
+ /**
1937
+ * Permissions for a participant within a conversation.
1938
+ */
1939
+ interface ConversationPermissions {
1940
+ canSend: boolean;
1941
+ canObserve: boolean;
1942
+ canInvite: boolean;
1943
+ canRemove: boolean;
1944
+ canCreateThreads: boolean;
1945
+ historyAccess: "none" | "from-join" | "full";
1946
+ canSeeInternal: boolean;
1947
+ _meta?: Meta;
1948
+ }
1949
+ /**
1950
+ * A participant in a conversation with role and permissions.
1951
+ */
1952
+ interface ConversationParticipant {
1953
+ id: ParticipantId;
1954
+ type: "user" | "agent" | "system";
1955
+ role: ParticipantRole;
1956
+ joinedAt: Timestamp;
1957
+ leftAt?: Timestamp;
1958
+ permissions: ConversationPermissions;
1959
+ agentInfo?: {
1960
+ agentId: AgentId;
1961
+ name?: string;
1962
+ role?: string;
1963
+ };
1964
+ _meta?: Meta;
1965
+ }
1966
+ /**
1967
+ * A thread within a conversation for focused discussion.
1968
+ */
1969
+ interface Thread {
1970
+ id: ThreadId;
1971
+ conversationId: ConversationId;
1972
+ parentThreadId?: ThreadId;
1973
+ subject?: string;
1974
+ rootTurnId: TurnId;
1975
+ turnCount: number;
1976
+ participantCount: number;
1977
+ createdAt: Timestamp;
1978
+ updatedAt: Timestamp;
1979
+ createdBy: ParticipantId;
1980
+ _meta?: Meta;
1981
+ }
1982
+ /**
1983
+ * How a turn was created.
1984
+ * - 'explicit': Created directly via mail/turn call
1985
+ * - 'intercepted': Auto-recorded from map/send with mail meta
1986
+ */
1987
+ type TurnSource = {
1988
+ type: "explicit";
1989
+ method: "mail/turn";
1990
+ } | {
1991
+ type: "intercepted";
1992
+ messageId: MessageId;
1993
+ };
1994
+ /**
1995
+ * Visibility of a turn within a conversation.
1996
+ */
1997
+ type TurnVisibility = {
1998
+ type: "all";
1999
+ } | {
2000
+ type: "participants";
2001
+ ids: ParticipantId[];
2002
+ } | {
2003
+ type: "role";
2004
+ roles: ParticipantRole[];
2005
+ } | {
2006
+ type: "private";
2007
+ };
2008
+ /**
2009
+ * Status of a turn's content lifecycle.
2010
+ */
2011
+ type TurnStatus = "pending" | "streaming" | "complete" | "failed";
2012
+ /**
2013
+ * A turn - the atomic unit of conversation.
2014
+ * Records what a participant intentionally communicates.
2015
+ *
2016
+ * Content uses a generic model:
2017
+ * - Well-known types: 'text', 'data', 'event', 'reference'
2018
+ * - Custom types use 'x-' prefix (e.g., 'x-tool-call')
2019
+ */
2020
+ interface Turn {
2021
+ id: TurnId;
2022
+ conversationId: ConversationId;
2023
+ participant: ParticipantId;
2024
+ timestamp: Timestamp;
2025
+ /** Content type - well-known ('text', 'data', 'event', 'reference') or custom ('x-*') */
2026
+ contentType: string;
2027
+ /** Content payload - shape determined by contentType */
2028
+ content: unknown;
2029
+ /** Thread this turn belongs to */
2030
+ threadId?: ThreadId;
2031
+ /** Turn this is in reply to */
2032
+ inReplyTo?: TurnId;
2033
+ /** How this turn was created */
2034
+ source: TurnSource;
2035
+ /** Who can see this turn */
2036
+ visibility?: TurnVisibility;
2037
+ /** Status of the turn content */
2038
+ status?: TurnStatus;
2039
+ metadata?: Record<string, unknown>;
2040
+ _meta?: Meta;
2041
+ }
2042
+ /**
2043
+ * Mail metadata for map/send turn tracking.
2044
+ * Include in MessageMeta.mail to route AND record a turn.
2045
+ */
2046
+ interface MailMessageMeta {
2047
+ conversationId: ConversationId;
2048
+ threadId?: ThreadId;
2049
+ inReplyTo?: TurnId;
2050
+ visibility?: TurnVisibility;
2051
+ }
2052
+ /**
2053
+ * Mail-specific subscription filter.
2054
+ * Used in SubscriptionFilter.mail for filtering mail events.
2055
+ */
2056
+ interface MailSubscriptionFilter {
2057
+ conversationId?: ConversationId;
2058
+ threadId?: ThreadId;
2059
+ participantId?: ParticipantId;
2060
+ contentType?: string;
2061
+ }
2062
+ /** Data for mail.created events */
2063
+ interface MailCreatedEventData {
2064
+ conversationId: ConversationId;
2065
+ type: ConversationType;
2066
+ subject?: string;
2067
+ createdBy: ParticipantId;
2068
+ }
2069
+ /** Data for mail.closed events */
2070
+ interface MailClosedEventData {
2071
+ conversationId: ConversationId;
2072
+ closedBy: ParticipantId;
2073
+ reason?: string;
2074
+ }
2075
+ /** Data for mail.participant.joined events */
2076
+ interface MailParticipantJoinedEventData {
2077
+ conversationId: ConversationId;
2078
+ participant: ConversationParticipant;
2079
+ }
2080
+ /** Data for mail.participant.left events */
2081
+ interface MailParticipantLeftEventData {
2082
+ conversationId: ConversationId;
2083
+ participantId: ParticipantId;
2084
+ reason?: string;
2085
+ }
2086
+ /** Data for mail.turn.added events */
2087
+ interface MailTurnAddedEventData {
2088
+ conversationId: ConversationId;
2089
+ turn: Turn;
2090
+ }
2091
+ /** Data for mail.turn.updated events */
2092
+ interface MailTurnUpdatedEventData {
2093
+ conversationId: ConversationId;
2094
+ turnId: TurnId;
2095
+ status?: TurnStatus;
2096
+ }
2097
+ /** Data for mail.thread.created events */
2098
+ interface MailThreadCreatedEventData {
2099
+ conversationId: ConversationId;
2100
+ thread: Thread;
2101
+ }
2102
+ /** Data for mail.summary.generated events */
2103
+ interface MailSummaryGeneratedEventData {
2104
+ conversationId: ConversationId;
2105
+ summary: string;
2106
+ }
2107
+ interface MailCreateRequestParams {
2108
+ type?: ConversationType;
2109
+ subject?: string;
2110
+ parentConversationId?: ConversationId;
2111
+ parentTurnId?: TurnId;
2112
+ initialParticipants?: Array<{
2113
+ id: ParticipantId;
2114
+ role?: ParticipantRole;
2115
+ permissions?: Partial<ConversationPermissions>;
2116
+ }>;
2117
+ initialTurn?: {
2118
+ contentType: string;
2119
+ content: unknown;
2120
+ visibility?: TurnVisibility;
2121
+ };
2122
+ metadata?: Record<string, unknown>;
2123
+ _meta?: Meta;
2124
+ }
2125
+ interface MailCreateRequest extends MAPRequestBase<MailCreateRequestParams> {
2126
+ method: "mail/create";
2127
+ params: MailCreateRequestParams;
2128
+ }
2129
+ interface MailCreateResponseResult {
2130
+ conversation: Conversation;
2131
+ participant: ConversationParticipant;
2132
+ initialTurn?: Turn;
2133
+ _meta?: Meta;
2134
+ }
2135
+ interface MailGetRequestParams {
2136
+ conversationId: ConversationId;
2137
+ include?: {
2138
+ participants?: boolean;
2139
+ threads?: boolean;
2140
+ recentTurns?: number;
2141
+ stats?: boolean;
2142
+ };
2143
+ _meta?: Meta;
2144
+ }
2145
+ interface MailGetRequest extends MAPRequestBase<MailGetRequestParams> {
2146
+ method: "mail/get";
2147
+ params: MailGetRequestParams;
2148
+ }
2149
+ interface MailGetResponseResult {
2150
+ conversation: Conversation;
2151
+ participants?: ConversationParticipant[];
2152
+ threads?: Thread[];
2153
+ recentTurns?: Turn[];
2154
+ stats?: {
2155
+ totalTurns: number;
2156
+ turnsByContentType: Record<string, number>;
2157
+ activeParticipants: number;
2158
+ threadCount: number;
2159
+ };
2160
+ _meta?: Meta;
2161
+ }
2162
+ interface MailListRequestParams {
2163
+ filter?: {
2164
+ type?: ConversationType[];
2165
+ status?: ConversationStatus[];
2166
+ participantId?: ParticipantId;
2167
+ createdAfter?: Timestamp;
2168
+ createdBefore?: Timestamp;
2169
+ parentConversationId?: ConversationId;
2170
+ };
2171
+ limit?: number;
2172
+ cursor?: string;
2173
+ _meta?: Meta;
2174
+ }
2175
+ interface MailListRequest extends MAPRequestBase<MailListRequestParams> {
2176
+ method: "mail/list";
2177
+ params?: MailListRequestParams;
2178
+ }
2179
+ interface MailListResponseResult {
2180
+ conversations: Conversation[];
2181
+ nextCursor?: string;
2182
+ hasMore: boolean;
2183
+ _meta?: Meta;
2184
+ }
2185
+ interface MailCloseRequestParams {
2186
+ conversationId: ConversationId;
2187
+ reason?: string;
2188
+ _meta?: Meta;
2189
+ }
2190
+ interface MailCloseRequest extends MAPRequestBase<MailCloseRequestParams> {
2191
+ method: "mail/close";
2192
+ params: MailCloseRequestParams;
2193
+ }
2194
+ interface MailCloseResponseResult {
2195
+ conversation: Conversation;
2196
+ _meta?: Meta;
2197
+ }
2198
+ interface MailJoinRequestParams {
2199
+ conversationId: ConversationId;
2200
+ role?: ParticipantRole;
2201
+ catchUp?: {
2202
+ from: string | number;
2203
+ limit?: number;
2204
+ includeSummary?: boolean;
2205
+ };
2206
+ _meta?: Meta;
2207
+ }
2208
+ interface MailJoinRequest extends MAPRequestBase<MailJoinRequestParams> {
2209
+ method: "mail/join";
2210
+ params: MailJoinRequestParams;
2211
+ }
2212
+ interface MailJoinResponseResult {
2213
+ conversation: Conversation;
2214
+ participant: ConversationParticipant;
2215
+ history?: Turn[];
2216
+ historyCursor?: string;
2217
+ summary?: string;
2218
+ _meta?: Meta;
2219
+ }
2220
+ interface MailLeaveRequestParams {
2221
+ conversationId: ConversationId;
2222
+ reason?: string;
2223
+ _meta?: Meta;
2224
+ }
2225
+ interface MailLeaveRequest extends MAPRequestBase<MailLeaveRequestParams> {
2226
+ method: "mail/leave";
2227
+ params: MailLeaveRequestParams;
2228
+ }
2229
+ interface MailLeaveResponseResult {
2230
+ success: boolean;
2231
+ leftAt: Timestamp;
2232
+ _meta?: Meta;
2233
+ }
2234
+ interface MailInviteRequestParams {
2235
+ conversationId: ConversationId;
2236
+ participant: {
2237
+ id: ParticipantId;
2238
+ role?: ParticipantRole;
2239
+ permissions?: Partial<ConversationPermissions>;
2240
+ };
2241
+ message?: string;
2242
+ _meta?: Meta;
2243
+ }
2244
+ interface MailInviteRequest extends MAPRequestBase<MailInviteRequestParams> {
2245
+ method: "mail/invite";
2246
+ params: MailInviteRequestParams;
2247
+ }
2248
+ interface MailInviteResponseResult {
2249
+ invited: boolean;
2250
+ participant?: ConversationParticipant;
2251
+ invitationId?: string;
2252
+ pending?: boolean;
2253
+ _meta?: Meta;
2254
+ }
2255
+ interface MailTurnRequestParams {
2256
+ conversationId: ConversationId;
2257
+ contentType: string;
2258
+ content: unknown;
2259
+ threadId?: ThreadId;
2260
+ inReplyTo?: TurnId;
2261
+ visibility?: TurnVisibility;
2262
+ metadata?: Record<string, unknown>;
2263
+ _meta?: Meta;
2264
+ }
2265
+ interface MailTurnRequest extends MAPRequestBase<MailTurnRequestParams> {
2266
+ method: "mail/turn";
2267
+ params: MailTurnRequestParams;
2268
+ }
2269
+ interface MailTurnResponseResult {
2270
+ turn: Turn;
2271
+ _meta?: Meta;
2272
+ }
2273
+ interface MailTurnsListRequestParams {
2274
+ conversationId: ConversationId;
2275
+ filter?: {
2276
+ threadId?: ThreadId;
2277
+ includeAllThreads?: boolean;
2278
+ contentTypes?: string[];
2279
+ participantId?: ParticipantId;
2280
+ afterTurnId?: TurnId;
2281
+ beforeTurnId?: TurnId;
2282
+ afterTimestamp?: Timestamp;
2283
+ beforeTimestamp?: Timestamp;
2284
+ };
2285
+ limit?: number;
2286
+ order?: "asc" | "desc";
2287
+ _meta?: Meta;
2288
+ }
2289
+ interface MailTurnsListRequest extends MAPRequestBase<MailTurnsListRequestParams> {
2290
+ method: "mail/turns/list";
2291
+ params: MailTurnsListRequestParams;
2292
+ }
2293
+ interface MailTurnsListResponseResult {
2294
+ turns: Turn[];
2295
+ hasMore: boolean;
2296
+ nextCursor?: string;
2297
+ _meta?: Meta;
2298
+ }
2299
+ interface MailThreadCreateRequestParams {
2300
+ conversationId: ConversationId;
2301
+ rootTurnId: TurnId;
2302
+ subject?: string;
2303
+ parentThreadId?: ThreadId;
2304
+ _meta?: Meta;
2305
+ }
2306
+ interface MailThreadCreateRequest extends MAPRequestBase<MailThreadCreateRequestParams> {
2307
+ method: "mail/thread/create";
2308
+ params: MailThreadCreateRequestParams;
2309
+ }
2310
+ interface MailThreadCreateResponseResult {
2311
+ thread: Thread;
2312
+ _meta?: Meta;
2313
+ }
2314
+ interface MailThreadListRequestParams {
2315
+ conversationId: ConversationId;
2316
+ parentThreadId?: ThreadId;
2317
+ limit?: number;
2318
+ cursor?: string;
2319
+ _meta?: Meta;
2320
+ }
2321
+ interface MailThreadListRequest extends MAPRequestBase<MailThreadListRequestParams> {
2322
+ method: "mail/thread/list";
2323
+ params?: MailThreadListRequestParams;
2324
+ }
2325
+ interface MailThreadListResponseResult {
2326
+ threads: Thread[];
2327
+ hasMore: boolean;
2328
+ nextCursor?: string;
2329
+ _meta?: Meta;
2330
+ }
2331
+ interface MailSummaryRequestParams {
2332
+ conversationId: ConversationId;
2333
+ scope?: {
2334
+ fromTurnId?: TurnId;
2335
+ toTurnId?: TurnId;
2336
+ threadId?: ThreadId;
2337
+ };
2338
+ regenerate?: boolean;
2339
+ include?: {
2340
+ keyPoints?: boolean;
2341
+ keyDecisions?: boolean;
2342
+ openQuestions?: boolean;
2343
+ participants?: boolean;
2344
+ };
2345
+ _meta?: Meta;
2346
+ }
2347
+ interface MailSummaryRequest extends MAPRequestBase<MailSummaryRequestParams> {
2348
+ method: "mail/summary";
2349
+ params: MailSummaryRequestParams;
2350
+ }
2351
+ interface MailSummaryResponseResult {
2352
+ summary: string;
2353
+ keyPoints?: string[];
2354
+ keyDecisions?: string[];
2355
+ openQuestions?: string[];
2356
+ generated: boolean;
2357
+ cachedAt?: Timestamp;
2358
+ _meta?: Meta;
2359
+ }
2360
+ interface MailReplayRequestParams {
2361
+ conversationId: ConversationId;
2362
+ fromTurnId?: TurnId;
2363
+ fromTimestamp?: Timestamp;
2364
+ threadId?: ThreadId;
2365
+ limit?: number;
2366
+ contentTypes?: string[];
2367
+ _meta?: Meta;
2368
+ }
2369
+ interface MailReplayRequest extends MAPRequestBase<MailReplayRequestParams> {
2370
+ method: "mail/replay";
2371
+ params: MailReplayRequestParams;
2372
+ }
2373
+ interface MailReplayResponseResult {
2374
+ turns: Turn[];
2375
+ hasMore: boolean;
2376
+ nextCursor?: string;
2377
+ missedCount: number;
2378
+ _meta?: Meta;
2379
+ }
2380
+ interface WorkspaceSearchRequestParams {
2381
+ /** Agent whose workspace to search */
2382
+ agentId: AgentId;
2383
+ /** Search query (matched against filenames) */
2384
+ query: string;
2385
+ /** Subdirectory to search within (relative to workspace root) */
2386
+ cwd?: string;
2387
+ /** Max results to return (default 50) */
2388
+ limit?: number;
2389
+ _meta?: Meta;
2390
+ }
2391
+ interface WorkspaceFileResult {
2392
+ /** Relative path from workspace root */
2393
+ path: string;
2394
+ /** Whether this is a directory */
2395
+ isDirectory: boolean;
2396
+ /** File size in bytes (undefined for directories) */
2397
+ size?: number;
2398
+ /** MIME type guess based on extension */
2399
+ mime?: string;
2400
+ }
2401
+ interface WorkspaceSearchResponseResult {
2402
+ files: WorkspaceFileResult[];
2403
+ _meta?: Meta;
2404
+ }
2405
+ interface WorkspaceListRequestParams {
2406
+ /** Agent whose workspace to list */
2407
+ agentId: AgentId;
2408
+ /** Directory to list (relative to workspace root, default ".") */
2409
+ directory?: string;
2410
+ _meta?: Meta;
2411
+ }
2412
+ interface WorkspaceListResponseResult {
2413
+ files: WorkspaceFileResult[];
2414
+ _meta?: Meta;
2415
+ }
2416
+ interface WorkspaceReadRequestParams {
2417
+ /** Agent whose workspace to read from */
2418
+ agentId: AgentId;
2419
+ /** File path relative to workspace root */
2420
+ path: string;
2421
+ /** Optional line range */
2422
+ lineRange?: {
2423
+ start: number;
2424
+ end: number;
2425
+ };
2426
+ _meta?: Meta;
2427
+ }
2428
+ interface WorkspaceReadResponseResult {
2429
+ /** File text content */
2430
+ text: string;
2431
+ /** MIME type */
2432
+ mime: string;
2433
+ /** File size in bytes */
2434
+ size: number;
2435
+ _meta?: Meta;
2436
+ }
1626
2437
  /**
1627
2438
  * Parameters for event notifications delivered to subscribers.
1628
2439
  *
@@ -1671,7 +2482,7 @@ interface EventNotificationParams {
1671
2482
  _meta?: Meta;
1672
2483
  }
1673
2484
  interface EventNotification extends MAPNotificationBase<EventNotificationParams> {
1674
- method: 'map/event';
2485
+ method: "map/event";
1675
2486
  params: EventNotificationParams;
1676
2487
  }
1677
2488
  interface MessageNotificationParams {
@@ -1679,11 +2490,11 @@ interface MessageNotificationParams {
1679
2490
  _meta?: Meta;
1680
2491
  }
1681
2492
  interface MessageNotification extends MAPNotificationBase<MessageNotificationParams> {
1682
- method: 'map/message';
2493
+ method: "map/message";
1683
2494
  params: MessageNotificationParams;
1684
2495
  }
1685
2496
  /** All MAP request types */
1686
- type MAPRequest = ConnectRequest | DisconnectRequest | SessionListRequest | SessionLoadRequest | SessionCloseRequest | AgentsListRequest | AgentsGetRequest | SendRequest | SubscribeRequest | UnsubscribeRequest | ReplayRequest | AuthRefreshRequest | AgentsRegisterRequest | AgentsSpawnRequest | AgentsUnregisterRequest | AgentsUpdateRequest | AgentsStopRequest | AgentsSuspendRequest | AgentsResumeRequest | StructureGraphRequest | ScopesListRequest | ScopesGetRequest | ScopesCreateRequest | ScopesDeleteRequest | ScopesJoinRequest | ScopesLeaveRequest | ScopesMembersRequest | PermissionsUpdateRequest | InjectRequest | FederationConnectRequest | FederationRouteRequest;
2497
+ type MAPRequest = ConnectRequest | DisconnectRequest | SessionListRequest | SessionLoadRequest | SessionCloseRequest | AgentsListRequest | AgentsGetRequest | SendRequest | SubscribeRequest | UnsubscribeRequest | ReplayRequest | AuthRefreshRequest | AgentsRegisterRequest | AgentsSpawnRequest | AgentsUnregisterRequest | AgentsUpdateRequest | AgentsStopRequest | AgentsSuspendRequest | AgentsResumeRequest | StructureGraphRequest | ScopesListRequest | ScopesGetRequest | ScopesCreateRequest | ScopesDeleteRequest | ScopesJoinRequest | ScopesLeaveRequest | ScopesMembersRequest | PermissionsUpdateRequest | InjectRequest | FederationConnectRequest | FederationRouteRequest | MailCreateRequest | MailGetRequest | MailListRequest | MailCloseRequest | MailJoinRequest | MailLeaveRequest | MailInviteRequest | MailTurnRequest | MailTurnsListRequest | MailThreadCreateRequest | MailThreadListRequest | MailSummaryRequest | MailReplayRequest;
1687
2498
  /** All MAP notification types */
1688
2499
  type MAPNotification = EventNotification | MessageNotification | SubscriptionAckNotification;
1689
2500
  /** Core methods - All implementations must support */
@@ -1748,6 +2559,28 @@ declare const FEDERATION_METHODS: {
1748
2559
  readonly FEDERATION_CONNECT: "map/federation/connect";
1749
2560
  readonly FEDERATION_ROUTE: "map/federation/route";
1750
2561
  };
2562
+ /** Mail methods - Conversation and turn management */
2563
+ declare const MAIL_METHODS: {
2564
+ readonly MAIL_CREATE: "mail/create";
2565
+ readonly MAIL_GET: "mail/get";
2566
+ readonly MAIL_LIST: "mail/list";
2567
+ readonly MAIL_CLOSE: "mail/close";
2568
+ readonly MAIL_JOIN: "mail/join";
2569
+ readonly MAIL_LEAVE: "mail/leave";
2570
+ readonly MAIL_INVITE: "mail/invite";
2571
+ readonly MAIL_TURN: "mail/turn";
2572
+ readonly MAIL_TURNS_LIST: "mail/turns/list";
2573
+ readonly MAIL_THREAD_CREATE: "mail/thread/create";
2574
+ readonly MAIL_THREAD_LIST: "mail/thread/list";
2575
+ readonly MAIL_SUMMARY: "mail/summary";
2576
+ readonly MAIL_REPLAY: "mail/replay";
2577
+ };
2578
+ /** Workspace methods */
2579
+ declare const WORKSPACE_METHODS: {
2580
+ readonly WORKSPACE_SEARCH: "workspace/search";
2581
+ readonly WORKSPACE_LIST: "workspace/list";
2582
+ readonly WORKSPACE_READ: "workspace/read";
2583
+ };
1751
2584
  /** Notification methods */
1752
2585
  declare const NOTIFICATION_METHODS: {
1753
2586
  readonly EVENT: "map/event";
@@ -1759,6 +2592,22 @@ declare const NOTIFICATION_METHODS: {
1759
2592
  };
1760
2593
  /** All MAP methods */
1761
2594
  declare const MAP_METHODS: {
2595
+ readonly WORKSPACE_SEARCH: "workspace/search";
2596
+ readonly WORKSPACE_LIST: "workspace/list";
2597
+ readonly WORKSPACE_READ: "workspace/read";
2598
+ readonly MAIL_CREATE: "mail/create";
2599
+ readonly MAIL_GET: "mail/get";
2600
+ readonly MAIL_LIST: "mail/list";
2601
+ readonly MAIL_CLOSE: "mail/close";
2602
+ readonly MAIL_JOIN: "mail/join";
2603
+ readonly MAIL_LEAVE: "mail/leave";
2604
+ readonly MAIL_INVITE: "mail/invite";
2605
+ readonly MAIL_TURN: "mail/turn";
2606
+ readonly MAIL_TURNS_LIST: "mail/turns/list";
2607
+ readonly MAIL_THREAD_CREATE: "mail/thread/create";
2608
+ readonly MAIL_THREAD_LIST: "mail/thread/list";
2609
+ readonly MAIL_SUMMARY: "mail/summary";
2610
+ readonly MAIL_REPLAY: "mail/replay";
1762
2611
  readonly FEDERATION_CONNECT: "map/federation/connect";
1763
2612
  readonly FEDERATION_ROUTE: "map/federation/route";
1764
2613
  readonly PERMISSIONS_UPDATE: "map/permissions/update";
@@ -1861,9 +2710,38 @@ declare const FEDERATION_ERROR_CODES: {
1861
2710
  readonly FEDERATION_LOOP_DETECTED: 5010;
1862
2711
  /** Message exceeded maximum hop count */
1863
2712
  readonly FEDERATION_MAX_HOPS_EXCEEDED: 5011;
2713
+ /** DID document resolution failed (network error, invalid document, etc.) */
2714
+ readonly FEDERATION_DID_RESOLUTION_FAILED: 5004;
2715
+ /** DID proof verification failed (bad signature, expired, wrong challenge, etc.) */
2716
+ readonly FEDERATION_DID_PROOF_INVALID: 5005;
2717
+ };
2718
+ /** Mail error codes - prefixed to avoid collision with PERMISSION_DENIED */
2719
+ declare const MAIL_ERROR_CODES: {
2720
+ readonly MAIL_CONVERSATION_NOT_FOUND: 10000;
2721
+ readonly MAIL_CONVERSATION_CLOSED: 10001;
2722
+ readonly MAIL_NOT_A_PARTICIPANT: 10002;
2723
+ readonly MAIL_PERMISSION_DENIED: 10003;
2724
+ readonly MAIL_TURN_NOT_FOUND: 10004;
2725
+ readonly MAIL_THREAD_NOT_FOUND: 10005;
2726
+ readonly MAIL_INVALID_TURN_CONTENT: 10006;
2727
+ readonly MAIL_PARTICIPANT_ALREADY_JOINED: 10007;
2728
+ readonly MAIL_INVITATION_REQUIRED: 10008;
2729
+ readonly MAIL_HISTORY_ACCESS_DENIED: 10009;
2730
+ readonly MAIL_PARENT_CONVERSATION_NOT_FOUND: 10010;
1864
2731
  };
1865
2732
  /** All error codes */
1866
2733
  declare const ERROR_CODES: {
2734
+ readonly MAIL_CONVERSATION_NOT_FOUND: 10000;
2735
+ readonly MAIL_CONVERSATION_CLOSED: 10001;
2736
+ readonly MAIL_NOT_A_PARTICIPANT: 10002;
2737
+ readonly MAIL_PERMISSION_DENIED: 10003;
2738
+ readonly MAIL_TURN_NOT_FOUND: 10004;
2739
+ readonly MAIL_THREAD_NOT_FOUND: 10005;
2740
+ readonly MAIL_INVALID_TURN_CONTENT: 10006;
2741
+ readonly MAIL_PARTICIPANT_ALREADY_JOINED: 10007;
2742
+ readonly MAIL_INVITATION_REQUIRED: 10008;
2743
+ readonly MAIL_HISTORY_ACCESS_DENIED: 10009;
2744
+ readonly MAIL_PARENT_CONVERSATION_NOT_FOUND: 10010;
1867
2745
  readonly FEDERATION_UNAVAILABLE: 5000;
1868
2746
  readonly FEDERATION_SYSTEM_NOT_FOUND: 5001;
1869
2747
  readonly FEDERATION_AUTH_FAILED: 5002;
@@ -1872,6 +2750,10 @@ declare const ERROR_CODES: {
1872
2750
  readonly FEDERATION_LOOP_DETECTED: 5010;
1873
2751
  /** Message exceeded maximum hop count */
1874
2752
  readonly FEDERATION_MAX_HOPS_EXCEEDED: 5011;
2753
+ /** DID document resolution failed (network error, invalid document, etc.) */
2754
+ readonly FEDERATION_DID_RESOLUTION_FAILED: 5004;
2755
+ /** DID proof verification failed (bad signature, expired, wrong challenge, etc.) */
2756
+ readonly FEDERATION_DID_PROOF_INVALID: 5005;
1875
2757
  readonly EXHAUSTED: 4000;
1876
2758
  readonly RATE_LIMITED: 4001;
1877
2759
  readonly QUOTA_EXCEEDED: 4002;
@@ -4051,6 +4933,117 @@ declare class ClientConnection {
4051
4933
  resumed: boolean;
4052
4934
  agent?: Agent;
4053
4935
  }>;
4936
+ /**
4937
+ * Create a new mail conversation.
4938
+ *
4939
+ * @param params - Conversation creation parameters
4940
+ * @returns Created conversation and participant info
4941
+ */
4942
+ createConversation(params?: Omit<MailCreateRequestParams, '_meta'>): Promise<MailCreateResponseResult>;
4943
+ /**
4944
+ * Get a conversation by ID with optional includes.
4945
+ *
4946
+ * @param conversationId - ID of the conversation to retrieve
4947
+ * @param include - Optional fields to include (participants, threads, recentTurns, stats)
4948
+ * @returns Conversation details with requested includes
4949
+ */
4950
+ getConversation(conversationId: ConversationId, include?: MailGetRequestParams['include']): Promise<MailGetResponseResult>;
4951
+ /**
4952
+ * List conversations with optional filters.
4953
+ *
4954
+ * @param params - Optional filter, limit, and cursor parameters
4955
+ * @returns Paginated list of conversations
4956
+ */
4957
+ listConversations(params?: Omit<MailListRequestParams, '_meta'>): Promise<MailListResponseResult>;
4958
+ /**
4959
+ * Close a conversation.
4960
+ *
4961
+ * @param conversationId - ID of the conversation to close
4962
+ * @param reason - Optional reason for closing
4963
+ * @returns The closed conversation
4964
+ */
4965
+ closeConversation(conversationId: ConversationId, reason?: string): Promise<MailCloseResponseResult>;
4966
+ /**
4967
+ * Join an existing conversation.
4968
+ *
4969
+ * @param params - Join parameters including conversationId and optional catch-up config
4970
+ * @returns Conversation, participant, and optional history
4971
+ */
4972
+ joinConversation(params: Omit<MailJoinRequestParams, '_meta'>): Promise<MailJoinResponseResult>;
4973
+ /**
4974
+ * Leave a conversation.
4975
+ *
4976
+ * @param conversationId - ID of the conversation to leave
4977
+ * @param reason - Optional reason for leaving
4978
+ * @returns Leave confirmation with timestamp
4979
+ */
4980
+ leaveConversation(conversationId: ConversationId, reason?: string): Promise<MailLeaveResponseResult>;
4981
+ /**
4982
+ * Invite a participant to a conversation.
4983
+ *
4984
+ * @param params - Invite parameters including conversationId and participant info
4985
+ * @returns Invite result
4986
+ */
4987
+ inviteToConversation(params: Omit<MailInviteRequestParams, '_meta'>): Promise<MailInviteResponseResult>;
4988
+ /**
4989
+ * Record a turn (message) in a conversation.
4990
+ *
4991
+ * @param params - Turn parameters including conversationId, contentType, and content
4992
+ * @returns The created turn
4993
+ */
4994
+ recordTurn(params: Omit<MailTurnRequestParams, '_meta'>): Promise<MailTurnResponseResult>;
4995
+ /**
4996
+ * List turns in a conversation with optional filters.
4997
+ *
4998
+ * @param params - List parameters including conversationId and optional filters
4999
+ * @returns Paginated list of turns
5000
+ */
5001
+ listTurns(params: Omit<MailTurnsListRequestParams, '_meta'>): Promise<MailTurnsListResponseResult>;
5002
+ /**
5003
+ * Create a thread in a conversation.
5004
+ *
5005
+ * @param params - Thread creation parameters including conversationId and rootTurnId
5006
+ * @returns The created thread
5007
+ */
5008
+ createThread(params: Omit<MailThreadCreateRequestParams, '_meta'>): Promise<MailThreadCreateResponseResult>;
5009
+ /**
5010
+ * List threads in a conversation.
5011
+ *
5012
+ * @param params - List parameters including conversationId
5013
+ * @returns Paginated list of threads
5014
+ */
5015
+ listThreads(params: Omit<MailThreadListRequestParams, '_meta'>): Promise<MailThreadListResponseResult>;
5016
+ /**
5017
+ * Get a summary of a conversation.
5018
+ *
5019
+ * @param params - Summary parameters including conversationId and optional scope/includes
5020
+ * @returns Generated summary with optional key points, decisions, and questions
5021
+ */
5022
+ getConversationSummary(params: Omit<MailSummaryRequestParams, '_meta'>): Promise<MailSummaryResponseResult>;
5023
+ /**
5024
+ * Replay turns from a conversation, optionally from a specific point.
5025
+ *
5026
+ * @param params - Replay parameters including conversationId and optional starting point
5027
+ * @returns Replayed turns with pagination info
5028
+ */
5029
+ replayConversation(params: Omit<MailReplayRequestParams, '_meta'>): Promise<MailReplayResponseResult>;
5030
+ /**
5031
+ * Send a message to an address with mail context attached.
5032
+ *
5033
+ * Wraps the standard `send()` method, automatically attaching `meta.mail`
5034
+ * with the specified conversationId so the message is recorded as a turn
5035
+ * in the conversation.
5036
+ *
5037
+ * @param to - Target address
5038
+ * @param payload - Message payload
5039
+ * @param conversationId - Conversation to associate with
5040
+ * @param options - Optional threadId and additional message meta
5041
+ * @returns Send result
5042
+ */
5043
+ sendWithMail(to: Address, payload: unknown, conversationId: ConversationId, options?: {
5044
+ threadId?: ThreadId;
5045
+ meta?: MessageMeta;
5046
+ }): Promise<SendResponseResult>;
4054
5047
  /**
4055
5048
  * Current connection state
4056
5049
  */
@@ -4524,6 +5517,117 @@ declare class AgentConnection {
4524
5517
  * @returns Unsubscribe function to remove the handler
4525
5518
  */
4526
5519
  onStateChange(handler: (newState: ConnectionState, oldState: ConnectionState) => void): () => void;
5520
+ /**
5521
+ * Create a new mail conversation.
5522
+ *
5523
+ * @param params - Conversation creation parameters
5524
+ * @returns Created conversation and participant info
5525
+ */
5526
+ createConversation(params?: Omit<MailCreateRequestParams, '_meta'>): Promise<MailCreateResponseResult>;
5527
+ /**
5528
+ * Get a conversation by ID with optional includes.
5529
+ *
5530
+ * @param conversationId - ID of the conversation to retrieve
5531
+ * @param include - Optional fields to include (participants, threads, recentTurns, stats)
5532
+ * @returns Conversation details with requested includes
5533
+ */
5534
+ getConversation(conversationId: ConversationId, include?: MailGetRequestParams['include']): Promise<MailGetResponseResult>;
5535
+ /**
5536
+ * List conversations with optional filters.
5537
+ *
5538
+ * @param params - Optional filter, limit, and cursor parameters
5539
+ * @returns Paginated list of conversations
5540
+ */
5541
+ listConversations(params?: Omit<MailListRequestParams, '_meta'>): Promise<MailListResponseResult>;
5542
+ /**
5543
+ * Close a conversation.
5544
+ *
5545
+ * @param conversationId - ID of the conversation to close
5546
+ * @param reason - Optional reason for closing
5547
+ * @returns The closed conversation
5548
+ */
5549
+ closeConversation(conversationId: ConversationId, reason?: string): Promise<MailCloseResponseResult>;
5550
+ /**
5551
+ * Join an existing conversation.
5552
+ *
5553
+ * @param params - Join parameters including conversationId and optional catch-up config
5554
+ * @returns Conversation, participant, and optional history
5555
+ */
5556
+ joinConversation(params: Omit<MailJoinRequestParams, '_meta'>): Promise<MailJoinResponseResult>;
5557
+ /**
5558
+ * Leave a conversation.
5559
+ *
5560
+ * @param conversationId - ID of the conversation to leave
5561
+ * @param reason - Optional reason for leaving
5562
+ * @returns Leave confirmation with timestamp
5563
+ */
5564
+ leaveConversation(conversationId: ConversationId, reason?: string): Promise<MailLeaveResponseResult>;
5565
+ /**
5566
+ * Invite a participant to a conversation.
5567
+ *
5568
+ * @param params - Invite parameters including conversationId and participant info
5569
+ * @returns Invite result
5570
+ */
5571
+ inviteToConversation(params: Omit<MailInviteRequestParams, '_meta'>): Promise<MailInviteResponseResult>;
5572
+ /**
5573
+ * Record a turn (message) in a conversation.
5574
+ *
5575
+ * @param params - Turn parameters including conversationId, contentType, and content
5576
+ * @returns The created turn
5577
+ */
5578
+ recordTurn(params: Omit<MailTurnRequestParams, '_meta'>): Promise<MailTurnResponseResult>;
5579
+ /**
5580
+ * List turns in a conversation with optional filters.
5581
+ *
5582
+ * @param params - List parameters including conversationId and optional filters
5583
+ * @returns Paginated list of turns
5584
+ */
5585
+ listTurns(params: Omit<MailTurnsListRequestParams, '_meta'>): Promise<MailTurnsListResponseResult>;
5586
+ /**
5587
+ * Create a thread in a conversation.
5588
+ *
5589
+ * @param params - Thread creation parameters including conversationId and rootTurnId
5590
+ * @returns The created thread
5591
+ */
5592
+ createThread(params: Omit<MailThreadCreateRequestParams, '_meta'>): Promise<MailThreadCreateResponseResult>;
5593
+ /**
5594
+ * List threads in a conversation.
5595
+ *
5596
+ * @param params - List parameters including conversationId
5597
+ * @returns Paginated list of threads
5598
+ */
5599
+ listThreads(params: Omit<MailThreadListRequestParams, '_meta'>): Promise<MailThreadListResponseResult>;
5600
+ /**
5601
+ * Get a summary of a conversation.
5602
+ *
5603
+ * @param params - Summary parameters including conversationId and optional scope/includes
5604
+ * @returns Generated summary with optional key points, decisions, and questions
5605
+ */
5606
+ getConversationSummary(params: Omit<MailSummaryRequestParams, '_meta'>): Promise<MailSummaryResponseResult>;
5607
+ /**
5608
+ * Replay turns from a conversation, optionally from a specific point.
5609
+ *
5610
+ * @param params - Replay parameters including conversationId and optional starting point
5611
+ * @returns Replayed turns with pagination info
5612
+ */
5613
+ replayConversation(params: Omit<MailReplayRequestParams, '_meta'>): Promise<MailReplayResponseResult>;
5614
+ /**
5615
+ * Send a message to an agent with mail context attached.
5616
+ *
5617
+ * Wraps the standard `send()` method, automatically attaching `meta.mail`
5618
+ * with the specified conversationId so the message is recorded as a turn
5619
+ * in the conversation.
5620
+ *
5621
+ * @param to - Target address
5622
+ * @param payload - Message payload
5623
+ * @param conversationId - Conversation to associate with
5624
+ * @param options - Optional threadId and additional message meta
5625
+ * @returns Send result
5626
+ */
5627
+ sendWithMail(to: Address, payload: unknown, conversationId: ConversationId, options?: {
5628
+ threadId?: ThreadId;
5629
+ meta?: MessageMeta;
5630
+ }): Promise<SendResponseResult>;
4527
5631
  }
4528
5632
 
4529
5633
  /**
@@ -4933,4 +6037,4 @@ declare function canAgentMessageAgent(senderAgent: Agent, targetAgentId: AgentId
4933
6037
  sharedScopes?: ScopeId[];
4934
6038
  }, config?: AgentPermissionConfig): boolean;
4935
6039
 
4936
- export { type ACPReadTextFileRequest as $, type AgentId as A, type BaseConnectionOptions as B, type ConnectResponseResult as C, type DisconnectResponseResult as D, type ErrorCategory as E, type FederationBufferConfig as F, type ScopesJoinResponseResult as G, type ScopesLeaveResponseResult as H, type ScopesListResponseResult as I, type MessageId as J, type SendResponseResult as K, type SubscriptionId as L, type MAPError as M, type SubscribeResponseResult as N, type AgentVisibility as O, type ParticipantCapabilities as P, type ScopeVisibility as Q, type RequestId as R, type Stream as S, type AgentState as T, type UnsubscribeResponseResult as U, type MessageMeta as V, AgentConnection as W, type ACPAgentHandler as X, type ACPSessionNotification as Y, type ACPRequestPermissionRequest as Z, type ACPRequestPermissionResponse as _, type MAPErrorData as a, type ACPPlan as a$, type ACPReadTextFileResponse as a0, type ACPWriteTextFileRequest as a1, type ACPWriteTextFileResponse as a2, type ACPCreateTerminalRequest as a3, type ACPCreateTerminalResponse as a4, type ACPTerminalOutputRequest as a5, type ACPTerminalOutputResponse as a6, type ACPReleaseTerminalRequest as a7, type ACPReleaseTerminalResponse as a8, type ACPWaitForTerminalExitRequest as a9, type ACPEnvVariable as aA, type ACPEnvelope as aB, ACPError as aC, type ACPErrorCode as aD, type ACPErrorObject as aE, type ACPErrorResponse as aF, type ACPFileSystemCapability as aG, type ACPHttpHeader as aH, type ACPImageContent as aI, type ACPImplementation as aJ, type ACPInitializeRequest as aK, type ACPInitializeResponse as aL, type ACPLoadSessionRequest as aM, type ACPLoadSessionResponse as aN, type ACPMcpCapabilities as aO, type ACPMcpServer as aP, type ACPMcpServerHttp as aQ, type ACPMcpServerSse as aR, type ACPMcpServerStdio as aS, type ACPMessage as aT, type ACPMeta as aU, type ACPNewSessionRequest as aV, type ACPNewSessionResponse as aW, type ACPNotification as aX, type ACPPermissionOption as aY, type ACPPermissionOptionId as aZ, type ACPPermissionOptionKind as a_, type ACPWaitForTerminalExitResponse as aa, type ACPKillTerminalCommandRequest as ab, type ACPKillTerminalCommandResponse as ac, type ACPSessionId as ad, type ACPAgentCapabilities as ae, type ACPAgentContext as af, type ACPAnnotations as ag, type ACPAudioContent as ah, type ACPAuthMethod as ai, type ACPAuthenticateRequest as aj, type ACPAuthenticateResponse as ak, type ACPAvailableCommand as al, type ACPAvailableCommandsUpdate as am, type ACPBlobResourceContents as an, type ACPCancelNotification as ao, type ACPCancelledPermissionOutcome as ap, type ACPCapability as aq, type ACPClientCapabilities as ar, type ACPClientHandlers as as, type ACPContent as at, type ACPContentBlock as au, type ACPContentChunk as av, type ACPContext as aw, type ACPCurrentModeUpdate as ax, type ACPDiff as ay, type ACPEmbeddedResource as az, type FederationEnvelope as b, type AgentsListFilter as b$, type ACPPlanEntry as b0, type ACPPlanEntryPriority as b1, type ACPPlanEntryStatus as b2, type ACPPromptCapabilities as b3, type ACPPromptRequest as b4, type ACPPromptResponse as b5, type ACPProtocolVersion as b6, type ACPRequest as b7, type ACPRequestId as b8, type ACPRequestPermissionOutcome as b9, type ACPToolCallUpdate as bA, type ACPToolKind as bB, ACP_ERROR_CODES as bC, ACP_METHODS as bD, ACP_PROTOCOL_VERSION as bE, AGENT_ERROR_CODES as bF, AUTH_ERROR_CODES as bG, AUTH_METHODS as bH, type AcceptanceContext as bI, type AgentAcceptanceRule as bJ, type AgentConnectOptions as bK, type AgentConnectionOptions as bL, type AgentIncludeOptions as bM, type AgentLifecycle as bN, type AgentMeshConnectOptions as bO, type AgentMessagingRule as bP, type AgentPermissionConfig as bQ, type AgentPermissions as bR, type AgentReconnectionEventHandler as bS, type AgentReconnectionEventType as bT, type AgentReconnectionOptions as bU, type AgentRelationship as bV, type AgentRelationshipType as bW, type AgentVisibilityRule as bX, type AgenticMeshStreamConfig as bY, type AgentsGetRequest as bZ, type AgentsGetRequestParams as b_, type ACPResourceLink as ba, type ACPResponse as bb, type ACPRole as bc, type ACPSelectedPermissionOutcome as bd, type ACPSessionCapabilities as be, type ACPSessionInfoUpdate as bf, type ACPSessionMode as bg, type ACPSessionModeId as bh, type ACPSessionModeState as bi, type ACPSessionUpdate as bj, type ACPSetSessionModeRequest as bk, type ACPSetSessionModeResponse as bl, type ACPStopReason as bm, ACPStreamConnection as bn, type ACPStreamEvents as bo, type ACPStreamOptions as bp, type ACPSuccessResponse as bq, type ACPTerminal as br, type ACPTerminalExitStatus as bs, type ACPTextContent as bt, type ACPTextResourceContents as bu, type ACPToolCall as bv, type ACPToolCallContent as bw, type ACPToolCallId as bx, type ACPToolCallLocation as by, type ACPToolCallStatus as bz, type Message as c, type FederationRouteRequest as c$, type AgentsListRequest as c0, type AgentsListRequestParams as c1, type AgentsRegisterRequest as c2, type AgentsRegisterRequestParams as c3, type AgentsResumeRequest as c4, type AgentsResumeRequestParams as c5, type AgentsResumeResponseResult as c6, type AgentsSpawnRequest as c7, type AgentsSpawnRequestParams as c8, type AgentsStopRequest as c9, type ClientAcceptanceRule as cA, type ClientConnectOptions as cB, ClientConnection as cC, type ClientConnectionOptions as cD, type ConnectRequest as cE, type ConnectRequestParams as cF, type CorrelationId as cG, DEFAULT_AGENT_PERMISSION_CONFIG as cH, type DeliverySemantics as cI, type DirectAddress as cJ, type DisconnectPolicy as cK, type DisconnectRequest as cL, type DisconnectRequestParams as cM, ERROR_CODES as cN, EVENT_TYPES as cO, EXTENSION_METHODS as cP, type EventInput as cQ, type EventNotification as cR, type EventNotificationParams as cS, FEDERATION_ERROR_CODES as cT, FEDERATION_METHODS as cU, type FederatedAddress as cV, type FederationAuth as cW, type FederationConnectRequest as cX, type FederationConnectRequestParams as cY, type FederationMetadata as cZ, type FederationReplayConfig as c_, type AgentsStopRequestParams as ca, type AgentsStopResponseResult as cb, type AgentsSuspendRequest as cc, type AgentsSuspendRequestParams as cd, type AgentsSuspendResponseResult as ce, type AgentsUnregisterRequest as cf, type AgentsUnregisterRequestParams as cg, type AgentsUpdateRequest as ch, type AgentsUpdateRequestParams as ci, type AnyMessage as cj, type AuthCredentials as ck, type AuthError as cl, type AuthErrorCode as cm, type AuthMethod as cn, type AuthPrincipal as co, type AuthRefreshRequest as cp, type AuthRefreshRequestParams as cq, type AuthRefreshResponseResult as cr, type AuthResult as cs, type AuthenticateRequest as ct, type AuthenticateRequestParams as cu, type AuthenticateResponseResult as cv, BaseConnection as cw, type BroadcastAddress as cx, CAPABILITY_REQUIREMENTS as cy, CORE_METHODS as cz, type FederationRoutingConfig as d, type ReplayRequest as d$, type FederationRouteRequestParams as d0, type GatewayReconnectionEvent as d1, type GatewayReconnectionEventHandler as d2, type GatewayReconnectionEventType as d3, type GatewayReconnectionOptions as d4, type GraphEdge as d5, type HierarchicalAddress as d6, type InjectDelivery as d7, type InjectDeliveryResult as d8, type InjectRequest as d9, type Meta as dA, type MultiAddress as dB, NOTIFICATION_METHODS as dC, type NotificationHandler as dD, OBSERVATION_METHODS as dE, type OverflowHandler as dF, type OverflowInfo as dG, PERMISSION_METHODS as dH, PROTOCOL_ERROR_CODES as dI, PROTOCOL_VERSION as dJ, type Participant as dK, type ParticipantAddress as dL, type PermissionAction as dM, type PermissionContext as dN, type PermissionParticipant as dO, type PermissionResult as dP, type PermissionSystemConfig as dQ, type PermissionsAgentUpdatedEventData as dR, type PermissionsClientUpdatedEventData as dS, type PermissionsUpdateRequest as dT, type PermissionsUpdateRequestParams as dU, type PermissionsUpdateResponseResult as dV, RESOURCE_ERROR_CODES as dW, ROUTING_ERROR_CODES as dX, type ReconnectionEventHandler as dY, type ReconnectionEventType as dZ, type ReconnectionOptions as d_, type InjectRequestParams as da, type InjectResponseResult as db, JSONRPC_VERSION as dc, type JoinPolicy as dd, LIFECYCLE_METHODS as de, type MAPNotification as df, type MAPNotificationBase as dg, type MAPRequest as dh, type MAPRequestBase as di, type MAPResponse as dj, type MAPResponseError as dk, type MAPResponseSuccess as dl, MAP_METHODS as dm, type MeshConnectOptions as dn, type MeshPeerEndpoint as dp, type MeshTransportAdapter as dq, type MessageDeliveredEventData as dr, type MessageFailedEventData as ds, type MessageHandler as dt, type MessageNotification as du, type MessageNotificationParams as dv, type MessagePriority as dw, type MessageRelationship as dx, type MessageSentEventData as dy, type MessageVisibility as dz, type EventType as e, agenticMeshStream as e$, type ReplayRequestParams as e0, type ReplayResponseResult as e1, type ReplayedEvent as e2, type RequestHandler as e3, type RoleAddress as e4, SCOPE_METHODS as e5, SESSION_METHODS as e6, STATE_METHODS as e7, STEERING_METHODS as e8, STRUCTURE_METHODS as e9, type SessionCloseResponseResult as eA, type SessionListRequest as eB, type SessionListRequestParams as eC, type SessionListResponseResult as eD, type SessionLoadRequest as eE, type SessionLoadRequestParams as eF, type SessionLoadResponseResult as eG, type StandardAuthMethod as eH, type StateChangeHandler as eI, type StreamingCapabilities as eJ, type StructureGraphRequest as eK, type StructureGraphRequestParams as eL, type StructureGraphResponseResult as eM, type StructureVisibilityRule as eN, type SubscribeRequest as eO, type SubscribeRequestParams as eP, Subscription as eQ, type SubscriptionAckNotification as eR, type SubscriptionAckParams as eS, type SubscriptionOptions$1 as eT, type SubscriptionState as eU, type SystemAcceptanceRule as eV, type SystemAddress as eW, type Timestamp as eX, type TransportType as eY, type UnsubscribeRequest as eZ, type UnsubscribeRequestParams as e_, type ScopeAddress as ea, type ScopeMessagingRule as eb, type ScopeVisibilityRule as ec, type ScopesCreateRequest as ed, type ScopesCreateRequestParams as ee, type ScopesDeleteRequest as ef, type ScopesDeleteRequestParams as eg, type ScopesDeleteResponseResult as eh, type ScopesGetRequest as ei, type ScopesGetRequestParams as ej, type ScopesGetResponseResult as ek, type ScopesJoinRequest as el, type ScopesJoinRequestParams as em, type ScopesLeaveRequest as en, type ScopesLeaveRequestParams as eo, type ScopesListRequest as ep, type ScopesListRequestParams as eq, type ScopesMembersRequest as er, type ScopesMembersRequestParams as es, type ScopesMembersResponseResult as et, type SendPolicy as eu, type SendRequest as ev, type SendRequestParams as ew, type ServerAuthCapabilities as ex, type SessionCloseRequest as ey, type SessionCloseRequestParams as ez, type SessionId as f, canAgentAcceptMessage as f0, canAgentMessageAgent as f1, canAgentSeeAgent as f2, canControlAgent as f3, canJoinScope as f4, canMessageAgent as f5, canPerformAction as f6, canPerformMethod as f7, canSeeAgent as f8, canSeeScope as f9, ndJsonStream as fA, resolveAgentPermissions as fB, waitForOpen as fC, websocketStream as fD, type SystemExposure as fE, canSendToScope as fa, createACPStream as fb, createEvent as fc, createStreamPair as fd, createSubscription as fe, deepMergePermissions as ff, filterVisibleAgents as fg, filterVisibleEvents as fh, filterVisibleScopes as fi, hasCapability as fj, isACPEnvelope as fk, isACPErrorResponse as fl, isACPNotification as fm, isACPRequest as fn, isACPResponse as fo, isACPSuccessResponse as fp, isAgentExposed as fq, isBroadcastAddress as fr, isDirectAddress as fs, isEventTypeExposed as ft, isFederatedAddress as fu, isHierarchicalAddress as fv, isOrphanedAgent as fw, isScopeExposed as fx, isSuccessResponse as fy, mapVisibilityToRule as fz, type FederationConnectResponseResult as g, type FederationRouteResponseResult as h, type ConnectionState as i, type ParticipantId as j, type ParticipantType as k, type ScopeId as l, type Agent as m, type Scope as n, type Address as o, type SubscriptionFilter as p, type Event as q, type AgentsGetResponseResult as r, type AgentsListResponseResult as s, type AgentsRegisterResponseResult as t, type AgentsSpawnResponseResult as u, type AgentsUnregisterResponseResult as v, type AgentsUpdateResponseResult as w, type ProtocolVersion as x, type SessionInfo as y, type ScopesCreateResponseResult as z };
6040
+ export { type ACPRequestPermissionResponse as $, type AgentId as A, type BaseConnectionOptions as B, type ConnectResponseResult as C, type DisconnectResponseResult as D, type ErrorCategory as E, type FederationBufferConfig as F, type ScopesCreateResponseResult as G, type ScopesJoinResponseResult as H, type ScopesLeaveResponseResult as I, type ScopesListResponseResult as J, type MessageId as K, type SendResponseResult as L, type MAPError as M, type SubscriptionId as N, type SubscribeResponseResult as O, type ParticipantCapabilities as P, type AgentVisibility as Q, type RequestId as R, type Stream as S, type ScopeVisibility as T, type UnsubscribeResponseResult as U, type AgentState as V, type MessageMeta as W, AgentConnection as X, type ACPAgentHandler as Y, type ACPSessionNotification as Z, type ACPRequestPermissionRequest as _, type MAPErrorData as a, type ACPPermissionOptionKind as a$, type ACPReadTextFileRequest as a0, type ACPReadTextFileResponse as a1, type ACPWriteTextFileRequest as a2, type ACPWriteTextFileResponse as a3, type ACPCreateTerminalRequest as a4, type ACPCreateTerminalResponse as a5, type ACPTerminalOutputRequest as a6, type ACPTerminalOutputResponse as a7, type ACPReleaseTerminalRequest as a8, type ACPReleaseTerminalResponse as a9, type ACPEmbeddedResource as aA, type ACPEnvVariable as aB, type ACPEnvelope as aC, ACPError as aD, type ACPErrorCode as aE, type ACPErrorObject as aF, type ACPErrorResponse as aG, type ACPFileSystemCapability as aH, type ACPHttpHeader as aI, type ACPImageContent as aJ, type ACPImplementation as aK, type ACPInitializeRequest as aL, type ACPInitializeResponse as aM, type ACPLoadSessionRequest as aN, type ACPLoadSessionResponse as aO, type ACPMcpCapabilities as aP, type ACPMcpServer as aQ, type ACPMcpServerHttp as aR, type ACPMcpServerSse as aS, type ACPMcpServerStdio as aT, type ACPMessage as aU, type ACPMeta as aV, type ACPNewSessionRequest as aW, type ACPNewSessionResponse as aX, type ACPNotification as aY, type ACPPermissionOption as aZ, type ACPPermissionOptionId as a_, type ACPWaitForTerminalExitRequest as aa, type ACPWaitForTerminalExitResponse as ab, type ACPKillTerminalCommandRequest as ac, type ACPKillTerminalCommandResponse as ad, type ACPSessionId as ae, type ACPAgentCapabilities as af, type ACPAgentContext as ag, type ACPAnnotations as ah, type ACPAudioContent as ai, type ACPAuthMethod as aj, type ACPAuthenticateRequest as ak, type ACPAuthenticateResponse as al, type ACPAvailableCommand as am, type ACPAvailableCommandsUpdate as an, type ACPBlobResourceContents as ao, type ACPCancelNotification as ap, type ACPCancelledPermissionOutcome as aq, type ACPCapability as ar, type ACPClientCapabilities as as, type ACPClientHandlers as at, type ACPContent as au, type ACPContentBlock as av, type ACPContentChunk as aw, type ACPContext as ax, type ACPCurrentModeUpdate as ay, type ACPDiff as az, type FederationEnvelope as b, type AgentsGetRequest as b$, type ACPPlan as b0, type ACPPlanEntry as b1, type ACPPlanEntryPriority as b2, type ACPPlanEntryStatus as b3, type ACPPromptCapabilities as b4, type ACPPromptRequest as b5, type ACPPromptResponse as b6, type ACPProtocolVersion as b7, type ACPRequest as b8, type ACPRequestId as b9, type ACPToolCallStatus as bA, type ACPToolCallUpdate as bB, type ACPToolKind as bC, ACP_ERROR_CODES as bD, ACP_METHODS as bE, ACP_PROTOCOL_VERSION as bF, AGENT_ERROR_CODES as bG, AUTH_ERROR_CODES as bH, AUTH_METHODS as bI, type AcceptanceContext as bJ, type AgentAcceptanceRule as bK, type AgentConnectOptions as bL, type AgentConnectionOptions as bM, type AgentEnvironment as bN, type AgentIncludeOptions as bO, type AgentLifecycle as bP, type AgentMeshConnectOptions as bQ, type AgentMessagingRule as bR, type AgentPermissionConfig as bS, type AgentPermissions as bT, type AgentReconnectionEventHandler as bU, type AgentReconnectionEventType as bV, type AgentReconnectionOptions as bW, type AgentRelationship as bX, type AgentRelationshipType as bY, type AgentVisibilityRule as bZ, type AgenticMeshStreamConfig as b_, type ACPRequestPermissionOutcome as ba, type ACPResourceLink as bb, type ACPResponse as bc, type ACPRole as bd, type ACPSelectedPermissionOutcome as be, type ACPSessionCapabilities as bf, type ACPSessionInfoUpdate as bg, type ACPSessionMode as bh, type ACPSessionModeId as bi, type ACPSessionModeState as bj, type ACPSessionUpdate as bk, type ACPSetSessionModeRequest as bl, type ACPSetSessionModeResponse as bm, type ACPStopReason as bn, ACPStreamConnection as bo, type ACPStreamEvents as bp, type ACPStreamOptions as bq, type ACPSuccessResponse as br, type ACPTerminal as bs, type ACPTerminalExitStatus as bt, type ACPTextContent as bu, type ACPTextResourceContents as bv, type ACPToolCall as bw, type ACPToolCallContent as bx, type ACPToolCallId as by, type ACPToolCallLocation as bz, type Message as c, EVENT_TYPES as c$, type AgentsGetRequestParams as c0, type AgentsListFilter as c1, type AgentsListRequest as c2, type AgentsListRequestParams as c3, type AgentsRegisterRequest as c4, type AgentsRegisterRequestParams as c5, type AgentsResumeRequest as c6, type AgentsResumeRequestParams as c7, type AgentsResumeResponseResult as c8, type AgentsSpawnRequest as c9, CAPABILITY_REQUIREMENTS as cA, CORE_METHODS as cB, type ClientAcceptanceRule as cC, type ClientConnectOptions as cD, ClientConnection as cE, type ClientConnectionOptions as cF, type ConnectRequest as cG, type ConnectRequestParams as cH, type Conversation as cI, type ConversationId as cJ, type ConversationParticipant as cK, type ConversationPermissions as cL, type ConversationStatus as cM, type ConversationType as cN, type CorrelationId as cO, DEFAULT_AGENT_PERMISSION_CONFIG as cP, type DIDDocument as cQ, type DIDService as cR, type DIDVerificationMethod as cS, type DIDWBACredentials as cT, type DIDWBAProof as cU, type DeliverySemantics as cV, type DirectAddress as cW, type DisconnectPolicy as cX, type DisconnectRequest as cY, type DisconnectRequestParams as cZ, ERROR_CODES as c_, type AgentsSpawnRequestParams as ca, type AgentsStopRequest as cb, type AgentsStopRequestParams as cc, type AgentsStopResponseResult as cd, type AgentsSuspendRequest as ce, type AgentsSuspendRequestParams as cf, type AgentsSuspendResponseResult as cg, type AgentsUnregisterRequest as ch, type AgentsUnregisterRequestParams as ci, type AgentsUpdateRequest as cj, type AgentsUpdateRequestParams as ck, type AnyMessage as cl, type AuthCredentials as cm, type AuthError as cn, type AuthErrorCode as co, type AuthMethod as cp, type AuthPrincipal as cq, type AuthRefreshRequest as cr, type AuthRefreshRequestParams as cs, type AuthRefreshResponseResult as ct, type AuthResult as cu, type AuthenticateRequest as cv, type AuthenticateRequestParams as cw, type AuthenticateResponseResult as cx, BaseConnection as cy, type BroadcastAddress as cz, type FederationRoutingConfig as d, type MailListRequest as d$, EXTENSION_METHODS as d0, type EventInput as d1, type EventNotification as d2, type EventNotificationParams as d3, FEDERATION_ERROR_CODES as d4, FEDERATION_METHODS as d5, type FederatedAddress as d6, type FederationAuthMethod as d7, type FederationConnectRequest as d8, type FederationConnectRequestParams as d9, type MAPNotificationBase as dA, type MAPRequest as dB, type MAPRequestBase as dC, type MAPResponse as dD, type MAPResponseError as dE, type MAPResponseSuccess as dF, MAP_METHODS as dG, type MailCloseRequest as dH, type MailCloseRequestParams as dI, type MailCloseResponseResult as dJ, type MailClosedEventData as dK, type MailCreateRequest as dL, type MailCreateRequestParams as dM, type MailCreateResponseResult as dN, type MailCreatedEventData as dO, type MailGetRequest as dP, type MailGetRequestParams as dQ, type MailGetResponseResult as dR, type MailInviteRequest as dS, type MailInviteRequestParams as dT, type MailInviteResponseResult as dU, type MailJoinRequest as dV, type MailJoinRequestParams as dW, type MailJoinResponseResult as dX, type MailLeaveRequest as dY, type MailLeaveRequestParams as dZ, type MailLeaveResponseResult as d_, type FederationMetadata as da, type FederationReplayConfig as db, type FederationRouteRequest as dc, type FederationRouteRequestParams as dd, type GatewayReconnectionEvent as de, type GatewayReconnectionEventHandler as df, type GatewayReconnectionEventType as dg, type GatewayReconnectionOptions as dh, type GraphEdge as di, type HierarchicalAddress as dj, type InjectDelivery as dk, type InjectDeliveryResult as dl, type InjectRequest as dm, type InjectRequestParams as dn, type InjectResponseResult as dp, JSONRPC_VERSION as dq, type JoinPolicy as dr, LIFECYCLE_METHODS as ds, MAIL_ERROR_CODES as dt, MAIL_METHODS as du, type MAPAgentCapabilityDescriptor as dv, type MAPCapabilityDeclaration as dw, type MAPFederationAuth as dx, type MAPInterfaceSpec as dy, type MAPNotification as dz, type EventType as e, RESOURCE_ERROR_CODES as e$, type MailListRequestParams as e0, type MailListResponseResult as e1, type MailMessageMeta as e2, type MailParticipantJoinedEventData as e3, type MailParticipantLeftEventData as e4, type MailReplayRequest as e5, type MailReplayRequestParams as e6, type MailReplayResponseResult as e7, type MailSubscriptionFilter as e8, type MailSummaryGeneratedEventData as e9, type MessagePriority as eA, type MessageRelationship as eB, type MessageSentEventData as eC, type MessageVisibility as eD, type Meta as eE, type MultiAddress as eF, NOTIFICATION_METHODS as eG, type NotificationHandler as eH, OBSERVATION_METHODS as eI, type OverflowHandler as eJ, type OverflowInfo as eK, PERMISSION_METHODS as eL, PROTOCOL_ERROR_CODES as eM, PROTOCOL_VERSION as eN, type Participant as eO, type ParticipantAddress as eP, type ParticipantRole as eQ, type PermissionAction as eR, type PermissionContext as eS, type PermissionParticipant as eT, type PermissionResult as eU, type PermissionSystemConfig as eV, type PermissionsAgentUpdatedEventData as eW, type PermissionsClientUpdatedEventData as eX, type PermissionsUpdateRequest as eY, type PermissionsUpdateRequestParams as eZ, type PermissionsUpdateResponseResult as e_, type MailSummaryRequest as ea, type MailSummaryRequestParams as eb, type MailSummaryResponseResult as ec, type MailThreadCreateRequest as ed, type MailThreadCreateRequestParams as ee, type MailThreadCreateResponseResult as ef, type MailThreadCreatedEventData as eg, type MailThreadListRequest as eh, type MailThreadListRequestParams as ei, type MailThreadListResponseResult as ej, type MailTurnAddedEventData as ek, type MailTurnRequest as el, type MailTurnRequestParams as em, type MailTurnResponseResult as en, type MailTurnUpdatedEventData as eo, type MailTurnsListRequest as ep, type MailTurnsListRequestParams as eq, type MailTurnsListResponseResult as er, type MeshConnectOptions as es, type MeshPeerEndpoint as et, type MeshTransportAdapter as eu, type MessageDeliveredEventData as ev, type MessageFailedEventData as ew, type MessageHandler as ex, type MessageNotification as ey, type MessageNotificationParams as ez, type SessionId as f, type SystemAddress as f$, ROUTING_ERROR_CODES as f0, type ReconnectionEventHandler as f1, type ReconnectionEventType as f2, type ReconnectionOptions as f3, type ReplayRequest as f4, type ReplayRequestParams as f5, type ReplayResponseResult as f6, type ReplayedEvent as f7, type RequestHandler as f8, type RoleAddress as f9, type SendRequest as fA, type SendRequestParams as fB, type ServerAuthCapabilities as fC, type SessionCloseRequest as fD, type SessionCloseRequestParams as fE, type SessionCloseResponseResult as fF, type SessionListRequest as fG, type SessionListRequestParams as fH, type SessionListResponseResult as fI, type SessionLoadRequest as fJ, type SessionLoadRequestParams as fK, type SessionLoadResponseResult as fL, type StandardAuthMethod as fM, type StateChangeHandler as fN, type StreamingCapabilities as fO, type StructureGraphRequest as fP, type StructureGraphRequestParams as fQ, type StructureGraphResponseResult as fR, type StructureVisibilityRule as fS, type SubscribeRequest as fT, type SubscribeRequestParams as fU, Subscription as fV, type SubscriptionAckNotification as fW, type SubscriptionAckParams as fX, type SubscriptionOptions$1 as fY, type SubscriptionState as fZ, type SystemAcceptanceRule as f_, SCOPE_METHODS as fa, SESSION_METHODS as fb, STATE_METHODS as fc, STEERING_METHODS as fd, STRUCTURE_METHODS as fe, type ScopeAddress as ff, type ScopeMessagingRule as fg, type ScopeVisibilityRule as fh, type ScopesCreateRequest as fi, type ScopesCreateRequestParams as fj, type ScopesDeleteRequest as fk, type ScopesDeleteRequestParams as fl, type ScopesDeleteResponseResult as fm, type ScopesGetRequest as fn, type ScopesGetRequestParams as fo, type ScopesGetResponseResult as fp, type ScopesJoinRequest as fq, type ScopesJoinRequestParams as fr, type ScopesLeaveRequest as fs, type ScopesLeaveRequestParams as ft, type ScopesListRequest as fu, type ScopesListRequestParams as fv, type ScopesMembersRequest as fw, type ScopesMembersRequestParams as fx, type ScopesMembersResponseResult as fy, type SendPolicy as fz, type FederationAuth as g, type Thread as g0, type ThreadId as g1, type Timestamp as g2, type TransportType as g3, type Turn as g4, type TurnId as g5, type TurnSource as g6, type TurnStatus as g7, type TurnVisibility as g8, type UnsubscribeRequest as g9, filterVisibleAgents as gA, filterVisibleEvents as gB, filterVisibleScopes as gC, hasCapability as gD, isACPEnvelope as gE, isACPErrorResponse as gF, isACPNotification as gG, isACPRequest as gH, isACPResponse as gI, isACPSuccessResponse as gJ, isAgentExposed as gK, isBroadcastAddress as gL, isDirectAddress as gM, isEventTypeExposed as gN, isFederatedAddress as gO, isHierarchicalAddress as gP, isOrphanedAgent as gQ, isScopeExposed as gR, isSuccessResponse as gS, mapVisibilityToRule as gT, ndJsonStream as gU, resolveAgentPermissions as gV, waitForOpen as gW, websocketStream as gX, type SystemExposure as gY, type UnsubscribeRequestParams as ga, WORKSPACE_METHODS as gb, type WorkspaceFileResult as gc, type WorkspaceListRequestParams as gd, type WorkspaceListResponseResult as ge, type WorkspaceReadRequestParams as gf, type WorkspaceReadResponseResult as gg, type WorkspaceSearchRequestParams as gh, type WorkspaceSearchResponseResult as gi, agenticMeshStream as gj, canAgentAcceptMessage as gk, canAgentMessageAgent as gl, canAgentSeeAgent as gm, canControlAgent as gn, canJoinScope as go, canMessageAgent as gp, canPerformAction as gq, canPerformMethod as gr, canSeeAgent as gs, canSeeScope as gt, canSendToScope as gu, createACPStream as gv, createEvent as gw, createStreamPair as gx, createSubscription as gy, deepMergePermissions as gz, type FederationConnectResponseResult as h, type FederationRouteResponseResult as i, type ConnectionState as j, type ParticipantId as k, type ParticipantType as l, type ScopeId as m, type Agent as n, type Scope as o, type Address as p, type SubscriptionFilter as q, type Event as r, type AgentsGetResponseResult as s, type AgentsListResponseResult as t, type AgentsRegisterResponseResult as u, type AgentsSpawnResponseResult as v, type AgentsUnregisterResponseResult as w, type AgentsUpdateResponseResult as x, type ProtocolVersion as y, type SessionInfo as z };