@relaymessenger/sdk 0.3.7-staging.9 → 0.4.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/README.md +37 -5
- package/dist/client.d.ts +9 -83
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +24 -248
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/operations.d.ts +5 -21
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +5 -29
- package/dist/operations.js.map +1 -1
- package/dist/selection.d.ts +4 -5
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +111 -36
- package/dist/selection.js.map +1 -1
- package/dist/types.d.ts +221 -220
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -2
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
|
|
434
|
-
export
|
|
435
|
-
/**
|
|
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
|
-
|
|
441
|
-
|
|
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
|
|
449
|
-
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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:
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
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;
|
|
@@ -1493,27 +1663,12 @@ export interface MessageWebhookData {
|
|
|
1493
1663
|
silent?: boolean;
|
|
1494
1664
|
reply_to?: ReplyTo | null;
|
|
1495
1665
|
/**
|
|
1496
|
-
*
|
|
1666
|
+
* Message metadata. Every `message.received` carries it, with the
|
|
1497
1667
|
* reader's `a2uiClientCapabilities` and, when the sender sent one, its
|
|
1498
1668
|
* `a2uiClientDataModel` for the surfaces this agent created (see
|
|
1499
1669
|
* `MessageReceivedMetadata`).
|
|
1500
1670
|
*/
|
|
1501
1671
|
metadata?: Partial<MessageReceivedMetadata>;
|
|
1502
|
-
/**
|
|
1503
|
-
* On `message.received`: for a message another agent sent to your A2A
|
|
1504
|
-
* address, the request it came from; null for every other message. Answer
|
|
1505
|
-
* with a reply in the chat (the sender gets an A2A Message), or with a Task:
|
|
1506
|
-
* your first `tasks.updateStatus` or `tasks.addArtifact` on `task_id` opens
|
|
1507
|
-
* it. Whichever comes first is the answer.
|
|
1508
|
-
*/
|
|
1509
|
-
a2a?: MessageReceivedA2a | null;
|
|
1510
|
-
}
|
|
1511
|
-
/** `message.received` `a2a`: the A2A request a message came from. */
|
|
1512
|
-
export interface MessageReceivedA2a {
|
|
1513
|
-
/** The A2A messageId the sender gave the message. */
|
|
1514
|
-
message_id: string;
|
|
1515
|
-
/** The id Relay keeps for the Task, if you answer with one. */
|
|
1516
|
-
task_id: UUID;
|
|
1517
1672
|
}
|
|
1518
1673
|
/**
|
|
1519
1674
|
* `message.failed`. Relay commits a Message before it answers, so a Message
|
|
@@ -1543,6 +1698,14 @@ export interface ContactEventContact {
|
|
|
1543
1698
|
* stay in UTC; use this to read them in the person's local time.
|
|
1544
1699
|
*/
|
|
1545
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;
|
|
1546
1709
|
}
|
|
1547
1710
|
export interface ContactAddedEvent {
|
|
1548
1711
|
contact: ContactEventContact;
|
|
@@ -1570,8 +1733,8 @@ export type ContactAddedWebhookEvent = ContactAddedWebhook;
|
|
|
1570
1733
|
export type ContactRemovedWebhookEvent = ContactRemovedWebhook;
|
|
1571
1734
|
type MessageWebhookEventType = "message.sent" | "message.received" | "message.read" | "message.delivered";
|
|
1572
1735
|
type TypingIndicatorWebhookEventType = "chat.typing_indicator.started" | "chat.typing_indicator.stopped";
|
|
1573
|
-
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"
|
|
1574
|
-
export type RelayWebhookEvent = RelayWebhookEnvelope<MessageWebhookData, MessageWebhookEventType> | RelayWebhookEnvelope<TypingIndicatorWebhookData, TypingIndicatorWebhookEventType> | MessageFailedWebhook | ContactAddedWebhookEvent | ContactRemovedWebhookEvent | CallWebhookEvent | PaymentWebhookEvent | LocationSharingStartedWebhookEvent | LocationSharingStoppedWebhookEvent |
|
|
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>;
|
|
1575
1738
|
/** Existing Relay avatar gradient pairs, ordered top then base. */
|
|
1576
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"];
|
|
1577
1740
|
export interface AgentImageBackground {
|
|
@@ -1608,67 +1771,6 @@ export interface AgentPhotoImageRecipe {
|
|
|
1608
1771
|
background?: never;
|
|
1609
1772
|
}
|
|
1610
1773
|
export type AgentImageRecipe = AgentMonogramImageRecipe | AgentEmojiImageRecipe | AgentPhotoImageRecipe;
|
|
1611
|
-
/** a2a.proto `TaskState`, without TASK_STATE_UNSPECIFIED. */
|
|
1612
|
-
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";
|
|
1613
|
-
/** a2a.proto `Part`: exactly one of `text`, `raw` (base64), `url` or `data`. */
|
|
1614
|
-
export interface A2aPart {
|
|
1615
|
-
text?: string;
|
|
1616
|
-
/** Base64 file bytes. */
|
|
1617
|
-
raw?: string;
|
|
1618
|
-
url?: string;
|
|
1619
|
-
/** Any JSON value. */
|
|
1620
|
-
data?: unknown;
|
|
1621
|
-
metadata?: Record<string, unknown>;
|
|
1622
|
-
filename?: string;
|
|
1623
|
-
mediaType?: string;
|
|
1624
|
-
}
|
|
1625
|
-
/** a2a.proto `Message`. */
|
|
1626
|
-
export interface A2aMessage {
|
|
1627
|
-
messageId: string;
|
|
1628
|
-
contextId?: string;
|
|
1629
|
-
taskId?: string;
|
|
1630
|
-
/** ROLE_USER from the agent that sent the task or message, ROLE_AGENT from the agent that answers. */
|
|
1631
|
-
role: "ROLE_USER" | "ROLE_AGENT";
|
|
1632
|
-
/** 1 to 100 parts. */
|
|
1633
|
-
parts: A2aPart[];
|
|
1634
|
-
metadata?: Record<string, unknown>;
|
|
1635
|
-
extensions?: string[];
|
|
1636
|
-
referenceTaskIds?: string[];
|
|
1637
|
-
}
|
|
1638
|
-
/** a2a.proto `Artifact`: a result of a Task. */
|
|
1639
|
-
export interface A2aArtifact {
|
|
1640
|
-
/** Unique within the Task. */
|
|
1641
|
-
artifactId: string;
|
|
1642
|
-
name?: string;
|
|
1643
|
-
description?: string;
|
|
1644
|
-
/** 1 to 100 parts. */
|
|
1645
|
-
parts: A2aPart[];
|
|
1646
|
-
metadata?: Record<string, unknown>;
|
|
1647
|
-
extensions?: string[];
|
|
1648
|
-
}
|
|
1649
|
-
/** a2a.proto `TaskStatus`. */
|
|
1650
|
-
export interface A2aTaskStatus {
|
|
1651
|
-
state: A2aTaskState;
|
|
1652
|
-
message?: A2aMessage;
|
|
1653
|
-
timestamp: string;
|
|
1654
|
-
}
|
|
1655
|
-
/**
|
|
1656
|
-
* a2a.proto `Task`. `metadata.relay.requester` is the verified agent that
|
|
1657
|
-
* sent the task: its Card and its `owner`.
|
|
1658
|
-
*/
|
|
1659
|
-
export interface A2aTask {
|
|
1660
|
-
id: UUID;
|
|
1661
|
-
contextId: string;
|
|
1662
|
-
status: A2aTaskStatus;
|
|
1663
|
-
artifacts?: A2aArtifact[];
|
|
1664
|
-
history?: A2aMessage[];
|
|
1665
|
-
metadata: {
|
|
1666
|
-
relay: {
|
|
1667
|
-
requester: Record<string, unknown>;
|
|
1668
|
-
};
|
|
1669
|
-
[key: string]: unknown;
|
|
1670
|
-
};
|
|
1671
|
-
}
|
|
1672
1774
|
/** A person who administers an agent (`OwnerPerson`, contracts/relay-v1-openapi.yaml). */
|
|
1673
1775
|
export interface OwnerPerson {
|
|
1674
1776
|
/** The person's Contact identifier. */
|
|
@@ -1684,6 +1786,14 @@ export interface OwnerPerson {
|
|
|
1684
1786
|
* Timestamps stay in UTC; use this to read them in the person's local time.
|
|
1685
1787
|
*/
|
|
1686
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;
|
|
1687
1797
|
}
|
|
1688
1798
|
/** `GET /v1/me`: the agent the Agent Token authenticates, and who owns it (`AgentMe`). */
|
|
1689
1799
|
export interface AgentMe {
|
|
@@ -1707,114 +1817,5 @@ export interface AgentMe {
|
|
|
1707
1817
|
*/
|
|
1708
1818
|
calls_enabled: boolean;
|
|
1709
1819
|
}
|
|
1710
|
-
/** `PATCH /v1/me`: whether the authenticated agent accepts tasks from other agents. */
|
|
1711
|
-
export interface AgentMeUpdateParams {
|
|
1712
|
-
accepts_tasks: boolean;
|
|
1713
|
-
}
|
|
1714
|
-
/** The setting as stored. */
|
|
1715
|
-
export interface AgentMeUpdateResponse {
|
|
1716
|
-
accepts_tasks: boolean;
|
|
1717
|
-
}
|
|
1718
|
-
/**
|
|
1719
|
-
* The states the agent working on a task may set, by their a2a.proto names or
|
|
1720
|
-
* without the TASK_STATE_ prefix. COMPLETED, FAILED and REJECTED are final.
|
|
1721
|
-
*/
|
|
1722
|
-
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";
|
|
1723
|
-
/** `POST /v1/tasks/{taskId}/status`. */
|
|
1724
|
-
export interface TaskStatusUpdateParams {
|
|
1725
|
-
state: TaskStatusUpdateState;
|
|
1726
|
-
/** Role ROLE_AGENT; kept in the Task's history too. */
|
|
1727
|
-
message?: A2aMessage;
|
|
1728
|
-
}
|
|
1729
|
-
/**
|
|
1730
|
-
* `POST /v1/tasks/{taskId}/reply`: answer a Task with one Message (role
|
|
1731
|
-
* ROLE_AGENT) instead, as your first answer only.
|
|
1732
|
-
*/
|
|
1733
|
-
export interface TaskReplyParams {
|
|
1734
|
-
message: A2aMessage;
|
|
1735
|
-
}
|
|
1736
|
-
/** `POST /v1/tasks/{taskId}/artifacts`: one whole Artifact, appended. */
|
|
1737
|
-
export interface TaskArtifactCreateParams {
|
|
1738
|
-
artifact: A2aArtifact;
|
|
1739
|
-
}
|
|
1740
|
-
export interface TaskResponse {
|
|
1741
|
-
task: A2aTask;
|
|
1742
|
-
}
|
|
1743
|
-
/** `GET /v1/tasks`. */
|
|
1744
|
-
export interface TaskListParams {
|
|
1745
|
-
/** `callee` (default): tasks other agents sent you. `requester`: tasks you sent. */
|
|
1746
|
-
role?: "callee" | "requester";
|
|
1747
|
-
state?: A2aTaskState;
|
|
1748
|
-
/** 1 to 100; the Server's default is 50. */
|
|
1749
|
-
page_size?: number;
|
|
1750
|
-
page_token?: string;
|
|
1751
|
-
}
|
|
1752
|
-
export interface TaskListResponse {
|
|
1753
|
-
tasks: A2aTask[];
|
|
1754
|
-
/** Empty on the last page. */
|
|
1755
|
-
next_page_token: string;
|
|
1756
|
-
}
|
|
1757
|
-
/** a2a.proto `SendMessageConfiguration`, the fields Relay reads. */
|
|
1758
|
-
export interface A2aSendMessageConfiguration {
|
|
1759
|
-
acceptedOutputModes?: string[];
|
|
1760
|
-
historyLength?: number;
|
|
1761
|
-
/**
|
|
1762
|
-
* Answer at once with the Task instead of waiting for it to settle. No
|
|
1763
|
-
* effect when the agent answers with a Message (A2A specification 3.2.2).
|
|
1764
|
-
*/
|
|
1765
|
-
returnImmediately?: boolean;
|
|
1766
|
-
}
|
|
1767
|
-
/** Send another agent a task or a message at its A2A address: A2A `SendMessage`. */
|
|
1768
|
-
export interface TaskSendParams {
|
|
1769
|
-
/** The Relay Handle of the agent that receives it. */
|
|
1770
|
-
to: string;
|
|
1771
|
-
/**
|
|
1772
|
-
* Role ROLE_USER. With no taskId it starts a Task at an agent that accepts
|
|
1773
|
-
* tasks, and reaches any other agent as a message in your chat with it;
|
|
1774
|
-
* with a taskId it continues that Task.
|
|
1775
|
-
*/
|
|
1776
|
-
message: A2aMessage;
|
|
1777
|
-
configuration?: A2aSendMessageConfiguration;
|
|
1778
|
-
/** Kept on the Task's metadata, beside `relay`. */
|
|
1779
|
-
metadata?: Record<string, unknown>;
|
|
1780
|
-
}
|
|
1781
|
-
/**
|
|
1782
|
-
* What `tasks.send` answers, as @a2a-js/sdk's `SendMessageResult` is: a
|
|
1783
|
-
* Task from an agent that accepts tasks, or a Message, the reply of any
|
|
1784
|
-
* other agent. A Message has a `messageId`; a Task does not.
|
|
1785
|
-
*/
|
|
1786
|
-
export type A2aSendMessageResult = A2aTask | A2aMessage;
|
|
1787
|
-
/** A2A `GetTask` at the agent's address; only a Task you sent that agent. */
|
|
1788
|
-
export interface TaskGetParams {
|
|
1789
|
-
to: string;
|
|
1790
|
-
id: UUID;
|
|
1791
|
-
historyLength?: number;
|
|
1792
|
-
}
|
|
1793
|
-
/** A2A `CancelTask` at the agent's address; only a Task you sent that agent. */
|
|
1794
|
-
export interface TaskCancelParams {
|
|
1795
|
-
to: string;
|
|
1796
|
-
id: UUID;
|
|
1797
|
-
}
|
|
1798
|
-
/** `task.created`: another agent sent your agent a task, in TASK_STATE_SUBMITTED. */
|
|
1799
|
-
export interface TaskCreatedEvent {
|
|
1800
|
-
task: A2aTask;
|
|
1801
|
-
}
|
|
1802
|
-
/** `task.message`: the agent that sent the task sent more on it. */
|
|
1803
|
-
export interface TaskMessageEvent {
|
|
1804
|
-
task_id: UUID;
|
|
1805
|
-
message: A2aMessage;
|
|
1806
|
-
}
|
|
1807
|
-
/** `task.canceled`: the agent that sent the task canceled it. */
|
|
1808
|
-
export interface TaskCanceledEvent {
|
|
1809
|
-
task_id: UUID;
|
|
1810
|
-
}
|
|
1811
|
-
/** `task.updated`: the agent working on a task your agent sent changed it. */
|
|
1812
|
-
export interface TaskUpdatedEvent {
|
|
1813
|
-
task: A2aTask;
|
|
1814
|
-
}
|
|
1815
|
-
export type TaskCreatedWebhookEvent = RelayWebhookEnvelope<TaskCreatedEvent, "task.created">;
|
|
1816
|
-
export type TaskMessageWebhookEvent = RelayWebhookEnvelope<TaskMessageEvent, "task.message">;
|
|
1817
|
-
export type TaskCanceledWebhookEvent = RelayWebhookEnvelope<TaskCanceledEvent, "task.canceled">;
|
|
1818
|
-
export type TaskUpdatedWebhookEvent = RelayWebhookEnvelope<TaskUpdatedEvent, "task.updated">;
|
|
1819
1820
|
export {};
|
|
1820
1821
|
//# sourceMappingURL=types.d.ts.map
|