@relaymessenger/sdk 0.3.7-staging.1 → 0.3.7-staging.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.
package/dist/types.d.ts CHANGED
@@ -10,6 +10,21 @@ 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;
20
+ /**
21
+ * People only: The person's age range, as their Relay app last reported it: from Apple's
22
+ * Declared Age Range, or from a birth year the person gave once (only the
23
+ * range is kept). Null until the app reports one. A person whose range is not
24
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
25
+ * ask anyone their age.
26
+ */
27
+ age_range?: AgeRange | null;
13
28
  }
14
29
  export type CallTerminalStatus = "completed" | "no-answer" | "canceled" | "busy" | "failed";
15
30
  export interface Call {
@@ -213,6 +228,8 @@ export interface PaymentRequest {
213
228
  mode: PaymentMode;
214
229
  /** What the person is charged at checkout, in minor units. */
215
230
  amount: number;
231
+ /** 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. */
232
+ application_fee_amount: number;
216
233
  currency: string;
217
234
  description: string;
218
235
  category: PaymentCategory;
@@ -344,6 +361,21 @@ interface ChatHandleBase {
344
361
  }
345
362
  export interface UserChatHandle extends ChatHandleBase {
346
363
  kind: "user";
364
+ /**
365
+ * The person's IANA time zone name ("America/Detroit"), as their Relay app
366
+ * last reported it; null until it reports one. When the person uses Relay
367
+ * on more than one device, the device they used last sets it. Timestamps
368
+ * stay in UTC; use this to read them in the person's local time.
369
+ */
370
+ timezone?: string | null;
371
+ /**
372
+ * The person's age range, as their Relay app last reported it: from Apple's
373
+ * Declared Age Range, or from a birth year the person gave once (only the
374
+ * range is kept). Null until the app reports one. A person whose range is not
375
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
376
+ * ask anyone their age.
377
+ */
378
+ age_range?: AgeRange | null;
347
379
  }
348
380
  /** Who owns an agent: its organization, or the person who owns it. */
349
381
  export type HandleOwner = {
@@ -358,6 +390,21 @@ export type HandleOwner = {
358
390
  handle: string | null;
359
391
  /** The owning person's display name. Null when the person has no Relay account. */
360
392
  display_name: string | null;
393
+ /**
394
+ * Null when the person has no Relay account; otherwise the person's IANA
395
+ * time zone name ("America/Detroit"), as their Relay app last reported
396
+ * it. When the person uses Relay on more than one device, the device
397
+ * they used last sets it.
398
+ */
399
+ timezone?: string | null;
400
+ /**
401
+ * Null when the person has no Relay account. The person's age range, as their Relay app last reported it: from Apple's
402
+ * Declared Age Range, or from a birth year the person gave once (only the
403
+ * range is kept). Null until the app reports one. A person whose range is not
404
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
405
+ * ask anyone their age.
406
+ */
407
+ age_range?: AgeRange | null;
361
408
  };
362
409
  export interface AgentChatHandle extends ChatHandleBase {
363
410
  kind: "agent";
@@ -449,6 +496,92 @@ export interface SelectionResponsePart {
449
496
  /** Metadata only: contributes no visible fallback text. */
450
497
  export interface SelectionResponsePartResponse extends SelectionResponsePart {
451
498
  }
499
+ /** A card's picture or video, a public https URL, drawn full width at `height` (short 112, medium 168, tall 264 pt). */
500
+ export interface RichCardMedia {
501
+ type: "image" | "video";
502
+ url: string;
503
+ thumbnail_url?: string;
504
+ height?: "short" | "medium" | "tall";
505
+ }
506
+ /**
507
+ * One suggestion on a card; `label` is 1–25 characters. A `reply` comes back
508
+ * as the person's text (the label) plus a `suggestion_response` carrying `id`;
509
+ * every other type is done by the person's phone and sends nothing back.
510
+ */
511
+ export type RichCardSuggestion = {
512
+ type: "reply";
513
+ label: string; /** 1–256 characters, unique within the part. */
514
+ id: string;
515
+ } | {
516
+ type: "open_url";
517
+ label: string; /** http or https only. */
518
+ url: string;
519
+ application?: "browser" | "webview";
520
+ } | {
521
+ type: "dial";
522
+ label: string; /** E.164, e.g. +12223334444. */
523
+ phone_number: string;
524
+ } | {
525
+ type: "view_location";
526
+ label: string;
527
+ latitude?: number;
528
+ longitude?: number;
529
+ name?: string;
530
+ query?: string;
531
+ } | {
532
+ type: "share_location";
533
+ label: string;
534
+ } | {
535
+ type: "create_calendar_event";
536
+ label: string;
537
+ start_time: string;
538
+ end_time: string;
539
+ /** 1–100 characters. */
540
+ title: string;
541
+ /** Up to 500 characters. */
542
+ description?: string;
543
+ };
544
+ /** One card: at least one of media, title (1–200) or description (1–2000); up to 4 suggestions. */
545
+ export interface CardContent {
546
+ media?: RichCardMedia;
547
+ title?: string;
548
+ description?: string;
549
+ suggestions?: RichCardSuggestion[];
550
+ }
551
+ /**
552
+ * Agent-only: one card. At most one rich_card or carousel per Message, never
553
+ * beside a selection; a `buttons` part beside it draws as reply pills that
554
+ * leave once the person answers. The card's suggestions persist.
555
+ */
556
+ export interface RichCardPart extends CardContent {
557
+ type: "rich_card";
558
+ }
559
+ export interface RichCardPartResponse extends RichCardPart {
560
+ reactions: Reaction[] | null;
561
+ }
562
+ /** Agent-only: 2–10 cards swiped sideways, each as tall as the tallest. Reply ids are unique across cards. */
563
+ export interface CarouselPart {
564
+ type: "carousel";
565
+ /** small is 180 pt, medium (the default) 296 pt. */
566
+ card_width?: "small" | "medium";
567
+ cards: CardContent[];
568
+ }
569
+ export interface CarouselPartResponse extends CarouselPart {
570
+ card_width: "small" | "medium";
571
+ reactions: Reaction[] | null;
572
+ }
573
+ /**
574
+ * User-only, after a text part equal to the reply's label, with reply_to
575
+ * naming the card part. The person sends only `id`.
576
+ */
577
+ export interface SuggestionResponsePart {
578
+ type: "suggestion_response";
579
+ id: string;
580
+ }
581
+ /** The reply the person tapped, as the agent reads it: its `id` and its `label`. */
582
+ export interface SuggestionResponsePartResponse extends SuggestionResponsePart {
583
+ label: string;
584
+ }
452
585
  /** What is being paid for (PayPal Orders v2 `items[].category`); App Store rules decide where each is payable. */
453
586
  export type PaymentCategory = "physical_goods" | "digital_goods" | "donation";
454
587
  /** A payment request's lifecycle. It leaves `requested` exactly once, only on Stripe's word or your cancel. */
@@ -703,13 +836,13 @@ export type A2uiClientToServerMessage = A2uiActionMessage | A2uiErrorMessage;
703
836
  /** Any A2UI v0.9.1 message a data part may carry. */
704
837
  export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;
705
838
  /**
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
839
+ * A data part holding A2UI v0.9.1 messages, in order. A Message may carry any number of data parts beside its
708
840
  * other parts. Relay applies each A2UI message on its own, checked against
709
841
  * A2UI's schemas and the surface's catalog: the ones that fail come back in
710
842
  * 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`;
843
+ * (403, 404, 409 or 422) with `a2ui_errors` in the error body. Only an agent
844
+ * sends `createSurface`, and only the agent that created a surface sends its
845
+ * `updateComponents`, `updateDataModel` and `deleteSurface`;
713
846
  * a send that only changes an earlier card adds no Message and returns that
714
847
  * card. An `action` or `error` reaches only its sender and the agent that
715
848
  * created the surface it names.
@@ -746,7 +879,7 @@ export interface A2uiClientCapabilities {
746
879
  };
747
880
  }
748
881
  /**
749
- * A2A Message metadata. A tap on a surface that set `sendDataModel` carries
882
+ * Message metadata. A tap on a surface that set `sendDataModel` carries
750
883
  * `a2uiClientDataModel`. Each surface's data model reaches only the sender and
751
884
  * the agent that created that surface, unchanged.
752
885
  */
@@ -757,7 +890,7 @@ export interface MessageMetadata {
757
890
  export interface MessageReceivedMetadata extends MessageMetadata {
758
891
  a2uiClientCapabilities: A2uiClientCapabilities;
759
892
  }
760
- export type MessagePart = TextPart | MediaPart | LinkPart | ButtonsPart | SelectionPart | SelectionResponsePart | PaymentPart | DataPart | PlacePart;
893
+ export type MessagePart = TextPart | MediaPart | LinkPart | ButtonsPart | SelectionPart | SelectionResponsePart | RichCardPart | CarouselPart | SuggestionResponsePart | PaymentPart | DataPart | PlacePart;
761
894
  export interface TextPartResponse extends TextPart {
762
895
  mentions?: Array<{
763
896
  id: string;
@@ -793,6 +926,21 @@ export interface SystemEventParty {
793
926
  id: UUID;
794
927
  handle: string;
795
928
  kind: "user" | "agent";
929
+ /**
930
+ * People only: the person's IANA time zone name ("America/Detroit"), as their
931
+ * Relay app last reported it; null until it reports one. When the person
932
+ * uses Relay on more than one device, the device they used last sets it.
933
+ * Timestamps stay in UTC; use this to read them in the person's local time.
934
+ */
935
+ timezone?: string | null;
936
+ /**
937
+ * People only: The person's age range, as their Relay app last reported it: from Apple's
938
+ * Declared Age Range, or from a birth year the person gave once (only the
939
+ * range is kept). Null until the app reports one. A person whose range is not
940
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
941
+ * ask anyone their age.
942
+ */
943
+ age_range?: AgeRange | null;
796
944
  }
797
945
  export type TypingContact = SystemEventParty;
798
946
  export interface TypingIndicatorWebhookData {
@@ -823,7 +971,7 @@ export interface SystemPartResponse {
823
971
  value: string;
824
972
  reactions: null;
825
973
  }
826
- export type MessagePartResponse = TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse | SystemPartResponse;
974
+ export type MessagePartResponse = TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | RichCardPartResponse | CarouselPartResponse | SuggestionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse | SystemPartResponse;
827
975
  /** Ordinary replies target text, media, or link, never system. A buttons part
828
976
  * accepts only a tap: one text part equal to one of its plain labels. A selection
829
977
  * requires explicit part_index and exactly text then selection_response metadata. */
@@ -835,7 +983,7 @@ export interface MessageContent {
835
983
  parts: MessagePart[];
836
984
  reply_to?: ReplyTo;
837
985
  /**
838
- * A2A Message metadata. A tap (an A2UI `action`) on a surface that set
986
+ * Message metadata. A tap (an A2UI `action`) on a surface that set
839
987
  * `sendDataModel` must carry `a2uiClientDataModel`.
840
988
  */
841
989
  metadata?: MessageMetadata;
@@ -857,7 +1005,7 @@ export interface MessageContent {
857
1005
  */
858
1006
  export interface SentMessage {
859
1007
  id: UUID;
860
- parts: Array<TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse>;
1008
+ parts: Array<TextPartResponse | MediaPartResponse | LinkPartResponse | ButtonsPartResponse | SelectionPartResponse | SelectionResponsePartResponse | RichCardPartResponse | CarouselPartResponse | SuggestionResponsePartResponse | PaymentPartResponse | PaymentReceiptPartResponse | DataPartResponse | LocationRequestPartResponse | LocationPartResponse | PlacePartResponse>;
861
1009
  metadata?: MessageMetadata;
862
1010
  created_at: string;
863
1011
  sent_at: string | null;
@@ -1130,7 +1278,18 @@ export type AgentCategory = "productivity" | "business" | "finance" | "shopping"
1130
1278
  * agents answer by handle only.
1131
1279
  */
1132
1280
  export type AgentVisibility = "public" | "unlisted";
1133
- /** One thing the agent does, in the A2A AgentSkill shape. */
1281
+ /**
1282
+ * A person's age range: the bands Apple's Declared Age Range answers for the
1283
+ * age gates 13, 16 and 18.
1284
+ */
1285
+ export type AgeRange = "under_13" | "13_15" | "16_17" | "18_plus";
1286
+ /**
1287
+ * Who an agent is for, set in the Relay Console. Relay refuses an 18_plus
1288
+ * agent to every person whose age range is not 18_plus (error code 2035) and
1289
+ * leaves it out of their directory, search and suggestions.
1290
+ */
1291
+ export type AgentAgeRating = "everyone" | "18_plus";
1292
+ /** One thing the agent does. */
1134
1293
  export interface AgentSkill {
1135
1294
  id: string;
1136
1295
  name: string;
@@ -1169,6 +1328,22 @@ export interface ContactLookup {
1169
1328
  * contact now, by the same rule a send applies. Reading it changes nothing.
1170
1329
  */
1171
1330
  can_message?: boolean;
1331
+ /**
1332
+ * People only: the person's IANA time zone name ("America/Detroit"), as
1333
+ * their Relay app last reported it; null until it reports one. Timestamps
1334
+ * stay in UTC; use this to read them in the person's local time.
1335
+ */
1336
+ timezone?: string | null;
1337
+ /**
1338
+ * People only: The person's age range, as their Relay app last reported it: from Apple's
1339
+ * Declared Age Range, or from a birth year the person gave once (only the
1340
+ * range is kept). Null until the app reports one. A person whose range is not
1341
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
1342
+ * ask anyone their age.
1343
+ */
1344
+ age_range?: AgeRange | null;
1345
+ /** Who the agent is for: everyone, or only people whose age range is 18_plus. Agents only. */
1346
+ age_rating?: AgentAgeRating;
1172
1347
  }
1173
1348
  /** The organization that made an agent. */
1174
1349
  export interface AgentCreator {
@@ -1269,6 +1444,27 @@ export type AgentAccessRule = "allow" | "deny";
1269
1444
  * owner set for people and other agents; a contact on Never Allow may not.
1270
1445
  * The agent's owner is always allowed and is on neither list.
1271
1446
  */
1447
+ /** "Log in with Relay" scopes: `openid` and `profile` always, `email` and `phone` optional. */
1448
+ export type OAuth2Scope = "openid" | "profile" | "email" | "phone";
1449
+ /** The agent's OAuth2 client for Log in with Relay. `client_id` is the agent's ID. */
1450
+ export interface OAuth2Client {
1451
+ client_id: string;
1452
+ redirect_uris: string[];
1453
+ scopes: OAuth2Scope[];
1454
+ created_at: string;
1455
+ updated_at: string;
1456
+ }
1457
+ export interface OAuth2ClientResponse {
1458
+ client: OAuth2Client;
1459
+ /** The client secret (`rel_cs_...`), only when the client was just made or its secret was just reset. */
1460
+ client_secret?: string;
1461
+ }
1462
+ export interface OAuth2ClientUpdateParams {
1463
+ /** Replaces every redirect. Up to 10 https URLs (http only on localhost). */
1464
+ redirect_uris?: string[];
1465
+ /** Replaces the scopes. `openid` and `profile` are always kept. */
1466
+ scopes?: OAuth2Scope[];
1467
+ }
1272
1468
  export interface AgentAccessLists {
1273
1469
  allow: ContactLookup[];
1274
1470
  deny: ContactLookup[];
@@ -1349,7 +1545,7 @@ export interface MessageWebhookData {
1349
1545
  silent?: boolean;
1350
1546
  reply_to?: ReplyTo | null;
1351
1547
  /**
1352
- * A2A Message metadata. Every `message.received` carries it, with the
1548
+ * Message metadata. Every `message.received` carries it, with the
1353
1549
  * reader's `a2uiClientCapabilities` and, when the sender sent one, its
1354
1550
  * `a2uiClientDataModel` for the surfaces this agent created (see
1355
1551
  * `MessageReceivedMetadata`).
@@ -1377,6 +1573,21 @@ export interface ContactEventContact {
1377
1573
  id: UUID;
1378
1574
  handle: string;
1379
1575
  display_name: string;
1576
+ /**
1577
+ * The person's IANA time zone name ("America/Detroit"), as their Relay app
1578
+ * last reported it; null until it reports one. When the person uses Relay
1579
+ * on more than one device, the device they used last sets it. Timestamps
1580
+ * stay in UTC; use this to read them in the person's local time.
1581
+ */
1582
+ timezone: string | null;
1583
+ /**
1584
+ * The person's age range, as their Relay app last reported it: from Apple's
1585
+ * Declared Age Range, or from a birth year the person gave once (only the
1586
+ * range is kept). Null until the app reports one. A person whose range is not
1587
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
1588
+ * ask anyone their age.
1589
+ */
1590
+ age_range: AgeRange | null;
1380
1591
  }
1381
1592
  export interface ContactAddedEvent {
1382
1593
  contact: ContactEventContact;
@@ -1404,8 +1615,8 @@ export type ContactAddedWebhookEvent = ContactAddedWebhook;
1404
1615
  export type ContactRemovedWebhookEvent = ContactRemovedWebhook;
1405
1616
  type MessageWebhookEventType = "message.sent" | "message.received" | "message.read" | "message.delivered";
1406
1617
  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>;
1618
+ 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">;
1619
+ export type RelayWebhookEvent = RelayWebhookEnvelope<MessageWebhookData, MessageWebhookEventType> | RelayWebhookEnvelope<TypingIndicatorWebhookData, TypingIndicatorWebhookEventType> | MessageFailedWebhook | ContactAddedWebhookEvent | ContactRemovedWebhookEvent | CallWebhookEvent | PaymentWebhookEvent | LocationSharingStartedWebhookEvent | LocationSharingStoppedWebhookEvent | RelayWebhookEnvelope<Record<string, unknown>, OtherWebhookEventType>;
1409
1620
  /** Existing Relay avatar gradient pairs, ordered top then base. */
1410
1621
  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
1622
  export interface AgentImageBackground {
@@ -1442,67 +1653,6 @@ export interface AgentPhotoImageRecipe {
1442
1653
  background?: never;
1443
1654
  }
1444
1655
  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
1656
  /** A person who administers an agent (`OwnerPerson`, contracts/relay-v1-openapi.yaml). */
1507
1657
  export interface OwnerPerson {
1508
1658
  /** The person's Contact identifier. */
@@ -1511,6 +1661,21 @@ export interface OwnerPerson {
1511
1661
  handle: string;
1512
1662
  /** The person's display name. */
1513
1663
  display_name: string;
1664
+ /**
1665
+ * the person's IANA time zone name ("America/Detroit"), as their
1666
+ * Relay app last reported it; null until it reports one. When the person
1667
+ * uses Relay on more than one device, the device they used last sets it.
1668
+ * Timestamps stay in UTC; use this to read them in the person's local time.
1669
+ */
1670
+ timezone?: string | null;
1671
+ /**
1672
+ * The person's age range, as their Relay app last reported it: from Apple's
1673
+ * Declared Age Range, or from a birth year the person gave once (only the
1674
+ * range is kept). Null until the app reports one. A person whose range is not
1675
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
1676
+ * ask anyone their age.
1677
+ */
1678
+ age_range?: AgeRange | null;
1514
1679
  }
1515
1680
  /** `GET /v1/me`: the agent the Agent Token authenticates, and who owns it (`AgentMe`). */
1516
1681
  export interface AgentMe {
@@ -1527,228 +1692,12 @@ export interface AgentMe {
1527
1692
  * Relay app account yet.
1528
1693
  */
1529
1694
  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
1695
  /**
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).
1696
+ * Whether this server takes Calls. When false, `calls.create` is refused
1697
+ * with 503 (error code 3006) and nothing is written, so do not start or
1698
+ * offer a Call.
1578
1699
  */
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
- /**
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.
1649
- */
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;
1700
+ calls_enabled: boolean;
1751
1701
  }
1752
- export type CommunityRetrieveResponse = PublicCommunity | PrivateCommunity | CommunityInvite;
1753
1702
  export {};
1754
1703
  //# sourceMappingURL=types.d.ts.map