@relaymessenger/sdk 0.3.7-staging.8 → 0.4.0-staging.0

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
@@ -17,6 +17,14 @@ export interface CallContact {
17
17
  * Timestamps stay in UTC; use this to read them in the person's local time.
18
18
  */
19
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;
20
28
  }
21
29
  export type CallTerminalStatus = "completed" | "no-answer" | "canceled" | "busy" | "failed";
22
30
  export interface Call {
@@ -360,6 +368,14 @@ export interface UserChatHandle extends ChatHandleBase {
360
368
  * stay in UTC; use this to read them in the person's local time.
361
369
  */
362
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;
363
379
  }
364
380
  /** Who owns an agent: its organization, or the person who owns it. */
365
381
  export type HandleOwner = {
@@ -381,6 +397,14 @@ export type HandleOwner = {
381
397
  * they used last sets it.
382
398
  */
383
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;
384
408
  };
385
409
  export interface AgentChatHandle extends ChatHandleBase {
386
410
  kind: "agent";
@@ -430,47 +454,89 @@ export interface ButtonsPart {
430
454
  type: "buttons";
431
455
  items: ButtonItem[];
432
456
  }
433
- /** Stable machine value and independently editable visible label. */
434
- export interface SelectionOption {
435
- /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */
457
+ /** Stable row identifier, never derived from the visible label. */
458
+ export type SelectionOption = {
459
+ /** 1–24 characters with id; legacy value-only labels allow 1–80. */
460
+ label: string;
461
+ /** Optional row description, 0–72 characters. */
462
+ subtitle?: string;
463
+ /** HTTPS row image, at most 2048 characters. */
464
+ image_url?: string;
465
+ } & ({
466
+ id: string;
467
+ value?: string;
468
+ } | {
469
+ id?: never;
470
+ value: string;
471
+ });
472
+ /** Normalized response aliases are equal; stored legacy labels may have 80 characters. */
473
+ export interface SelectionOptionResponse {
474
+ id: string;
436
475
  value: string;
437
- /** Trimmed visible label, 1–80 characters. */
438
476
  label: string;
477
+ subtitle?: string;
478
+ image_url?: string;
439
479
  }
440
- /** Agent-only, 1–25 options; one per Message, never with buttons. A text part is optional and shows as an ordinary bubble above the card. */
441
- export interface SelectionPart {
442
- type: "selection";
443
- /** The question: the card's title in the chat and the sheet's title. Trimmed, 1–60 characters. */
480
+ export interface SelectionSection {
481
+ /** Trimmed section heading, 1–24 characters. */
444
482
  title: string;
445
- /** The person checks any number of options and submits them once; checking sends nothing. */
446
483
  options: SelectionOption[];
447
484
  }
448
- export interface SelectionPartResponse extends SelectionPart {
449
- /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */
485
+ export interface SelectionSectionResponse {
486
+ title: string;
487
+ options: SelectionOptionResponse[];
488
+ }
489
+ /** Source-owned answered-bubble text; does not replace portable selected-label text. */
490
+ export interface SelectionReplyMessage {
491
+ /** Trimmed text, 1–512 characters. */
492
+ title: string;
493
+ /** Trimmed text, 0–512 characters. */
494
+ subtitle?: string;
495
+ }
496
+ interface SelectionPresentation {
497
+ type: "selection";
498
+ /** The question: trimmed, 1–60 characters. */
499
+ title: string;
500
+ /** Card second line, trimmed, 0–512 characters. */
501
+ subtitle?: string;
502
+ /** Defaults to true when omitted. False permits exactly one chosen option. */
503
+ multiple?: boolean;
504
+ reply_message?: SelectionReplyMessage;
505
+ }
506
+ /** Agent-only; exactly one of options or sections, 1–25 total options, up to 10 sections. */
507
+ export type SelectionPart = SelectionPresentation & ({
508
+ options: SelectionOption[];
509
+ sections?: never;
510
+ } | {
511
+ sections: SelectionSection[];
512
+ options?: never;
513
+ });
514
+ export interface SelectionPartResponse extends SelectionPresentation {
515
+ /** All rows in display order, retained for old clients even when sections are supplied. */
516
+ options: SelectionOptionResponse[];
517
+ sections?: SelectionSectionResponse[];
518
+ /** Durable viewer state; a user answers once. */
450
519
  readonly has_responded: boolean;
451
- /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */
520
+ /** Viewer-scoped; null before answering, after answer deletion, and for agents. */
452
521
  readonly selected_values: string[] | null;
522
+ /** Equal to selected_values, including for legacy options. */
523
+ readonly selected_ids: string[] | null;
453
524
  reactions: null;
454
525
  }
455
- /**
456
- * User-only metadata after canonical text (literal '• ' + each source
457
- * label, joined with '\n'), with explicit reply_to. Exact legacy comma-joined
458
- * labels are accepted by the server only for compatibility, never parsed for IDs.
459
- */
526
+ /** User-only metadata after canonical bullet text, with explicit reply_to. */
460
527
  export interface SelectionResponsePart {
461
528
  type: "selection_response";
462
- /**
463
- * Unique known values, nonempty and in source-option order, authoritative with
464
- * reply_to. New preceding text is literal '• ' + each source label joined with
465
- * '\n'. The server accepts exact legacy comma-joined labels for compatibility
466
- * only, never arbitrary label parsing. iOS may draw a checkmark in place of
467
- * each bullet and repeat the prompt's title, as presentation only; portable
468
- * text remains bullets.
469
- */
529
+ /** Unique known identifiers (1–200 characters), in source-option order. */
470
530
  selected_values: string[];
531
+ /** When supplied, must equal selected_values in the same order. */
532
+ selected_ids?: string[];
471
533
  }
472
534
  /** Metadata only: contributes no visible fallback text. */
473
535
  export interface SelectionResponsePartResponse extends SelectionResponsePart {
536
+ /** Source-derived, including for replies sent by legacy clients. */
537
+ readonly selected_ids: string[];
538
+ /** Copied by the server from the prompt, never supplied by the replying client. */
539
+ readonly reply_message?: SelectionReplyMessage;
474
540
  }
475
541
  /** A card's picture or video, a public https URL, drawn full width at `height` (short 112, medium 168, tall 264 pt). */
476
542
  export interface RichCardMedia {
@@ -538,7 +604,7 @@ export interface RichCardPartResponse extends RichCardPart {
538
604
  /** Agent-only: 2–10 cards swiped sideways, each as tall as the tallest. Reply ids are unique across cards. */
539
605
  export interface CarouselPart {
540
606
  type: "carousel";
541
- /** small is 180 pt, medium (the default) 296 pt. */
607
+ /** small is 180 pt; medium (the default) is as wide as a single card, up to 350 pt. */
542
608
  card_width?: "small" | "medium";
543
609
  cards: CardContent[];
544
610
  }
@@ -812,8 +878,7 @@ export type A2uiClientToServerMessage = A2uiActionMessage | A2uiErrorMessage;
812
878
  /** Any A2UI v0.9.1 message a data part may carry. */
813
879
  export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;
814
880
  /**
815
- * A data part holding A2UI v0.9.1 messages, in order: Relay's REST shape of
816
- * A2A's DataPart. A Message may carry any number of data parts beside its
881
+ * A data part holding A2UI v0.9.1 messages, in order. A Message may carry any number of data parts beside its
817
882
  * other parts. Relay applies each A2UI message on its own, checked against
818
883
  * A2UI's schemas and the surface's catalog: the ones that fail come back in
819
884
  * the response's `a2ui_errors`, and a send that applies nothing is refused
@@ -856,7 +921,7 @@ export interface A2uiClientCapabilities {
856
921
  };
857
922
  }
858
923
  /**
859
- * A2A Message metadata. A tap on a surface that set `sendDataModel` carries
924
+ * Message metadata. A tap on a surface that set `sendDataModel` carries
860
925
  * `a2uiClientDataModel`. Each surface's data model reaches only the sender and
861
926
  * the agent that created that surface, unchanged.
862
927
  */
@@ -910,6 +975,14 @@ export interface SystemEventParty {
910
975
  * Timestamps stay in UTC; use this to read them in the person's local time.
911
976
  */
912
977
  timezone?: string | null;
978
+ /**
979
+ * People only: The person's age range, as their Relay app last reported it: from Apple's
980
+ * Declared Age Range, or from a birth year the person gave once (only the
981
+ * range is kept). Null until the app reports one. A person whose range is not
982
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
983
+ * ask anyone their age.
984
+ */
985
+ age_range?: AgeRange | null;
913
986
  }
914
987
  export type TypingContact = SystemEventParty;
915
988
  export interface TypingIndicatorWebhookData {
@@ -926,9 +999,16 @@ export interface CallMarker {
926
999
  to: [CallContact];
927
1000
  duration_seconds: number | null;
928
1001
  }
1002
+ /** Who did it, with the name and picture a client shows beside the event. */
1003
+ export interface SystemEventActor extends SystemEventParty {
1004
+ /** First and last name joined by a space; empty when the Contact has none. */
1005
+ display_name: string;
1006
+ image_url: string | null;
1007
+ image_color: string | null;
1008
+ }
929
1009
  export interface SystemEvent {
930
1010
  type: SystemEventType;
931
- actor: SystemEventParty;
1011
+ actor: SystemEventActor;
932
1012
  subject: SystemEventParty | null;
933
1013
  value: string | null;
934
1014
  icon_attachment_id: UUID | null;
@@ -952,7 +1032,7 @@ export interface MessageContent {
952
1032
  parts: MessagePart[];
953
1033
  reply_to?: ReplyTo;
954
1034
  /**
955
- * A2A Message metadata. A tap (an A2UI `action`) on a surface that set
1035
+ * Message metadata. A tap (an A2UI `action`) on a surface that set
956
1036
  * `sendDataModel` must carry `a2uiClientDataModel`.
957
1037
  */
958
1038
  metadata?: MessageMetadata;
@@ -1056,6 +1136,19 @@ export interface ChatCreateResponse {
1056
1136
  message: SentMessage;
1057
1137
  };
1058
1138
  }
1139
+ /** Omit handle to share the authenticated agent's own card. */
1140
+ export interface ChatShareContactCardParams {
1141
+ /**
1142
+ * The agent to recommend, trimmed and lowercased by the Server. It must be
1143
+ * active, Public or Unlisted, and let people message it; anything else is
1144
+ * the same 404 as an unknown handle.
1145
+ */
1146
+ handle?: string;
1147
+ }
1148
+ export interface ChatShareContactCardOptions extends RequestOptions {
1149
+ /** 1 to 255 characters. The same key and body replay with nothing shared; another body is 409. */
1150
+ idempotencyKey?: string;
1151
+ }
1059
1152
  export interface ChatUpdateParams {
1060
1153
  display_name?: string;
1061
1154
  /**
@@ -1247,7 +1340,18 @@ export type AgentCategory = "productivity" | "business" | "finance" | "shopping"
1247
1340
  * agents answer by handle only.
1248
1341
  */
1249
1342
  export type AgentVisibility = "public" | "unlisted";
1250
- /** One thing the agent does, in the A2A AgentSkill shape. */
1343
+ /**
1344
+ * A person's age range: the bands Apple's Declared Age Range answers for the
1345
+ * age gates 13, 16 and 18.
1346
+ */
1347
+ export type AgeRange = "under_13" | "13_15" | "16_17" | "18_plus";
1348
+ /**
1349
+ * Who an agent is for, set in the Relay Console. Relay refuses an 18_plus
1350
+ * agent to every person whose age range is not 18_plus (error code 2035) and
1351
+ * leaves it out of their directory, search and suggestions.
1352
+ */
1353
+ export type AgentAgeRating = "everyone" | "18_plus";
1354
+ /** One thing the agent does. */
1251
1355
  export interface AgentSkill {
1252
1356
  id: string;
1253
1357
  name: string;
@@ -1255,6 +1359,46 @@ export interface AgentSkill {
1255
1359
  tags: string[];
1256
1360
  examples: string[];
1257
1361
  }
1362
+ export interface DirectorySearchParams {
1363
+ q?: string;
1364
+ category?: AgentCategory;
1365
+ limit?: number;
1366
+ sort?: "name" | "newest";
1367
+ }
1368
+ export interface AgentMetrics {
1369
+ chats_people: number;
1370
+ chats_agents: number;
1371
+ chats_people_30d: number;
1372
+ chats_agents_30d: number;
1373
+ reply_rate_30d: number | null;
1374
+ reply_minutes_30d: number | null;
1375
+ messages_total: number;
1376
+ since: string;
1377
+ }
1378
+ export interface AgentRatingAverage {
1379
+ average: number | null;
1380
+ count: number;
1381
+ }
1382
+ export interface DirectoryAgent {
1383
+ handle: string;
1384
+ name: string;
1385
+ subtitle: string | null;
1386
+ category: AgentCategory;
1387
+ image_url: string | null;
1388
+ image_color: string | null;
1389
+ accent_color: string | null;
1390
+ verified: boolean;
1391
+ provider: {
1392
+ name: string | null;
1393
+ url: string | null;
1394
+ verified: boolean;
1395
+ };
1396
+ metrics: AgentMetrics;
1397
+ rating: AgentRatingAverage;
1398
+ }
1399
+ export interface DirectorySearchResponse {
1400
+ agents: DirectoryAgent[];
1401
+ }
1258
1402
  export interface ContactLookup {
1259
1403
  id: UUID;
1260
1404
  handle: string;
@@ -1292,6 +1436,16 @@ export interface ContactLookup {
1292
1436
  * stay in UTC; use this to read them in the person's local time.
1293
1437
  */
1294
1438
  timezone?: string | null;
1439
+ /**
1440
+ * People only: The person's age range, as their Relay app last reported it: from Apple's
1441
+ * Declared Age Range, or from a birth year the person gave once (only the
1442
+ * range is kept). Null until the app reports one. A person whose range is not
1443
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
1444
+ * ask anyone their age.
1445
+ */
1446
+ age_range?: AgeRange | null;
1447
+ /** Who the agent is for: everyone, or only people whose age range is 18_plus. Agents only. */
1448
+ age_rating?: AgentAgeRating;
1295
1449
  }
1296
1450
  /** The organization that made an agent. */
1297
1451
  export interface AgentCreator {
@@ -1309,6 +1463,10 @@ export type ContactLookupParams =
1309
1463
  {
1310
1464
  handle: string;
1311
1465
  }
1466
+ /** Contact id, such as a shared Contact Card's id; its handle may since have changed. */
1467
+ | {
1468
+ id: UUID;
1469
+ }
1312
1470
  /** What you need done, in plain words; at most 200 characters. */
1313
1471
  | {
1314
1472
  task: string;
@@ -1324,6 +1482,18 @@ export type ContactLookupResponse = {
1324
1482
  contacts: ContactLookup[];
1325
1483
  };
1326
1484
  export interface ContactCardItem {
1485
+ /**
1486
+ * The shared agent's Contact id, only on a card shared by handle. Open the
1487
+ * agent by this id (`contacts.lookup({ id })`); the handle may since have changed.
1488
+ */
1489
+ id?: UUID;
1490
+ /** The shared agent's subtitle when it was shared, only on a card shared by handle. */
1491
+ subtitle?: string | null;
1492
+ /**
1493
+ * Relay link that opens the shared agent's chat, only on a card shared by
1494
+ * handle. Such a card is a snapshot taken when it was shared and never changes.
1495
+ */
1496
+ url?: string;
1327
1497
  /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */
1328
1498
  description?: string | null;
1329
1499
  handle: string;
@@ -1392,6 +1562,27 @@ export type AgentAccessRule = "allow" | "deny";
1392
1562
  * owner set for people and other agents; a contact on Never Allow may not.
1393
1563
  * The agent's owner is always allowed and is on neither list.
1394
1564
  */
1565
+ /** "Log in with Relay" scopes: `openid` and `profile` always, `email` and `phone` optional. */
1566
+ export type OAuth2Scope = "openid" | "profile" | "email" | "phone";
1567
+ /** The agent's OAuth2 client for Log in with Relay. `client_id` is the agent's ID. */
1568
+ export interface OAuth2Client {
1569
+ client_id: string;
1570
+ redirect_uris: string[];
1571
+ scopes: OAuth2Scope[];
1572
+ created_at: string;
1573
+ updated_at: string;
1574
+ }
1575
+ export interface OAuth2ClientResponse {
1576
+ client: OAuth2Client;
1577
+ /** The client secret (`rel_cs_...`), only when the client was just made or its secret was just reset. */
1578
+ client_secret?: string;
1579
+ }
1580
+ export interface OAuth2ClientUpdateParams {
1581
+ /** Replaces every redirect. Up to 10 https URLs (http only on localhost). */
1582
+ redirect_uris?: string[];
1583
+ /** Replaces the scopes. `openid` and `profile` are always kept. */
1584
+ scopes?: OAuth2Scope[];
1585
+ }
1395
1586
  export interface AgentAccessLists {
1396
1587
  allow: ContactLookup[];
1397
1588
  deny: ContactLookup[];
@@ -1472,27 +1663,12 @@ export interface MessageWebhookData {
1472
1663
  silent?: boolean;
1473
1664
  reply_to?: ReplyTo | null;
1474
1665
  /**
1475
- * A2A Message metadata. Every `message.received` carries it, with the
1666
+ * Message metadata. Every `message.received` carries it, with the
1476
1667
  * reader's `a2uiClientCapabilities` and, when the sender sent one, its
1477
1668
  * `a2uiClientDataModel` for the surfaces this agent created (see
1478
1669
  * `MessageReceivedMetadata`).
1479
1670
  */
1480
1671
  metadata?: Partial<MessageReceivedMetadata>;
1481
- /**
1482
- * On `message.received`: for a message another agent sent to your A2A
1483
- * address, the request it came from; null for every other message. Answer
1484
- * with a reply in the chat (the sender gets an A2A Message), or with a Task:
1485
- * your first `tasks.updateStatus` or `tasks.addArtifact` on `task_id` opens
1486
- * it. Whichever comes first is the answer.
1487
- */
1488
- a2a?: MessageReceivedA2a | null;
1489
- }
1490
- /** `message.received` `a2a`: the A2A request a message came from. */
1491
- export interface MessageReceivedA2a {
1492
- /** The A2A messageId the sender gave the message. */
1493
- message_id: string;
1494
- /** The id Relay keeps for the Task, if you answer with one. */
1495
- task_id: UUID;
1496
1672
  }
1497
1673
  /**
1498
1674
  * `message.failed`. Relay commits a Message before it answers, so a Message
@@ -1522,6 +1698,14 @@ export interface ContactEventContact {
1522
1698
  * stay in UTC; use this to read them in the person's local time.
1523
1699
  */
1524
1700
  timezone: string | null;
1701
+ /**
1702
+ * The person's age range, as their Relay app last reported it: from Apple's
1703
+ * Declared Age Range, or from a birth year the person gave once (only the
1704
+ * range is kept). Null until the app reports one. A person whose range is not
1705
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
1706
+ * ask anyone their age.
1707
+ */
1708
+ age_range: AgeRange | null;
1525
1709
  }
1526
1710
  export interface ContactAddedEvent {
1527
1711
  contact: ContactEventContact;
@@ -1549,8 +1733,8 @@ export type ContactAddedWebhookEvent = ContactAddedWebhook;
1549
1733
  export type ContactRemovedWebhookEvent = ContactRemovedWebhook;
1550
1734
  type MessageWebhookEventType = "message.sent" | "message.received" | "message.read" | "message.delivered";
1551
1735
  type TypingIndicatorWebhookEventType = "chat.typing_indicator.started" | "chat.typing_indicator.stopped";
1552
- 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">;
1553
- 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>;
1736
+ 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">;
1737
+ export type RelayWebhookEvent = RelayWebhookEnvelope<MessageWebhookData, MessageWebhookEventType> | RelayWebhookEnvelope<TypingIndicatorWebhookData, TypingIndicatorWebhookEventType> | MessageFailedWebhook | ContactAddedWebhookEvent | ContactRemovedWebhookEvent | CallWebhookEvent | PaymentWebhookEvent | LocationSharingStartedWebhookEvent | LocationSharingStoppedWebhookEvent | RelayWebhookEnvelope<Record<string, unknown>, OtherWebhookEventType>;
1554
1738
  /** Existing Relay avatar gradient pairs, ordered top then base. */
1555
1739
  export type AgentImageGradient = readonly ["EC8A3C", "C85F1C"] | readonly ["E0567A", "AD2A52"] | readonly ["D05FC6", "93217E"] | readonly ["8F6CF2", "5F38CF"] | readonly ["5B9BFA", "0B52C0"] | readonly ["2596A6", "116A79"] | readonly ["2FA46A", "137347"];
1556
1740
  export interface AgentImageBackground {
@@ -1587,67 +1771,6 @@ export interface AgentPhotoImageRecipe {
1587
1771
  background?: never;
1588
1772
  }
1589
1773
  export type AgentImageRecipe = AgentMonogramImageRecipe | AgentEmojiImageRecipe | AgentPhotoImageRecipe;
1590
- /** a2a.proto `TaskState`, without TASK_STATE_UNSPECIFIED. */
1591
- 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";
1592
- /** a2a.proto `Part`: exactly one of `text`, `raw` (base64), `url` or `data`. */
1593
- export interface A2aPart {
1594
- text?: string;
1595
- /** Base64 file bytes. */
1596
- raw?: string;
1597
- url?: string;
1598
- /** Any JSON value. */
1599
- data?: unknown;
1600
- metadata?: Record<string, unknown>;
1601
- filename?: string;
1602
- mediaType?: string;
1603
- }
1604
- /** a2a.proto `Message`. */
1605
- export interface A2aMessage {
1606
- messageId: string;
1607
- contextId?: string;
1608
- taskId?: string;
1609
- /** ROLE_USER from the agent that sent the task or message, ROLE_AGENT from the agent that answers. */
1610
- role: "ROLE_USER" | "ROLE_AGENT";
1611
- /** 1 to 100 parts. */
1612
- parts: A2aPart[];
1613
- metadata?: Record<string, unknown>;
1614
- extensions?: string[];
1615
- referenceTaskIds?: string[];
1616
- }
1617
- /** a2a.proto `Artifact`: a result of a Task. */
1618
- export interface A2aArtifact {
1619
- /** Unique within the Task. */
1620
- artifactId: string;
1621
- name?: string;
1622
- description?: string;
1623
- /** 1 to 100 parts. */
1624
- parts: A2aPart[];
1625
- metadata?: Record<string, unknown>;
1626
- extensions?: string[];
1627
- }
1628
- /** a2a.proto `TaskStatus`. */
1629
- export interface A2aTaskStatus {
1630
- state: A2aTaskState;
1631
- message?: A2aMessage;
1632
- timestamp: string;
1633
- }
1634
- /**
1635
- * a2a.proto `Task`. `metadata.relay.requester` is the verified agent that
1636
- * sent the task: its Card and its `owner`.
1637
- */
1638
- export interface A2aTask {
1639
- id: UUID;
1640
- contextId: string;
1641
- status: A2aTaskStatus;
1642
- artifacts?: A2aArtifact[];
1643
- history?: A2aMessage[];
1644
- metadata: {
1645
- relay: {
1646
- requester: Record<string, unknown>;
1647
- };
1648
- [key: string]: unknown;
1649
- };
1650
- }
1651
1774
  /** A person who administers an agent (`OwnerPerson`, contracts/relay-v1-openapi.yaml). */
1652
1775
  export interface OwnerPerson {
1653
1776
  /** The person's Contact identifier. */
@@ -1663,6 +1786,14 @@ export interface OwnerPerson {
1663
1786
  * Timestamps stay in UTC; use this to read them in the person's local time.
1664
1787
  */
1665
1788
  timezone?: string | null;
1789
+ /**
1790
+ * The person's age range, as their Relay app last reported it: from Apple's
1791
+ * Declared Age Range, or from a birth year the person gave once (only the
1792
+ * range is kept). Null until the app reports one. A person whose range is not
1793
+ * "18_plus" never reaches an agent rated 18_plus, so an agent never needs to
1794
+ * ask anyone their age.
1795
+ */
1796
+ age_range?: AgeRange | null;
1666
1797
  }
1667
1798
  /** `GET /v1/me`: the agent the Agent Token authenticates, and who owns it (`AgentMe`). */
1668
1799
  export interface AgentMe {
@@ -1686,114 +1817,5 @@ export interface AgentMe {
1686
1817
  */
1687
1818
  calls_enabled: boolean;
1688
1819
  }
1689
- /** `PATCH /v1/me`: whether the authenticated agent accepts tasks from other agents. */
1690
- export interface AgentMeUpdateParams {
1691
- accepts_tasks: boolean;
1692
- }
1693
- /** The setting as stored. */
1694
- export interface AgentMeUpdateResponse {
1695
- accepts_tasks: boolean;
1696
- }
1697
- /**
1698
- * The states the agent working on a task may set, by their a2a.proto names or
1699
- * without the TASK_STATE_ prefix. COMPLETED, FAILED and REJECTED are final.
1700
- */
1701
- 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";
1702
- /** `POST /v1/tasks/{taskId}/status`. */
1703
- export interface TaskStatusUpdateParams {
1704
- state: TaskStatusUpdateState;
1705
- /** Role ROLE_AGENT; kept in the Task's history too. */
1706
- message?: A2aMessage;
1707
- }
1708
- /**
1709
- * `POST /v1/tasks/{taskId}/reply`: answer a Task with one Message (role
1710
- * ROLE_AGENT) instead, as your first answer only.
1711
- */
1712
- export interface TaskReplyParams {
1713
- message: A2aMessage;
1714
- }
1715
- /** `POST /v1/tasks/{taskId}/artifacts`: one whole Artifact, appended. */
1716
- export interface TaskArtifactCreateParams {
1717
- artifact: A2aArtifact;
1718
- }
1719
- export interface TaskResponse {
1720
- task: A2aTask;
1721
- }
1722
- /** `GET /v1/tasks`. */
1723
- export interface TaskListParams {
1724
- /** `callee` (default): tasks other agents sent you. `requester`: tasks you sent. */
1725
- role?: "callee" | "requester";
1726
- state?: A2aTaskState;
1727
- /** 1 to 100; the Server's default is 50. */
1728
- page_size?: number;
1729
- page_token?: string;
1730
- }
1731
- export interface TaskListResponse {
1732
- tasks: A2aTask[];
1733
- /** Empty on the last page. */
1734
- next_page_token: string;
1735
- }
1736
- /** a2a.proto `SendMessageConfiguration`, the fields Relay reads. */
1737
- export interface A2aSendMessageConfiguration {
1738
- acceptedOutputModes?: string[];
1739
- historyLength?: number;
1740
- /**
1741
- * Answer at once with the Task instead of waiting for it to settle. No
1742
- * effect when the agent answers with a Message (A2A specification 3.2.2).
1743
- */
1744
- returnImmediately?: boolean;
1745
- }
1746
- /** Send another agent a task or a message at its A2A address: A2A `SendMessage`. */
1747
- export interface TaskSendParams {
1748
- /** The Relay Handle of the agent that receives it. */
1749
- to: string;
1750
- /**
1751
- * Role ROLE_USER. With no taskId it starts a Task at an agent that accepts
1752
- * tasks, and reaches any other agent as a message in your chat with it;
1753
- * with a taskId it continues that Task.
1754
- */
1755
- message: A2aMessage;
1756
- configuration?: A2aSendMessageConfiguration;
1757
- /** Kept on the Task's metadata, beside `relay`. */
1758
- metadata?: Record<string, unknown>;
1759
- }
1760
- /**
1761
- * What `tasks.send` answers, as @a2a-js/sdk's `SendMessageResult` is: a
1762
- * Task from an agent that accepts tasks, or a Message, the reply of any
1763
- * other agent. A Message has a `messageId`; a Task does not.
1764
- */
1765
- export type A2aSendMessageResult = A2aTask | A2aMessage;
1766
- /** A2A `GetTask` at the agent's address; only a Task you sent that agent. */
1767
- export interface TaskGetParams {
1768
- to: string;
1769
- id: UUID;
1770
- historyLength?: number;
1771
- }
1772
- /** A2A `CancelTask` at the agent's address; only a Task you sent that agent. */
1773
- export interface TaskCancelParams {
1774
- to: string;
1775
- id: UUID;
1776
- }
1777
- /** `task.created`: another agent sent your agent a task, in TASK_STATE_SUBMITTED. */
1778
- export interface TaskCreatedEvent {
1779
- task: A2aTask;
1780
- }
1781
- /** `task.message`: the agent that sent the task sent more on it. */
1782
- export interface TaskMessageEvent {
1783
- task_id: UUID;
1784
- message: A2aMessage;
1785
- }
1786
- /** `task.canceled`: the agent that sent the task canceled it. */
1787
- export interface TaskCanceledEvent {
1788
- task_id: UUID;
1789
- }
1790
- /** `task.updated`: the agent working on a task your agent sent changed it. */
1791
- export interface TaskUpdatedEvent {
1792
- task: A2aTask;
1793
- }
1794
- export type TaskCreatedWebhookEvent = RelayWebhookEnvelope<TaskCreatedEvent, "task.created">;
1795
- export type TaskMessageWebhookEvent = RelayWebhookEnvelope<TaskMessageEvent, "task.message">;
1796
- export type TaskCanceledWebhookEvent = RelayWebhookEnvelope<TaskCanceledEvent, "task.canceled">;
1797
- export type TaskUpdatedWebhookEvent = RelayWebhookEnvelope<TaskUpdatedEvent, "task.updated">;
1798
1820
  export {};
1799
1821
  //# sourceMappingURL=types.d.ts.map