@multi-agent-protocol/sdk 0.0.9 → 0.0.11

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.
@@ -827,7 +827,13 @@ interface SubscriptionAckNotification extends MAPNotificationBase<SubscriptionAc
827
827
  method: "map/subscribe.ack";
828
828
  params: SubscriptionAckParams;
829
829
  }
830
- /** Data for message_sent events (no payload for privacy) */
830
+ /**
831
+ * Data for message_sent events.
832
+ *
833
+ * Payload is included for subscribers that have permission to observe the
834
+ * event stream. Access control is enforced at the subscription level —
835
+ * clients that can subscribe are trusted to see message content.
836
+ */
831
837
  interface MessageSentEventData {
832
838
  messageId: MessageId;
833
839
  from: ParticipantId;
@@ -835,14 +841,21 @@ interface MessageSentEventData {
835
841
  timestamp: Timestamp;
836
842
  correlationId?: CorrelationId;
837
843
  priority?: MessagePriority;
844
+ payload?: unknown;
838
845
  }
839
- /** Data for message_delivered events (no payload for privacy) */
846
+ /**
847
+ * Data for message_delivered events.
848
+ *
849
+ * Payload is included for subscribers that have permission to observe the
850
+ * event stream. Access control is enforced at the subscription level.
851
+ */
840
852
  interface MessageDeliveredEventData {
841
853
  messageId: MessageId;
842
854
  from: ParticipantId;
843
855
  deliveredTo: ParticipantId[];
844
856
  timestamp: Timestamp;
845
857
  correlationId?: CorrelationId;
858
+ payload?: unknown;
846
859
  }
847
860
  /** Data for message_failed events */
848
861
  interface MessageFailedEventData {
@@ -4933,6 +4946,27 @@ declare class ClientConnection {
4933
4946
  resumed: boolean;
4934
4947
  agent?: Agent;
4935
4948
  }>;
4949
+ /**
4950
+ * Call a server extension method directly via JSON-RPC.
4951
+ *
4952
+ * Extension methods (prefixed with `_macro/` or similar) are registered on the
4953
+ * server's RPC handler and callable as standard JSON-RPC methods. This bypasses
4954
+ * ACP-over-MAP messaging — use this for simple request/response operations that
4955
+ * don't need ACP session semantics.
4956
+ *
4957
+ * @param method - The extension method name (e.g., "_macro/workspace/files/search")
4958
+ * @param params - Parameters to pass to the extension method
4959
+ * @returns The result from the extension method
4960
+ *
4961
+ * @example
4962
+ * ```typescript
4963
+ * const result = await client.callExtension('_macro/workspace/files/search', {
4964
+ * agentId: 'agent-1',
4965
+ * query: 'app.tsx',
4966
+ * });
4967
+ * ```
4968
+ */
4969
+ callExtension<TParams = unknown, TResult = unknown>(method: string, params?: TParams): Promise<TResult>;
4936
4970
  /**
4937
4971
  * Create a new mail conversation.
4938
4972
  *
@@ -827,7 +827,13 @@ interface SubscriptionAckNotification extends MAPNotificationBase<SubscriptionAc
827
827
  method: "map/subscribe.ack";
828
828
  params: SubscriptionAckParams;
829
829
  }
830
- /** Data for message_sent events (no payload for privacy) */
830
+ /**
831
+ * Data for message_sent events.
832
+ *
833
+ * Payload is included for subscribers that have permission to observe the
834
+ * event stream. Access control is enforced at the subscription level —
835
+ * clients that can subscribe are trusted to see message content.
836
+ */
831
837
  interface MessageSentEventData {
832
838
  messageId: MessageId;
833
839
  from: ParticipantId;
@@ -835,14 +841,21 @@ interface MessageSentEventData {
835
841
  timestamp: Timestamp;
836
842
  correlationId?: CorrelationId;
837
843
  priority?: MessagePriority;
844
+ payload?: unknown;
838
845
  }
839
- /** Data for message_delivered events (no payload for privacy) */
846
+ /**
847
+ * Data for message_delivered events.
848
+ *
849
+ * Payload is included for subscribers that have permission to observe the
850
+ * event stream. Access control is enforced at the subscription level.
851
+ */
840
852
  interface MessageDeliveredEventData {
841
853
  messageId: MessageId;
842
854
  from: ParticipantId;
843
855
  deliveredTo: ParticipantId[];
844
856
  timestamp: Timestamp;
845
857
  correlationId?: CorrelationId;
858
+ payload?: unknown;
846
859
  }
847
860
  /** Data for message_failed events */
848
861
  interface MessageFailedEventData {
@@ -4933,6 +4946,27 @@ declare class ClientConnection {
4933
4946
  resumed: boolean;
4934
4947
  agent?: Agent;
4935
4948
  }>;
4949
+ /**
4950
+ * Call a server extension method directly via JSON-RPC.
4951
+ *
4952
+ * Extension methods (prefixed with `_macro/` or similar) are registered on the
4953
+ * server's RPC handler and callable as standard JSON-RPC methods. This bypasses
4954
+ * ACP-over-MAP messaging — use this for simple request/response operations that
4955
+ * don't need ACP session semantics.
4956
+ *
4957
+ * @param method - The extension method name (e.g., "_macro/workspace/files/search")
4958
+ * @param params - Parameters to pass to the extension method
4959
+ * @returns The result from the extension method
4960
+ *
4961
+ * @example
4962
+ * ```typescript
4963
+ * const result = await client.callExtension('_macro/workspace/files/search', {
4964
+ * agentId: 'agent-1',
4965
+ * query: 'app.tsx',
4966
+ * });
4967
+ * ```
4968
+ */
4969
+ callExtension<TParams = unknown, TResult = unknown>(method: string, params?: TParams): Promise<TResult>;
4936
4970
  /**
4937
4971
  * Create a new mail conversation.
4938
4972
  *
package/dist/index.cjs CHANGED
@@ -3330,6 +3330,32 @@ var ClientConnection = class _ClientConnection {
3330
3330
  return this.#connection.sendRequest(STATE_METHODS.AGENTS_RESUME, { agentId });
3331
3331
  }
3332
3332
  // ===========================================================================
3333
+ // Extensions
3334
+ // ===========================================================================
3335
+ /**
3336
+ * Call a server extension method directly via JSON-RPC.
3337
+ *
3338
+ * Extension methods (prefixed with `_macro/` or similar) are registered on the
3339
+ * server's RPC handler and callable as standard JSON-RPC methods. This bypasses
3340
+ * ACP-over-MAP messaging — use this for simple request/response operations that
3341
+ * don't need ACP session semantics.
3342
+ *
3343
+ * @param method - The extension method name (e.g., "_macro/workspace/files/search")
3344
+ * @param params - Parameters to pass to the extension method
3345
+ * @returns The result from the extension method
3346
+ *
3347
+ * @example
3348
+ * ```typescript
3349
+ * const result = await client.callExtension('_macro/workspace/files/search', {
3350
+ * agentId: 'agent-1',
3351
+ * query: 'app.tsx',
3352
+ * });
3353
+ * ```
3354
+ */
3355
+ async callExtension(method, params) {
3356
+ return this.#connection.sendRequest(method, params);
3357
+ }
3358
+ // ===========================================================================
3333
3359
  // Mail
3334
3360
  // ===========================================================================
3335
3361
  /**