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

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 (99) hide show
  1. package/README.md +126 -21
  2. package/dist/AgentAbout.js +6 -2
  3. package/dist/AgentAbout.js.map +1 -1
  4. package/dist/AgentChat.d.ts +25 -3
  5. package/dist/AgentChat.js +302 -28
  6. package/dist/AgentChat.js.map +1 -1
  7. package/dist/AgentSpace.d.ts +25 -4
  8. package/dist/AgentSpace.js +55 -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/View.d.ts +48 -0
  14. package/dist/View.js +101 -0
  15. package/dist/View.js.map +1 -0
  16. package/dist/automation/marks.js +7 -3
  17. package/dist/automation/marks.js.map +1 -1
  18. package/dist/automation/messages.d.ts +4 -0
  19. package/dist/automation/messages.js +5 -1
  20. package/dist/automation/messages.js.map +1 -1
  21. package/dist/automation/when.js +8 -0
  22. package/dist/automation/when.js.map +1 -1
  23. package/dist/blocks.d.ts +83 -2
  24. package/dist/client.d.ts +23 -5
  25. package/dist/client.js +8 -2
  26. package/dist/client.js.map +1 -1
  27. package/dist/contract.d.ts +9 -4
  28. package/dist/es.d.ts +2 -0
  29. package/dist/es.js +34 -3
  30. package/dist/es.js.map +1 -1
  31. package/dist/frames.d.ts +7 -1
  32. package/dist/frames.js.map +1 -1
  33. package/dist/index.d.ts +14 -7
  34. package/dist/index.js +11 -4
  35. package/dist/kit/Agenda.d.ts +25 -0
  36. package/dist/kit/Agenda.js +119 -0
  37. package/dist/kit/Agenda.js.map +1 -0
  38. package/dist/kit/Combobox.js +1 -1
  39. package/dist/kit/DateField.js +1 -1
  40. package/dist/kit/Kanban.d.ts +17 -0
  41. package/dist/kit/Kanban.js +157 -0
  42. package/dist/kit/Kanban.js.map +1 -0
  43. package/dist/kit/TimeField.js +1 -1
  44. package/dist/kit/Timeline.d.ts +14 -0
  45. package/dist/kit/Timeline.js +71 -0
  46. package/dist/kit/Timeline.js.map +1 -0
  47. package/dist/kit/context.d.ts +1 -1
  48. package/dist/kit/context.js.map +1 -1
  49. package/dist/kit/messages.d.ts +22 -0
  50. package/dist/kit/messages.js +10 -0
  51. package/dist/kit/messages.js.map +1 -1
  52. package/dist/surface/Form.js +1 -1
  53. package/dist/surface/Placed.d.ts +20 -0
  54. package/dist/surface/Placed.js +70 -0
  55. package/dist/surface/Placed.js.map +1 -0
  56. package/dist/surface/Surface.d.ts +4 -2
  57. package/dist/surface/Surface.js +78 -2
  58. package/dist/surface/Surface.js.map +1 -1
  59. package/dist/surface/places.d.ts +16 -0
  60. package/dist/surface/places.js +15 -0
  61. package/dist/surface/places.js.map +1 -0
  62. package/dist/surface/scope.d.ts +17 -1
  63. package/dist/surface/scope.js +1 -0
  64. package/dist/surface/scope.js.map +1 -1
  65. package/dist/types.d.ts +23 -0
  66. package/dist/types.js.map +1 -1
  67. package/dist/useConversation.d.ts +2 -0
  68. package/dist/useConversation.js +16 -0
  69. package/dist/useConversation.js.map +1 -1
  70. package/dist/widget.js +17 -16
  71. package/package.json +1 -1
  72. package/src/AgentAbout.tsx +4 -0
  73. package/src/AgentChat.tsx +417 -34
  74. package/src/AgentSpace.tsx +106 -14
  75. package/src/Threads.tsx +218 -0
  76. package/src/View.tsx +117 -0
  77. package/src/automation/marks.tsx +7 -0
  78. package/src/automation/messages.ts +8 -0
  79. package/src/automation/when.ts +4 -0
  80. package/src/blocks.ts +100 -2
  81. package/src/client.ts +42 -10
  82. package/src/contract.ts +404 -29
  83. package/src/es.ts +30 -0
  84. package/src/frames.ts +3 -1
  85. package/src/index.ts +36 -3
  86. package/src/kit/Agenda.tsx +161 -0
  87. package/src/kit/Kanban.tsx +182 -0
  88. package/src/kit/Timeline.tsx +58 -0
  89. package/src/kit/context.tsx +45 -1
  90. package/src/kit/messages.ts +31 -0
  91. package/src/styles.css +825 -66
  92. package/src/surface/Placed.tsx +98 -0
  93. package/src/surface/Surface.tsx +92 -1
  94. package/src/surface/places.ts +19 -0
  95. package/src/surface/scope.ts +24 -1
  96. package/src/types.ts +24 -0
  97. package/src/useConversation.ts +10 -0
  98. package/src/widget/element.tsx +54 -7
  99. package/src/widget/widget.css +13 -0
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;
@@ -238,6 +247,20 @@ export interface AutomationOut {
238
247
  last_run: RunOut | null;
239
248
  }
240
249
 
250
+ /** What a host block is for, in a sentence the agent reads, and the JSON Schema of its props: an object's. */
251
+ export interface BlockIn {
252
+ description: string;
253
+ schema: Record<string, unknown>;
254
+ }
255
+
256
+ export interface BlockOut {
257
+ name: string;
258
+ description: string;
259
+ schema: Record<string, unknown>;
260
+ created_at: string;
261
+ updated_at: string;
262
+ }
263
+
241
264
  /** What the automation moves: its table's rows counted by the value of one field. */
242
265
  export interface Board {
243
266
  table: string;
@@ -246,6 +269,38 @@ export interface Board {
246
269
  counts: Array<Count>;
247
270
  }
248
271
 
272
+ /** Cards in columns, a column per stage. With `action`, the person may move a card to another column, which sends `action` with `{"card": id, "column": id}`: the agent then does what moving it means. */
273
+ export interface BoardBlock {
274
+ type: "board";
275
+ columns: Array<BoardColumn>;
276
+ action?: string | null;
277
+ }
278
+
279
+ /** One card of a board. */
280
+ export interface BoardCard {
281
+ id: string;
282
+ title: string;
283
+ subtitle?: string | null;
284
+ meta?: string | null;
285
+ }
286
+
287
+ export interface BoardColumn {
288
+ id: string;
289
+ title: string;
290
+ cards: Array<BoardCard>;
291
+ }
292
+
293
+ /** The rows as cards in columns, a column per option of a choice (`column`). */
294
+ export interface BoardPiece {
295
+ type: "board";
296
+ title: string;
297
+ item: string;
298
+ column: string;
299
+ subtitle?: string | null;
300
+ meta?: string | null;
301
+ query: Rows;
302
+ }
303
+
249
304
  /** One thing the person can do: pressing it sends `action`, or, with `url`, opens the page (a payment, a document). Two buttons that do different things carry different action names: the name is the whole of what comes back. */
250
305
  export interface Button {
251
306
  type: "button";
@@ -255,6 +310,38 @@ export interface Button {
255
310
  tone?: "primary" | "neutral" | "danger";
256
311
  }
257
312
 
313
+ /** A day's events, or a week's from `start`, at their hours. With `action`, pressing one sends it with `{"event": id}`; one with `url` opens its page instead. */
314
+ export interface Calendar {
315
+ type: "calendar";
316
+ span?: "day" | "week";
317
+ start: string;
318
+ events: Array<CalendarEvent>;
319
+ action?: string | null;
320
+ }
321
+
322
+ /** One thing on a calendar: its title at its time (a day alone: all of it), until `end`, with a line of detail (where, with whom) and a page to open (`url`). */
323
+ export interface CalendarEvent {
324
+ id: string;
325
+ title: string;
326
+ start: string;
327
+ end?: string | null;
328
+ detail?: string | null;
329
+ url?: string | null;
330
+ }
331
+
332
+ /** The rows whose date (`at`) falls today (`day`) or this week, at their hours: each called by `item`, until `end`, with `detail` under it and `link` (an https address) to open. */
333
+ export interface CalendarPiece {
334
+ type: "calendar";
335
+ title: string;
336
+ span?: "day" | "week";
337
+ item: string;
338
+ at: string;
339
+ end?: string | null;
340
+ detail?: string | null;
341
+ link?: string | null;
342
+ query: Scope;
343
+ }
344
+
258
345
  /** The call a conversation is (VOICE.md): the owner's in the browser or a phone call, when the worker took it and when it ended, why and how long. */
259
346
  export interface CallGlance {
260
347
  id: string;
@@ -281,7 +368,7 @@ export interface Card {
281
368
  title?: string | null;
282
369
  subtitle?: string | null;
283
370
  image?: string | null;
284
- children: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | AutomationBlock | FileBlock>;
371
+ children: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | Calendar | Timeline | BoardBlock | AutomationBlock | FileBlock | HostBlock>;
285
372
  }
286
373
 
287
374
  /** A page of the apps a search finds. */
@@ -365,6 +452,8 @@ export interface ConnectIn {
365
452
  provider?: "arcade" | "composio" | null;
366
453
  toolkit: string;
367
454
  return_url?: string;
455
+ events?: boolean;
456
+ actions?: Array<string>;
368
457
  }
369
458
 
370
459
  export interface ConnectedOut {
@@ -382,6 +471,7 @@ export interface ConnectionOut {
382
471
  created_at: string;
383
472
  url?: string | null;
384
473
  icon?: string | null;
474
+ why?: string | null;
385
475
  }
386
476
 
387
477
  /** 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 +500,43 @@ export interface ContactGlance {
410
500
  muted?: boolean;
411
501
  }
412
502
 
503
+ /** 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. */
504
+ export interface ContactIn {
505
+ name?: string | null;
506
+ account?: string | null;
507
+ phone?: string | null;
508
+ email?: string | null;
509
+ instagram?: string | null;
510
+ fields?: Record<string, unknown>;
511
+ }
512
+
413
513
  export interface ContactOut {
414
514
  id: string;
415
515
  name: string | null;
416
516
  muted: boolean;
417
517
  opted_out: boolean;
418
518
  created_at: string;
519
+ phone?: string | null;
520
+ email?: string | null;
521
+ instagram?: string | null;
522
+ account?: string | null;
523
+ fields?: Record<string, unknown>;
524
+ claims?: Record<string, string>;
419
525
  }
420
526
 
421
- /** The owner marks a contact the agent doesn't answer, or takes the mark away. */
527
+ /** 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
528
  export interface ContactPatchIn {
423
- muted: boolean;
529
+ muted?: boolean | null;
530
+ add?: Array<IdentityIn>;
531
+ remove?: Array<IdentityIn>;
532
+ }
533
+
534
+ /** A contact by one of their identities, as `ContactIn` takes them: the first given finds them. */
535
+ export interface ContactRefIn {
536
+ account?: string | null;
537
+ phone?: string | null;
538
+ email?: string | null;
539
+ instagram?: string | null;
424
540
  }
425
541
 
426
542
  export interface ConversationDetailOut {
@@ -441,6 +557,9 @@ export interface ConversationDetailOut {
441
557
  last_inbound_at?: string | null;
442
558
  call?: CallGlance | null;
443
559
  person?: PersonOut | null;
560
+ unread?: number;
561
+ waiting_on_person?: boolean;
562
+ read_until?: string | null;
444
563
  messages: Array<MessageOut>;
445
564
  handovers?: Array<HandoverOut>;
446
565
  }
@@ -458,6 +577,9 @@ export interface ConversationFileOut {
458
577
  export interface ConversationIn {
459
578
  test?: boolean;
460
579
  about?: string | null;
580
+ contact?: string | ContactRefIn | null;
581
+ title?: string | null;
582
+ say?: FirstWords | null;
461
583
  }
462
584
 
463
585
  export interface ConversationOut {
@@ -478,6 +600,9 @@ export interface ConversationOut {
478
600
  last_inbound_at?: string | null;
479
601
  call?: CallGlance | null;
480
602
  person?: PersonOut | null;
603
+ unread?: number;
604
+ waiting_on_person?: boolean;
605
+ read_until?: string | null;
481
606
  }
482
607
 
483
608
  /** A conversation for its technical view: how its last turn ended, and every message raw. */
@@ -499,6 +624,9 @@ export interface ConversationRawOut {
499
624
  last_inbound_at?: string | null;
500
625
  call?: CallGlance | null;
501
626
  person?: PersonOut | null;
627
+ unread?: number;
628
+ waiting_on_person?: boolean;
629
+ read_until?: string | null;
502
630
  outcome: "done" | "failed" | null;
503
631
  error: string | null;
504
632
  last_at: string;
@@ -510,6 +638,36 @@ export interface Count {
510
638
  count: number;
511
639
  }
512
640
 
641
+ export interface CustomerOut {
642
+ org: OrgOut;
643
+ conversations: number;
644
+ cost: number;
645
+ lost: Array<LostChannelOut>;
646
+ failed: number;
647
+ approvals: number;
648
+ }
649
+
650
+ export interface CustomersOut {
651
+ from: string;
652
+ to: string;
653
+ conversations: number;
654
+ cost: number;
655
+ customers: Array<CustomerOut>;
656
+ }
657
+
658
+ /** A dashboard's name, title or blocks changed: only what is sent. */
659
+ export interface DashboardChange {
660
+ name?: string | null;
661
+ title?: string | null;
662
+ blocks?: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece> | null;
663
+ }
664
+
665
+ export interface DashboardIn {
666
+ name: string;
667
+ title: string;
668
+ blocks: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece>;
669
+ }
670
+
513
671
  export interface DashboardOut {
514
672
  id: string;
515
673
  name: string;
@@ -523,14 +681,15 @@ export interface DashboardOut {
523
681
  export interface DashboardView {
524
682
  id: string;
525
683
  title: string;
526
- blocks: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | AutomationBlock | FileBlock>;
684
+ blocks: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | Calendar | Timeline | BoardBlock | AutomationBlock | FileBlock | HostBlock>;
527
685
  rendered_at: string;
528
686
  }
529
687
 
530
- /** The business's yes (`approve`) or no on the call a conversation waits on for it. */
688
+ /** 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
689
  export interface DecisionIn {
532
690
  request: string;
533
691
  approve: boolean;
692
+ input?: Record<string, unknown> | null;
534
693
  }
535
694
 
536
695
  /** 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 +714,7 @@ export interface DefinitionOut {
555
714
  name: string;
556
715
  title: string;
557
716
  audience: "business" | "contact";
558
- kind: "schedule" | "webhook" | "event" | "platform" | "instruction";
717
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after" | "instruction";
559
718
  inputs: Record<string, string>;
560
719
  created_at: string;
561
720
  }
@@ -604,6 +763,12 @@ export interface Entry {
604
763
  image?: string | null;
605
764
  }
606
765
 
766
+ /** 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: …`). */
767
+ export interface ErrorOut {
768
+ code: string;
769
+ detail: string;
770
+ }
771
+
607
772
  /** Something that can happen in a connected app, that an automation can start an agent on. */
608
773
  export interface EventTypeOut {
609
774
  name: string;
@@ -634,7 +799,7 @@ export interface FactAsk {
634
799
  export interface FactAutomation {
635
800
  id: string;
636
801
  name: string;
637
- kind: "schedule" | "webhook" | "event" | "platform";
802
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
638
803
  title: string;
639
804
  summary: string;
640
805
  schedule: string | null;
@@ -774,6 +939,12 @@ export interface FilesFileOut {
774
939
  updated_at: string;
775
940
  }
776
941
 
942
+ /** A conversation's first words: the person's (the agent answers them) or the agent's. */
943
+ export interface FirstWords {
944
+ text: string;
945
+ from?: "contact" | "agent";
946
+ }
947
+
777
948
  export interface FolderFileOut {
778
949
  path: string;
779
950
  size: number;
@@ -811,10 +982,6 @@ export interface FormField {
811
982
  value?: string | number | boolean | Array<string> | null;
812
983
  }
813
984
 
814
- export interface HTTPValidationError {
815
- detail?: Array<ValidationError>;
816
- }
817
-
818
985
  /** A change of who answers a conversation: to whom, why, who set it and when. */
819
986
  export interface HandoverOut {
820
987
  holder: "agent" | "person" | "nobody";
@@ -851,12 +1018,34 @@ export interface HitOut {
851
1018
  kind: string | null;
852
1019
  tools: number | null;
853
1020
  connected: string | null;
1021
+ routes?: Array<RouteOut>;
1022
+ route?: "composio" | "arcade" | "api" | null;
1023
+ why?: string;
854
1024
  }
855
1025
 
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. */
1026
+ /** 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
1027
  export interface HolderIn {
858
- holder: "agent" | "person" | "nobody";
1028
+ holder?: "agent" | "person" | "nobody" | null;
859
1029
  reason?: string;
1030
+ title?: string | null;
1031
+ }
1032
+
1033
+ /** One of the host's own blocks, by the name it declared: `props` as its schema says (the API checks them against it), and `text`, the same in words, which a page that doesn't draw it shows instead, as a channel does. */
1034
+ export interface HostBlock {
1035
+ type: "host";
1036
+ name: string;
1037
+ props: Record<string, unknown>;
1038
+ text: string;
1039
+ }
1040
+
1041
+ /** One of the host's own blocks: its `props` as given; with a rows `query`, one block per row, each prop of `fields` taken from that row's field. `text`: the same in words. */
1042
+ export interface HostPiece {
1043
+ type: "host";
1044
+ name: string;
1045
+ text: string;
1046
+ props?: Record<string, unknown>;
1047
+ fields?: Record<string, string>;
1048
+ query?: Rows | null;
860
1049
  }
861
1050
 
862
1051
  /** 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 +1059,12 @@ export interface Hours {
870
1059
  sun?: Array<Span>;
871
1060
  }
872
1061
 
1062
+ /** One identity of a contact's, of a kind the business gives. */
1063
+ export interface IdentityIn {
1064
+ kind: "account" | "phone" | "email" | "instagram";
1065
+ value: string;
1066
+ }
1067
+
873
1068
  export interface Image {
874
1069
  type: "image";
875
1070
  url: string;
@@ -914,6 +1109,21 @@ export interface ItemOut {
914
1109
  title?: string | null;
915
1110
  read: boolean;
916
1111
  created_at: string;
1112
+ contact_id?: string | null;
1113
+ requests?: Array<RequestOut>;
1114
+ }
1115
+
1116
+ export interface KeyOut {
1117
+ id: string;
1118
+ kind: "secret" | "publishable";
1119
+ name: string;
1120
+ prefix: string;
1121
+ scopes: Array<"read" | "write" | "talk" | "admin">;
1122
+ agent_id: string | null;
1123
+ origins: Array<string>;
1124
+ created_at: string;
1125
+ last_used_at: string | null;
1126
+ revoked_at: string | null;
917
1127
  }
918
1128
 
919
1129
  export interface KindOut {
@@ -943,6 +1153,26 @@ export interface Listing {
943
1153
  action?: string | null;
944
1154
  }
945
1155
 
1156
+ export interface LostChannelOut {
1157
+ kind: string;
1158
+ name: string;
1159
+ }
1160
+
1161
+ /** A key as it is made: the only time `key` is shown. */
1162
+ export interface MadeKeyOut {
1163
+ id: string;
1164
+ kind: "secret" | "publishable";
1165
+ name: string;
1166
+ prefix: string;
1167
+ scopes: Array<"read" | "write" | "talk" | "admin">;
1168
+ agent_id: string | null;
1169
+ origins: Array<string>;
1170
+ created_at: string;
1171
+ last_used_at: string | null;
1172
+ revoked_at: string | null;
1173
+ key: string;
1174
+ }
1175
+
946
1176
  /** An agent made from the template, in one of the organizations it manages. */
947
1177
  export interface MadeOut {
948
1178
  org_id: string;
@@ -1005,11 +1235,17 @@ export interface MemoryOut {
1005
1235
  created_at: string;
1006
1236
  }
1007
1237
 
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. */
1238
+ /** The contact merged into this one, by their id: theirs becomes this one's, and they go. */
1239
+ export interface MergeIn {
1240
+ from: string;
1241
+ }
1242
+
1243
+ /** 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
1244
  export interface MessageIn {
1010
1245
  text?: string;
1011
1246
  files?: Array<string>;
1012
1247
  wait?: boolean;
1248
+ from?: "contact" | null;
1013
1249
  }
1014
1250
 
1015
1251
  export interface MessageOut {
@@ -1027,6 +1263,8 @@ export interface MessageOut {
1027
1263
  voice?: FileRef | null;
1028
1264
  heard?: string | null;
1029
1265
  decision?: SchemasDecisionOut | null;
1266
+ proactive?: boolean;
1267
+ run_id?: string | null;
1030
1268
  created_at: string;
1031
1269
  }
1032
1270
 
@@ -1139,6 +1377,13 @@ export interface PreviewSlide {
1139
1377
  notes: string | null;
1140
1378
  }
1141
1379
 
1380
+ export interface PublishableKeyIn {
1381
+ kind: "publishable";
1382
+ name: string;
1383
+ agent_id: string;
1384
+ origins: Array<string>;
1385
+ }
1386
+
1142
1387
  /** 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
1388
  export interface RawMessageOut {
1144
1389
  id: string;
@@ -1149,6 +1394,11 @@ export interface RawMessageOut {
1149
1394
  created_at: string;
1150
1395
  }
1151
1396
 
1397
+ /** How far the person it is with read a conversation: up to `until`, or all of it. */
1398
+ export interface ReadIn {
1399
+ until?: string | null;
1400
+ }
1401
+
1152
1402
  /** 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
1403
  export interface ReplyOut {
1154
1404
  conversation_id: string;
@@ -1159,6 +1409,30 @@ export interface ReplyOut {
1159
1409
  error: TurnErrorOut | null;
1160
1410
  }
1161
1411
 
1412
+ /** 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. */
1413
+ export interface RequestOut {
1414
+ id: string;
1415
+ action: string;
1416
+ kind: "ask" | "approve" | "tool";
1417
+ decides: "person" | "business" | null;
1418
+ schema?: Record<string, unknown> | null;
1419
+ input: Record<string, unknown> | null;
1420
+ }
1421
+
1422
+ /** The way the owner picks for an app over the platform's choice; null gives it back. */
1423
+ export interface RouteIn {
1424
+ provider: "composio" | "arcade" | "api" | null;
1425
+ }
1426
+
1427
+ /** 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. */
1428
+ export interface RouteOut {
1429
+ provider: "composio" | "arcade" | "api";
1430
+ toolkit: string | null;
1431
+ tools: number | null;
1432
+ events: boolean;
1433
+ auth: "oauth" | "key" | "none" | null;
1434
+ }
1435
+
1162
1436
  export interface RowIn {
1163
1437
  values: Record<string, unknown>;
1164
1438
  }
@@ -1184,7 +1458,7 @@ export interface RunDetailOut {
1184
1458
  agent_id: string;
1185
1459
  automation: string;
1186
1460
  title: string;
1187
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
1461
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
1188
1462
  conversation_id: string | null;
1189
1463
  status: "running" | "waiting" | "done" | "failed" | "skipped";
1190
1464
  summary: string | null;
@@ -1196,6 +1470,8 @@ export interface RunDetailOut {
1196
1470
  tokens_out: number;
1197
1471
  opened: Array<string>;
1198
1472
  decision?: RunsDecisionOut | null;
1473
+ result?: unknown;
1474
+ contact_id?: string | null;
1199
1475
  steps: Array<RunStepOut>;
1200
1476
  }
1201
1477
 
@@ -1205,7 +1481,7 @@ export interface RunEntryOut {
1205
1481
  agent_id: string;
1206
1482
  automation: string;
1207
1483
  title: string;
1208
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
1484
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
1209
1485
  conversation_id: string | null;
1210
1486
  status: "running" | "waiting" | "done" | "failed" | "skipped";
1211
1487
  summary: string | null;
@@ -1217,16 +1493,25 @@ export interface RunEntryOut {
1217
1493
  tokens_out: number;
1218
1494
  opened: Array<string>;
1219
1495
  decision?: RunsDecisionOut | null;
1496
+ result?: unknown;
1497
+ contact_id?: string | null;
1220
1498
  kind?: "run";
1221
1499
  last_at: string;
1222
1500
  }
1223
1501
 
1502
+ /** 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. */
1503
+ export interface RunIn {
1504
+ contact?: string | ContactRefIn | null;
1505
+ inputs?: Record<string, unknown>;
1506
+ wait?: boolean;
1507
+ }
1508
+
1224
1509
  export interface RunOut {
1225
1510
  id: string;
1226
1511
  agent_id: string;
1227
1512
  automation: string;
1228
1513
  title: string;
1229
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
1514
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
1230
1515
  conversation_id: string | null;
1231
1516
  status: "running" | "waiting" | "done" | "failed" | "skipped";
1232
1517
  summary: string | null;
@@ -1238,6 +1523,8 @@ export interface RunOut {
1238
1523
  tokens_out: number;
1239
1524
  opened: Array<string>;
1240
1525
  decision?: RunsDecisionOut | null;
1526
+ result?: unknown;
1527
+ contact_id?: string | null;
1241
1528
  }
1242
1529
 
1243
1530
  export interface RunStepOut {
@@ -1275,11 +1562,22 @@ export interface SchemasDecisionOut {
1275
1562
  run_id: string | null;
1276
1563
  }
1277
1564
 
1565
+ export interface Scope {
1566
+ table: string;
1567
+ where?: Array<Where>;
1568
+ }
1569
+
1278
1570
  export interface SecretIn {
1279
1571
  value: string;
1280
1572
  hosts?: Array<string>;
1281
1573
  }
1282
1574
 
1575
+ export interface SecretKeyIn {
1576
+ kind: "secret";
1577
+ name: string;
1578
+ scopes: Array<"read" | "write" | "talk" | "admin">;
1579
+ }
1580
+
1283
1581
  export interface SecretOut {
1284
1582
  name: string;
1285
1583
  hosts: Array<string>;
@@ -1351,7 +1649,7 @@ export interface Span {
1351
1649
  export interface Stack {
1352
1650
  type: "stack";
1353
1651
  direction?: "column" | "row";
1354
- children: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | AutomationBlock | FileBlock>;
1652
+ children: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | Calendar | Timeline | BoardBlock | AutomationBlock | FileBlock | HostBlock>;
1355
1653
  }
1356
1654
 
1357
1655
  /** One number that matters, under its label, with a line of context (a change, a goal). */
@@ -1410,6 +1708,13 @@ export interface Table {
1410
1708
  rows: Array<Array<string>>;
1411
1709
  }
1412
1710
 
1711
+ /** A table's fields added or changed (by name) and dropped, and its title; what isn't named stays. */
1712
+ export interface TableChangeIn {
1713
+ fields?: Array<FieldDef>;
1714
+ drop?: Array<string>;
1715
+ title?: string | null;
1716
+ }
1717
+
1413
1718
  export interface TableIn {
1414
1719
  name: string;
1415
1720
  title: string;
@@ -1433,6 +1738,22 @@ export interface TablePiece {
1433
1738
  query: Rows;
1434
1739
  }
1435
1740
 
1741
+ export interface TableVerbsIn {
1742
+ can: Array<"find" | "add" | "update">;
1743
+ contact?: string | null;
1744
+ }
1745
+
1746
+ /** 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`). */
1747
+ export interface TaskIn {
1748
+ contact: string;
1749
+ automation: string;
1750
+ inputs?: Record<string, unknown>;
1751
+ title?: string | null;
1752
+ cron?: string | null;
1753
+ at?: string | null;
1754
+ timezone?: string | null;
1755
+ }
1756
+
1436
1757
  /** 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
1758
  export interface TaskOut {
1438
1759
  id: string;
@@ -1509,6 +1830,33 @@ export interface TextPreview {
1509
1830
  truncated: boolean;
1510
1831
  }
1511
1832
 
1833
+ /** Dated things, one under another, the newest first. */
1834
+ export interface Timeline {
1835
+ type: "timeline";
1836
+ items: Array<TimelineItem>;
1837
+ }
1838
+
1839
+ /** One thing on a timeline: what happened (or will) and when, a line about it, and where it stands: `status` in a word, `tone` its mark. */
1840
+ export interface TimelineItem {
1841
+ id?: string | null;
1842
+ at: string;
1843
+ title: string;
1844
+ text?: string | null;
1845
+ status?: string | null;
1846
+ tone?: "info" | "success" | "warning" | "danger" | null;
1847
+ }
1848
+
1849
+ /** The rows by a date (`at`), the newest first: each called by `item`, with `text` under it and `status`, where it stands, in a word. */
1850
+ export interface TimelinePiece {
1851
+ type: "timeline";
1852
+ title: string;
1853
+ item: string;
1854
+ at: string;
1855
+ text?: string | null;
1856
+ status?: string | null;
1857
+ query: Rows;
1858
+ }
1859
+
1512
1860
  export interface TokenIn {
1513
1861
  agents: Array<string>;
1514
1862
  external_id: string;
@@ -1560,7 +1908,7 @@ export interface ToolSecretOut {
1560
1908
  export interface TriggerOut {
1561
1909
  id: string;
1562
1910
  name: string;
1563
- kind: "schedule" | "webhook" | "event" | "platform";
1911
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
1564
1912
  title: string;
1565
1913
  summary: string;
1566
1914
  schedule: string | null;
@@ -1580,7 +1928,7 @@ export interface TriggerPatchIn {
1580
1928
  }
1581
1929
 
1582
1930
  export interface TriggerView {
1583
- kind: "schedule" | "webhook" | "event" | "platform";
1931
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
1584
1932
  schedule: string | null;
1585
1933
  timezone: string | null;
1586
1934
  url: string | null;
@@ -1591,6 +1939,7 @@ export interface TriggerView {
1591
1939
  icon: string | null;
1592
1940
  decides?: boolean;
1593
1941
  channels?: Array<string>;
1942
+ after?: string | null;
1594
1943
  }
1595
1944
 
1596
1945
  export interface TurnErrorOut {
@@ -1627,12 +1976,37 @@ export interface UsedOut {
1627
1976
  unpriced: number;
1628
1977
  }
1629
1978
 
1630
- export interface ValidationError {
1631
- loc: Array<string | number>;
1632
- msg: string;
1633
- type: string;
1634
- input?: unknown;
1635
- ctx?: Record<string, unknown>;
1979
+ /** A view's name, title or blocks changed: only what is sent. */
1980
+ export interface ViewChange {
1981
+ name?: string | null;
1982
+ title?: string | null;
1983
+ blocks?: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece | CalendarPiece | TimelinePiece | BoardPiece | HostPiece> | null;
1984
+ }
1985
+
1986
+ export interface ViewIn {
1987
+ name: string;
1988
+ title: string;
1989
+ blocks: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece | CalendarPiece | TimelinePiece | BoardPiece | HostPiece>;
1990
+ }
1991
+
1992
+ export interface ViewOut {
1993
+ id: string;
1994
+ agent_id: string;
1995
+ name: string;
1996
+ title: string;
1997
+ blocks: Array<StatPiece | ChartPiece | TablePiece | ListPiece | NotePiece | CalendarPiece | TimelinePiece | BoardPiece | HostPiece>;
1998
+ created_at: string;
1999
+ updated_at: string;
2000
+ }
2001
+
2002
+ /** A view rendered for one contact: its blocks as the kit draws them, filled from the rows now, and `text`, the same in words (what a page that can't draw them shows). */
2003
+ export interface ViewRendered {
2004
+ name: string;
2005
+ title: string;
2006
+ contact_id: string;
2007
+ blocks: Array<Card | Stack | Divider | Text | Fields | Table | Listing | Stat | Chart | Note | Image | Button | Choice | Form | Calendar | Timeline | BoardBlock | AutomationBlock | FileBlock | HostBlock>;
2008
+ text: string;
2009
+ rendered_at: string;
1636
2010
  }
1637
2011
 
1638
2012
  /** 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. */
@@ -1669,6 +2043,7 @@ export interface WaitOut {
1669
2043
  action: string;
1670
2044
  kind: "ask" | "approve" | "tool";
1671
2045
  decides: "person" | "business" | null;
2046
+ schema?: Record<string, unknown> | null;
1672
2047
  }
1673
2048
 
1674
2049
  /** The agent the widget talks to, and the sites it may be loaded from. */
@@ -1705,10 +2080,10 @@ export interface WhatsAppIn {
1705
2080
  mode?: "cloud_api" | "coexistence";
1706
2081
  }
1707
2082
 
1708
- /** One filter: the field compared with `value` by `op`. `last_days` keeps the rows whose date falls in the last `value` days; `contains` looks for words in a text. */
2083
+ /** One filter: the field compared with `value` by `op`. `last_days` keeps the rows whose date falls in the last `value` days, `next_days` those in the next `value` days (from now on); `contains` looks for words in a text. */
1709
2084
  export interface Where {
1710
2085
  field: string;
1711
- op?: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains" | "last_days";
2086
+ op?: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains" | "last_days" | "next_days";
1712
2087
  value: string | number | boolean;
1713
2088
  }
1714
2089