@multi-agent-protocol/sdk 0.0.8 → 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.
package/dist/index.cjs CHANGED
@@ -93,6 +93,7 @@ var EVENT_TYPES = {
93
93
  AGENT_REGISTERED: "agent_registered",
94
94
  AGENT_UNREGISTERED: "agent_unregistered",
95
95
  AGENT_STATE_CHANGED: "agent_state_changed",
96
+ AGENT_ENVIRONMENT_CHANGED: "agent_environment_changed",
96
97
  AGENT_ORPHANED: "agent_orphaned",
97
98
  // Participant lifecycle events
98
99
  PARTICIPANT_CONNECTED: "participant_connected",
@@ -203,6 +204,11 @@ var MAIL_METHODS = {
203
204
  MAIL_SUMMARY: "mail/summary",
204
205
  MAIL_REPLAY: "mail/replay"
205
206
  };
207
+ var WORKSPACE_METHODS = {
208
+ WORKSPACE_SEARCH: "workspace/search",
209
+ WORKSPACE_LIST: "workspace/list",
210
+ WORKSPACE_READ: "workspace/read"
211
+ };
206
212
  var NOTIFICATION_METHODS = {
207
213
  EVENT: "map/event",
208
214
  MESSAGE: "map/message",
@@ -222,7 +228,8 @@ var MAP_METHODS = {
222
228
  ...AUTH_METHODS,
223
229
  ...PERMISSION_METHODS,
224
230
  ...FEDERATION_METHODS,
225
- ...MAIL_METHODS
231
+ ...MAIL_METHODS,
232
+ ...WORKSPACE_METHODS
226
233
  };
227
234
  var STRUCTURE_METHODS = {
228
235
  ...LIFECYCLE_METHODS,
@@ -277,7 +284,11 @@ var FEDERATION_ERROR_CODES = {
277
284
  /** Message has already visited this system (loop detected) */
278
285
  FEDERATION_LOOP_DETECTED: 5010,
279
286
  /** Message exceeded maximum hop count */
280
- FEDERATION_MAX_HOPS_EXCEEDED: 5011
287
+ FEDERATION_MAX_HOPS_EXCEEDED: 5011,
288
+ /** DID document resolution failed (network error, invalid document, etc.) */
289
+ FEDERATION_DID_RESOLUTION_FAILED: 5004,
290
+ /** DID proof verification failed (bad signature, expired, wrong challenge, etc.) */
291
+ FEDERATION_DID_PROOF_INVALID: 5005
281
292
  };
282
293
  var MAIL_ERROR_CODES = {
283
294
  MAIL_CONVERSATION_NOT_FOUND: 1e4,
@@ -357,7 +368,11 @@ var CAPABILITY_REQUIREMENTS = {
357
368
  [MAIL_METHODS.MAIL_THREAD_CREATE]: ["mail.canCreateThreads"],
358
369
  [MAIL_METHODS.MAIL_THREAD_LIST]: ["mail.canJoin"],
359
370
  [MAIL_METHODS.MAIL_SUMMARY]: ["mail.canViewHistory"],
360
- [MAIL_METHODS.MAIL_REPLAY]: ["mail.canViewHistory"]
371
+ [MAIL_METHODS.MAIL_REPLAY]: ["mail.canViewHistory"],
372
+ // Workspace
373
+ [WORKSPACE_METHODS.WORKSPACE_SEARCH]: ["workspace.canSearch"],
374
+ [WORKSPACE_METHODS.WORKSPACE_LIST]: ["workspace.canList"],
375
+ [WORKSPACE_METHODS.WORKSPACE_READ]: ["workspace.canRead"]
361
376
  };
362
377
  function isSuccessResponse(response) {
363
378
  return "result" in response;
@@ -4957,13 +4972,19 @@ var GatewayConnection = class {
4957
4972
  // Federation
4958
4973
  // ===========================================================================
4959
4974
  /**
4960
- * Connect to a remote MAP system
4975
+ * Connect to a remote MAP system.
4976
+ *
4977
+ * Supports single-request authentication: if `auth` is provided,
4978
+ * credentials are sent in the initial connect request for 1-RTT auth.
4979
+ * If the server responds with `authRequired`, the client can retry
4980
+ * with appropriate credentials.
4961
4981
  */
4962
- async connectToSystem(systemId, endpoint, auth) {
4982
+ async connectToSystem(systemId, endpoint, options) {
4963
4983
  const params = {
4964
4984
  systemId,
4965
4985
  endpoint,
4966
- auth
4986
+ auth: options?.auth,
4987
+ authContext: options?.authContext
4967
4988
  };
4968
4989
  const result = await this.#connection.sendRequest(FEDERATION_METHODS.FEDERATION_CONNECT, params);
4969
4990
  if (result.connected && result.systemInfo) {
@@ -5722,6 +5743,25 @@ var METHOD_REGISTRY = {
5722
5743
  capabilities: ["mail.canViewHistory"],
5723
5744
  description: "Replay turns from a specific point"
5724
5745
  },
5746
+ // Workspace methods
5747
+ "workspace/search": {
5748
+ method: "workspace/search",
5749
+ category: "workspace",
5750
+ capabilities: ["workspace.canSearch"],
5751
+ description: "Search for files matching a query"
5752
+ },
5753
+ "workspace/list": {
5754
+ method: "workspace/list",
5755
+ category: "workspace",
5756
+ capabilities: ["workspace.canList"],
5757
+ description: "List files in a directory"
5758
+ },
5759
+ "workspace/read": {
5760
+ method: "workspace/read",
5761
+ category: "workspace",
5762
+ capabilities: ["workspace.canRead"],
5763
+ description: "Read file contents"
5764
+ },
5725
5765
  // Notification methods (client → server)
5726
5766
  "subscription/ack": {
5727
5767
  method: "map/subscribe.ack",
@@ -7001,6 +7041,7 @@ exports.SubscriptionIdSchema = SubscriptionIdSchema;
7001
7041
  exports.SystemAddressSchema = SystemAddressSchema;
7002
7042
  exports.TimestampSchema = TimestampSchema;
7003
7043
  exports.TransportTypeSchema = TransportTypeSchema;
7044
+ exports.WORKSPACE_METHODS = WORKSPACE_METHODS;
7004
7045
  exports.agenticMeshStream = agenticMeshStream;
7005
7046
  exports.buildAgentsGetResponse = buildAgentsGetResponse;
7006
7047
  exports.buildAgentsListResponse = buildAgentsListResponse;