@signalcore/ui 1.0.0-beta.2 → 1.0.0-beta.3

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.
Files changed (55) hide show
  1. package/README.md +47 -21
  2. package/dist/AgentAbout.js +6 -2
  3. package/dist/AgentAbout.js.map +1 -1
  4. package/dist/AgentChat.d.ts +7 -1
  5. package/dist/AgentChat.js +154 -2
  6. package/dist/AgentChat.js.map +1 -1
  7. package/dist/AgentSpace.d.ts +12 -3
  8. package/dist/AgentSpace.js +53 -11
  9. package/dist/AgentSpace.js.map +1 -1
  10. package/dist/Threads.d.ts +73 -0
  11. package/dist/Threads.js +140 -0
  12. package/dist/Threads.js.map +1 -0
  13. package/dist/automation/marks.js +7 -3
  14. package/dist/automation/marks.js.map +1 -1
  15. package/dist/automation/messages.d.ts +4 -0
  16. package/dist/automation/messages.js +5 -1
  17. package/dist/automation/messages.js.map +1 -1
  18. package/dist/automation/when.js +8 -0
  19. package/dist/automation/when.js.map +1 -1
  20. package/dist/client.d.ts +14 -4
  21. package/dist/client.js +7 -2
  22. package/dist/client.js.map +1 -1
  23. package/dist/contract.d.ts +9 -4
  24. package/dist/es.d.ts +2 -0
  25. package/dist/es.js +22 -3
  26. package/dist/es.js.map +1 -1
  27. package/dist/frames.d.ts +7 -1
  28. package/dist/frames.js.map +1 -1
  29. package/dist/index.d.ts +5 -4
  30. package/dist/index.js +5 -4
  31. package/dist/surface/Form.js +1 -1
  32. package/dist/types.d.ts +11 -0
  33. package/dist/types.js.map +1 -1
  34. package/dist/useConversation.d.ts +2 -0
  35. package/dist/useConversation.js +16 -0
  36. package/dist/useConversation.js.map +1 -1
  37. package/dist/widget.js +17 -16
  38. package/package.json +1 -1
  39. package/src/AgentAbout.tsx +4 -0
  40. package/src/AgentChat.tsx +203 -1
  41. package/src/AgentSpace.tsx +89 -13
  42. package/src/Threads.tsx +218 -0
  43. package/src/automation/marks.tsx +7 -0
  44. package/src/automation/messages.ts +8 -0
  45. package/src/automation/when.ts +4 -0
  46. package/src/client.ts +26 -10
  47. package/src/contract.ts +240 -26
  48. package/src/es.ts +21 -0
  49. package/src/frames.ts +3 -1
  50. package/src/index.ts +9 -1
  51. package/src/styles.css +191 -0
  52. package/src/types.ts +11 -0
  53. package/src/useConversation.ts +10 -0
  54. package/src/widget/element.tsx +13 -4
  55. package/src/widget/widget.css +13 -0
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ArrowBendDownRightIcon,
2
3
  BellIcon,
3
4
  BrainIcon,
4
5
  ChatCircleIcon,
@@ -8,7 +9,9 @@ import {
8
9
  FileTextIcon,
9
10
  FlaskIcon,
10
11
  GlobeIcon,
12
+ HandTapIcon,
11
13
  LightningIcon,
14
+ PlugsConnectedIcon,
12
15
  SparkleIcon,
13
16
  TableIcon,
14
17
  WebhooksLogoIcon,
@@ -52,6 +55,8 @@ const KINDS: Readonly<Record<Exclude<Trigger["kind"], "event">, Icon>> = {
52
55
  schedule: ClockIcon,
53
56
  webhook: WebhooksLogoIcon,
54
57
  platform: ChatCircleIcon,
58
+ manual: HandTapIcon,
59
+ after: ArrowBendDownRightIcon,
55
60
  };
56
61
 
57
62
  /** What starts an automation, as a mark: a clock, a webhook, a message, the app whose event it
@@ -79,6 +84,8 @@ const BY: Readonly<Record<Exclude<RunBy, "event">, Icon>> = {
79
84
  platform: ChatCircleIcon,
80
85
  agent: ChatCircleIcon,
81
86
  test: FlaskIcon,
87
+ api: PlugsConnectedIcon,
88
+ after: ArrowBendDownRightIcon,
82
89
  };
83
90
 
84
91
  export function ByMark({
@@ -68,6 +68,10 @@ export interface AutomationMessages {
68
68
  event: (app: string | null, event: string | null) => string;
69
69
  /** One of the platform's events: a contact's message stored on a channel. */
70
70
  platform: string;
71
+ /** Only started by hand: the agent, the business's app, a button. */
72
+ manual: string;
73
+ /** When another of the agent's automations ends well, by its name. */
74
+ after: (automation: string | null) => string;
71
75
  /** When it runs next, after when it runs: the day, and the time when the line doesn't say it. */
72
76
  next: (day: DayRef, time: string | null) => string;
73
77
  /** How it stands, on its pill. */
@@ -127,6 +131,8 @@ export const AUTOMATION_MESSAGES: AutomationMessages = {
127
131
  custom: "On a schedule of its own",
128
132
  webhook: "When another system calls it",
129
133
  platform: "When a message arrives",
134
+ manual: "When someone starts it",
135
+ after: (automation) => (automation ? `After “${automation}”` : "After another automation"),
130
136
  event: (app, event) =>
131
137
  event ? `When ${event} in ${app ?? "an app"}` : `On an event in ${app ?? "an app"}`,
132
138
  next: (day, time) => {
@@ -177,6 +183,8 @@ export const AUTOMATION_MESSAGES: AutomationMessages = {
177
183
  platform: "a message",
178
184
  agent: "you asked in the chat",
179
185
  test: "test",
186
+ api: "your app",
187
+ after: "after another",
180
188
  })[by],
181
189
  statuses: {
182
190
  running: "Running",
@@ -35,6 +35,10 @@ export function whenOf(trigger: Trigger, words: AutomationMessages, code: string
35
35
  return { text: words.webhook, timed: false };
36
36
  case "platform":
37
37
  return { text: words.platform, timed: false };
38
+ case "manual":
39
+ return { text: words.manual, timed: false };
40
+ case "after":
41
+ return { text: words.after(trigger.after ?? null), timed: false };
38
42
  case "event":
39
43
  return {
40
44
  text: words.event(trigger.app_title ?? trigger.app, trigger.event_title),
package/src/client.ts CHANGED
@@ -127,8 +127,10 @@ export interface Client {
127
127
  /** Takes one memory from it. */
128
128
  forget: (id: string, memoryId: string) => Promise<void>;
129
129
  /**
130
- * The owner's call with the agent, from the browser (v3/VOICE.md): the call and its
131
- * conversation (a test) made now, and where to join it (`VoiceCall`'s `connect`).
130
+ * The owner's call with the agent, from our own app (v3/VOICE.md): the call and its
131
+ * conversation (a test) made now, and where to join it (`VoiceCall`'s `connect`). App only:
132
+ * it is `/api`'s, signed in by the owner's cookie, and 404s on `/v1`; a host's page calls with
133
+ * `conversations.call(agentId)`.
132
134
  */
133
135
  call: (id: string) => Promise<CallToken>;
134
136
  };
@@ -169,8 +171,14 @@ export interface Client {
169
171
  conversations: {
170
172
  /** One conversation with its messages. */
171
173
  get: (id: string) => Promise<ConversationDetail>;
172
- /** A new conversation with an agent. */
173
- start: (agentId: string) => Promise<Conversation>;
174
+ /** The agent's conversations, newest first: a person's own only, each with what is unread. */
175
+ list: (agentId: string) => Promise<Conversation[]>;
176
+ /** A new conversation with an agent, titled when given. */
177
+ start: (agentId: string, options?: { title?: string | undefined }) => Promise<Conversation>;
178
+ /** How far the person has read it: all of it, now. */
179
+ read: (id: string) => Promise<Conversation>;
180
+ /** Its title, as the person gives it. */
181
+ rename: (id: string, title: string) => Promise<Conversation>;
174
182
  /** The files that arrived in a conversation: attached, sent through a form. */
175
183
  files: (id: string) => Promise<ConversationFile[]>;
176
184
  /**
@@ -201,6 +209,10 @@ export interface Client {
201
209
 
202
210
  const seg = encodeURIComponent;
203
211
 
212
+ /** A request's JSON body. */
213
+ const body = (value: unknown): Blob =>
214
+ new Blob([JSON.stringify(value)], { type: "application/json" });
215
+
204
216
  /** A file's path in a URL: each name of it encoded, the slashes between them kept. */
205
217
  const filePath = (path: string): string => path.split("/").map(seg).join("/");
206
218
 
@@ -357,11 +369,7 @@ export function createClient(options: ClientOptions): Client {
357
369
  tasks: {
358
370
  list: (agentId) => json("GET", `/agents/${seg(agentId)}/tasks`),
359
371
  switch: (agentId, taskId, on) =>
360
- json(
361
- "PATCH",
362
- `/agents/${seg(agentId)}/tasks/${seg(taskId)}`,
363
- new Blob([JSON.stringify({ on })], { type: "application/json" }),
364
- ),
372
+ json("PATCH", `/agents/${seg(agentId)}/tasks/${seg(taskId)}`, body({ on })),
365
373
  remove: (agentId, taskId) => run("DELETE", `/agents/${seg(agentId)}/tasks/${seg(taskId)}`),
366
374
  },
367
375
  channels: {
@@ -370,7 +378,15 @@ export function createClient(options: ClientOptions): Client {
370
378
  },
371
379
  conversations: {
372
380
  get: (id) => json("GET", `/conversations/${seg(id)}`),
373
- start: (agentId) => json("POST", `/agents/${seg(agentId)}/conversations`),
381
+ list: (agentId) => json("GET", `/agents/${seg(agentId)}/conversations`),
382
+ start: (agentId, { title } = {}) =>
383
+ json(
384
+ "POST",
385
+ `/agents/${seg(agentId)}/conversations`,
386
+ title === undefined ? undefined : body({ title }),
387
+ ),
388
+ read: (id) => json("POST", `/conversations/${seg(id)}/read`, body({})),
389
+ rename: (id, title) => json("PATCH", `/conversations/${seg(id)}`, body({ title })),
374
390
  files: (id) => json("GET", `/conversations/${seg(id)}/files`),
375
391
  upload: (id, file, options) => sendFile(`/conversations/${seg(id)}/files`, file, options),
376
392
  play: async (id, fileId) => {
package/src/contract.ts CHANGED
@@ -60,7 +60,7 @@ export interface ActivityPage {
60
60
  export interface AgentAutomationOut {
61
61
  id: string;
62
62
  name: string;
63
- kind: "schedule" | "webhook" | "event" | "platform";
63
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
64
64
  title: string;
65
65
  summary: string;
66
66
  schedule: string | null;
@@ -171,6 +171,15 @@ export interface AppGlance {
171
171
  icon: string | null;
172
172
  }
173
173
 
174
+ export interface AppRouteOut {
175
+ app: string;
176
+ provider: "composio" | "arcade" | "api" | null;
177
+ }
178
+
179
+ export interface AppToolsIn {
180
+ tools: Array<string>;
181
+ }
182
+
174
183
  /** How the widget looks: each unset field keeps the widget's own default (the page's type and ink, neutral greys). Colours are `#rrggbb`; sizes are pixels within what reads well. */
175
184
  export interface Appearance {
176
185
  accent?: string | null;
@@ -365,6 +374,8 @@ export interface ConnectIn {
365
374
  provider?: "arcade" | "composio" | null;
366
375
  toolkit: string;
367
376
  return_url?: string;
377
+ events?: boolean;
378
+ actions?: Array<string>;
368
379
  }
369
380
 
370
381
  export interface ConnectedOut {
@@ -382,6 +393,7 @@ export interface ConnectionOut {
382
393
  created_at: string;
383
394
  url?: string | null;
384
395
  icon?: string | null;
396
+ why?: string | null;
385
397
  }
386
398
 
387
399
  /** One thing the app can do, as the owner picks which to give an agent; its input as the provider describes it (JSON Schema), for the technical view. */
@@ -410,17 +422,43 @@ export interface ContactGlance {
410
422
  muted?: boolean;
411
423
  }
412
424
 
425
+ /** A contact the business knows, by one identity at least. The first of `account`, `phone`, `email`, `instagram` given finds them when they are known already: the same contact comes back, the other identities added unless someone else has them, a name kept when they have none; `fields`, values of the fields the builders added. */
426
+ export interface ContactIn {
427
+ name?: string | null;
428
+ account?: string | null;
429
+ phone?: string | null;
430
+ email?: string | null;
431
+ instagram?: string | null;
432
+ fields?: Record<string, unknown>;
433
+ }
434
+
413
435
  export interface ContactOut {
414
436
  id: string;
415
437
  name: string | null;
416
438
  muted: boolean;
417
439
  opted_out: boolean;
418
440
  created_at: string;
441
+ phone?: string | null;
442
+ email?: string | null;
443
+ instagram?: string | null;
444
+ account?: string | null;
445
+ fields?: Record<string, unknown>;
446
+ claims?: Record<string, string>;
419
447
  }
420
448
 
421
- /** The owner marks a contact the agent doesn't answer, or takes the mark away. */
449
+ /** What the business changes of a contact: the mark that the agent doesn't answer them (`muted`), and the identities they are known by, added (`add`; one another contact has is refused: merge them) and taken away (`remove`; one at least stays). */
422
450
  export interface ContactPatchIn {
423
- muted: boolean;
451
+ muted?: boolean | null;
452
+ add?: Array<IdentityIn>;
453
+ remove?: Array<IdentityIn>;
454
+ }
455
+
456
+ /** A contact by one of their identities, as `ContactIn` takes them: the first given finds them. */
457
+ export interface ContactRefIn {
458
+ account?: string | null;
459
+ phone?: string | null;
460
+ email?: string | null;
461
+ instagram?: string | null;
424
462
  }
425
463
 
426
464
  export interface ConversationDetailOut {
@@ -441,6 +479,9 @@ export interface ConversationDetailOut {
441
479
  last_inbound_at?: string | null;
442
480
  call?: CallGlance | null;
443
481
  person?: PersonOut | null;
482
+ unread?: number;
483
+ waiting_on_person?: boolean;
484
+ read_until?: string | null;
444
485
  messages: Array<MessageOut>;
445
486
  handovers?: Array<HandoverOut>;
446
487
  }
@@ -458,6 +499,9 @@ export interface ConversationFileOut {
458
499
  export interface ConversationIn {
459
500
  test?: boolean;
460
501
  about?: string | null;
502
+ contact?: string | ContactRefIn | null;
503
+ title?: string | null;
504
+ say?: FirstWords | null;
461
505
  }
462
506
 
463
507
  export interface ConversationOut {
@@ -478,6 +522,9 @@ export interface ConversationOut {
478
522
  last_inbound_at?: string | null;
479
523
  call?: CallGlance | null;
480
524
  person?: PersonOut | null;
525
+ unread?: number;
526
+ waiting_on_person?: boolean;
527
+ read_until?: string | null;
481
528
  }
482
529
 
483
530
  /** A conversation for its technical view: how its last turn ended, and every message raw. */
@@ -499,6 +546,9 @@ export interface ConversationRawOut {
499
546
  last_inbound_at?: string | null;
500
547
  call?: CallGlance | null;
501
548
  person?: PersonOut | null;
549
+ unread?: number;
550
+ waiting_on_person?: boolean;
551
+ read_until?: string | null;
502
552
  outcome: "done" | "failed" | null;
503
553
  error: string | null;
504
554
  last_at: string;
@@ -510,6 +560,36 @@ export interface Count {
510
560
  count: number;
511
561
  }
512
562
 
563
+ export interface CustomerOut {
564
+ org: OrgOut;
565
+ conversations: number;
566
+ cost: number;
567
+ lost: Array<LostChannelOut>;
568
+ failed: number;
569
+ approvals: number;
570
+ }
571
+
572
+ export interface CustomersOut {
573
+ from: string;
574
+ to: string;
575
+ conversations: number;
576
+ cost: number;
577
+ customers: Array<CustomerOut>;
578
+ }
579
+
580
+ /** A dashboard's name, title or blocks changed: only what is sent. */
581
+ export interface DashboardChange {
582
+ name?: string | null;
583
+ title?: string | null;
584
+ blocks?: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece> | null;
585
+ }
586
+
587
+ export interface DashboardIn {
588
+ name: string;
589
+ title: string;
590
+ blocks: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece>;
591
+ }
592
+
513
593
  export interface DashboardOut {
514
594
  id: string;
515
595
  name: string;
@@ -527,10 +607,11 @@ export interface DashboardView {
527
607
  rendered_at: string;
528
608
  }
529
609
 
530
- /** The business's yes (`approve`) or no on the call a conversation waits on for it. */
610
+ /** The business's yes (`approve`) or no on a call a conversation waits on for it; with the yes, `input` changes what the call runs with (checked against its action's schema). */
531
611
  export interface DecisionIn {
532
612
  request: string;
533
613
  approve: boolean;
614
+ input?: Record<string, unknown> | null;
534
615
  }
535
616
 
536
617
  /** A tool as it is declared; `secret`, the organization's tool secret, when this declaration made it (its first server tool): shown here, never again. */
@@ -555,7 +636,7 @@ export interface DefinitionOut {
555
636
  name: string;
556
637
  title: string;
557
638
  audience: "business" | "contact";
558
- kind: "schedule" | "webhook" | "event" | "platform" | "instruction";
639
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after" | "instruction";
559
640
  inputs: Record<string, string>;
560
641
  created_at: string;
561
642
  }
@@ -604,6 +685,12 @@ export interface Entry {
604
685
  image?: string | null;
605
686
  }
606
687
 
688
+ /** An error: `code` for your code (`invalid`, `not_found`, `forbidden`, …), `detail` in a sentence; a request that isn't valid names the field first (`scopes.0: …`). */
689
+ export interface ErrorOut {
690
+ code: string;
691
+ detail: string;
692
+ }
693
+
607
694
  /** Something that can happen in a connected app, that an automation can start an agent on. */
608
695
  export interface EventTypeOut {
609
696
  name: string;
@@ -634,7 +721,7 @@ export interface FactAsk {
634
721
  export interface FactAutomation {
635
722
  id: string;
636
723
  name: string;
637
- kind: "schedule" | "webhook" | "event" | "platform";
724
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
638
725
  title: string;
639
726
  summary: string;
640
727
  schedule: string | null;
@@ -774,6 +861,12 @@ export interface FilesFileOut {
774
861
  updated_at: string;
775
862
  }
776
863
 
864
+ /** A conversation's first words: the person's (the agent answers them) or the agent's. */
865
+ export interface FirstWords {
866
+ text: string;
867
+ from?: "contact" | "agent";
868
+ }
869
+
777
870
  export interface FolderFileOut {
778
871
  path: string;
779
872
  size: number;
@@ -811,10 +904,6 @@ export interface FormField {
811
904
  value?: string | number | boolean | Array<string> | null;
812
905
  }
813
906
 
814
- export interface HTTPValidationError {
815
- detail?: Array<ValidationError>;
816
- }
817
-
818
907
  /** A change of who answers a conversation: to whom, why, who set it and when. */
819
908
  export interface HandoverOut {
820
909
  holder: "agent" | "person" | "nobody";
@@ -851,12 +940,16 @@ export interface HitOut {
851
940
  kind: string | null;
852
941
  tools: number | null;
853
942
  connected: string | null;
943
+ routes?: Array<RouteOut>;
944
+ route?: "composio" | "arcade" | "api" | null;
945
+ why?: string;
854
946
  }
855
947
 
856
- /** The owner says who answers a conversation now: the agent (given back), a person of the business (the agent paused there) or nobody (ignored), and why. */
948
+ /** A conversation changed: who answers it now, as the business says (the agent, given back; a person of the business, the agent paused there; or nobody, ignored), and why; or its title, which the person it is with may change too. */
857
949
  export interface HolderIn {
858
- holder: "agent" | "person" | "nobody";
950
+ holder?: "agent" | "person" | "nobody" | null;
859
951
  reason?: string;
952
+ title?: string | null;
860
953
  }
861
954
 
862
955
  /** The week, in the agent's time zone: each day's stretches, in order and apart; a day left out, or empty, is closed. */
@@ -870,6 +963,12 @@ export interface Hours {
870
963
  sun?: Array<Span>;
871
964
  }
872
965
 
966
+ /** One identity of a contact's, of a kind the business gives. */
967
+ export interface IdentityIn {
968
+ kind: "account" | "phone" | "email" | "instagram";
969
+ value: string;
970
+ }
971
+
873
972
  export interface Image {
874
973
  type: "image";
875
974
  url: string;
@@ -914,6 +1013,21 @@ export interface ItemOut {
914
1013
  title?: string | null;
915
1014
  read: boolean;
916
1015
  created_at: string;
1016
+ contact_id?: string | null;
1017
+ requests?: Array<RequestOut>;
1018
+ }
1019
+
1020
+ export interface KeyOut {
1021
+ id: string;
1022
+ kind: "secret" | "publishable";
1023
+ name: string;
1024
+ prefix: string;
1025
+ scopes: Array<"read" | "write" | "talk" | "admin">;
1026
+ agent_id: string | null;
1027
+ origins: Array<string>;
1028
+ created_at: string;
1029
+ last_used_at: string | null;
1030
+ revoked_at: string | null;
917
1031
  }
918
1032
 
919
1033
  export interface KindOut {
@@ -943,6 +1057,26 @@ export interface Listing {
943
1057
  action?: string | null;
944
1058
  }
945
1059
 
1060
+ export interface LostChannelOut {
1061
+ kind: string;
1062
+ name: string;
1063
+ }
1064
+
1065
+ /** A key as it is made: the only time `key` is shown. */
1066
+ export interface MadeKeyOut {
1067
+ id: string;
1068
+ kind: "secret" | "publishable";
1069
+ name: string;
1070
+ prefix: string;
1071
+ scopes: Array<"read" | "write" | "talk" | "admin">;
1072
+ agent_id: string | null;
1073
+ origins: Array<string>;
1074
+ created_at: string;
1075
+ last_used_at: string | null;
1076
+ revoked_at: string | null;
1077
+ key: string;
1078
+ }
1079
+
946
1080
  /** An agent made from the template, in one of the organizations it manages. */
947
1081
  export interface MadeOut {
948
1082
  org_id: string;
@@ -1005,11 +1139,17 @@ export interface MemoryOut {
1005
1139
  created_at: string;
1006
1140
  }
1007
1141
 
1008
- /** Words in a conversation, files of it (`POST /conversations/{id}/files` first) by id, or both; `wait` to be answered when the turn ends, with the agent's reply. */
1142
+ /** The contact merged into this one, by their id: theirs becomes this one's, and they go. */
1143
+ export interface MergeIn {
1144
+ from: string;
1145
+ }
1146
+
1147
+ /** Words in a conversation, files of it (`POST /conversations/{id}/files` first) by id, or both; `wait` to be answered when the turn ends, with the agent's reply. They are the person's a token speaks for, or the business's; the business's backend may say them as the conversation's contact (`from: "contact"`). The agent's words first are `sc.say`'s, or a new conversation's (`say`). */
1009
1148
  export interface MessageIn {
1010
1149
  text?: string;
1011
1150
  files?: Array<string>;
1012
1151
  wait?: boolean;
1152
+ from?: "contact" | null;
1013
1153
  }
1014
1154
 
1015
1155
  export interface MessageOut {
@@ -1027,6 +1167,8 @@ export interface MessageOut {
1027
1167
  voice?: FileRef | null;
1028
1168
  heard?: string | null;
1029
1169
  decision?: SchemasDecisionOut | null;
1170
+ proactive?: boolean;
1171
+ run_id?: string | null;
1030
1172
  created_at: string;
1031
1173
  }
1032
1174
 
@@ -1139,6 +1281,13 @@ export interface PreviewSlide {
1139
1281
  notes: string | null;
1140
1282
  }
1141
1283
 
1284
+ export interface PublishableKeyIn {
1285
+ kind: "publishable";
1286
+ name: string;
1287
+ agent_id: string;
1288
+ origins: Array<string>;
1289
+ }
1290
+
1142
1291
  /** A message as it was stored: its blocks as the model saw or said them (a file's bytes and a thinking block's signature left out), and what the model reported the reply cost. */
1143
1292
  export interface RawMessageOut {
1144
1293
  id: string;
@@ -1149,6 +1298,11 @@ export interface RawMessageOut {
1149
1298
  created_at: string;
1150
1299
  }
1151
1300
 
1301
+ /** How far the person it is with read a conversation: up to `until`, or all of it. */
1302
+ export interface ReadIn {
1303
+ until?: string | null;
1304
+ }
1305
+
1152
1306
  /** What was said, as stored, and how the turn stands: `running` (it hasn't ended yet: read the conversation later), `done`, `waiting` (on `waiting`) or `failed` (`error`); `replies`, what the agent said since; `waiting`, every call the conversation waits on (a yes the business gives may wait while the turn is done). */
1153
1307
  export interface ReplyOut {
1154
1308
  conversation_id: string;
@@ -1159,6 +1313,30 @@ export interface ReplyOut {
1159
1313
  error: TurnErrorOut | null;
1160
1314
  }
1161
1315
 
1316
+ /** A call a conversation waits on, as `approval.requested` tells it: its id is the `request` a decision names; `input`, what the agent called it with. */
1317
+ export interface RequestOut {
1318
+ id: string;
1319
+ action: string;
1320
+ kind: "ask" | "approve" | "tool";
1321
+ decides: "person" | "business" | null;
1322
+ schema?: Record<string, unknown> | null;
1323
+ input: Record<string, unknown> | null;
1324
+ }
1325
+
1326
+ /** The way the owner picks for an app over the platform's choice; null gives it back. */
1327
+ export interface RouteIn {
1328
+ provider: "composio" | "arcade" | "api" | null;
1329
+ }
1330
+
1331
+ /** One way to reach an app: its provider and its name there (none for its own API), how many tools it gives, whether it tells of events, and how a person authorizes it. */
1332
+ export interface RouteOut {
1333
+ provider: "composio" | "arcade" | "api";
1334
+ toolkit: string | null;
1335
+ tools: number | null;
1336
+ events: boolean;
1337
+ auth: "oauth" | "key" | "none" | null;
1338
+ }
1339
+
1162
1340
  export interface RowIn {
1163
1341
  values: Record<string, unknown>;
1164
1342
  }
@@ -1184,7 +1362,7 @@ export interface RunDetailOut {
1184
1362
  agent_id: string;
1185
1363
  automation: string;
1186
1364
  title: string;
1187
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
1365
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
1188
1366
  conversation_id: string | null;
1189
1367
  status: "running" | "waiting" | "done" | "failed" | "skipped";
1190
1368
  summary: string | null;
@@ -1196,6 +1374,8 @@ export interface RunDetailOut {
1196
1374
  tokens_out: number;
1197
1375
  opened: Array<string>;
1198
1376
  decision?: RunsDecisionOut | null;
1377
+ result?: unknown;
1378
+ contact_id?: string | null;
1199
1379
  steps: Array<RunStepOut>;
1200
1380
  }
1201
1381
 
@@ -1205,7 +1385,7 @@ export interface RunEntryOut {
1205
1385
  agent_id: string;
1206
1386
  automation: string;
1207
1387
  title: string;
1208
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
1388
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
1209
1389
  conversation_id: string | null;
1210
1390
  status: "running" | "waiting" | "done" | "failed" | "skipped";
1211
1391
  summary: string | null;
@@ -1217,16 +1397,25 @@ export interface RunEntryOut {
1217
1397
  tokens_out: number;
1218
1398
  opened: Array<string>;
1219
1399
  decision?: RunsDecisionOut | null;
1400
+ result?: unknown;
1401
+ contact_id?: string | null;
1220
1402
  kind?: "run";
1221
1403
  last_at: string;
1222
1404
  }
1223
1405
 
1406
+ /** A run started by hand: for a contact (their id or an identity) when it works for one, with what the automation declares (`inputs`; a webhook's body), waiting for its end. */
1407
+ export interface RunIn {
1408
+ contact?: string | ContactRefIn | null;
1409
+ inputs?: Record<string, unknown>;
1410
+ wait?: boolean;
1411
+ }
1412
+
1224
1413
  export interface RunOut {
1225
1414
  id: string;
1226
1415
  agent_id: string;
1227
1416
  automation: string;
1228
1417
  title: string;
1229
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
1418
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
1230
1419
  conversation_id: string | null;
1231
1420
  status: "running" | "waiting" | "done" | "failed" | "skipped";
1232
1421
  summary: string | null;
@@ -1238,6 +1427,8 @@ export interface RunOut {
1238
1427
  tokens_out: number;
1239
1428
  opened: Array<string>;
1240
1429
  decision?: RunsDecisionOut | null;
1430
+ result?: unknown;
1431
+ contact_id?: string | null;
1241
1432
  }
1242
1433
 
1243
1434
  export interface RunStepOut {
@@ -1280,6 +1471,12 @@ export interface SecretIn {
1280
1471
  hosts?: Array<string>;
1281
1472
  }
1282
1473
 
1474
+ export interface SecretKeyIn {
1475
+ kind: "secret";
1476
+ name: string;
1477
+ scopes: Array<"read" | "write" | "talk" | "admin">;
1478
+ }
1479
+
1283
1480
  export interface SecretOut {
1284
1481
  name: string;
1285
1482
  hosts: Array<string>;
@@ -1410,6 +1607,13 @@ export interface Table {
1410
1607
  rows: Array<Array<string>>;
1411
1608
  }
1412
1609
 
1610
+ /** A table's fields added or changed (by name) and dropped, and its title; what isn't named stays. */
1611
+ export interface TableChangeIn {
1612
+ fields?: Array<FieldDef>;
1613
+ drop?: Array<string>;
1614
+ title?: string | null;
1615
+ }
1616
+
1413
1617
  export interface TableIn {
1414
1618
  name: string;
1415
1619
  title: string;
@@ -1433,6 +1637,22 @@ export interface TablePiece {
1433
1637
  query: Rows;
1434
1638
  }
1435
1639
 
1640
+ export interface TableVerbsIn {
1641
+ can: Array<"find" | "add" | "update">;
1642
+ contact?: string | null;
1643
+ }
1644
+
1645
+ /** A contact subscribed to one of the agent's automations for contacts, as the agent's `schedule_task` subscribes the person it talks with: what it takes (`inputs`), and when, a cron line (`cron`, on `timezone`, the agent's when not given) or once (`at`). */
1646
+ export interface TaskIn {
1647
+ contact: string;
1648
+ automation: string;
1649
+ inputs?: Record<string, unknown>;
1650
+ title?: string | null;
1651
+ cron?: string | null;
1652
+ at?: string | null;
1653
+ timezone?: string | null;
1654
+ }
1655
+
1436
1656
  /** A contact's subscription: an instance of a definition (`automation`: the business's automation for contacts, by name; None for an instruction), what it gives it (`inputs`: an instruction's words are `inputs.instruction`), when (`schedule`, a cron line in `timezone`, or once at `next_run_at`), whether it is on, its contact, the conversation it runs about and its newest runs. It read as an automation before: those fields stay, deprecated. */
1437
1657
  export interface TaskOut {
1438
1658
  id: string;
@@ -1560,7 +1780,7 @@ export interface ToolSecretOut {
1560
1780
  export interface TriggerOut {
1561
1781
  id: string;
1562
1782
  name: string;
1563
- kind: "schedule" | "webhook" | "event" | "platform";
1783
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
1564
1784
  title: string;
1565
1785
  summary: string;
1566
1786
  schedule: string | null;
@@ -1580,7 +1800,7 @@ export interface TriggerPatchIn {
1580
1800
  }
1581
1801
 
1582
1802
  export interface TriggerView {
1583
- kind: "schedule" | "webhook" | "event" | "platform";
1803
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
1584
1804
  schedule: string | null;
1585
1805
  timezone: string | null;
1586
1806
  url: string | null;
@@ -1591,6 +1811,7 @@ export interface TriggerView {
1591
1811
  icon: string | null;
1592
1812
  decides?: boolean;
1593
1813
  channels?: Array<string>;
1814
+ after?: string | null;
1594
1815
  }
1595
1816
 
1596
1817
  export interface TurnErrorOut {
@@ -1627,14 +1848,6 @@ export interface UsedOut {
1627
1848
  unpriced: number;
1628
1849
  }
1629
1850
 
1630
- export interface ValidationError {
1631
- loc: Array<string | number>;
1632
- msg: string;
1633
- type: string;
1634
- input?: unknown;
1635
- ctx?: Record<string, unknown>;
1636
- }
1637
-
1638
1851
  /** How an agent talks on a call (VOICE.md). The defaults are the old product's, in Spanish: its ElevenLabs voice (Carolina, from Spain), up to ten minutes, a goodbye ends it. */
1639
1852
  export interface Voice {
1640
1853
  language?: string;
@@ -1669,6 +1882,7 @@ export interface WaitOut {
1669
1882
  action: string;
1670
1883
  kind: "ask" | "approve" | "tool";
1671
1884
  decides: "person" | "business" | null;
1885
+ schema?: Record<string, unknown> | null;
1672
1886
  }
1673
1887
 
1674
1888
  /** The agent the widget talks to, and the sites it may be loaded from. */