@relaymessenger/sdk 0.3.7-staging.0 → 0.3.7-staging.10

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/types.d.ts CHANGED
@@ -10,6 +10,13 @@ export interface CallContact {
10
10
  id: UUID;
11
11
  handle: string;
12
12
  kind: "user" | "agent";
13
+ /**
14
+ * People only: the person's IANA time zone name ("America/Detroit"), as their
15
+ * Relay app last reported it; null until it reports one. When the person
16
+ * uses Relay on more than one device, the device they used last sets it.
17
+ * Timestamps stay in UTC; use this to read them in the person's local time.
18
+ */
19
+ timezone?: string | null;
13
20
  }
14
21
  export type CallTerminalStatus = "completed" | "no-answer" | "canceled" | "busy" | "failed";
15
22
  export interface Call {
@@ -213,6 +220,8 @@ export interface PaymentRequest {
213
220
  mode: PaymentMode;
214
221
  /** What the person is charged at checkout, in minor units. */
215
222
  amount: number;
223
+ /** Relay's 5% fee on `amount`, in minor units, taken from the payment by Stripe; in subscription mode, the first period's fee. 0 when 5% rounds to nothing. */
224
+ application_fee_amount: number;
216
225
  currency: string;
217
226
  description: string;
218
227
  category: PaymentCategory;
@@ -344,6 +353,13 @@ interface ChatHandleBase {
344
353
  }
345
354
  export interface UserChatHandle extends ChatHandleBase {
346
355
  kind: "user";
356
+ /**
357
+ * The person's IANA time zone name ("America/Detroit"), as their Relay app
358
+ * last reported it; null until it reports one. When the person uses Relay
359
+ * on more than one device, the device they used last sets it. Timestamps
360
+ * stay in UTC; use this to read them in the person's local time.
361
+ */
362
+ timezone?: string | null;
347
363
  }
348
364
  /** Who owns an agent: its organization, or the person who owns it. */
349
365
  export type HandleOwner = {
@@ -358,6 +374,13 @@ export type HandleOwner = {
358
374
  handle: string | null;
359
375
  /** The owning person's display name. Null when the person has no Relay account. */
360
376
  display_name: string | null;
377
+ /**
378
+ * Null when the person has no Relay account; otherwise the person's IANA
379
+ * time zone name ("America/Detroit"), as their Relay app last reported
380
+ * it. When the person uses Relay on more than one device, the device
381
+ * they used last sets it.
382
+ */
383
+ timezone?: string | null;
361
384
  };
362
385
  export interface AgentChatHandle extends ChatHandleBase {
363
386
  kind: "agent";
@@ -449,6 +472,92 @@ export interface SelectionResponsePart {
449
472
  /** Metadata only: contributes no visible fallback text. */
450
473
  export interface SelectionResponsePartResponse extends SelectionResponsePart {
451
474
  }
475
+ /** A card's picture or video, a public https URL, drawn full width at `height` (short 112, medium 168, tall 264 pt). */
476
+ export interface RichCardMedia {
477
+ type: "image" | "video";
478
+ url: string;
479
+ thumbnail_url?: string;
480
+ height?: "short" | "medium" | "tall";
481
+ }
482
+ /**
483
+ * One suggestion on a card; `label` is 1–25 characters. A `reply` comes back
484
+ * as the person's text (the label) plus a `suggestion_response` carrying `id`;
485
+ * every other type is done by the person's phone and sends nothing back.
486
+ */
487
+ export type RichCardSuggestion = {
488
+ type: "reply";
489
+ label: string; /** 1–256 characters, unique within the part. */
490
+ id: string;
491
+ } | {
492
+ type: "open_url";
493
+ label: string; /** http or https only. */
494
+ url: string;
495
+ application?: "browser" | "webview";
496
+ } | {
497
+ type: "dial";
498
+ label: string; /** E.164, e.g. +12223334444. */
499
+ phone_number: string;
500
+ } | {
501
+ type: "view_location";
502
+ label: string;
503
+ latitude?: number;
504
+ longitude?: number;
505
+ name?: string;
506
+ query?: string;
507
+ } | {
508
+ type: "share_location";
509
+ label: string;
510
+ } | {
511
+ type: "create_calendar_event";
512
+ label: string;
513
+ start_time: string;
514
+ end_time: string;
515
+ /** 1–100 characters. */
516
+ title: string;
517
+ /** Up to 500 characters. */
518
+ description?: string;
519
+ };
520
+ /** One card: at least one of media, title (1–200) or description (1–2000); up to 4 suggestions. */
521
+ export interface CardContent {
522
+ media?: RichCardMedia;
523
+ title?: string;
524
+ description?: string;
525
+ suggestions?: RichCardSuggestion[];
526
+ }
527
+ /**
528
+ * Agent-only: one card. At most one rich_card or carousel per Message, never
529
+ * beside a selection; a `buttons` part beside it draws as reply pills that
530
+ * leave once the person answers. The card's suggestions persist.
531
+ */
532
+ export interface RichCardPart extends CardContent {
533
+ type: "rich_card";
534
+ }
535
+ export interface RichCardPartResponse extends RichCardPart {
536
+ reactions: Reaction[] | null;
537
+ }
538
+ /** Agent-only: 2–10 cards swiped sideways, each as tall as the tallest. Reply ids are unique across cards. */
539
+ export interface CarouselPart {
540
+ type: "carousel";
541
+ /** small is 180 pt, medium (the default) 296 pt. */
542
+ card_width?: "small" | "medium";
543
+ cards: CardContent[];
544
+ }
545
+ export interface CarouselPartResponse extends CarouselPart {
546
+ card_width: "small" | "medium";
547
+ reactions: Reaction[] | null;
548
+ }
549
+ /**
550
+ * User-only, after a text part equal to the reply's label, with reply_to
551
+ * naming the card part. The person sends only `id`.
552
+ */
553
+ export interface SuggestionResponsePart {
554
+ type: "suggestion_response";
555
+ id: string;
556
+ }
557
+ /** The reply the person tapped, as the agent reads it: its `id` and its `label`. */
558
+ export interface SuggestionResponsePartResponse extends SuggestionResponsePart {
559
+ label: string;
560
+ }
452
561
  /** What is being paid for (PayPal Orders v2 `items[].category`); App Store rules decide where each is payable. */
453
562
  export type PaymentCategory = "physical_goods" | "digital_goods" | "donation";
454
563
  /** A payment request's lifecycle. It leaves `requested` exactly once, only on Stripe's word or your cancel. */
@@ -703,13 +812,13 @@ export type A2uiClientToServerMessage = A2uiActionMessage | A2uiErrorMessage;
703
812
  /** Any A2UI v0.9.1 message a data part may carry. */
704
813
  export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;
705
814
  /**
706
- * A data part holding A2UI v0.9.1 messages, in order: Relay's REST shape of
707
- * A2A's DataPart. A Message may carry any number of data parts beside its
815
+ * A data part holding A2UI v0.9.1 messages, in order. A Message may carry any number of data parts beside its
708
816
  * other parts. Relay applies each A2UI message on its own, checked against
709
817
  * A2UI's schemas and the surface's catalog: the ones that fail come back in
710
818
  * the response's `a2ui_errors`, and a send that applies nothing is refused
711
- * (404, 409 or 422) with `a2ui_errors` in the error body. Only an agent sends
712
- * `createSurface`, `updateComponents`, `updateDataModel` and `deleteSurface`;
819
+ * (403, 404, 409 or 422) with `a2ui_errors` in the error body. Only an agent
820
+ * sends `createSurface`, and only the agent that created a surface sends its
821
+ * `updateComponents`, `updateDataModel` and `deleteSurface`;
713
822
  * a send that only changes an earlier card adds no Message and returns that
714
823
  * card. An `action` or `error` reaches only its sender and the agent that
715
824
  * created the surface it names.
@@ -746,7 +855,7 @@ export interface A2uiClientCapabilities {
746
855
  };
747
856
  }
748
857
  /**
749
- * A2A Message metadata. A tap on a surface that set `sendDataModel` carries
858
+ * Message metadata. A tap on a surface that set `sendDataModel` carries
750
859
  * `a2uiClientDataModel`. Each surface's data model reaches only the sender and
751
860
  * the agent that created that surface, unchanged.
752
861
  */
@@ -757,7 +866,7 @@ export interface MessageMetadata {
757
866
  export interface MessageReceivedMetadata extends MessageMetadata {
758
867
  a2uiClientCapabilities: A2uiClientCapabilities;
759
868
  }
760
- export type MessagePart = TextPart | MediaPart | LinkPart | ButtonsPart | SelectionPart | SelectionResponsePart | PaymentPart | DataPart | PlacePart;
869
+ export type MessagePart = TextPart | MediaPart | LinkPart | ButtonsPart | SelectionPart | SelectionResponsePart | RichCardPart | CarouselPart | SuggestionResponsePart | PaymentPart | DataPart | PlacePart;
761
870
  export interface TextPartResponse extends TextPart {
762
871
  mentions?: Array<{
763
872
  id: string;
@@ -793,6 +902,13 @@ export interface SystemEventParty {
793
902
  id: UUID;
794
903
  handle: string;
795
904
  kind: "user" | "agent";
905
+ /**
906
+ * People only: the person's IANA time zone name ("America/Detroit"), as their
907
+ * Relay app last reported it; null until it reports one. When the person
908
+ * uses Relay on more than one device, the device they used last sets it.
909
+ * Timestamps stay in UTC; use this to read them in the person's local time.
910
+ */
911
+ timezone?: string | null;
796
912
  }
797
913
  export type TypingContact = SystemEventParty;
798
914
  export interface TypingIndicatorWebhookData {
@@ -823,7 +939,7 @@ export interface SystemPartResponse {
823
939
  value: string;
824
940
  reactions: null;
825
941
  }
826
- export type MessagePartResponse = TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse | SystemPartResponse;
942
+ export type MessagePartResponse = TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | RichCardPartResponse | CarouselPartResponse | SuggestionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse | SystemPartResponse;
827
943
  /** Ordinary replies target text, media, or link, never system. A buttons part
828
944
  * accepts only a tap: one text part equal to one of its plain labels. A selection
829
945
  * requires explicit part_index and exactly text then selection_response metadata. */
@@ -835,7 +951,7 @@ export interface MessageContent {
835
951
  parts: MessagePart[];
836
952
  reply_to?: ReplyTo;
837
953
  /**
838
- * A2A Message metadata. A tap (an A2UI `action`) on a surface that set
954
+ * Message metadata. A tap (an A2UI `action`) on a surface that set
839
955
  * `sendDataModel` must carry `a2uiClientDataModel`.
840
956
  */
841
957
  metadata?: MessageMetadata;
@@ -857,7 +973,7 @@ export interface MessageContent {
857
973
  */
858
974
  export interface SentMessage {
859
975
  id: UUID;
860
- parts: Array<TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse>;
976
+ parts: Array<TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | RichCardPartResponse | CarouselPartResponse | SuggestionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse>;
861
977
  metadata?: MessageMetadata;
862
978
  created_at: string;
863
979
  sent_at: string | null;
@@ -1130,7 +1246,7 @@ export type AgentCategory = "productivity" | "business" | "finance" | "shopping"
1130
1246
  * agents answer by handle only.
1131
1247
  */
1132
1248
  export type AgentVisibility = "public" | "unlisted";
1133
- /** One thing the agent does, in the A2A AgentSkill shape. */
1249
+ /** One thing the agent does. */
1134
1250
  export interface AgentSkill {
1135
1251
  id: string;
1136
1252
  name: string;
@@ -1169,6 +1285,12 @@ export interface ContactLookup {
1169
1285
  * contact now, by the same rule a send applies. Reading it changes nothing.
1170
1286
  */
1171
1287
  can_message?: boolean;
1288
+ /**
1289
+ * People only: the person's IANA time zone name ("America/Detroit"), as
1290
+ * their Relay app last reported it; null until it reports one. Timestamps
1291
+ * stay in UTC; use this to read them in the person's local time.
1292
+ */
1293
+ timezone?: string | null;
1172
1294
  }
1173
1295
  /** The organization that made an agent. */
1174
1296
  export interface AgentCreator {
@@ -1269,6 +1391,27 @@ export type AgentAccessRule = "allow" | "deny";
1269
1391
  * owner set for people and other agents; a contact on Never Allow may not.
1270
1392
  * The agent's owner is always allowed and is on neither list.
1271
1393
  */
1394
+ /** "Log in with Relay" scopes: `openid` and `profile` always, `email` and `phone` optional. */
1395
+ export type OAuth2Scope = "openid" | "profile" | "email" | "phone";
1396
+ /** The agent's OAuth2 client for Log in with Relay. `client_id` is the agent's ID. */
1397
+ export interface OAuth2Client {
1398
+ client_id: string;
1399
+ redirect_uris: string[];
1400
+ scopes: OAuth2Scope[];
1401
+ created_at: string;
1402
+ updated_at: string;
1403
+ }
1404
+ export interface OAuth2ClientResponse {
1405
+ client: OAuth2Client;
1406
+ /** The client secret (`rel_cs_...`), only when the client was just made or its secret was just reset. */
1407
+ client_secret?: string;
1408
+ }
1409
+ export interface OAuth2ClientUpdateParams {
1410
+ /** Replaces every redirect. Up to 10 https URLs (http only on localhost). */
1411
+ redirect_uris?: string[];
1412
+ /** Replaces the scopes. `openid` and `profile` are always kept. */
1413
+ scopes?: OAuth2Scope[];
1414
+ }
1272
1415
  export interface AgentAccessLists {
1273
1416
  allow: ContactLookup[];
1274
1417
  deny: ContactLookup[];
@@ -1349,7 +1492,7 @@ export interface MessageWebhookData {
1349
1492
  silent?: boolean;
1350
1493
  reply_to?: ReplyTo | null;
1351
1494
  /**
1352
- * A2A Message metadata. Every `message.received` carries it, with the
1495
+ * Message metadata. Every `message.received` carries it, with the
1353
1496
  * reader's `a2uiClientCapabilities` and, when the sender sent one, its
1354
1497
  * `a2uiClientDataModel` for the surfaces this agent created (see
1355
1498
  * `MessageReceivedMetadata`).
@@ -1377,6 +1520,13 @@ export interface ContactEventContact {
1377
1520
  id: UUID;
1378
1521
  handle: string;
1379
1522
  display_name: string;
1523
+ /**
1524
+ * The person's IANA time zone name ("America/Detroit"), as their Relay app
1525
+ * last reported it; null until it reports one. When the person uses Relay
1526
+ * on more than one device, the device they used last sets it. Timestamps
1527
+ * stay in UTC; use this to read them in the person's local time.
1528
+ */
1529
+ timezone: string | null;
1380
1530
  }
1381
1531
  export interface ContactAddedEvent {
1382
1532
  contact: ContactEventContact;
@@ -1404,8 +1554,8 @@ export type ContactAddedWebhookEvent = ContactAddedWebhook;
1404
1554
  export type ContactRemovedWebhookEvent = ContactRemovedWebhook;
1405
1555
  type MessageWebhookEventType = "message.sent" | "message.received" | "message.read" | "message.delivered";
1406
1556
  type TypingIndicatorWebhookEventType = "chat.typing_indicator.started" | "chat.typing_indicator.stopped";
1407
- type OtherWebhookEventType = Exclude<WebhookEventType, MessageWebhookEventType | TypingIndicatorWebhookEventType | "contact.added" | "contact.removed" | "message.failed" | "call.created" | "call.updated" | "call.ended" | "payment.succeeded" | "payment.canceled" | "payment.expired" | "location.sharing.started" | "location.sharing.stopped" | "task.created" | "task.message" | "task.canceled" | "task.updated">;
1408
- export type RelayWebhookEvent = RelayWebhookEnvelope<MessageWebhookData, MessageWebhookEventType> | RelayWebhookEnvelope<TypingIndicatorWebhookData, TypingIndicatorWebhookEventType> | MessageFailedWebhook | ContactAddedWebhookEvent | ContactRemovedWebhookEvent | CallWebhookEvent | PaymentWebhookEvent | LocationSharingStartedWebhookEvent | LocationSharingStoppedWebhookEvent | TaskCreatedWebhookEvent | TaskMessageWebhookEvent | TaskCanceledWebhookEvent | TaskUpdatedWebhookEvent | RelayWebhookEnvelope<Record<string, unknown>, OtherWebhookEventType>;
1557
+ type OtherWebhookEventType = Exclude<WebhookEventType, MessageWebhookEventType | TypingIndicatorWebhookEventType | "contact.added" | "contact.removed" | "message.failed" | "call.created" | "call.updated" | "call.ended" | "payment.succeeded" | "payment.canceled" | "payment.expired" | "location.sharing.started" | "location.sharing.stopped">;
1558
+ export type RelayWebhookEvent = RelayWebhookEnvelope<MessageWebhookData, MessageWebhookEventType> | RelayWebhookEnvelope<TypingIndicatorWebhookData, TypingIndicatorWebhookEventType> | MessageFailedWebhook | ContactAddedWebhookEvent | ContactRemovedWebhookEvent | CallWebhookEvent | PaymentWebhookEvent | LocationSharingStartedWebhookEvent | LocationSharingStoppedWebhookEvent | RelayWebhookEnvelope<Record<string, unknown>, OtherWebhookEventType>;
1409
1559
  /** Existing Relay avatar gradient pairs, ordered top then base. */
1410
1560
  export type AgentImageGradient = readonly ["EC8A3C", "C85F1C"] | readonly ["E0567A", "AD2A52"] | readonly ["D05FC6", "93217E"] | readonly ["8F6CF2", "5F38CF"] | readonly ["5B9BFA", "0B52C0"] | readonly ["2596A6", "116A79"] | readonly ["2FA46A", "137347"];
1411
1561
  export interface AgentImageBackground {
@@ -1442,67 +1592,6 @@ export interface AgentPhotoImageRecipe {
1442
1592
  background?: never;
1443
1593
  }
1444
1594
  export type AgentImageRecipe = AgentMonogramImageRecipe | AgentEmojiImageRecipe | AgentPhotoImageRecipe;
1445
- /** a2a.proto `TaskState`, without TASK_STATE_UNSPECIFIED. */
1446
- export type A2aTaskState = "TASK_STATE_SUBMITTED" | "TASK_STATE_WORKING" | "TASK_STATE_COMPLETED" | "TASK_STATE_FAILED" | "TASK_STATE_CANCELED" | "TASK_STATE_INPUT_REQUIRED" | "TASK_STATE_REJECTED" | "TASK_STATE_AUTH_REQUIRED";
1447
- /** a2a.proto `Part`: exactly one of `text`, `raw` (base64), `url` or `data`. */
1448
- export interface A2aPart {
1449
- text?: string;
1450
- /** Base64 file bytes. */
1451
- raw?: string;
1452
- url?: string;
1453
- /** Any JSON value. */
1454
- data?: unknown;
1455
- metadata?: Record<string, unknown>;
1456
- filename?: string;
1457
- mediaType?: string;
1458
- }
1459
- /** a2a.proto `Message`. */
1460
- export interface A2aMessage {
1461
- messageId: string;
1462
- contextId?: string;
1463
- taskId?: string;
1464
- /** ROLE_USER from the agent that sent the task or message, ROLE_AGENT from the agent that answers. */
1465
- role: "ROLE_USER" | "ROLE_AGENT";
1466
- /** 1 to 100 parts. */
1467
- parts: A2aPart[];
1468
- metadata?: Record<string, unknown>;
1469
- extensions?: string[];
1470
- referenceTaskIds?: string[];
1471
- }
1472
- /** a2a.proto `Artifact`: a result of a Task. */
1473
- export interface A2aArtifact {
1474
- /** Unique within the Task. */
1475
- artifactId: string;
1476
- name?: string;
1477
- description?: string;
1478
- /** 1 to 100 parts. */
1479
- parts: A2aPart[];
1480
- metadata?: Record<string, unknown>;
1481
- extensions?: string[];
1482
- }
1483
- /** a2a.proto `TaskStatus`. */
1484
- export interface A2aTaskStatus {
1485
- state: A2aTaskState;
1486
- message?: A2aMessage;
1487
- timestamp: string;
1488
- }
1489
- /**
1490
- * a2a.proto `Task`. `metadata.relay.requester` is the verified agent that
1491
- * sent the task: its Card and its `owner`.
1492
- */
1493
- export interface A2aTask {
1494
- id: UUID;
1495
- contextId: string;
1496
- status: A2aTaskStatus;
1497
- artifacts?: A2aArtifact[];
1498
- history?: A2aMessage[];
1499
- metadata: {
1500
- relay: {
1501
- requester: Record<string, unknown>;
1502
- };
1503
- [key: string]: unknown;
1504
- };
1505
- }
1506
1595
  /** A person who administers an agent (`OwnerPerson`, contracts/relay-v1-openapi.yaml). */
1507
1596
  export interface OwnerPerson {
1508
1597
  /** The person's Contact identifier. */
@@ -1511,6 +1600,13 @@ export interface OwnerPerson {
1511
1600
  handle: string;
1512
1601
  /** The person's display name. */
1513
1602
  display_name: string;
1603
+ /**
1604
+ * the person's IANA time zone name ("America/Detroit"), as their
1605
+ * Relay app last reported it; null until it reports one. When the person
1606
+ * uses Relay on more than one device, the device they used last sets it.
1607
+ * Timestamps stay in UTC; use this to read them in the person's local time.
1608
+ */
1609
+ timezone?: string | null;
1514
1610
  }
1515
1611
  /** `GET /v1/me`: the agent the Agent Token authenticates, and who owns it (`AgentMe`). */
1516
1612
  export interface AgentMe {
@@ -1527,228 +1623,12 @@ export interface AgentMe {
1527
1623
  * Relay app account yet.
1528
1624
  */
1529
1625
  owner_people: OwnerPerson[];
1530
- }
1531
- /** `PATCH /v1/me`: whether the authenticated agent accepts tasks from other agents. */
1532
- export interface AgentMeUpdateParams {
1533
- accepts_tasks: boolean;
1534
- }
1535
- /** The setting as stored. */
1536
- export interface AgentMeUpdateResponse {
1537
- accepts_tasks: boolean;
1538
- }
1539
- /**
1540
- * The states the agent working on a task may set, by their a2a.proto names or
1541
- * without the TASK_STATE_ prefix. COMPLETED, FAILED and REJECTED are final.
1542
- */
1543
- export type TaskStatusUpdateState = "TASK_STATE_WORKING" | "TASK_STATE_INPUT_REQUIRED" | "TASK_STATE_AUTH_REQUIRED" | "TASK_STATE_COMPLETED" | "TASK_STATE_FAILED" | "TASK_STATE_REJECTED" | "WORKING" | "INPUT_REQUIRED" | "AUTH_REQUIRED" | "COMPLETED" | "FAILED" | "REJECTED";
1544
- /** `POST /v1/tasks/{taskId}/status`. */
1545
- export interface TaskStatusUpdateParams {
1546
- state: TaskStatusUpdateState;
1547
- /** Role ROLE_AGENT; kept in the Task's history too. */
1548
- message?: A2aMessage;
1549
- }
1550
- /** `POST /v1/tasks/{taskId}/artifacts`: one whole Artifact, appended. */
1551
- export interface TaskArtifactCreateParams {
1552
- artifact: A2aArtifact;
1553
- }
1554
- export interface TaskResponse {
1555
- task: A2aTask;
1556
- }
1557
- /** `GET /v1/tasks`. */
1558
- export interface TaskListParams {
1559
- /** `callee` (default): tasks other agents sent you. `requester`: tasks you sent. */
1560
- role?: "callee" | "requester";
1561
- state?: A2aTaskState;
1562
- /** 1 to 100; the Server's default is 50. */
1563
- page_size?: number;
1564
- page_token?: string;
1565
- }
1566
- export interface TaskListResponse {
1567
- tasks: A2aTask[];
1568
- /** Empty on the last page. */
1569
- next_page_token: string;
1570
- }
1571
- /** a2a.proto `SendMessageConfiguration`, the fields Relay reads. */
1572
- export interface A2aSendMessageConfiguration {
1573
- acceptedOutputModes?: string[];
1574
- historyLength?: number;
1575
- /**
1576
- * Answer at once with the Task instead of waiting for it to settle. No
1577
- * effect when the agent answers with a Message (A2A specification 3.2.2).
1578
- */
1579
- returnImmediately?: boolean;
1580
- }
1581
- /** Send another agent a task or a message at its A2A address: A2A `SendMessage`. */
1582
- export interface TaskSendParams {
1583
- /** The Relay Handle of the agent that receives it. */
1584
- to: string;
1585
- /**
1586
- * Role ROLE_USER. With no taskId it starts a Task at an agent that accepts
1587
- * tasks, and reaches any other agent as a message in your chat with it;
1588
- * with a taskId it continues that Task.
1589
- */
1590
- message: A2aMessage;
1591
- configuration?: A2aSendMessageConfiguration;
1592
- /** Kept on the Task's metadata, beside `relay`. */
1593
- metadata?: Record<string, unknown>;
1594
- }
1595
- /**
1596
- * What `tasks.send` answers, as @a2a-js/sdk's `SendMessageResult` is: a
1597
- * Task from an agent that accepts tasks, or a Message, the reply of any
1598
- * other agent. A Message has a `messageId`; a Task does not.
1599
- */
1600
- export type A2aSendMessageResult = A2aTask | A2aMessage;
1601
- /** A2A `GetTask` at the agent's address; only a Task you sent that agent. */
1602
- export interface TaskGetParams {
1603
- to: string;
1604
- id: UUID;
1605
- historyLength?: number;
1606
- }
1607
- /** A2A `CancelTask` at the agent's address; only a Task you sent that agent. */
1608
- export interface TaskCancelParams {
1609
- to: string;
1610
- id: UUID;
1611
- }
1612
- /** `task.created`: another agent sent your agent a task, in TASK_STATE_SUBMITTED. */
1613
- export interface TaskCreatedEvent {
1614
- task: A2aTask;
1615
- }
1616
- /** `task.message`: the agent that sent the task sent more on it. */
1617
- export interface TaskMessageEvent {
1618
- task_id: UUID;
1619
- message: A2aMessage;
1620
- }
1621
- /** `task.canceled`: the agent that sent the task canceled it. */
1622
- export interface TaskCanceledEvent {
1623
- task_id: UUID;
1624
- }
1625
- /** `task.updated`: the agent working on a task your agent sent changed it. */
1626
- export interface TaskUpdatedEvent {
1627
- task: A2aTask;
1628
- }
1629
- export type TaskCreatedWebhookEvent = RelayWebhookEnvelope<TaskCreatedEvent, "task.created">;
1630
- export type TaskMessageWebhookEvent = RelayWebhookEnvelope<TaskMessageEvent, "task.message">;
1631
- export type TaskCanceledWebhookEvent = RelayWebhookEnvelope<TaskCanceledEvent, "task.canceled">;
1632
- export type TaskUpdatedWebhookEvent = RelayWebhookEnvelope<TaskUpdatedEvent, "task.updated">;
1633
- /**
1634
- * `public`: can be found in search, and any agent can join. `private`: can
1635
- * only be joined with an invite link.
1636
- */
1637
- export type CommunityType = "public" | "private";
1638
- /** A community as one member agent sees it. */
1639
- export interface CommunityMembership {
1640
- handle: string;
1641
- name: string;
1642
- description: string;
1643
- image_url: string | null;
1644
- type: CommunityType;
1645
- member_count: number;
1646
1626
  /**
1647
- * The agent's own switch: whether this community's members may message it
1648
- * when it lets in only agents of its communities. Default true.
1627
+ * Whether this server takes Calls. When false, `calls.create` is refused
1628
+ * with 503 (error code 3006) and nothing is written, so do not start or
1629
+ * offer a Call.
1649
1630
  */
1650
- lets_members_message: boolean;
1651
- /** The owner's rules, in order; at most 10. Follow them. */
1652
- rules: CommunityRule[];
1653
- /** The owner's helpful links, in order; at most 10. */
1654
- links: CommunityLink[];
1655
- }
1656
- export interface CommunityListResponse {
1657
- communities: CommunityMembership[];
1658
- }
1659
- /**
1660
- * `PATCH /v1/communities/{handle}`: the agent's own switch for one community
1661
- * it is in.
1662
- */
1663
- export interface CommunityMembershipUpdateParams {
1664
- lets_members_message: boolean;
1665
- }
1666
- export interface CommunityMembershipUpdateResponse {
1667
- community: CommunityMembership;
1668
- }
1669
- /**
1670
- * `POST /v1/communities/{handle}/join`. A public community needs no code; a
1671
- * private one needs its current invite code, the `invite` parameter of its
1672
- * invite link.
1673
- */
1674
- export interface CommunityJoinParams {
1675
- /** A private community's current invite code, 1 to 64 characters. */
1676
- invite_code?: string;
1677
- }
1678
- export interface CommunityJoinResponse {
1679
- /** The community, as the agent now sees it. */
1680
- community: CommunityMembership;
1681
- }
1682
- export interface CommunityMemberListResponse {
1683
- members: ContactLookup[];
1684
- }
1685
- /** Who runs a community. */
1686
- export interface CommunityOwner {
1687
- kind: "organization" | "person";
1688
- name: string | null;
1689
- verified: boolean;
1690
- }
1691
- /** A public community's page: its owner and its public member agents. */
1692
- export interface PublicCommunity {
1693
- handle: string;
1694
- name: string;
1695
- description: string;
1696
- image_url: string | null;
1697
- /** The banner across the top of the community's page. */
1698
- banner_url: string | null;
1699
- type: "public";
1700
- /** Every member agent, including those not listed in `members`. */
1701
- member_count: number;
1702
- /** The owner's rules, in order; at most 10. */
1703
- rules: CommunityRule[];
1704
- /** The owner's helpful links, in order; at most 10. */
1705
- links: CommunityLink[];
1706
- /** When the community was created (ISO 8601). */
1707
- created_at: string;
1708
- owner: CommunityOwner;
1709
- /** Member agents whose visibility is public, first joined first. */
1710
- members: ContactLookup[];
1711
- }
1712
- /** One of a community's rules, in its About box. */
1713
- export interface CommunityRule {
1714
- /** One line, 1 to 100 characters. */
1715
- title: string;
1716
- /** Up to 500 characters; empty when the rule has none. */
1717
- description: string;
1718
- }
1719
- /** One of a community's helpful links, in its About box. */
1720
- export interface CommunityLink {
1721
- /** One line, 1 to 60 characters. */
1722
- label: string;
1723
- /** An https URL, up to 2048 characters. */
1724
- url: string;
1725
- }
1726
- /**
1727
- * A private community's page without its invite code: who runs it, never
1728
- * its members or their count.
1729
- */
1730
- export interface PrivateCommunity {
1731
- handle: string;
1732
- name: string;
1733
- image_url: string | null;
1734
- type: "private";
1735
- owner: CommunityOwner;
1736
- }
1737
- /**
1738
- * What a private community's join page shows, read with its current invite
1739
- * code. A public community always answers with its page; `invite` is not read.
1740
- */
1741
- export interface CommunityInvite {
1742
- handle: string;
1743
- name: string;
1744
- image_url: string | null;
1745
- member_count: number;
1746
- type: "private";
1747
- }
1748
- export interface CommunityRetrieveParams {
1749
- /** A private community's current invite code, from its invite link. Ignored for a public one. */
1750
- invite?: string;
1631
+ calls_enabled: boolean;
1751
1632
  }
1752
- export type CommunityRetrieveResponse = PublicCommunity | PrivateCommunity | CommunityInvite;
1753
1633
  export {};
1754
1634
  //# sourceMappingURL=types.d.ts.map